签到额外奖励,存储提示次数

This commit is contained in:
meixiongfeng 2023-03-31 14:30:47 +08:00
parent fe3cc724ab
commit 233c0f5f70
12 changed files with 1655 additions and 1281 deletions

View File

@ -1047,7 +1047,7 @@
{
"id": 56,
"day": 25,
"group": 1,
"group": 2,
"loopgift": [
{
"a": "hero",
@ -1066,7 +1066,7 @@
{
"id": 57,
"day": 26,
"group": 1,
"group": 2,
"loopgift": [
{
"a": "hero",
@ -1085,7 +1085,7 @@
{
"id": 58,
"day": 27,
"group": 1,
"group": 2,
"loopgift": [
{
"a": "hero",
@ -1104,7 +1104,7 @@
{
"id": 59,
"day": 28,
"group": 1,
"group": 2,
"loopgift": [
{
"a": "hero",
@ -1123,7 +1123,7 @@
{
"id": 60,
"day": 29,
"group": 1,
"group": 2,
"loopgift": [
{
"a": "hero",
@ -1142,7 +1142,7 @@
{
"id": 61,
"day": 30,
"group": 1,
"group": 2,
"loopgift": [
{
"a": "hero",
@ -1161,7 +1161,7 @@
{
"id": 62,
"day": 31,
"group": 1,
"group": 2,
"loopgift": [
{
"a": "hero",
@ -1655,7 +1655,7 @@
{
"id": 88,
"day": 26,
"group": 1,
"group": 3,
"loopgift": [
{
"a": "hero",
@ -1674,7 +1674,7 @@
{
"id": 89,
"day": 27,
"group": 1,
"group": 3,
"loopgift": [
{
"a": "hero",
@ -1693,7 +1693,7 @@
{
"id": 90,
"day": 28,
"group": 1,
"group": 3,
"loopgift": [
{
"a": "hero",
@ -1712,7 +1712,7 @@
{
"id": 91,
"day": 29,
"group": 1,
"group": 3,
"loopgift": [
{
"a": "hero",
@ -1731,7 +1731,7 @@
{
"id": 92,
"day": 30,
"group": 1,
"group": 3,
"loopgift": [
{
"a": "hero",
@ -1750,7 +1750,7 @@
{
"id": 93,
"day": 31,
"group": 1,
"group": 3,
"loopgift": [
{
"a": "hero",

View File

@ -0,0 +1,110 @@
[
{
"id": 1,
"day": 7,
"groups": 1,
"extra": [
{
"a": "item",
"t": "90001",
"n": 10
}
]
},
{
"id": 2,
"day": 14,
"groups": 1,
"extra": [
{
"a": "item",
"t": "90002",
"n": 10
}
]
},
{
"id": 3,
"day": 21,
"groups": 1,
"extra": [
{
"a": "item",
"t": "90003",
"n": 10
}
]
},
{
"id": 4,
"day": 7,
"groups": 2,
"extra": [
{
"a": "item",
"t": "90001",
"n": 10
}
]
},
{
"id": 5,
"day": 14,
"groups": 2,
"extra": [
{
"a": "item",
"t": "90002",
"n": 10
}
]
},
{
"id": 6,
"day": 21,
"groups": 2,
"extra": [
{
"a": "item",
"t": "90003",
"n": 10
}
]
},
{
"id": 7,
"day": 7,
"groups": 3,
"extra": [
{
"a": "item",
"t": "90001",
"n": 10
}
]
},
{
"id": 8,
"day": 14,
"groups": 3,
"extra": [
{
"a": "item",
"t": "90002",
"n": 10
}
]
},
{
"id": 9,
"day": 21,
"groups": 3,
"extra": [
{
"a": "item",
"t": "90003",
"n": 10
}
]
}
]

View File

@ -0,0 +1,33 @@
package user
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) ChangeTipsCheck(session comm.IUserSession, req *pb.UserChangeTipsReq) (code pb.ErrorCode) {
return
}
//修改提示次数
func (this *apiComp) ChangeTips(session comm.IUserSession, req *pb.UserChangeTipsReq) (code pb.ErrorCode, data proto.Message) {
update := make(map[string]interface{}, 0)
if sign, err := this.module.modelSign.GetUserSign(session.GetUserId()); err == nil {
sign.Tips = req.Tips
update["tips"] = sign.Tips
this.module.modelSign.Change(session.GetUserId(), update)
session.SendMsg(string(this.module.GetType()), "changetips", &pb.UserChangeTipsReq{
Tips: req.Tips,
})
}
return
}

View File

@ -24,14 +24,14 @@ func (this *apiComp) PuzzleAward(session comm.IUserSession, req *pb.UserPuzzleAw
code = pb.ErrorCode_DBError
return
}
if sign.Puzzle[req.Index] != 0 {
if sign.Puzzle[req.Index] != 1 {
code = pb.ErrorCode_ReqParameterError
return
}
if code = this.module.DispenseRes(session, this.module.globalConf.UnifiedReward, true); code != pb.ErrorCode_Success {
return
}
sign.Puzzle[req.Index] = 1
sign.Puzzle[req.Index] = 2
if err = this.module.modelSign.Change(session.GetUserId(), map[string]interface{}{
"puzzle": sign.Puzzle,
}); err != nil {

View File

@ -11,9 +11,7 @@ import (
//参数校验
func (this *apiComp) SignCheck(session comm.IUserSession, req *pb.UserSignReq) (code pb.ErrorCode) {
if req.SignType != 1 && req.SignType != 2 { // 签到参数校验
return pb.ErrorCode_ReqParameterError
}
return
}
@ -21,64 +19,56 @@ func (this *apiComp) SignCheck(session comm.IUserSession, req *pb.UserSignReq) (
func (this *apiComp) Sign(session comm.IUserSession, req *pb.UserSignReq) (code pb.ErrorCode, data proto.Message) {
var (
update map[string]interface{}
update map[string]interface{}
lastSignTime int64 // 上次签到时间
)
if code = this.module.ModuleSys.IsAccess(comm.Sign, session.GetUserId()); code != pb.ErrorCode_Success {
return
}
update = make(map[string]interface{}, 0)
if sign, err := this.module.modelSign.GetUserSign(session.GetUserId()); err == nil {
// 获取当前是第几天
lastSignTime = sign.SignTime
sign.SignTime = configure.Now().Unix()
iDay := (configure.Now().Unix() - sign.SignTime) / (24 * 3600)
start, _ := utils.GetMonthStartEnd()
if sign.SignTime < start { // 重置
sign.SignTime = configure.Now().Unix()
sign.SignCount = 1
if newGroup := this.module.configure.GetSignResetConf(sign.Group + 1); newGroup != -1 { // 获取当前的组id
sign.Day = 1
sign.Group = newGroup
update["day"] = sign.Day
sign.SignCount = 1
update["group"] = newGroup
}
update["signTime"] = sign.SignTime
update["signCount"] = sign.SignCount
sign.Puzzle = make([]int32, 31)
sign.Puzzle[0] = 1
update["puzzle"] = sign.Puzzle
this.module.modelSign.Change(session.GetUserId(), update)
} else {
// 获取当前是第几天
iDay := (configure.Now().Unix() - sign.SignTime) / (24 * 3600)
if req.SignType == 1 && sign.Puzzle[iDay] != 0 {
code = pb.ErrorCode_UserSign
return
}
if req.SignType == 2 && sign.Puzzle[iDay] != 1 {
if sign.Puzzle[iDay] != 0 {
code = pb.ErrorCode_UserSign
return
}
sign.Day = int32(iDay)
if utils.IsYestoday(sign.SignTime) {
if utils.IsYestoday(lastSignTime) {
sign.SignCount += 1
} else {
sign.SignCount = 1
}
sign.SignTime = configure.Now().Unix()
update["signTime"] = sign.SignTime
update["signCount"] = sign.SignCount
update["day"] = sign.Day
sign.Puzzle[iDay] = req.SignType
update["puzzle"] = sign.Puzzle
this.module.modelSign.Change(session.GetUserId(), update)
}
sign.Day = int32(iDay)
sign.Puzzle[iDay] = 1
update["signTime"] = sign.SignTime
update["signCount"] = sign.SignCount
update["day"] = sign.Day
update["puzzle"] = sign.Puzzle
this.module.modelSign.Change(session.GetUserId(), update)
_data := this.module.configure.GetSignConf(sign.Day, sign.Group)
if _data != nil { // 发奖
if req.SignType == 1 {
this.module.DispenseRes(session, _data.Loopgift, true) // 签到奖励
} else {
this.module.DispenseRes(session, _data.Gamegift, true) // 小游戏奖励
}
this.module.DispenseRes(session, _data.Loopgift, true) // 签到奖励
// 额外奖励
if conf := this.module.configure.GetSignExtarConf(sign.SignCount, sign.Group); conf != nil {
this.module.DispenseRes(session, conf.Extra, true) // 签到额外奖励
}
}
session.SendMsg(string(this.module.GetType()), "sign", &pb.UserSignResp{
Data: sign,

View File

@ -14,13 +14,15 @@ const (
game_signreset = "game_signreset.json"
game_sign = "game_sign.json"
gameOpencond = "game_opencond.json"
game_SignExtra = "game_signextra.json"
)
///配置管理基础组件
type configureComp struct {
hlock sync.RWMutex
modules.MCompConfigure
_sign map[int32]*cfg.GameSignData
_sign map[int32]*cfg.GameSignData
_signExtra map[int32]*cfg.GameSignExtraData
}
//组件初始化接口
@ -30,12 +32,13 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
this._sign = make(map[int32]*cfg.GameSignData, 0)
configure.RegisterConfigure(game_sign, cfg.NewGameSign, this.LoadSignData)
this.LoadConfigure(gameOpencond, cfg.NewGameOpencond)
configure.RegisterConfigure(game_sign, cfg.NewGameSign, this.LoadSignExtraData)
return
}
// 获取签到信息
func (this *configureComp) GetSignConf(day, group int32) *cfg.GameSignData {
if v, ok := this._sign[day<<8+group]; ok {
if v, ok := this._sign[group<<8+day]; ok {
return v
}
return nil
@ -46,6 +49,9 @@ func (this *configureComp) GetSignResetConf(id int32) int32 {
if v, err := this.GetConfigure(game_signreset); err == nil {
if configure, ok := v.(*cfg.GameSignReset); ok {
if configure != nil {
if _, ok := configure.GetDataMap()[id]; !ok {
return configure.Get(1).Groups
}
return configure.Get(id).Groups
}
}
@ -58,7 +64,7 @@ func (this *configureComp) LoadSignData() {
this.hlock.Lock()
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
this._sign[value.Day<<8+value.Group] = value
this._sign[value.Group<<8+value.Day] = value
}
return
}
@ -79,7 +85,6 @@ func (this *configureComp) GetOpenCondList() []*cfg.GameOpencondData {
}
return data.GetDataList()
}
return nil
}
func (this *configureComp) FindFunc(lv int32) (funcIds []string) {
@ -102,3 +107,25 @@ func (this *configureComp) FindFunc(lv int32) (funcIds []string) {
}
return
}
func (this *configureComp) LoadSignExtraData() {
if v, err := this.GetConfigure(game_SignExtra); err == nil {
if configure, ok := v.(*cfg.GameSignExtra); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
this._signExtra[value.Groups<<8+value.Day] = value
}
return
}
} else {
log.Errorf("get SignExtra conf err:%v", err)
}
return
}
func (this *configureComp) GetSignExtarConf(day, group int32) *cfg.GameSignExtraData {
if v, ok := this._signExtra[group<<8+day]; ok {
return v
}
return nil
}

View File

@ -510,6 +510,7 @@ type DBSign struct {
Group int32 `protobuf:"varint,5,opt,name=group,proto3" json:"group"` //记录循环签到值
Day int32 `protobuf:"varint,6,opt,name=day,proto3" json:"day"` // 今天是这个月第几天
Puzzle []int32 `protobuf:"varint,7,rep,packed,name=puzzle,proto3" json:"puzzle" bson:"puzzle"` //拼图游戏完成情况 // 0 未签到 1 已签到 2 玩了游戏
Tips int32 `protobuf:"varint,8,opt,name=tips,proto3" json:"tips"` // 提示次数
}
func (x *DBSign) Reset() {
@ -593,6 +594,13 @@ func (x *DBSign) GetPuzzle() []int32 {
return nil
}
func (x *DBSign) GetTips() int32 {
if x != nil {
return x.Tips
}
return 0
}
var File_user_user_db_proto protoreflect.FileDescriptor
var file_user_user_db_proto_rawDesc = []byte{
@ -668,7 +676,7 @@ var file_user_user_db_proto_rawDesc = []byte{
0x67, 0x12, 0x1c, 0x0a, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x18, 0x0d,
0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x12,
0x14, 0x0a, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x73, 0x61, 0x69, 0x6a, 0x69, 0x22, 0xa4, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e,
0x73, 0x61, 0x69, 0x6a, 0x69, 0x22, 0xb8, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64,
0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75,
0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03,
@ -678,8 +686,9 @@ var file_user_user_db_proto_rawDesc = []byte{
0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f,
0x75, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52,
0x03, 0x64, 0x61, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x18, 0x07,
0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04,
0x74, 0x69, 0x70, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x69, 0x70, 0x73,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -2378,8 +2378,6 @@ type UserSignReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SignType int32 `protobuf:"varint,1,opt,name=signType,proto3" json:"signType"` // 1 签到 2 玩游戏
}
func (x *UserSignReq) Reset() {
@ -2414,13 +2412,6 @@ func (*UserSignReq) Descriptor() ([]byte, []int) {
return file_user_user_msg_proto_rawDescGZIP(), []int{46}
}
func (x *UserSignReq) GetSignType() int32 {
if x != nil {
return x.SignType
}
return 0
}
// 推送签到信息
type UserSignResp struct {
state protoimpl.MessageState
@ -2565,6 +2556,101 @@ func (x *UserPuzzleAwardResp) GetIndex() int32 {
return 0
}
// 修改提示次数
type UserChangeTipsReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Tips int32 `protobuf:"varint,1,opt,name=tips,proto3" json:"tips"`
}
func (x *UserChangeTipsReq) Reset() {
*x = UserChangeTipsReq{}
if protoimpl.UnsafeEnabled {
mi := &file_user_user_msg_proto_msgTypes[50]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserChangeTipsReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserChangeTipsReq) ProtoMessage() {}
func (x *UserChangeTipsReq) ProtoReflect() protoreflect.Message {
mi := &file_user_user_msg_proto_msgTypes[50]
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 UserChangeTipsReq.ProtoReflect.Descriptor instead.
func (*UserChangeTipsReq) Descriptor() ([]byte, []int) {
return file_user_user_msg_proto_rawDescGZIP(), []int{50}
}
func (x *UserChangeTipsReq) GetTips() int32 {
if x != nil {
return x.Tips
}
return 0
}
type UserChangeTipsResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *DBSign `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *UserChangeTipsResp) Reset() {
*x = UserChangeTipsResp{}
if protoimpl.UnsafeEnabled {
mi := &file_user_user_msg_proto_msgTypes[51]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserChangeTipsResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserChangeTipsResp) ProtoMessage() {}
func (x *UserChangeTipsResp) ProtoReflect() protoreflect.Message {
mi := &file_user_user_msg_proto_msgTypes[51]
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 UserChangeTipsResp.ProtoReflect.Descriptor instead.
func (*UserChangeTipsResp) Descriptor() ([]byte, []int) {
return file_user_user_msg_proto_rawDescGZIP(), []int{51}
}
func (x *UserChangeTipsResp) GetData() *DBSign {
if x != nil {
return x.Data
}
return nil
}
var File_user_user_msg_proto protoreflect.FileDescriptor
var file_user_user_msg_proto_rawDesc = []byte{
@ -2747,18 +2833,22 @@ var file_user_user_msg_proto_rawDesc = []byte{
0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61,
0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x44, 0x61, 0x74,
0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x29, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53,
0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x79,
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x79,
0x70, 0x65, 0x22, 0x2b, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x07, 0x2e, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
0x2a, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x41, 0x77, 0x61,
0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x2b, 0x0a, 0x13, 0x55,
0x73, 0x65, 0x72, 0x50, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65,
0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x0d, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53,
0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x2b, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x69,
0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x04, 0x64,
0x61, 0x74, 0x61, 0x22, 0x2a, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x7a, 0x7a, 0x6c,
0x65, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64,
0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22,
0x2b, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x41, 0x77, 0x61,
0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x27, 0x0a, 0x11,
0x55, 0x73, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x69, 0x70, 0x73, 0x52, 0x65,
0x71, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x70, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x04, 0x74, 0x69, 0x70, 0x73, 0x22, 0x31, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x43, 0x68, 0x61,
0x6e, 0x67, 0x65, 0x54, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x64,
0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x53, 0x69,
0x67, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
@ -2774,7 +2864,7 @@ func file_user_user_msg_proto_rawDescGZIP() []byte {
return file_user_user_msg_proto_rawDescData
}
var file_user_user_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 50)
var file_user_user_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 52)
var file_user_user_msg_proto_goTypes = []interface{}{
(*UserLoginReq)(nil), // 0: UserLoginReq
(*UserLoginResp)(nil), // 1: UserLoginResp
@ -2826,40 +2916,43 @@ var file_user_user_msg_proto_goTypes = []interface{}{
(*UserSignResp)(nil), // 47: UserSignResp
(*UserPuzzleAwardReq)(nil), // 48: UserPuzzleAwardReq
(*UserPuzzleAwardResp)(nil), // 49: UserPuzzleAwardResp
(*DBUser)(nil), // 50: DBUser
(*DBUserExpand)(nil), // 51: DBUserExpand
(ErrorCode)(0), // 52: ErrorCode
(*CacheUser)(nil), // 53: CacheUser
(*DBUserSetting)(nil), // 54: DBUserSetting
(*DBPagodaRecord)(nil), // 55: DBPagodaRecord
(*DBHuntingRank)(nil), // 56: DBHuntingRank
(*DBVikingRank)(nil), // 57: DBVikingRank
(*DBServerData)(nil), // 58: DBServerData
(*DBSign)(nil), // 59: DBSign
(*UserChangeTipsReq)(nil), // 50: UserChangeTipsReq
(*UserChangeTipsResp)(nil), // 51: UserChangeTipsResp
(*DBUser)(nil), // 52: DBUser
(*DBUserExpand)(nil), // 53: DBUserExpand
(ErrorCode)(0), // 54: ErrorCode
(*CacheUser)(nil), // 55: CacheUser
(*DBUserSetting)(nil), // 56: DBUserSetting
(*DBPagodaRecord)(nil), // 57: DBPagodaRecord
(*DBHuntingRank)(nil), // 58: DBHuntingRank
(*DBVikingRank)(nil), // 59: DBVikingRank
(*DBServerData)(nil), // 60: DBServerData
(*DBSign)(nil), // 61: DBSign
}
var file_user_user_msg_proto_depIdxs = []int32{
50, // 0: UserLoginResp.data:type_name -> DBUser
51, // 1: UserLoginResp.ex:type_name -> DBUserExpand
50, // 2: UserInfoResp.data:type_name -> DBUser
51, // 3: UserInfoResp.ex:type_name -> DBUserExpand
52, // 4: UserRegisterResp.Code:type_name -> ErrorCode
53, // 5: UserLoadResp.data:type_name -> CacheUser
54, // 6: UserGetSettingResp.setting:type_name -> DBUserSetting
54, // 7: UserUpdateSettingReq.setting:type_name -> DBUserSetting
50, // 8: UserBattlerecordResp.data:type_name -> DBUser
51, // 9: UserBattlerecordResp.ex:type_name -> DBUserExpand
55, // 10: UserBattlerecordResp.pagodaRecord:type_name -> DBPagodaRecord
56, // 11: UserBattlerecordResp.huntingRecord:type_name -> DBHuntingRank
57, // 12: UserBattlerecordResp.vikingRecord:type_name -> DBVikingRank
53, // 13: UserOnlineResp.users:type_name -> CacheUser
50, // 14: UserDataListResp.users:type_name -> DBUser
58, // 15: UserGetServerDataResp.data:type_name -> DBServerData
59, // 16: UserSignResp.data:type_name -> DBSign
17, // [17:17] is the sub-list for method output_type
17, // [17:17] is the sub-list for method input_type
17, // [17:17] is the sub-list for extension type_name
17, // [17:17] is the sub-list for extension extendee
0, // [0:17] is the sub-list for field type_name
52, // 0: UserLoginResp.data:type_name -> DBUser
53, // 1: UserLoginResp.ex:type_name -> DBUserExpand
52, // 2: UserInfoResp.data:type_name -> DBUser
53, // 3: UserInfoResp.ex:type_name -> DBUserExpand
54, // 4: UserRegisterResp.Code:type_name -> ErrorCode
55, // 5: UserLoadResp.data:type_name -> CacheUser
56, // 6: UserGetSettingResp.setting:type_name -> DBUserSetting
56, // 7: UserUpdateSettingReq.setting:type_name -> DBUserSetting
52, // 8: UserBattlerecordResp.data:type_name -> DBUser
53, // 9: UserBattlerecordResp.ex:type_name -> DBUserExpand
57, // 10: UserBattlerecordResp.pagodaRecord:type_name -> DBPagodaRecord
58, // 11: UserBattlerecordResp.huntingRecord:type_name -> DBHuntingRank
59, // 12: UserBattlerecordResp.vikingRecord:type_name -> DBVikingRank
55, // 13: UserOnlineResp.users:type_name -> CacheUser
52, // 14: UserDataListResp.users:type_name -> DBUser
60, // 15: UserGetServerDataResp.data:type_name -> DBServerData
61, // 16: UserSignResp.data:type_name -> DBSign
61, // 17: UserChangeTipsResp.data:type_name -> DBSign
18, // [18:18] is the sub-list for method output_type
18, // [18:18] is the sub-list for method input_type
18, // [18:18] is the sub-list for extension type_name
18, // [18:18] is the sub-list for extension extendee
0, // [0:18] is the sub-list for field type_name
}
func init() { file_user_user_msg_proto_init() }
@ -3475,6 +3568,30 @@ func file_user_user_msg_proto_init() {
return nil
}
}
file_user_user_msg_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserChangeTipsReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_user_user_msg_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserChangeTipsResp); 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{
@ -3482,7 +3599,7 @@ func file_user_user_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_user_user_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 50,
NumMessages: 52,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -9,34 +9,26 @@
package cfg
type GameSign struct {
_dataMap map[int32]*GameSignData
_dataList []*GameSignData
}
func NewGameSign(_buf []map[string]interface{}) (*GameSign, error) {
_dataList := make([]*GameSignData, 0, len(_buf))
dataMap := make(map[int32]*GameSignData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameSignData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Id] = _v
}
}
return &GameSign{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameSign) GetDataMap() map[int32]*GameSignData {
return table._dataMap
return &GameSign{_dataList:_dataList}, nil
}
func (table *GameSign) GetDataList() []*GameSignData {
return table._dataList
}
func (table *GameSign) Get(key int32) *GameSignData {
return table._dataMap[key]
func (table *GameSign) Get(index int) *GameSignData {
return table._dataList[index]
}

View File

@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type GameSignExtra struct {
_dataList []*GameSignExtraData
}
func NewGameSignExtra(_buf []map[string]interface{}) (*GameSignExtra, error) {
_dataList := make([]*GameSignExtraData, 0, len(_buf))
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameSignExtraData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
}
}
return &GameSignExtra{_dataList:_dataList}, nil
}
func (table *GameSignExtra) GetDataList() []*GameSignExtraData {
return table._dataList
}
func (table *GameSignExtra) Get(index int) *GameSignExtraData {
return table._dataList[index]
}

View File

@ -0,0 +1,54 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type GameSignExtraData struct {
Id int32
Day int32
Groups int32
Extra []*Gameatn
}
const TypeId_GameSignExtraData = -308971103
func (*GameSignExtraData) GetTypeId() int32 {
return -308971103
}
func (_v *GameSignExtraData)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["day"].(float64); !_ok_ { err = errors.New("day error"); return }; _v.Day = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["groups"].(float64); !_ok_ { err = errors.New("groups error"); return }; _v.Groups = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["extra"].([]interface{}); !_ok_ { err = errors.New("extra error"); return }
_v.Extra = 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.Extra = append(_v.Extra, _list_v_)
}
}
return
}
func DeserializeGameSignExtraData(_buf map[string]interface{}) (*GameSignExtraData, error) {
v := &GameSignExtraData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

File diff suppressed because it is too large Load Diff