mirror of
https://github.com/CPunch/gopenfusion.git
synced 2025-10-27 19:30:07 +00:00
protocol/packet: switch away from allocation
- Packet struct is small enough that allocation for it is really unnecessary, and can be passed around by value fairly easily
This commit is contained in:
@@ -18,7 +18,7 @@ const (
|
||||
)
|
||||
|
||||
type PeerHandler interface {
|
||||
HandlePacket(client *Peer, typeID uint32, pkt *protocol.Packet)
|
||||
HandlePacket(client *Peer, typeID uint32, pkt protocol.Packet)
|
||||
Connect(client *Peer)
|
||||
Disconnect(client *Peer)
|
||||
}
|
||||
@@ -116,8 +116,6 @@ func (client *Peer) ClientHandler() {
|
||||
panic(fmt.Errorf("[FATAL] failed to read packet body! %v", err))
|
||||
}
|
||||
|
||||
fmt.Printf("%#v", buf)
|
||||
|
||||
// decrypt
|
||||
protocol.DecryptData(buf.Bytes(), client.E_key)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user