上传海盗英雄招募错误处理

This commit is contained in:
liwei1dao 2024-02-19 16:56:31 +08:00
parent 020a45e6df
commit 6c17661cff
6 changed files with 208 additions and 134 deletions

View File

@ -42,8 +42,12 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.IsLandInfoReq) (err
}
return
}
for _, v := range cards {
info.Heroshop[v] = 0
info.Heroshop = make([]*pb.DBIslandShopItem, 5)
for i, v := range cards {
info.Heroshop[i] = &pb.DBIslandShopItem{
Cid: v,
Buy: 0,
}
}
this.module.model.Change(session.GetUserId(), map[string]interface{}{
"heroshop": info.Heroshop,

View File

@ -10,27 +10,41 @@ import (
// 参数校验
func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.IsLandBuyReq) (errdata *pb.ErrorData) {
if req.Index < 0 || req.Index >= 5 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: "index out range",
}
}
return
}
// /获取自己的排行榜信息
func (this *apiComp) Buy(session comm.IUserSession, req *pb.IsLandBuyReq) (errdata *pb.ErrorData) {
var (
shopitem *pb.DBIslandShopItem
conf *cfg.GameHeroData
coinconf *cfg.GamePuggsyRecruitData
info *pb.DBIsland
heros []*pb.DBHero
hero *pb.DBHero
buynum int32
ok bool
err error
)
if errdata = this.BuyCheck(session, req); errdata != nil {
return
}
if conf, err = this.module.ModuleTools.GetHeroConfig(req.Cids); err != nil {
if info, err = this.module.model.getmodel(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),
}
return
}
shopitem = info.Heroshop[req.Index]
if conf, err = this.module.ModuleTools.GetHeroConfig(shopitem.Cid); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Message: err.Error(),
@ -46,26 +60,18 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.IsLandBuyReq) (errda
return
}
if info, err = this.module.model.getmodel(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),
}
return
}
if errdata = this.module.ConsumeRes(session, coinconf.Need, true); errdata != nil {
return
}
if buynum, ok = info.Heroshop[req.Cids]; ok && buynum > 0 {
if shopitem.Buy > 0 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Message: "Purchased !",
}
return
}
info.Heroshop[req.Cids] = 1
shopitem.Buy = 1
if heros, err = this.module.modelhero.getHeroList(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
@ -75,9 +81,9 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.IsLandBuyReq) (errda
}
for _, v := range heros {
if v.HeroID == req.Cids {
if v.HeroID == shopitem.Cid {
hero = v
if hero.Star <= 6 {
if hero.Star < 6 {
hero.Star++
hero.Lv = hero.Star * 10
} else {

View File

@ -37,9 +37,12 @@ func (this *apiComp) RefresHeroShop(session comm.IUserSession, req *pb.IsLandRef
}
return
}
info.Heroshop = make(map[string]int32)
for _, v := range cards {
info.Heroshop[v] = 0
info.Heroshop = make([]*pb.DBIslandShopItem, 5)
for i, v := range cards {
info.Heroshop[i] = &pb.DBIslandShopItem{
Cid: v,
Buy: 0,
}
}
this.module.model.Change(session.GetUserId(), map[string]interface{}{
"heroshop": info.Heroshop,

View File

@ -43,7 +43,7 @@ func (this *modelComp) getmodel(uid string) (result *pb.DBIsland, err error) {
Uid: uid,
Opentime: utils.GetMonthStart(),
Endtime: utils.GetMonthEnd(configure.Now().Unix()),
Heroshop: make(map[string]int32),
Heroshop: make([]*pb.DBIslandShopItem, 0),
Islands: make(map[int32]*pb.DBIslandItem),
Nodes: make(map[int32]int32),
}

View File

@ -29,10 +29,10 @@ type DBIsland struct {
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"`
Opentime int64 `protobuf:"varint,3,opt,name=opentime,proto3" json:"opentime"` //开启时间
Endtime int64 `protobuf:"varint,4,opt,name=endtime,proto3" json:"endtime"`
Heroshop map[string]int32 `protobuf:"bytes,5,rep,name=heroshop,proto3" json:"heroshop" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //英雄商店
Islands map[int32]*DBIslandItem `protobuf:"bytes,6,rep,name=islands,proto3" json:"islands" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //岛屿
Nodes map[int32]int32 `protobuf:"bytes,7,rep,name=nodes,proto3" json:"nodes" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //养成节点
Freeprogress int32 `protobuf:"varint,8,opt,name=freeprogress,proto3" json:"freeprogress"` //已领取天数
Heroshop []*DBIslandShopItem `protobuf:"bytes,5,rep,name=heroshop,proto3" json:"heroshop"` //英雄商店
Islands map[int32]*DBIslandItem `protobuf:"bytes,6,rep,name=islands,proto3" json:"islands" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //岛屿
Nodes map[int32]int32 `protobuf:"bytes,7,rep,name=nodes,proto3" json:"nodes" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //养成节点
Freeprogress int32 `protobuf:"varint,8,opt,name=freeprogress,proto3" json:"freeprogress"` //已领取天数
Payprogress int32 `protobuf:"varint,9,opt,name=payprogress,proto3" json:"payprogress"`
Vip bool `protobuf:"varint,10,opt,name=vip,proto3" json:"vip"`
Refreshed int32 `protobuf:"varint,11,opt,name=refreshed,proto3" json:"refreshed"` //已刷新
@ -98,7 +98,7 @@ func (x *DBIsland) GetEndtime() int64 {
return 0
}
func (x *DBIsland) GetHeroshop() map[string]int32 {
func (x *DBIsland) GetHeroshop() []*DBIslandShopItem {
if x != nil {
return x.Heroshop
}
@ -147,6 +147,61 @@ func (x *DBIsland) GetRefreshed() int32 {
return 0
}
type DBIslandShopItem struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid"`
Buy int32 `protobuf:"varint,2,opt,name=buy,proto3" json:"buy"`
}
func (x *DBIslandShopItem) Reset() {
*x = DBIslandShopItem{}
if protoimpl.UnsafeEnabled {
mi := &file_island_island_db_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBIslandShopItem) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBIslandShopItem) ProtoMessage() {}
func (x *DBIslandShopItem) ProtoReflect() protoreflect.Message {
mi := &file_island_island_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 DBIslandShopItem.ProtoReflect.Descriptor instead.
func (*DBIslandShopItem) Descriptor() ([]byte, []int) {
return file_island_island_db_proto_rawDescGZIP(), []int{1}
}
func (x *DBIslandShopItem) GetCid() string {
if x != nil {
return x.Cid
}
return ""
}
func (x *DBIslandShopItem) GetBuy() int32 {
if x != nil {
return x.Buy
}
return 0
}
//海岛地图
type DBIslandItem struct {
state protoimpl.MessageState
@ -161,7 +216,7 @@ type DBIslandItem struct {
func (x *DBIslandItem) Reset() {
*x = DBIslandItem{}
if protoimpl.UnsafeEnabled {
mi := &file_island_island_db_proto_msgTypes[1]
mi := &file_island_island_db_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -174,7 +229,7 @@ func (x *DBIslandItem) String() string {
func (*DBIslandItem) ProtoMessage() {}
func (x *DBIslandItem) ProtoReflect() protoreflect.Message {
mi := &file_island_island_db_proto_msgTypes[1]
mi := &file_island_island_db_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -187,7 +242,7 @@ func (x *DBIslandItem) ProtoReflect() protoreflect.Message {
// Deprecated: Use DBIslandItem.ProtoReflect.Descriptor instead.
func (*DBIslandItem) Descriptor() ([]byte, []int) {
return file_island_island_db_proto_rawDescGZIP(), []int{1}
return file_island_island_db_proto_rawDescGZIP(), []int{2}
}
func (x *DBIslandItem) GetId() int32 {
@ -215,53 +270,52 @@ var File_island_island_db_proto protoreflect.FileDescriptor
var file_island_island_db_proto_rawDesc = []byte{
0x0a, 0x16, 0x69, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x2f, 0x69, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x5f,
0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x04, 0x0a, 0x08, 0x44, 0x42, 0x49,
0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xea, 0x03, 0x0a, 0x08, 0x44, 0x42, 0x49,
0x73, 0x6c, 0x61, 0x6e, 0x64, 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, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x74,
0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x74,
0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04,
0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x33, 0x0a,
0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2d, 0x0a,
0x08, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x17, 0x2e, 0x44, 0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x73,
0x68, 0x6f, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x68,
0x6f, 0x70, 0x12, 0x30, 0x0a, 0x07, 0x69, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x44, 0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x2e, 0x49,
0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x69, 0x73, 0x6c,
0x61, 0x6e, 0x64, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x07, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x2e, 0x4e,
0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73,
0x12, 0x22, 0x0a, 0x0c, 0x66, 0x72, 0x65, 0x65, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73,
0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x66, 0x72, 0x65, 0x65, 0x70, 0x72, 0x6f, 0x67,
0x72, 0x65, 0x73, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x70, 0x72, 0x6f, 0x67, 0x72,
0x65, 0x73, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x70, 0x72,
0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x70, 0x18, 0x0a, 0x20,
0x01, 0x28, 0x08, 0x52, 0x03, 0x76, 0x69, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x72,
0x65, 0x73, 0x68, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x66,
0x72, 0x65, 0x73, 0x68, 0x65, 0x64, 0x1a, 0x3b, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x73, 0x68,
0x6f, 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, 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, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 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, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x49,
0x74, 0x65, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38,
0x0a, 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x73, 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, 0x9a, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x49,
0x73, 0x6c, 0x61, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x6c, 0x65, 0x76,
0x65, 0x6c, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x44, 0x42, 0x49, 0x73, 0x6c,
0x61, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x6f, 0x73,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x4c,
0x65, 0x76, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
0x11, 0x2e, 0x44, 0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x49, 0x74,
0x65, 0x6d, 0x52, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x12, 0x30, 0x0a, 0x07,
0x69, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e,
0x44, 0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x2e, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x69, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x2a,
0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e,
0x44, 0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x72,
0x65, 0x65, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0c, 0x66, 0x72, 0x65, 0x65, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x20,
0x0a, 0x0b, 0x70, 0x61, 0x79, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x09, 0x20,
0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73,
0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x76,
0x69, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x65, 0x64, 0x18,
0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x65, 0x64,
0x1a, 0x49, 0x0a, 0x0c, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 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, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x4e,
0x6f, 0x64, 0x65, 0x73, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x36, 0x0a, 0x10, 0x44, 0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e,
0x64, 0x53, 0x68, 0x6f, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x62,
0x75, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x75, 0x79, 0x22, 0x9a, 0x01,
0x0a, 0x0c, 0x44, 0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e,
0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
0x44, 0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x65, 0x76,
0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x10,
0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x6f, 0x73,
0x1a, 0x38, 0x0a, 0x0a, 0x4c, 0x65, 0x76, 0x65, 0x6c, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -278,19 +332,19 @@ func file_island_island_db_proto_rawDescGZIP() []byte {
var file_island_island_db_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_island_island_db_proto_goTypes = []interface{}{
(*DBIsland)(nil), // 0: DBIsland
(*DBIslandItem)(nil), // 1: DBIslandItem
nil, // 2: DBIsland.HeroshopEntry
nil, // 3: DBIsland.IslandsEntry
nil, // 4: DBIsland.NodesEntry
nil, // 5: DBIslandItem.LevelEntry
(*DBIsland)(nil), // 0: DBIsland
(*DBIslandShopItem)(nil), // 1: DBIslandShopItem
(*DBIslandItem)(nil), // 2: DBIslandItem
nil, // 3: DBIsland.IslandsEntry
nil, // 4: DBIsland.NodesEntry
nil, // 5: DBIslandItem.LevelEntry
}
var file_island_island_db_proto_depIdxs = []int32{
2, // 0: DBIsland.heroshop:type_name -> DBIsland.HeroshopEntry
1, // 0: DBIsland.heroshop:type_name -> DBIslandShopItem
3, // 1: DBIsland.islands:type_name -> DBIsland.IslandsEntry
4, // 2: DBIsland.nodes:type_name -> DBIsland.NodesEntry
5, // 3: DBIslandItem.level:type_name -> DBIslandItem.LevelEntry
1, // 4: DBIsland.IslandsEntry.value:type_name -> DBIslandItem
2, // 4: DBIsland.IslandsEntry.value:type_name -> DBIslandItem
5, // [5:5] is the sub-list for method output_type
5, // [5:5] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
@ -317,6 +371,18 @@ func file_island_island_db_proto_init() {
}
}
file_island_island_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBIslandShopItem); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_island_island_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBIslandItem); i {
case 0:
return &v.state

View File

@ -406,8 +406,8 @@ type IsLandRefresHeroShopResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Refreshed int32 `protobuf:"varint,1,opt,name=refreshed,proto3" json:"refreshed"` //已刷新
Heroshop map[string]int32 `protobuf:"bytes,2,rep,name=heroshop,proto3" json:"heroshop" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //英雄商店
Refreshed int32 `protobuf:"varint,1,opt,name=refreshed,proto3" json:"refreshed"` //已刷新
Heroshop []*DBIslandShopItem `protobuf:"bytes,2,rep,name=heroshop,proto3" json:"heroshop"` //英雄商店
}
func (x *IsLandRefresHeroShopResp) Reset() {
@ -449,7 +449,7 @@ func (x *IsLandRefresHeroShopResp) GetRefreshed() int32 {
return 0
}
func (x *IsLandRefresHeroShopResp) GetHeroshop() map[string]int32 {
func (x *IsLandRefresHeroShopResp) GetHeroshop() []*DBIslandShopItem {
if x != nil {
return x.Heroshop
}
@ -462,7 +462,7 @@ type IsLandBuyReq struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Cids string `protobuf:"bytes,1,opt,name=cids,proto3" json:"cids"`
Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index"`
}
func (x *IsLandBuyReq) Reset() {
@ -497,11 +497,11 @@ func (*IsLandBuyReq) Descriptor() ([]byte, []int) {
return file_island_island_msg_proto_rawDescGZIP(), []int{8}
}
func (x *IsLandBuyReq) GetCids() string {
func (x *IsLandBuyReq) GetIndex() int32 {
if x != nil {
return x.Cids
return x.Index
}
return ""
return 0
}
//购买英雄卡回应
@ -791,37 +791,32 @@ var file_island_island_msg_proto_rawDesc = []byte{
0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55,
0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x22, 0x19,
0x0a, 0x17, 0x49, 0x73, 0x4c, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x48, 0x65,
0x72, 0x6f, 0x53, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x22, 0xba, 0x01, 0x0a, 0x18, 0x49, 0x73,
0x4c, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x68,
0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73,
0x68, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x66, 0x72, 0x65,
0x73, 0x68, 0x65, 0x64, 0x12, 0x43, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x68, 0x6f, 0x70,
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x49, 0x73, 0x4c, 0x61, 0x6e, 0x64, 0x52,
0x65, 0x66, 0x72, 0x65, 0x73, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x73,
0x70, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
0x08, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x1a, 0x3b, 0x0a, 0x0d, 0x48, 0x65, 0x72,
0x6f, 0x73, 0x68, 0x6f, 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, 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, 0x22, 0x0a, 0x0c, 0x49, 0x73, 0x4c, 0x61, 0x6e, 0x64,
0x42, 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x64, 0x73, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x64, 0x73, 0x22, 0x2c, 0x0a, 0x0d, 0x49, 0x73,
0x4c, 0x61, 0x6e, 0x64, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x68,
0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65,
0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x24, 0x0a, 0x10, 0x49, 0x73, 0x4c, 0x61,
0x6e, 0x64, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03,
0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x69, 0x64, 0x22, 0x35,
0x0a, 0x11, 0x49, 0x73, 0x4c, 0x61, 0x6e, 0x64, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52,
0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x03, 0x6e, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0x12, 0x0a, 0x10, 0x49, 0x73, 0x4c, 0x61, 0x6e, 0x64, 0x52,
0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x22, 0x53, 0x0a, 0x11, 0x49, 0x73, 0x4c,
0x61, 0x6e, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d,
0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44,
0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a,
0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55,
0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06,
0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x72, 0x6f, 0x53, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x22, 0x67, 0x0a, 0x18, 0x49, 0x73, 0x4c,
0x61, 0x6e, 0x64, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x6f,
0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68,
0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73,
0x68, 0x65, 0x64, 0x12, 0x2d, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x18,
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x44, 0x42, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64,
0x53, 0x68, 0x6f, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x68,
0x6f, 0x70, 0x22, 0x24, 0x0a, 0x0c, 0x49, 0x73, 0x4c, 0x61, 0x6e, 0x64, 0x42, 0x75, 0x79, 0x52,
0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x2c, 0x0a, 0x0d, 0x49, 0x73, 0x4c, 0x61,
0x6e, 0x64, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x68, 0x65, 0x72,
0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f,
0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x24, 0x0a, 0x10, 0x49, 0x73, 0x4c, 0x61, 0x6e, 0x64,
0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x69, 0x64, 0x22, 0x35, 0x0a, 0x11,
0x49, 0x73, 0x4c, 0x61, 0x6e, 0x64, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73,
0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
0x6e, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x02, 0x6c, 0x76, 0x22, 0x12, 0x0a, 0x10, 0x49, 0x73, 0x4c, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x63,
0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x22, 0x53, 0x0a, 0x11, 0x49, 0x73, 0x4c, 0x61, 0x6e,
0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04,
0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x49,
0x73, 0x6c, 0x61, 0x6e, 0x64, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x05, 0x61,
0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -836,7 +831,7 @@ func file_island_island_msg_proto_rawDescGZIP() []byte {
return file_island_island_msg_proto_rawDescData
}
var file_island_island_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_island_island_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_island_island_msg_proto_goTypes = []interface{}{
(*IsLandInfoReq)(nil), // 0: IsLandInfoReq
(*IsLandInfoResp)(nil), // 1: IsLandInfoResp
@ -852,25 +847,25 @@ var file_island_island_msg_proto_goTypes = []interface{}{
(*IsLandUpgradeResp)(nil), // 11: IsLandUpgradeResp
(*IsLandReceiveReq)(nil), // 12: IsLandReceiveReq
(*IsLandReceiveResp)(nil), // 13: IsLandReceiveResp
nil, // 14: IsLandRefresHeroShopResp.HeroshopEntry
(*DBIsland)(nil), // 15: DBIsland
(*DBHero)(nil), // 16: DBHero
(*BattleFormation)(nil), // 17: BattleFormation
(*BattleInfo)(nil), // 18: BattleInfo
(*BattleReport)(nil), // 19: BattleReport
(*UserAtno)(nil), // 20: UserAtno
(*DBIsland)(nil), // 14: DBIsland
(*DBHero)(nil), // 15: DBHero
(*BattleFormation)(nil), // 16: BattleFormation
(*BattleInfo)(nil), // 17: BattleInfo
(*BattleReport)(nil), // 18: BattleReport
(*UserAtno)(nil), // 19: UserAtno
(*DBIslandShopItem)(nil), // 20: DBIslandShopItem
}
var file_island_island_msg_proto_depIdxs = []int32{
15, // 0: IsLandInfoResp.info:type_name -> DBIsland
16, // 1: IsLandInfoResp.heros:type_name -> DBHero
17, // 2: IsLandBattleReq.battle:type_name -> BattleFormation
18, // 3: IsLandBattleResp.info:type_name -> BattleInfo
19, // 4: IsLandCompleteReq.report:type_name -> BattleReport
20, // 5: IsLandCompleteResp.award:type_name -> UserAtno
14, // 6: IsLandRefresHeroShopResp.heroshop:type_name -> IsLandRefresHeroShopResp.HeroshopEntry
16, // 7: IsLandBuyResp.hero:type_name -> DBHero
15, // 8: IsLandReceiveResp.info:type_name -> DBIsland
20, // 9: IsLandReceiveResp.award:type_name -> UserAtno
14, // 0: IsLandInfoResp.info:type_name -> DBIsland
15, // 1: IsLandInfoResp.heros:type_name -> DBHero
16, // 2: IsLandBattleReq.battle:type_name -> BattleFormation
17, // 3: IsLandBattleResp.info:type_name -> BattleInfo
18, // 4: IsLandCompleteReq.report:type_name -> BattleReport
19, // 5: IsLandCompleteResp.award:type_name -> UserAtno
20, // 6: IsLandRefresHeroShopResp.heroshop:type_name -> DBIslandShopItem
15, // 7: IsLandBuyResp.hero:type_name -> DBHero
14, // 8: IsLandReceiveResp.info:type_name -> DBIsland
19, // 9: IsLandReceiveResp.award:type_name -> UserAtno
10, // [10:10] is the sub-list for method output_type
10, // [10:10] is the sub-list for method input_type
10, // [10:10] is the sub-list for extension type_name
@ -1063,7 +1058,7 @@ func file_island_island_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_island_island_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 15,
NumMessages: 14,
NumExtensions: 0,
NumServices: 0,
},