Skip to content

Commit 411bf02

Browse files
committed
add log info
1 parent cffe95c commit 411bf02

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

server/binary/msg.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ func BuildRegularMsgFrame(t MsgType, seq int, payload []byte, hmac hash.Hash) []
136136
}
137137

138138
// ParseMsg parse binary data to Msg struct
139-
func UnmarshalMsg(hmac hash.Hash, data []byte) (Msg, error) {
140-
data, ok := auth.ValidateMsgHMAC(hmac, data)
139+
func UnmarshalMsg(hmac hash.Hash, alldata []byte) (Msg, error) {
140+
data, ok := auth.ValidateMsgHMAC(hmac, alldata)
141141
if !ok {
142-
return nil, xerrors.Errorf("invalid msg")
142+
return nil, xerrors.Errorf("invalid msg hmac (len=%v)", len(alldata))
143143
}
144144

145145
if len(data) < 1 {

server/game/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func (c *Client) DetachPeer(p *Peer) {
351351
if c.peer != p {
352352
return // すでにdetach済み
353353
}
354-
c.logger.Infof("detach peer: %v peer=%p", c.Id, p)
354+
c.logger.Infof("detach peer: %v peer=%p lastMsg=%v", c.Id, p, c.msgSeqNum)
355355
c.peer.Detached()
356356
go c.drainMsg(c.peer.MsgCh())
357357

0 commit comments

Comments
 (0)