This commit is contained in:
aozhiwei 2023-09-07 19:34:13 +08:00
parent 8a947f6f60
commit b4191a43eb
3 changed files with 15 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import (
"f5"
"github.com/golang/protobuf/proto"
"main/common"
. "main/global"
)
type Player struct {
@ -20,7 +21,7 @@ func (this *Player) GetAccountId() string {
}
func (this *Player) SendMsg(rspMsg proto.Message) {
//wspListener.sendProxyMsg(this.socket.Conn, this.socket.SocketHandle, rspMsg)
GetWspListener().SendProxyMsg(this.socket.Conn, this.socket.SocketHandle, rspMsg)
}
func (this *Player) GetRoom() *common.Room {

View File

@ -8,6 +8,7 @@ import (
"mt"
"q5"
"main/constant"
"github.com/golang/protobuf/proto"
)
type playerMgr struct {
@ -37,6 +38,14 @@ func (this *playerMgr) UnInit() {
}
func (this *playerMgr) CMLogin(hdr *f5.MsgHdr, msg *cs.CMLogin) {
oldPlayer := this.getPlayerBySocket(hdr.GetSocket())
if oldPlayer != nil {
rspMsg := cs.SMLogin{}
rspMsg.Errcode = proto.Int32(0)
rspMsg.Errmsg = proto.String("")
oldPlayer.SendMsg(&rspMsg)
return;
}
params := map[string]string{
"c": "User",
"a": "info",
@ -86,7 +95,6 @@ func (this *playerMgr) CMLoginResult(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.Htt
serverInfo := "192.168.100.39:2000"
rspMsg := &cs.SMLogin{}
rspMsg.ServerInfo = &serverInfo
rspMsg.AccountId = &resObj.Info.AccountID
//wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg)
}

View File

@ -89,13 +89,15 @@ message CMLogin
optional string account_id = 3; //id
optional int32 proto_version = 5; //Constant_e.ProtoVersion
optional string session_id = 20; //id
optional int32 zone_id = 21; //Id
}
//
message SMLogin
{
optional string server_info = 1; //使
optional string account_id = 2;
optional int32 errcode = 7; // 0 1:
optional string errmsg = 10; //
optional string server_info = 9; //使
}
//线