上传商店中心
This commit is contained in:
parent
599399e11e
commit
cec5bec0fc
@ -101,6 +101,8 @@ const (
|
||||
ModuleShopCenter core.M_Modules = "shopcenter" //购物中心
|
||||
ModuleAddrecharge core.M_Modules = "addrecharge" //累充系统
|
||||
ModuleStoryLine core.M_Modules = "storyline" //剧情活动
|
||||
ModuleDreamwarorder core.M_Modules = "dreamwarorder" //如梦战令
|
||||
ModulePushgiftbag core.M_Modules = "pushgiftbag" //推送礼包
|
||||
)
|
||||
|
||||
// 数据表名定义处
|
||||
@ -331,6 +333,12 @@ const (
|
||||
|
||||
//守护者任务
|
||||
TableHerotask = "herotask"
|
||||
|
||||
//如梦战令
|
||||
TablekfDreamwarorder = "dreamwarorder"
|
||||
|
||||
//推送礼包
|
||||
TablekfPushGiftbag = "pushgiftbag"
|
||||
)
|
||||
|
||||
// RPC服务接口定义处
|
||||
|
@ -30,6 +30,6 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.AddRechargeInfoReq)
|
||||
return
|
||||
}
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), "info", &pb.AddRechargeInfoResp{Record: info.Record})
|
||||
session.SendMsg(string(this.module.GetType()), "info", &pb.AddRechargeInfoResp{Record: info.Record, Integral: info.Integral})
|
||||
return
|
||||
}
|
||||
|
20
modules/dreamwarorder/api.go
Normal file
20
modules/dreamwarorder/api.go
Normal file
@ -0,0 +1,20 @@
|
||||
package dreamwarorder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/base"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
modules.MCompGate
|
||||
service base.IRPCXService
|
||||
module *DreamWarorder
|
||||
}
|
||||
|
||||
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
_ = this.MCompGate.Init(service, module, comp, options)
|
||||
this.service = service.(base.IRPCXService)
|
||||
this.module = module.(*DreamWarorder)
|
||||
return
|
||||
}
|
47
modules/dreamwarorder/api_Info.go
Normal file
47
modules/dreamwarorder/api_Info.go
Normal file
@ -0,0 +1,47 @@
|
||||
package dreamwarorder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
// 参数校验
|
||||
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.KFTaskInfoReq) (errdata *pb.ErrorData) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// /获取自己的排行榜信息
|
||||
func (this *apiComp) Info(session comm.IUserSession, req *pb.KFTaskInfoReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
dtask *pb.DBKFTask
|
||||
tasks map[int32]struct{}
|
||||
condiIds []int32
|
||||
progress []*pb.ConIProgress
|
||||
err error
|
||||
)
|
||||
if errdata = this.InfoCheck(session, req); errdata != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if dtask, err = this.module.model.getUserDTasks(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
tasks = this.module.configure.gettasks()
|
||||
condiIds = make([]int32, 0, len(tasks))
|
||||
for k, _ := range tasks {
|
||||
condiIds = append(condiIds, k)
|
||||
}
|
||||
|
||||
if progress, err = this.module.ModuleBuried.CheckCondition(session.GetUserId(), condiIds...); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), "info", &pb.KFTaskInfoResp{Conlds: progress, Tasks: dtask.Tasks})
|
||||
return
|
||||
}
|
107
modules/dreamwarorder/api_receive.go
Normal file
107
modules/dreamwarorder/api_receive.go
Normal file
@ -0,0 +1,107 @@
|
||||
package dreamwarorder
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"go_dreamfactory/utils"
|
||||
)
|
||||
|
||||
// 参数校验
|
||||
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.KFTaskReceiveReq) (errdata *pb.ErrorData) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// /获取自己的排行榜信息
|
||||
func (this *apiComp) Receive(session comm.IUserSession, req *pb.KFTaskReceiveReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
dtask *pb.DBKFTask
|
||||
conf *cfg.GameVenturegiftsTaskData
|
||||
user *pb.DBUser
|
||||
progress []*pb.ConIProgress
|
||||
award []*pb.UserAssets
|
||||
err error
|
||||
)
|
||||
if errdata = this.ReceiveCheck(session, req); errdata != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if conf, err = this.module.configure.getGameVenturegiftsTask(req.Id); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
if dtask, err = this.module.model.getUserDTasks(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if dtask.Tasks[req.Id] == 1 {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
Message: fmt.Sprintf("%d received", req.Id),
|
||||
}
|
||||
return
|
||||
}
|
||||
if user = this.module.ModuleUser.GetUser(session.GetUserId()); user == nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: "no found user!",
|
||||
}
|
||||
return
|
||||
}
|
||||
days := utils.DiffDays(user.Ctime, configure.Now().Unix())
|
||||
if days < int(conf.Openday) {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: "no open",
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if progress, err = this.module.ModuleBuried.CheckCondition(session.GetUserId(), conf.Venturetask); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range progress {
|
||||
if v.State == pb.BuriedItemFinishState_buried_unfinish {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
Message: "task no finish",
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if errdata = this.module.DispenseRes(session, conf.Venturereward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
award = make([]*pb.UserAssets, 0)
|
||||
for _, v := range conf.Venturereward {
|
||||
award = append(award, &pb.UserAssets{
|
||||
A: v.A,
|
||||
T: v.T,
|
||||
N: v.N,
|
||||
})
|
||||
}
|
||||
dtask.Tasks[req.Id] = 1
|
||||
this.module.model.Change(session.GetUserId(), map[string]interface{}{
|
||||
"tasks": dtask.Tasks,
|
||||
})
|
||||
session.SendMsg(string(this.module.GetType()), "receive", &pb.KFTaskReceiveResp{Id: req.Id, Award: award})
|
||||
return
|
||||
}
|
84
modules/dreamwarorder/configure.go
Normal file
84
modules/dreamwarorder/configure.go
Normal file
@ -0,0 +1,84 @@
|
||||
package dreamwarorder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const (
|
||||
game_venturegiftstask = "game_venturegiftstask.json"
|
||||
)
|
||||
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
module *DreamWarorder
|
||||
lock sync.RWMutex
|
||||
tasks map[int32]struct{}
|
||||
groupTasks map[int32][]*cfg.GameVenturegiftsTaskData //key 条件ID
|
||||
}
|
||||
|
||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||
this.module = module.(*DreamWarorder)
|
||||
configure.RegisterConfigure(game_venturegiftstask, cfg.NewGameVenturegiftsTask, this.updateconfigure)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) gettasks() map[int32]struct{} {
|
||||
this.lock.RLock()
|
||||
defer this.lock.RUnlock()
|
||||
return this.tasks
|
||||
}
|
||||
|
||||
// 更新任务配置表
|
||||
func (this *configureComp) updateconfigure() {
|
||||
var (
|
||||
v interface{}
|
||||
conf *cfg.GameVenturegiftsTask
|
||||
ok bool
|
||||
err error
|
||||
)
|
||||
if v, err = this.GetConfigure(game_venturegiftstask); err != nil {
|
||||
return
|
||||
}
|
||||
if conf, ok = v.(*cfg.GameVenturegiftsTask); !ok {
|
||||
this.module.Error("日常任务配置异常!")
|
||||
return
|
||||
}
|
||||
tasks := make(map[int32]struct{})
|
||||
groupTasksConf := make(map[int32][]*cfg.GameVenturegiftsTaskData)
|
||||
|
||||
for _, v := range conf.GetDataList() {
|
||||
|
||||
if _, ok := groupTasksConf[v.Openday]; !ok {
|
||||
groupTasksConf[v.Openday] = make([]*cfg.GameVenturegiftsTaskData, 0)
|
||||
}
|
||||
groupTasksConf[v.Openday] = append(groupTasksConf[v.Openday], v)
|
||||
tasks[v.Venturetask] = struct{}{}
|
||||
}
|
||||
|
||||
this.lock.Lock()
|
||||
this.groupTasks = groupTasksConf
|
||||
this.tasks = tasks
|
||||
this.lock.Unlock()
|
||||
}
|
||||
|
||||
func (this *configureComp) getGameVenturegiftsTask(id int32) (conf *cfg.GameVenturegiftsTaskData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(game_venturegiftstask); err != nil {
|
||||
return
|
||||
}
|
||||
if conf, ok = v.(*cfg.GameVenturegiftsTask).GetDataMap()[id]; !ok {
|
||||
err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_venturegiftstask, id)
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
46
modules/dreamwarorder/model.go
Normal file
46
modules/dreamwarorder/model.go
Normal file
@ -0,0 +1,46 @@
|
||||
package dreamwarorder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||
)
|
||||
|
||||
type ModelDreamWarorder struct {
|
||||
modules.MCompModel
|
||||
module *DreamWarorder
|
||||
}
|
||||
|
||||
func (this *ModelDreamWarorder) 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.TablekfDreamwarorder
|
||||
this.module = module.(*DreamWarorder)
|
||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 获取用户全部的埋点数据
|
||||
func (this *ModelDreamWarorder) getUserDTasks(uid string) (results *pb.DBKFTask, err error) {
|
||||
results = &pb.DBKFTask{}
|
||||
if err = this.Get(uid, results); err != nil && err != mgo.MongodbNil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
if err == mgo.MongodbNil {
|
||||
results = &pb.DBKFTask{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: uid,
|
||||
Tasks: make(map[int32]int32),
|
||||
}
|
||||
err = this.Add(uid, results)
|
||||
}
|
||||
return
|
||||
}
|
64
modules/dreamwarorder/module.go
Normal file
64
modules/dreamwarorder/module.go
Normal file
@ -0,0 +1,64 @@
|
||||
package dreamwarorder
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
type DreamWarorder struct {
|
||||
modules.ModuleBase
|
||||
service core.IService
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
model *ModelDreamWarorder
|
||||
open bool
|
||||
}
|
||||
|
||||
func NewModule() core.IModule {
|
||||
return &DreamWarorder{}
|
||||
}
|
||||
|
||||
func (this *DreamWarorder) GetType() core.M_Modules {
|
||||
return comm.ModuleDreamwarorder
|
||||
}
|
||||
|
||||
func (this *DreamWarorder) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
this.service = service
|
||||
return
|
||||
}
|
||||
|
||||
func (this *DreamWarorder) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (this *DreamWarorder) OnInstallComp() {
|
||||
this.ModuleBase.OnInstallComp()
|
||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||
this.model = this.RegisterComp(new(ModelDreamWarorder)).(*ModelDreamWarorder)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
}
|
||||
|
||||
// 活动开启
|
||||
func (this *DreamWarorder) ActivityOpenNotice(hdlist *pb.DBHuodong) {
|
||||
switch hdlist.Itype {
|
||||
case comm.KFSevenTask:
|
||||
this.open = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// 活动关闭
|
||||
func (this *DreamWarorder) ActivityCloseNotice(hdlist *pb.DBHuodong) {
|
||||
|
||||
}
|
||||
|
||||
// 发货
|
||||
func (this *DreamWarorder) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) {
|
||||
|
||||
return
|
||||
}
|
20
modules/pushgiftbag/api.go
Normal file
20
modules/pushgiftbag/api.go
Normal file
@ -0,0 +1,20 @@
|
||||
package pushgiftbag
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/base"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
modules.MCompGate
|
||||
service base.IRPCXService
|
||||
module *PushGiftbag
|
||||
}
|
||||
|
||||
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
_ = this.MCompGate.Init(service, module, comp, options)
|
||||
this.service = service.(base.IRPCXService)
|
||||
this.module = module.(*PushGiftbag)
|
||||
return
|
||||
}
|
47
modules/pushgiftbag/api_Info.go
Normal file
47
modules/pushgiftbag/api_Info.go
Normal file
@ -0,0 +1,47 @@
|
||||
package pushgiftbag
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
// 参数校验
|
||||
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.KFTaskInfoReq) (errdata *pb.ErrorData) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// /获取自己的排行榜信息
|
||||
func (this *apiComp) Info(session comm.IUserSession, req *pb.KFTaskInfoReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
dtask *pb.DBKFTask
|
||||
tasks map[int32]struct{}
|
||||
condiIds []int32
|
||||
progress []*pb.ConIProgress
|
||||
err error
|
||||
)
|
||||
if errdata = this.InfoCheck(session, req); errdata != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if dtask, err = this.module.model.getUserDTasks(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
tasks = this.module.configure.gettasks()
|
||||
condiIds = make([]int32, 0, len(tasks))
|
||||
for k, _ := range tasks {
|
||||
condiIds = append(condiIds, k)
|
||||
}
|
||||
|
||||
if progress, err = this.module.ModuleBuried.CheckCondition(session.GetUserId(), condiIds...); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), "info", &pb.KFTaskInfoResp{Conlds: progress, Tasks: dtask.Tasks})
|
||||
return
|
||||
}
|
107
modules/pushgiftbag/api_receive.go
Normal file
107
modules/pushgiftbag/api_receive.go
Normal file
@ -0,0 +1,107 @@
|
||||
package pushgiftbag
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"go_dreamfactory/utils"
|
||||
)
|
||||
|
||||
// 参数校验
|
||||
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.KFTaskReceiveReq) (errdata *pb.ErrorData) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// /获取自己的排行榜信息
|
||||
func (this *apiComp) Receive(session comm.IUserSession, req *pb.KFTaskReceiveReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
dtask *pb.DBKFTask
|
||||
conf *cfg.GameVenturegiftsTaskData
|
||||
user *pb.DBUser
|
||||
progress []*pb.ConIProgress
|
||||
award []*pb.UserAssets
|
||||
err error
|
||||
)
|
||||
if errdata = this.ReceiveCheck(session, req); errdata != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if conf, err = this.module.configure.getGameVenturegiftsTask(req.Id); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
if dtask, err = this.module.model.getUserDTasks(session.GetUserId()); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if dtask.Tasks[req.Id] == 1 {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
Message: fmt.Sprintf("%d received", req.Id),
|
||||
}
|
||||
return
|
||||
}
|
||||
if user = this.module.ModuleUser.GetUser(session.GetUserId()); user == nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: "no found user!",
|
||||
}
|
||||
return
|
||||
}
|
||||
days := utils.DiffDays(user.Ctime, configure.Now().Unix())
|
||||
if days < int(conf.Openday) {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: "no open",
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if progress, err = this.module.ModuleBuried.CheckCondition(session.GetUserId(), conf.Venturetask); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range progress {
|
||||
if v.State == pb.BuriedItemFinishState_buried_unfinish {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
Message: "task no finish",
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if errdata = this.module.DispenseRes(session, conf.Venturereward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
award = make([]*pb.UserAssets, 0)
|
||||
for _, v := range conf.Venturereward {
|
||||
award = append(award, &pb.UserAssets{
|
||||
A: v.A,
|
||||
T: v.T,
|
||||
N: v.N,
|
||||
})
|
||||
}
|
||||
dtask.Tasks[req.Id] = 1
|
||||
this.module.model.Change(session.GetUserId(), map[string]interface{}{
|
||||
"tasks": dtask.Tasks,
|
||||
})
|
||||
session.SendMsg(string(this.module.GetType()), "receive", &pb.KFTaskReceiveResp{Id: req.Id, Award: award})
|
||||
return
|
||||
}
|
84
modules/pushgiftbag/configure.go
Normal file
84
modules/pushgiftbag/configure.go
Normal file
@ -0,0 +1,84 @@
|
||||
package pushgiftbag
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const (
|
||||
game_venturegiftstask = "game_venturegiftstask.json"
|
||||
)
|
||||
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
module *PushGiftbag
|
||||
lock sync.RWMutex
|
||||
tasks map[int32]struct{}
|
||||
groupTasks map[int32][]*cfg.GameVenturegiftsTaskData //key 条件ID
|
||||
}
|
||||
|
||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||
this.module = module.(*PushGiftbag)
|
||||
configure.RegisterConfigure(game_venturegiftstask, cfg.NewGameVenturegiftsTask, this.updateconfigure)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) gettasks() map[int32]struct{} {
|
||||
this.lock.RLock()
|
||||
defer this.lock.RUnlock()
|
||||
return this.tasks
|
||||
}
|
||||
|
||||
// 更新任务配置表
|
||||
func (this *configureComp) updateconfigure() {
|
||||
var (
|
||||
v interface{}
|
||||
conf *cfg.GameVenturegiftsTask
|
||||
ok bool
|
||||
err error
|
||||
)
|
||||
if v, err = this.GetConfigure(game_venturegiftstask); err != nil {
|
||||
return
|
||||
}
|
||||
if conf, ok = v.(*cfg.GameVenturegiftsTask); !ok {
|
||||
this.module.Error("日常任务配置异常!")
|
||||
return
|
||||
}
|
||||
tasks := make(map[int32]struct{})
|
||||
groupTasksConf := make(map[int32][]*cfg.GameVenturegiftsTaskData)
|
||||
|
||||
for _, v := range conf.GetDataList() {
|
||||
|
||||
if _, ok := groupTasksConf[v.Openday]; !ok {
|
||||
groupTasksConf[v.Openday] = make([]*cfg.GameVenturegiftsTaskData, 0)
|
||||
}
|
||||
groupTasksConf[v.Openday] = append(groupTasksConf[v.Openday], v)
|
||||
tasks[v.Venturetask] = struct{}{}
|
||||
}
|
||||
|
||||
this.lock.Lock()
|
||||
this.groupTasks = groupTasksConf
|
||||
this.tasks = tasks
|
||||
this.lock.Unlock()
|
||||
}
|
||||
|
||||
func (this *configureComp) getGameVenturegiftsTask(id int32) (conf *cfg.GameVenturegiftsTaskData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(game_venturegiftstask); err != nil {
|
||||
return
|
||||
}
|
||||
if conf, ok = v.(*cfg.GameVenturegiftsTask).GetDataMap()[id]; !ok {
|
||||
err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_venturegiftstask, id)
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
46
modules/pushgiftbag/model.go
Normal file
46
modules/pushgiftbag/model.go
Normal file
@ -0,0 +1,46 @@
|
||||
package pushgiftbag
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||
)
|
||||
|
||||
type ModelPushGiftbag struct {
|
||||
modules.MCompModel
|
||||
module *PushGiftbag
|
||||
}
|
||||
|
||||
func (this *ModelPushGiftbag) 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.TablekfPushGiftbag
|
||||
this.module = module.(*PushGiftbag)
|
||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 获取用户全部的埋点数据
|
||||
func (this *ModelPushGiftbag) getUserDTasks(uid string) (results *pb.DBKFTask, err error) {
|
||||
results = &pb.DBKFTask{}
|
||||
if err = this.Get(uid, results); err != nil && err != mgo.MongodbNil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
if err == mgo.MongodbNil {
|
||||
results = &pb.DBKFTask{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: uid,
|
||||
Tasks: make(map[int32]int32),
|
||||
}
|
||||
err = this.Add(uid, results)
|
||||
}
|
||||
return
|
||||
}
|
64
modules/pushgiftbag/module.go
Normal file
64
modules/pushgiftbag/module.go
Normal file
@ -0,0 +1,64 @@
|
||||
package pushgiftbag
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
type PushGiftbag struct {
|
||||
modules.ModuleBase
|
||||
service core.IService
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
model *ModelPushGiftbag
|
||||
open bool
|
||||
}
|
||||
|
||||
func NewModule() core.IModule {
|
||||
return &PushGiftbag{}
|
||||
}
|
||||
|
||||
func (this *PushGiftbag) GetType() core.M_Modules {
|
||||
return comm.ModulePushgiftbag
|
||||
}
|
||||
|
||||
func (this *PushGiftbag) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
this.service = service
|
||||
return
|
||||
}
|
||||
|
||||
func (this *PushGiftbag) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (this *PushGiftbag) OnInstallComp() {
|
||||
this.ModuleBase.OnInstallComp()
|
||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||
this.model = this.RegisterComp(new(ModelPushGiftbag)).(*ModelPushGiftbag)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
}
|
||||
|
||||
// 活动开启
|
||||
func (this *PushGiftbag) ActivityOpenNotice(hdlist *pb.DBHuodong) {
|
||||
switch hdlist.Itype {
|
||||
case comm.KFSevenTask:
|
||||
this.open = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// 活动关闭
|
||||
func (this *PushGiftbag) ActivityCloseNotice(hdlist *pb.DBHuodong) {
|
||||
|
||||
}
|
||||
|
||||
// 发货
|
||||
func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) {
|
||||
|
||||
return
|
||||
}
|
@ -33,7 +33,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
||||
return
|
||||
}
|
||||
|
||||
// 获取活跃度奖励配置
|
||||
// 获取所有活动列表
|
||||
func (this *configureComp) getGameShopCenterControls() (confs []*cfg.GameShopCenterControlData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"sync"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
@ -49,17 +50,33 @@ func (this *ModelShop) getactivity() map[int32]*pb.DBHuodong {
|
||||
|
||||
// 获取用户全部的埋点数据
|
||||
func (this *ModelShop) getUserShopCenter(uid string) (results *pb.DBShopCenter, err error) {
|
||||
var (
|
||||
confs []*cfg.GameShopCenterControlData
|
||||
)
|
||||
|
||||
results = &pb.DBShopCenter{}
|
||||
if err = this.Get(uid, results); err != nil && err != mgo.MongodbNil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
if err == mgo.MongodbNil {
|
||||
if confs, err = this.module.configure.getGameShopCenterControls(); err != nil {
|
||||
return
|
||||
}
|
||||
results = &pb.DBShopCenter{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: uid,
|
||||
Item: make(map[int32]*pb.DBShopCenterItem),
|
||||
}
|
||||
for _, v := range confs {
|
||||
if v.On == 0 {
|
||||
results.Item[v.Id] = &pb.DBShopCenterItem{
|
||||
Id: v.Id,
|
||||
Open: true,
|
||||
Record: make(map[int32]bool),
|
||||
}
|
||||
}
|
||||
}
|
||||
err = this.Add(uid, results)
|
||||
}
|
||||
return
|
||||
|
@ -368,8 +368,9 @@ type ActivityTurntableRewardResp struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data *DBActivityData `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
|
||||
Atno []*UserAtno `protobuf:"bytes,2,rep,name=atno,proto3" json:"atno"`
|
||||
Data *DBActivityData `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
|
||||
Atno []*UserAtno `protobuf:"bytes,2,rep,name=atno,proto3" json:"atno"`
|
||||
Drawkey int32 `protobuf:"varint,3,opt,name=drawkey,proto3" json:"drawkey"`
|
||||
}
|
||||
|
||||
func (x *ActivityTurntableRewardResp) Reset() {
|
||||
@ -418,6 +419,13 @@ func (x *ActivityTurntableRewardResp) GetAtno() []*UserAtno {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ActivityTurntableRewardResp) GetDrawkey() int32 {
|
||||
if x != nil {
|
||||
return x.Drawkey
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// 活动数据变更推送
|
||||
type ActivityDataChangePush struct {
|
||||
state protoimpl.MessageState
|
||||
@ -497,18 +505,19 @@ var file_activity_activity_msg_proto_rawDesc = []byte{
|
||||
0x74, 0x6e, 0x6f, 0x22, 0x2e, 0x0a, 0x1a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54,
|
||||
0x75, 0x72, 0x6e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65,
|
||||
0x71, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x6f, 0x69, 0x64, 0x22, 0x61, 0x0a, 0x1b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54,
|
||||
0x6f, 0x69, 0x64, 0x22, 0x7b, 0x0a, 0x1b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54,
|
||||
0x75, 0x72, 0x6e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65,
|
||||
0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x0f, 0x2e, 0x44, 0x42, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74,
|
||||
0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x04, 0x61, 0x74, 0x6e, 0x6f, 0x18,
|
||||
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f,
|
||||
0x52, 0x04, 0x61, 0x74, 0x6e, 0x6f, 0x22, 0x3d, 0x0a, 0x16, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69,
|
||||
0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68,
|
||||
0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f,
|
||||
0x2e, 0x44, 0x42, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x52, 0x04, 0x61, 0x74, 0x6e, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x72, 0x61, 0x77, 0x6b, 0x65,
|
||||
0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x72, 0x61, 0x77, 0x6b, 0x65, 0x79,
|
||||
0x22, 0x3d, 0x0a, 0x16, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61,
|
||||
0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61,
|
||||
0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x41, 0x63, 0x74,
|
||||
0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42,
|
||||
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -65,7 +65,8 @@ type AddRechargeInfoResp struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Record map[int32]bool `protobuf:"bytes,1,rep,name=record,proto3" json:"record" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
||||
Integral int32 `protobuf:"varint,1,opt,name=integral,proto3" json:"integral"`
|
||||
Record map[int32]bool `protobuf:"bytes,2,rep,name=record,proto3" json:"record" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
func (x *AddRechargeInfoResp) Reset() {
|
||||
@ -100,6 +101,13 @@ func (*AddRechargeInfoResp) Descriptor() ([]byte, []int) {
|
||||
return file_addrecharge_addrecharge_msg_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *AddRechargeInfoResp) GetIntegral() int32 {
|
||||
if x != nil {
|
||||
return x.Integral
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AddRechargeInfoResp) GetRecord() map[int32]bool {
|
||||
if x != nil {
|
||||
return x.Record
|
||||
@ -218,24 +226,26 @@ var file_addrecharge_addrecharge_msg_proto_rawDesc = []byte{
|
||||
0x64, 0x72, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0x14, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x49, 0x6e,
|
||||
0x66, 0x6f, 0x52, 0x65, 0x71, 0x22, 0x8a, 0x01, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63,
|
||||
0x68, 0x61, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a,
|
||||
0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e,
|
||||
0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52,
|
||||
0x65, 0x73, 0x70, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
|
||||
0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x6f, 0x72,
|
||||
0x64, 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, 0x27, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67,
|
||||
0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x16, 0x41,
|
||||
0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76,
|
||||
0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74,
|
||||
0x73, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x66, 0x6f, 0x52, 0x65, 0x71, 0x22, 0xa6, 0x01, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63,
|
||||
0x68, 0x61, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x38, 0x0a, 0x06, 0x72, 0x65, 0x63,
|
||||
0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x41, 0x64, 0x64, 0x52,
|
||||
0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x2e,
|
||||
0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x63,
|
||||
0x6f, 0x72, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 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, 0x27,
|
||||
0x0a, 0x15, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x63,
|
||||
0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x52, 0x65,
|
||||
0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73,
|
||||
0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69,
|
||||
0x64, 0x12, 0x21, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x61,
|
||||
0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -1626,14 +1626,15 @@ func (x *ComChainEffect) GetRoles() []int32 {
|
||||
return nil
|
||||
}
|
||||
|
||||
//护盾统计
|
||||
//护盾
|
||||
type ComShieldInfo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rid int32 `protobuf:"varint,1,opt,name=rid,proto3" json:"rid"` //角色id
|
||||
Value int32 `protobuf:"varint,2,opt,name=value,proto3" json:"value"` //抵消的伤害量
|
||||
Rid int32 `protobuf:"varint,1,opt,name=rid,proto3" json:"rid"` //角色id
|
||||
Value int32 `protobuf:"varint,2,opt,name=value,proto3" json:"value"` //本次扣除的护盾值
|
||||
CurValue int32 `protobuf:"varint,3,opt,name=curValue,proto3" json:"curValue"` //当前剩余护盾值
|
||||
}
|
||||
|
||||
func (x *ComShieldInfo) Reset() {
|
||||
@ -1682,6 +1683,13 @@ func (x *ComShieldInfo) GetValue() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ComShieldInfo) GetCurValue() int32 {
|
||||
if x != nil {
|
||||
return x.CurValue
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_battle_battle_struct_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_battle_battle_struct_proto_rawDesc = []byte{
|
||||
@ -1833,22 +1841,24 @@ var file_battle_battle_struct_proto_rawDesc = []byte{
|
||||
0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x74, 0x6f, 0x22, 0x26, 0x0a, 0x0e,
|
||||
0x43, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x72,
|
||||
0x6f, 0x6c, 0x65, 0x73, 0x22, 0x37, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x53, 0x68, 0x69, 0x65, 0x6c,
|
||||
0x6f, 0x6c, 0x65, 0x73, 0x22, 0x53, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x53, 0x68, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x03, 0x72, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0xab, 0x01,
|
||||
0x0a, 0x0e, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x54, 0x69, 0x70, 0x73, 0x54, 0x79, 0x70, 0x65,
|
||||
0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x66, 0x66, 0x5f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10,
|
||||
0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x6f, 0x74, 0x5f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
|
||||
0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x10, 0x02,
|
||||
0x12, 0x0a, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08,
|
||||
0x4e, 0x6f, 0x74, 0x5f, 0x47, 0x61, 0x69, 0x6e, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x6f,
|
||||
0x74, 0x5f, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x4e,
|
||||
0x6f, 0x74, 0x5f, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x50,
|
||||
0x75, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x07, 0x12, 0x0c, 0x0a,
|
||||
0x08, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x10, 0x08, 0x12, 0x0e, 0x0a, 0x0a, 0x47,
|
||||
0x61, 0x69, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x09, 0x42, 0x06, 0x5a, 0x04, 0x2e,
|
||||
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x63, 0x75, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x08, 0x63, 0x75, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0xab, 0x01, 0x0a, 0x0e, 0x45, 0x66,
|
||||
0x66, 0x65, 0x63, 0x74, 0x54, 0x69, 0x70, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b,
|
||||
0x45, 0x66, 0x66, 0x5f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0f, 0x0a,
|
||||
0x0b, 0x4e, 0x6f, 0x74, 0x5f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x01, 0x12, 0x0c,
|
||||
0x0a, 0x08, 0x49, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06,
|
||||
0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x6f, 0x74, 0x5f,
|
||||
0x47, 0x61, 0x69, 0x6e, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x6f, 0x74, 0x5f, 0x43, 0x6f,
|
||||
0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x5f, 0x41,
|
||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x75, 0x72, 0x69, 0x66,
|
||||
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x07, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x69, 0x73,
|
||||
0x70, 0x65, 0x72, 0x73, 0x65, 0x10, 0x08, 0x12, 0x0e, 0x0a, 0x0a, 0x47, 0x61, 0x69, 0x6e, 0x5f,
|
||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x09, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user