mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 14:22:26 +08:00
更新机器人
This commit is contained in:
@@ -24,14 +24,14 @@ func main() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
engine.RunEngine([]int{0, 1, 2, 3}, 1, "0.0.0.0")
|
||||
engine.RunEngine([]int{0, 1, 2, 3}, 4, 1, "0.0.0.0")
|
||||
|
||||
time.Sleep(time.Second * 30)
|
||||
|
||||
session := net.NewSession("192.168.199.233:22222", []byte{0x00})
|
||||
session := net.NewSession("192.168.199.233:22222", make([]byte, 4096))
|
||||
go func() {
|
||||
protoMsg := <-session.RecvChan
|
||||
logger.Debug("%v", protoMsg)
|
||||
logger.Debug("protoMsg: %v", protoMsg)
|
||||
}()
|
||||
go func() {
|
||||
session.SendChan <- &hk4egatenet.ProtoMsg{
|
||||
|
||||
@@ -63,7 +63,7 @@ func (s *Session) recvHandle() {
|
||||
kcpMsgList := make([]*hk4egatenet.KcpMsg, 0)
|
||||
hk4egatenet.DecodeBinToPayload(recvData, &dataBuf, convId, &kcpMsgList, s.xorKey)
|
||||
for _, v := range kcpMsgList {
|
||||
protoMsgList := hk4egatenet.ProtoDecode(v, nil, nil)
|
||||
protoMsgList := hk4egatenet.ProtoDecode(v, cmd.NewCmdProtoMap(), nil)
|
||||
for _, vv := range protoMsgList {
|
||||
s.RecvChan <- vv
|
||||
if s.changeXorKeyFin == false && vv.CmdId == cmd.GetPlayerTokenRsp {
|
||||
|
||||
Reference in New Issue
Block a user