Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev

This commit is contained in:
meixiongfeng 2022-08-26 15:46:36 +08:00
commit ae6ffabe3b
20 changed files with 3835 additions and 47 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

@ -55,6 +55,7 @@ const (
ModuleRtask core.M_Modules = "rtask" //随机任务 ModuleRtask core.M_Modules = "rtask" //随机任务
ModuleSmithy core.M_Modules = "smithy" //铁匠铺 ModuleSmithy core.M_Modules = "smithy" //铁匠铺
ModuleTimer core.M_Modules = "timer" //定时任务模块 ModuleTimer core.M_Modules = "timer" //定时任务模块
ModuleViking core.M_Modules = "viking" //维京远征
) )
//数据表名定义处 //数据表名定义处
@ -111,6 +112,8 @@ const (
TableSmithy = "smithy" TableSmithy = "smithy"
/// 赛季塔数据表 /// 赛季塔数据表
TableSeasonPagoda = "seasonpagoda" TableSeasonPagoda = "seasonpagoda"
//
TableViking = "viking"
) )
//RPC服务接口定义处 //RPC服务接口定义处

View File

@ -70,6 +70,8 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
code = pb.ErrorCode_PagodaNotFound code = pb.ErrorCode_PagodaNotFound
return return
} }
// 塔数据校验
seasonPagoda, _ := this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId()) seasonPagoda, _ := this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
if seasonPagoda == nil { if seasonPagoda == nil {
@ -94,7 +96,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
this.module.modelSeasonPagoda.addNewSeasonPagoda(session.GetUserId(), seasonPagoda) this.module.modelSeasonPagoda.addNewSeasonPagoda(session.GetUserId(), seasonPagoda)
} else { } else {
pagoda.PagodaId = cfg.LayerNum seasonPagoda.PagodaId = cfg.LayerNum
mapData["pagodaId"] = cfg.LayerNum mapData["pagodaId"] = cfg.LayerNum
code = this.module.ModifySeasonPagodaData(session.GetUserId(), mapData) code = this.module.ModifySeasonPagodaData(session.GetUserId(), mapData)
} }
@ -112,6 +114,10 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
mapData["pagodaId"] = cfg.LayerNum mapData["pagodaId"] = cfg.LayerNum
this.module.modulerank.ChangeUserRank(session.GetUserId(), mapData) this.module.modulerank.ChangeUserRank(session.GetUserId(), mapData)
} }
pagoda.PagodaId = seasonPagoda.PagodaId
pagoda.Type = seasonPagoda.Type
pagoda.Reward = seasonPagoda.Reward
session.SendMsg(string(this.module.GetType()), PagodaChallengeResp, &pb.PagodaChallengeResp{Data: pagoda})
} }
return return

View File

@ -28,32 +28,69 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.PagodaGetRewar
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
_cfg := this.module.configure.GetPagodaRewardconfig(req.Id) season, _ := this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
if _cfg == nil { if season != nil {
code = pb.ErrorCode_ConfigNoFound _cfg := this.module.configure.GetPagodaRewardconfig(req.Id)
return if _cfg == nil {
} code = pb.ErrorCode_ConfigNoFound
// 校验是否能领取 return
if _cfg.LayerNum >= list.PagodaId { }
code = pb.ErrorCode_PagodaConditionErr // 校验是否能领取
return if _cfg.LayerNum >= season.PagodaId {
code = pb.ErrorCode_PagodaConditionErr
return
}
if _, ok := season.Reward[req.Id]; ok { // 校验是否重复领取
code = pb.ErrorCode_PagodaGetRewardErr
return
}
if season.Reward == nil {
season.Reward = make(map[int32]bool, 0)
}
// 发奖励
if code = this.module.DispenseRes(session, _cfg.Reward, true); code != pb.ErrorCode_Success {
return
}
season.Reward[req.Id] = true
mapData := make(map[string]interface{}, 0)
mapData["reward"] = season.Reward
code = this.module.ModifySeasonPagodaData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), PagodaGetRewardResp, &pb.PagodaGetRewardResp{Data: &pb.DBPagoda{
PagodaId: season.PagodaId,
Reward: season.Reward,
Type: season.Type,
}})
} else {
_cfg := this.module.configure.GetPagodaRewardconfig(req.Id)
if _cfg == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
// 校验是否能领取
if _cfg.LayerNum >= list.PagodaId {
code = pb.ErrorCode_PagodaConditionErr
return
}
if _, ok := list.Reward[req.Id]; ok { // 校验是否重复领取
code = pb.ErrorCode_PagodaGetRewardErr
return
}
if list.Reward == nil {
list.Reward = make(map[int32]bool, 0)
}
// 发奖励
if code = this.module.DispenseRes(session, _cfg.Reward, true); code != pb.ErrorCode_Success {
return
}
list.Reward[req.Id] = true
mapData := make(map[string]interface{}, 0)
mapData["reward"] = list.Reward
code = this.module.ModifyPagodaData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), PagodaGetRewardResp, &pb.PagodaGetRewardResp{Data: list})
} }
if _, ok := list.Reward[req.GetId()]; ok { // 校验是否重复领取
code = pb.ErrorCode_PagodaGetRewardErr
return
}
if list.Reward == nil {
list.Reward = make(map[int32]bool, 0)
}
// 发奖励
if code = this.module.DispenseRes(session, _cfg.Reward, true); code != pb.ErrorCode_Success {
return
}
list.Reward[req.Id] = true
mapData := make(map[string]interface{}, 0)
mapData["reward"] = list.Reward
code = this.module.ModifyPagodaData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), PagodaGetRewardResp, &pb.PagodaGetRewardResp{Data: list})
return return
} }

View File

@ -43,6 +43,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq
if season != nil { if season != nil {
list.PagodaId = season.PagodaId list.PagodaId = season.PagodaId
list.Type = season.Type list.Type = season.Type
list.Reward = season.Reward
} }
return return
} }

View File

@ -43,23 +43,7 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreate
} }
costTime += needTime * order.Count costTime += needTime * order.Count
} }
if _smithy.Orders == nil { // 队列数据为nil 直接将订单数据给ta _smithy.Orders = append(_smithy.Orders, req.Order...) // 直接追加订单数据
_smithy.Orders = req.Order
} else {
for _, v := range req.Order {
bFound := false
for _, v1 := range _smithy.Orders {
if v.DeskType == v1.DeskType {
v1.Count += v.Count // 加对应的数量
bFound = true
break
}
}
if !bFound {
_smithy.Orders = append(_smithy.Orders, v)
}
}
}
if _smithy.Clang == nil || (_smithy.Clang != nil && _smithy.Clang.ETime == 0) { if _smithy.Clang == nil || (_smithy.Clang != nil && _smithy.Clang.ETime == 0) {
if _smithy.Ctime == 0 { if _smithy.Ctime == 0 {
@ -73,7 +57,6 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreate
if v.Count > 0 { if v.Count > 0 {
v.Count-- v.Count--
// 获取生产时间 // 获取生产时间
_smithy.Clang = &pb.Clang{ _smithy.Clang = &pb.Clang{
DeskType: v.DeskType, DeskType: v.DeskType,
ETime: time.Now().Unix() + int64(needTime), ETime: time.Now().Unix() + int64(needTime),
@ -105,9 +88,6 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreate
return return
} }
if code = this.module.DispenseRes(session, res, true); code != pb.ErrorCode_Success { // 真正消耗
return
}
// 校验通过 写数据 // 校验通过 写数据
mapData := make(map[string]interface{}, 0) mapData := make(map[string]interface{}, 0)
mapData["orders"] = _smithy.Orders mapData["orders"] = _smithy.Orders

View File

@ -32,6 +32,9 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.SmithyGetRewar
}) })
} }
code = this.module.DispenseRes(session, res, true) code = this.module.DispenseRes(session, res, true)
if code != pb.ErrorCode_Success {
return
}
_gourmet.Items = nil _gourmet.Items = nil
mapData := make(map[string]interface{}, 0) mapData := make(map[string]interface{}, 0)
mapData["items"] = nil mapData["items"] = nil

34
modules/viking/api.go Normal file
View File

@ -0,0 +1,34 @@
package viking
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
const (
VikingGetListResp = "getlist"
VikingCreateOrderResp = "createorder"
VikingSkillLvResp = "skilllv"
VikingGetRewardResp = "getreward"
)
type apiComp struct {
modules.MCompGate
service core.IService
configure *configureComp
module *Viking
}
//组件初始化接口
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.(*Viking)
this.service = service
return
}
func (this *apiComp) Start() (err error) {
err = this.MCompGate.Start()
return
}

View File

@ -0,0 +1,24 @@
package viking
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.GourmetGetListReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) GetList(session comm.IUserSession, req *pb.GourmetGetListReq) (code pb.ErrorCode, data proto.Message) {
code = this.GetListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
return
}

View File

@ -0,0 +1,145 @@
package viking
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_gourmet = "game_gourmet.json"
game_gourmetskill = "game_gourmetskill.json"
game_drop = "game_drop.json"
)
///配置管理基础组件
type configureComp struct {
cbase.ModuleCompBase
hlock sync.RWMutex
modules.MCompConfigure
_gourmetMap map[int64]*cfg.GameGourmetData
_gourmetSkillMap map[int64]*cfg.GameGourmetSkillData
_dropMap map[int32][]*cfg.GameDropData // 掉落表 key 是DiropId
}
//组件初始化接口
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._gourmetMap = make(map[int64]*cfg.GameGourmetData, 0)
configure.RegisterConfigure(game_gourmet, cfg.NewGameGourmet, func() {
if v, err := this.GetConfigure(game_gourmet); err == nil {
if configure, ok := v.(*cfg.GameGourmet); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
this._gourmetMap[int64(value.Type<<16)+int64(value.Level)] = value
}
return
}
}
log.Errorf("get game_pagoda conf err:%v", err)
return
})
this._gourmetSkillMap = make(map[int64]*cfg.GameGourmetSkillData, 0)
configure.RegisterConfigure(game_gourmetskill, cfg.NewGameGourmetSkill, func() {
if v, err := this.GetConfigure(game_gourmetskill); err == nil {
if configure, ok := v.(*cfg.GameGourmetSkill); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
this._gourmetSkillMap[int64(value.Type<<16)+int64(value.Level)] = value
}
return
}
}
log.Errorf("get game_pagoda conf err:%v", err)
return
})
this._dropMap = make(map[int32][]*cfg.GameDropData, 0)
configure.RegisterConfigure(game_drop, cfg.NewGameDrop, func() {
if v, err := this.GetConfigure(game_drop); err == nil {
if configure, ok := v.(*cfg.GameDrop); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
this._dropMap[value.Dropid] = append(this._dropMap[value.Dropid], value)
}
return
}
}
log.Errorf("get game_pagoda conf err:%v", err)
return
})
// _data := this.GetGourmetConfigData(1002, 4) // 测试配置文件读取
// _dataskill := this.GetGourmetSkillConfigData(1001, 4)
// _data := this.GetDropData(1001)
// fmt.Printf("%v", _data)
return
}
// 获取美食馆配置数据
func (this *configureComp) GetGourmetConfigData(gourmetType int32, level int32) (data *cfg.GameGourmetData) {
return this._gourmetMap[int64(gourmetType<<16)+int64(level)]
}
// 获取美食馆配置数据
func (this *configureComp) GetGourmetSkillConfigData(gourmetType int32, level int32) (data *cfg.GameGourmetSkillData) {
return this._gourmetSkillMap[int64(gourmetType<<16)+int64(level)]
}
// 通过技能id 查询技能配置表
func (this *configureComp) GetGourmetSkillConfigBySkillID(skillId int) (data *cfg.GameGourmetSkillData) {
if v, err := this.GetConfigure(game_gourmetskill); err == nil {
if configure, ok := v.(*cfg.GameGourmetSkill); ok {
data = configure.Get(int32(skillId))
return
}
}
return
}
func (this *configureComp) GetGourmetSkillConfigBySkillType(skillType int) (szSkill []int32) {
szSkill = make([]int32, 0)
if v, err := this.GetConfigure(game_gourmetskill); err == nil {
if configure, ok := v.(*cfg.GameGourmetSkill); ok {
for _, data := range configure.GetDataList() {
if skillType == int(data.SkillType) && data.Initial == 1 {
szSkill = append(szSkill, data.Type)
}
}
//data = configure.Get(int32(skillId))
return
}
}
return
}
//加载多个配置文件
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)
}
func (this *configureComp) GetDropData(dropId int32) (data []*cfg.GameDropData) {
data = this._dropMap[dropId]
return
}

View File

@ -0,0 +1,78 @@
package viking
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/x/bsonx"
)
type modelViking struct {
modules.MCompModel
module *Viking
}
func (this *modelViking) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.TableName = string(comm.TableViking)
err = this.MCompModel.Init(service, module, comp, options)
this.module = module.(*Viking)
// uid 创建索引
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
})
return
}
// func (this *modelViking) getVikingList(uid string) (result *pb.DBViking, err error) {
// result = &pb.DBViking{}
// if err = this.Get(uid, result); err != nil {
// if redis.RedisNil != err { // 没有数据直接创建新的数据
// return
// }
// }
// err = nil
// return result, err
// }
func (this *modelViking) modifyVikingDataByObjId(uid string, data map[string]interface{}) error {
return this.Change(uid, data)
}
// todo 调用drop 表 获取掉落信息
func (this *modelViking) GetDropReward(count, dropId int32, Items []*pb.UserAssets) {
res := make([]*cfg.Gameatn, 0)
for i := 0; i < int(count); i++ {
data := this.module.configure.GetDropData(dropId)
szW := make([]int32, 0)
for _, value := range data {
szW = append(szW, value.P)
}
if len(szW) > 0 {
index := comm.GetRandW(szW)
res = append(res, data[index].Prize...)
}
}
for _, v := range res {
bFind := false
for _, v1 := range Items {
if v.A == v1.A && v.T == v1.T {
v1.N += v.N
bFind = true
}
}
if !bFind {
Items = append(Items, &pb.UserAssets{
A: v.A,
T: v.T,
N: v.N,
})
}
}
return
}

50
modules/viking/module.go Normal file
View File

@ -0,0 +1,50 @@
/*
模块名:viking
描述:维京远征
开发:梅雄风
*/
package viking
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type Viking struct {
modules.ModuleBase
modelViking *modelViking
api *apiComp
configure *configureComp
}
func NewModule() core.IModule {
return &Viking{}
}
func (this *Viking) GetType() core.M_Modules {
return comm.ModuleViking
}
func (this *Viking) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
func (this *Viking) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelViking = this.RegisterComp(new(modelViking)).(*modelViking)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}
// 接口信息
func (this *Viking) ModifyVikingData(uid string, data map[string]interface{}) (code pb.ErrorCode) {
err := this.modelViking.modifyVikingDataByObjId(uid, data)
if err != nil {
code = pb.ErrorCode_DBError
}
return
}

197
pb/viking_db.pb.go Normal file
View File

@ -0,0 +1,197 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: viking/viking_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 DBViking 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]bool `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"` //修改时间
}
func (x *DBViking) Reset() {
*x = DBViking{}
if protoimpl.UnsafeEnabled {
mi := &file_viking_viking_db_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBViking) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBViking) ProtoMessage() {}
func (x *DBViking) ProtoReflect() protoreflect.Message {
mi := &file_viking_viking_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 DBViking.ProtoReflect.Descriptor instead.
func (*DBViking) Descriptor() ([]byte, []int) {
return file_viking_viking_db_proto_rawDescGZIP(), []int{0}
}
func (x *DBViking) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DBViking) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DBViking) GetChallengeCount() int32 {
if x != nil {
return x.ChallengeCount
}
return 0
}
func (x *DBViking) GetBoos() map[int32]bool {
if x != nil {
return x.Boos
}
return nil
}
func (x *DBViking) GetBuyCount() int32 {
if x != nil {
return x.BuyCount
}
return 0
}
func (x *DBViking) GetCTime() int64 {
if x != nil {
return x.CTime
}
return 0
}
var File_viking_viking_db_proto protoreflect.FileDescriptor
var file_viking_viking_db_proto_rawDesc = []byte{
0x0a, 0x16, 0x76, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x5f,
0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe8, 0x01, 0x0a, 0x08, 0x44, 0x42, 0x56,
0x69, 0x6b, 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,
0x27, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e,
0x44, 0x42, 0x56, 0x69, 0x6b, 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, 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, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_viking_viking_db_proto_rawDescOnce sync.Once
file_viking_viking_db_proto_rawDescData = file_viking_viking_db_proto_rawDesc
)
func file_viking_viking_db_proto_rawDescGZIP() []byte {
file_viking_viking_db_proto_rawDescOnce.Do(func() {
file_viking_viking_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_viking_viking_db_proto_rawDescData)
})
return file_viking_viking_db_proto_rawDescData
}
var file_viking_viking_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_viking_viking_db_proto_goTypes = []interface{}{
(*DBViking)(nil), // 0: DBViking
nil, // 1: DBViking.BoosEntry
}
var file_viking_viking_db_proto_depIdxs = []int32{
1, // 0: DBViking.boos:type_name -> DBViking.BoosEntry
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_viking_viking_db_proto_init() }
func file_viking_viking_db_proto_init() {
if File_viking_viking_db_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_viking_viking_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBViking); 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_viking_viking_db_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_viking_viking_db_proto_goTypes,
DependencyIndexes: file_viking_viking_db_proto_depIdxs,
MessageInfos: file_viking_viking_db_proto_msgTypes,
}.Build()
File_viking_viking_db_proto = out.File
file_viking_viking_db_proto_rawDesc = nil
file_viking_viking_db_proto_goTypes = nil
file_viking_viking_db_proto_depIdxs = nil
}

560
pb/viking_msg.pb.go Normal file
View File

@ -0,0 +1,560 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: viking/viking_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 VikingGetListReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *VikingGetListReq) Reset() {
*x = VikingGetListReq{}
if protoimpl.UnsafeEnabled {
mi := &file_viking_viking_msg_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VikingGetListReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VikingGetListReq) ProtoMessage() {}
func (x *VikingGetListReq) ProtoReflect() protoreflect.Message {
mi := &file_viking_viking_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 VikingGetListReq.ProtoReflect.Descriptor instead.
func (*VikingGetListReq) Descriptor() ([]byte, []int) {
return file_viking_viking_msg_proto_rawDescGZIP(), []int{0}
}
type VikingGetListResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *DBViking `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *VikingGetListResp) Reset() {
*x = VikingGetListResp{}
if protoimpl.UnsafeEnabled {
mi := &file_viking_viking_msg_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VikingGetListResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VikingGetListResp) ProtoMessage() {}
func (x *VikingGetListResp) ProtoReflect() protoreflect.Message {
mi := &file_viking_viking_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 VikingGetListResp.ProtoReflect.Descriptor instead.
func (*VikingGetListResp) Descriptor() ([]byte, []int) {
return file_viking_viking_msg_proto_rawDescGZIP(), []int{1}
}
func (x *VikingGetListResp) GetData() *DBViking {
if x != nil {
return x.Data
}
return nil
}
// 挑战
type VikingChallengeReq 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 *VikingChallengeReq) Reset() {
*x = VikingChallengeReq{}
if protoimpl.UnsafeEnabled {
mi := &file_viking_viking_msg_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VikingChallengeReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VikingChallengeReq) ProtoMessage() {}
func (x *VikingChallengeReq) ProtoReflect() protoreflect.Message {
mi := &file_viking_viking_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 VikingChallengeReq.ProtoReflect.Descriptor instead.
func (*VikingChallengeReq) Descriptor() ([]byte, []int) {
return file_viking_viking_msg_proto_rawDescGZIP(), []int{2}
}
func (x *VikingChallengeReq) GetBossType() int32 {
if x != nil {
return x.BossType
}
return 0
}
func (x *VikingChallengeReq) GetDifficulty() int32 {
if x != nil {
return x.Difficulty
}
return 0
}
type VikingChallengeResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *DBViking `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *VikingChallengeResp) Reset() {
*x = VikingChallengeResp{}
if protoimpl.UnsafeEnabled {
mi := &file_viking_viking_msg_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VikingChallengeResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VikingChallengeResp) ProtoMessage() {}
func (x *VikingChallengeResp) ProtoReflect() protoreflect.Message {
mi := &file_viking_viking_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 VikingChallengeResp.ProtoReflect.Descriptor instead.
func (*VikingChallengeResp) Descriptor() ([]byte, []int) {
return file_viking_viking_msg_proto_rawDescGZIP(), []int{3}
}
func (x *VikingChallengeResp) GetData() *DBViking {
if x != nil {
return x.Data
}
return nil
}
// 购买
type VikingBuyReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *VikingBuyReq) Reset() {
*x = VikingBuyReq{}
if protoimpl.UnsafeEnabled {
mi := &file_viking_viking_msg_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VikingBuyReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VikingBuyReq) ProtoMessage() {}
func (x *VikingBuyReq) ProtoReflect() protoreflect.Message {
mi := &file_viking_viking_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 VikingBuyReq.ProtoReflect.Descriptor instead.
func (*VikingBuyReq) Descriptor() ([]byte, []int) {
return file_viking_viking_msg_proto_rawDescGZIP(), []int{4}
}
type VikingBuyResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *DBViking `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *VikingBuyResp) Reset() {
*x = VikingBuyResp{}
if protoimpl.UnsafeEnabled {
mi := &file_viking_viking_msg_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VikingBuyResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VikingBuyResp) ProtoMessage() {}
func (x *VikingBuyResp) ProtoReflect() protoreflect.Message {
mi := &file_viking_viking_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 VikingBuyResp.ProtoReflect.Descriptor instead.
func (*VikingBuyResp) Descriptor() ([]byte, []int) {
return file_viking_viking_msg_proto_rawDescGZIP(), []int{5}
}
func (x *VikingBuyResp) GetData() *DBViking {
if x != nil {
return x.Data
}
return nil
}
// 排行榜
type VikingRankListReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *VikingRankListReq) Reset() {
*x = VikingRankListReq{}
if protoimpl.UnsafeEnabled {
mi := &file_viking_viking_msg_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VikingRankListReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VikingRankListReq) ProtoMessage() {}
func (x *VikingRankListReq) ProtoReflect() protoreflect.Message {
mi := &file_viking_viking_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 VikingRankListReq.ProtoReflect.Descriptor instead.
func (*VikingRankListReq) Descriptor() ([]byte, []int) {
return file_viking_viking_msg_proto_rawDescGZIP(), []int{6}
}
type VikingRankListResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *VikingRankListResp) Reset() {
*x = VikingRankListResp{}
if protoimpl.UnsafeEnabled {
mi := &file_viking_viking_msg_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VikingRankListResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VikingRankListResp) ProtoMessage() {}
func (x *VikingRankListResp) ProtoReflect() protoreflect.Message {
mi := &file_viking_viking_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 VikingRankListResp.ProtoReflect.Descriptor instead.
func (*VikingRankListResp) Descriptor() ([]byte, []int) {
return file_viking_viking_msg_proto_rawDescGZIP(), []int{7}
}
var File_viking_viking_msg_proto protoreflect.FileDescriptor
var file_viking_viking_msg_proto_rawDesc = []byte{
0x0a, 0x17, 0x76, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x5f,
0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x76, 0x69, 0x6b, 0x69, 0x6e,
0x67, 0x2f, 0x76, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x12, 0x0a, 0x10, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x47, 0x65, 0x74, 0x4c, 0x69,
0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x32, 0x0a, 0x11, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x47,
0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61,
0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b,
0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x50, 0x0a, 0x12, 0x56, 0x69, 0x6b,
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, 0x34, 0x0a, 0x13, 0x56,
0x69, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65,
0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x09, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74,
0x61, 0x22, 0x0e, 0x0a, 0x0c, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65,
0x71, 0x22, 0x2e, 0x0a, 0x0d, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65,
0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x09, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74,
0x61, 0x22, 0x13, 0x0a, 0x11, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c,
0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x14, 0x0a, 0x12, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67,
0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_viking_viking_msg_proto_rawDescOnce sync.Once
file_viking_viking_msg_proto_rawDescData = file_viking_viking_msg_proto_rawDesc
)
func file_viking_viking_msg_proto_rawDescGZIP() []byte {
file_viking_viking_msg_proto_rawDescOnce.Do(func() {
file_viking_viking_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_viking_viking_msg_proto_rawDescData)
})
return file_viking_viking_msg_proto_rawDescData
}
var file_viking_viking_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_viking_viking_msg_proto_goTypes = []interface{}{
(*VikingGetListReq)(nil), // 0: VikingGetListReq
(*VikingGetListResp)(nil), // 1: VikingGetListResp
(*VikingChallengeReq)(nil), // 2: VikingChallengeReq
(*VikingChallengeResp)(nil), // 3: VikingChallengeResp
(*VikingBuyReq)(nil), // 4: VikingBuyReq
(*VikingBuyResp)(nil), // 5: VikingBuyResp
(*VikingRankListReq)(nil), // 6: VikingRankListReq
(*VikingRankListResp)(nil), // 7: VikingRankListResp
(*DBViking)(nil), // 8: DBViking
}
var file_viking_viking_msg_proto_depIdxs = []int32{
8, // 0: VikingGetListResp.data:type_name -> DBViking
8, // 1: VikingChallengeResp.data:type_name -> DBViking
8, // 2: VikingBuyResp.data:type_name -> DBViking
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_viking_viking_msg_proto_init() }
func file_viking_viking_msg_proto_init() {
if File_viking_viking_msg_proto != nil {
return
}
file_viking_viking_db_proto_init()
if !protoimpl.UnsafeEnabled {
file_viking_viking_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VikingGetListReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_viking_viking_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VikingGetListResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_viking_viking_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VikingChallengeReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_viking_viking_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VikingChallengeResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_viking_viking_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VikingBuyReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_viking_viking_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VikingBuyResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_viking_viking_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VikingRankListReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_viking_viking_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VikingRankListResp); 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_viking_viking_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_viking_viking_msg_proto_goTypes,
DependencyIndexes: file_viking_viking_msg_proto_depIdxs,
MessageInfos: file_viking_viking_msg_proto_msgTypes,
}.Build()
File_viking_viking_msg_proto = out.File
file_viking_viking_msg_proto_rawDesc = nil
file_viking_viking_msg_proto_goTypes = nil
file_viking_viking_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 GameVikingBoss struct {
_dataMap map[int32]*GameVikingBossData
_dataList []*GameVikingBossData
}
func NewGameVikingBoss(_buf []map[string]interface{}) (*GameVikingBoss, error) {
_dataList := make([]*GameVikingBossData, 0, len(_buf))
dataMap := make(map[int32]*GameVikingBossData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameVikingBossData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Id] = _v
}
}
return &GameVikingBoss{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameVikingBoss) GetDataMap() map[int32]*GameVikingBossData {
return table._dataMap
}
func (table *GameVikingBoss) GetDataList() []*GameVikingBossData {
return table._dataList
}
func (table *GameVikingBoss) Get(key int32) *GameVikingBossData {
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 GameVikingBossData 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_GameVikingBossData = 550277405
func (*GameVikingBossData) GetTypeId() int32 {
return 550277405
}
func (_v *GameVikingBossData)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 DeserializeGameVikingBossData(_buf map[string]interface{}) (*GameVikingBossData, error) {
v := &GameVikingBossData{}
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 GameVikingChallenge struct {
_dataMap map[int32]*GameVikingChallengeData
_dataList []*GameVikingChallengeData
}
func NewGameVikingChallenge(_buf []map[string]interface{}) (*GameVikingChallenge, error) {
_dataList := make([]*GameVikingChallengeData, 0, len(_buf))
dataMap := make(map[int32]*GameVikingChallengeData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameVikingChallengeData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Buynum] = _v
}
}
return &GameVikingChallenge{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameVikingChallenge) GetDataMap() map[int32]*GameVikingChallengeData {
return table._dataMap
}
func (table *GameVikingChallenge) GetDataList() []*GameVikingChallengeData {
return table._dataList
}
func (table *GameVikingChallenge) Get(key int32) *GameVikingChallengeData {
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 GameVikingChallengeData struct {
Buynum int32
Need []*Gameatn
}
const TypeId_GameVikingChallengeData = 1311823367
func (*GameVikingChallengeData) GetTypeId() int32 {
return 1311823367
}
func (_v *GameVikingChallengeData)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 DeserializeGameVikingChallengeData(_buf map[string]interface{}) (*GameVikingChallengeData, error) {
v := &GameVikingChallengeData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}