From fb04fd18a4b4657dcd1da449f71b6f9592d8ae9e Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 26 Jan 2024 16:15:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8E=A0=E5=A4=BA=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/comp_model.go | 4 + modules/plunder/api_getlist.go | 5 +- modules/plunder/api_unlock.go | 2 +- modules/plunder/model_land.go | 35 +++-- modules/plunder/model_plunder.go | 17 ++- modules/plunder/module.go | 8 +- pb/plunder_db.pb.go | 241 ++++++++++++++++--------------- sys/db/dbmodel.go | 25 ++++ 8 files changed, 189 insertions(+), 148 deletions(-) diff --git a/modules/comp_model.go b/modules/comp_model.go index e03428108..8bf9d68a2 100644 --- a/modules/comp_model.go +++ b/modules/comp_model.go @@ -115,6 +115,10 @@ func (this *MCompModel) ChangeLists(uid string, datas map[string]interface{}, op return this.DBModel.ChangeLists(uid, datas, opt...) } +func (this *MCompModel) BatchChange(uids []string, update map[string]interface{}, opt ...db.DBOption) (err error) { + return this.DBModel.BatchChange(uids, update, opt...) +} + // 读取全部数据 func (this *MCompModel) Get(id string, data interface{}, opt ...db.DBOption) (err error) { return this.DBModel.Get(id, data, opt...) diff --git a/modules/plunder/api_getlist.go b/modules/plunder/api_getlist.go index 54579c2b9..79d692cb2 100644 --- a/modules/plunder/api_getlist.go +++ b/modules/plunder/api_getlist.go @@ -22,7 +22,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PlunderGetListRe return } update = make(map[string]interface{}) - if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil { + if list, err = this.module.modelPlunder.getPlunderData(session); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, Message: err.Error(), @@ -31,7 +31,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PlunderGetListRe } if list.Landid == "" { - if land, err = this.module.modelLand.createPlunderLandData(session.GetUserId(), list.Score); err != nil { + if land, err = this.module.modelLand.createPlunderLandData(list); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, Message: err.Error(), @@ -73,6 +73,5 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PlunderGetListRe List: list, Land: land, }) - return } diff --git a/modules/plunder/api_unlock.go b/modules/plunder/api_unlock.go index 8e2601c60..ade1fa53b 100644 --- a/modules/plunder/api_unlock.go +++ b/modules/plunder/api_unlock.go @@ -21,7 +21,7 @@ func (this *apiComp) Unlock(session comm.IUserSession, req *pb.PlunderUnlockReq) return } - if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil { + if list, err = this.module.modelPlunder.getPlunderData(session); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, Message: err.Error(), diff --git a/modules/plunder/model_land.go b/modules/plunder/model_land.go index db1d250be..95f00b7cd 100644 --- a/modules/plunder/model_land.go +++ b/modules/plunder/model_land.go @@ -46,11 +46,11 @@ func (this *modelLand) changePlunderLandData(id string, update map[string]interf return } -func (this *modelLand) createPlunderLandData(uid string, socre int32) (land *pb.DBPlunderLand, err error) { +func (this *modelLand) createPlunderLandData(user *pb.DBPlunder) (land *pb.DBPlunderLand, err error) { var ( - uids []string - users []*pb.DBUser - uInfos []*pb.BaseUserInfo + uids []string + users []*pb.DBPlunder + socre int32 ) land = &pb.DBPlunderLand{ Id: primitive.NewObjectID().Hex(), @@ -59,28 +59,22 @@ func (this *modelLand) createPlunderLandData(uid string, socre int32) (land *pb. Score: make(map[string]int32, 0), Etime: utils.GetTodayZeroTime(configure.Now().Unix()) + 48*3600, // 临时处理 后面走配置 } - socre = socre - 100 + socre = user.Score - 100 if socre < 0 { socre = 0 } - uids = append(uids, uid) // 优先加入自己 - cur, err := this.DB.Find(core.SqlTable(comm.TablePlunder), bson.M{"score": bson.M{"$gte": socre}, "uid": bson.M{"$ne": uid}, "landid": bson.M{"$ne": ""}}, options.Find().SetSkip(int64(0)).SetLimit(int64(20))) + users = append(users, user) // 优先加入自己 + cur, err := this.DB.Find(core.SqlTable(comm.TablePlunder), bson.M{"score": bson.M{"$gte": socre}, "uid": bson.M{"$ne": user.Uid}, "landid": ""}, options.Find().SetSkip(int64(0)).SetLimit(int64(19))) for cur.Next(context.TODO()) { tmp := &pb.DBPlunder{} if err = cur.Decode(tmp); err == nil { - uids = append(uids, tmp.Uid) + users = append(users, tmp) } } - if users, err = this.module.ModuleUser.GetUsers(uids); err == nil { - for _, v := range users { - uInfos = append(uInfos, comm.GetUserBaseInfo(v)) - } - } - - sz := utils.RandomNumbers(0, 20, len(uInfos)) - for k, v := range uInfos { - land.Uinfo[int32(sz[k])] = v + sz := utils.RandomNumbers(0, 20, len(users)) + for k, v := range users { + land.Uinfo[int32(sz[k])] = v.Uinfo } if err = this.AddList(comm.RDS_EMPTY, land.Id, land); err != nil { return @@ -88,7 +82,12 @@ func (this *modelLand) createPlunderLandData(uid string, socre int32) (land *pb. if _, err = this.module.modelRecord.getPlunderRecordData(land.Id); err != nil { return } - + for _, v := range users { + uids = append(uids, v.Uid) + } + if err = this.module.modelPlunder.BatchChange(uids, map[string]interface{}{"landid": land.Id}); err != nil { + return + } return } diff --git a/modules/plunder/model_plunder.go b/modules/plunder/model_plunder.go index 832a448ba..5e62b7802 100644 --- a/modules/plunder/model_plunder.go +++ b/modules/plunder/model_plunder.go @@ -57,16 +57,25 @@ func (this *modelPlunder) initplayerData(uid string) (err error) { } // 获取基本数据 -func (this *modelPlunder) getPlunderData(uid string) (info *pb.DBPlunder, err error) { +func (this *modelPlunder) getPlunderData(session comm.IUserSession) (info *pb.DBPlunder, err error) { + var ( + user *pb.DBUser + ) info = &pb.DBPlunder{} - if err = this.Get(uid, info); err != nil && err != mgo.MongodbNil { + if err = this.Get(session.GetUserId(), info); err != nil && err != mgo.MongodbNil { this.module.Errorln(err) return } if err == mgo.MongodbNil { + user, err = this.module.GetUserForSession(session) + if err != nil { + this.module.Errorln(err) + return + } info = &pb.DBPlunder{ Id: primitive.NewObjectID().Hex(), - Uid: uid, + Uid: session.GetUserId(), + Uinfo: comm.GetUserBaseInfo(user), Ctime: configure.Now().Unix(), Develop: make(map[int32]int32), } @@ -79,7 +88,7 @@ func (this *modelPlunder) getPlunderData(uid string) (info *pb.DBPlunder, err er }) // 刷新货物信息 info.Source, _ = this.refreshGoodsInfo() - err = this.Add(uid, info) + err = this.Add(session.GetUserId(), info) } return } diff --git a/modules/plunder/module.go b/modules/plunder/module.go index 43acb55f0..45947bb32 100644 --- a/modules/plunder/module.go +++ b/modules/plunder/module.go @@ -68,11 +68,5 @@ func (this *Plunder) OnInstallComp() { //初始化用户掠夺信息 func (this *Plunder) InitPlunderByUser(session comm.IUserSession) { - var ( - err error - ) - if err = this.modelPlunder.initplayerData(session.GetUserId()); err != nil { - this.Errorln(err) - return - } + this.modelPlunder.getPlunderData(session) } diff --git a/pb/plunder_db.pb.go b/pb/plunder_db.pb.go index f486d20c8..dbb76271e 100644 --- a/pb/plunder_db.pb.go +++ b/pb/plunder_db.pb.go @@ -28,17 +28,18 @@ type DBPlunder struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` // - Landid string `protobuf:"bytes,3,opt,name=landid,proto3" json:"landid"` //掠夺岛 oid - Line []*TransportLine `protobuf:"bytes,4,rep,name=line,proto3" json:"line"` // 运输队列 - Count int32 `protobuf:"varint,5,opt,name=count,proto3" json:"count"` // 运输次数 - Source []int32 `protobuf:"varint,6,rep,packed,name=source,proto3" json:"source"` // 货源列表 - Setout []int32 `protobuf:"varint,7,rep,packed,name=setout,proto3" json:"setout"` // 已经出发的列表 - Refresh int32 `protobuf:"varint,8,opt,name=refresh,proto3" json:"refresh"` // 刷新次数 - Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime"` // 刷新时间 客户端不用 - Score int32 `protobuf:"varint,10,opt,name=score,proto3" json:"score"` // 当前赛季积分 - Etime int64 `protobuf:"varint,11,opt,name=etime,proto3" json:"etime"` // 结束时间 - Plunderexp int32 `protobuf:"varint,12,opt,name=plunderexp,proto3" json:"plunderexp"` // 积分 排行用 - Develop map[int32]int32 `protobuf:"bytes,13,rep,name=develop,proto3" json:"develop" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 海航术 + Uinfo *BaseUserInfo `protobuf:"bytes,3,opt,name=uinfo,proto3" json:"uinfo"` //用户基础 + Landid string `protobuf:"bytes,4,opt,name=landid,proto3" json:"landid"` //掠夺岛 oid + Line []*TransportLine `protobuf:"bytes,5,rep,name=line,proto3" json:"line"` // 运输队列 + Count int32 `protobuf:"varint,6,opt,name=count,proto3" json:"count"` // 运输次数 + Source []int32 `protobuf:"varint,7,rep,packed,name=source,proto3" json:"source"` // 货源列表 + Setout []int32 `protobuf:"varint,8,rep,packed,name=setout,proto3" json:"setout"` // 已经出发的列表 + Refresh int32 `protobuf:"varint,9,opt,name=refresh,proto3" json:"refresh"` // 刷新次数 + Ctime int64 `protobuf:"varint,10,opt,name=ctime,proto3" json:"ctime"` // 刷新时间 客户端不用 + Score int32 `protobuf:"varint,11,opt,name=score,proto3" json:"score"` // 当前赛季积分 + Etime int64 `protobuf:"varint,12,opt,name=etime,proto3" json:"etime"` // 结束时间 + Plunderexp int32 `protobuf:"varint,13,opt,name=plunderexp,proto3" json:"plunderexp"` // 积分 排行用 + Develop map[int32]int32 `protobuf:"bytes,14,rep,name=develop,proto3" json:"develop" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 海航术 } func (x *DBPlunder) Reset() { @@ -87,6 +88,13 @@ func (x *DBPlunder) GetUid() string { return "" } +func (x *DBPlunder) GetUinfo() *BaseUserInfo { + if x != nil { + return x.Uinfo + } + return nil +} + func (x *DBPlunder) GetLandid() string { if x != nil { return x.Landid @@ -626,95 +634,97 @@ var file_plunder_plunder_db_proto_rawDesc = []byte{ 0x72, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x9a, 0x03, 0x0a, 0x09, 0x44, 0x42, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, + 0x74, 0x6f, 0x22, 0xbf, 0x03, 0x0a, 0x09, 0x44, 0x42, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, - 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x6c, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x69, - 0x6e, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x65, 0x74, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, 0x65, - 0x74, 0x6f, 0x75, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, - 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, - 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x78, 0x70, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x78, 0x70, - 0x12, 0x31, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x44, 0x42, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x2e, 0x44, 0x65, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x64, 0x65, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x1a, 0x3a, 0x0a, 0x0c, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x3f, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x6e, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, - 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x74, 0x69, 0x6d, 0x65, - 0x22, 0x5d, 0x0a, 0x0b, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x69, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x6f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x22, - 0xc2, 0x01, 0x0a, 0x08, 0x53, 0x68, 0x69, 0x70, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, - 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x20, - 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, - 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, - 0x0a, 0x02, 0x63, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x63, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x50, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x74, 0x52, 0x06, 0x64, 0x65, - 0x66, 0x65, 0x6e, 0x64, 0x22, 0x8c, 0x03, 0x0a, 0x0d, 0x44, 0x42, 0x50, 0x6c, 0x75, 0x6e, 0x64, - 0x65, 0x72, 0x4c, 0x61, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x05, 0x75, 0x69, 0x6e, 0x66, 0x6f, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, - 0x72, 0x4c, 0x61, 0x6e, 0x64, 0x2e, 0x55, 0x69, 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x05, 0x75, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x2c, 0x0a, 0x04, 0x73, 0x68, 0x69, 0x70, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x44, 0x42, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, - 0x72, 0x4c, 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x04, 0x73, 0x68, 0x69, 0x70, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, - 0x4c, 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x47, 0x0a, 0x0a, - 0x55, 0x69, 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, - 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x09, 0x53, 0x68, 0x69, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x63, 0x6f, - 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0x99, 0x01, 0x0a, 0x11, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x52, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x0e, 0x0a, 0x02, 0x70, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x70, 0x31, 0x12, - 0x0e, 0x0a, 0x02, 0x70, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x70, 0x32, 0x12, - 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x77, - 0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x77, 0x69, 0x6e, 0x22, - 0x49, 0x0a, 0x0f, 0x44, 0x42, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x64, 0x12, 0x23, 0x0a, 0x05, 0x75, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x05, 0x75, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x6e, 0x64, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x12, + 0x22, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x6c, + 0x69, 0x6e, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x74, 0x6f, 0x75, 0x74, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x05, 0x52, 0x06, 0x73, 0x65, 0x74, 0x6f, 0x75, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, + 0x72, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, + 0x65, 0x78, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x6e, 0x64, + 0x65, 0x72, 0x65, 0x78, 0x70, 0x12, 0x31, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, + 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x44, 0x42, 0x50, 0x6c, 0x75, 0x6e, 0x64, + 0x65, 0x72, 0x2e, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x07, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x1a, 0x3a, 0x0a, 0x0c, 0x44, 0x65, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3f, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, + 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x73, 0x65, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x6f, 0x73, + 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x5d, 0x0a, 0x0b, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, + 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, + 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6f, 0x69, 0x64, 0x22, 0xc2, 0x01, 0x0a, 0x08, 0x53, 0x68, 0x69, 0x70, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x75, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x52, + 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x63, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x63, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x64, + 0x65, 0x66, 0x65, 0x6e, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, + 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, + 0x74, 0x52, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x22, 0x8c, 0x03, 0x0a, 0x0d, 0x44, 0x42, + 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x61, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x05, 0x75, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x50, + 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x61, 0x6e, 0x64, 0x2e, 0x55, 0x69, 0x6e, 0x66, 0x6f, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x75, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x2c, 0x0a, 0x04, + 0x73, 0x68, 0x69, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x44, 0x42, 0x50, + 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x73, 0x68, 0x69, 0x70, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x63, + 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x50, 0x6c, + 0x75, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, + 0x65, 0x1a, 0x47, 0x0a, 0x0a, 0x55, 0x69, 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x09, 0x53, 0x68, + 0x69, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, + 0x0a, 0x0a, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x99, 0x01, 0x0a, 0x11, 0x50, 0x6c, 0x75, + 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x70, 0x31, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x70, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x62, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x69, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x73, 0x77, 0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, + 0x73, 0x77, 0x69, 0x6e, 0x22, 0x49, 0x0a, 0x0f, 0x44, 0x42, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x50, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, + 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -742,25 +752,26 @@ var file_plunder_plunder_db_proto_goTypes = []interface{}{ nil, // 8: DBPlunderLand.UinfoEntry nil, // 9: DBPlunderLand.ShipEntry nil, // 10: DBPlunderLand.ScoreEntry - (*DBPlayerBattleFormt)(nil), // 11: DBPlayerBattleFormt - (*BaseUserInfo)(nil), // 12: BaseUserInfo + (*BaseUserInfo)(nil), // 11: BaseUserInfo + (*DBPlayerBattleFormt)(nil), // 12: DBPlayerBattleFormt } var file_plunder_plunder_db_proto_depIdxs = []int32{ - 1, // 0: DBPlunder.line:type_name -> TransportLine - 7, // 1: DBPlunder.develop:type_name -> DBPlunder.DevelopEntry - 2, // 2: ShipData.line:type_name -> PlunderLine - 11, // 3: ShipData.defend:type_name -> DBPlayerBattleFormt - 8, // 4: DBPlunderLand.uinfo:type_name -> DBPlunderLand.UinfoEntry - 9, // 5: DBPlunderLand.ship:type_name -> DBPlunderLand.ShipEntry - 10, // 6: DBPlunderLand.score:type_name -> DBPlunderLand.ScoreEntry - 5, // 7: DBPlunderRecord.data:type_name -> PlunderRecordData - 12, // 8: DBPlunderLand.UinfoEntry.value:type_name -> BaseUserInfo - 3, // 9: DBPlunderLand.ShipEntry.value:type_name -> ShipData - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 11, // 0: DBPlunder.uinfo:type_name -> BaseUserInfo + 1, // 1: DBPlunder.line:type_name -> TransportLine + 7, // 2: DBPlunder.develop:type_name -> DBPlunder.DevelopEntry + 2, // 3: ShipData.line:type_name -> PlunderLine + 12, // 4: ShipData.defend:type_name -> DBPlayerBattleFormt + 8, // 5: DBPlunderLand.uinfo:type_name -> DBPlunderLand.UinfoEntry + 9, // 6: DBPlunderLand.ship:type_name -> DBPlunderLand.ShipEntry + 10, // 7: DBPlunderLand.score:type_name -> DBPlunderLand.ScoreEntry + 5, // 8: DBPlunderRecord.data:type_name -> PlunderRecordData + 11, // 9: DBPlunderLand.UinfoEntry.value:type_name -> BaseUserInfo + 3, // 10: DBPlunderLand.ShipEntry.value:type_name -> ShipData + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_plunder_plunder_db_proto_init() } diff --git a/sys/db/dbmodel.go b/sys/db/dbmodel.go index 0ac89382a..3c66ff6d3 100644 --- a/sys/db/dbmodel.go +++ b/sys/db/dbmodel.go @@ -395,6 +395,31 @@ func (this *DBModel) ChangeLists(uid string, datas map[string]interface{}, opt . return nil } +//批量修改多个用户数据 +func (this *DBModel) BatchChange(uids []string, datas map[string]interface{}, opt ...DBOption) (err error) { + pipe := this.Redis.RedisPipe(context.TODO()) + for _, uid := range uids { + if err = pipe.HMSet(this.ukey(uid), datas); err != nil { + log.Error("DBModel ChangeList", log.Field{Key: "err", Value: err.Error()}) + return + } + } + pipe.Exec() + + option := newDBOption(opt...) + if option.IsMgoLog { + for _, uid := range uids { + err = this.UpdateModelLogs(this.TableName, uid, bson.M{"uid": uid}, datas) + } + } + if this.Expired > 0 { + for _, uid := range uids { + this.conn.UpDateModelExpired(this.ukey(uid), nil, this.Expired) + } + } + return nil +} + // 读取全部数据 func (this *DBModel) Get(uid string, data interface{}, opt ...DBOption) (err error) { //defer log.Debug("DBModel Get", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "data", Value: data})