掠夺结束时间
This commit is contained in:
parent
83170939c2
commit
4fe2e92dc6
@ -54,10 +54,8 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PlunderGetListRe
|
||||
return
|
||||
}
|
||||
var uids []string
|
||||
etime := this.module.modelLand.GetEndTime()
|
||||
// 清理岛数据
|
||||
if land.Etime > configure.Now().Unix() {
|
||||
land.Etime = etime
|
||||
if land.Etime < configure.Now().Unix() {
|
||||
for _, v := range land.Uinfo { // 重置成员信息
|
||||
uids = append(uids, v.Uid)
|
||||
}
|
||||
@ -65,9 +63,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PlunderGetListRe
|
||||
fmt.Printf("err:%v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
// 校验是否过期
|
||||
if list.Etime > configure.Now().Unix() {
|
||||
|
||||
if land, err = this.module.modelLand.createPlunderLandData(list); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
@ -77,7 +73,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PlunderGetListRe
|
||||
}
|
||||
list.Landid = land.Id
|
||||
update["landid"] = land.Id
|
||||
list.Etime = etime
|
||||
list.Etime = land.Etime
|
||||
update["etime"] = land.Etime
|
||||
}
|
||||
|
||||
|
@ -52,13 +52,15 @@ func (this *modelLand) createPlunderLandData(user *pb.DBPlunder) (land *pb.DBPlu
|
||||
other []string
|
||||
users []*pb.DBPlunder
|
||||
socre int32
|
||||
eTime int64
|
||||
)
|
||||
eTime = this.module.modelLand.GetEndTime()
|
||||
land = &pb.DBPlunderLand{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Ship: map[string]*pb.ShipData{},
|
||||
Uinfo: make(map[int32]*pb.BaseUserInfo, 0),
|
||||
Score: make(map[string]int32, 0),
|
||||
Etime: utils.GetTodayZeroTime(configure.Now().Unix()) + 48*3600, // 临时处理 后面走配置
|
||||
Etime: eTime,
|
||||
}
|
||||
|
||||
socre = user.Score - 100
|
||||
|
Loading…
Reference in New Issue
Block a user