fix variable naming and client compatability issues

master
Edzell 2022-05-14 18:30:55 +02:00
parent c3fe13d096
commit b022959005
5 changed files with 16 additions and 16 deletions

View File

@ -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
}

View File

@ -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

View File

@ -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
}

View File

@ -14,8 +14,8 @@ import (
)
const (
latestSerializeVer = 28
latestProtoVer = 39
serializeVer = 28
protoVer = 39
versionString = "5.4.1"
maxPlayerNameLen = 20
bytesPerMediaBunch = 5000

View File

@ -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)