aboutsummaryrefslogtreecommitdiff
path: root/process.go
diff options
context:
space:
mode:
Diffstat (limited to 'process.go')
-rw-r--r--process.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/process.go b/process.go
index c78daa3..76e175d 100644
--- a/process.go
+++ b/process.go
@@ -33,8 +33,8 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
}
cc.setState(csInit)
- if cmd.SerializeVer != latestSerializeVer {
- cc.Log("<-", "invalid serializeVer")
+ if cmd.SerializeVer <= latestSerializeVer {
+ cc.Log("<-", "invalid serializeVer", cmd.SerializeVer)
ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.UnsupportedVer})
select {
@@ -46,8 +46,8 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
return
}
- if cmd.MaxProtoVer < latestProtoVer {
- cc.Log("<-", "invalid protoVer")
+ if cmd.MaxProtoVer <= latestProtoVer {
+ cc.Log("<-", "invalid protoVer", cmd.MaxProtoVer)
ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.UnsupportedVer})
select {
@@ -445,6 +445,7 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
done := make(chan struct{})
go func(done chan<- struct{}) {
+
result, isCmd := onChatMsg(cc, cmd)
if !isCmd {
forward(pkt)
@@ -452,7 +453,7 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
cc.SendChatMsg(result)
}
- close(done)
+ close(done)
}(done)
go func(done <-chan struct{}) {