1
This commit is contained in:
parent
dea638fe0c
commit
702f721fea
@ -4,5 +4,6 @@
|
|||||||
"auto_start_time": 3600,
|
"auto_start_time": 3600,
|
||||||
"game_start_notify_time": 20,
|
"game_start_notify_time": 20,
|
||||||
"delay_delete_time": 60,
|
"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 {
|
type HistoryMgr interface {
|
||||||
AddBattle(string, int32, int32)
|
AddBattle(string, int32, int32)
|
||||||
PushLastBattleInfo(Player)
|
PushLastBattleInfo(Player)
|
||||||
|
CanStart(string, int32, int32) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type WspListener interface {
|
type WspListener interface {
|
||||||
|
@ -237,6 +237,10 @@ func (this *SMTeamKickoutNotify) GetNetMsgId() uint16 {
|
|||||||
return uint16(SMMessageIdE__SMTeamKickoutNotify)
|
return uint16(SMMessageIdE__SMTeamKickoutNotify)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *SMPushLastBattleInfo) GetNetMsgId() uint16 {
|
||||||
|
return uint16(SMMessageIdE__SMPushLastBattleInfo)
|
||||||
|
}
|
||||||
|
|
||||||
func (this *SMLogin) Err(errCode int32, errMsg string) *SMLogin {
|
func (this *SMLogin) Err(errCode int32, errMsg string) *SMLogin {
|
||||||
this.Errcode = proto.Int32(errCode)
|
this.Errcode = proto.Int32(errCode)
|
||||||
this.Errmsg = proto.String(errMsg)
|
this.Errmsg = proto.String(errMsg)
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"cs"
|
"cs"
|
||||||
"jccommon"
|
"jccommon"
|
||||||
"main/common"
|
"main/common"
|
||||||
|
"main/mt"
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -43,12 +44,20 @@ func (this *historyMgr) PushLastBattleInfo(hum common.Player) {
|
|||||||
p.ModeId = proto.Int32(modeId)
|
p.ModeId = proto.Int32(modeId)
|
||||||
p.StartTime = proto.Int32(val)
|
p.StartTime = proto.Int32(val)
|
||||||
if modeId == jccommon.MAP_MODE_CIRCUIT {
|
if modeId == jccommon.MAP_MODE_CIRCUIT {
|
||||||
p.IntervalTime = proto.Int32(60 * 2)
|
p.IntervalTime = proto.Int32(mt.Table.Config.Get().GetCircuitModeIntervalTime())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hum.SendMsg(msg)
|
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 {
|
func (this *historyMgr) getUser(accountId string) *user {
|
||||||
if u, ok := this.userHash[accountId]; ok {
|
if u, ok := this.userHash[accountId]; ok {
|
||||||
return u
|
return u
|
||||||
|
@ -29,6 +29,7 @@ type Config struct {
|
|||||||
delay_delete_time int32
|
delay_delete_time int32
|
||||||
friendapi_url string
|
friendapi_url string
|
||||||
match_real_player int32
|
match_real_player int32
|
||||||
|
circuit_mode_interval_time int32
|
||||||
|
|
||||||
_flags1_ uint64
|
_flags1_ uint64
|
||||||
_flags2_ uint64
|
_flags2_ uint64
|
||||||
@ -139,6 +140,14 @@ func (this *Config) HasMatchRealPlayer() bool {
|
|||||||
return (this._flags1_ & (uint64(1) << 6)) > 0
|
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 {
|
func (this *Robot) GetId() int32 {
|
||||||
return this.id
|
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.delay_delete_time, "delay_delete_time", &this._flags1_, 4, kv)
|
||||||
f5.ReadMetaTableField(&this.friendapi_url, "friendapi_url", &this._flags1_, 5, 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.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{}) {
|
func (this *Robot) LoadFromKv(kv map[string]interface{}) {
|
||||||
|
@ -24,6 +24,7 @@ message Config
|
|||||||
optional int32 delay_delete_time = 4;
|
optional int32 delay_delete_time = 4;
|
||||||
optional string friendapi_url = 5;
|
optional string friendapi_url = 5;
|
||||||
optional int32 match_real_player = 6;
|
optional int32 match_real_player = 6;
|
||||||
|
optional int32 circuit_mode_interval_time = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Robot
|
message Robot
|
||||||
|
Loading…
x
Reference in New Issue
Block a user