Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
62904759e2
@ -2,6 +2,7 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"model": "34006",
|
"model": "34006",
|
||||||
|
"weight": 1000,
|
||||||
"startstory": 3007,
|
"startstory": 3007,
|
||||||
"rejectstory": 3001,
|
"rejectstory": 3001,
|
||||||
"endstory": 3002,
|
"endstory": 3002,
|
||||||
@ -13,9 +14,6 @@
|
|||||||
"key": "story_80",
|
"key": "story_80",
|
||||||
"text": "踢馆1号的文本"
|
"text": "踢馆1号的文本"
|
||||||
},
|
},
|
||||||
"FormatList": [
|
|
||||||
700011
|
|
||||||
],
|
|
||||||
"BattleReadyID": 100,
|
"BattleReadyID": 100,
|
||||||
"EventList": [],
|
"EventList": [],
|
||||||
"award": [
|
"award": [
|
||||||
@ -30,10 +28,80 @@
|
|||||||
"n": 1
|
"n": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"story_award": [
|
||||||
|
{
|
||||||
|
"a": "attr",
|
||||||
|
"t": "gold",
|
||||||
|
"n": 2640
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"a": "item",
|
||||||
|
"t": "30001",
|
||||||
|
"n": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
"onlookers": [
|
"onlookers": [
|
||||||
"45003",
|
"45003",
|
||||||
"25001"
|
"25001"
|
||||||
],
|
],
|
||||||
|
"challenge_onlookers": [
|
||||||
|
"45003",
|
||||||
|
"25001"
|
||||||
|
],
|
||||||
|
"onlookersstory": [
|
||||||
|
30001,
|
||||||
|
30001
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"model": "35002",
|
||||||
|
"weight": 1000,
|
||||||
|
"startstory": 3007,
|
||||||
|
"rejectstory": 3001,
|
||||||
|
"endstory": 3002,
|
||||||
|
"battlename": {
|
||||||
|
"key": "story_81",
|
||||||
|
"text": "踢馆2号"
|
||||||
|
},
|
||||||
|
"battletxt": {
|
||||||
|
"key": "story_81",
|
||||||
|
"text": "踢馆2号的文本"
|
||||||
|
},
|
||||||
|
"BattleReadyID": 100,
|
||||||
|
"EventList": [],
|
||||||
|
"award": [
|
||||||
|
{
|
||||||
|
"a": "attr",
|
||||||
|
"t": "gold",
|
||||||
|
"n": 6480
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"a": "item",
|
||||||
|
"t": "30001",
|
||||||
|
"n": 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"story_award": [
|
||||||
|
{
|
||||||
|
"a": "attr",
|
||||||
|
"t": "gold",
|
||||||
|
"n": 6480
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"a": "item",
|
||||||
|
"t": "30001",
|
||||||
|
"n": 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"onlookers": [
|
||||||
|
"45003",
|
||||||
|
"25001"
|
||||||
|
],
|
||||||
|
"challenge_onlookers": [
|
||||||
|
"45003",
|
||||||
|
"25001"
|
||||||
|
],
|
||||||
"onlookersstory": [
|
"onlookersstory": [
|
||||||
30001,
|
30001,
|
||||||
30001
|
30001
|
||||||
|
@ -385,6 +385,8 @@ type (
|
|||||||
IReddot
|
IReddot
|
||||||
//设置用户积分
|
//设置用户积分
|
||||||
SetUserIntegral(session IUserSession, Integral int32) (err error)
|
SetUserIntegral(session IUserSession, Integral int32) (err error)
|
||||||
|
//获取匹配战斗角色列表
|
||||||
|
GetMatcheBattleRoles(uid string) (captain int32, rules []*pb.BattleRole, err error)
|
||||||
}
|
}
|
||||||
IGourmet interface {
|
IGourmet interface {
|
||||||
///红点
|
///红点
|
||||||
|
@ -117,3 +117,9 @@ func (this *Arena) SetUserIntegral(session comm.IUserSession, Integral int32) (e
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///获取竞技场匹配目标战斗阵型数据
|
||||||
|
func (this *Arena) GetMatcheBattleRoles(uid string) (captain int32, rules []*pb.BattleRole, err error) {
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -11,12 +11,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
game_pandamasmz = "game_pandamasmz.json"
|
game_pandamasmz = "game_pandamasmz.json"
|
||||||
game_pandamasjs = "game_pandamasjs.json"
|
game_pandamasjs = "game_pandamasjs.json"
|
||||||
game_pandamasjx = "game_pandamasjx.json"
|
game_pandamasjx = "game_pandamasjx.json"
|
||||||
game_pandamasyxjx = "game_pandamasyxjx.json"
|
game_pandamasyxjx = "game_pandamasyxjx.json"
|
||||||
game_pandamasmryl = "game_pandamasmryl.json"
|
game_pandamasmryl = "game_pandamasmryl.json"
|
||||||
game_pandamasbuff = "game_pandamasbuff.json"
|
game_pandamasbuff = "game_pandamasbuff.json"
|
||||||
|
game_dispatch_battle = "game_dispatch_battle.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
///背包配置管理组件
|
///背包配置管理组件
|
||||||
@ -36,6 +37,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
this.LoadConfigure(game_pandamasjx, cfg.NewGamePandamasJx)
|
this.LoadConfigure(game_pandamasjx, cfg.NewGamePandamasJx)
|
||||||
this.LoadConfigure(game_pandamasyxjx, cfg.NewGamePandamasYxjx)
|
this.LoadConfigure(game_pandamasyxjx, cfg.NewGamePandamasYxjx)
|
||||||
this.LoadConfigure(game_pandamasmryl, cfg.NewGamePandamasMryl)
|
this.LoadConfigure(game_pandamasmryl, cfg.NewGamePandamasMryl)
|
||||||
|
this.LoadConfigure(game_dispatch_battle, cfg.NewGameDispatch_Battle)
|
||||||
configure.RegisterConfigure(game_pandamasbuff, cfg.NewGamePandamasBuff, func() {
|
configure.RegisterConfigure(game_pandamasbuff, cfg.NewGamePandamasBuff, func() {
|
||||||
this.lock.Lock()
|
this.lock.Lock()
|
||||||
if v, err := this.GetConfigure(game_pandamasbuff); err != nil {
|
if v, err := this.GetConfigure(game_pandamasbuff); err != nil {
|
||||||
@ -178,3 +180,36 @@ func (this *configureComp) getGamePandamasBuff(groupid int32) (configure *cfg.Ga
|
|||||||
configure = group[index]
|
configure = group[index]
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取踢馆npc配置
|
||||||
|
func (this *configureComp) getDispatchBattle() (configure []*cfg.GameDispatch_BattleData, err error) {
|
||||||
|
var (
|
||||||
|
v interface{}
|
||||||
|
)
|
||||||
|
if v, err = this.GetConfigure(game_dispatch_battle); err != nil {
|
||||||
|
this.module.Errorln(err)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
configure = v.(*cfg.GameDispatch_Battle).GetDataList()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取踢馆npc配置
|
||||||
|
func (this *configureComp) getDispatchBattleData(id int32) (configure *cfg.GameDispatch_BattleData, err error) {
|
||||||
|
var (
|
||||||
|
v interface{}
|
||||||
|
ok bool
|
||||||
|
)
|
||||||
|
if v, err = this.GetConfigure(game_dispatch_battle); err != nil {
|
||||||
|
this.module.Errorln(err)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
if configure, ok = v.(*cfg.GameDispatch_Battle).GetDataMap()[id]; !ok {
|
||||||
|
err = fmt.Errorf("not found:%d ", id)
|
||||||
|
this.module.Errorln(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"go_dreamfactory/lego/sys/mgo"
|
"go_dreamfactory/lego/sys/mgo"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
@ -49,6 +50,9 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic
|
|||||||
Pillarf: &pb.DBPracticePillar{Index: 4, Lv: 1},
|
Pillarf: &pb.DBPracticePillar{Index: 4, Lv: 1},
|
||||||
Statuers: make([]*pb.DBPracticeStatuer, 0),
|
Statuers: make([]*pb.DBPracticeStatuer, 0),
|
||||||
}
|
}
|
||||||
|
if err = this.refreshnpc(result); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
if err = this.Add(uid, result); err != nil {
|
if err = this.Add(uid, result); err != nil {
|
||||||
this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
return
|
return
|
||||||
@ -57,3 +61,29 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic
|
|||||||
err = nil
|
err = nil
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//刷新npc
|
||||||
|
func (this *modelPandata) refreshnpc(room *pb.DBPracticeRoom) (err error) {
|
||||||
|
var (
|
||||||
|
npcs []*cfg.GameDispatch_BattleData
|
||||||
|
wigets []int32
|
||||||
|
index int32
|
||||||
|
)
|
||||||
|
|
||||||
|
if npcs, err = this.module.configure.getDispatchBattle(); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wigets = make([]int32, len(npcs))
|
||||||
|
for i, v := range npcs {
|
||||||
|
wigets[i] = v.Weight
|
||||||
|
}
|
||||||
|
|
||||||
|
index = comm.GetRandW(wigets)
|
||||||
|
room.Currnpc = npcs[index].Id
|
||||||
|
room.Npcstate = 0
|
||||||
|
room.Battlenum = 0
|
||||||
|
if room.Captain, room.Formation, err = this.module.arena.GetMatcheBattleRoles(room.Uid); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -32,6 +32,7 @@ type Practice struct {
|
|||||||
pvp comm.IPvp
|
pvp comm.IPvp
|
||||||
mail comm.Imail
|
mail comm.Imail
|
||||||
atlas comm.IPandaAtlas
|
atlas comm.IPandaAtlas
|
||||||
|
arena comm.IArena
|
||||||
api *apiComp
|
api *apiComp
|
||||||
configure *configureComp
|
configure *configureComp
|
||||||
modelPandata *modelPandata
|
modelPandata *modelPandata
|
||||||
@ -64,6 +65,10 @@ func (this *Practice) Start() (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.atlas = module.(comm.IPandaAtlas)
|
this.atlas = module.(comm.IPandaAtlas)
|
||||||
|
if module, err = this.service.GetModule(comm.ModuleArena); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.arena = module.(comm.IArena)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,14 +234,14 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Debug("任务事件触发",
|
// this.Debug("任务事件触发",
|
||||||
log.Field{Key: "uid", Value: uid},
|
// log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "taskType", Value: rtaskType},
|
// log.Field{Key: "taskType", Value: rtaskType},
|
||||||
log.Field{Key: "params", Value: params},
|
// log.Field{Key: "params", Value: params},
|
||||||
)
|
// )
|
||||||
var (
|
var (
|
||||||
err error
|
// err error
|
||||||
condiId int32
|
// condiId int32
|
||||||
condis []*rtaskCondi
|
condis []*rtaskCondi
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -264,11 +264,11 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if condiId, err = v.find(codiConf, params...); condiId == 0 {
|
if condiId, _ := v.find(codiConf, params...); condiId != 0 {
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
this.Warnln(errors.WithMessage(err, uid).Error())
|
// this.Warnln(errors.WithMessage(err, uid).Error())
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
v.condId = codiConf.Id
|
v.condId = codiConf.Id
|
||||||
condis = append(condis, v)
|
condis = append(condis, v)
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
package rtask
|
package rtask
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go_dreamfactory/lego/sys/log"
|
|
||||||
|
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/sys/configure"
|
"go_dreamfactory/sys/configure"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
@ -109,12 +107,12 @@ func (this *ModelRtaskRecord) addUpdate(uid string, cfg *cfg.GameRdtaskCondiData
|
|||||||
}
|
}
|
||||||
err = this.Change(uid, update)
|
err = this.Change(uid, update)
|
||||||
}
|
}
|
||||||
log.Debug("累计次数更新",
|
// log.Debug("累计次数更新",
|
||||||
log.Field{Key: "uid", Value: uid},
|
// log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "condiId", Value: cfg.Id},
|
// log.Field{Key: "condiId", Value: cfg.Id},
|
||||||
log.Field{Key: "params", Value: vals},
|
// log.Field{Key: "params", Value: vals},
|
||||||
log.Field{Key: "updated", Value: record.Vals[cfg.Id]},
|
// log.Field{Key: "updated", Value: record.Vals[cfg.Id]},
|
||||||
)
|
// )
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,6 @@ func (this *ModelRtask) verifyRtype3(uid string, cfg *cfg.GameRdtaskCondiData) (
|
|||||||
|
|
||||||
// 指定英雄等级
|
// 指定英雄等级
|
||||||
func (this *ModelRtask) verifyRtype4(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
func (this *ModelRtask) verifyRtype4(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
||||||
defer printCondiLog(uid, cfg)
|
|
||||||
m, err := this.service.GetModule(comm.ModuleHero)
|
m, err := this.service.GetModule(comm.ModuleHero)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -182,7 +181,6 @@ func (this *ModelRtask) verifyRtype4(uid string, cfg *cfg.GameRdtaskCondiData) (
|
|||||||
|
|
||||||
// 指定英雄的指定装备数量
|
// 指定英雄的指定装备数量
|
||||||
func (this *ModelRtask) verifyRtype5(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
func (this *ModelRtask) verifyRtype5(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
||||||
defer printCondiLog(uid, cfg)
|
|
||||||
m, err := this.service.GetModule(comm.ModuleHero)
|
m, err := this.service.GetModule(comm.ModuleHero)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -220,7 +218,6 @@ func (this *ModelRtask) verifyRtype5(uid string, cfg *cfg.GameRdtaskCondiData) (
|
|||||||
|
|
||||||
// 指定英雄星级
|
// 指定英雄星级
|
||||||
func (this *ModelRtask) verifyRtype6(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
func (this *ModelRtask) verifyRtype6(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
||||||
defer printCondiLog(uid, cfg)
|
|
||||||
m, err := this.service.GetModule(comm.ModuleHero)
|
m, err := this.service.GetModule(comm.ModuleHero)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -247,7 +244,6 @@ func (this *ModelRtask) verifyRtype6(uid string, cfg *cfg.GameRdtaskCondiData) (
|
|||||||
|
|
||||||
// 日常登录一次
|
// 日常登录一次
|
||||||
func (this *ModelRtask) verfiyRtype7(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
func (this *ModelRtask) verfiyRtype7(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
||||||
defer printCondiLog(uid, cfg)
|
|
||||||
userModule, err := this.service.GetModule(comm.ModuleUser)
|
userModule, err := this.service.GetModule(comm.ModuleUser)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -263,7 +259,6 @@ func (this *ModelRtask) verfiyRtype7(uid string, cfg *cfg.GameRdtaskCondiData) (
|
|||||||
|
|
||||||
// 累计登陆xx天
|
// 累计登陆xx天
|
||||||
func (this *ModelRtask) verfiyRtype8(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
func (this *ModelRtask) verfiyRtype8(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
||||||
defer printCondiLog(uid, cfg)
|
|
||||||
userModule, err := this.service.GetModule(comm.ModuleUser)
|
userModule, err := this.service.GetModule(comm.ModuleUser)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -281,7 +276,6 @@ func (this *ModelRtask) verfiyRtype8(uid string, cfg *cfg.GameRdtaskCondiData) (
|
|||||||
|
|
||||||
// 连续登陆xx天
|
// 连续登陆xx天
|
||||||
func (this *ModelRtask) verfiyRtype9(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
func (this *ModelRtask) verfiyRtype9(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
||||||
defer printCondiLog(uid, cfg)
|
|
||||||
userModule, err := this.service.GetModule(comm.ModuleUser)
|
userModule, err := this.service.GetModule(comm.ModuleUser)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -299,7 +293,6 @@ func (this *ModelRtask) verfiyRtype9(uid string, cfg *cfg.GameRdtaskCondiData) (
|
|||||||
|
|
||||||
// 拥有xx个好友
|
// 拥有xx个好友
|
||||||
func (this *ModelRtask) verfiyRtype10(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
func (this *ModelRtask) verfiyRtype10(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
||||||
defer printCondiLog(uid, cfg)
|
|
||||||
m, err := this.service.GetModule(comm.ModuleFriend)
|
m, err := this.service.GetModule(comm.ModuleFriend)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -314,7 +307,6 @@ func (this *ModelRtask) verfiyRtype10(uid string, cfg *cfg.GameRdtaskCondiData)
|
|||||||
|
|
||||||
// 用户等级达到xx级
|
// 用户等级达到xx级
|
||||||
func (this *ModelRtask) verifyRtype20(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
func (this *ModelRtask) verifyRtype20(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
||||||
defer printCondiLog(uid, cfg)
|
|
||||||
userModule, err := this.service.GetModule(comm.ModuleUser)
|
userModule, err := this.service.GetModule(comm.ModuleUser)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -100,17 +100,31 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if req.IsManualRefresh && shopconf.Rtype == 1 { //可以手动刷新
|
if req.IsManualRefresh && shopconf.Rtype == 1 { //可以手动刷新
|
||||||
//剩余刷新次数为零
|
isrefresh := false
|
||||||
if leftrefnum == 0 {
|
refresh := int(this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType2))
|
||||||
code = pb.ErrorCode_ShopNoSurplusRefreshNum
|
if refresh > 0 { //
|
||||||
return
|
if time.Unix(shopData.RefreshtimegoldShop, 0).Day() < configure.Now().Day() {
|
||||||
} else if leftrefnum > 0 {
|
shopData.RefreshtimegoldShop = configure.Now().Unix()
|
||||||
leftrefnum--
|
shopData.RefreshnumgoldShop = 0
|
||||||
|
}
|
||||||
|
if int(shopData.RefreshnumgoldShop) < refresh {
|
||||||
|
isrefresh = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !isrefresh {
|
||||||
|
//剩余刷新次数为零
|
||||||
|
if leftrefnum == 0 {
|
||||||
|
code = pb.ErrorCode_ShopNoSurplusRefreshNum
|
||||||
|
return
|
||||||
|
} else if leftrefnum > 0 {
|
||||||
|
leftrefnum--
|
||||||
|
}
|
||||||
|
|
||||||
|
if code = this.module.ConsumeRes(session, shopconf.Rneed, true); code != pb.ErrorCode_Success {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if code = this.module.ConsumeRes(session, shopconf.Rneed, true); code != pb.ErrorCode_Success {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _items []*cfg.GameShopitemData
|
var _items []*cfg.GameShopitemData
|
||||||
for _, v := range shopconf.Shopitem {
|
for _, v := range shopconf.Shopitem {
|
||||||
if _items, err = this.module.configure.GetShopItemsConfigureByGroups(v, udata); err != nil || len(_items) == 0 {
|
if _items, err = this.module.configure.GetShopItemsConfigureByGroups(v, udata); err != nil || len(_items) == 0 {
|
||||||
@ -134,23 +148,23 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1)
|
this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1)
|
||||||
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{filed: sdata})
|
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{"refreshnumgoldShop": shopData.RefreshnumgoldShop, "refreshtimegoldShop": shopData.RefreshtimegoldShop, filed: sdata})
|
||||||
} else if !req.IsManualRefresh {
|
} else if !req.IsManualRefresh {
|
||||||
refresh := int(this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType2))
|
// refresh := int(this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType2))
|
||||||
isrefresh := false
|
isrefresh := false
|
||||||
if refresh > 0 { //
|
// if refresh > 0 { //
|
||||||
if time.Unix(shopData.RefreshtimegoldShop, 0).Day() < configure.Now().Day() {
|
// if time.Unix(shopData.RefreshtimegoldShop, 0).Day() < configure.Now().Day() {
|
||||||
shopData.RefreshtimegoldShop = configure.Now().Unix()
|
// shopData.RefreshtimegoldShop = configure.Now().Unix()
|
||||||
shopData.RefreshnumgoldShop = 0
|
// shopData.RefreshnumgoldShop = 0
|
||||||
}
|
// }
|
||||||
if int(shopData.RefreshnumgoldShop) < refresh {
|
// if int(shopData.RefreshnumgoldShop) < refresh {
|
||||||
isrefresh = true
|
// isrefresh = true
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
if tdata > ltime { //达到刷新时间 可以刷新商品列表
|
if tdata > ltime { //达到刷新时间 可以刷新商品列表
|
||||||
isrefresh = true
|
isrefresh = true
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
if isrefresh {
|
if isrefresh {
|
||||||
var _items []*cfg.GameShopitemData
|
var _items []*cfg.GameShopitemData
|
||||||
for _, v := range shopconf.Shopitem {
|
for _, v := range shopconf.Shopitem {
|
||||||
@ -174,7 +188,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
goods = transGoods(items, sdata)
|
goods = transGoods(items, sdata)
|
||||||
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{"refreshnumgoldShop": shopData.RefreshnumgoldShop, "refreshtimegoldShop": shopData.RefreshtimegoldShop, filed: sdata})
|
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{filed: sdata})
|
||||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1)
|
this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1)
|
||||||
} else { //返回以前的商品列表
|
} else { //返回以前的商品列表
|
||||||
if items, err = this.module.configure.GetShopItemsConfigureByIds(sdata.Items...); err != nil {
|
if items, err = this.module.configure.GetShopItemsConfigureByIds(sdata.Items...); err != nil {
|
||||||
|
@ -11,8 +11,6 @@ import (
|
|||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/sys/configure"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ comm.ITask = (*ModuleTask)(nil)
|
var _ comm.ITask = (*ModuleTask)(nil)
|
||||||
@ -59,10 +57,6 @@ func (this *ModuleTask) Start() (err error) {
|
|||||||
|
|
||||||
// 初始化日常、周常、成就
|
// 初始化日常、周常、成就
|
||||||
func (this *ModuleTask) InitTaskAll(uid string) {
|
func (this *ModuleTask) InitTaskAll(uid string) {
|
||||||
t := configure.Now()
|
|
||||||
defer func() {
|
|
||||||
log.Debugf("初始化任务 耗时:%v", time.Since(t))
|
|
||||||
}()
|
|
||||||
this.modelTask.initTask(uid, comm.TASK_DAILY)
|
this.modelTask.initTask(uid, comm.TASK_DAILY)
|
||||||
this.modelTask.initTask(uid, comm.TASK_WEEKLY)
|
this.modelTask.initTask(uid, comm.TASK_WEEKLY)
|
||||||
this.modelTask.initTask(uid, comm.TASK_ACHIEVE)
|
this.modelTask.initTask(uid, comm.TASK_ACHIEVE)
|
||||||
|
@ -287,10 +287,11 @@ type DBPracticeRoom struct {
|
|||||||
Pillarf *DBPracticePillar `protobuf:"bytes,11,opt,name=pillarf,proto3" json:"pillarf"` //好友柱子
|
Pillarf *DBPracticePillar `protobuf:"bytes,11,opt,name=pillarf,proto3" json:"pillarf"` //好友柱子
|
||||||
Statuers []*DBPracticeStatuer `protobuf:"bytes,12,rep,name=statuers,proto3" json:"statuers"` //武馆雕像
|
Statuers []*DBPracticeStatuer `protobuf:"bytes,12,rep,name=statuers,proto3" json:"statuers"` //武馆雕像
|
||||||
Currnpc int32 `protobuf:"varint,13,opt,name=currnpc,proto3" json:"currnpc"` //当前npc
|
Currnpc int32 `protobuf:"varint,13,opt,name=currnpc,proto3" json:"currnpc"` //当前npc
|
||||||
Refresh int64 `protobuf:"varint,14,opt,name=refresh,proto3" json:"refresh"` //刷新时间
|
Npcstate int32 `protobuf:"varint,14,opt,name=npcstate,proto3" json:"npcstate"` //npc状态 0 未挑战 1 挑战失败 2挑战成功
|
||||||
Battlenum int32 `protobuf:"varint,15,opt,name=battlenum,proto3" json:"battlenum"` //战斗次数
|
Refresh int64 `protobuf:"varint,15,opt,name=refresh,proto3" json:"refresh"` //刷新时间
|
||||||
Captain int32 `protobuf:"varint,16,opt,name=captain,proto3" json:"captain"` //战斗征信队长位
|
Battlenum int32 `protobuf:"varint,16,opt,name=battlenum,proto3" json:"battlenum"` //战斗次数
|
||||||
Formation []*BattleRole `protobuf:"bytes,17,rep,name=formation,proto3" json:"formation"` //战斗阵型
|
Captain int32 `protobuf:"varint,17,opt,name=captain,proto3" json:"captain"` //战斗征信队长位
|
||||||
|
Formation []*BattleRole `protobuf:"bytes,18,rep,name=formation,proto3" json:"formation"` //战斗阵型
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DBPracticeRoom) Reset() {
|
func (x *DBPracticeRoom) Reset() {
|
||||||
@ -416,6 +417,13 @@ func (x *DBPracticeRoom) GetCurrnpc() int32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DBPracticeRoom) GetNpcstate() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Npcstate
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
func (x *DBPracticeRoom) GetRefresh() int64 {
|
func (x *DBPracticeRoom) GetRefresh() int64 {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Refresh
|
return x.Refresh
|
||||||
@ -618,7 +626,7 @@ var file_practice_practice_db_proto_rawDesc = []byte{
|
|||||||
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72,
|
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72,
|
||||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12,
|
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12,
|
||||||
0x16, 0x0a, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
|
0x16, 0x0a, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||||
0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x22, 0xed, 0x05, 0x0a, 0x0e, 0x44, 0x42, 0x50, 0x72,
|
0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x22, 0x89, 0x06, 0x0a, 0x0e, 0x44, 0x42, 0x50, 0x72,
|
||||||
0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
|
0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69,
|
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, 0x1c, 0x0a, 0x09,
|
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09,
|
||||||
@ -650,39 +658,41 @@ var file_practice_practice_db_proto_rawDesc = []byte{
|
|||||||
0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x65, 0x72,
|
0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x65, 0x72,
|
||||||
0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75,
|
0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75,
|
||||||
0x72, 0x72, 0x6e, 0x70, 0x63, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x75, 0x72,
|
0x72, 0x72, 0x6e, 0x70, 0x63, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x75, 0x72,
|
||||||
0x72, 0x6e, 0x70, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18,
|
0x72, 0x6e, 0x70, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x70, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65,
|
||||||
0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x1c,
|
0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6e, 0x70, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65,
|
||||||
0x0a, 0x09, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x0f, 0x20, 0x01, 0x28,
|
0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28,
|
||||||
0x05, 0x52, 0x09, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07,
|
0x03, 0x52, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x61,
|
||||||
0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63,
|
0x74, 0x74, 0x6c, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x62,
|
||||||
0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x12, 0x29, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
|
0x61, 0x74, 0x74, 0x6c, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x70, 0x74,
|
||||||
0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74,
|
0x61, 0x69, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x61, 0x70, 0x74, 0x61,
|
||||||
0x6c, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f,
|
0x69, 0x6e, 0x12, 0x29, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,
|
||||||
0x6e, 0x1a, 0x37, 0x0a, 0x09, 0x46, 0x75, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
|
0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x6f,
|
||||||
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79,
|
0x6c, 0x65, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x37, 0x0a,
|
||||||
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x09, 0x46, 0x75, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
|
||||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x4b, 0x6e,
|
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
|
||||||
0x61, 0x70, 0x73, 0x61, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
|
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
||||||
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a,
|
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x4b, 0x6e, 0x61, 0x70, 0x73, 0x61,
|
||||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61,
|
0x63, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
||||||
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x48, 0x0a, 0x16, 0x44, 0x42, 0x50, 0x72, 0x61,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||||
0x63, 0x74, 0x69, 0x63, 0x65, 0x51, 0x69, 0x65, 0x63, 0x75, 0x6f, 0x49, 0x6e, 0x76, 0x69, 0x74,
|
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||||
0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
0x02, 0x38, 0x01, 0x22, 0x48, 0x0a, 0x16, 0x44, 0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63,
|
||||||
0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
|
0x65, 0x51, 0x69, 0x65, 0x63, 0x75, 0x6f, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x10, 0x0a,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
|
0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12,
|
||||||
0x70, 0x22, 0xb5, 0x01, 0x0a, 0x16, 0x44, 0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65,
|
0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x51, 0x69, 0x65, 0x63, 0x75, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02,
|
0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xb5, 0x01,
|
||||||
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03,
|
0x0a, 0x16, 0x44, 0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x51, 0x69, 0x65, 0x63,
|
||||||
0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x31,
|
0x75, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
|
||||||
0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18,
|
||||||
0x17, 0x2e, 0x44, 0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x51, 0x69, 0x65, 0x63,
|
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x61,
|
||||||
0x75, 0x6f, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
|
0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x44, 0x42,
|
||||||
0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
|
0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x51, 0x69, 0x65, 0x63, 0x75, 0x6f, 0x49, 0x6e,
|
||||||
0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x61, 0x74,
|
0x76, 0x69, 0x74, 0x65, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x16, 0x0a,
|
||||||
0x74, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x69,
|
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73,
|
||||||
0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x06, 0x20, 0x03, 0x28,
|
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x69, 0x64, 0x18,
|
||||||
0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
|
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x69, 0x64, 0x12, 0x16, 0x0a,
|
||||||
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6d,
|
||||||
|
0x65, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -13,16 +13,18 @@ import "errors"
|
|||||||
type GameDispatch_BattleData struct {
|
type GameDispatch_BattleData struct {
|
||||||
Id int32
|
Id int32
|
||||||
Model string
|
Model string
|
||||||
|
Weight int32
|
||||||
Startstory int32
|
Startstory int32
|
||||||
Rejectstory int32
|
Rejectstory int32
|
||||||
Endstory int32
|
Endstory int32
|
||||||
Battlename string
|
Battlename string
|
||||||
Battletxt string
|
Battletxt string
|
||||||
FormatList []int32
|
|
||||||
BattleReadyID int32
|
BattleReadyID int32
|
||||||
EventList []int32
|
EventList []int32
|
||||||
Award []*Gameatn
|
Award []*Gameatn
|
||||||
|
StoryAward []*Gameatn
|
||||||
Onlookers []string
|
Onlookers []string
|
||||||
|
ChallengeOnlookers []string
|
||||||
Onlookersstory []int32
|
Onlookersstory []int32
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,25 +37,12 @@ func (*GameDispatch_BattleData) GetTypeId() int32 {
|
|||||||
func (_v *GameDispatch_BattleData)Deserialize(_buf map[string]interface{}) (err error) {
|
func (_v *GameDispatch_BattleData)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["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; if _v.Model, _ok_ = _buf["model"].(string); !_ok_ { err = errors.New("model error"); return } }
|
{ var _ok_ bool; if _v.Model, _ok_ = _buf["model"].(string); !_ok_ { err = errors.New("model error"); return } }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["weight"].(float64); !_ok_ { err = errors.New("weight error"); return }; _v.Weight = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["startstory"].(float64); !_ok_ { err = errors.New("startstory error"); return }; _v.Startstory = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["startstory"].(float64); !_ok_ { err = errors.New("startstory error"); return }; _v.Startstory = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rejectstory"].(float64); !_ok_ { err = errors.New("rejectstory error"); return }; _v.Rejectstory = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rejectstory"].(float64); !_ok_ { err = errors.New("rejectstory error"); return }; _v.Rejectstory = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endstory"].(float64); !_ok_ { err = errors.New("endstory error"); return }; _v.Endstory = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endstory"].(float64); !_ok_ { err = errors.New("endstory error"); return }; _v.Endstory = int32(_tempNum_) }
|
||||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["battlename"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Battlename error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Battlename, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["battlename"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Battlename error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Battlename, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["battletxt"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Battletxt error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Battletxt, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["battletxt"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Battletxt error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Battletxt, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||||
{
|
|
||||||
var _arr_ []interface{}
|
|
||||||
var _ok_ bool
|
|
||||||
if _arr_, _ok_ = _buf["FormatList"].([]interface{}); !_ok_ { err = errors.New("FormatList error"); return }
|
|
||||||
|
|
||||||
_v.FormatList = 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.FormatList = append(_v.FormatList, _list_v_)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BattleReadyID"].(float64); !_ok_ { err = errors.New("BattleReadyID error"); return }; _v.BattleReadyID = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BattleReadyID"].(float64); !_ok_ { err = errors.New("BattleReadyID error"); return }; _v.BattleReadyID = int32(_tempNum_) }
|
||||||
{
|
{
|
||||||
var _arr_ []interface{}
|
var _arr_ []interface{}
|
||||||
@ -83,6 +72,20 @@ func (_v *GameDispatch_BattleData)Deserialize(_buf map[string]interface{}) (err
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
var _arr_ []interface{}
|
||||||
|
var _ok_ bool
|
||||||
|
if _arr_, _ok_ = _buf["story_award"].([]interface{}); !_ok_ { err = errors.New("story_award error"); return }
|
||||||
|
|
||||||
|
_v.StoryAward = 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.StoryAward = append(_v.StoryAward, _list_v_)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
var _arr_ []interface{}
|
var _arr_ []interface{}
|
||||||
var _ok_ bool
|
var _ok_ bool
|
||||||
@ -97,6 +100,20 @@ func (_v *GameDispatch_BattleData)Deserialize(_buf map[string]interface{}) (err
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
var _arr_ []interface{}
|
||||||
|
var _ok_ bool
|
||||||
|
if _arr_, _ok_ = _buf["challenge_onlookers"].([]interface{}); !_ok_ { err = errors.New("challenge_onlookers error"); return }
|
||||||
|
|
||||||
|
_v.ChallengeOnlookers = make([]string, 0, len(_arr_))
|
||||||
|
|
||||||
|
for _, _e_ := range _arr_ {
|
||||||
|
var _list_v_ string
|
||||||
|
{ if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } }
|
||||||
|
_v.ChallengeOnlookers = append(_v.ChallengeOnlookers, _list_v_)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
var _arr_ []interface{}
|
var _arr_ []interface{}
|
||||||
var _ok_ bool
|
var _ok_ bool
|
||||||
|
Loading…
Reference in New Issue
Block a user