1
This commit is contained in:
parent
f99e570d50
commit
ba8d674c36
@ -118,15 +118,16 @@ func (this *playerMgr) CMLogin(hdr *f5.MsgHdr, msg *cs.CMLogin) {
|
||||
"target_id": msg.GetAccountId(),
|
||||
}
|
||||
url := fmt.Sprintf("%s/webapp/index.php", mt.Table.Config.GetById(0).GetGameapiUrl())
|
||||
rspObj := &common.LoginRsp{}
|
||||
f5.GetHttpCliMgr().SendJsStyleRequest(
|
||||
url,
|
||||
params,
|
||||
func(rsp f5.HttpCliResponse) {
|
||||
this.apiAuthCb(hdr, msg, rsp, reqId)
|
||||
this.apiAuthCb(hdr, msg, reqId, rsp, rspObj)
|
||||
})
|
||||
}
|
||||
|
||||
func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCliResponse, reqId int64) {
|
||||
func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, reqId int64, rsp f5.HttpCliResponse, rspObj *common.LoginRsp) {
|
||||
pendingReq := this.getPendingRequest(msg.GetAccountId())
|
||||
if pendingReq == nil || pendingReq.reqId != reqId {
|
||||
return
|
||||
@ -141,7 +142,6 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
|
||||
f5.GetSysLog().Info("Api服务器JSON 解析错误1\n")
|
||||
return
|
||||
}
|
||||
rspObj := common.LoginRsp{}
|
||||
err := json.Unmarshal([]byte(rsp.GetRawData()), &rspObj)
|
||||
if err != nil {
|
||||
rspMsg.Errcode = proto.Int32(2)
|
||||
@ -158,7 +158,7 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
|
||||
return
|
||||
}
|
||||
hum := newPlayer()
|
||||
hum.init(pendingReq, &rspObj)
|
||||
hum.init(pendingReq, rspObj)
|
||||
this.accountIdHash[hum.GetAccountId()] = hum
|
||||
this.socketHash[pendingReq.hdr.GetSocket()] = hum
|
||||
rspMsg.AccountId = proto.String(rspObj.Info.AccountID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user