KeepAlive error handling

This commit is contained in:
Tnze
2021-12-23 01:26:55 +08:00
parent 260fc64701
commit 0fc4453bf6
2 changed files with 13 additions and 2 deletions

View File

@ -38,8 +38,13 @@ type PacketHandler struct {
type packetHandlerFunc func(packet Packet757) error
func (p *Player) Add(ph PacketHandler) {
if p.handlers == nil {
p.handlers = make(map[int32][]packetHandlerFunc)
}
p.handlers[ph.ID] = append(p.handlers[ph.ID], ph.F)
}
func (p *Player) PutErr(err error) {
// TODO: handle errors
}