上传商城装备预览
This commit is contained in:
parent
e394133335
commit
fc1b0b800a
@ -110,6 +110,8 @@ type (
|
||||
QueryEquipmentAmount(uid string, equipmentId string) (amount uint32)
|
||||
//添加新武器
|
||||
AddNewEquipments(session IUserSession, cIds map[string]uint32, bPush bool) (code pb.ErrorCode)
|
||||
//创建装备
|
||||
NewEquipment(uid, cid string) (code pb.ErrorCode, equip *pb.DB_Equipment)
|
||||
}
|
||||
IMainline interface {
|
||||
// 修改章节信息
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"go_dreamfactory/lego/sys/event"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
)
|
||||
@ -127,6 +128,23 @@ func (this *Equipment) DelEquipments(session comm.IUserSession, equipIds []strin
|
||||
return
|
||||
}
|
||||
|
||||
//创建新的装备
|
||||
func (this *Equipment) NewEquipment(uid, cid string) (code pb.ErrorCode, equip *pb.DB_Equipment) {
|
||||
var (
|
||||
conf *cfg.GameEquipData
|
||||
err error
|
||||
)
|
||||
if conf, err = this.configure.GetEquipmentConfigureById(cid); err != nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if equip, err = this.modelEquipment.newEquipment(uid, conf); err != nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//Evens--------------------------------------------------------------------------------------------------------------------------------
|
||||
//推送道具变化消息
|
||||
func (this *Equipment) equipmentsChangePush(session comm.IUserSession, items []*pb.DB_Equipment) (err error) {
|
||||
|
@ -62,9 +62,14 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (code pb
|
||||
if code = this.module.ConsumeRes(session, need, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
if code = this.module.DispenseRes(session, give, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
if !conf.Preview {
|
||||
if code = this.module.DispenseRes(session, give, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
switch req.ShopType {
|
||||
case pb.ShopType_GoldShop:
|
||||
filed = "goldShop"
|
||||
|
@ -119,12 +119,17 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
||||
items = append(items, randomGoods(_items))
|
||||
}
|
||||
sdata.Buy = make(map[int32]int32)
|
||||
goods = transGoods(items, sdata.Buy)
|
||||
goods = transGoods(items, sdata)
|
||||
sdata.LastRefreshTime = time.Now().Unix()
|
||||
sdata.ManualRefreshNum++
|
||||
sdata.Items = make([]int32, len(items))
|
||||
for i, v := range items {
|
||||
sdata.Items[i] = v.Key
|
||||
if v.Preview { //是否预览
|
||||
if code, sdata.Preview[v.Key] = this.module.equip.NewEquipment(session.GetUserId(), v.Iteminfo[0].T); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{filed: sdata})
|
||||
} else if !req.IsManualRefresh {
|
||||
@ -139,19 +144,24 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
||||
items = append(items, randomGoods(_items))
|
||||
}
|
||||
sdata.Buy = make(map[int32]int32)
|
||||
goods = transGoods(items, sdata.Buy)
|
||||
sdata.LastRefreshTime = time.Now().Unix()
|
||||
sdata.Items = make([]int32, len(items))
|
||||
for i, v := range items {
|
||||
sdata.Items[i] = v.Key
|
||||
if v.Preview { //是否预览
|
||||
if code, sdata.Preview[v.Key] = this.module.equip.NewEquipment(session.GetUserId(), v.Iteminfo[0].T); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
goods = transGoods(items, sdata)
|
||||
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{filed: sdata})
|
||||
} else { //返回以前的商品列表
|
||||
if items, err = this.module.configure.GetShopItemsConfigureByIds(sdata.Items...); err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
goods = transGoods(items, sdata.Buy)
|
||||
goods = transGoods(items, sdata)
|
||||
}
|
||||
} else {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
|
@ -31,7 +31,7 @@ func randomGoods(goods []*cfg.GameShopitemData) (result *cfg.GameShopitemData) {
|
||||
}
|
||||
|
||||
//转换商品对象
|
||||
func transGoods(goods []*cfg.GameShopitemData, buy map[int32]int32) (result []*pb.ShopItem) {
|
||||
func transGoods(goods []*cfg.GameShopitemData, sdata *pb.UserShopData) (result []*pb.ShopItem) {
|
||||
result = make([]*pb.ShopItem, len(goods))
|
||||
// ok := false
|
||||
// uitem := &pb.DBShopItem{}
|
||||
@ -43,7 +43,7 @@ func transGoods(goods []*cfg.GameShopitemData, buy map[int32]int32) (result []*p
|
||||
GoodsId: v.Key,
|
||||
Sale: int32(v.Sale),
|
||||
}
|
||||
result[i].LeftBuyNum = v.Buyminnum - buy[v.Key]
|
||||
result[i].LeftBuyNum = v.Buyminnum - sdata.Buy[v.Key]
|
||||
result[i].Items = make([]*pb.UserAssets, len(v.Iteminfo))
|
||||
for i1, v1 := range v.Iteminfo {
|
||||
result[i].Items[i1] = &pb.UserAssets{
|
||||
@ -60,6 +60,7 @@ func transGoods(goods []*cfg.GameShopitemData, buy map[int32]int32) (result []*p
|
||||
N: int32(math.Ceil(float64(v1.N) * float64(v.Sale) / float64(1000))),
|
||||
}
|
||||
}
|
||||
result[i].Preview = sdata.Preview[v.Key]
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package shop
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/base"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/sys/db"
|
||||
@ -19,6 +20,8 @@ func NewModule() core.IModule {
|
||||
|
||||
type Shop struct {
|
||||
modules.ModuleBase
|
||||
service base.IRPCXService
|
||||
equip comm.IEquipment //装备系统
|
||||
api_comp *apiComp
|
||||
configure *configureComp
|
||||
modelShop *modelShopComp
|
||||
@ -32,6 +35,16 @@ func (this *Shop) GetType() core.M_Modules {
|
||||
//模块初始化接口 注册用户创建角色事件
|
||||
func (this *Shop) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
this.service = service.(base.IRPCXService)
|
||||
return
|
||||
}
|
||||
func (this *Shop) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
var module core.IModule
|
||||
if module, err = this.service.GetModule(comm.ModuleEquipment); err != nil {
|
||||
return
|
||||
}
|
||||
this.equip = module.(comm.IEquipment)
|
||||
return
|
||||
}
|
||||
|
||||
|
133
pb/shop_db.pb.go
133
pb/shop_db.pb.go
@ -83,10 +83,11 @@ type UserShopData struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
LastRefreshTime int64 `protobuf:"varint,1,opt,name=LastRefreshTime,proto3" json:"LastRefreshTime"` //最后一次刷新时间
|
||||
ManualRefreshNum int32 `protobuf:"varint,2,opt,name=ManualRefreshNum,proto3" json:"ManualRefreshNum"` //手动刷新次数
|
||||
Items []int32 `protobuf:"varint,3,rep,packed,name=Items,proto3" json:"Items"` //商品列表
|
||||
Buy map[int32]int32 `protobuf:"bytes,4,rep,name=buy,proto3" json:"buy" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //购买记录
|
||||
LastRefreshTime int64 `protobuf:"varint,1,opt,name=LastRefreshTime,proto3" json:"LastRefreshTime"` //最后一次刷新时间
|
||||
ManualRefreshNum int32 `protobuf:"varint,2,opt,name=ManualRefreshNum,proto3" json:"ManualRefreshNum"` //手动刷新次数
|
||||
Items []int32 `protobuf:"varint,3,rep,packed,name=Items,proto3" json:"Items"` //商品列表
|
||||
Buy map[int32]int32 `protobuf:"bytes,4,rep,name=buy,proto3" json:"buy" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //购买记录
|
||||
Preview map[int32]*DB_Equipment `protobuf:"bytes,5,rep,name=preview,proto3" json:"preview" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //预览数据
|
||||
}
|
||||
|
||||
func (x *UserShopData) Reset() {
|
||||
@ -149,6 +150,13 @@ func (x *UserShopData) GetBuy() map[int32]int32 {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *UserShopData) GetPreview() map[int32]*DB_Equipment {
|
||||
if x != nil {
|
||||
return x.Preview
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DBShop struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@ -248,45 +256,55 @@ var File_shop_shop_db_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_shop_shop_db_proto_rawDesc = []byte{
|
||||
0x0a, 0x12, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x73, 0x68, 0x6f, 0x70, 0x5f, 0x64, 0x62, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdc, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f,
|
||||
0x70, 0x44, 0x61, 0x74, 0x61, 0x12, 0x28, 0x0a, 0x0f, 0x4c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x66,
|
||||
0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f,
|
||||
0x4c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12,
|
||||
0x2a, 0x0a, 0x10, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68,
|
||||
0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x4d, 0x61, 0x6e, 0x75, 0x61,
|
||||
0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x49,
|
||||
0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x73, 0x12, 0x28, 0x0a, 0x03, 0x62, 0x75, 0x79, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16,
|
||||
0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x75,
|
||||
0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x62, 0x75, 0x79, 0x1a, 0x36, 0x0a, 0x08, 0x42,
|
||||
0x75, 0x79, 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, 0x8b, 0x02, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x68, 0x6f, 0x70, 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, 0x29, 0x0a, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74,
|
||||
0x61, 0x52, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x2f, 0x0a, 0x0b, 0x64,
|
||||
0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52,
|
||||
0x0b, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x27, 0x0a, 0x07,
|
||||
0x70, 0x76, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
|
||||
0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x70, 0x76,
|
||||
0x70, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x27, 0x0a, 0x07, 0x70, 0x76, 0x65, 0x53, 0x68, 0x6f, 0x70,
|
||||
0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f,
|
||||
0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x70, 0x76, 0x65, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x31,
|
||||
0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x07,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44,
|
||||
0x61, 0x74, 0x61, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68, 0x6f,
|
||||
0x70, 0x2a, 0x5f, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a,
|
||||
0x04, 0x4e, 0x75, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x47, 0x6f, 0x6c, 0x64, 0x53,
|
||||
0x68, 0x6f, 0x70, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64,
|
||||
0x53, 0x68, 0x6f, 0x70, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x56, 0x50, 0x53, 0x68, 0x6f,
|
||||
0x70, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x56, 0x45, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x04,
|
||||
0x12, 0x10, 0x0a, 0x0c, 0x41, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x70,
|
||||
0x10, 0x05, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x2f,
|
||||
0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x22, 0xdd, 0x02, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44,
|
||||
0x61, 0x74, 0x61, 0x12, 0x28, 0x0a, 0x0f, 0x4c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x66, 0x72, 0x65,
|
||||
0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x4c, 0x61,
|
||||
0x73, 0x74, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a,
|
||||
0x10, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75,
|
||||
0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52,
|
||||
0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x74, 0x65,
|
||||
0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12,
|
||||
0x28, 0x0a, 0x03, 0x62, 0x75, 0x79, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x55,
|
||||
0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x75, 0x79, 0x45,
|
||||
0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x62, 0x75, 0x79, 0x12, 0x34, 0x0a, 0x07, 0x70, 0x72, 0x65,
|
||||
0x76, 0x69, 0x65, 0x77, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x55, 0x73, 0x65,
|
||||
0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65,
|
||||
0x77, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x1a,
|
||||
0x36, 0x0a, 0x08, 0x42, 0x75, 0x79, 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, 0x1a, 0x49, 0x0a, 0x0c, 0x50, 0x72, 0x65, 0x76, 0x69,
|
||||
0x65, 0x77, 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, 0x44, 0x42, 0x5f, 0x45, 0x71,
|
||||
0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
|
||||
0x38, 0x01, 0x22, 0x8b, 0x02, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x68, 0x6f, 0x70, 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,
|
||||
0x29, 0x0a, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61,
|
||||
0x52, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x2f, 0x0a, 0x0b, 0x64, 0x69,
|
||||
0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b,
|
||||
0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x27, 0x0a, 0x07, 0x70,
|
||||
0x76, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55,
|
||||
0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x70, 0x76, 0x70,
|
||||
0x53, 0x68, 0x6f, 0x70, 0x12, 0x27, 0x0a, 0x07, 0x70, 0x76, 0x65, 0x53, 0x68, 0x6f, 0x70, 0x18,
|
||||
0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70,
|
||||
0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x70, 0x76, 0x65, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x31, 0x0a,
|
||||
0x0c, 0x61, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x07, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61,
|
||||
0x74, 0x61, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x70,
|
||||
0x2a, 0x5f, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04,
|
||||
0x4e, 0x75, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x47, 0x6f, 0x6c, 0x64, 0x53, 0x68,
|
||||
0x6f, 0x70, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53,
|
||||
0x68, 0x6f, 0x70, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x56, 0x50, 0x53, 0x68, 0x6f, 0x70,
|
||||
0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x56, 0x45, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x04, 0x12,
|
||||
0x10, 0x0a, 0x0c, 0x41, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x70, 0x10,
|
||||
0x05, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -302,25 +320,29 @@ func file_shop_shop_db_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_shop_shop_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_shop_shop_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_shop_shop_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_shop_shop_db_proto_goTypes = []interface{}{
|
||||
(ShopType)(0), // 0: ShopType
|
||||
(*UserShopData)(nil), // 1: UserShopData
|
||||
(*DBShop)(nil), // 2: DBShop
|
||||
nil, // 3: UserShopData.BuyEntry
|
||||
nil, // 4: UserShopData.PreviewEntry
|
||||
(*DB_Equipment)(nil), // 5: DB_Equipment
|
||||
}
|
||||
var file_shop_shop_db_proto_depIdxs = []int32{
|
||||
3, // 0: UserShopData.buy:type_name -> UserShopData.BuyEntry
|
||||
1, // 1: DBShop.goldShop:type_name -> UserShopData
|
||||
1, // 2: DBShop.diamondShop:type_name -> UserShopData
|
||||
1, // 3: DBShop.pvpShop:type_name -> UserShopData
|
||||
1, // 4: DBShop.pveShop:type_name -> UserShopData
|
||||
1, // 5: DBShop.allianceShop:type_name -> UserShopData
|
||||
6, // [6:6] is the sub-list for method output_type
|
||||
6, // [6:6] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
4, // 1: UserShopData.preview:type_name -> UserShopData.PreviewEntry
|
||||
1, // 2: DBShop.goldShop:type_name -> UserShopData
|
||||
1, // 3: DBShop.diamondShop:type_name -> UserShopData
|
||||
1, // 4: DBShop.pvpShop:type_name -> UserShopData
|
||||
1, // 5: DBShop.pveShop:type_name -> UserShopData
|
||||
1, // 6: DBShop.allianceShop:type_name -> UserShopData
|
||||
5, // 7: UserShopData.PreviewEntry.value:type_name -> DB_Equipment
|
||||
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_shop_shop_db_proto_init() }
|
||||
@ -328,6 +350,7 @@ func file_shop_shop_db_proto_init() {
|
||||
if File_shop_shop_db_proto != nil {
|
||||
return
|
||||
}
|
||||
file_equipment_equipment_db_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_shop_shop_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UserShopData); i {
|
||||
@ -360,7 +383,7 @@ func file_shop_shop_db_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_shop_shop_db_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 3,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -31,6 +31,7 @@ type ShopItem struct {
|
||||
Consume []*UserAssets `protobuf:"bytes,3,rep,name=Consume,proto3" json:"Consume"` //消耗
|
||||
Sale int32 `protobuf:"varint,4,opt,name=Sale,proto3" json:"Sale"` //打折
|
||||
LeftBuyNum int32 `protobuf:"varint,5,opt,name=LeftBuyNum,proto3" json:"LeftBuyNum"` //还可购买次数
|
||||
Preview *DB_Equipment `protobuf:"bytes,6,opt,name=preview,proto3" json:"preview"` //装备预览数据
|
||||
}
|
||||
|
||||
func (x *ShopItem) Reset() {
|
||||
@ -100,6 +101,13 @@ func (x *ShopItem) GetLeftBuyNum() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ShopItem) GetPreview() *DB_Equipment {
|
||||
if x != nil {
|
||||
return x.Preview
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//获取装备列表请求
|
||||
type ShopGetListReq struct {
|
||||
state protoimpl.MessageState
|
||||
@ -346,44 +354,48 @@ var file_shop_shop_msg_proto_rawDesc = []byte{
|
||||
0x0a, 0x13, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x73, 0x68, 0x6f, 0x70, 0x5f, 0x6d, 0x73, 0x67, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x73, 0x68, 0x6f, 0x70,
|
||||
0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x49, 0x74,
|
||||
0x65, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x05,
|
||||
0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73,
|
||||
0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12,
|
||||
0x25, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x07, 0x43,
|
||||
0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x61, 0x6c, 0x65, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x61, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4c, 0x65,
|
||||
0x66, 0x74, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a,
|
||||
0x4c, 0x65, 0x66, 0x74, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x22, 0x5b, 0x0a, 0x0e, 0x53, 0x68,
|
||||
0x6f, 0x70, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x05,
|
||||
0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68,
|
||||
0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a,
|
||||
0x0f, 0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c,
|
||||
0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x22, 0xab, 0x01, 0x0a, 0x0f, 0x53, 0x68, 0x6f, 0x70,
|
||||
0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x05, 0x73,
|
||||
0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f,
|
||||
0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f,
|
||||
0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52,
|
||||
0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x18,
|
||||
0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x52, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x53, 0x75, 0x72, 0x70, 0x6c,
|
||||
0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x11, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65,
|
||||
0x73, 0x68, 0x4e, 0x75, 0x6d, 0x22, 0x65, 0x0a, 0x0a, 0x53, 0x68, 0x6f, 0x70, 0x42, 0x75, 0x79,
|
||||
0x52, 0x65, 0x71, 0x12, 0x25, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65,
|
||||
0x52, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f,
|
||||
0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f,
|
||||
0x64, 0x73, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x22, 0x25, 0x0a, 0x0b,
|
||||
0x53, 0x68, 0x6f, 0x70, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x49,
|
||||
0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x49, 0x73, 0x53,
|
||||
0x75, 0x63, 0x63, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x2f, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0xcb, 0x01, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x49, 0x74,
|
||||
0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72,
|
||||
0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x25, 0x0a,
|
||||
0x07, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b,
|
||||
0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x07, 0x43, 0x6f, 0x6e,
|
||||
0x73, 0x75, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x61, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x04, 0x53, 0x61, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4c, 0x65, 0x66, 0x74,
|
||||
0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x4c, 0x65,
|
||||
0x66, 0x74, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x12, 0x27, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x76,
|
||||
0x69, 0x65, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x5f, 0x45,
|
||||
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65,
|
||||
0x77, 0x22, 0x5b, 0x0a, 0x0e, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x73,
|
||||
0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c,
|
||||
0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x49,
|
||||
0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x22, 0xab,
|
||||
0x01, 0x0a, 0x0f, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
|
||||
0x73, 0x70, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x73, 0x54,
|
||||
0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52,
|
||||
0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x49, 0x73,
|
||||
0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x1f, 0x0a,
|
||||
0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x53,
|
||||
0x68, 0x6f, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x2c,
|
||||
0x0a, 0x11, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68,
|
||||
0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x53, 0x75, 0x72, 0x70, 0x6c,
|
||||
0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x22, 0x65, 0x0a, 0x0a,
|
||||
0x53, 0x68, 0x6f, 0x70, 0x42, 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x25, 0x0a, 0x08, 0x53, 0x68,
|
||||
0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x53,
|
||||
0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70,
|
||||
0x65, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x42,
|
||||
0x75, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x42, 0x75, 0x79,
|
||||
0x4e, 0x75, 0x6d, 0x22, 0x25, 0x0a, 0x0b, 0x53, 0x68, 0x6f, 0x70, 0x42, 0x75, 0x79, 0x52, 0x65,
|
||||
0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
|
||||
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -406,20 +418,22 @@ var file_shop_shop_msg_proto_goTypes = []interface{}{
|
||||
(*ShopBuyReq)(nil), // 3: ShopBuyReq
|
||||
(*ShopBuyResp)(nil), // 4: ShopBuyResp
|
||||
(*UserAssets)(nil), // 5: UserAssets
|
||||
(ShopType)(0), // 6: ShopType
|
||||
(*DB_Equipment)(nil), // 6: DB_Equipment
|
||||
(ShopType)(0), // 7: ShopType
|
||||
}
|
||||
var file_shop_shop_msg_proto_depIdxs = []int32{
|
||||
5, // 0: ShopItem.Items:type_name -> UserAssets
|
||||
5, // 1: ShopItem.Consume:type_name -> UserAssets
|
||||
6, // 2: ShopGetListReq.sType:type_name -> ShopType
|
||||
6, // 3: ShopGetListResp.sType:type_name -> ShopType
|
||||
0, // 4: ShopGetListResp.Goods:type_name -> ShopItem
|
||||
6, // 5: ShopBuyReq.ShopType:type_name -> ShopType
|
||||
6, // [6:6] is the sub-list for method output_type
|
||||
6, // [6:6] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
6, // 2: ShopItem.preview:type_name -> DB_Equipment
|
||||
7, // 3: ShopGetListReq.sType:type_name -> ShopType
|
||||
7, // 4: ShopGetListResp.sType:type_name -> ShopType
|
||||
0, // 5: ShopGetListResp.Goods:type_name -> ShopItem
|
||||
7, // 6: ShopBuyReq.ShopType:type_name -> ShopType
|
||||
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
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_shop_shop_msg_proto_init() }
|
||||
@ -429,6 +443,7 @@ func file_shop_shop_msg_proto_init() {
|
||||
}
|
||||
file_shop_shop_db_proto_init()
|
||||
file_comm_proto_init()
|
||||
file_equipment_equipment_db_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_shop_shop_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ShopItem); i {
|
||||
|
@ -11,90 +11,223 @@ package cfg
|
||||
import "errors"
|
||||
|
||||
type GameShopitemData struct {
|
||||
Key int32
|
||||
Id int32
|
||||
Iteminfo []*Gameatn
|
||||
Probability int32
|
||||
Need []*Gameatn
|
||||
Sale int32
|
||||
Salelist []int32
|
||||
Buyminnum int32
|
||||
Buymaxnum int32
|
||||
Vip int32
|
||||
Lvmin int32
|
||||
Lvmax int32
|
||||
Mapidmin int32
|
||||
Mapidmax int32
|
||||
Key int32
|
||||
Id int32
|
||||
Iteminfo []*Gameatn
|
||||
Preview bool
|
||||
Probability int32
|
||||
Need []*Gameatn
|
||||
Sale int32
|
||||
Salelist []int32
|
||||
Buyminnum int32
|
||||
Buymaxnum int32
|
||||
Vip int32
|
||||
Lvmin int32
|
||||
Lvmax int32
|
||||
Mapidmin int32
|
||||
Mapidmax int32
|
||||
}
|
||||
|
||||
const TypeId_GameShopitemData = 491491023
|
||||
|
||||
func (*GameShopitemData) GetTypeId() int32 {
|
||||
return 491491023
|
||||
return 491491023
|
||||
}
|
||||
|
||||
func (_v *GameShopitemData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["iteminfo"].([]interface{}); !_ok_ { err = errors.New("iteminfo error"); return }
|
||||
func (_v *GameShopitemData) Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ {
|
||||
err = errors.New("key error")
|
||||
return
|
||||
}
|
||||
_v.Key = int32(_tempNum_)
|
||||
}
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ {
|
||||
err = errors.New("id error")
|
||||
return
|
||||
}
|
||||
_v.Id = int32(_tempNum_)
|
||||
}
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["iteminfo"].([]interface{}); !_ok_ {
|
||||
err = errors.New("iteminfo error")
|
||||
return
|
||||
}
|
||||
|
||||
_v.Iteminfo = make([]*Gameatn, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ *Gameatn
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
_v.Iteminfo = append(_v.Iteminfo, _list_v_)
|
||||
}
|
||||
}
|
||||
_v.Iteminfo = make([]*Gameatn, 0, len(_arr_))
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["probability"].(float64); !_ok_ { err = errors.New("probability error"); return }; _v.Probability = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["need"].([]interface{}); !_ok_ { err = errors.New("need error"); return }
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ *Gameatn
|
||||
{
|
||||
var _ok_ bool
|
||||
var _x_ map[string]interface{}
|
||||
if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ {
|
||||
err = errors.New("_list_v_ error")
|
||||
return
|
||||
}
|
||||
if _list_v_, err = DeserializeGameatn(_x_); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
_v.Iteminfo = append(_v.Iteminfo, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
_v.Need = make([]*Gameatn, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ *Gameatn
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
_v.Need = append(_v.Need, _list_v_)
|
||||
}
|
||||
}
|
||||
{
|
||||
var _ok_ bool
|
||||
if _v.Preview, _ok_ = _buf["preview"].(bool); !_ok_ {
|
||||
err = errors.New("preview error")
|
||||
return
|
||||
}
|
||||
}
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["probability"].(float64); !_ok_ {
|
||||
err = errors.New("probability error")
|
||||
return
|
||||
}
|
||||
_v.Probability = int32(_tempNum_)
|
||||
}
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["need"].([]interface{}); !_ok_ {
|
||||
err = errors.New("need error")
|
||||
return
|
||||
}
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["sale"].(float64); !_ok_ { err = errors.New("sale error"); return }; _v.Sale = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["salelist"].([]interface{}); !_ok_ { err = errors.New("salelist error"); return }
|
||||
_v.Need = make([]*Gameatn, 0, len(_arr_))
|
||||
|
||||
_v.Salelist = make([]int32, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ int32
|
||||
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
|
||||
_v.Salelist = append(_v.Salelist, _list_v_)
|
||||
}
|
||||
}
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ *Gameatn
|
||||
{
|
||||
var _ok_ bool
|
||||
var _x_ map[string]interface{}
|
||||
if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ {
|
||||
err = errors.New("_list_v_ error")
|
||||
return
|
||||
}
|
||||
if _list_v_, err = DeserializeGameatn(_x_); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
_v.Need = append(_v.Need, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["buyminnum"].(float64); !_ok_ { err = errors.New("buyminnum error"); return }; _v.Buyminnum = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["buymaxnum"].(float64); !_ok_ { err = errors.New("buymaxnum error"); return }; _v.Buymaxnum = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["vip"].(float64); !_ok_ { err = errors.New("vip error"); return }; _v.Vip = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["lvmin"].(float64); !_ok_ { err = errors.New("lvmin error"); return }; _v.Lvmin = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["lvmax"].(float64); !_ok_ { err = errors.New("lvmax error"); return }; _v.Lvmax = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["mapidmin"].(float64); !_ok_ { err = errors.New("mapidmin error"); return }; _v.Mapidmin = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["mapidmax"].(float64); !_ok_ { err = errors.New("mapidmax error"); return }; _v.Mapidmax = int32(_tempNum_) }
|
||||
return
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["sale"].(float64); !_ok_ {
|
||||
err = errors.New("sale error")
|
||||
return
|
||||
}
|
||||
_v.Sale = int32(_tempNum_)
|
||||
}
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["salelist"].([]interface{}); !_ok_ {
|
||||
err = errors.New("salelist error")
|
||||
return
|
||||
}
|
||||
|
||||
_v.Salelist = make([]int32, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ int32
|
||||
{
|
||||
var _ok_ bool
|
||||
var _x_ float64
|
||||
if _x_, _ok_ = _e_.(float64); !_ok_ {
|
||||
err = errors.New("_list_v_ error")
|
||||
return
|
||||
}
|
||||
_list_v_ = int32(_x_)
|
||||
}
|
||||
_v.Salelist = append(_v.Salelist, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["buyminnum"].(float64); !_ok_ {
|
||||
err = errors.New("buyminnum error")
|
||||
return
|
||||
}
|
||||
_v.Buyminnum = int32(_tempNum_)
|
||||
}
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["buymaxnum"].(float64); !_ok_ {
|
||||
err = errors.New("buymaxnum error")
|
||||
return
|
||||
}
|
||||
_v.Buymaxnum = int32(_tempNum_)
|
||||
}
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["vip"].(float64); !_ok_ {
|
||||
err = errors.New("vip error")
|
||||
return
|
||||
}
|
||||
_v.Vip = int32(_tempNum_)
|
||||
}
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["lvmin"].(float64); !_ok_ {
|
||||
err = errors.New("lvmin error")
|
||||
return
|
||||
}
|
||||
_v.Lvmin = int32(_tempNum_)
|
||||
}
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["lvmax"].(float64); !_ok_ {
|
||||
err = errors.New("lvmax error")
|
||||
return
|
||||
}
|
||||
_v.Lvmax = int32(_tempNum_)
|
||||
}
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["mapidmin"].(float64); !_ok_ {
|
||||
err = errors.New("mapidmin error")
|
||||
return
|
||||
}
|
||||
_v.Mapidmin = int32(_tempNum_)
|
||||
}
|
||||
{
|
||||
var _ok_ bool
|
||||
var _tempNum_ float64
|
||||
if _tempNum_, _ok_ = _buf["mapidmax"].(float64); !_ok_ {
|
||||
err = errors.New("mapidmax error")
|
||||
return
|
||||
}
|
||||
_v.Mapidmax = int32(_tempNum_)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGameShopitemData(_buf map[string]interface{}) (*GameShopitemData, error) {
|
||||
v := &GameShopitemData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
v := &GameShopitemData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user