diff options
author | Edzell <derz@elidragon.com> | 2022-05-14 18:30:55 +0200 |
---|---|---|
committer | Edzell <derz@elidragon.com> | 2022-05-14 18:30:55 +0200 |
commit | b0229590053e8dde1dd5f39458749258084f9cb3 (patch) | |
tree | 2b466137a0535302e1cfaaf00f0596da2c6fadc4 | |
parent | c3fe13d0963b73a813e3bbe508de9a274c704fc0 (diff) |
fix variable naming and client compatability issues
-rw-r--r-- | content.go | 8 | ||||
-rw-r--r-- | list.go | 4 | ||||
-rw-r--r-- | process.go | 10 | ||||
-rw-r--r-- | proxy.go | 4 | ||||
-rw-r--r-- | server_conn.go | 6 |
5 files changed, 16 insertions, 16 deletions
@@ -118,9 +118,9 @@ func handleContent(cc *contentConn) { for cc.state() == csCreated { cc.SendCmd(&mt.ToSrvInit{ - SerializeVer: latestSerializeVer, - MinProtoVer: latestProtoVer, - MaxProtoVer: latestProtoVer, + SerializeVer: serializeVer, + MinProtoVer: protoVer, + MaxProtoVer: protoVer, PlayerName: cc.userName, }) time.Sleep(500 * time.Millisecond) @@ -158,7 +158,7 @@ func handleContent(cc *contentConn) { cc.auth.method = mt.SRP } - if cmd.SerializeVer != latestSerializeVer { + if cmd.SerializeVer != serializeVer { cc.log("<-", "invalid serializeVer") break } @@ -40,8 +40,8 @@ func announce(action string) error { a["name"] = Conf().List.Name a["description"] = Conf().List.Desc a["version"] = versionString - a["proto_min"] = latestProtoVer - a["proto_max"] = latestProtoVer + a["proto_min"] = protoVer + a["proto_max"] = protoVer a["url"] = Conf().List.URL a["creative"] = Conf().List.Creative a["damage"] = Conf().List.Dmg @@ -33,7 +33,7 @@ func (cc *ClientConn) process(pkt mt.Pkt) { } cc.setState(csInit) - if cmd.SerializeVer <= latestSerializeVer { + if cmd.SerializeVer < serializeVer { cc.Log("<-", "invalid serializeVer", cmd.SerializeVer) ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.UnsupportedVer}) @@ -46,7 +46,7 @@ func (cc *ClientConn) process(pkt mt.Pkt) { return } - if cmd.MaxProtoVer <= latestProtoVer { + if cmd.MaxProtoVer < protoVer { cc.Log("<-", "invalid protoVer", cmd.MaxProtoVer) ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.UnsupportedVer}) @@ -148,8 +148,8 @@ func (cc *ClientConn) process(pkt mt.Pkt) { } cc.SendCmd(&mt.ToCltHello{ - SerializeVer: latestSerializeVer, - ProtoVer: latestProtoVer, + SerializeVer: serializeVer, + ProtoVer: protoVer, AuthMethods: cc.auth.method, Username: cc.Name(), }) @@ -496,7 +496,7 @@ func (sc *ServerConn) process(pkt mt.Pkt) { sc.auth.method = mt.SRP } - if cmd.SerializeVer != latestSerializeVer { + if cmd.SerializeVer != serializeVer { sc.Log("<-", "invalid serializeVer") return } @@ -14,8 +14,8 @@ import ( ) const ( - latestSerializeVer = 28 - latestProtoVer = 39 + serializeVer = 28 + protoVer = 39 versionString = "5.4.1" maxPlayerNameLen = 20 bytesPerMediaBunch = 5000 diff --git a/server_conn.go b/server_conn.go index ba229d1..ceac020 100644 --- a/server_conn.go +++ b/server_conn.go @@ -91,9 +91,9 @@ func handleSrv(sc *ServerConn) { for sc.state() == csCreated && sc.client() != nil { sc.SendCmd(&mt.ToSrvInit{ - SerializeVer: latestSerializeVer, - MinProtoVer: latestProtoVer, - MaxProtoVer: latestProtoVer, + SerializeVer: serializeVer, + MinProtoVer: protoVer, + MaxProtoVer: protoVer, PlayerName: sc.client().Name(), }) time.Sleep(500 * time.Millisecond) |