掠夺模块
This commit is contained in:
parent
a8c8bd330a
commit
33ab6cc66b
@ -127,6 +127,7 @@ const (
|
||||
ModuleWhackamole core.M_Modules = "whackamole" //打豚鼠
|
||||
ModuleMonkey core.M_Modules = "monkey" //猴拳
|
||||
ModuleIntegral core.M_Modules = "integral" // 积分boss
|
||||
ModulePlunder core.M_Modules = "plunder" //掠夺
|
||||
)
|
||||
|
||||
// 数据表名定义处
|
||||
@ -445,7 +446,9 @@ const (
|
||||
TableIntegralRank = "integralrank" //排名
|
||||
|
||||
// 助战信息列表
|
||||
TableAssist = "assist"
|
||||
TableAssist = "assist"
|
||||
TablePlunder = "plunder" // 掠夺
|
||||
TablePlunderLand = "plunderland" // 掠夺岛
|
||||
)
|
||||
|
||||
// RPC服务接口定义处
|
||||
|
@ -31,6 +31,7 @@ func (this *Monkey) GetType() core.M_Modules {
|
||||
func (this *Monkey) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
this.service = service.(comm.IService)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
17
modules/plunder/api.go
Normal file
17
modules/plunder/api.go
Normal file
@ -0,0 +1,17 @@
|
||||
package plunder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
modules.MCompGate
|
||||
module *Plunder
|
||||
}
|
||||
|
||||
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
_ = this.MCompGate.Init(service, module, comp, options)
|
||||
this.module = module.(*Plunder)
|
||||
return
|
||||
}
|
36
modules/plunder/api_getlist.go
Normal file
36
modules/plunder/api_getlist.go
Normal file
@ -0,0 +1,36 @@
|
||||
package plunder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.PlunderGetListReq) (errdata *pb.ErrorData) {
|
||||
return
|
||||
}
|
||||
|
||||
// 获取基本信息
|
||||
func (this *apiComp) GetList(session comm.IUserSession, req *pb.PlunderGetListReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
err error
|
||||
list *pb.DBPlunder
|
||||
)
|
||||
if errdata = this.GetListCheck(session, req); errdata != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if list, err = this.module.model.getPlunderData(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), "getlist", &pb.PlunderGetListResp{
|
||||
List: list,
|
||||
Land: &pb.DBPlunderLand{},
|
||||
})
|
||||
|
||||
return
|
||||
}
|
46
modules/plunder/configure.go
Normal file
46
modules/plunder/configure.go
Normal file
@ -0,0 +1,46 @@
|
||||
package plunder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const (
|
||||
monkey_main = "game_monkeymain.json"
|
||||
)
|
||||
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
module *Plunder
|
||||
hlock sync.RWMutex
|
||||
}
|
||||
|
||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||
this.module = module.(*Plunder)
|
||||
err = this.LoadConfigure(monkey_main, cfg.NewGameMonkeyMain)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 通过章节id 获取信息
|
||||
func (this *configureComp) getGameMonkeyData(id int32) (result *cfg.GameMonkeyMainData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(monkey_main); err == nil {
|
||||
if result, ok = v.(*cfg.GameMonkeyMain).GetDataMap()[id]; ok {
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 获取章节对应的奖励
|
||||
func (this *configureComp) getGameMonkeyRewardData(chapterid int32) (result []*cfg.GameMonkeyRewardData, err error) {
|
||||
|
||||
return
|
||||
}
|
48
modules/plunder/model_land.go
Normal file
48
modules/plunder/model_land.go
Normal file
@ -0,0 +1,48 @@
|
||||
package plunder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type modelLand struct {
|
||||
modules.MCompModel
|
||||
module *Plunder
|
||||
}
|
||||
|
||||
func (this *modelLand) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.TableName = comm.TablePlunderLand
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 获取岛基本数据
|
||||
func (this *modelLand) getPlunderLandData(uid string) (info *pb.DBPlunderLand, err error) {
|
||||
info = &pb.DBPlunderLand{}
|
||||
if err = this.Get(uid, info); err != nil && err != mgo.MongodbNil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
if err == mgo.MongodbNil {
|
||||
info = &pb.DBPlunderLand{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uinfo: map[string]*pb.BaseUserInfo{},
|
||||
Ship: map[string]*pb.ShipData{},
|
||||
Etime: 0,
|
||||
}
|
||||
err = this.Add(uid, info)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 修改岛信息
|
||||
func (this *modelLand) changePlunderLandData(uid string, update map[string]interface{}) (err error) {
|
||||
err = this.Change(uid, update)
|
||||
return
|
||||
}
|
49
modules/plunder/model_plunder.go
Normal file
49
modules/plunder/model_plunder.go
Normal file
@ -0,0 +1,49 @@
|
||||
package plunder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||
)
|
||||
|
||||
type modelPlunder struct {
|
||||
modules.MCompModel
|
||||
module *Plunder
|
||||
}
|
||||
|
||||
func (this *modelPlunder) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.TableName = comm.TablePlunder
|
||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 获取猴拳基本数据
|
||||
func (this *modelPlunder) getPlunderData(uid string) (info *pb.DBPlunder, err error) {
|
||||
info = &pb.DBPlunder{}
|
||||
if err = this.Get(uid, info); err != nil && err != mgo.MongodbNil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
if err == mgo.MongodbNil {
|
||||
info = &pb.DBPlunder{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: uid,
|
||||
}
|
||||
err = this.Add(uid, info)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *modelPlunder) changePlunderData(uid string, update map[string]interface{}) (err error) {
|
||||
err = this.Change(uid, update)
|
||||
return
|
||||
}
|
50
modules/plunder/module.go
Normal file
50
modules/plunder/module.go
Normal file
@ -0,0 +1,50 @@
|
||||
package plunder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
func NewModule() core.IModule {
|
||||
m := new(Plunder)
|
||||
return m
|
||||
}
|
||||
|
||||
/*
|
||||
模块名称:猜颜色
|
||||
*/
|
||||
type Plunder struct {
|
||||
modules.ModuleBase
|
||||
service comm.IService
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
model *modelPlunder
|
||||
}
|
||||
|
||||
// 模块名
|
||||
func (this *Plunder) GetType() core.M_Modules {
|
||||
return comm.ModulePlunder
|
||||
}
|
||||
|
||||
// 模块初始化接口
|
||||
func (this *Plunder) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
this.service = service.(comm.IService)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (this *Plunder) Start() (err error) {
|
||||
if err = this.ModuleBase.Start(); err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *Plunder) OnInstallComp() {
|
||||
this.ModuleBase.OnInstallComp()
|
||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
this.model = this.RegisterComp(new(modelPlunder)).(*modelPlunder)
|
||||
}
|
546
pb/plunder_db.pb.go
Normal file
546
pb/plunder_db.pb.go
Normal file
@ -0,0 +1,546 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc v3.20.0
|
||||
// source: plunder/plunder_db.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// 玩家的掠夺信息
|
||||
type DBPlunder struct {
|
||||
state protoimpl.MessageState
|
||||
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"` // 货源列表
|
||||
Refresh int32 `protobuf:"varint,7,opt,name=refresh,proto3" json:"refresh"` // 刷新次数
|
||||
Ctime int64 `protobuf:"varint,8,opt,name=ctime,proto3" json:"ctime"` // 刷新时间 客户端不用
|
||||
}
|
||||
|
||||
func (x *DBPlunder) Reset() {
|
||||
*x = DBPlunder{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_plunder_plunder_db_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DBPlunder) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DBPlunder) ProtoMessage() {}
|
||||
|
||||
func (x *DBPlunder) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_plunder_plunder_db_proto_msgTypes[0]
|
||||
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 DBPlunder.ProtoReflect.Descriptor instead.
|
||||
func (*DBPlunder) Descriptor() ([]byte, []int) {
|
||||
return file_plunder_plunder_db_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *DBPlunder) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBPlunder) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBPlunder) GetLandid() string {
|
||||
if x != nil {
|
||||
return x.Landid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBPlunder) GetLine() []*PlunderLine {
|
||||
if x != nil {
|
||||
return x.Line
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBPlunder) GetCount() int32 {
|
||||
if x != nil {
|
||||
return x.Count
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBPlunder) GetSource() []int32 {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBPlunder) GetRefresh() int32 {
|
||||
if x != nil {
|
||||
return x.Refresh
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBPlunder) GetCtime() int64 {
|
||||
if x != nil {
|
||||
return x.Ctime
|
||||
}
|
||||
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 开启
|
||||
}
|
||||
|
||||
func (x *PlunderLine) Reset() {
|
||||
*x = PlunderLine{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_plunder_plunder_db_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PlunderLine) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PlunderLine) ProtoMessage() {}
|
||||
|
||||
func (x *PlunderLine) 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 PlunderLine.ProtoReflect.Descriptor instead.
|
||||
func (*PlunderLine) Descriptor() ([]byte, []int) {
|
||||
return file_plunder_plunder_db_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *PlunderLine) GetItype() int32 {
|
||||
if x != nil {
|
||||
return x.Itype
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PlunderLine) GetEtime() int64 {
|
||||
if x != nil {
|
||||
return x.Etime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PlunderLine) GetCid() int32 {
|
||||
if x != nil {
|
||||
return x.Cid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PlunderLine) GetOid() string {
|
||||
if x != nil {
|
||||
return x.Oid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PlunderLine) GetClosetime() int64 {
|
||||
if x != nil {
|
||||
return x.Closetime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// 船信息
|
||||
type ShipData struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"`
|
||||
Line *PlunderLine `protobuf:"bytes,2,opt,name=line,proto3" json:"line"`
|
||||
Hero map[string]*LineData `protobuf:"bytes,3,rep,name=hero,proto3" json:"hero" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // 英雄信息
|
||||
Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status"` // 状态 0 运输 1 正在被攻击 2 战败cd中 3 掠夺成功
|
||||
Cd int64 `protobuf:"varint,5,opt,name=cd,proto3" json:"cd"` //cd 结束时间
|
||||
Client bool `protobuf:"varint,7,opt,name=client,proto3" json:"client"` // 客户端状态 服务器不用
|
||||
}
|
||||
|
||||
func (x *ShipData) Reset() {
|
||||
*x = ShipData{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_plunder_plunder_db_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ShipData) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ShipData) ProtoMessage() {}
|
||||
|
||||
func (x *ShipData) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_plunder_plunder_db_proto_msgTypes[2]
|
||||
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 ShipData.ProtoReflect.Descriptor instead.
|
||||
func (*ShipData) Descriptor() ([]byte, []int) {
|
||||
return file_plunder_plunder_db_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ShipData) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ShipData) GetLine() *PlunderLine {
|
||||
if x != nil {
|
||||
return x.Line
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ShipData) GetHero() map[string]*LineData {
|
||||
if x != nil {
|
||||
return x.Hero
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ShipData) GetStatus() int32 {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ShipData) GetCd() int64 {
|
||||
if x != nil {
|
||||
return x.Cd
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ShipData) GetClient() bool {
|
||||
if x != nil {
|
||||
return x.Client
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 掠夺岛
|
||||
type DBPlunderLand struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
|
||||
Uinfo map[string]*BaseUserInfo `protobuf:"bytes,2,rep,name=uinfo,proto3" json:"uinfo" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // 成员信息 key uid
|
||||
Ship map[string]*ShipData `protobuf:"bytes,3,rep,name=ship,proto3" json:"ship" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // 运输的船 key 唯一id
|
||||
Etime int64 `protobuf:"varint,4,opt,name=etime,proto3" json:"etime"` // 结束时间
|
||||
}
|
||||
|
||||
func (x *DBPlunderLand) Reset() {
|
||||
*x = DBPlunderLand{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_plunder_plunder_db_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DBPlunderLand) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DBPlunderLand) ProtoMessage() {}
|
||||
|
||||
func (x *DBPlunderLand) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_plunder_plunder_db_proto_msgTypes[3]
|
||||
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 DBPlunderLand.ProtoReflect.Descriptor instead.
|
||||
func (*DBPlunderLand) Descriptor() ([]byte, []int) {
|
||||
return file_plunder_plunder_db_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *DBPlunderLand) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBPlunderLand) GetUinfo() map[string]*BaseUserInfo {
|
||||
if x != nil {
|
||||
return x.Uinfo
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBPlunderLand) GetShip() map[string]*ShipData {
|
||||
if x != nil {
|
||||
return x.Ship
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBPlunderLand) GetEtime() int64 {
|
||||
if x != nil {
|
||||
return x.Etime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_plunder_plunder_db_proto protoreflect.FileDescriptor
|
||||
|
||||
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, 0x17, 0x62, 0x61, 0x74, 0x74,
|
||||
0x6c, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0xc5, 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, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65,
|
||||
0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73,
|
||||
0x68, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 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, 0xeb, 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, 0x27, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x03, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x48,
|
||||
0x65, 0x72, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 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, 0x1a, 0x42,
|
||||
0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 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, 0x4c,
|
||||
0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
|
||||
0x38, 0x01, 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, 0x09, 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 (
|
||||
file_plunder_plunder_db_proto_rawDescOnce sync.Once
|
||||
file_plunder_plunder_db_proto_rawDescData = file_plunder_plunder_db_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_plunder_plunder_db_proto_rawDescGZIP() []byte {
|
||||
file_plunder_plunder_db_proto_rawDescOnce.Do(func() {
|
||||
file_plunder_plunder_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_plunder_plunder_db_proto_rawDescData)
|
||||
})
|
||||
return file_plunder_plunder_db_proto_rawDescData
|
||||
}
|
||||
|
||||
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: ShipData.HeroEntry
|
||||
nil, // 5: DBPlunderLand.UinfoEntry
|
||||
nil, // 6: DBPlunderLand.ShipEntry
|
||||
(*LineData)(nil), // 7: LineData
|
||||
(*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
|
||||
4, // 2: ShipData.hero:type_name -> ShipData.HeroEntry
|
||||
5, // 3: DBPlunderLand.uinfo:type_name -> DBPlunderLand.UinfoEntry
|
||||
6, // 4: DBPlunderLand.ship:type_name -> DBPlunderLand.ShipEntry
|
||||
7, // 5: ShipData.HeroEntry.value:type_name -> LineData
|
||||
8, // 6: DBPlunderLand.UinfoEntry.value:type_name -> BaseUserInfo
|
||||
2, // 7: DBPlunderLand.ShipEntry.value:type_name -> ShipData
|
||||
8, // [8:8] is the sub-list for method output_type
|
||||
8, // [8:8] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_plunder_plunder_db_proto_init() }
|
||||
func file_plunder_plunder_db_proto_init() {
|
||||
if File_plunder_plunder_db_proto != nil {
|
||||
return
|
||||
}
|
||||
file_battle_battle_msg_proto_init()
|
||||
file_comm_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_plunder_plunder_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DBPlunder); 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[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PlunderLine); 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[2].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[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DBPlunderLand); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_plunder_plunder_db_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_plunder_plunder_db_proto_goTypes,
|
||||
DependencyIndexes: file_plunder_plunder_db_proto_depIdxs,
|
||||
MessageInfos: file_plunder_plunder_db_proto_msgTypes,
|
||||
}.Build()
|
||||
File_plunder_plunder_db_proto = out.File
|
||||
file_plunder_plunder_db_proto_rawDesc = nil
|
||||
file_plunder_plunder_db_proto_goTypes = nil
|
||||
file_plunder_plunder_db_proto_depIdxs = nil
|
||||
}
|
1051
pb/plunder_msg.pb.go
Normal file
1051
pb/plunder_msg.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user