上传累充一键领取

This commit is contained in:
liwei 2023-08-09 11:28:34 +08:00
parent 79529c8cb6
commit 65f23c5973
10 changed files with 464 additions and 38 deletions

View File

@ -118,6 +118,46 @@ func GetRandW(sz []int32) int32 {
return 0
}
// / 参数 权重数组 返回值 数组下标
func GetRandWs(sz []int32, num int32) []int {
results := make([]int, 0)
if len(sz) > 0 {
var _totalW int64 // 总权重
var _tmpW int64 // 临时权重
for _, v := range sz {
_totalW += int64(v)
}
if int(num) > len(sz) {
num = int32(len(sz))
}
for i := 0; i < int(num); i++ {
// 随机权重
_tmpW = 0
n, _ := rand.Int(rand.Reader, big.NewInt(_totalW))
for i, v := range sz {
jump := false
for _, v1 := range results {
if i == v1 {
jump = true
break
}
}
if !jump {
_tmpW += int64(v)
if n.Int64() < _tmpW {
results = append(results, i)
_totalW -= int64(v)
break
}
}
}
}
}
return results
}
func RandShuffle(leng int) []int {
if leng < 0 {
return make([]int, 0)

View File

@ -1,9 +1,11 @@
package comm
import (
"crypto/rand"
"errors"
"fmt"
"go_dreamfactory/pb"
"math/big"
"strings"
"testing"
)
@ -26,3 +28,41 @@ func findUser(uid string) error {
}
return nil
}
// / 参数 权重数组 返回值 数组下标
func Test_GetRandWs(t *testing.T) {
results := make([]int, 0)
sz := []int32{100, 50, 200, 90, 20}
num := 2
if len(sz) > 0 {
var _totalW int64 // 总权重
var _tmpW int64 // 临时权重
for _, v := range sz {
_totalW += int64(v)
}
for i := 0; i < int(num); i++ {
_tmpW = 0
// 随机权重
n, _ := rand.Int(rand.Reader, big.NewInt(_totalW))
for i, v := range sz {
jump := false
for _, v1 := range results {
if i == v1 {
jump = true
break
}
}
if !jump {
_tmpW += int64(v)
if n.Int64() < _tmpW {
results = append(results, i)
_totalW -= int64(v)
break
}
}
}
}
}
fmt.Printf("results:%v", results)
}

View File

@ -0,0 +1,82 @@
package addrecharge
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
)
// 参数校验
func (this *apiComp) ReceiveAllCheck(session comm.IUserSession, req *pb.AddRechargeReceiveAllReq) (errdata *pb.ErrorData) {
return
}
// /获取自己的排行榜信息
func (this *apiComp) ReceiveAll(session comm.IUserSession, req *pb.AddRechargeReceiveAllReq) (errdata *pb.ErrorData) {
var (
info *pb.DBAddRecharge
confs []*cfg.GameAccumulateData
atns []*cfg.Gameatn = make([]*cfg.Gameatn, 0)
award []*pb.UserAssets = make([]*pb.UserAssets, 0)
err error
)
if errdata = this.ReceiveAllCheck(session, req); errdata != nil {
return
}
if confs, err = this.module.configure.getGameAccumulates(); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
if info, err = this.module.modelRecharge.getUserDTasks(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
for _, conf := range confs {
if info.Integral < conf.Integral {
continue
}
if info.Record[conf.Integral] {
continue
}
atns = append(atns, conf.Reward...)
info.Record[conf.Integral] = true
}
if len(atns) == 0 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: "no can receive !",
}
return
}
if errdata = this.module.DispenseRes(session, atns, true); errdata != nil {
return
}
for _, v := range atns {
award = append(award, &pb.UserAssets{
A: v.A,
T: v.T,
N: v.N,
})
}
this.module.modelRecharge.Change(session.GetUserId(), map[string]interface{}{
"record": info.Record,
})
session.SendMsg(string(this.module.GetType()), "receiveall", &pb.AddRechargeReceiveAllResp{Award: award})
return
}

View File

@ -38,3 +38,14 @@ func (this *configureComp) getGameAccumulate(id int32) (conf *cfg.GameAccumulate
}
return
}
func (this *configureComp) getGameAccumulates() (confs []*cfg.GameAccumulateData, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(game_accumulate); err != nil {
return
}
confs = v.(*cfg.GameAccumulate).GetDataList()
return
}

View File

@ -3,6 +3,8 @@ package dreamwarorder
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
)
// 参数校验
@ -14,15 +16,26 @@ func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.DreamWarorderI
// /获取自己的排行榜信息
func (this *apiComp) Info(session comm.IUserSession, req *pb.DreamWarorderInfoReq) (errdata *pb.ErrorData) {
var (
confs []*cfg.GamePassCheckTaskData
info *pb.DBDreamWarorder
condiIds []int32
progress []*pb.ConIProgress
update map[string]interface{} = make(map[string]interface{})
err error
)
if errdata = this.InfoCheck(session, req); errdata != nil {
return
}
if confs, err = this.module.configure.getGamePassCheckTask(); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(),
}
return
}
if info, err = this.module.model.getUserDreamwarorder(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
@ -31,6 +44,19 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.DreamWarorderInfoRe
}
return
}
if utils.IsToday(info.Daytime) {
daynum := this.module.ModuleTools.GetGlobalConf().Passcheck4DayNum
this.module.model.refreshDayTask(info, confs, daynum)
update["daytime"] = info.Daytime
update["daytasks"] = info.Daytasks
}
if utils.IsSameWeek(info.Weektime) {
weeknum := this.module.ModuleTools.GetGlobalConf().Passcheck4WeekNum
this.module.model.refreshDayTask(info, confs, weeknum)
update["weektime"] = info.Weektime
update["weektasks"] = info.Weektasks
}
condiIds = make([]int32, 0)
for _, v := range info.Daytasks {
condiIds = append(condiIds, v)
@ -39,10 +65,26 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.DreamWarorderInfoRe
condiIds = append(condiIds, v)
}
for _, v := range confs {
if v.Page == 3 {
condiIds = append(condiIds, v.Parameter)
}
}
if progress, err = this.module.ModuleBuried.CheckCondition(session.GetUserId(), condiIds...); err != nil {
return
}
if len(update) > 0 {
if err = this.module.model.Change(session.GetUserId(), update); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
}
}
session.SendMsg(string(this.module.GetType()), "info", &pb.DreamWarorderInfoResp{Conlds: progress, Info: info})
return
}

View File

@ -10,7 +10,9 @@ import (
)
const (
game_passcheck = "game_passcheck.json"
game_passcheck = "game_passcheck.json"
game_passcheckexp = "game_passcheckexp.json"
game_passchecktask = "game_passchecktask.json"
)
type configureComp struct {
@ -24,6 +26,8 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
err = this.MCompConfigure.Init(service, module, comp, options)
this.module = module.(*DreamWarorder)
this.order = make([]*cfg.GamePassCheckData, 0)
err = this.LoadConfigure(game_passcheckexp, cfg.NewGamePassCheckExp)
err = this.LoadConfigure(game_passchecktask, cfg.NewGamePassCheckTask)
configure.RegisterConfigure(game_passcheck, cfg.NewGamePassCheck, this.updateconfigure)
return
}
@ -69,3 +73,16 @@ func (this *configureComp) updateconfigure() {
this.order = orderConf
this.lock.Unlock()
}
// 读取任务配置表
func (this *configureComp) getGamePassCheckTask() (confs []*cfg.GamePassCheckTaskData, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(game_passchecktask); err != nil {
return
} else {
confs = v.(*cfg.GamePassCheckTask).GetDataList()
}
return
}

View File

@ -6,6 +6,8 @@ import (
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
@ -42,7 +44,52 @@ func (this *ModelDreamWarorder) getUserDreamwarorder(uid string) (results *pb.DB
Weektasks: make([]int32, 0),
Completetasks: make([]int32, 0),
}
err = this.Add(uid, results)
}
return
}
//刷新日常任务
func (this *ModelDreamWarorder) refreshDayTask(info *pb.DBDreamWarorder, confs []*cfg.GamePassCheckTaskData, num int32) {
var (
tasks []*cfg.GamePassCheckTaskData = make([]*cfg.GamePassCheckTaskData, 0)
weight []int32 = make([]int32, 0)
indexs []int = make([]int, 0)
)
for _, v := range confs {
if v.Page == 1 {
tasks = append(tasks, v)
weight = append(weight, v.Pro)
}
}
indexs = comm.GetRandWs(weight, num)
for _, i := range indexs {
info.Daytasks = append(info.Daytasks, tasks[i].Id)
}
info.Daytime = configure.Now().Unix()
}
//刷新日常任务
func (this *ModelDreamWarorder) refreshWeekTask(info *pb.DBDreamWarorder, confs []*cfg.GamePassCheckTaskData, num int32) {
var (
tasks []*cfg.GamePassCheckTaskData = make([]*cfg.GamePassCheckTaskData, 0)
weight []int32 = make([]int32, 0)
indexs []int = make([]int, 0)
)
for _, v := range confs {
if v.Page == 2 {
tasks = append(tasks, v)
weight = append(weight, v.Pro)
}
}
indexs = comm.GetRandWs(weight, num)
for _, i := range indexs {
info.Weektasks = append(info.Daytasks, tasks[i].Id)
}
info.Weektime = configure.Now().Unix()
}

View File

@ -34,6 +34,8 @@ const (
HdType_HdTypeSign HdType = 8 //七日签到
HdType_AddUpRecharge HdType = 10 //累计充值
HdType_ShopCenterPayPakcge HdType = 11 //活动中心限时礼包
HdType_SupplyWarOrder HdType = 12 //补给战令
HdType_MoondreamWarOrder HdType = 13 //岳梦战令
// 特殊类型活动 只受活动开启限制 具体玩法 走excel 配置
HdType_HdTypeTurntable HdType = 1001 //大转盘
HdType_HdCelebration HdType = 1002 // 庆典活动
@ -56,6 +58,8 @@ var (
8: "HdTypeSign",
10: "AddUpRecharge",
11: "ShopCenterPayPakcge",
12: "SupplyWarOrder",
13: "MoondreamWarOrder",
1001: "HdTypeTurntable",
1002: "HdCelebration",
1003: "HdPuzzle",
@ -74,6 +78,8 @@ var (
"HdTypeSign": 8,
"AddUpRecharge": 10,
"ShopCenterPayPakcge": 11,
"SupplyWarOrder": 12,
"MoondreamWarOrder": 13,
"HdTypeTurntable": 1001,
"HdCelebration": 1002,
"HdPuzzle": 1003,
@ -554,7 +560,7 @@ var file_activity_activity_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, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
0x01, 0x2a, 0xa2, 0x02, 0x0a, 0x06, 0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a,
0x01, 0x2a, 0xcd, 0x02, 0x0a, 0x06, 0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a,
0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x75, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e,
0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x57, 0x61, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x10, 0x01,
0x12, 0x0d, 0x0a, 0x09, 0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x50, 0x61, 0x79, 0x10, 0x02, 0x12,
@ -567,13 +573,16 @@ var file_activity_activity_db_proto_rawDesc = []byte{
0x6e, 0x10, 0x08, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x55, 0x70, 0x52, 0x65, 0x63, 0x68,
0x61, 0x72, 0x67, 0x65, 0x10, 0x0a, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x68, 0x6f, 0x70, 0x43, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x50, 0x61, 0x79, 0x50, 0x61, 0x6b, 0x63, 0x67, 0x65, 0x10, 0x0b, 0x12,
0x14, 0x0a, 0x0f, 0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x54, 0x75, 0x72, 0x6e, 0x74, 0x61, 0x62,
0x6c, 0x65, 0x10, 0xe9, 0x07, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x64, 0x43, 0x65, 0x6c, 0x65, 0x62,
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0xea, 0x07, 0x12, 0x0d, 0x0a, 0x08, 0x48, 0x64, 0x50,
0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x10, 0xeb, 0x07, 0x12, 0x0e, 0x0a, 0x09, 0x48, 0x64, 0x4c, 0x61,
0x74, 0x74, 0x69, 0x63, 0x65, 0x10, 0xec, 0x07, 0x12, 0x0c, 0x0a, 0x07, 0x48, 0x64, 0x4d, 0x69,
0x6e, 0x65, 0x72, 0x10, 0xed, 0x07, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x12, 0x0a, 0x0e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x57, 0x61, 0x72, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x10, 0x0c, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x6f, 0x6f, 0x6e, 0x64, 0x72, 0x65, 0x61, 0x6d,
0x57, 0x61, 0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x10, 0x0d, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x64,
0x54, 0x79, 0x70, 0x65, 0x54, 0x75, 0x72, 0x6e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xe9, 0x07,
0x12, 0x12, 0x0a, 0x0d, 0x48, 0x64, 0x43, 0x65, 0x6c, 0x65, 0x62, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x10, 0xea, 0x07, 0x12, 0x0d, 0x0a, 0x08, 0x48, 0x64, 0x50, 0x75, 0x7a, 0x7a, 0x6c, 0x65,
0x10, 0xeb, 0x07, 0x12, 0x0e, 0x0a, 0x09, 0x48, 0x64, 0x4c, 0x61, 0x74, 0x74, 0x69, 0x63, 0x65,
0x10, 0xec, 0x07, 0x12, 0x0c, 0x0a, 0x07, 0x48, 0x64, 0x4d, 0x69, 0x6e, 0x65, 0x72, 0x10, 0xed,
0x07, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (

View File

@ -219,6 +219,93 @@ func (x *AddRechargeReceiveResp) GetAward() []*UserAssets {
return nil
}
//一键领奖 请求
type AddRechargeReceiveAllReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *AddRechargeReceiveAllReq) Reset() {
*x = AddRechargeReceiveAllReq{}
if protoimpl.UnsafeEnabled {
mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AddRechargeReceiveAllReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddRechargeReceiveAllReq) ProtoMessage() {}
func (x *AddRechargeReceiveAllReq) ProtoReflect() protoreflect.Message {
mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddRechargeReceiveAllReq.ProtoReflect.Descriptor instead.
func (*AddRechargeReceiveAllReq) Descriptor() ([]byte, []int) {
return file_addrecharge_addrecharge_msg_proto_rawDescGZIP(), []int{4}
}
//一键领奖 请求回应
type AddRechargeReceiveAllResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Award []*UserAssets `protobuf:"bytes,2,rep,name=award,proto3" json:"award"` //奖励
}
func (x *AddRechargeReceiveAllResp) Reset() {
*x = AddRechargeReceiveAllResp{}
if protoimpl.UnsafeEnabled {
mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AddRechargeReceiveAllResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddRechargeReceiveAllResp) ProtoMessage() {}
func (x *AddRechargeReceiveAllResp) ProtoReflect() protoreflect.Message {
mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddRechargeReceiveAllResp.ProtoReflect.Descriptor instead.
func (*AddRechargeReceiveAllResp) Descriptor() ([]byte, []int) {
return file_addrecharge_addrecharge_msg_proto_rawDescGZIP(), []int{5}
}
func (x *AddRechargeReceiveAllResp) GetAward() []*UserAssets {
if x != nil {
return x.Award
}
return nil
}
var File_addrecharge_addrecharge_msg_proto protoreflect.FileDescriptor
var file_addrecharge_addrecharge_msg_proto_rawDesc = []byte{
@ -244,8 +331,13 @@ var file_addrecharge_addrecharge_msg_proto_rawDesc = []byte{
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,
0x77, 0x61, 0x72, 0x64, 0x22, 0x1a, 0x0a, 0x18, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61,
0x72, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71,
0x22, 0x3e, 0x0a, 0x19, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52,
0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 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 (
@ -260,23 +352,26 @@ func file_addrecharge_addrecharge_msg_proto_rawDescGZIP() []byte {
return file_addrecharge_addrecharge_msg_proto_rawDescData
}
var file_addrecharge_addrecharge_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_addrecharge_addrecharge_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_addrecharge_addrecharge_msg_proto_goTypes = []interface{}{
(*AddRechargeInfoReq)(nil), // 0: AddRechargeInfoReq
(*AddRechargeInfoResp)(nil), // 1: AddRechargeInfoResp
(*AddRechargeReceiveReq)(nil), // 2: AddRechargeReceiveReq
(*AddRechargeReceiveResp)(nil), // 3: AddRechargeReceiveResp
nil, // 4: AddRechargeInfoResp.RecordEntry
(*UserAssets)(nil), // 5: UserAssets
(*AddRechargeInfoReq)(nil), // 0: AddRechargeInfoReq
(*AddRechargeInfoResp)(nil), // 1: AddRechargeInfoResp
(*AddRechargeReceiveReq)(nil), // 2: AddRechargeReceiveReq
(*AddRechargeReceiveResp)(nil), // 3: AddRechargeReceiveResp
(*AddRechargeReceiveAllReq)(nil), // 4: AddRechargeReceiveAllReq
(*AddRechargeReceiveAllResp)(nil), // 5: AddRechargeReceiveAllResp
nil, // 6: AddRechargeInfoResp.RecordEntry
(*UserAssets)(nil), // 7: UserAssets
}
var file_addrecharge_addrecharge_msg_proto_depIdxs = []int32{
4, // 0: AddRechargeInfoResp.record:type_name -> AddRechargeInfoResp.RecordEntry
5, // 1: AddRechargeReceiveResp.award:type_name -> UserAssets
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
6, // 0: AddRechargeInfoResp.record:type_name -> AddRechargeInfoResp.RecordEntry
7, // 1: AddRechargeReceiveResp.award:type_name -> UserAssets
7, // 2: AddRechargeReceiveAllResp.award:type_name -> UserAssets
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_addrecharge_addrecharge_msg_proto_init() }
@ -334,6 +429,30 @@ func file_addrecharge_addrecharge_msg_proto_init() {
return nil
}
}
file_addrecharge_addrecharge_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddRechargeReceiveAllReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_addrecharge_addrecharge_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddRechargeReceiveAllResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -341,7 +460,7 @@ func file_addrecharge_addrecharge_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_addrecharge_addrecharge_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumMessages: 7,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -32,9 +32,11 @@ type DBDreamWarorder struct {
Vip2 bool `protobuf:"varint,4,opt,name=vip2,proto3" json:"vip2"`
Exp int32 `protobuf:"varint,5,opt,name=exp,proto3" json:"exp"`
Lv int32 `protobuf:"varint,6,opt,name=lv,proto3" json:"lv"`
Daytasks []int32 `protobuf:"varint,7,rep,packed,name=daytasks,proto3" json:"daytasks"`
Weektasks []int32 `protobuf:"varint,8,rep,packed,name=weektasks,proto3" json:"weektasks"`
Completetasks []int32 `protobuf:"varint,9,rep,packed,name=completetasks,proto3" json:"completetasks"`
Daytime int64 `protobuf:"varint,7,opt,name=daytime,proto3" json:"daytime"`
Daytasks []int32 `protobuf:"varint,8,rep,packed,name=daytasks,proto3" json:"daytasks"`
Weektime int64 `protobuf:"varint,9,opt,name=weektime,proto3" json:"weektime"`
Weektasks []int32 `protobuf:"varint,10,rep,packed,name=weektasks,proto3" json:"weektasks"`
Completetasks []int32 `protobuf:"varint,11,rep,packed,name=completetasks,proto3" json:"completetasks"`
}
func (x *DBDreamWarorder) Reset() {
@ -111,6 +113,13 @@ func (x *DBDreamWarorder) GetLv() int32 {
return 0
}
func (x *DBDreamWarorder) GetDaytime() int64 {
if x != nil {
return x.Daytime
}
return 0
}
func (x *DBDreamWarorder) GetDaytasks() []int32 {
if x != nil {
return x.Daytasks
@ -118,6 +127,13 @@ func (x *DBDreamWarorder) GetDaytasks() []int32 {
return nil
}
func (x *DBDreamWarorder) GetWeektime() int64 {
if x != nil {
return x.Weektime
}
return 0
}
func (x *DBDreamWarorder) GetWeektasks() []int32 {
if x != nil {
return x.Weektasks
@ -137,7 +153,7 @@ var File_dreamwarorder_dreamwarorder_db_proto protoreflect.FileDescriptor
var file_dreamwarorder_dreamwarorder_db_proto_rawDesc = []byte{
0x0a, 0x24, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x61, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f,
0x64, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x61, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x64, 0x62,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdd, 0x01, 0x0a, 0x0f, 0x44, 0x42, 0x44, 0x72, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x02, 0x0a, 0x0f, 0x44, 0x42, 0x44, 0x72, 0x65,
0x61, 0x6d, 0x57, 0x61, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x72, 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, 0x12, 0x0a, 0x04,
@ -145,14 +161,17 @@ var file_dreamwarorder_dreamwarorder_db_proto_rawDesc = []byte{
0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x70, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04,
0x76, 0x69, 0x70, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28,
0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x06, 0x20, 0x01,
0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x79, 0x74, 0x61, 0x73,
0x6b, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x74, 0x61, 0x73,
0x6b, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x65, 0x65, 0x6b, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18,
0x08, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x77, 0x65, 0x65, 0x6b, 0x74, 0x61, 0x73, 0x6b, 0x73,
0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x74, 0x61, 0x73, 0x6b,
0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74,
0x65, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x61, 0x79, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x64, 0x61, 0x79, 0x74, 0x69, 0x6d, 0x65,
0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x08, 0x20, 0x03,
0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x1a, 0x0a, 0x08,
0x77, 0x65, 0x65, 0x6b, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
0x77, 0x65, 0x65, 0x6b, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x65, 0x65, 0x6b,
0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x77, 0x65, 0x65,
0x6b, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65,
0x74, 0x65, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0d, 0x63,
0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (