fix variable naming and client compatability issues
parent
c3fe13d096
commit
b022959005
|
@ -118,9 +118,9 @@ func handleContent(cc *contentConn) {
|
||||||
|
|
||||||
for cc.state() == csCreated {
|
for cc.state() == csCreated {
|
||||||
cc.SendCmd(&mt.ToSrvInit{
|
cc.SendCmd(&mt.ToSrvInit{
|
||||||
SerializeVer: latestSerializeVer,
|
SerializeVer: serializeVer,
|
||||||
MinProtoVer: latestProtoVer,
|
MinProtoVer: protoVer,
|
||||||
MaxProtoVer: latestProtoVer,
|
MaxProtoVer: protoVer,
|
||||||
PlayerName: cc.userName,
|
PlayerName: cc.userName,
|
||||||
})
|
})
|
||||||
time.Sleep(500 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
|
@ -158,7 +158,7 @@ func handleContent(cc *contentConn) {
|
||||||
cc.auth.method = mt.SRP
|
cc.auth.method = mt.SRP
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd.SerializeVer != latestSerializeVer {
|
if cmd.SerializeVer != serializeVer {
|
||||||
cc.log("<-", "invalid serializeVer")
|
cc.log("<-", "invalid serializeVer")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
4
list.go
4
list.go
|
@ -40,8 +40,8 @@ func announce(action string) error {
|
||||||
a["name"] = Conf().List.Name
|
a["name"] = Conf().List.Name
|
||||||
a["description"] = Conf().List.Desc
|
a["description"] = Conf().List.Desc
|
||||||
a["version"] = versionString
|
a["version"] = versionString
|
||||||
a["proto_min"] = latestProtoVer
|
a["proto_min"] = protoVer
|
||||||
a["proto_max"] = latestProtoVer
|
a["proto_max"] = protoVer
|
||||||
a["url"] = Conf().List.URL
|
a["url"] = Conf().List.URL
|
||||||
a["creative"] = Conf().List.Creative
|
a["creative"] = Conf().List.Creative
|
||||||
a["damage"] = Conf().List.Dmg
|
a["damage"] = Conf().List.Dmg
|
||||||
|
|
10
process.go
10
process.go
|
@ -33,7 +33,7 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cc.setState(csInit)
|
cc.setState(csInit)
|
||||||
if cmd.SerializeVer <= latestSerializeVer {
|
if cmd.SerializeVer < serializeVer {
|
||||||
cc.Log("<-", "invalid serializeVer", cmd.SerializeVer)
|
cc.Log("<-", "invalid serializeVer", cmd.SerializeVer)
|
||||||
ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.UnsupportedVer})
|
ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.UnsupportedVer})
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd.MaxProtoVer <= latestProtoVer {
|
if cmd.MaxProtoVer < protoVer {
|
||||||
cc.Log("<-", "invalid protoVer", cmd.MaxProtoVer)
|
cc.Log("<-", "invalid protoVer", cmd.MaxProtoVer)
|
||||||
ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.UnsupportedVer})
|
ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.UnsupportedVer})
|
||||||
|
|
||||||
|
@ -148,8 +148,8 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cc.SendCmd(&mt.ToCltHello{
|
cc.SendCmd(&mt.ToCltHello{
|
||||||
SerializeVer: latestSerializeVer,
|
SerializeVer: serializeVer,
|
||||||
ProtoVer: latestProtoVer,
|
ProtoVer: protoVer,
|
||||||
AuthMethods: cc.auth.method,
|
AuthMethods: cc.auth.method,
|
||||||
Username: cc.Name(),
|
Username: cc.Name(),
|
||||||
})
|
})
|
||||||
|
@ -496,7 +496,7 @@ func (sc *ServerConn) process(pkt mt.Pkt) {
|
||||||
sc.auth.method = mt.SRP
|
sc.auth.method = mt.SRP
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd.SerializeVer != latestSerializeVer {
|
if cmd.SerializeVer != serializeVer {
|
||||||
sc.Log("<-", "invalid serializeVer")
|
sc.Log("<-", "invalid serializeVer")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
4
proxy.go
4
proxy.go
|
@ -14,8 +14,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
latestSerializeVer = 28
|
serializeVer = 28
|
||||||
latestProtoVer = 39
|
protoVer = 39
|
||||||
versionString = "5.4.1"
|
versionString = "5.4.1"
|
||||||
maxPlayerNameLen = 20
|
maxPlayerNameLen = 20
|
||||||
bytesPerMediaBunch = 5000
|
bytesPerMediaBunch = 5000
|
||||||
|
|
|
@ -91,9 +91,9 @@ func handleSrv(sc *ServerConn) {
|
||||||
|
|
||||||
for sc.state() == csCreated && sc.client() != nil {
|
for sc.state() == csCreated && sc.client() != nil {
|
||||||
sc.SendCmd(&mt.ToSrvInit{
|
sc.SendCmd(&mt.ToSrvInit{
|
||||||
SerializeVer: latestSerializeVer,
|
SerializeVer: serializeVer,
|
||||||
MinProtoVer: latestProtoVer,
|
MinProtoVer: protoVer,
|
||||||
MaxProtoVer: latestProtoVer,
|
MaxProtoVer: protoVer,
|
||||||
PlayerName: sc.client().Name(),
|
PlayerName: sc.client().Name(),
|
||||||
})
|
})
|
||||||
time.Sleep(500 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
|
|
Loading…
Reference in New Issue