This commit is contained in:
aozhiwei 2023-12-02 22:55:47 +08:00
parent 989e8bc3df
commit 73d3378edc
5 changed files with 0 additions and 620 deletions

View File

@ -38,21 +38,6 @@ type MsgHandler interface {
CMPing(*f5.MsgHdr, *CMPing)
CMLogin(*f5.MsgHdr, *CMLogin)
CMReconnect(*f5.MsgHdr, *CMReconnect)
CMCreateRoom(*f5.MsgHdr, *CMCreateRoom)
CMSearchRoom(*f5.MsgHdr, *CMSearchRoom)
CMJoinRoom(*f5.MsgHdr, *CMJoinRoom)
CMDisbandRoom(*f5.MsgHdr, *CMDisbandRoom)
CMLeaveRoom(*f5.MsgHdr, *CMLeaveRoom)
CMModifyRoom(*f5.MsgHdr, *CMModifyRoom)
CMStartGame(*f5.MsgHdr, *CMStartGame)
CMSetPrepare(*f5.MsgHdr, *CMSetPrepare)
CMKickoutTeam(*f5.MsgHdr, *CMKickoutTeam)
CMKickoutMember(*f5.MsgHdr, *CMKickoutMember)
CMCloseNotify(*f5.MsgHdr, *CMCloseNotify)
CMReportPingValue(*f5.MsgHdr, *CMReportPingValue)
CMGetCurrentRoom(*f5.MsgHdr, *CMGetCurrentRoom)
CMEnterObserver(*f5.MsgHdr, *CMEnterObserver)
CMLeaveObserver(*f5.MsgHdr, *CMLeaveObserver)
}
func (this *MsgHandlerImpl) CMPing(hdr *f5.MsgHdr, msg *CMPing) {
@ -64,51 +49,6 @@ func (this *MsgHandlerImpl) CMLogin(hdr *f5.MsgHdr, msg *CMLogin) {
func (this *MsgHandlerImpl) CMReconnect(hdr *f5.MsgHdr, msg *CMReconnect) {
}
func (this *MsgHandlerImpl) CMCreateRoom(hdr *f5.MsgHdr, msg *CMCreateRoom) {
}
func (this *MsgHandlerImpl) CMSearchRoom(hdr *f5.MsgHdr, msg *CMSearchRoom) {
}
func (this *MsgHandlerImpl) CMJoinRoom(hdr *f5.MsgHdr, msg *CMJoinRoom) {
}
func (this *MsgHandlerImpl) CMDisbandRoom(hdr *f5.MsgHdr, msg *CMDisbandRoom) {
}
func (this *MsgHandlerImpl) CMLeaveRoom(hdr *f5.MsgHdr, msg *CMLeaveRoom) {
}
func (this *MsgHandlerImpl) CMModifyRoom(hdr *f5.MsgHdr, msg *CMModifyRoom) {
}
func (this *MsgHandlerImpl) CMStartGame(hdr *f5.MsgHdr, msg *CMStartGame) {
}
func (this *MsgHandlerImpl) CMSetPrepare(hdr *f5.MsgHdr, msg *CMSetPrepare) {
}
func (this *MsgHandlerImpl) CMKickoutTeam(hdr *f5.MsgHdr, msg *CMKickoutTeam) {
}
func (this *MsgHandlerImpl) CMKickoutMember(hdr *f5.MsgHdr, msg *CMKickoutMember) {
}
func (this *MsgHandlerImpl) CMCloseNotify(hdr *f5.MsgHdr, msg *CMCloseNotify) {
}
func (this *MsgHandlerImpl) CMReportPingValue(hdr *f5.MsgHdr, msg *CMReportPingValue) {
}
func (this *MsgHandlerImpl) CMGetCurrentRoom(hdr *f5.MsgHdr, msg *CMGetCurrentRoom) {
}
func (this *MsgHandlerImpl) CMEnterObserver(hdr *f5.MsgHdr, msg *CMEnterObserver) {
}
func (this *MsgHandlerImpl) CMLeaveObserver(hdr *f5.MsgHdr, msg *CMLeaveObserver) {
}
func (this *CMPing) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMPing)
}
@ -137,134 +77,6 @@ func (this *SMReconnect) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMReconnect)
}
func (this *CMCreateRoom) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMCreateRoom)
}
func (this *SMCreateRoom) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMCreateRoom)
}
func (this *CMSearchRoom) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMSearchRoom)
}
func (this *SMSearchRoom) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMSearchRoom)
}
func (this *CMJoinRoom) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMJoinRoom)
}
func (this *SMJoinRoom) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMJoinRoom)
}
func (this *CMDisbandRoom) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMDisbandRoom)
}
func (this *SMDisbandRoom) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMDisbandRoom)
}
func (this *CMLeaveRoom) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMLeaveRoom)
}
func (this *SMLeaveRoom) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMLeaveRoom)
}
func (this *CMModifyRoom) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMModifyRoom)
}
func (this *SMModifyRoom) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMModifyRoom)
}
func (this *CMStartGame) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMStartGame)
}
func (this *SMStartGame) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMStartGame)
}
func (this *CMSetPrepare) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMSetPrepare)
}
func (this *CMKickoutTeam) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMKickoutTeam)
}
func (this *CMKickoutMember) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMKickoutMember)
}
func (this *CMCloseNotify) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMCloseNotify)
}
func (this *CMReportPingValue) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMReportPingValue)
}
func (this *CMGetCurrentRoom) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMGetCurrentRoom)
}
func (this *SMGetCurrentRoom) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMGetCurrentRoom)
}
func (this *SMRoomMemberChangeNotify) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMRoomMemberChangeNotify)
}
func (this *SMRoomKickoutNotify) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMRoomKickoutNotify)
}
func (this *SMRoomLeaveNotify) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMRoomLeaveNotify)
}
func (this *SMRoomDisbandNotify) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMRoomDisbandNotify)
}
func (this *SMRoomChangeNotify) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMRoomChangeNotify)
}
func (this *SMAutoStartGameCountdownNotify) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMAutoStartGameCountdownNotify)
}
func (this *SMRoomGameStartNotify) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMRoomGameStartNotify)
}
func (this *CMEnterObserver) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMEnterObserver)
}
func (this *SMEnterObserver) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMEnterObserver)
}
func (this *CMLeaveObserver) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMLeaveObserver)
}
func (this *SMLeaveObserver) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMLeaveObserver)
}
func init() {
handlers[int(CMMessageIdE__CMPing)] = &CsNetMsgHandler{
@ -303,184 +115,4 @@ func init() {
},
}
handlers[int(CMMessageIdE__CMCreateRoom)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMCreateRoom),
ParseCb: func (data []byte) interface{} {
msg := &CMCreateRoom{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMCreateRoom(hdr, hdr.Msg.(*CMCreateRoom))
},
}
handlers[int(CMMessageIdE__CMSearchRoom)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMSearchRoom),
ParseCb: func (data []byte) interface{} {
msg := &CMSearchRoom{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMSearchRoom(hdr, hdr.Msg.(*CMSearchRoom))
},
}
handlers[int(CMMessageIdE__CMJoinRoom)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMJoinRoom),
ParseCb: func (data []byte) interface{} {
msg := &CMJoinRoom{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMJoinRoom(hdr, hdr.Msg.(*CMJoinRoom))
},
}
handlers[int(CMMessageIdE__CMDisbandRoom)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMDisbandRoom),
ParseCb: func (data []byte) interface{} {
msg := &CMDisbandRoom{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMDisbandRoom(hdr, hdr.Msg.(*CMDisbandRoom))
},
}
handlers[int(CMMessageIdE__CMLeaveRoom)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMLeaveRoom),
ParseCb: func (data []byte) interface{} {
msg := &CMLeaveRoom{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMLeaveRoom(hdr, hdr.Msg.(*CMLeaveRoom))
},
}
handlers[int(CMMessageIdE__CMModifyRoom)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMModifyRoom),
ParseCb: func (data []byte) interface{} {
msg := &CMModifyRoom{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMModifyRoom(hdr, hdr.Msg.(*CMModifyRoom))
},
}
handlers[int(CMMessageIdE__CMStartGame)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMStartGame),
ParseCb: func (data []byte) interface{} {
msg := &CMStartGame{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMStartGame(hdr, hdr.Msg.(*CMStartGame))
},
}
handlers[int(CMMessageIdE__CMSetPrepare)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMSetPrepare),
ParseCb: func (data []byte) interface{} {
msg := &CMSetPrepare{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMSetPrepare(hdr, hdr.Msg.(*CMSetPrepare))
},
}
handlers[int(CMMessageIdE__CMKickoutTeam)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMKickoutTeam),
ParseCb: func (data []byte) interface{} {
msg := &CMKickoutTeam{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMKickoutTeam(hdr, hdr.Msg.(*CMKickoutTeam))
},
}
handlers[int(CMMessageIdE__CMKickoutMember)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMKickoutMember),
ParseCb: func (data []byte) interface{} {
msg := &CMKickoutMember{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMKickoutMember(hdr, hdr.Msg.(*CMKickoutMember))
},
}
handlers[int(CMMessageIdE__CMCloseNotify)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMCloseNotify),
ParseCb: func (data []byte) interface{} {
msg := &CMCloseNotify{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMCloseNotify(hdr, hdr.Msg.(*CMCloseNotify))
},
}
handlers[int(CMMessageIdE__CMReportPingValue)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMReportPingValue),
ParseCb: func (data []byte) interface{} {
msg := &CMReportPingValue{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMReportPingValue(hdr, hdr.Msg.(*CMReportPingValue))
},
}
handlers[int(CMMessageIdE__CMGetCurrentRoom)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMGetCurrentRoom),
ParseCb: func (data []byte) interface{} {
msg := &CMGetCurrentRoom{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMGetCurrentRoom(hdr, hdr.Msg.(*CMGetCurrentRoom))
},
}
handlers[int(CMMessageIdE__CMEnterObserver)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMEnterObserver),
ParseCb: func (data []byte) interface{} {
msg := &CMEnterObserver{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMEnterObserver(hdr, hdr.Msg.(*CMEnterObserver))
},
}
handlers[int(CMMessageIdE__CMLeaveObserver)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMLeaveObserver),
ParseCb: func (data []byte) interface{} {
msg := &CMLeaveObserver{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMLeaveObserver(hdr, hdr.Msg.(*CMLeaveObserver))
},
}
}

View File

@ -94,10 +94,6 @@ func (this *player) IsOnline() bool {
return this.socket.IsValid()
}
func (this *player) CMReportPingValue(hdr *f5.MsgHdr, msg *cs.CMReportPingValue) {
this.internalSetPing(msg.GetPing())
}
func (this *player) internalSetPing(ping int32) {
if ping < 30 {
this.ping = 30

View File

@ -7,22 +7,6 @@ enum CMMessageId_e
_CMPing = 101;
_CMLogin = 103;
_CMReconnect = 104;
_CMCreateRoom = 105;
_CMSearchRoom = 106;
_CMJoinRoom = 107;
_CMDisbandRoom = 108;
_CMLeaveRoom = 109;
_CMModifyRoom = 110;
_CMStartGame = 111;
_CMSetPrepare = 112;
_CMKickoutTeam = 113;
_CMKickoutMember = 114;
_CMCloseNotify = 115;
_CMReportPingValue = 116;
_CMGetCurrentRoom = 117;
_CMEnterObserver = 118;
_CMLeaveObserver = 119;
}
enum SMMessageId_e
@ -31,26 +15,4 @@ enum SMMessageId_e
_SMRpcError = 102;
_SMLogin = 103;
_SMReconnect = 104;
_SMCreateRoom = 105;
_SMSearchRoom = 106;
_SMJoinRoom = 107;
_SMDisbandRoom = 108;
_SMLeaveRoom = 109;
_SMModifyRoom = 110;
_SMStartGame = 111;
_SMSetPrepare = 112;
_SMKickoutTeam = 113;
_SMKickoutMember = 114;
_SMGetCurrentRoom = 117;
_SMEnterObserver = 118;
_SMLeaveObserver = 119;
_SMRoomMemberChangeNotify = 1001;
_SMRoomKickoutNotify = 1002;
_SMRoomLeaveNotify = 1003;
_SMRoomDisbandNotify = 1004;
_SMRoomChangeNotify = 1005;
_SMRoomGameStartNotify = 1006;
_SMAutoStartGameCountdownNotify = 1007;
}

View File

@ -185,209 +185,3 @@ message SMReconnect
optional int32 errcode = 1; // 0 1:
optional string errmsg = 2; //
}
//
message CMCreateRoom
{
optional int32 map_id = 1; //id
optional int32 zone_id = 2; //id
optional int32 node_id = 3; //id
optional string passwd = 4; //
optional string team_uuid = 5; //id
optional string team_info = 6; // json:{}
}
message SMCreateRoom
{
optional int32 errcode = 1; // 0 1:
optional string errmsg = 2; //
optional string room_id = 3; //
optional MFRoom room = 4; //
}
//
message CMSearchRoom
{
optional int64 since_id = 1; //0
optional string room_id = 2; //id
}
message SMSearchRoom
{
optional int64 since_id = 1; //
repeated MFRoom rows = 2; //
}
//
message CMJoinRoom
{
optional int32 map_id = 1; //id
optional int32 zone_id = 2; //id
optional int32 node_id = 3; //id
optional string passwd = 4; //
optional string team_uuid = 5; //id
optional string team_info = 6; // json:{}
optional string room_id = 10; //
}
message SMJoinRoom
{
optional int32 errcode = 1; // 0 1:
optional string errmsg = 2; //
optional MFRoom room = 3; //
}
//
message CMDisbandRoom
{
optional string room_id = 1; //
}
message SMDisbandRoom
{
optional int32 errcode = 1; // 0 1:
optional string errmsg = 2; //
}
//退
message CMLeaveRoom
{
optional string room_id = 1; //
}
message SMLeaveRoom
{
}
//
message CMModifyRoom
{
optional int32 map_id = 1; //
optional string passwd = 2; //
}
message SMModifyRoom
{
}
//
message CMStartGame
{
}
message SMStartGame
{
optional int32 errcode = 1; // 0 1:
optional string errmsg = 2; //
}
//
message CMSetPrepare
{
}
//()
message CMKickoutTeam
{
optional string team_uuid = 1; //id
}
//
message CMKickoutMember
{
optional string target_id = 1; //account_id
}
//
message CMCloseNotify
{
optional int32 param = 1; //1SMRoomGameStartNotify
}
//ping值
message CMReportPingValue
{
optional int32 ping = 1;
}
//
message CMGetCurrentRoom
{
}
message SMGetCurrentRoom
{
optional MFCurrentRoom room = 1; //
}
//
message SMRoomMemberChangeNotify
{
optional MFMember member = 1; //
}
//
message SMRoomKickoutNotify
{
repeated string account_ids = 1; //account_id列表
}
//
message SMRoomLeaveNotify
{
repeated string account_ids = 1; //account_id列表
}
//
message SMRoomDisbandNotify
{
optional string room_id = 1; //id
optional int32 reason = 2; // 0:(<2) 1:
}
//
message SMRoomChangeNotify
{
optional MFRoom room = 1; //
}
//
message SMAutoStartGameCountdownNotify
{
optional int32 seconds = 1; //
}
//,10,
message SMRoomGameStartNotify
{
optional int32 zone_id = 1; //id
optional int32 node_id = 2; //id
optional string team_uuid = 3; //CMJoin战斗服时用
optional string custom_room_payload = 4; //
optional int32 map_id = 5; //id
}
//
message CMEnterObserver
{
}
message SMEnterObserver
{
optional int32 errcode = 1; //
optional string errmsg = 2; //
}
//
message CMLeaveObserver
{
}
message SMLeaveObserver
{
optional int32 errcode = 1; //
optional string errmsg = 2; //
}

View File

@ -94,10 +94,6 @@ func (this *team) IsOnline() bool {
return this.socket.IsValid()
}
func (this *team) CMReportPingValue(hdr *f5.MsgHdr, msg *cs.CMReportPingValue) {
this.internalSetPing(msg.GetPing())
}
func (this *team) internalSetPing(ping int32) {
if ping < 30 {
this.ping = 30