商队继续货物修改
This commit is contained in:
parent
fc8826511e
commit
b941b855cd
@ -124,8 +124,6 @@ func (this *Caravan) InitCaravanCityData(uid string, data *pb.DBCaravan) {
|
||||
}
|
||||
data.Citystime = utils.GetZeroTime(configure.Now().Unix())
|
||||
data.Rtime = configure.Now().Unix() // 修改时间
|
||||
|
||||
//data.Itemtime = configure.Now().Unix() +
|
||||
}
|
||||
|
||||
// 初始化货物信息
|
||||
@ -205,7 +203,7 @@ func (this *Caravan) refreshCaravanCityInfo(uid string, caravan *pb.DBCaravan) {
|
||||
changeTime = this.configure.GetCityRefreshTime()
|
||||
|
||||
// 刷新城市货物信息
|
||||
if !utils.IsNextToday(caravan.Citystime) {
|
||||
if utils.IsNextToday(caravan.Citystime) {
|
||||
list := this.configure.GetAllCaravanCity()
|
||||
for _, conf := range list {
|
||||
if v, ok := caravan.City[conf.Id]; ok {
|
||||
@ -227,7 +225,7 @@ func (this *Caravan) refreshCaravanCityInfo(uid string, caravan *pb.DBCaravan) {
|
||||
} else { // 初始化今天
|
||||
v.Exspecial = make([]string, 0)
|
||||
// 初始化下一天的信息
|
||||
if len(v.Exspecial) > int(conf.ExspecialNum) {
|
||||
if len(conf.Exspecial) > int(conf.ExspecialNum) {
|
||||
ids := utils.RandomNumbers(0, len(conf.Exspecial), int(conf.ExspecialNum))
|
||||
for _, id := range ids {
|
||||
v.Exspecial = append(v.Exspecial, conf.Exspecial[id])
|
||||
@ -257,14 +255,12 @@ func (this *Caravan) refreshCaravanCityInfo(uid string, caravan *pb.DBCaravan) {
|
||||
update["city"] = caravan.City
|
||||
update["citystime"] = caravan.Citystime
|
||||
bChange = true
|
||||
caravan.Itemtime = curTime
|
||||
}
|
||||
|
||||
subTime := int32(curTime - caravan.Itemtime)
|
||||
if subTime >= 0 {
|
||||
bChange = true
|
||||
|
||||
icount := int32(subTime/changeTime) + 1 // 循环周期
|
||||
|
||||
caravan.Itemtime += int64(changeTime * icount)
|
||||
update["itemtime"] = caravan.Itemtime
|
||||
for k, v := range caravan.Goods {
|
||||
|
Loading…
Reference in New Issue
Block a user