This commit is contained in:
liwei1dao 2022-08-30 18:03:35 +08:00
commit df08889bb8
25 changed files with 5026 additions and 11 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,102 @@
[
{
"buynum": 1,
"need": [
{
"a": "attr",
"t": "diamond",
"n": 10
}
]
},
{
"buynum": 2,
"need": [
{
"a": "attr",
"t": "diamond",
"n": 20
}
]
},
{
"buynum": 3,
"need": [
{
"a": "attr",
"t": "diamond",
"n": 30
}
]
},
{
"buynum": 4,
"need": [
{
"a": "attr",
"t": "diamond",
"n": 40
}
]
},
{
"buynum": 5,
"need": [
{
"a": "attr",
"t": "diamond",
"n": 50
}
]
},
{
"buynum": 6,
"need": [
{
"a": "attr",
"t": "diamond",
"n": 60
}
]
},
{
"buynum": 7,
"need": [
{
"a": "attr",
"t": "diamond",
"n": 70
}
]
},
{
"buynum": 8,
"need": [
{
"a": "attr",
"t": "diamond",
"n": 80
}
]
},
{
"buynum": 9,
"need": [
{
"a": "attr",
"t": "diamond",
"n": 90
}
]
},
{
"buynum": 10,
"need": [
{
"a": "attr",
"t": "diamond",
"n": 100
}
]
}
]

View File

@ -0,0 +1,30 @@
[
{
"type": 1,
"opentime": [
1,
2
]
},
{
"type": 2,
"opentime": [
3,
4
]
},
{
"type": 3,
"opentime": [
5,
6
]
},
{
"type": 4,
"opentime": [
1,
7
]
}
]

View File

@ -57,6 +57,7 @@ const (
ModuleTimer core.M_Modules = "timer" //定时任务模块
ModuleViking core.M_Modules = "viking" //维京远征
ModuleMoonfantasy core.M_Modules = "moonfantasy" //月之秘境模块
ModuleHunting core.M_Modules = "hunting" //狩猎
)
//数据表名定义处
@ -120,6 +121,11 @@ const (
//月之秘境
TableMoonfantasy = "moonfantasy"
//
TableHunting = "hunting"
// 维京远征排行榜
TableHuntingRank = "huntingrank"
)
//RPC服务接口定义处

37
modules/hunting/api.go Normal file
View File

@ -0,0 +1,37 @@
package hunting
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
const (
HuntingGetListResp = "getlist"
HuntingChallengeResp = "challenge"
HuntingSkillLvResp = "skilllv"
HuntingGetRewardResp = "getreward"
HuntingBuyResp = "buy"
HuntingRankListResp = "ranklist"
)
type apiComp struct {
modules.MCompGate
service core.IService
configure *configureComp
module *Hunting
}
//组件初始化接口
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompGate.Init(service, module, comp, options)
this.module = module.(*Hunting)
this.service = service
return
}
func (this *apiComp) Start() (err error) {
err = this.MCompGate.Start()
return
}

View File

@ -0,0 +1,74 @@
package hunting
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"time"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.HuntingBuyReq) (code pb.ErrorCode) {
if req.Count <= 0 {
code = pb.ErrorCode_ReqParameterError
return
}
return
}
func (this *apiComp) Buy(session comm.IUserSession, req *pb.HuntingBuyReq) (code pb.ErrorCode, data proto.Message) {
var (
curByCount int32
costRes []*cfg.Gameatn
mapData map[string]interface{}
)
code = this.BuyCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
list, err := this.module.modelHunting.getHuntingList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
// 校验是不是今天
if !utils.IsToday(list.CTime) {
list.CTime = time.Now().Unix()
list.BuyCount = 0
list.ChallengeCount = 0
mapData["cTime"] = list.CTime
mapData["buyCount"] = list.BuyCount
mapData["challengeCount"] = list.ChallengeCount
} else {
curByCount = list.BuyCount
}
curByCount += req.Count // 当前需要购买的数量
//
for i := list.BuyCount + 1; i <= curByCount; i++ {
_cfg := this.configure.GetBuyChallengeCount(i)
if _cfg == nil {
code = pb.ErrorCode_VikingBuyMaxCount
return
}
costRes = append(costRes, _cfg.Need...)
}
// 消耗校验
if code = this.module.CheckRes(session, costRes); code != pb.ErrorCode_Success {
return
}
//消耗
if code = this.module.ConsumeRes(session, costRes, true); code != pb.ErrorCode_Success {
return
}
list.BuyCount = curByCount
mapData["buyCount"] = curByCount
code = this.module.ModifyHuntingData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), HuntingBuyResp, &pb.HuntingBuyResp{Data: list})
return
}

View File

@ -0,0 +1,79 @@
package hunting
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.HuntingChallengeReq) (code pb.ErrorCode) {
if req.BossType <= 0 && req.Difficulty != 0 {
code = pb.ErrorCode_ReqParameterError
return
}
return
}
///挑战主线关卡
func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallengeReq) (code pb.ErrorCode, data proto.Message) {
var (
mapData map[string]interface{}
newChallenge bool // 新的关卡
reward []*cfg.Gameatn
)
mapData = make(map[string]interface{}, 0)
reward = make([]*cfg.Gameatn, 0)
code = this.ChallengeCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
hunting, err := this.module.modelHunting.getHuntingList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_PagodaNotFound
return
}
cfg := this.module.configure.GetHuntingBossConfigData(req.BossType, req.Difficulty)
if cfg != nil {
code = pb.ErrorCode_ConfigNoFound
return
}
if value, ok := hunting.Boos[req.BossType]; !ok { // 类型校验
code = pb.ErrorCode_VikingBoosType
return
} else {
if value < req.Difficulty {
if value+1 != req.Difficulty {
code = pb.ErrorCode_VikingLvErr
return
}
newChallenge = true
} else { // 挑战历史
newChallenge = false
}
}
if newChallenge { // 新关卡挑战通过 发放首通奖励
if code = this.module.DispenseRes(session, cfg.Firstprize, true); code != pb.ErrorCode_Success {
return
}
hunting.Boos[req.BossType] += 1
mapData["boos"] = hunting.Boos
hunting.ChallengeTime[req.BossType<<16+req.Difficulty] = 0 // todo 耗时
mapData["challengeTime"] = hunting.ChallengeTime
}
// 耗时校验 当前战斗胜利时间消耗小于之前刷新数据
hunting.ChallengeTime[req.BossType<<16+req.Difficulty] = 0
code = this.module.ModifyHuntingData(session.GetUserId(), mapData)
// 发放通关随机奖励
this.module.configure.GetDropReward(cfg.Drop, reward) // 获取掉落奖励
if code = this.module.DispenseRes(session, reward, true); code != pb.ErrorCode_Success {
return
}
session.SendMsg(string(this.module.GetType()), HuntingChallengeResp, &pb.HuntingChallengeResp{Data: hunting})
return
}

View File

@ -0,0 +1,53 @@
package hunting
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/utils"
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.HuntingGetListReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) GetList(session comm.IUserSession, req *pb.HuntingGetListReq) (code pb.ErrorCode, data proto.Message) {
code = this.GetListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
list, err := this.module.modelHunting.getHuntingList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
if list == nil {
list.Id = primitive.NewObjectID().Hex()
list.Uid = session.GetUserId()
list.Boos = make(map[int32]int32)
_mapType := this.configure.GetHuntingBossTypeConfigData()
for k := range _mapType {
list.Boos[k] = 0 // 默认难度0
}
this.module.modelHunting.Add(session.GetUserId(), list) // 写缓存
}
// 校验 是不是当天
if !utils.IsToday(list.CTime) {
list.CTime = time.Now().Unix()
list.BuyCount = 0
list.ChallengeCount = 0
mapData := make(map[string]interface{}, 0)
mapData["cTime"] = list.CTime
mapData["buyCount"] = list.BuyCount
mapData["challengeCount"] = list.ChallengeCount
code = this.module.ModifyHuntingData(session.GetUserId(), mapData) //修改内存信息
}
session.SendMsg(string(this.module.GetType()), HuntingGetListResp, &pb.HuntingGetListResp{Data: list})
return
}

View File

@ -0,0 +1,28 @@
package hunting
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) RankListCheck(session comm.IUserSession, req *pb.HuntingRankListReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) RankList(session comm.IUserSession, req *pb.HuntingRankListReq) (code pb.ErrorCode, data proto.Message) {
code = this.RankListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
szRank, err := this.module.modulerank.GetRankData()
if err != nil {
code = pb.ErrorCode_DBError
}
session.SendMsg(string(this.module.GetType()), HuntingRankListResp, &pb.HuntingRankListResp{Ranks: szRank})
return
}

View File

@ -0,0 +1,105 @@
package hunting
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/core/cbase"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"sync"
)
const (
game_vikingboss = "game_vikingboss.json"
game_challenge = "game_vikingchallenge.json"
)
///配置管理基础组件
type configureComp struct {
cbase.ModuleCompBase
hlock sync.RWMutex
modules.MCompConfigure
_vikingMap map[int64]*cfg.GameHuntingBossData
}
//组件初始化接口
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.ModuleCompBase.Init(service, module, comp, options)
this._vikingMap = make(map[int64]*cfg.GameHuntingBossData, 0)
configure.RegisterConfigure(game_vikingboss, cfg.NewGameHuntingBoss, func() {
if v, err := this.GetConfigure(game_vikingboss); err == nil {
if configure, ok := v.(*cfg.GameHuntingBoss); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
this._vikingMap[int64(value.Type<<16)+int64(value.Difficulty)] = value
}
return
}
}
log.Errorf("get game_viking conf err:%v", err)
return
})
err = this.LoadConfigure(game_challenge, cfg.NewGameHuntingChallenge)
// _data := this.GetBuyChallengeCount(1)
// log.Debugf("%v", _data)
return
}
// 参数: boss类型 难度
func (this *configureComp) GetHuntingBossConfigData(bossType int32, difficulty int32) (data *cfg.GameHuntingBossData) {
return this._vikingMap[int64(bossType<<16)+int64(difficulty)]
}
//加载多个配置文件
func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err error) {
for k, v := range confs {
err = configure.RegisterConfigure(k, v, nil)
if err != nil {
log.Errorf("配置文件:%s解析失败!", k)
break
}
}
return
}
//读取配置数据
func (this *configureComp) GetConfigure(name string) (v interface{}, err error) {
return configure.GetConfigure(name)
}
// get boss Type
func (this *configureComp) GetHuntingBossTypeConfigData() (mapType map[int32]struct{}) {
mapType = make(map[int32]struct{}, 0)
if v, err := this.GetConfigure(game_vikingboss); err == nil {
if configure, ok := v.(*cfg.GameHuntingBoss); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
if _, ok := mapType[value.Type]; !ok {
mapType[value.Type] = struct{}{}
}
}
}
}
return
}
func (this *configureComp) GetBuyChallengeCount(index int32) (data *cfg.GameHuntingChallengeData) {
if v, err := this.GetConfigure(game_challenge); err == nil {
if configure, ok := v.(*cfg.GameHuntingChallenge); ok {
data = configure.Get(index)
return
}
} else {
log.Errorf("get game_challenge conf err:%v", err)
}
return
}

View File

@ -0,0 +1,62 @@
package hunting
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/redis"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type ModelRank struct {
modules.MCompModel
moduleUser *Hunting
}
func (this *ModelRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.TableName = comm.TableHuntingRank
err = this.MCompModel.Init(service, module, comp, options)
this.moduleUser = module.(*Hunting)
return
}
//获取用户
func (this *ModelRank) getUserSession(uid string) (cuser *pb.CacheUser) {
cuser = &pb.CacheUser{}
if err := this.Get(uid, cuser); err != nil {
this.moduleUser.Errorf("GetUserSession err:%v", err)
return
}
return
}
func (this *ModelRank) AddRank(uId string, data *pb.DBHuntingRank) (err error) {
if err = this.Add(uId, data); err != nil {
return
}
return nil
}
func (this *ModelRank) GetUserRandData(uid string) (result *pb.DBHuntingRank, err error) {
result = &pb.DBHuntingRank{}
if err = this.Get(uid, result); err != nil && redis.RedisNil != err {
return
}
err = nil
return result, err
}
// 更新排行榜数据
func (this *ModelRank) ChangeUserRank(uid string, value map[string]interface{}) (err error) {
if len(value) == 0 {
return nil
}
return this.Change(uid, value)
}
func (this *ModelRank) GetRankData() (data []*pb.DBHuntingRank, err error) {
data = make([]*pb.DBHuntingRank, 0)
err = this.Redis.LRange(comm.TableHuntingRank, 0, -1, &data)
return
}

View File

@ -0,0 +1,41 @@
package hunting
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/redis"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/x/bsonx"
)
type modelHunting struct {
modules.MCompModel
module *Hunting
}
func (this *modelHunting) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.TableName = string(comm.TableHunting)
err = this.MCompModel.Init(service, module, comp, options)
this.module = module.(*Hunting)
// uid 创建索引
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
})
return
}
func (this *modelHunting) getHuntingList(uid string) (result *pb.DBHunting, err error) {
result = &pb.DBHunting{}
if err = this.Get(uid, result); err != nil && redis.RedisNil != err {
return
}
err = nil
return result, err
}
func (this *modelHunting) modifyHuntingDataByObjId(uid string, data map[string]interface{}) error {
return this.Change(uid, data)
}

47
modules/hunting/module.go Normal file
View File

@ -0,0 +1,47 @@
package hunting
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type Hunting struct {
modules.ModuleBase
modelHunting *modelHunting
api *apiComp
configure *configureComp
modulerank *ModelRank
}
func NewModule() core.IModule {
return &Hunting{}
}
func (this *Hunting) GetType() core.M_Modules {
return comm.ModuleHunting
}
func (this *Hunting) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
func (this *Hunting) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelHunting = this.RegisterComp(new(modelHunting)).(*modelHunting)
this.modulerank = this.RegisterComp(new(ModelRank)).(*ModelRank)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}
// 接口信息
func (this *Hunting) ModifyHuntingData(uid string, data map[string]interface{}) (code pb.ErrorCode) {
err := this.modelHunting.modifyHuntingDataByObjId(uid, data)
if err != nil {
code = pb.ErrorCode_DBError
}
return
}

View File

@ -16,9 +16,8 @@ const (
type apiComp struct {
modules.MCompGate
service core.IService
configure *configureComp
module *Smithy
service core.IService
module *Smithy
}
//组件初始化接口

View File

@ -43,12 +43,13 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreate
}
costTime += needTime * order.Count
}
if _smithy.Ctime == 0 {
_smithy.Ctime = time.Now().Unix()
}
_smithy.Orders = append(_smithy.Orders, req.Order...) // 直接追加订单数据
_smithy.OrderCostTime += costTime
if _smithy.Clang == nil || (_smithy.Clang != nil && _smithy.Clang.ETime == 0) {
if _smithy.Ctime == 0 {
_smithy.Ctime = time.Now().Unix()
}
if !utils.IsToday(_smithy.Ctime) {
_smithy.Ctime = time.Now().Unix()
_smithy.OrderCostTime = 0
@ -91,6 +92,13 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreate
// 校验通过 写数据
mapData := make(map[string]interface{}, 0)
sz := make([]*pb.OrderClang, 0)
for _, v := range _smithy.Orders {
if v.Count != 0 {
sz = append(sz, v)
}
}
_smithy.Orders = sz
mapData["orders"] = _smithy.Orders
mapData["orderCostTime"] = _smithy.OrderCostTime
mapData["clang"] = _smithy.Clang // 正在做的

View File

@ -37,10 +37,10 @@ func (this *apiComp) DeskSkillLv(session comm.IUserSession, req *pb.SmithyDeskSk
if k == req.DeskType {
bFindSkill = true
// 查询配置文件
curSkillCfg = this.configure.GetSmithyConfigData(k, v)
curSkillCfg = this.module.configure.GetSmithyConfigData(k, v)
if curSkillCfg != nil && curSkillCfg.Starupneed != nil {
//获取下一级
NextSkillCfg := this.configure.GetSmithyConfigData(k, v+1)
NextSkillCfg := this.module.configure.GetSmithyConfigData(k, v+1)
if NextSkillCfg == nil {
code = pb.ErrorCode_GourmetSkillMaxLv
return

View File

@ -26,12 +26,12 @@ func (this *apiComp) StoveSkillLv(session comm.IUserSession, req *pb.SmithyStove
code = pb.ErrorCode_DBError
return
}
curLvData := this.configure.GetSmithyStoveConfigData(_smithy.StoveLv)
curLvData := this.module.configure.GetSmithyStoveConfigData(_smithy.StoveLv)
if curLvData == nil {
code = pb.ErrorCode_GourmetSkillMaxLv
return
}
nextLvData := this.configure.GetSmithyStoveConfigData(_smithy.StoveLv + 1)
nextLvData := this.module.configure.GetSmithyStoveConfigData(_smithy.StoveLv + 1)
if nextLvData == nil {
code = pb.ErrorCode_GourmetSkillMaxLv
return

344
pb/hunting_db.pb.go Normal file
View File

@ -0,0 +1,344 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: hunting/hunting_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 DBHunting 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"` //用户ID
ChallengeCount int32 `protobuf:"varint,3,opt,name=challengeCount,proto3" json:"challengeCount" bson:"challengeCount"` //挑战次数
Boos map[int32]int32 `protobuf:"bytes,4,rep,name=boos,proto3" json:"boos" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key boos 类型 value 难度
BuyCount int32 `protobuf:"varint,5,opt,name=buyCount,proto3" json:"buyCount" bson:"buyCount"` //购买次数
CTime int64 `protobuf:"varint,6,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` //修改时间
ChallengeTime map[int32]int32 `protobuf:"bytes,7,rep,name=challengeTime,proto3" json:"challengeTime" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"challengeTime"` //每个难度通关时间
}
func (x *DBHunting) Reset() {
*x = DBHunting{}
if protoimpl.UnsafeEnabled {
mi := &file_hunting_hunting_db_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBHunting) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBHunting) ProtoMessage() {}
func (x *DBHunting) ProtoReflect() protoreflect.Message {
mi := &file_hunting_hunting_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 DBHunting.ProtoReflect.Descriptor instead.
func (*DBHunting) Descriptor() ([]byte, []int) {
return file_hunting_hunting_db_proto_rawDescGZIP(), []int{0}
}
func (x *DBHunting) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DBHunting) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DBHunting) GetChallengeCount() int32 {
if x != nil {
return x.ChallengeCount
}
return 0
}
func (x *DBHunting) GetBoos() map[int32]int32 {
if x != nil {
return x.Boos
}
return nil
}
func (x *DBHunting) GetBuyCount() int32 {
if x != nil {
return x.BuyCount
}
return 0
}
func (x *DBHunting) GetCTime() int64 {
if x != nil {
return x.CTime
}
return 0
}
func (x *DBHunting) GetChallengeTime() map[int32]int32 {
if x != nil {
return x.ChallengeTime
}
return nil
}
// 维京远征排行榜
type DBHuntingRank 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"` //用户ID
Difficulty int32 `protobuf:"varint,3,opt,name=difficulty,proto3" json:"difficulty"` // 难度
Bosstype int32 `protobuf:"varint,4,opt,name=bosstype,proto3" json:"bosstype"` // boss类型塔类型
Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname"` // 昵称
Icon string `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon"` // 玩家头像
Lv int32 `protobuf:"varint,7,opt,name=lv,proto3" json:"lv"` // 玩家等级
CostTime int32 `protobuf:"varint,8,opt,name=costTime,proto3" json:"costTime" bson:"costTime"` //闯关耗时 单位s
}
func (x *DBHuntingRank) Reset() {
*x = DBHuntingRank{}
if protoimpl.UnsafeEnabled {
mi := &file_hunting_hunting_db_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBHuntingRank) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBHuntingRank) ProtoMessage() {}
func (x *DBHuntingRank) ProtoReflect() protoreflect.Message {
mi := &file_hunting_hunting_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 DBHuntingRank.ProtoReflect.Descriptor instead.
func (*DBHuntingRank) Descriptor() ([]byte, []int) {
return file_hunting_hunting_db_proto_rawDescGZIP(), []int{1}
}
func (x *DBHuntingRank) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DBHuntingRank) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DBHuntingRank) GetDifficulty() int32 {
if x != nil {
return x.Difficulty
}
return 0
}
func (x *DBHuntingRank) GetBosstype() int32 {
if x != nil {
return x.Bosstype
}
return 0
}
func (x *DBHuntingRank) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}
func (x *DBHuntingRank) GetIcon() string {
if x != nil {
return x.Icon
}
return ""
}
func (x *DBHuntingRank) GetLv() int32 {
if x != nil {
return x.Lv
}
return 0
}
func (x *DBHuntingRank) GetCostTime() int32 {
if x != nil {
return x.CostTime
}
return 0
}
var File_hunting_hunting_db_proto protoreflect.FileDescriptor
var file_hunting_hunting_db_proto_rawDesc = []byte{
0x0a, 0x18, 0x68, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x68, 0x75, 0x6e, 0x74, 0x69, 0x6e,
0x67, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf1, 0x02, 0x0a, 0x09, 0x44,
0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 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, 0x26, 0x0a, 0x0e, 0x63, 0x68,
0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01,
0x28, 0x05, 0x52, 0x0e, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x75,
0x6e, 0x74, 0x12, 0x28, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x14, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x6f, 0x6f,
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x12, 0x1a, 0x0a, 0x08,
0x62, 0x75, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x62, 0x75, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x54, 0x69, 0x6d,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x43,
0x0a, 0x0d, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18,
0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e,
0x67, 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54,
0x69, 0x6d, 0x65, 0x1a, 0x37, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 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, 0x1a, 0x40, 0x0a, 0x12,
0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 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, 0xc9,
0x01, 0x0a, 0x0d, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b,
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, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79,
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c,
0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04,
0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a,
0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63,
0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x0e,
0x0a, 0x02, 0x6c, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x1a,
0x0a, 0x08, 0x63, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05,
0x52, 0x08, 0x63, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_hunting_hunting_db_proto_rawDescOnce sync.Once
file_hunting_hunting_db_proto_rawDescData = file_hunting_hunting_db_proto_rawDesc
)
func file_hunting_hunting_db_proto_rawDescGZIP() []byte {
file_hunting_hunting_db_proto_rawDescOnce.Do(func() {
file_hunting_hunting_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_hunting_hunting_db_proto_rawDescData)
})
return file_hunting_hunting_db_proto_rawDescData
}
var file_hunting_hunting_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_hunting_hunting_db_proto_goTypes = []interface{}{
(*DBHunting)(nil), // 0: DBHunting
(*DBHuntingRank)(nil), // 1: DBHuntingRank
nil, // 2: DBHunting.BoosEntry
nil, // 3: DBHunting.ChallengeTimeEntry
}
var file_hunting_hunting_db_proto_depIdxs = []int32{
2, // 0: DBHunting.boos:type_name -> DBHunting.BoosEntry
3, // 1: DBHunting.challengeTime:type_name -> DBHunting.ChallengeTimeEntry
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_hunting_hunting_db_proto_init() }
func file_hunting_hunting_db_proto_init() {
if File_hunting_hunting_db_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_hunting_hunting_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBHunting); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hunting_hunting_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBHuntingRank); 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_hunting_hunting_db_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_hunting_hunting_db_proto_goTypes,
DependencyIndexes: file_hunting_hunting_db_proto_depIdxs,
MessageInfos: file_hunting_hunting_db_proto_msgTypes,
}.Build()
File_hunting_hunting_db_proto = out.File
file_hunting_hunting_db_proto_rawDesc = nil
file_hunting_hunting_db_proto_goTypes = nil
file_hunting_hunting_db_proto_depIdxs = nil
}

585
pb/hunting_msg.pb.go Normal file
View File

@ -0,0 +1,585 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: hunting/hunting_msg.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 HuntingGetListReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *HuntingGetListReq) Reset() {
*x = HuntingGetListReq{}
if protoimpl.UnsafeEnabled {
mi := &file_hunting_hunting_msg_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HuntingGetListReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HuntingGetListReq) ProtoMessage() {}
func (x *HuntingGetListReq) ProtoReflect() protoreflect.Message {
mi := &file_hunting_hunting_msg_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 HuntingGetListReq.ProtoReflect.Descriptor instead.
func (*HuntingGetListReq) Descriptor() ([]byte, []int) {
return file_hunting_hunting_msg_proto_rawDescGZIP(), []int{0}
}
type HuntingGetListResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *DBHunting `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *HuntingGetListResp) Reset() {
*x = HuntingGetListResp{}
if protoimpl.UnsafeEnabled {
mi := &file_hunting_hunting_msg_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HuntingGetListResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HuntingGetListResp) ProtoMessage() {}
func (x *HuntingGetListResp) ProtoReflect() protoreflect.Message {
mi := &file_hunting_hunting_msg_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 HuntingGetListResp.ProtoReflect.Descriptor instead.
func (*HuntingGetListResp) Descriptor() ([]byte, []int) {
return file_hunting_hunting_msg_proto_rawDescGZIP(), []int{1}
}
func (x *HuntingGetListResp) GetData() *DBHunting {
if x != nil {
return x.Data
}
return nil
}
// 挑战
type HuntingChallengeReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
BossType int32 `protobuf:"varint,1,opt,name=bossType,proto3" json:"bossType"` // boos 类型
Difficulty int32 `protobuf:"varint,2,opt,name=difficulty,proto3" json:"difficulty"` // 难度
}
func (x *HuntingChallengeReq) Reset() {
*x = HuntingChallengeReq{}
if protoimpl.UnsafeEnabled {
mi := &file_hunting_hunting_msg_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HuntingChallengeReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HuntingChallengeReq) ProtoMessage() {}
func (x *HuntingChallengeReq) ProtoReflect() protoreflect.Message {
mi := &file_hunting_hunting_msg_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 HuntingChallengeReq.ProtoReflect.Descriptor instead.
func (*HuntingChallengeReq) Descriptor() ([]byte, []int) {
return file_hunting_hunting_msg_proto_rawDescGZIP(), []int{2}
}
func (x *HuntingChallengeReq) GetBossType() int32 {
if x != nil {
return x.BossType
}
return 0
}
func (x *HuntingChallengeReq) GetDifficulty() int32 {
if x != nil {
return x.Difficulty
}
return 0
}
type HuntingChallengeResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *DBHunting `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *HuntingChallengeResp) Reset() {
*x = HuntingChallengeResp{}
if protoimpl.UnsafeEnabled {
mi := &file_hunting_hunting_msg_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HuntingChallengeResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HuntingChallengeResp) ProtoMessage() {}
func (x *HuntingChallengeResp) ProtoReflect() protoreflect.Message {
mi := &file_hunting_hunting_msg_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 HuntingChallengeResp.ProtoReflect.Descriptor instead.
func (*HuntingChallengeResp) Descriptor() ([]byte, []int) {
return file_hunting_hunting_msg_proto_rawDescGZIP(), []int{3}
}
func (x *HuntingChallengeResp) GetData() *DBHunting {
if x != nil {
return x.Data
}
return nil
}
// 购买
type HuntingBuyReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count"` // 购买次数
}
func (x *HuntingBuyReq) Reset() {
*x = HuntingBuyReq{}
if protoimpl.UnsafeEnabled {
mi := &file_hunting_hunting_msg_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HuntingBuyReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HuntingBuyReq) ProtoMessage() {}
func (x *HuntingBuyReq) ProtoReflect() protoreflect.Message {
mi := &file_hunting_hunting_msg_proto_msgTypes[4]
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 HuntingBuyReq.ProtoReflect.Descriptor instead.
func (*HuntingBuyReq) Descriptor() ([]byte, []int) {
return file_hunting_hunting_msg_proto_rawDescGZIP(), []int{4}
}
func (x *HuntingBuyReq) GetCount() int32 {
if x != nil {
return x.Count
}
return 0
}
type HuntingBuyResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *DBHunting `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *HuntingBuyResp) Reset() {
*x = HuntingBuyResp{}
if protoimpl.UnsafeEnabled {
mi := &file_hunting_hunting_msg_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HuntingBuyResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HuntingBuyResp) ProtoMessage() {}
func (x *HuntingBuyResp) ProtoReflect() protoreflect.Message {
mi := &file_hunting_hunting_msg_proto_msgTypes[5]
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 HuntingBuyResp.ProtoReflect.Descriptor instead.
func (*HuntingBuyResp) Descriptor() ([]byte, []int) {
return file_hunting_hunting_msg_proto_rawDescGZIP(), []int{5}
}
func (x *HuntingBuyResp) GetData() *DBHunting {
if x != nil {
return x.Data
}
return nil
}
// 排行榜
type HuntingRankListReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *HuntingRankListReq) Reset() {
*x = HuntingRankListReq{}
if protoimpl.UnsafeEnabled {
mi := &file_hunting_hunting_msg_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HuntingRankListReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HuntingRankListReq) ProtoMessage() {}
func (x *HuntingRankListReq) ProtoReflect() protoreflect.Message {
mi := &file_hunting_hunting_msg_proto_msgTypes[6]
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 HuntingRankListReq.ProtoReflect.Descriptor instead.
func (*HuntingRankListReq) Descriptor() ([]byte, []int) {
return file_hunting_hunting_msg_proto_rawDescGZIP(), []int{6}
}
type HuntingRankListResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Ranks []*DBHuntingRank `protobuf:"bytes,1,rep,name=ranks,proto3" json:"ranks"` // 排行数据 有序的 注意boss类型
}
func (x *HuntingRankListResp) Reset() {
*x = HuntingRankListResp{}
if protoimpl.UnsafeEnabled {
mi := &file_hunting_hunting_msg_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HuntingRankListResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HuntingRankListResp) ProtoMessage() {}
func (x *HuntingRankListResp) ProtoReflect() protoreflect.Message {
mi := &file_hunting_hunting_msg_proto_msgTypes[7]
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 HuntingRankListResp.ProtoReflect.Descriptor instead.
func (*HuntingRankListResp) Descriptor() ([]byte, []int) {
return file_hunting_hunting_msg_proto_rawDescGZIP(), []int{7}
}
func (x *HuntingRankListResp) GetRanks() []*DBHuntingRank {
if x != nil {
return x.Ranks
}
return nil
}
var File_hunting_hunting_msg_proto protoreflect.FileDescriptor
var file_hunting_hunting_msg_proto_rawDesc = []byte{
0x0a, 0x19, 0x68, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x68, 0x75, 0x6e, 0x74, 0x69, 0x6e,
0x67, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x68, 0x75, 0x6e,
0x74, 0x69, 0x6e, 0x67, 0x2f, 0x68, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x62, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x13, 0x0a, 0x11, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67,
0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x34, 0x0a, 0x12, 0x48, 0x75,
0x6e, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70,
0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a,
0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
0x22, 0x51, 0x0a, 0x13, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c,
0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54,
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54,
0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74,
0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75,
0x6c, 0x74, 0x79, 0x22, 0x36, 0x0a, 0x14, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x68,
0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64,
0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x48, 0x75,
0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x25, 0x0a, 0x0d, 0x48,
0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x22, 0x30, 0x0a, 0x0e, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79,
0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x04,
0x64, 0x61, 0x74, 0x61, 0x22, 0x14, 0x0a, 0x12, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52,
0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x3b, 0x0a, 0x13, 0x48, 0x75,
0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
0x70, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0e, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b,
0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_hunting_hunting_msg_proto_rawDescOnce sync.Once
file_hunting_hunting_msg_proto_rawDescData = file_hunting_hunting_msg_proto_rawDesc
)
func file_hunting_hunting_msg_proto_rawDescGZIP() []byte {
file_hunting_hunting_msg_proto_rawDescOnce.Do(func() {
file_hunting_hunting_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_hunting_hunting_msg_proto_rawDescData)
})
return file_hunting_hunting_msg_proto_rawDescData
}
var file_hunting_hunting_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_hunting_hunting_msg_proto_goTypes = []interface{}{
(*HuntingGetListReq)(nil), // 0: HuntingGetListReq
(*HuntingGetListResp)(nil), // 1: HuntingGetListResp
(*HuntingChallengeReq)(nil), // 2: HuntingChallengeReq
(*HuntingChallengeResp)(nil), // 3: HuntingChallengeResp
(*HuntingBuyReq)(nil), // 4: HuntingBuyReq
(*HuntingBuyResp)(nil), // 5: HuntingBuyResp
(*HuntingRankListReq)(nil), // 6: HuntingRankListReq
(*HuntingRankListResp)(nil), // 7: HuntingRankListResp
(*DBHunting)(nil), // 8: DBHunting
(*DBHuntingRank)(nil), // 9: DBHuntingRank
}
var file_hunting_hunting_msg_proto_depIdxs = []int32{
8, // 0: HuntingGetListResp.data:type_name -> DBHunting
8, // 1: HuntingChallengeResp.data:type_name -> DBHunting
8, // 2: HuntingBuyResp.data:type_name -> DBHunting
9, // 3: HuntingRankListResp.ranks:type_name -> DBHuntingRank
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_hunting_hunting_msg_proto_init() }
func file_hunting_hunting_msg_proto_init() {
if File_hunting_hunting_msg_proto != nil {
return
}
file_hunting_hunting_db_proto_init()
if !protoimpl.UnsafeEnabled {
file_hunting_hunting_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HuntingGetListReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hunting_hunting_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HuntingGetListResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hunting_hunting_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HuntingChallengeReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hunting_hunting_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HuntingChallengeResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hunting_hunting_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HuntingBuyReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hunting_hunting_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HuntingBuyResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hunting_hunting_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HuntingRankListReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hunting_hunting_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HuntingRankListResp); 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_hunting_hunting_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_hunting_hunting_msg_proto_goTypes,
DependencyIndexes: file_hunting_hunting_msg_proto_depIdxs,
MessageInfos: file_hunting_hunting_msg_proto_msgTypes,
}.Build()
File_hunting_hunting_msg_proto = out.File
file_hunting_hunting_msg_proto_rawDesc = nil
file_hunting_hunting_msg_proto_goTypes = nil
file_hunting_hunting_msg_proto_depIdxs = nil
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type GameHuntingBoss struct {
_dataMap map[int32]*GameHuntingBossData
_dataList []*GameHuntingBossData
}
func NewGameHuntingBoss(_buf []map[string]interface{}) (*GameHuntingBoss, error) {
_dataList := make([]*GameHuntingBossData, 0, len(_buf))
dataMap := make(map[int32]*GameHuntingBossData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameHuntingBossData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Id] = _v
}
}
return &GameHuntingBoss{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameHuntingBoss) GetDataMap() map[int32]*GameHuntingBossData {
return table._dataMap
}
func (table *GameHuntingBoss) GetDataList() []*GameHuntingBossData {
return table._dataList
}
func (table *GameHuntingBoss) Get(key int32) *GameHuntingBossData {
return table._dataMap[key]
}

View File

@ -0,0 +1,167 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type GameHuntingBossData struct {
Id int32
Type int32
Name string
Difficulty int32
Captionrecommend []int32
Firstprize []*Gameatn
Dropshow []*Gameatn
Drop int32
Bossmodel int32
Npcid1 []int32
Npc1lv int32
Npc1hp float32
Npc1atk float32
Npc1def float32
Npcid2 []int32
Npc2lv int32
Npc2hp float32
Npc2atk float32
Npc2def float32
Npcid3 []int32
Npc3lv int32
Npc3hp float32
Npc3atk float32
Npc3def float32
Bosslv int32
Bosshp float32
Bossatk float32
Bossdef float32
}
const TypeId_GameHuntingBossData = -450881718
func (*GameHuntingBossData) GetTypeId() int32 {
return -450881718
}
func (_v *GameHuntingBossData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Name error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Name, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["difficulty"].(float64); !_ok_ { err = errors.New("difficulty error"); return }; _v.Difficulty = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["captionrecommend"].([]interface{}); !_ok_ { err = errors.New("captionrecommend error"); return }
_v.Captionrecommend = 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.Captionrecommend = append(_v.Captionrecommend, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["firstprize"].([]interface{}); !_ok_ { err = errors.New("firstprize error"); return }
_v.Firstprize = 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.Firstprize = append(_v.Firstprize, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["dropshow"].([]interface{}); !_ok_ { err = errors.New("dropshow error"); return }
_v.Dropshow = 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.Dropshow = append(_v.Dropshow, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["drop"].(float64); !_ok_ { err = errors.New("drop error"); return }; _v.Drop = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["bossmodel"].(float64); !_ok_ { err = errors.New("bossmodel error"); return }; _v.Bossmodel = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["npcid1"].([]interface{}); !_ok_ { err = errors.New("npcid1 error"); return }
_v.Npcid1 = 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.Npcid1 = append(_v.Npcid1, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc1lv"].(float64); !_ok_ { err = errors.New("npc1lv error"); return }; _v.Npc1lv = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc1hp"].(float64); !_ok_ { err = errors.New("npc1hp error"); return }; _v.Npc1hp = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc1atk"].(float64); !_ok_ { err = errors.New("npc1atk error"); return }; _v.Npc1atk = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc1def"].(float64); !_ok_ { err = errors.New("npc1def error"); return }; _v.Npc1def = float32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["npcid2"].([]interface{}); !_ok_ { err = errors.New("npcid2 error"); return }
_v.Npcid2 = 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.Npcid2 = append(_v.Npcid2, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc2lv"].(float64); !_ok_ { err = errors.New("npc2lv error"); return }; _v.Npc2lv = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc2hp"].(float64); !_ok_ { err = errors.New("npc2hp error"); return }; _v.Npc2hp = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc2atk"].(float64); !_ok_ { err = errors.New("npc2atk error"); return }; _v.Npc2atk = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc2def"].(float64); !_ok_ { err = errors.New("npc2def error"); return }; _v.Npc2def = float32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["npcid3"].([]interface{}); !_ok_ { err = errors.New("npcid3 error"); return }
_v.Npcid3 = 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.Npcid3 = append(_v.Npcid3, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc3lv"].(float64); !_ok_ { err = errors.New("npc3lv error"); return }; _v.Npc3lv = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc3hp"].(float64); !_ok_ { err = errors.New("npc3hp error"); return }; _v.Npc3hp = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc3atk"].(float64); !_ok_ { err = errors.New("npc3atk error"); return }; _v.Npc3atk = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["npc3def"].(float64); !_ok_ { err = errors.New("npc3def error"); return }; _v.Npc3def = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["bosslv"].(float64); !_ok_ { err = errors.New("bosslv error"); return }; _v.Bosslv = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["bosshp"].(float64); !_ok_ { err = errors.New("bosshp error"); return }; _v.Bosshp = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["bossatk"].(float64); !_ok_ { err = errors.New("bossatk error"); return }; _v.Bossatk = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["bossdef"].(float64); !_ok_ { err = errors.New("bossdef error"); return }; _v.Bossdef = float32(_tempNum_) }
return
}
func DeserializeGameHuntingBossData(_buf map[string]interface{}) (*GameHuntingBossData, error) {
v := &GameHuntingBossData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type GameHuntingChallenge struct {
_dataMap map[int32]*GameHuntingChallengeData
_dataList []*GameHuntingChallengeData
}
func NewGameHuntingChallenge(_buf []map[string]interface{}) (*GameHuntingChallenge, error) {
_dataList := make([]*GameHuntingChallengeData, 0, len(_buf))
dataMap := make(map[int32]*GameHuntingChallengeData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameHuntingChallengeData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Buynum] = _v
}
}
return &GameHuntingChallenge{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameHuntingChallenge) GetDataMap() map[int32]*GameHuntingChallengeData {
return table._dataMap
}
func (table *GameHuntingChallenge) GetDataList() []*GameHuntingChallengeData {
return table._dataList
}
func (table *GameHuntingChallenge) Get(key int32) *GameHuntingChallengeData {
return table._dataMap[key]
}

View File

@ -0,0 +1,50 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type GameHuntingChallengeData struct {
Buynum int32
Need []*Gameatn
}
const TypeId_GameHuntingChallengeData = 1005265914
func (*GameHuntingChallengeData) GetTypeId() int32 {
return 1005265914
}
func (_v *GameHuntingChallengeData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["buynum"].(float64); !_ok_ { err = errors.New("buynum error"); return }; _v.Buynum = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["need"].([]interface{}); !_ok_ { err = errors.New("need error"); return }
_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_)
}
}
return
}
func DeserializeGameHuntingChallengeData(_buf map[string]interface{}) (*GameHuntingChallengeData, error) {
v := &GameHuntingChallengeData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type GameHuntingOpenTime struct {
_dataMap map[int32]*GameHuntingOpenTimeData
_dataList []*GameHuntingOpenTimeData
}
func NewGameHuntingOpenTime(_buf []map[string]interface{}) (*GameHuntingOpenTime, error) {
_dataList := make([]*GameHuntingOpenTimeData, 0, len(_buf))
dataMap := make(map[int32]*GameHuntingOpenTimeData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameHuntingOpenTimeData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Type] = _v
}
}
return &GameHuntingOpenTime{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameHuntingOpenTime) GetDataMap() map[int32]*GameHuntingOpenTimeData {
return table._dataMap
}
func (table *GameHuntingOpenTime) GetDataList() []*GameHuntingOpenTimeData {
return table._dataList
}
func (table *GameHuntingOpenTime) Get(key int32) *GameHuntingOpenTimeData {
return table._dataMap[key]
}

View File

@ -0,0 +1,50 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type GameHuntingOpenTimeData struct {
Type int32
Opentime []int32
}
const TypeId_GameHuntingOpenTimeData = 1854578068
func (*GameHuntingOpenTimeData) GetTypeId() int32 {
return 1854578068
}
func (_v *GameHuntingOpenTimeData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["opentime"].([]interface{}); !_ok_ { err = errors.New("opentime error"); return }
_v.Opentime = 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.Opentime = append(_v.Opentime, _list_v_)
}
}
return
}
func DeserializeGameHuntingOpenTimeData(_buf map[string]interface{}) (*GameHuntingOpenTimeData, error) {
v := &GameHuntingOpenTimeData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}