This commit is contained in:
meixiongfeng 2023-07-18 11:15:51 +08:00
commit 5647f0273b
8 changed files with 195 additions and 3 deletions

View File

@ -630,5 +630,24 @@
"text": "0", "text": "0",
"show": "98元", "show": "98元",
"image": "" "image": ""
},
{
"id": "drawcard_pack1",
"editionid": "debug",
"recharge_type": 5,
"monetaryunit": "¥",
"amount": 3000,
"vipexp": [
{
"a": "attr",
"t": "vipexp",
"n": 300
}
],
"diamond_num_double": [],
"channel": "0",
"text": "0",
"show": "30元",
"image": ""
} }
] ]

View File

@ -42051,5 +42051,52 @@
"DpsCondition": "", "DpsCondition": "",
"RevisiCondition": "", "RevisiCondition": "",
"RevisiParams": [] "RevisiParams": []
},
{
"Id": 254014111,
"EmitPR": 1000,
"From": 4,
"Where": [],
"Order": "",
"Limit": 1,
"ExecuteCnt": 1,
"Type": 1,
"Argu": [
1,
4,
2000
],
"FollowSK": [],
"SucFollowSK": [],
"FailFollowSK": [],
"MustHit": false,
"DpsRevisiType": 0,
"DpsCondition": "",
"RevisiCondition": "",
"RevisiParams": []
},
{
"Id": 254014211,
"EmitPR": 1000,
"From": 1,
"Where": [],
"Order": "",
"Limit": 10,
"ExecuteCnt": 1,
"Type": 3,
"Argu": [
390001008,
1000,
1,
2
],
"FollowSK": [],
"SucFollowSK": [],
"FailFollowSK": [],
"MustHit": false,
"DpsRevisiType": 0,
"DpsCondition": "",
"RevisiCondition": "",
"RevisiParams": []
} }
] ]

View File

@ -29914,5 +29914,63 @@
}, },
"buffid": [], "buffid": [],
"map": "" "map": ""
},
{
"id": 154014111,
"level": 1,
"MaxLV": 1,
"UnavailablePlayTypes": [],
"Name": {
"key": "skill_skill_atk_Name_154014111",
"text": "挚爱甜心"
},
"ico": "jn_54014_1",
"CorrectPos": 0,
"IsMelee": 0,
"act": "Skill_1",
"Type": 1,
"CD": 0,
"Where": [],
"Target": 2,
"ChildSkill": {
"Id": [
254014111
]
},
"Desc": {
"key": "skill_skill_atk_Desc_154014111_1",
"text": "对敌方1个目标发起攻击造成攻击力 200%的伤害。"
},
"buffid": [],
"map": ""
},
{
"id": 154014211,
"level": 1,
"MaxLV": 1,
"UnavailablePlayTypes": [],
"Name": {
"key": "skill_skill_atk_Name_154014211",
"text": "恋如糖雨"
},
"ico": "jn_54014_2",
"CorrectPos": 0,
"IsMelee": 0,
"act": "Skill_2",
"Type": 1,
"CD": 3,
"Where": [],
"Target": 2,
"ChildSkill": {
"Id": [
254014211
]
},
"Desc": {
"key": "skill_skill_atk_Desc_154014211_1",
"text": "对全体己方队友附加2回合[color=#37d8a9]攻击提升[/color]状态。"
},
"buffid": [],
"map": ""
} }
] ]

View File

@ -293,6 +293,9 @@ const (
///工会战 ///工会战
TableUniongve = "uniongve" TableUniongve = "uniongve"
//全局表
TableGlobal = "global"
) )
// RPC服务接口定义处 // RPC服务接口定义处

View File

@ -504,6 +504,11 @@ type (
GetPriceGroupLen(pricegroupId int32) (count int32, err error) GetPriceGroupLen(pricegroupId int32) (count int32, err error)
GetGrormetLlame(id string) (data int32, err error) GetGrormetLlame(id string) (data int32, err error)
GetGroupDataByLotteryId(id int32) (data *cfg.GameLotteryData, err error) GetGroupDataByLotteryId(id int32) (data *cfg.GameLotteryData, err error)
//读取全局表 db层
GetGlobalData(key string, v interface{}) (err error)
//更新全局表 db层
UpdateGlobalData(key string, v interface{}) (err error)
} }
IReputation interface { IReputation interface {

View File

@ -0,0 +1,39 @@
package tools
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo/options"
)
type modelGlobal struct {
modules.MCompModel
module *Tools
}
func (this *modelGlobal) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompModel.Init(service, module, comp, options)
this.TableName = comm.TableGlobal
this.module = module.(*Tools)
return
}
// 查询全局配置
func (this *modelGlobal) GetGlobalData(key string, v interface{}) (err error) {
if err = this.DBModel.DB.FindOne(core.SqlTable(this.TableName), bson.M{"_id": key}).Decode(v); err != nil {
this.module.Error("GetGlobalData err", log.Field{Key: "key", Value: key}, log.Field{Key: "err", Value: err.Error()})
}
return
}
// 更新全局配置
func (this *modelGlobal) UpdateGlobalData(key string, v interface{}) (err error) {
if _, err = this.DBModel.DB.UpdateOne(core.SqlTable(this.TableName), bson.M{"_id": key}, v, options.Update().SetUpsert(true)); err != nil {
this.module.Error("GetGlobalData err", log.Field{Key: "key", Value: key}, log.Field{Key: "err", Value: err.Error()})
}
return
}

View File

@ -15,6 +15,7 @@ func NewModule() core.IModule {
type Tools struct { type Tools struct {
modules.ModuleBase modules.ModuleBase
configure *MCompConfigure configure *MCompConfigure
modelGlobal *modelGlobal
} }
// 模块名 // 模块名
@ -38,6 +39,7 @@ func (this *Tools) Start() (err error) {
func (this *Tools) OnInstallComp() { func (this *Tools) OnInstallComp() {
this.ModuleBase.OnInstallComp() this.ModuleBase.OnInstallComp()
this.configure = this.RegisterComp(new(MCompConfigure)).(*MCompConfigure) this.configure = this.RegisterComp(new(MCompConfigure)).(*MCompConfigure)
this.modelGlobal = this.RegisterComp(new(modelGlobal)).(*modelGlobal)
} }
// 随机机器人 // 随机机器人
@ -77,3 +79,11 @@ func (this *Tools) GetPriceGroupLen(pricegroupId int32) (count int32, err error)
func (this *Tools) GetGrormetLlame(id string) (data int32, err error) { func (this *Tools) GetGrormetLlame(id string) (data int32, err error) {
return this.configure.GetGrormetLlame(id) return this.configure.GetGrormetLlame(id)
} }
func (this *Tools) GetGlobalData(key string, v interface{}) (err error) {
return this.modelGlobal.GetGlobalData(key, v)
}
func (this *Tools) UpdateGlobalData(key string, v interface{}) (err error) {
return this.modelGlobal.UpdateGlobalData(key, v)
}

View File

@ -22,6 +22,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.WarorderReceiveR
info *pb.Warorder info *pb.Warorder
confs []*cfg.GamePassCheckData confs []*cfg.GamePassCheckData
awards []*cfg.Gameatn awards []*cfg.Gameatn
ads []*pb.UserAssets = make([]*pb.UserAssets, 0)
days int32 days int32
err error err error
ok bool ok bool
@ -54,16 +55,26 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.WarorderReceiveR
return return
} }
days = int32(utils.DiffDays(configure.Now().Unix(), info.Opentime)) days = int32(utils.DiffDays(configure.Now().Unix(), info.Opentime)) + 1
awards = make([]*cfg.Gameatn, 0) awards = make([]*cfg.Gameatn, 0)
for _, v := range confs { for _, v := range confs {
if v.Parameter <= days { if v.Parameter <= days {
if info.Freeprogress < v.Parameter { if info.Freeprogress < v.Parameter {
awards = append(awards, v.FreeReward) awards = append(awards, v.FreeReward)
ads = append(ads, &pb.UserAssets{
A: v.FreeReward.A,
T: v.FreeReward.T,
N: v.FreeReward.N,
})
} }
if info.Vip { if info.Vip {
if info.Payprogress < v.Parameter { if info.Payprogress < v.Parameter {
awards = append(awards, v.PayReward) awards = append(awards, v.PayReward)
ads = append(ads, &pb.UserAssets{
A: v.PayReward.A,
T: v.PayReward.T,
N: v.PayReward.N,
})
} }
} }
} }
@ -75,6 +86,6 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.WarorderReceiveR
if errdata = this.module.DispenseRes(session, awards, true); errdata != nil { if errdata = this.module.DispenseRes(session, awards, true); errdata != nil {
return return
} }
session.SendMsg(string(this.module.GetType()), "receive", &pb.WarorderReceiveResp{Info: info}) session.SendMsg(string(this.module.GetType()), "receive", &pb.WarorderReceiveResp{Rtype: req.Rtype, Info: info, Award: ads})
return return
} }