1
This commit is contained in:
parent
66c187a52c
commit
d917c28547
@ -33,6 +33,7 @@ type LoginRsp struct {
|
|||||||
type WspListener interface {
|
type WspListener interface {
|
||||||
ProcessSSMMsg(*ss.SsNetMsgHandler, *f5.MsgHdr)
|
ProcessSSMMsg(*ss.SsNetMsgHandler, *f5.MsgHdr)
|
||||||
SendProxyMsg(net.Conn, uint16, proto.Message)
|
SendProxyMsg(net.Conn, uint16, proto.Message)
|
||||||
|
SendProxyErrMsg(net.Conn, uint16, proto.Message, int32, string)
|
||||||
}
|
}
|
||||||
|
|
||||||
type App interface {
|
type App interface {
|
||||||
|
@ -40,7 +40,7 @@ func (this *WSPListener) unInit() {
|
|||||||
|
|
||||||
func (this *WSPListener) SS_ping(hdr *f5.MsgHdr, msg *ss.SS_Ping) {
|
func (this *WSPListener) SS_ping(hdr *f5.MsgHdr, msg *ss.SS_Ping) {
|
||||||
rspMsg := ss.SS_Pong{}
|
rspMsg := ss.SS_Pong{}
|
||||||
this.sendProxyMsg(hdr.Conn, 0, &rspMsg)
|
this.SendProxyMsg(hdr.Conn, 0, &rspMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *WSPListener) SS_WSP_SocketDisconnect(hdr *f5.MsgHdr, msg *ss.SS_WSP_SocketDisconnect) {
|
func (this *WSPListener) SS_WSP_SocketDisconnect(hdr *f5.MsgHdr, msg *ss.SS_WSP_SocketDisconnect) {
|
||||||
@ -160,7 +160,7 @@ func (this *WSPListener) parseNetPkt() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *WSPListener) sendProxyMsg(conn net.Conn, socketHandle uint16, msg proto.Message) {
|
func (this *WSPListener) SendProxyMsg(conn net.Conn, socketHandle uint16, msg proto.Message) {
|
||||||
netMsg := msg.(f5.NetMsg)
|
netMsg := msg.(f5.NetMsg)
|
||||||
if !f5.IsOnlineEnv() {
|
if !f5.IsOnlineEnv() {
|
||||||
f5.GetSysLog().Info("%s %s", q5.GetTypeName(msg), q5.EncodeJson(msg))
|
f5.GetSysLog().Info("%s %s", q5.GetTypeName(msg), q5.EncodeJson(msg))
|
||||||
@ -180,3 +180,8 @@ func (this *WSPListener) sendProxyMsg(conn net.Conn, socketHandle uint16, msg pr
|
|||||||
copy(buff[f5.WSPROXYPACKHEAD_S_SIZE:], msgData[:])
|
copy(buff[f5.WSPROXYPACKHEAD_S_SIZE:], msgData[:])
|
||||||
conn.Write(buff)
|
conn.Write(buff)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *WSPListener) SendProxyErrMsg(conn net.Conn, socketHandle, uint16, msg proto.Message,
|
||||||
|
errCode int32, errMsg string) {
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -137,22 +137,22 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, reqId int64,
|
|||||||
|
|
||||||
rspMsg := cs.SMLogin{}
|
rspMsg := cs.SMLogin{}
|
||||||
if rsp.GetErr() != nil {
|
if rsp.GetErr() != nil {
|
||||||
rspMsg.Errcode = proto.Int32(2)
|
GetWspListener().SendProxyErrMsg(pendingReq.hdr.Conn, pendingReq.hdr.SocketHandle, &rspMsg,
|
||||||
rspMsg.Errmsg = proto.String("server internal error")
|
2,
|
||||||
GetWspListener().SendProxyMsg(pendingReq.hdr.Conn, pendingReq.hdr.SocketHandle, &rspMsg)
|
"server internal error")
|
||||||
f5.GetSysLog().Info("Api服务器JSON 解析错误1\n")
|
f5.GetSysLog().Info("Api服务器JSON 解析错误1\n")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !rsp.JsonParseOk() {
|
if !rsp.JsonParseOk() {
|
||||||
rspMsg.Errcode = proto.Int32(2)
|
GetWspListener().SendProxyErrMsg(pendingReq.hdr.Conn, pendingReq.hdr.SocketHandle, &rspMsg,
|
||||||
rspMsg.Errmsg = proto.String("server internal error")
|
2,
|
||||||
GetWspListener().SendProxyMsg(pendingReq.hdr.Conn, pendingReq.hdr.SocketHandle, &rspMsg)
|
"server internal error")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if rspObj.Errcode != 0 {
|
if rspObj.Errcode != 0 {
|
||||||
rspMsg.Errcode = proto.Int32(1)
|
GetWspListener().SendProxyErrMsg(pendingReq.hdr.Conn, pendingReq.hdr.SocketHandle, &rspMsg,
|
||||||
rspMsg.Errmsg = proto.String("invalid session_id")
|
1,
|
||||||
GetWspListener().SendProxyMsg(pendingReq.hdr.Conn, pendingReq.hdr.SocketHandle, &rspMsg)
|
"invalid session_id")
|
||||||
f5.GetSysLog().Error("Api服务器errcode:%d", rspObj.Errcode)
|
f5.GetSysLog().Error("Api服务器errcode:%d", rspObj.Errcode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user