1
This commit is contained in:
parent
ac45db9fd1
commit
f9034bdfd8
@ -225,6 +225,84 @@ func (this *SMTeamKickoutNotify) GetNetMsgId() uint16 {
|
||||
return uint16(SMMessageIdE__SMTeamKickoutNotify)
|
||||
}
|
||||
|
||||
func (this *SMLogin) Err(errCode int32, errMsg string) *SMLogin {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMReconnect) Err(errCode int32, errMsg string) *SMReconnect {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMLeaveTeam) Err(errCode int32, errMsg string) *SMLeaveTeam {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMDisbandTeam) Err(errCode int32, errMsg string) *SMDisbandTeam {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMKickOut) Err(errCode int32, errMsg string) *SMKickOut {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMHandoverLeader) Err(errCode int32, errMsg string) *SMHandoverLeader {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMStartGame) Err(errCode int32, errMsg string) *SMStartGame {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMCancel) Err(errCode int32, errMsg string) *SMCancel {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMSetReady) Err(errCode int32, errMsg string) *SMSetReady {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMSetSpecSkill) Err(errCode int32, errMsg string) *SMSetSpecSkill {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMChooseHero) Err(errCode int32, errMsg string) *SMChooseHero {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMChooseMap) Err(errCode int32, errMsg string) *SMChooseMap {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func (this *SMGrantInvitePermission) Err(errCode int32, errMsg string) *SMGrantInvitePermission {
|
||||
this.Errcode = proto.Int32(errCode)
|
||||
this.Errmsg = proto.String(errMsg)
|
||||
return this
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
handlers[int(CMMessageIdE__CMPing)] = &CsNetMsgHandler{
|
||||
|
21
server/matchserver/mt/Robot.go
Normal file
21
server/matchserver/mt/Robot.go
Normal file
@ -0,0 +1,21 @@
|
||||
package mt
|
||||
|
||||
import (
|
||||
"f5"
|
||||
"mtb"
|
||||
)
|
||||
|
||||
type Robot struct {
|
||||
mtb.Config
|
||||
}
|
||||
|
||||
type RobotTable struct {
|
||||
f5.IdMetaTable[Robot]
|
||||
}
|
||||
|
||||
func (this *Robot) Init1() {
|
||||
}
|
||||
|
||||
func (this *RobotTable) RandRobot() *Robot {
|
||||
return this.RandElement()
|
||||
}
|
@ -8,6 +8,7 @@ type table struct {
|
||||
MatchCluster *MatchClusterTable
|
||||
MasterCluster *MasterClusterTable
|
||||
Config *ConfigTable
|
||||
Robot *RobotTable
|
||||
}
|
||||
|
||||
var Table = f5.New(func (this* table) {
|
||||
@ -25,4 +26,10 @@ var Table = f5.New(func (this* table) {
|
||||
this.FileName = "../config/config.json"
|
||||
this.PrimKey = ""
|
||||
});
|
||||
|
||||
this.Robot = f5.New(func (this *RobotTable) {
|
||||
this.FileName = "../res/robot@robot.json"
|
||||
this.PrimKey = ""
|
||||
});
|
||||
|
||||
})
|
||||
|
@ -32,6 +32,15 @@ type Config struct {
|
||||
_flags2_ uint64
|
||||
}
|
||||
|
||||
type Robot struct {
|
||||
id int32
|
||||
name string
|
||||
hero_id int32
|
||||
|
||||
_flags1_ uint64
|
||||
_flags2_ uint64
|
||||
}
|
||||
|
||||
func (this *MatchCluster) GetInstanceId() int32 {
|
||||
return this.instance_id
|
||||
}
|
||||
@ -112,6 +121,30 @@ func (this *Config) HasDelayDeleteTime() bool {
|
||||
return (this._flags1_ & (uint64(1) << 4)) > 0
|
||||
}
|
||||
|
||||
func (this *Robot) GetId() int32 {
|
||||
return this.id
|
||||
}
|
||||
|
||||
func (this *Robot) HasId() bool {
|
||||
return (this._flags1_ & (uint64(1) << 1)) > 0
|
||||
}
|
||||
|
||||
func (this *Robot) GetName() string {
|
||||
return this.name
|
||||
}
|
||||
|
||||
func (this *Robot) HasName() bool {
|
||||
return (this._flags1_ & (uint64(1) << 2)) > 0
|
||||
}
|
||||
|
||||
func (this *Robot) GetHeroId() int32 {
|
||||
return this.hero_id
|
||||
}
|
||||
|
||||
func (this *Robot) HasHeroId() bool {
|
||||
return (this._flags1_ & (uint64(1) << 3)) > 0
|
||||
}
|
||||
|
||||
|
||||
func (this *MatchCluster) LoadFromKv(kv map[string]interface{}) {
|
||||
f5.ReadMetaTableField(&this.instance_id, "instance_id", &this._flags1_, 1, kv)
|
||||
@ -131,3 +164,9 @@ func (this *Config) LoadFromKv(kv map[string]interface{}) {
|
||||
f5.ReadMetaTableField(&this.game_start_notify_time, "game_start_notify_time", &this._flags1_, 3, kv)
|
||||
f5.ReadMetaTableField(&this.delay_delete_time, "delay_delete_time", &this._flags1_, 4, kv)
|
||||
}
|
||||
|
||||
func (this *Robot) LoadFromKv(kv map[string]interface{}) {
|
||||
f5.ReadMetaTableField(&this.id, "id", &this._flags1_, 1, kv)
|
||||
f5.ReadMetaTableField(&this.name, "name", &this._flags1_, 2, kv)
|
||||
f5.ReadMetaTableField(&this.hero_id, "hero_id", &this._flags1_, 3, kv)
|
||||
}
|
||||
|
@ -326,6 +326,7 @@ message SMTeamStateNotify
|
||||
optional int32 state = 1; //0:已取消 1:已开始 2:正在匹配(moba模式)
|
||||
optional MFJoinMsg join_msg = 2; //进入房间传的字段(只有一开始才生效)
|
||||
optional string next_team_uuid = 3; //下一次队伍唯一id(当state=1是才有效)
|
||||
repeated MFTeam team_list = 4; //队伍列表
|
||||
}
|
||||
|
||||
//队伍解散通知
|
||||
|
@ -23,3 +23,10 @@ message Config
|
||||
optional int32 game_start_notify_time = 3;
|
||||
optional int32 delay_delete_time = 4;
|
||||
}
|
||||
|
||||
message Robot
|
||||
{
|
||||
optional int32 id = 1;
|
||||
optional string name = 2;
|
||||
optional int32 hero_id = 3;
|
||||
}
|
||||
|
2
third_party/f5
vendored
2
third_party/f5
vendored
@ -1 +1 @@
|
||||
Subproject commit 35f839e5d4f3ef46a050c1968c16554ddb41c25e
|
||||
Subproject commit 5fe4ba1d1fd4b3e3d9ad6d4a77c2594e8f4df6c2
|
Loading…
x
Reference in New Issue
Block a user