机器人进入场景请求

This commit is contained in:
flswld
2023-02-15 18:13:07 +08:00
parent df53b6afff
commit ba063e9d70
3 changed files with 93 additions and 57 deletions
+6 -16
View File
@@ -6,10 +6,8 @@ import (
"encoding/binary"
"errors"
"strconv"
"time"
"hk4e/common/region"
hk4egatenet "hk4e/gate/net"
"hk4e/pkg/endec"
"hk4e/pkg/logger"
"hk4e/pkg/random"
@@ -49,20 +47,12 @@ func GateLogin(dispatchInfo *DispatchInfo, accountInfo *AccountInfo, keyId strin
logger.Error("parse key id error: %v", err)
return nil, err
}
session.SendChan <- &hk4egatenet.ProtoMsg{
ConvId: 0,
CmdId: cmd.GetPlayerTokenReq,
HeadMessage: &proto.PacketHead{
ClientSequenceId: 0,
SentMs: uint64(time.Now().UnixMilli()),
},
PayloadMessage: &proto.GetPlayerTokenReq{
AccountToken: accountInfo.ComboToken,
AccountUid: strconv.Itoa(int(accountInfo.AccountId)),
KeyId: uint32(keyIdInt),
ClientRandKey: clientSeedBase64,
},
}
session.SendMsg(cmd.GetPlayerTokenReq, &proto.GetPlayerTokenReq{
AccountToken: accountInfo.ComboToken,
AccountUid: strconv.Itoa(int(accountInfo.AccountId)),
KeyId: uint32(keyIdInt),
ClientRandKey: clientSeedBase64,
})
protoMsg := <-session.RecvChan
if protoMsg.CmdId != cmd.GetPlayerTokenRsp {
return nil, errors.New("recv pkt is not GetPlayerTokenRsp")