This commit is contained in:
liwei1dao 2022-08-19 15:07:27 +08:00
commit 1f1e6c18fd
25 changed files with 470 additions and 218 deletions

View File

@ -5,4 +5,4 @@ Website = "https://legu.com"
Name = "RobotGUI"
ID = "com.legu.app"
Version = "1.0.1"
Build = 7
Build = 8

View File

@ -27,7 +27,7 @@ a.SetIcon(resourceFavPng)
## package
fyne package --name robotGUI-1.0.1 -os windows -icon Icon.png
fyne package --name robotGUI-1.0.0 -os windows -icon Icon.png
## 开发协议参数表单

View File

@ -9,7 +9,7 @@ services:
name: 赵长远
url: ws://10.0.0.238:7891/gateway
- service:
sid: 3
sid: "df01"
name: 内网
url: ws://10.0.0.9:7891/gateway
- service:

View File

@ -16,7 +16,7 @@ import (
type DbService interface {
Save(conf *model.GenTool) error
Update() error
Get() *model.GenTool
Get(key string) *model.GenTool
}
type DbServiceImpl struct {
@ -36,17 +36,24 @@ func GetDbService() DbService {
func (this *DbServiceImpl) Save(conf *model.GenTool) error {
boltDb = GetBoltDb()
defer boltDb.Close()
_ = boltDb.Update(func(tx *bolt.Tx) error {
if err := boltDb.Update(func(tx *bolt.Tx) error {
b, err2 := json.Marshal(conf)
if err2 != nil {
return err
}
return bucket.Put([]byte(common.BUCKET_CONF), b)
})
c := tx.Bucket([]byte(common.BOLTDB_BUCKETNAME))
if c == nil {
return fmt.Errorf("Bucket %s not found!", common.BOLTDB_BUCKETNAME)
}
return c.Put([]byte(common.BUCKET_CONF), b)
}); err != nil {
logrus.Errorf("save err: %v", err)
return err
}
return nil
}
func (this *DbServiceImpl) Get() *model.GenTool {
func (this *DbServiceImpl) Get(key string) *model.GenTool {
boltDb = GetBoltDb()
defer boltDb.Close()
conf := &model.GenTool{}
@ -56,7 +63,7 @@ func (this *DbServiceImpl) Get() *model.GenTool {
return fmt.Errorf("Bucket %s not found!", common.BOLTDB_BUCKETNAME)
}
val := c.Get([]byte(common.BUCKET_CONF))
val := c.Get([]byte(key))
if err := json.Unmarshal(val, conf); err != nil {
logrus.Errorf("get gen conf err:%v", err)
return err
@ -81,8 +88,8 @@ var (
)
func GetBoltDb() *bolt.DB {
once.Do(func() {
boltDb, err = bolt.Open(common.BOLTDB_NAME, 0600, &bolt.Options{Timeout: 1 * time.Second})
// once.Do(func() {
boltDb, err = bolt.Open(common.BOLTDB_NAME, 0600, &bolt.Options{Timeout: 5 * time.Second})
if err != nil {
log.Fatal(err)
}
@ -99,6 +106,6 @@ func GetBoltDb() *bolt.DB {
}
return nil
})
})
// })
return boltDb
}

View File

@ -30,7 +30,7 @@ func (this *appGen) LazyInit(obs observer.Observer) error {
this.tabItem = container.NewTabItemWithIcon(common.TOOLBAR_GEN, theme.ContentCopyIcon(), nil)
// load
gt := service.GetDbService().Get()
gt := service.GetDbService().Get(common.BUCKET_CONF)
logrus.Debugf("%v", gt)
content := container.NewMax()
@ -38,20 +38,16 @@ func (this *appGen) LazyInit(obs observer.Observer) error {
serverAddr := widget.NewEntry()
serverAddr.PlaceHolder = "服务器地址"
serverAddr.Text = "10.0.1.11"
projectDir := widget.NewEntry()
projectDir.PlaceHolder = "项目目录"
projectDir.Text = "E:\\projects\\workspace\\go_dreamfactory"
workDir := widget.NewEntry()
workDir.PlaceHolder = "LuBan目录"
workDir.Text = "E:\\svn\\dreamworks\\client\\dreamworks\\ExcelFile"
// client
client := widget.NewEntry()
client.PlaceHolder = "配置Luban Client.exe路径"
client.Text = "\\Luban.Client\\Luban.Client.exe"
//define
define := widget.NewEntry()
@ -75,6 +71,14 @@ func (this *appGen) LazyInit(obs observer.Observer) error {
})
genType.PlaceHolder = "生成类型"
if gt != nil {
serverAddr.Text = gt.ServerAddr //10.0.1.11
projectDir.Text = gt.ProjectDir //"E:\\projects\\workspace\\go_dreamfactory"
workDir.Text = gt.WorkDir // "E:\\svn\\dreamworks\\client\\dreamworks\\ExcelFile"
client.Text = gt.Client //"\\Luban.Client\\Luban.Client.exe"
genType.Selected = gt.GenType
}
form := widget.NewForm(
widget.NewFormItem("服务地址", serverAddr),
widget.NewFormItem("项目目录", projectDir),

View File

@ -54,6 +54,8 @@ type (
GetSpecifiedHero(session IUserSession, heroConfId string, star, lv, amount int32) (code pb.ErrorCode)
// 英雄加经验
AddHeroExp(session IUserSession, heroObjID string, exp int32) (code pb.ErrorCode)
// 英雄练功
KungFuHero(session IUserSession, heroObjID string, bKongfu bool) (code pb.ErrorCode)
}
//玩家

View File

@ -61,9 +61,11 @@ func (this *MCompConfigure) GetGlobalConf() *cfg.GameGlobalData {
)
if v, err := this.GetConfigure(game_global); err != nil {
log.Errorf("get global conf err:%v", err)
return nil
} else {
if configure, ok = v.(*cfg.GameGlobal); !ok {
log.Errorf("%T no is *cfg.Game_global", v)
return nil
}
}
return configure.GetDataList()[0] // 返回对象信息

View File

@ -21,6 +21,12 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackR
return
}
globalCnf := this.moduleFriend.configure.GetGlobalConf()
if globalCnf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
var (
err error
self *pb.DBFriend
@ -70,7 +76,7 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackR
}
// 判断是否黑名单人数已满
if len(self.BlackIds) >= int(this.moduleFriend.configure.GetGlobalConf().FriendBlack) {
if len(self.BlackIds) >= int(globalCnf.FriendBlack) {
code = pb.ErrorCode_FriendBlackMax
return
}
@ -78,9 +84,13 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackR
//将目标加入黑名单
self.BlackIds = append(self.BlackIds, req.FriendId)
//更新黑名单
// 将目标从好友列表中移除
friendIds := utils.DeleteString(self.FriendIds, req.FriendId)
//更新
err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
"blackIds": self.BlackIds,
"friendIds": friendIds,
})
if err != nil {
code = pb.ErrorCode_DBError

View File

@ -22,6 +22,12 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
return
}
globalCnf := this.moduleFriend.configure.GetGlobalConf()
if globalCnf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
var (
err error
self *pb.DBFriend
@ -63,13 +69,13 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
}
//判断是否超过最大好友数量
if len(self.FriendIds) >= int(this.moduleFriend.configure.GetGlobalConf().FriendMaxnum) {
if len(self.FriendIds) >= int(globalCnf.FriendMaxnum) {
code = pb.ErrorCode_FriendSelfMax
return
}
//判断对方是否也超过最大好友数量
if len(target.FriendIds) >= int(this.moduleFriend.configure.GetGlobalConf().FriendMaxnum) {
if len(target.FriendIds) >= int(globalCnf.FriendMaxnum) {
code = pb.ErrorCode_FriendTargetMax
return
}

View File

@ -46,6 +46,7 @@ func (this *apiComp) Blacklist(session comm.IUserSession, req *pb.FriendBlackLis
list = append(list, &pb.FriendBase{
UserId: userId,
NickName: user.Name,
Level: user.Lv,
})
}

View File

@ -62,18 +62,17 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (cod
base.OfflineTime = user.Offlinetime //离线时间
}
// 判断是否在自己的申请列表中
if _, ok := utils.Findx(self.ApplyIds, userId); ok {
base.IsApplied = true
}
// 判断是否已点赞
if _, ok := utils.Findx(self.ZanIds, userId); ok {
target := this.moduleFriend.modelFriend.GetFriend(userId)
if target == nil {
continue
}
if _, ok := utils.Findx(target.ZanIds, self.Uid); ok {
base.IsZaned = true
}
//判断是否已接收获赞
if _, ok := utils.Findx(self.GetZandIds, userId); ok {
if _, ok := utils.Findx(self.ZanIds, userId); ok {
base.IsGetZaned = true
}

View File

@ -1,6 +1,7 @@
package friend
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/utils"
@ -23,6 +24,14 @@ func (this *apiComp) Randlist(session comm.IUserSession, req *pb.FriendRandlistR
return
}
// 只随机选择5个在线玩家
// var randOnlineUsers []string
if len(cu) > 5 {
fmt.Println(utils.Numbers(0, len(cu), 5))
}
// 当前玩家好友数据
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
if self == nil {
code = pb.ErrorCode_FriendSelfNoData
@ -30,25 +39,42 @@ func (this *apiComp) Randlist(session comm.IUserSession, req *pb.FriendRandlistR
}
var userList []*pb.FriendBase
for _, v := range cu {
// 将自己从在线玩家中过滤掉
if v.Uid == session.GetUserId() {
continue
}
// 将自己的好友从在线玩家中过滤掉
if _, ok := utils.Findx(self.FriendIds, v.Uid); ok {
continue
}
if _, ok := utils.Findx(self.ApplyIds, v.Uid); ok {
// 判断当前在线好友是否在自己的申请列表中,如果存在也过滤掉
target := this.moduleFriend.modelFriend.GetFriend(v.Uid)
if target == nil {
continue
}
// 获取在线好友的信息
user := this.moduleFriend.ModuleUser.GetUser(v.Uid)
if user == nil {
continue
}
userList = append(userList, &pb.FriendBase{
base := &pb.FriendBase{
UserId: user.Uid,
NickName: user.Name,
Level: user.Lv,
})
OfflineTime: user.Offlinetime,
}
// 申请过的在线好友,设置申请状态
if _, ok := utils.Findx(target.ApplyIds, self.Uid); ok {
base.IsApplied = true
}
userList = append(userList, base)
}
rsp := &pb.FriendRandlistResp{

View File

@ -27,6 +27,12 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
selfId string
)
globalCnf := this.moduleFriend.configure.GetGlobalConf()
if globalCnf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
selfId = session.GetUserId()
// 不能给自己点赞
@ -39,7 +45,6 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
var (
pointTotal int32 //友情值累加
optIds []string //本次操作的有效id
)
// 是否已给好友点赞
for _, v := range req.FriendIds {
@ -48,19 +53,20 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
code = pb.ErrorCode_FriendSelfNoData
return
}
if _, ok := utils.Find(target.ZanIds, selfId); !ok {
optIds = append(optIds, v)
pointTotal += 1
}
}
if _, ok := utils.Find(target.ZanIds, selfId); !ok {
pointTotal += 1
target.ZanIds = append(target.ZanIds, selfId)
//设置被点赞玩家
if err = this.moduleFriend.modelFriend.Change(target.GetUid(), map[string]interface{}{
"zanIds": optIds,
"zanIds": target.ZanIds,
}); err != nil {
code = pb.ErrorCode_DBError
return
}
}
}
//设置友情值
ue, err := this.moduleFriend.ModuleUser.GetUserExpand(session.GetUserId())
@ -70,7 +76,7 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
}
// 今日送出的友情点是否达到上限
if ue.FriendPointOD >= this.moduleFriend.configure.GetGlobalConf().FriendMaxsendnum {
if ue.FriendPointOD >= globalCnf.FriendMaxsendnum {
code = pb.ErrorCode_FriendPointLimit
return
}

View File

@ -22,6 +22,12 @@ func (this *apiComp) Zanreceive(session comm.IUserSession, req *pb.FriendZanrece
return
}
globalCnf := this.moduleFriend.configure.GetGlobalConf()
if globalCnf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
var (
self *pb.DBFriend
err error
@ -35,26 +41,24 @@ func (this *apiComp) Zanreceive(session comm.IUserSession, req *pb.FriendZanrece
var (
pointTotal int32 // 累计友情值
optIds []string //本次有效操作Ids
)
// 是否已领取点赞
for _, v := range req.FriendIds {
if _, ok := utils.Find(self.GetZandIds, v); !ok {
optIds = append(optIds, v)
self.GetZandIds = append(self.GetZandIds, v)
pointTotal += 1
}
}
for _, v := range optIds {
// 修改获赞Id
if err = this.moduleFriend.modelFriend.Change(v, map[string]interface{}{
"getZandIds": v,
if err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
"getZandIds": self.GetZandIds,
}); err != nil {
code = pb.ErrorCode_DBError
return
}
pointTotal += 1
}
//设置自己的友情值
ue, err := this.moduleFriend.ModuleUser.GetUserExpand(session.GetUserId())
@ -64,7 +68,7 @@ func (this *apiComp) Zanreceive(session comm.IUserSession, req *pb.FriendZanrece
}
// 今日获赠的友情点是否达到上限
if ue.FriendPointID >= int32(this.moduleFriend.configure.GetGlobalConf().FriendMaxgetnum) {
if ue.FriendPointID >= int32(globalCnf.FriendMaxgetnum) {
code = pb.ErrorCode_FriendPointLimit
return
}

View File

@ -246,3 +246,59 @@ func (this *Hero) AddHeroExp(session comm.IUserSession, heroObjID string, exp in
session.SendMsg(string(this.GetType()), "change", &pb.HeroChangePush{List: _changeHero})
return
}
// 英雄练功
func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongfu bool) (code pb.ErrorCode) {
var (
_hero *pb.DBHero
newhero *pb.DBHero
_changeHero []*pb.DBHero // 变化的英雄
)
_hero, code = this.GetHeroByObjID(session.GetUserId(), heroObjID)
if code != pb.ErrorCode_Success {
return
}
if bKongfu && _hero.Status == pb.HeroType_HeroTypeKongFu {
code = pb.ErrorCode_HeroAlreadyKongFuStatus // 已经是练功状态
return
}
if !bKongfu {
_heroMap := map[string]interface{}{
"status": pb.HeroType_HeroTypeNil,
}
err1 := this.modelHero.ChangeList(session.GetUserId(), heroObjID, _heroMap) // 修改英雄信息
if err1 != nil {
this.Errorf("update hero skill failed:%v", err1)
code = pb.ErrorCode_DBError
return
}
_hero.Status = pb.HeroType_HeroTypeNil
_changeHero = append(_changeHero, _hero)
session.SendMsg(string(this.GetType()), "change", &pb.HeroChangePush{List: _changeHero})
return
}
if _hero.SameCount > 1 {
_hero.SameCount -= 1
newHero := this.modelHero.CloneNewHero(_hero)
_changeHero = append(_changeHero, newHero)
}
_heroMap := map[string]interface{}{
"status": pb.HeroType_HeroTypeKongFu,
"isOverlying": false,
"sameCount": 1,
}
_hero.SameCount = 1
err1 := this.modelHero.ChangeList(session.GetUserId(), heroObjID, _heroMap) // 修改英雄信息
if err1 != nil {
this.Errorf("update hero skill failed:%v", err1)
code = pb.ErrorCode_DBError
return
}
_changeHero = append(_changeHero, _hero) // 升级后的英雄 hero id 不变
if newhero != nil {
_changeHero = append(_changeHero, newhero) // 原来的英雄 只是数量变化了
}
_changeHero = append(_changeHero, _hero)
session.SendMsg(string(this.GetType()), "change", &pb.HeroChangePush{List: _changeHero})
return
}

View File

@ -29,7 +29,6 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
code = pb.ErrorCode_PagodaNotFound
return
}
req.PagodaType = 101
cfg := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID)
if cfg == nil {
code = pb.ErrorCode_PagodaNotFound
@ -54,12 +53,13 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
rst.Uid = session.GetUserId()
rst.Id = primitive.NewObjectID().Hex()
rst.Type = req.PagodaType
rst.Nickname = "123"
rst.Nickname = this.module.ModuleUser.GetUser(session.GetUserId()).Name
rst.Lv = this.module.ModuleUser.GetUser(session.GetUserId()).Lv
rst.PagodaId = pagoda.PagodaId
this.module.modulerank.AddRank(session.GetUserId(), rst)
} else {
mapData := make(map[string]interface{}, 0)
mapData["pagodaId"] = pagoda.PagodaId
mapData["pagodaId"] = cfg.LayerNum
mapData["type"] = pagoda.Type
this.module.modulerank.ChangeUserRank(session.GetUserId(), mapData)

View File

@ -31,7 +31,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq
//_mData := make(map[string]interface{}, 0)
result.Uid = session.GetUserId()
result.PagodaId = 1 // 初始数据1层
//_mData[result.Id] = result
result.Type = 101
this.module.modelPagoda.addNewPagoda(session.GetUserId(), result)
session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: result})
return

View File

@ -8,14 +8,14 @@ import (
)
//参数校验
func (this *apiComp) RankLisCheck(session comm.IUserSession, req *pb.PagodaRankListReq) (code pb.ErrorCode) {
func (this *apiComp) RankListCheck(session comm.IUserSession, req *pb.PagodaRankListReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) RankLis(session comm.IUserSession, req *pb.PagodaRankListReq) (code pb.ErrorCode, data proto.Message) {
func (this *apiComp) RankList(session comm.IUserSession, req *pb.PagodaRankListReq) (code pb.ErrorCode, data proto.Message) {
code = this.RankLisCheck(session, req)
code = this.RankListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}

View File

@ -62,7 +62,7 @@ func (this *ModelRank) ChangeUserRank(uid string, value map[string]interface{})
// 临时测试
func (this *ModelRank) GetRankData(floorId int32, pagodaType int32) (data []*pb.DBPagodaRank, err error) {
if floorId == 0 {
if _data, err := this.DB.Find(comm.TablePagodaRank, bson.M{"type": pagodaType}, options.Find().SetSort(bson.M{"pagodaId": 1})); err == nil {
if _data, err := this.DB.Find(comm.TablePagodaRank, bson.M{"type": pagodaType}, options.Find().SetSort(bson.M{"pagodaId": -1})); err == nil {
for _data.Next(context.TODO()) {
temp := &pb.DBPagodaRank{}
if err = _data.Decode(temp); err == nil {
@ -71,7 +71,7 @@ func (this *ModelRank) GetRankData(floorId int32, pagodaType int32) (data []*pb.
}
}
} else {
if _data, err := this.DB.Find(comm.TablePagodaRank, bson.M{"pagodaId": bson.M{"$gte": floorId}, "type": pagodaType}, options.Find().SetSort(bson.M{"pagodaId": 1})); err == nil {
if _data, err := this.DB.Find(comm.TablePagodaRank, bson.M{"pagodaId": bson.M{"$gte": floorId}, "type": pagodaType}, options.Find().SetSort(bson.M{"pagodaId": -1})); err == nil {
for _data.Next(context.TODO()) {
temp := &pb.DBPagodaRank{}
if err = _data.Decode(temp); err == nil {

View File

@ -108,6 +108,7 @@ const (
ErrorCode_HeroMaxStarLv ErrorCode = 1321 // 达到最大升星等级
ErrorCode_DrawCardTypeNotFound ErrorCode = 1322 // 抽卡类型不匹配
ErrorCode_HeroMaxSkillLv ErrorCode = 1323 // 达到最大技能等级
ErrorCode_HeroAlreadyKongFuStatus ErrorCode = 1324 // 已经是练功状态
// equipment
ErrorCode_EquipmentOnFoundEquipment ErrorCode = 1400 // 未找到武器
ErrorCode_EquipmentLvlimitReached ErrorCode = 1401 // 武器等级已达上限
@ -238,6 +239,7 @@ var (
1321: "HeroMaxStarLv",
1322: "DrawCardTypeNotFound",
1323: "HeroMaxSkillLv",
1324: "HeroAlreadyKongFuStatus",
1400: "EquipmentOnFoundEquipment",
1401: "EquipmentLvlimitReached",
1402: "EquipmentIsWorn",
@ -356,6 +358,7 @@ var (
"HeroMaxStarLv": 1321,
"DrawCardTypeNotFound": 1322,
"HeroMaxSkillLv": 1323,
"HeroAlreadyKongFuStatus": 1324,
"EquipmentOnFoundEquipment": 1400,
"EquipmentLvlimitReached": 1401,
"EquipmentIsWorn": 1402,
@ -425,7 +428,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
var file_errorcode_proto_rawDesc = []byte{
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2a, 0xb6, 0x13, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x6f, 0x2a, 0xd4, 0x13, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
@ -530,58 +533,60 @@ var file_errorcode_proto_rawDesc = []byte{
0x4c, 0x76, 0x10, 0xa9, 0x0a, 0x12, 0x19, 0x0a, 0x14, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72,
0x64, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xaa, 0x0a,
0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x53, 0x6b, 0x69, 0x6c, 0x6c,
0x4c, 0x76, 0x10, 0xab, 0x0a, 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65,
0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65,
0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65,
0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64,
0x10, 0xf9, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74,
0x49, 0x73, 0x57, 0x6f, 0x72, 0x6e, 0x10, 0xfa, 0x0a, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69,
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x70,
0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69,
0x6e, 0x65, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xdd, 0x0b, 0x12, 0x15, 0x0a,
0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e,
0x64, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65,
0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xdf, 0x0b, 0x12, 0x19,
0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74,
0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe0, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69,
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x77,
0x61, 0x72, 0x64, 0x10, 0xe1, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e,
0x69, 0x74, 0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73,
0x65, 0x74, 0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e,
0x64, 0x6c, 0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65,
0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73,
0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16,
0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f,
0x75, 0x6e, 0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63,
0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12,
0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65,
0x64, 0x10, 0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69,
0x73, 0x68, 0x65, 0x64, 0x10, 0xc8, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x54,
0x61, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xc9, 0x0c, 0x12, 0x10, 0x0a, 0x0b, 0x54, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xca, 0x0c, 0x12, 0x11, 0x0a, 0x0c,
0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xcb, 0x0c, 0x12,
0x17, 0x0a, 0x12, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x73, 0x53, 0x6f,
0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0xa4, 0x0d, 0x12, 0x1c, 0x0a, 0x17, 0x53, 0x68, 0x6f, 0x70,
0x4e, 0x6f, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68,
0x4e, 0x75, 0x6d, 0x10, 0xa5, 0x0d, 0x12, 0x0c, 0x0a, 0x07, 0x4d, 0x61, 0x69, 0x6c, 0x45, 0x72,
0x72, 0x10, 0x88, 0x0e, 0x12, 0x13, 0x0a, 0x0e, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x4e, 0x6f,
0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xec, 0x0e, 0x12, 0x12, 0x0a, 0x0d, 0x50, 0x61, 0x67,
0x6f, 0x64, 0x61, 0x4c, 0x65, 0x76, 0x6c, 0x45, 0x72, 0x72, 0x10, 0xed, 0x0e, 0x12, 0x17, 0x0a,
0x12, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64,
0x45, 0x72, 0x72, 0x10, 0xee, 0x0e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61,
0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x10, 0xef, 0x0e, 0x12,
0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x4e, 0x6f,
0x74, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x10, 0xd0, 0x0f, 0x12, 0x15, 0x0a, 0x10,
0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x55, 0x73, 0x65,
0x10, 0xd1, 0x0f, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61,
0x6c, 0x6c, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x10, 0xd2, 0x0f, 0x12, 0x19, 0x0a,
0x14, 0x47, 0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x4d, 0x6f, 0x72, 0x65, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x54, 0x69, 0x6d, 0x65, 0x10, 0xb5, 0x10, 0x12, 0x16, 0x0a, 0x11, 0x47, 0x6f, 0x75, 0x72,
0x6d, 0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0xb6, 0x10,
0x12, 0x12, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65,
0x64, 0x10, 0x99, 0x11, 0x12, 0x14, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x55, 0x6e, 0x46,
0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0x9a, 0x11, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x4c, 0x76, 0x10, 0xab, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x6c, 0x72,
0x65, 0x61, 0x64, 0x79, 0x4b, 0x6f, 0x6e, 0x67, 0x46, 0x75, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x10, 0xac, 0x0a, 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74,
0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74,
0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74,
0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9,
0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x73,
0x57, 0x6f, 0x72, 0x6e, 0x10, 0xfa, 0x0a, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c,
0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65,
0x72, 0x10, 0xdc, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65,
0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xdd, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d,
0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10,
0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72,
0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xdf, 0x0b, 0x12, 0x19, 0x0a, 0x14,
0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x52, 0x65,
0x77, 0x61, 0x72, 0x64, 0x10, 0xe0, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c,
0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72,
0x64, 0x10, 0xe1, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74,
0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74,
0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c,
0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65,
0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41,
0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11,
0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e,
0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69,
0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a,
0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10,
0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68,
0x65, 0x64, 0x10, 0xc8, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xc9, 0x0c, 0x12, 0x10, 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b,
0x49, 0x64, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xca, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61,
0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xcb, 0x0c, 0x12, 0x17, 0x0a,
0x12, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x73, 0x53, 0x6f, 0x6c, 0x64,
0x4f, 0x75, 0x74, 0x10, 0xa4, 0x0d, 0x12, 0x1c, 0x0a, 0x17, 0x53, 0x68, 0x6f, 0x70, 0x4e, 0x6f,
0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75,
0x6d, 0x10, 0xa5, 0x0d, 0x12, 0x0c, 0x0a, 0x07, 0x4d, 0x61, 0x69, 0x6c, 0x45, 0x72, 0x72, 0x10,
0x88, 0x0e, 0x12, 0x13, 0x0a, 0x0e, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x4e, 0x6f, 0x74, 0x46,
0x6f, 0x75, 0x6e, 0x64, 0x10, 0xec, 0x0e, 0x12, 0x12, 0x0a, 0x0d, 0x50, 0x61, 0x67, 0x6f, 0x64,
0x61, 0x4c, 0x65, 0x76, 0x6c, 0x45, 0x72, 0x72, 0x10, 0xed, 0x0e, 0x12, 0x17, 0x0a, 0x12, 0x50,
0x61, 0x67, 0x6f, 0x64, 0x61, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x72,
0x72, 0x10, 0xee, 0x0e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x6f,
0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x10, 0xef, 0x0e, 0x12, 0x1b, 0x0a,
0x16, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x4e, 0x6f, 0x74, 0x55,
0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x10, 0xd0, 0x0f, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61,
0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x55, 0x73, 0x65, 0x10, 0xd1,
0x0f, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c,
0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x10, 0xd2, 0x0f, 0x12, 0x19, 0x0a, 0x14, 0x47,
0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x4d, 0x6f, 0x72, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54,
0x69, 0x6d, 0x65, 0x10, 0xb5, 0x10, 0x12, 0x16, 0x0a, 0x11, 0x47, 0x6f, 0x75, 0x72, 0x6d, 0x65,
0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0xb6, 0x10, 0x12, 0x12,
0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10,
0x99, 0x11, 0x12, 0x14, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x55, 0x6e, 0x46, 0x69, 0x6e,
0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0x9a, 0x11, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -20,6 +20,52 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type HeroType int32
const (
HeroType_HeroTypeNil HeroType = 0
HeroType_HeroTypeKongFu HeroType = 1
)
// Enum value maps for HeroType.
var (
HeroType_name = map[int32]string{
0: "HeroTypeNil",
1: "HeroTypeKongFu",
}
HeroType_value = map[string]int32{
"HeroTypeNil": 0,
"HeroTypeKongFu": 1,
}
)
func (x HeroType) Enum() *HeroType {
p := new(HeroType)
*p = x
return p
}
func (x HeroType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (HeroType) Descriptor() protoreflect.EnumDescriptor {
return file_hero_hero_db_proto_enumTypes[0].Descriptor()
}
func (HeroType) Type() protoreflect.EnumType {
return &file_hero_hero_db_proto_enumTypes[0]
}
func (x HeroType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use HeroType.Descriptor instead.
func (HeroType) EnumDescriptor() ([]byte, []int) {
return file_hero_hero_db_proto_rawDescGZIP(), []int{0}
}
type SkillData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -105,6 +151,7 @@ type DBHero struct {
IsOverlying bool `protobuf:"varint,23,opt,name=isOverlying,proto3" json:"isOverlying"` // go_tags(`bson:"isOverlying"`) 是否允许叠加 默认true
EnergyProperty map[string]int32 `protobuf:"bytes,24,rep,name=energyProperty,proto3" json:"energyProperty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"energyProperty"` //
JuexProperty map[string]int32 `protobuf:"bytes,25,rep,name=juexProperty,proto3" json:"juexProperty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"juexProperty"` ////hp
Status HeroType `protobuf:"varint,26,opt,name=status,proto3,enum=HeroType" json:"status"` // 状态 (1 练功)
}
func (x *DBHero) Reset() {
@ -314,6 +361,13 @@ func (x *DBHero) GetJuexProperty() map[string]int32 {
return nil
}
func (x *DBHero) GetStatus() HeroType {
if x != nil {
return x.Status
}
return HeroType_HeroTypeNil
}
type Floor struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -465,7 +519,7 @@ var file_hero_hero_db_proto_rawDesc = []byte{
0x61, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x07, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x73,
0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x6b,
0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x22, 0x90, 0x09, 0x0a, 0x06, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f,
0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x22, 0xb3, 0x09, 0x0a, 0x06, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64,
0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75,
0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01,
@ -518,40 +572,45 @@ var file_hero_hero_db_proto_rawDesc = []byte{
0x0c, 0x6a, 0x75, 0x65, 0x78, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x19, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x2e, 0x4a, 0x75, 0x65,
0x78, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c,
0x6a, 0x75, 0x65, 0x78, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x1a, 0x3b, 0x0a, 0x0d,
0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x64, 0x64,
0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x45, 0x6e, 0x65,
0x72, 0x67, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x50, 0x72,
0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
0x6a, 0x75, 0x65, 0x78, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x21, 0x0a, 0x06,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x48,
0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a,
0x3b, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10,
0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b,
0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x4a, 0x75, 0x65, 0x78, 0x50,
0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x27, 0x0a, 0x05, 0x46, 0x6c, 0x6f, 0x6f,
0x72, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x34, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68,
0x34, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x35, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68,
0x35, 0x22, 0x90, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x34, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x34, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74,
0x61, 0x72, 0x35, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x35,
0x12, 0x14, 0x0a, 0x05, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
0x05, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x72, 0x61, 0x77, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x72, 0x61, 0x77, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x45, 0x6e, 0x65, 0x72, 0x67,
0x79, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x4a, 0x75,
0x65, 0x78, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x27, 0x0a, 0x05, 0x46,
0x6c, 0x6f, 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x34, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x02, 0x68, 0x34, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x35, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x02, 0x68, 0x35, 0x22, 0x90, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x34,
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x34, 0x12, 0x14, 0x0a,
0x05, 0x73, 0x74, 0x61, 0x72, 0x35, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74,
0x61, 0x72, 0x35, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01,
0x28, 0x03, 0x52, 0x05, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x72, 0x61,
0x77, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x72,
0x61, 0x77, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x2f, 0x0a, 0x08, 0x48, 0x65, 0x72, 0x6f, 0x54,
0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x4e,
0x69, 0x6c, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65,
0x4b, 0x6f, 0x6e, 0x67, 0x46, 0x75, 0x10, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -566,30 +625,33 @@ func file_hero_hero_db_proto_rawDescGZIP() []byte {
return file_hero_hero_db_proto_rawDescData
}
var file_hero_hero_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_hero_hero_db_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_hero_hero_db_proto_goTypes = []interface{}{
(*SkillData)(nil), // 0: SkillData
(*DBHero)(nil), // 1: DBHero
(*Floor)(nil), // 2: Floor
(*DBHeroRecord)(nil), // 3: DBHeroRecord
nil, // 4: DBHero.PropertyEntry
nil, // 5: DBHero.AddPropertyEntry
nil, // 6: DBHero.EnergyEntry
nil, // 7: DBHero.EnergyPropertyEntry
nil, // 8: DBHero.JuexPropertyEntry
(HeroType)(0), // 0: HeroType
(*SkillData)(nil), // 1: SkillData
(*DBHero)(nil), // 2: DBHero
(*Floor)(nil), // 3: Floor
(*DBHeroRecord)(nil), // 4: DBHeroRecord
nil, // 5: DBHero.PropertyEntry
nil, // 6: DBHero.AddPropertyEntry
nil, // 7: DBHero.EnergyEntry
nil, // 8: DBHero.EnergyPropertyEntry
nil, // 9: DBHero.JuexPropertyEntry
}
var file_hero_hero_db_proto_depIdxs = []int32{
0, // 0: DBHero.normalSkill:type_name -> SkillData
4, // 1: DBHero.property:type_name -> DBHero.PropertyEntry
5, // 2: DBHero.addProperty:type_name -> DBHero.AddPropertyEntry
6, // 3: DBHero.energy:type_name -> DBHero.EnergyEntry
7, // 4: DBHero.energyProperty:type_name -> DBHero.EnergyPropertyEntry
8, // 5: DBHero.juexProperty:type_name -> DBHero.JuexPropertyEntry
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
1, // 0: DBHero.normalSkill:type_name -> SkillData
5, // 1: DBHero.property:type_name -> DBHero.PropertyEntry
6, // 2: DBHero.addProperty:type_name -> DBHero.AddPropertyEntry
7, // 3: DBHero.energy:type_name -> DBHero.EnergyEntry
8, // 4: DBHero.energyProperty:type_name -> DBHero.EnergyPropertyEntry
9, // 5: DBHero.juexProperty:type_name -> DBHero.JuexPropertyEntry
0, // 6: DBHero.status:type_name -> HeroType
7, // [7:7] is the sub-list for method output_type
7, // [7:7] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_hero_hero_db_proto_init() }
@ -652,13 +714,14 @@ func file_hero_hero_db_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_hero_hero_db_proto_rawDesc,
NumEnums: 0,
NumEnums: 1,
NumMessages: 9,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_hero_hero_db_proto_goTypes,
DependencyIndexes: file_hero_hero_db_proto_depIdxs,
EnumInfos: file_hero_hero_db_proto_enumTypes,
MessageInfos: file_hero_hero_db_proto_msgTypes,
}.Build()
File_hero_hero_db_proto = out.File

View File

@ -110,6 +110,8 @@ type DBPagodaRank struct {
Type int32 `protobuf:"varint,4,opt,name=type,proto3" json:"type"` // 塔类型
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"` //塔层
}
func (x *DBPagodaRank) Reset() {
@ -186,6 +188,20 @@ func (x *DBPagodaRank) GetIcon() string {
return ""
}
func (x *DBPagodaRank) GetLv() int32 {
if x != nil {
return x.Lv
}
return 0
}
func (x *DBPagodaRank) GetCostTime() int32 {
if x != nil {
return x.CostTime
}
return 0
}
var File_pagoda_pagoda_db_proto protoreflect.FileDescriptor
var file_pagoda_pagoda_db_proto_rawDesc = []byte{
@ -203,7 +219,7 @@ var file_pagoda_pagoda_db_proto_rawDesc = []byte{
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, 0x22, 0x90, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61,
0x01, 0x22, 0xbc, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 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, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x49, 0x64,
@ -212,8 +228,10 @@ var file_pagoda_pagoda_db_proto_rawDesc = []byte{
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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
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 (

View File

@ -72,6 +72,7 @@ type GameGlobalData struct {
SmithyMaxplayer int32
SmithyMaxtime int32
ChatExpressionSmall []string
VikingNum int32
KungfuTime int32
}
@ -221,6 +222,7 @@ func (_v *GameGlobalData)Deserialize(_buf map[string]interface{}) (err error) {
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["viking_num"].(float64); !_ok_ { err = errors.New("viking_num error"); return }; _v.VikingNum = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["kungfu_time"].(float64); !_ok_ { err = errors.New("kungfu_time error"); return }; _v.KungfuTime = int32(_tempNum_) }
return
}

View File

@ -5,6 +5,8 @@ import (
"math/rand"
"strings"
"time"
"github.com/Pallinder/go-randomdata"
)
func GenValidateCode(width int) string {
@ -18,3 +20,38 @@ func GenValidateCode(width int) string {
}
return sb.String()
}
// 随机一组随机数
// number >= start and < end num 随机数个数
func Numbers(start, end, num int) []int {
if end-start < 0 || num > (end-start) {
return nil
}
if end-start == 1 {
n := randomdata.Number(start, end)
return []int{n}
}
var i int
arr := make([]int, num)
boo := make(map[int]int)
for {
if i == num {
break
}
var n int
n = randomdata.Number(start, end)
if _, ok := boo[n]; ok {
// 重新生成
n = randomdata.Number(start, end)
continue
}
boo[n] = i
arr[i] = n
i++
}
return arr
}

View File

@ -20,3 +20,7 @@ func TestSubTime(t *testing.T) {
func TestRandom(t *testing.T) {
fmt.Println(utils.GenValidateCode(6))
}
func TestNumber(t *testing.T) {
fmt.Println(utils.Numbers(5, 10, 5))
}