diff --git a/bin/matchserver/config/config.json b/bin/matchserver/config/config.json index cfafc6c5..26d51c56 100644 --- a/bin/matchserver/config/config.json +++ b/bin/matchserver/config/config.json @@ -4,5 +4,6 @@ "auto_start_time": 3600, "game_start_notify_time": 20, "delay_delete_time": 60, - "match_real_player": 1 + "match_real_player": 1, + "circuit_mode_interval_time": 120 } diff --git a/server/matchserver/common/types.go b/server/matchserver/common/types.go index a976dd1d..78faca78 100644 --- a/server/matchserver/common/types.go +++ b/server/matchserver/common/types.go @@ -190,6 +190,7 @@ type MatchMgr interface { type HistoryMgr interface { AddBattle(string, int32, int32) PushLastBattleInfo(Player) + CanStart(string, int32, int32) bool } type WspListener interface { diff --git a/server/matchserver/cs/cs.auto_gen.go b/server/matchserver/cs/cs.auto_gen.go index 5f151da9..a7ab33a6 100644 --- a/server/matchserver/cs/cs.auto_gen.go +++ b/server/matchserver/cs/cs.auto_gen.go @@ -237,6 +237,10 @@ func (this *SMTeamKickoutNotify) GetNetMsgId() uint16 { return uint16(SMMessageIdE__SMTeamKickoutNotify) } +func (this *SMPushLastBattleInfo) GetNetMsgId() uint16 { + return uint16(SMMessageIdE__SMPushLastBattleInfo) +} + func (this *SMLogin) Err(errCode int32, errMsg string) *SMLogin { this.Errcode = proto.Int32(errCode) this.Errmsg = proto.String(errMsg) diff --git a/server/matchserver/history/historymgr.go b/server/matchserver/history/historymgr.go index 91ce7053..4f0475d4 100644 --- a/server/matchserver/history/historymgr.go +++ b/server/matchserver/history/historymgr.go @@ -5,6 +5,7 @@ import ( "cs" "jccommon" "main/common" + "main/mt" "github.com/golang/protobuf/proto" ) @@ -43,12 +44,20 @@ func (this *historyMgr) PushLastBattleInfo(hum common.Player) { p.ModeId = proto.Int32(modeId) p.StartTime = proto.Int32(val) if modeId == jccommon.MAP_MODE_CIRCUIT { - p.IntervalTime = proto.Int32(60 * 2) + p.IntervalTime = proto.Int32(mt.Table.Config.Get().GetCircuitModeIntervalTime()) } } hum.SendMsg(msg) } +func (this *historyMgr) CanStart(accountId string, mapId int32, modeId int32) bool { + u := this.getUser(accountId) + if u == nil { + return false + } + return true +} + func (this *historyMgr) getUser(accountId string) *user { if u, ok := this.userHash[accountId]; ok { return u diff --git a/server/matchserver/mtb/mtb.auto_gen.go b/server/matchserver/mtb/mtb.auto_gen.go index f184f462..cd0d19a8 100644 --- a/server/matchserver/mtb/mtb.auto_gen.go +++ b/server/matchserver/mtb/mtb.auto_gen.go @@ -29,6 +29,7 @@ type Config struct { delay_delete_time int32 friendapi_url string match_real_player int32 + circuit_mode_interval_time int32 _flags1_ uint64 _flags2_ uint64 @@ -139,6 +140,14 @@ func (this *Config) HasMatchRealPlayer() bool { return (this._flags1_ & (uint64(1) << 6)) > 0 } +func (this *Config) GetCircuitModeIntervalTime() int32 { + return this.circuit_mode_interval_time +} + +func (this *Config) HasCircuitModeIntervalTime() bool { + return (this._flags1_ & (uint64(1) << 7)) > 0 +} + func (this *Robot) GetId() int32 { return this.id } @@ -183,6 +192,7 @@ func (this *Config) LoadFromKv(kv map[string]interface{}) { f5.ReadMetaTableField(&this.delay_delete_time, "delay_delete_time", &this._flags1_, 4, kv) f5.ReadMetaTableField(&this.friendapi_url, "friendapi_url", &this._flags1_, 5, kv) f5.ReadMetaTableField(&this.match_real_player, "match_real_player", &this._flags1_, 6, kv) + f5.ReadMetaTableField(&this.circuit_mode_interval_time, "circuit_mode_interval_time", &this._flags1_, 7, kv) } func (this *Robot) LoadFromKv(kv map[string]interface{}) { diff --git a/server/matchserver/proto/mt.proto b/server/matchserver/proto/mt.proto index 1fb36a39..35396b8c 100644 --- a/server/matchserver/proto/mt.proto +++ b/server/matchserver/proto/mt.proto @@ -24,6 +24,7 @@ message Config optional int32 delay_delete_time = 4; optional string friendapi_url = 5; optional int32 match_real_player = 6; + optional int32 circuit_mode_interval_time = 7; } message Robot