1
This commit is contained in:
parent
8a947f6f60
commit
b4191a43eb
@ -5,6 +5,7 @@ import (
|
|||||||
"f5"
|
"f5"
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"main/common"
|
"main/common"
|
||||||
|
. "main/global"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Player struct {
|
type Player struct {
|
||||||
@ -20,7 +21,7 @@ func (this *Player) GetAccountId() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) SendMsg(rspMsg proto.Message) {
|
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 {
|
func (this *Player) GetRoom() *common.Room {
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
"mt"
|
"mt"
|
||||||
"q5"
|
"q5"
|
||||||
"main/constant"
|
"main/constant"
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type playerMgr struct {
|
type playerMgr struct {
|
||||||
@ -37,6 +38,14 @@ func (this *playerMgr) UnInit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *playerMgr) CMLogin(hdr *f5.MsgHdr, msg *cs.CMLogin) {
|
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{
|
params := map[string]string{
|
||||||
"c": "User",
|
"c": "User",
|
||||||
"a": "info",
|
"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"
|
serverInfo := "192.168.100.39:2000"
|
||||||
rspMsg := &cs.SMLogin{}
|
rspMsg := &cs.SMLogin{}
|
||||||
rspMsg.ServerInfo = &serverInfo
|
rspMsg.ServerInfo = &serverInfo
|
||||||
rspMsg.AccountId = &resObj.Info.AccountID
|
|
||||||
//wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg)
|
//wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,13 +89,15 @@ message CMLogin
|
|||||||
optional string account_id = 3; //账号id
|
optional string account_id = 3; //账号id
|
||||||
optional int32 proto_version = 5; //协议版本号Constant_e.ProtoVersion
|
optional int32 proto_version = 5; //协议版本号Constant_e.ProtoVersion
|
||||||
optional string session_id = 20; //账号id
|
optional string session_id = 20; //账号id
|
||||||
|
optional int32 zone_id = 21; //国家Id
|
||||||
}
|
}
|
||||||
|
|
||||||
//登录回复
|
//登录回复
|
||||||
message SMLogin
|
message SMLogin
|
||||||
{
|
{
|
||||||
optional string server_info = 1; //服务器信息(重连时使用)
|
optional int32 errcode = 7; //错误码 0:成功 1:重连失败
|
||||||
optional string account_id = 2;
|
optional string errmsg = 10; //错误描述
|
||||||
|
optional string server_info = 9; //服务器信息(重连时使用)
|
||||||
}
|
}
|
||||||
|
|
||||||
//断线重连
|
//断线重连
|
||||||
|
Loading…
x
Reference in New Issue
Block a user