1
This commit is contained in:
parent
dea638fe0c
commit
702f721fea
@ -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
|
||||
}
|
||||
|
@ -190,6 +190,7 @@ type MatchMgr interface {
|
||||
type HistoryMgr interface {
|
||||
AddBattle(string, int32, int32)
|
||||
PushLastBattleInfo(Player)
|
||||
CanStart(string, int32, int32) bool
|
||||
}
|
||||
|
||||
type WspListener interface {
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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{}) {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user