diff --git a/modules/plunder/api_getlist.go b/modules/plunder/api_getlist.go index 9697d7ecf..c0eb9ccb3 100644 --- a/modules/plunder/api_getlist.go +++ b/modules/plunder/api_getlist.go @@ -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 } diff --git a/modules/plunder/model_land.go b/modules/plunder/model_land.go index dfdd8a215..8afeca316 100644 --- a/modules/plunder/model_land.go +++ b/modules/plunder/model_land.go @@ -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