This commit is contained in:
aozhiwei 2024-03-14 19:37:30 +08:00
parent c4f90d2c3b
commit 9c74103711
4 changed files with 77 additions and 0 deletions

View File

@ -25,6 +25,9 @@ func (this *HandlerMgr) Init() {
cs.RegHandlerId(int(cs.CMMessageIdE__CMStartGame), constant.PLAYER_HANDLER_ID) cs.RegHandlerId(int(cs.CMMessageIdE__CMStartGame), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMCancel), constant.PLAYER_HANDLER_ID) cs.RegHandlerId(int(cs.CMMessageIdE__CMCancel), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMSetReady), constant.PLAYER_HANDLER_ID) cs.RegHandlerId(int(cs.CMMessageIdE__CMSetReady), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMSetSpecSkill), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMChooseHero), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMChooseMap), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMGrantInvitePermission), constant.PLAYER_HANDLER_ID) cs.RegHandlerId(int(cs.CMMessageIdE__CMGrantInvitePermission), constant.PLAYER_HANDLER_ID)
} }

View File

@ -256,6 +256,39 @@ func (this *player) CMSetReady(hdr *f5.MsgHdr, msg *cs.CMSetReady) {
this.GetTeam().SendUpdateNotify() this.GetTeam().SendUpdateNotify()
} }
func (this *player) CMSpecSkill(hdr *f5.MsgHdr, msg *cs.CMSetSpecSkill) {
rspMsg := &cs.SMSetSpecSkill{}
if this.GetTeam().Started() {
rspMsg.Errcode = proto.Int32(1)
rspMsg.Errmsg = proto.String("team already started")
} else {
}
this.SendMsg(rspMsg)
this.GetTeam().SendUpdateNotify()
}
func (this *player) CMChooseHero(hdr *f5.MsgHdr, msg *cs.CMChooseHero) {
rspMsg := &cs.SMChooseHero{}
if this.GetTeam().Started() {
rspMsg.Errcode = proto.Int32(1)
rspMsg.Errmsg = proto.String("team already started")
} else {
}
this.SendMsg(rspMsg)
this.GetTeam().SendUpdateNotify()
}
func (this *player) CMChooseMap(hdr *f5.MsgHdr, msg *cs.CMChooseMap) {
rspMsg := &cs.SMChooseMap{}
if this.GetTeam().Started() {
rspMsg.Errcode = proto.Int32(1)
rspMsg.Errmsg = proto.String("team already started")
} else {
}
this.SendMsg(rspMsg)
this.GetTeam().SendUpdateNotify()
}
func (this *player) CMGrantInvitePermission(hdr *f5.MsgHdr, msg *cs.CMGrantInvitePermission) { func (this *player) CMGrantInvitePermission(hdr *f5.MsgHdr, msg *cs.CMGrantInvitePermission) {
rspMsg := &cs.SMGrantInvitePermission{} rspMsg := &cs.SMGrantInvitePermission{}
if this.GetTeam().Started() { if this.GetTeam().Started() {

View File

@ -17,6 +17,9 @@ enum CMMessageId_e
_CMCancel = 112; _CMCancel = 112;
_CMSetReady = 113; _CMSetReady = 113;
_CMGrantInvitePermission = 114; _CMGrantInvitePermission = 114;
_CMSetSpecSkill = 115;
_CMChooseHero = 116;
_CMChooseMap = 117;
} }
enum SMMessageId_e enum SMMessageId_e
@ -33,6 +36,9 @@ enum SMMessageId_e
_SMCancel = 112; _SMCancel = 112;
_SMSetReady = 113; _SMSetReady = 113;
_SMGrantInvitePermission = 114; _SMGrantInvitePermission = 114;
_SMSetSpecSkill = 115;
_SMChooseHero = 116;
_SMChooseMap = 117;
_SMTeamUpdateNotify = 1001; _SMTeamUpdateNotify = 1001;
_SMTeamStateNotify = 1002; _SMTeamStateNotify = 1002;

View File

@ -266,6 +266,41 @@ message SMSetReady
optional string errmsg = 2; // optional string errmsg = 2; //
} }
//
message CMSetSpecSkill
{
}
message SMSetSpecSkill
{
optional int32 errcode = 1; // 0
optional string errmsg = 2; //
}
//
message CMChooseHero
{
optional string hero_uniid = 1; //id
}
message SMChooseHero
{
optional int32 errcode = 1; // 0
optional string errmsg = 2; //
}
//
message CMChooseMap
{
optional int32 map_id = 1; //id
}
message SMChooseMap
{
optional int32 errcode = 1; // 0
optional string errmsg = 2; //
}
// //
message CMGrantInvitePermission message CMGrantInvitePermission
{ {