1
This commit is contained in:
parent
989e8bc3df
commit
73d3378edc
@ -38,21 +38,6 @@ type MsgHandler interface {
|
|||||||
CMPing(*f5.MsgHdr, *CMPing)
|
CMPing(*f5.MsgHdr, *CMPing)
|
||||||
CMLogin(*f5.MsgHdr, *CMLogin)
|
CMLogin(*f5.MsgHdr, *CMLogin)
|
||||||
CMReconnect(*f5.MsgHdr, *CMReconnect)
|
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) {
|
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) 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 {
|
func (this *CMPing) GetNetMsgId() uint16 {
|
||||||
return uint16(CMMessageIdE__CMPing)
|
return uint16(CMMessageIdE__CMPing)
|
||||||
}
|
}
|
||||||
@ -137,134 +77,6 @@ func (this *SMReconnect) GetNetMsgId() uint16 {
|
|||||||
return uint16(SMMessageIdE__SMReconnect)
|
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() {
|
func init() {
|
||||||
|
|
||||||
handlers[int(CMMessageIdE__CMPing)] = &CsNetMsgHandler{
|
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))
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -94,10 +94,6 @@ func (this *player) IsOnline() bool {
|
|||||||
return this.socket.IsValid()
|
return this.socket.IsValid()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *player) CMReportPingValue(hdr *f5.MsgHdr, msg *cs.CMReportPingValue) {
|
|
||||||
this.internalSetPing(msg.GetPing())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *player) internalSetPing(ping int32) {
|
func (this *player) internalSetPing(ping int32) {
|
||||||
if ping < 30 {
|
if ping < 30 {
|
||||||
this.ping = 30
|
this.ping = 30
|
||||||
|
@ -7,22 +7,6 @@ enum CMMessageId_e
|
|||||||
_CMPing = 101;
|
_CMPing = 101;
|
||||||
_CMLogin = 103;
|
_CMLogin = 103;
|
||||||
_CMReconnect = 104;
|
_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
|
enum SMMessageId_e
|
||||||
@ -31,26 +15,4 @@ enum SMMessageId_e
|
|||||||
_SMRpcError = 102;
|
_SMRpcError = 102;
|
||||||
_SMLogin = 103;
|
_SMLogin = 103;
|
||||||
_SMReconnect = 104;
|
_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;
|
|
||||||
}
|
}
|
||||||
|
@ -185,209 +185,3 @@ message SMReconnect
|
|||||||
optional int32 errcode = 1; //错误码 0:成功 1:重连失败
|
optional int32 errcode = 1; //错误码 0:成功 1:重连失败
|
||||||
optional string errmsg = 2; //错误描述
|
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; //1:关闭SMRoomGameStartNotify
|
|
||||||
}
|
|
||||||
|
|
||||||
//上报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; //错误描述
|
|
||||||
}
|
|
||||||
|
@ -94,10 +94,6 @@ func (this *team) IsOnline() bool {
|
|||||||
return this.socket.IsValid()
|
return this.socket.IsValid()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *team) CMReportPingValue(hdr *f5.MsgHdr, msg *cs.CMReportPingValue) {
|
|
||||||
this.internalSetPing(msg.GetPing())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *team) internalSetPing(ping int32) {
|
func (this *team) internalSetPing(ping int32) {
|
||||||
if ping < 30 {
|
if ping < 30 {
|
||||||
this.ping = 30
|
this.ping = 30
|
||||||
|
Loading…
x
Reference in New Issue
Block a user