From 6d7d65483af7b0bde1de0d5f656c029ae9b6b75b Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 18 Jan 2024 20:22:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A0=E5=A4=BA=E7=8A=B6=E6=80=81=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/plunder/api_challenge.go | 14 ++ modules/plunder/api_challengeover.go | 19 +- modules/plunder/api_pvpchallenge.go | 6 +- modules/plunder/api_pvpchallengeover.go | 21 +- modules/plunder/api_reach.go | 73 +++++++ modules/plunder/model_land.go | 2 +- modules/plunder/model_plunder.go | 4 +- pb/plunder_db.pb.go | 263 +++++++++++++++--------- 8 files changed, 292 insertions(+), 110 deletions(-) create mode 100644 modules/plunder/api_reach.go diff --git a/modules/plunder/api_challenge.go b/modules/plunder/api_challenge.go index a0bb16318..6bf78125d 100644 --- a/modules/plunder/api_challenge.go +++ b/modules/plunder/api_challenge.go @@ -38,6 +38,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PlunderChallen } return } + if len(list.Source) < int(req.Index) { // 数组长度校验 errdata = &pb.ErrorData{ Code: pb.ErrorCode_ReqParameterError, @@ -46,6 +47,18 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PlunderChallen } return } + + for k := range list.Setout { + if req.Index == int32(k) { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + Message: fmt.Sprintf("list.Setout %d,", req.Pos), + } + return + } + } + // 配置校验 if conf, err = this.module.configure.getGamePlunderDataById(list.Source[req.Index]); err != nil { errdata = &pb.ErrorData{ @@ -73,6 +86,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PlunderChallen if errdata != nil { return } + session.SendMsg(string(this.module.GetType()), "challenge", &pb.PlunderChallengeResp{ Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, Rulesid: battleConf.BattleReadyID, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist, Tasks: record.Tasks}, }) diff --git a/modules/plunder/api_challengeover.go b/modules/plunder/api_challengeover.go index e77345c8d..48814f8d5 100644 --- a/modules/plunder/api_challengeover.go +++ b/modules/plunder/api_challengeover.go @@ -37,7 +37,9 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PlunderCha land *pb.DBPlunderLand // 岛屿数据 shipData *pb.ShipData // 船 users []string + update map[string]interface{} // ) + update = make(map[string]interface{}) changExp = make(map[string]int32, 0) if errdata = this.ChallengeOverCheck(session, req); errdata != nil { return // 参数校验失败直接返回 @@ -102,17 +104,24 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PlunderCha shipData = &pb.ShipData{ Uid: session.GetUserId(), Line: &pb.PlunderLine{ - Itype: req.Itype, - Etime: configure.Now().Unix() + int64(conf.Extime), - Cid: conf.Id, - Oid: _id, - Closetime: 0, + Itype: req.Itype, + Etime: configure.Now().Unix() + int64(conf.Extime), + Cid: conf.Id, + Oid: _id, }, Status: 0, Cd: 0, Client: false, Defend: req.Report.Info.Buleflist, } + list.Count++ + update["count"] = list.Count + list.Line[req.Index].Oid = _id + update["line"] = list.Line + list.Setout = append(list.Setout, req.Index) + update["setout"] = list.Setout + + this.module.modelPlunder.changePlunderData(session.GetUserId(), update) // 此处需要redis 锁 land.Ship[_id] = shipData // 一条新船 diff --git a/modules/plunder/api_pvpchallenge.go b/modules/plunder/api_pvpchallenge.go index 279687884..55350c560 100644 --- a/modules/plunder/api_pvpchallenge.go +++ b/modules/plunder/api_pvpchallenge.go @@ -72,7 +72,11 @@ func (this *apiComp) PvpChallenge(session comm.IUserSession, req *pb.PlunderPvpC }); errdata != nil { return } - + land.Ship[req.Oid].Status = 1 + // 修改状态 + this.module.modelLand.changePlunderLandData(land.Id, map[string]interface{}{ + "ship": land.Ship, + }) session.SendMsg(string(this.module.GetType()), "challenge", &pb.ArenaChallengeResp{Info: &pb.BattleInfo{ Id: record.Id, Title: record.Title, diff --git a/modules/plunder/api_pvpchallengeover.go b/modules/plunder/api_pvpchallengeover.go index e1bed57d0..6ca941282 100644 --- a/modules/plunder/api_pvpchallengeover.go +++ b/modules/plunder/api_pvpchallengeover.go @@ -26,6 +26,7 @@ func (this *apiComp) PvpChallengeOver(session comm.IUserSession, req *pb.Plunder list *pb.DBPlunder iswin bool conf *cfg.GamePlunderData + users []string ) if errdata = this.PvpChallengeOverCheck(session, req); errdata != nil { return @@ -46,7 +47,9 @@ func (this *apiComp) PvpChallengeOver(session comm.IUserSession, req *pb.Plunder } return } - + for _, v := range land.Uinfo { + users = append(users, v.Uid) + } // 校验oid if _, ok := land.Ship[req.Oid]; !ok { errdata = &pb.ErrorData{ @@ -71,8 +74,24 @@ func (this *apiComp) PvpChallengeOver(session comm.IUserSession, req *pb.Plunder if !iswin { land.Ship[req.Oid].Cd = configure.Now().Unix() + int64(conf.Protecttime) land.Ship[req.Oid].Status = 2 + this.module.modelLand.changePlunderLandData(land.Id, map[string]interface{}{ + "ship": land.Ship, + }) + // 通知大家 + this.module.SendMsgToUsers(string(this.module.GetType()), "change", &pb.PlunderChangePush{ + Ship: land.Ship, + }, users...) return } + land.Ship[req.Oid].Status = 3 + // 修改状态 + this.module.modelLand.changePlunderLandData(land.Id, map[string]interface{}{ + "ship": land.Ship, + }) + // 通知大家 + this.module.SendMsgToUsers(string(this.module.GetType()), "change", &pb.PlunderChangePush{ + Ship: land.Ship, + }, users...) session.SendMsg(string(this.module.GetType()), "pvpchallengeover", &pb.PlunderPvpChallengeOverResp{ Atno: []*pb.UserAtno{}, }) diff --git a/modules/plunder/api_reach.go b/modules/plunder/api_reach.go new file mode 100644 index 000000000..e7225fc1d --- /dev/null +++ b/modules/plunder/api_reach.go @@ -0,0 +1,73 @@ +package plunder + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +// 参数校验 +func (this *apiComp) ReachCheck(session comm.IUserSession, req *pb.PlunderReachReq) (errdata *pb.ErrorData) { + if len(req.Oid) == 0 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } + } + return +} + +// 船准备出发 +func (this *apiComp) Reach(session comm.IUserSession, req *pb.PlunderReachReq) (errdata *pb.ErrorData) { + var ( + err error + list *pb.DBPlunder + land *pb.DBPlunderLand // 岛屿数据 + ) + + if errdata = this.ReachCheck(session, req); errdata != nil { + return // 参数校验失败直接返回 + } + + if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Message: err.Error(), + } + return + } + if land, err = this.module.modelLand.getPlunderLandData(list.Landid); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Message: err.Error(), + } + return + } + for _, oid := range req.Oid { + if _, ok := land.Ship[oid]; !ok { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Message: err.Error(), + } + return + } else { + for _, v := range list.Line { + if v.Oid == oid { + v.Oid = "" + } + } + delete(land.Ship, oid) + } + } + + this.module.modelPlunder.changePlunderData(session.GetUserId(), map[string]interface{}{ + "line": list.Line, + }) + this.module.modelLand.changePlunderLandData(land.Id, map[string]interface{}{ + "ship": land.Ship, + }) + session.SendMsg(string(this.module.GetType()), "reach", &pb.PlunderReachResp{ + Line: []*pb.PlunderLine{}, + Ship: land.Ship, + }) + return +} diff --git a/modules/plunder/model_land.go b/modules/plunder/model_land.go index c849d5234..07fb87b36 100644 --- a/modules/plunder/model_land.go +++ b/modules/plunder/model_land.go @@ -69,7 +69,7 @@ func (this *modelLand) createPlunderLandData(uid string) (land *pb.DBPlunderLand if limtSocre < 0 { limtSocre = 0 } - cur, err := this.DB.Find(core.SqlTable(comm.TableUser), bson.M{"gold": bson.M{"$gte": limtSocre}}, options.Find().SetSkip(int64(0)).SetLimit(int64(30))) + cur, err := this.DB.Find(core.SqlTable(comm.TableUser), bson.M{"gold": bson.M{"$gte": limtSocre}, "name": bson.M{"$ne": ""}}, options.Find().SetSkip(int64(0)).SetLimit(int64(30))) for cur.Next(context.TODO()) { tmp := &pb.DBUser{} if err = cur.Decode(tmp); err == nil { diff --git a/modules/plunder/model_plunder.go b/modules/plunder/model_plunder.go index 88f769b80..c471bb60b 100644 --- a/modules/plunder/model_plunder.go +++ b/modules/plunder/model_plunder.go @@ -44,9 +44,9 @@ func (this *modelPlunder) getPlunderData(uid string) (info *pb.DBPlunder, err er } for i := 0; i < 3; i++ { // 队列固定三条 - info.Line = append(info.Line, &pb.PlunderLine{}) + info.Line = append(info.Line, &pb.TransportLine{}) } - info.Line = append(info.Line, &pb.PlunderLine{ + info.Line = append(info.Line, &pb.TransportLine{ Closetime: -1, // 需要手动解锁 }) // 刷新货物信息 diff --git a/pb/plunder_db.pb.go b/pb/plunder_db.pb.go index f377155c4..4d1457219 100644 --- a/pb/plunder_db.pb.go +++ b/pb/plunder_db.pb.go @@ -26,16 +26,16 @@ type DBPlunder struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - 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 []*PlunderLine `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"` // 当前赛季积分 + 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"` // 当前赛季积分 } func (x *DBPlunder) Reset() { @@ -91,7 +91,7 @@ func (x *DBPlunder) GetLandid() string { return "" } -func (x *DBPlunder) GetLine() []*PlunderLine { +func (x *DBPlunder) GetLine() []*TransportLine { if x != nil { return x.Line } @@ -140,23 +140,77 @@ func (x *DBPlunder) GetScore() int32 { return 0 } +type TransportLine struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Oid string `protobuf:"bytes,1,opt,name=oid,proto3" json:"oid"` // 唯一id + Closetime int64 `protobuf:"varint,2,opt,name=closetime,proto3" json:"closetime"` // 格子关闭时间 -1 关闭 0 开启 +} + +func (x *TransportLine) Reset() { + *x = TransportLine{} + if protoimpl.UnsafeEnabled { + mi := &file_plunder_plunder_db_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransportLine) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransportLine) ProtoMessage() {} + +func (x *TransportLine) ProtoReflect() protoreflect.Message { + mi := &file_plunder_plunder_db_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransportLine.ProtoReflect.Descriptor instead. +func (*TransportLine) Descriptor() ([]byte, []int) { + return file_plunder_plunder_db_proto_rawDescGZIP(), []int{1} +} + +func (x *TransportLine) GetOid() string { + if x != nil { + return x.Oid + } + return "" +} + +func (x *TransportLine) GetClosetime() int64 { + if x != nil { + return x.Closetime + } + return 0 +} + // 自己的船 type PlunderLine struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Itype int32 `protobuf:"varint,1,opt,name=itype,proto3" json:"itype"` // 运输品质 - Etime int64 `protobuf:"varint,2,opt,name=etime,proto3" json:"etime"` // 到达时间 - Cid int32 `protobuf:"varint,3,opt,name=cid,proto3" json:"cid"` // 货物配置id - Oid string `protobuf:"bytes,4,opt,name=oid,proto3" json:"oid"` // 唯一id - Closetime int64 `protobuf:"varint,5,opt,name=closetime,proto3" json:"closetime"` // 格子关闭时间 -1 关闭 0 开启 + Itype int32 `protobuf:"varint,1,opt,name=itype,proto3" json:"itype"` // 运输品质 + Etime int64 `protobuf:"varint,2,opt,name=etime,proto3" json:"etime"` // 到达时间 + Cid int32 `protobuf:"varint,3,opt,name=cid,proto3" json:"cid"` // 货物配置id + Oid string `protobuf:"bytes,4,opt,name=oid,proto3" json:"oid"` // 唯一id } func (x *PlunderLine) Reset() { *x = PlunderLine{} if protoimpl.UnsafeEnabled { - mi := &file_plunder_plunder_db_proto_msgTypes[1] + mi := &file_plunder_plunder_db_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -169,7 +223,7 @@ func (x *PlunderLine) String() string { func (*PlunderLine) ProtoMessage() {} func (x *PlunderLine) ProtoReflect() protoreflect.Message { - mi := &file_plunder_plunder_db_proto_msgTypes[1] + mi := &file_plunder_plunder_db_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -182,7 +236,7 @@ func (x *PlunderLine) ProtoReflect() protoreflect.Message { // Deprecated: Use PlunderLine.ProtoReflect.Descriptor instead. func (*PlunderLine) Descriptor() ([]byte, []int) { - return file_plunder_plunder_db_proto_rawDescGZIP(), []int{1} + return file_plunder_plunder_db_proto_rawDescGZIP(), []int{2} } func (x *PlunderLine) GetItype() int32 { @@ -213,13 +267,6 @@ func (x *PlunderLine) GetOid() string { return "" } -func (x *PlunderLine) GetClosetime() int64 { - if x != nil { - return x.Closetime - } - return 0 -} - // 船信息 type ShipData struct { state protoimpl.MessageState @@ -238,7 +285,7 @@ type ShipData struct { func (x *ShipData) Reset() { *x = ShipData{} if protoimpl.UnsafeEnabled { - mi := &file_plunder_plunder_db_proto_msgTypes[2] + mi := &file_plunder_plunder_db_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -251,7 +298,7 @@ func (x *ShipData) String() string { func (*ShipData) ProtoMessage() {} func (x *ShipData) ProtoReflect() protoreflect.Message { - mi := &file_plunder_plunder_db_proto_msgTypes[2] + mi := &file_plunder_plunder_db_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -264,7 +311,7 @@ func (x *ShipData) ProtoReflect() protoreflect.Message { // Deprecated: Use ShipData.ProtoReflect.Descriptor instead. func (*ShipData) Descriptor() ([]byte, []int) { - return file_plunder_plunder_db_proto_rawDescGZIP(), []int{2} + return file_plunder_plunder_db_proto_rawDescGZIP(), []int{3} } func (x *ShipData) GetUid() string { @@ -324,7 +371,7 @@ type DBPlunderLand struct { func (x *DBPlunderLand) Reset() { *x = DBPlunderLand{} if protoimpl.UnsafeEnabled { - mi := &file_plunder_plunder_db_proto_msgTypes[3] + mi := &file_plunder_plunder_db_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -337,7 +384,7 @@ func (x *DBPlunderLand) String() string { func (*DBPlunderLand) ProtoMessage() {} func (x *DBPlunderLand) ProtoReflect() protoreflect.Message { - mi := &file_plunder_plunder_db_proto_msgTypes[3] + mi := &file_plunder_plunder_db_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -350,7 +397,7 @@ func (x *DBPlunderLand) ProtoReflect() protoreflect.Message { // Deprecated: Use DBPlunderLand.ProtoReflect.Descriptor instead. func (*DBPlunderLand) Descriptor() ([]byte, []int) { - return file_plunder_plunder_db_proto_rawDescGZIP(), []int{3} + return file_plunder_plunder_db_proto_rawDescGZIP(), []int{4} } func (x *DBPlunderLand) GetId() string { @@ -387,60 +434,63 @@ var file_plunder_plunder_db_proto_rawDesc = []byte{ 0x0a, 0x18, 0x70, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x2f, 0x70, 0x6c, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf3, + 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf5, 0x01, 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, 0x20, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x04, - 0x20, 0x03, 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, 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, 0x22, 0x7b, 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, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x74, 0x69, 0x6d, - 0x65, 0x22, 0xa6, 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, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x63, 0x64, - 0x18, 0x05, 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, 0x26, 0x0a, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x18, 0x08, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, - 0x6d, 0x74, 0x52, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x22, 0xa1, 0x02, 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, 0x14, 0x0a, 0x05, 0x65, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 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, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 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, 0xa6, 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, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x63, 0x64, 0x18, 0x05, 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, 0x26, 0x0a, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, + 0x64, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x74, 0x52, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x22, + 0xa1, 0x02, 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, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -455,25 +505,26 @@ func file_plunder_plunder_db_proto_rawDescGZIP() []byte { return file_plunder_plunder_db_proto_rawDescData } -var file_plunder_plunder_db_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_plunder_plunder_db_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_plunder_plunder_db_proto_goTypes = []interface{}{ (*DBPlunder)(nil), // 0: DBPlunder - (*PlunderLine)(nil), // 1: PlunderLine - (*ShipData)(nil), // 2: ShipData - (*DBPlunderLand)(nil), // 3: DBPlunderLand - nil, // 4: DBPlunderLand.UinfoEntry - nil, // 5: DBPlunderLand.ShipEntry - (*DBBattleFormt)(nil), // 6: DBBattleFormt - (*BaseUserInfo)(nil), // 7: BaseUserInfo + (*TransportLine)(nil), // 1: TransportLine + (*PlunderLine)(nil), // 2: PlunderLine + (*ShipData)(nil), // 3: ShipData + (*DBPlunderLand)(nil), // 4: DBPlunderLand + nil, // 5: DBPlunderLand.UinfoEntry + nil, // 6: DBPlunderLand.ShipEntry + (*DBBattleFormt)(nil), // 7: DBBattleFormt + (*BaseUserInfo)(nil), // 8: BaseUserInfo } var file_plunder_plunder_db_proto_depIdxs = []int32{ - 1, // 0: DBPlunder.line:type_name -> PlunderLine - 1, // 1: ShipData.line:type_name -> PlunderLine - 6, // 2: ShipData.defend:type_name -> DBBattleFormt - 4, // 3: DBPlunderLand.uinfo:type_name -> DBPlunderLand.UinfoEntry - 5, // 4: DBPlunderLand.ship:type_name -> DBPlunderLand.ShipEntry - 7, // 5: DBPlunderLand.UinfoEntry.value:type_name -> BaseUserInfo - 2, // 6: DBPlunderLand.ShipEntry.value:type_name -> ShipData + 1, // 0: DBPlunder.line:type_name -> TransportLine + 2, // 1: ShipData.line:type_name -> PlunderLine + 7, // 2: ShipData.defend:type_name -> DBBattleFormt + 5, // 3: DBPlunderLand.uinfo:type_name -> DBPlunderLand.UinfoEntry + 6, // 4: DBPlunderLand.ship:type_name -> DBPlunderLand.ShipEntry + 8, // 5: DBPlunderLand.UinfoEntry.value:type_name -> BaseUserInfo + 3, // 6: DBPlunderLand.ShipEntry.value:type_name -> ShipData 7, // [7:7] is the sub-list for method output_type 7, // [7:7] is the sub-list for method input_type 7, // [7:7] is the sub-list for extension type_name @@ -502,7 +553,7 @@ func file_plunder_plunder_db_proto_init() { } } file_plunder_plunder_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlunderLine); i { + switch v := v.(*TransportLine); i { case 0: return &v.state case 1: @@ -514,7 +565,7 @@ func file_plunder_plunder_db_proto_init() { } } file_plunder_plunder_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShipData); i { + switch v := v.(*PlunderLine); i { case 0: return &v.state case 1: @@ -526,6 +577,18 @@ func file_plunder_plunder_db_proto_init() { } } file_plunder_plunder_db_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShipData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plunder_plunder_db_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DBPlunderLand); i { case 0: return &v.state @@ -544,7 +607,7 @@ func file_plunder_plunder_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_plunder_plunder_db_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, },