随机任务数读配置
This commit is contained in:
parent
300d33c777
commit
68ffda04ee
@ -201,11 +201,12 @@
|
|||||||
"guild_AcceptApplyMax": 100,
|
"guild_AcceptApplyMax": 100,
|
||||||
"guild_ViceAllianceLeader_MaxNum": 3,
|
"guild_ViceAllianceLeader_MaxNum": 3,
|
||||||
"guild_administrators_MaxNum": 5,
|
"guild_administrators_MaxNum": 5,
|
||||||
"guild_InitiateImpeachmentTime": 72,
|
"guild_InitiateImpeachmentTime": 1,
|
||||||
"guild_ImpeachmentCountDown": 48,
|
"guild_TaskNum": 4,
|
||||||
"guild_DissolutionCountDown_cd": 24,
|
"guild_ImpeachmentCountDown": 1,
|
||||||
"guild_dissolution_cd": 72,
|
"guild_DissolutionCountDown_cd": 1,
|
||||||
"guild_BuildCd": 72,
|
"guild_dissolution_cd": 1,
|
||||||
|
"guild_BuildCd": 1,
|
||||||
"ArenaTicket_max": 10,
|
"ArenaTicket_max": 10,
|
||||||
"ArenaTicket_RecoveryTime": 144,
|
"ArenaTicket_RecoveryTime": 144,
|
||||||
"VikingExpedition_RecoveryTime": 144,
|
"VikingExpedition_RecoveryTime": 144,
|
||||||
@ -225,7 +226,7 @@
|
|||||||
],
|
],
|
||||||
"horoscope_reset_cost": {
|
"horoscope_reset_cost": {
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
"t": "starcoin",
|
"t": "diamond",
|
||||||
"n": 500
|
"n": 500
|
||||||
},
|
},
|
||||||
"horoscope_reset_cd": 86400
|
"horoscope_reset_cd": 86400
|
||||||
|
@ -36,10 +36,15 @@ func (this *ModelSociatyTask) initSociatyTask(uid, sociatyId string) error {
|
|||||||
var taskList []*pb.SociatyTask
|
var taskList []*pb.SociatyTask
|
||||||
|
|
||||||
list := ggt.GetDataList()
|
list := ggt.GetDataList()
|
||||||
|
ggd := this.moduleSociaty.configure.GetGlobalConf()
|
||||||
|
if ggd == nil {
|
||||||
|
return errors.New("config not found")
|
||||||
|
}
|
||||||
|
|
||||||
// 大于4条配置
|
// 大于4条配置
|
||||||
if len(list) > 4 {
|
if len(list) > int(ggd.GuildTaskNum) {
|
||||||
//随机4条任务
|
//随机4条任务
|
||||||
randInts := utils.RandomNumbers(0, len(list)-1, 4)
|
randInts := utils.RandomNumbers(0, len(list)-1, int(ggd.GuildTaskNum))
|
||||||
for _, v := range randInts {
|
for _, v := range randInts {
|
||||||
taskList = append(taskList, &pb.SociatyTask{
|
taskList = append(taskList, &pb.SociatyTask{
|
||||||
TaskId: list[v].Id,
|
TaskId: list[v].Id,
|
||||||
|
@ -100,6 +100,7 @@ type GameGlobalData struct {
|
|||||||
GuildViceAllianceLeaderMaxNum int32
|
GuildViceAllianceLeaderMaxNum int32
|
||||||
GuildAdministratorsMaxNum int32
|
GuildAdministratorsMaxNum int32
|
||||||
GuildInitiateImpeachmentTime int32
|
GuildInitiateImpeachmentTime int32
|
||||||
|
GuildTaskNum int32
|
||||||
GuildImpeachmentCountDown int32
|
GuildImpeachmentCountDown int32
|
||||||
GuildDissolutionCountDownCd int32
|
GuildDissolutionCountDownCd int32
|
||||||
GuildDissolutionCd int32
|
GuildDissolutionCd int32
|
||||||
@ -356,6 +357,7 @@ func (_v *GameGlobalData)Deserialize(_buf map[string]interface{}) (err error) {
|
|||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_ViceAllianceLeader_MaxNum"].(float64); !_ok_ { err = errors.New("guild_ViceAllianceLeader_MaxNum error"); return }; _v.GuildViceAllianceLeaderMaxNum = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_ViceAllianceLeader_MaxNum"].(float64); !_ok_ { err = errors.New("guild_ViceAllianceLeader_MaxNum error"); return }; _v.GuildViceAllianceLeaderMaxNum = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_administrators_MaxNum"].(float64); !_ok_ { err = errors.New("guild_administrators_MaxNum error"); return }; _v.GuildAdministratorsMaxNum = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_administrators_MaxNum"].(float64); !_ok_ { err = errors.New("guild_administrators_MaxNum error"); return }; _v.GuildAdministratorsMaxNum = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_InitiateImpeachmentTime"].(float64); !_ok_ { err = errors.New("guild_InitiateImpeachmentTime error"); return }; _v.GuildInitiateImpeachmentTime = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_InitiateImpeachmentTime"].(float64); !_ok_ { err = errors.New("guild_InitiateImpeachmentTime error"); return }; _v.GuildInitiateImpeachmentTime = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_TaskNum"].(float64); !_ok_ { err = errors.New("guild_TaskNum error"); return }; _v.GuildTaskNum = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_ImpeachmentCountDown"].(float64); !_ok_ { err = errors.New("guild_ImpeachmentCountDown error"); return }; _v.GuildImpeachmentCountDown = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_ImpeachmentCountDown"].(float64); !_ok_ { err = errors.New("guild_ImpeachmentCountDown error"); return }; _v.GuildImpeachmentCountDown = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_DissolutionCountDown_cd"].(float64); !_ok_ { err = errors.New("guild_DissolutionCountDown_cd error"); return }; _v.GuildDissolutionCountDownCd = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_DissolutionCountDown_cd"].(float64); !_ok_ { err = errors.New("guild_DissolutionCountDown_cd error"); return }; _v.GuildDissolutionCountDownCd = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_dissolution_cd"].(float64); !_ok_ { err = errors.New("guild_dissolution_cd error"); return }; _v.GuildDissolutionCd = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["guild_dissolution_cd"].(float64); !_ok_ { err = errors.New("guild_dissolution_cd error"); return }; _v.GuildDissolutionCd = int32(_tempNum_) }
|
||||||
|
Loading…
Reference in New Issue
Block a user