This commit is contained in:
liwei1dao 2022-12-15 14:03:21 +08:00
commit 39d46f3a01
27 changed files with 2684 additions and 311 deletions

File diff suppressed because it is too large Load Diff

View File

@ -20,9 +20,9 @@
} }
], ],
"privilege_id": [ "privilege_id": [
10001, 10101,
10002, 10201,
10003 10301
] ]
}, },
{ {
@ -46,9 +46,9 @@
} }
], ],
"privilege_id": [ "privilege_id": [
10004, 10401,
10005, 10501,
10006 10601
] ]
}, },
{ {
@ -59,8 +59,6 @@
"renew_day": 0, "renew_day": 0,
"day_reward": [], "day_reward": [],
"disposable_reward": [], "disposable_reward": [],
"privilege_id": [ "privilege_id": []
10007
]
} }
] ]

View File

@ -228,7 +228,7 @@ const ( //Rpc
Rpc_ModuleRtaskSendTask core.Rpc_Key = "Rpc_ModuleRtaskSendTask" //随机任务触发 Rpc_ModuleRtaskSendTask core.Rpc_Key = "Rpc_ModuleRtaskSendTask" //随机任务触发
// friend // friend
Rpc_ModuleFriendUseAssitHero core.Rpc_Key = "Rpc_ModuleFriendUseAssitHero" //使用助战英雄 Rpc_ModuleFriendUseAssitHero core.Rpc_Key = "Rpc_ModuleFriendUseAssitHero" //使用助战英雄
Rpc_ModuleFriendDB core.Rpc_Key = "Rpc_ModuleFriendDB"
// arena // arena
Rpc_ModuleArenaRaceSettlement core.Rpc_Key = "Rpc_ModuleArenaRaceSettlement" //竞技场比赛结算信息 Rpc_ModuleArenaRaceSettlement core.Rpc_Key = "Rpc_ModuleArenaRaceSettlement" //竞技场比赛结算信息
Rpc_ModuleArenaModifyIntegral core.Rpc_Key = "Rpc_ModuleArenaModifyIntegral" //竞技场修改积分 Rpc_ModuleArenaModifyIntegral core.Rpc_Key = "Rpc_ModuleArenaModifyIntegral" //竞技场修改积分
@ -260,9 +260,9 @@ const (
EventCreateUser core.Event_Key = "Event_CreateUser" //创建角色事件 EventCreateUser core.Event_Key = "Event_CreateUser" //创建角色事件
EventUserOffline core.Event_Key = "Event_UserOffline" //用户离线事件 EventUserOffline core.Event_Key = "Event_UserOffline" //用户离线事件
EventUserChanged core.Event_Key = "event_user_changed" //用户数据变化 EventUserChanged core.Event_Key = "event_user_changed" //用户数据变化
EventTaskChanged core.Event_Key = "event_task_changed" //任务数据变化 EventTaskChanged core.Event_Key = "event_task_changed" //任务数据变化
EventUserVipChanged core.Event_Key = "event_uservip_changed" //用户数据变化
EventSociatyRankChanged core.Event_Key = "event_sociatyRank_changed" //公会数据变化 EventSociatyRankChanged core.Event_Key = "event_sociatyRank_changed" //公会数据变化
) )
@ -645,3 +645,17 @@ const (
Arena = "arena" Arena = "arena"
Sign = "sign" Sign = "sign"
) )
// 特权类型
const (
PrivilegeType1 = iota + 1 //每日获得
PrivilegeType2 //金币商店每日免费刷新次数
PrivilegeType3 //维京远征每日可购买挑战次数
PrivilegeType4 //狩猎每日可购买挑战次数
PrivilegeType5 //竞技场每日可购买挑战次数
PrivilegeType6 //梦境每日可购买挑战次数
PrivilegeType7 //巨怪商队背包容量
PrivilegeType8 //美食馆每日最大制作时间
PrivilegeType9 //武馆每日最大练功时间
PrivilegeType10 //铁匠铺每日最大锻造时间
)

View File

@ -104,6 +104,7 @@ type (
AddAttributeValues(session IUserSession, attrs map[string]int32, bPush bool) (code pb.ErrorCode) AddAttributeValues(session IUserSession, attrs map[string]int32, bPush bool) (code pb.ErrorCode)
//用户改变事件 //用户改变事件
EventUserChanged(session IUserSession) EventUserChanged(session IUserSession)
EventUserVipChanged(session IUserSession)
//获取用户expand //获取用户expand
GetUserExpand(uid string) (result *pb.DBUserExpand, err error) GetUserExpand(uid string) (result *pb.DBUserExpand, err error)
//更新用户expand //更新用户expand
@ -118,6 +119,8 @@ type (
CrossSearchUser(nickname string) ([]*pb.DBUser, error) CrossSearchUser(nickname string) ([]*pb.DBUser, error)
// 搜索远程用户 // 搜索远程用户
SearchRmoteUser(nickname string) ([]*pb.DBUser, error) SearchRmoteUser(nickname string) ([]*pb.DBUser, error)
// 检查是不是新获得的英雄
CheckTujianHero(session IUserSession, heros []string) []bool
} }
//武器模块 //武器模块
IEquipment interface { IEquipment interface {
@ -279,10 +282,14 @@ type (
CreatePrivilegeCard(session IUserSession, cId string) (code pb.ErrorCode) CreatePrivilegeCard(session IUserSession, cId string) (code pb.ErrorCode)
// 续费特权卡 // 续费特权卡
RenewPrivilegeCard(session IUserSession, cId string) (code pb.ErrorCode) RenewPrivilegeCard(session IUserSession, cId string) (code pb.ErrorCode)
// 检查特权 // 检查特权 参数 计费点 返回值 是否有特权
CheckPrivilege(session IUserSession, cId string) (privilege *pb.DBPrivilege) CheckPrivilege(session IUserSession, cId string) bool
// 查询玩家当前所有特权 返回特权id // 检查每日特权邮件
QueryPrivilege(session IUserSession) (privilegeID []int32) CheckDailyPrivilegeMail(session IUserSession)
// 获得vip
AddVipData(session IUserSession, oldVip, newVip int32)
// 查询所有特权 key 对应comm.PrivilegeType1类型
CheckAllPrivilege(session IUserSession) map[int32]*pb.PrivilegeList
} }
//武馆 //武馆
IMartialhall interface { IMartialhall interface {

View File

@ -69,6 +69,9 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c
//将目标加入到自己的好友列表中 //将目标加入到自己的好友列表中
for _, userId := range agreeIds { for _, userId := range agreeIds {
//将目标从申请列表中删除
self.ApplyIds = utils.DeleteString(self.ApplyIds, userId)
if _, ok := utils.Find(self.FriendIds, userId); !ok { if _, ok := utils.Find(self.FriendIds, userId); !ok {
if self.FriendIds == nil { if self.FriendIds == nil {
self.FriendIds = []string{} self.FriendIds = []string{}
@ -82,6 +85,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c
code = pb.ErrorCode_FriendTargetNoData code = pb.ErrorCode_FriendTargetNoData
return return
} }
target.ApplyIds = utils.DeleteString(target.ApplyIds, self.Uid)
if _, ok := utils.Find(target.FriendIds, self.Uid); !ok { if _, ok := utils.Find(target.FriendIds, self.Uid); !ok {
if target.FriendIds == nil { if target.FriendIds == nil {
target.FriendIds = []string{} target.FriendIds = []string{}
@ -106,19 +110,19 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c
pushAssistHero(self.Uid, target.Uid, self.AssistHeroId) pushAssistHero(self.Uid, target.Uid, self.AssistHeroId)
} }
//将目标从申请列表中删除
self.ApplyIds = utils.DeleteString(self.ApplyIds, userId)
optNum++ optNum++
} }
//更新 if optNum > 0 {
err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{ //更新
"applyIds": self.ApplyIds, err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
"friendIds": self.FriendIds, "applyIds": self.ApplyIds,
}) "friendIds": self.FriendIds,
if err != nil { })
code = pb.ErrorCode_DBError if err != nil {
return code = pb.ErrorCode_DBError
return
}
} }
// 拥有xx个好友 // 拥有xx个好友

View File

@ -31,6 +31,13 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
) )
uid := session.GetUserId() uid := session.GetUserId()
//判断是否是自己
if req.FriendId == uid {
code = pb.ErrorCode_FriendNotSelf
return
}
//获取玩家自己好友数据 //获取玩家自己好友数据
self = this.moduleFriend.modelFriend.GetFriend(uid) self = this.moduleFriend.modelFriend.GetFriend(uid)
if self == nil { if self == nil {
@ -38,6 +45,19 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
return return
} }
globalConf := this.moduleFriend.globalConf
//判断是否超过最大好友数量
if len(self.FriendIds) >= int(globalConf.FriendMaxnum) {
code = pb.ErrorCode_FriendSelfMax
return
}
//判断是否是好友
if _, ok := utils.Find(self.FriendIds, req.FriendId); ok {
code = pb.ErrorCode_FriendYet
return
}
//获取好友数据 //获取好友数据
target = this.moduleFriend.modelFriend.GetFriend(req.FriendId) target = this.moduleFriend.modelFriend.GetFriend(req.FriendId)
if target == nil { if target == nil {
@ -45,15 +65,9 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
return return
} }
//判断是否是自己 //判断自己是否在目标用户的申请列表中
if req.FriendId == uid { if _, ok := utils.Find(target.ApplyIds, self.Uid); ok {
code = pb.ErrorCode_FriendNotSelf code = pb.ErrorCode_FriendApplyYet
return
}
globalConf := this.moduleFriend.globalConf
//判断是否超过最大好友数量
if len(self.FriendIds) >= int(globalConf.FriendMaxnum) {
code = pb.ErrorCode_FriendSelfMax
return return
} }
@ -63,18 +77,6 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
return return
} }
//判断是否是好友
if _, ok := utils.Find(self.FriendIds, req.FriendId); ok {
code = pb.ErrorCode_FriendYet
return
}
//判断自己是否在目标用户的申请列表中
if _, ok := utils.Find(target.ApplyIds, self.Uid); ok {
code = pb.ErrorCode_FriendApplyYet
return
}
//判断目标用户是否在黑名单中 //判断目标用户是否在黑名单中
if _, ok := utils.Find(self.BlackIds, req.FriendId); ok { if _, ok := utils.Find(self.BlackIds, req.FriendId); ok {
code = pb.ErrorCode_FriendSelfBlackYet code = pb.ErrorCode_FriendSelfBlackYet

View File

@ -1,6 +1,7 @@
package friend package friend
import ( import (
"context"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
@ -14,12 +15,13 @@ import (
type ModelFriend struct { type ModelFriend struct {
modules.MCompModel modules.MCompModel
moduleFriend *Friend
} }
func (this *ModelFriend) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { func (this *ModelFriend) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.TableName = comm.TableFriend this.TableName = comm.TableFriend
err = this.MCompModel.Init(service, module, comp, options) err = this.MCompModel.Init(service, module, comp, options)
this.moduleFriend = module.(*Friend)
return return
} }
@ -38,14 +40,28 @@ func (this *ModelFriend) Frined_FindCond(nickName string) *pb.DBUser {
//查询好友 //查询好友
func (this *ModelFriend) GetFriend(uid string) *pb.DBFriend { func (this *ModelFriend) GetFriend(uid string) *pb.DBFriend {
friend := &pb.DBFriend{Uid: uid} friend := &pb.DBFriend{Uid: uid}
err := this.Get(uid, friend) if this.moduleFriend.IsCross() {
if err != nil { err := this.Get(uid, friend)
if err == redis.RedisNil || err == mongo.ErrNoDocuments { if err != nil {
if err := this.Add(uid, friend); err != nil { if err == redis.RedisNil || err == mongo.ErrNoDocuments {
return nil if err := this.Add(uid, friend); err != nil {
return nil
}
} }
log.Error("未获得好友数据", log.Fields{"uid": uid})
}
} else {
friend := &pb.DBFriend{}
if err := this.moduleFriend.service.AcrossClusterRpcCall(
context.Background(),
this.moduleFriend.GetCrossTag(),
comm.Service_Worker,
string(comm.Rpc_ModuleFriendDB),
pb.RPCGeneralReqA1{Param1: uid},
friend); err != nil {
this.moduleFriend.Errorln(err)
} }
log.Error("未获得好友数据", log.Fields{"uid": uid})
} }
return friend return friend
} }

View File

@ -15,10 +15,12 @@ import (
"go_dreamfactory/lego/base" "go_dreamfactory/lego/base"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/lego/sys/redis"
cfg "go_dreamfactory/sys/configure/structs" cfg "go_dreamfactory/sys/configure/structs"
"github.com/spf13/cast" "github.com/spf13/cast"
"go.mongodb.org/mongo-driver/mongo"
) )
var _ comm.IFriend = (*Friend)(nil) var _ comm.IFriend = (*Friend)(nil)
@ -56,6 +58,7 @@ func (this *Friend) OnInstallComp() {
func (this *Friend) Start() (err error) { func (this *Friend) Start() (err error) {
err = this.ModuleBase.Start() err = this.ModuleBase.Start()
this.service.RegisterFunctionName(string(comm.Rpc_ModuleFriendUseAssitHero), this.RpcUseAssisHero) this.service.RegisterFunctionName(string(comm.Rpc_ModuleFriendUseAssitHero), this.RpcUseAssisHero)
this.service.RegisterFunctionName(string(comm.Rpc_ModuleFriendDB), this.RpcFriendDB)
this.globalConf = this.configure.GetGlobalConf() this.globalConf = this.configure.GetGlobalConf()
if this.globalConf == nil { if this.globalConf == nil {
err = errors.New("global config not found") err = errors.New("global config not found")
@ -109,6 +112,23 @@ func (this *Friend) RpcUseAssisHero(ctx context.Context, req *pb.RPCGeneralReqA2
return nil return nil
} }
func (this *Friend) RpcFriendDB(ctx context.Context, req *pb.RPCGeneralReqA1, reply *pb.DBFriend) error {
this.Debug("Rpc_ModuleFriendDB", log.Fields{"req": req})
friend := &pb.DBFriend{Uid: req.Param1}
err := this.modelFriend.Get(req.Param1, friend)
if err != nil {
if err == redis.RedisNil || err == mongo.ErrNoDocuments {
if err := this.modelFriend.Add(req.Param1, friend); err != nil {
return nil
}
} else {
log.Error("未获得好友数据", log.Fields{"uid": req.Param1, "err": err})
}
}
*reply = *friend
return nil
}
// 使用好友助战英雄 // 使用好友助战英雄
// friendId 好友Id // friendId 好友Id
func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) { func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) {

View File

@ -30,6 +30,7 @@ import (
15bingo:sociatyexp,100 // 设置工会经验 15bingo:sociatyexp,100 // 设置工会经验
15bingo:sociatyactivity,100 // 设置工会活跃 15bingo:sociatyactivity,100 // 设置工会活跃
16bingo:alltask // bingo所有任务 16bingo:alltask // bingo所有任务
16bingo:allhero // bingo所有英雄
*/ */
//参数校验 //参数校验
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode) { func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode) {

View File

@ -266,6 +266,25 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
} }
} }
} else if len(datas) == 1 && (datas[0] == "allhero") { // 完成所有世界任务
var (
res []*cfg.Gameatn
)
data := this.configure.GetHeroConfigData()
for _, v := range data {
res = append(res, &cfg.Gameatn{
A: "hero",
T: v.Hid,
N: 1,
})
}
code = this.DispenseRes(session, res, true)
if code != pb.ErrorCode_Success {
this.Errorf("资源发放失败,%v", code)
}
this.Debug("使用bingo命令", log.Fields{"uid": session.GetUserId(), "param": datas[0], "res": res})
} }
} }

View File

@ -70,7 +70,19 @@ func GetMonthStartEnd() (int64, int64) {
return _d1, _d2 return _d1, _d2
} }
func Test_Main(t *testing.T) { func Test_Main(t *testing.T) {
var list []int32
var list2 []int32
list = []int32{1, 2, 3, 4, 5, 6, 7, 8, 9}
list2 = []int32{4, 8, 9}
for _, v := range list2 {
for i, v1 := range list {
if v == v1 { // 找到了 就删除
//conf.PrivilegeId = append(conf.PrivilegeId, v1)
list = append(list[:i], list[i+1:]...)
break
}
}
}
ids := utils.RandomNumbers(0, 10, 5) ids := utils.RandomNumbers(0, 10, 5)
for _, v := range ids { for _, v := range ids {
fmt.Printf("%d", v) fmt.Printf("%d", v)

View File

@ -38,9 +38,7 @@ func (this *apiComp) WarOrder(session comm.IUserSession, req *pb.PagodaWarOrderR
payPoint := this.module.configure.GetPassCheckPointByTtype(1) payPoint := this.module.configure.GetPassCheckPointByTtype(1)
if payPoint != "" { if payPoint != "" {
// 获取特权信息 // 获取特权信息
if privilege := this.module.ModulePrivilege.CheckPrivilege(session, payPoint); privilege != nil { vip = this.module.ModulePrivilege.CheckPrivilege(session, payPoint)
vip = true
}
} }
if list.PagodaId < list.PassCheckID { // 层数校验 if list.PagodaId < list.PassCheckID { // 层数校验

View File

@ -10,6 +10,7 @@ const (
PrivilegeGetListResp = "getlist" PrivilegeGetListResp = "getlist"
PrivilegeBuyYuekaResp = "buyyueka" PrivilegeBuyYuekaResp = "buyyueka"
PrivilegeBuyGiftResp = "buygift" PrivilegeBuyGiftResp = "buygift"
PrivilegeVipListResp = "viplist"
) )
type apiComp struct { type apiComp struct {

View File

@ -24,7 +24,7 @@ func (this *apiComp) BuyGift(session comm.IUserSession, req *pb.PrivilegeBuyGift
} }
userinfo := this.module.ModuleUser.GetUser(session.GetUserId()) userinfo := this.module.ModuleUser.GetUser(session.GetUserId())
if userinfo.Viplv == 0 || userinfo.Viplv < req.VipLv { if userinfo.Vip == 0 || userinfo.Vip < req.VipLv {
code = pb.ErrorCode_VipLvError // vip 等级不足 code = pb.ErrorCode_VipLvError // vip 等级不足
return return
} }

View File

@ -0,0 +1,24 @@
package privilege
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) VipListCheck(session comm.IUserSession, req *pb.PrivilegeVipListReq) (code pb.ErrorCode) {
return
}
///获取特权列表
func (this *apiComp) VipList(session comm.IUserSession, req *pb.PrivilegeVipListReq) (code pb.ErrorCode, data proto.Message) {
list, err := this.module.modelVip.getVipList(session.GetUserId())
if err != nil {
this.module.Errorf("can't get privilege list :%v", err)
}
session.SendMsg(string(this.module.GetType()), PrivilegeVipListResp, &pb.PrivilegeVipListResp{Data: list})
return
}

View File

@ -47,20 +47,15 @@ func (this *configureComp) GetPrivilegeCard(id string) (configure *cfg.GamePrivi
} }
// 获取指定特权配置 // 获取指定特权配置
func (this *configureComp) GetPrivilegeData(id int32) (result *cfg.GamePrivilegeData, err error) { func (this *configureComp) GetPrivilegeData(id int32) (result *cfg.GamePrivilegeData) {
var (
v interface{} if v, err := this.GetConfigure(game_privilege); err == nil {
ok bool
) if c, ok := v.(*cfg.GamePrivilege); ok {
if v, err = this.GetConfigure(game_privilege); err != nil { result = c.Get(id)
this.module.Errorf("err:%v", err)
return
} else {
if result, ok = v.(*cfg.GamePrivilege).GetDataMap()[id]; !ok {
err = fmt.Errorf("GamePrivilegeData not found:%d ", id)
this.module.Errorf("err:%v", err)
return return
} }
} }
return this.module.Errorf("GetPrivilegeData err, id:%d", id)
return nil
} }

View File

@ -3,7 +3,6 @@ package privilege
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
@ -31,11 +30,10 @@ func (this *ModelVip) Init(service core.IService, module core.IModule, comp core
// 获取vip信息 // 获取vip信息
func (this *ModelVip) getVipList(uid string) (vip *pb.DBVip, err error) { func (this *ModelVip) getVipList(uid string) (vip *pb.DBVip, err error) {
vip = &pb.DBVip{} vip = &pb.DBVip{}
if err = this.Get(uid, vip); err != nil && err != mgo.MongodbNil { if err = this.Get(uid, vip); err != nil {
return return
} }
err = nil return
return vip, err
} }
// 修改Vip信息 // 修改Vip信息
@ -48,7 +46,8 @@ func (this *ModelVip) addVipData(uId string, vip *pb.DBVip) (err error) {
if err = this.Add(uId, vip); err != nil { if err = this.Add(uId, vip); err != nil {
this.module.Errorf("err:%v", err) this.module.Errorf("err:%v", err)
return err return
} }
return nil
return
} }

View File

@ -4,10 +4,10 @@ import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/event" "go_dreamfactory/lego/sys/event"
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/configure" "go_dreamfactory/sys/configure"
"go_dreamfactory/sys/db"
"go_dreamfactory/utils" "go_dreamfactory/utils"
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
@ -46,6 +46,7 @@ func (this *Privilege) OnInstallComp() {
this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp) this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelPrivilege = this.RegisterComp(new(ModelPrivilege)).(*ModelPrivilege) this.modelPrivilege = this.RegisterComp(new(ModelPrivilege)).(*ModelPrivilege)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp) this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
this.modelVip = this.RegisterComp(new(ModelVip)).(*ModelVip)
} }
func (this *Privilege) Start() (err error) { func (this *Privilege) Start() (err error) {
@ -61,7 +62,7 @@ func (this *Privilege) Start() (err error) {
//Event------------------------------------------------------------------------------------------------------------ //Event------------------------------------------------------------------------------------------------------------
func (this *Privilege) EventUserOffline(session comm.IUserSession) { func (this *Privilege) EventUserOffline(session comm.IUserSession) {
this.modelPrivilege.DelByUId(session.GetUserId(), db.SetDBMgoLog(false)) //this.modelPrivilege.DelByUId(session.GetUserId(), db.SetDBMgoLog(false))
} }
// 购买了一个新的特权 // 购买了一个新的特权
@ -82,20 +83,23 @@ func (this *Privilege) CreatePrivilegeCard(session comm.IUserSession, cId string
} }
for _, v := range list { for _, v := range list {
if v.CId == cId { if v.CId == cId {
update := map[string]interface{}{}
if v.ETime > configure.Now().Unix() { // 加时间 if v.ETime > configure.Now().Unix() { // 加时间
v.ETime += int64(conf.AssertDay) * 24 * 3600
} else {
// 检测能否续费 // 检测能否续费
if configure.Now().Unix()-v.ETime <= int64(conf.RenewDay)*24*3600 { if v.ETime-configure.Now().Unix() > int64(conf.RenewDay)*24*3600 {
v.ETime = configure.Now().Unix() + int64(conf.AssertDay)*24*3600
} else {
code = pb.ErrorCode_PayRenewTimeErr code = pb.ErrorCode_PayRenewTimeErr
return return
} }
v.ETime += int64(conf.AssertDay) * 24 * 3600
update["eTime"] = v.ETime
} else { // 过期了
v.CTime = configure.Now().Unix()
v.ETime = v.CTime + int64(conf.AssertDay)*24*3600
update["cTime"] = v.CTime
update["eTime"] = v.ETime
} }
if err = this.modelPrivilege.Change(session.GetUserId(), map[string]interface{}{ if err = this.modelPrivilege.Change(session.GetUserId(), update); err != nil {
"eTime": v.ETime,
}); err != nil {
this.Errorf("err:%v", err) this.Errorf("err:%v", err)
return return
} }
@ -103,31 +107,69 @@ func (this *Privilege) CreatePrivilegeCard(session comm.IUserSession, cId string
break break
} }
} }
if !bFind { if !bFind { // 创建一条新的信息
data := &pb.DBPrivilege{ data := &pb.DBPrivilege{
Id: primitive.NewObjectID().Hex(), Id: primitive.NewObjectID().Hex(),
Uid: session.GetUserId(), Uid: session.GetUserId(),
CId: cId, CId: cId,
PrivilegeID: []int32{}, CTime: configure.Now().Unix(),
CTime: configure.Now().Unix(), ETime: configure.Now().Unix() + int64(conf.AssertDay*24*3600), // 设置过期时间
ETime: 0, RewardTime: configure.Now().Unix(),
RewardTime: configure.Now().Unix(),
} }
data.ETime = configure.Now().Unix() + int64(conf.AssertDay*24*3600) // 设置过期时间 // 特权插入
for _, v := range conf.PrivilegeId { vip, err := this.modelVip.getVipList(session.GetUserId())
data.PrivilegeID = append(data.PrivilegeID, v) if err != nil && err == mgo.MongodbNil { // 没有数据 直接创建一条
vip = &pb.DBVip{
Id: primitive.NewObjectID().Hex(),
Uid: session.GetUserId(),
Reward: map[int32]bool{},
Privilege: map[int32]*pb.PrivilegeList{},
CTime: configure.Now().Unix(),
RewardTime: 0,
}
if err = this.modelVip.addVipData(session.GetUserId(), vip); err != nil {
this.Errorf("err:%v", err)
return
}
}
if vip.Id != "" {
update := map[string]interface{}{}
for _, v := range conf.PrivilegeId {
conf := this.configure.GetPrivilegeData(v)
if conf != nil {
if _, ok := vip.Privilege[conf.PrivilegeType]; ok {
// 过滤重复的特权
bRepeat := false
for _, v1 := range vip.Privilege[conf.PrivilegeType].PrivilegeID {
if v1 == v {
bRepeat = true
break
}
}
if !bRepeat {
vip.Privilege[conf.PrivilegeType].PrivilegeID = append(vip.Privilege[conf.PrivilegeType].PrivilegeID, v)
}
} else {
sz := &pb.PrivilegeList{}
sz.PrivilegeID = append(sz.PrivilegeID, v)
vip.Privilege[conf.PrivilegeType] = sz
}
}
}
update["privilege"] = vip.Privilege
this.modelVip.modifyVipData(session.GetUserId(), update)
} }
list = append(list, data) list = append(list, data)
this.modelPrivilege.addNewPrivilegeData(session.GetUserId(), data) this.modelPrivilege.addNewPrivilegeData(session.GetUserId(), data)
this.SendDailyMail(session, cId, 1, conf.PType) this.SendDailyMail(session, cId, 1, conf.PType)
} }
// 即使奖励 马上发送
if code = this.DispenseRes(session, conf.DisposableReward, true); code != pb.ErrorCode_Success { if code = this.DispenseRes(session, conf.DisposableReward, true); code != pb.ErrorCode_Success {
return return
} }
// 推送 // 推送
session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeGetListResp{Data: list}) session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeBuyYuekaResp{Data: list})
return return
} }
@ -166,44 +208,58 @@ func (this *Privilege) RenewPrivilegeCard(session comm.IUserSession, cId string)
} }
// 查询特权特权 // 查询特权特权
func (this *Privilege) CheckPrivilege(session comm.IUserSession, cId string) (privilege *pb.DBPrivilege) { func (this *Privilege) CheckPrivilege(session comm.IUserSession, cId string) bool {
list, err := this.modelPrivilege.getPrivilegeList(session.GetUserId()) list, err := this.modelPrivilege.getPrivilegeList(session.GetUserId())
if err != nil { if err != nil {
return return false
} }
for _, v := range list { for _, v := range list {
if v.CId == cId { if v.CId == cId {
if v.ETime < configure.Now().Unix() { // 判断当前特权是否过期 if v.ETime < configure.Now().Unix() { // 判断当前特权是否过期
if err := this.modelPrivilege.DelListlds(session.GetUserId(), v.Id); err != nil { return false
this.Errorf("delete privilege failed:%v", err)
}
privilege = nil
return
} }
privilege = v return true
return
} }
} }
return return false
} }
// 查询特权信息,把过期的特权清除掉 // 检查特权 并发送每日邮件
func (this *Privilege) QueryPrivilege(session comm.IUserSession) (privilegeID []int32) { func (this *Privilege) CheckDailyPrivilegeMail(session comm.IUserSession) {
privilgeList, err := this.modelVip.getVipList(session.GetUserId())
if err != nil {
return
}
list, err := this.modelPrivilege.getPrivilegeList(session.GetUserId()) list, err := this.modelPrivilege.getPrivilegeList(session.GetUserId())
if err != nil { if err != nil {
return return
} }
for _, v := range list { for _, v := range list {
conf, err := this.configure.GetPrivilegeCard(v.CId)
if err != nil {
return
}
if v.ETime < configure.Now().Unix() { // 判断当前特权是否过期 if v.ETime < configure.Now().Unix() { // 判断当前特权是否过期
if err := this.modelPrivilege.DelListlds(session.GetUserId(), v.Id); err != nil {
this.Errorf("delete privilege failed:%v", err) update := map[string]interface{}{}
for _, id := range conf.PrivilegeId { // 找到过期的特权 并删除
data := this.configure.GetPrivilegeData(id)
if data != nil {
if v, ok := privilgeList.Privilege[data.PrivilegeType]; ok {
for i, v1 := range v.PrivilegeID {
if v1 == id { // 找到了 就删除
v.PrivilegeID = append(v.PrivilegeID[:i], v.PrivilegeID[i+1:]...)
break
}
}
}
}
} }
update["privilege"] = privilgeList.Privilege
this.modelVip.modifyVipData(session.GetUserId(), update) // 更新数据
} else { } else {
conf, err := this.configure.GetPrivilegeCard(v.CId)
if err != nil {
return nil
}
privilegeID = append(privilegeID, v.PrivilegeID...)
// 检查 每日奖励是否发放 // 检查 每日奖励是否发放
if !utils.IsToday(v.RewardTime) { if !utils.IsToday(v.RewardTime) {
v.RewardTime = configure.Now().Unix() v.RewardTime = configure.Now().Unix()
@ -259,5 +315,55 @@ func (this *Privilege) SendDailyMail(session comm.IUserSession, cId string, coun
mail.ObjId = primitive.NewObjectID().Hex() mail.ObjId = primitive.NewObjectID().Hex()
this.mail.CreateNewMail(session, mail) this.mail.CreateNewMail(session, mail)
} }
}
func (this *Privilege) CheckAllPrivilege(session comm.IUserSession) map[int32]*pb.PrivilegeList {
vip, err := this.modelVip.getVipList(session.GetUserId())
if err != nil {
return make(map[int32]*pb.PrivilegeList)
}
return vip.Privilege
}
func (this *Privilege) AddVipData(session comm.IUserSession, oldVip, newVip int32) {
if newVip <= oldVip {
return
}
vip, err := this.modelVip.getVipList(session.GetUserId())
if err != nil && err == mgo.MongodbNil { // 没有数据 直接创建一条
vip = &pb.DBVip{
Id: primitive.NewObjectID().Hex(),
Uid: session.GetUserId(),
Reward: map[int32]bool{},
Privilege: map[int32]*pb.PrivilegeList{},
CTime: configure.Now().Unix(),
RewardTime: 0,
}
if err = this.modelVip.addVipData(session.GetUserId(), vip); err != nil {
this.Errorf("err:%v", err)
return
}
}
update := map[string]interface{}{}
for i := oldVip + 1; i <= newVip; i++ {
conf := this.configure.GetVipConfigureData(i)
if conf != nil {
for _, v := range conf.VipPrivilege {
data := this.configure.GetPrivilegeData(v)
if data != nil {
if _, ok := vip.Privilege[data.PrivilegeType]; ok {
vip.Privilege[data.PrivilegeType].PrivilegeID = append(vip.Privilege[data.PrivilegeType].PrivilegeID, v)
} else {
sz := &pb.PrivilegeList{}
sz.PrivilegeID = append(sz.PrivilegeID, v)
vip.Privilege[data.PrivilegeType] = sz
}
}
}
}
}
update["privilege"] = vip.Privilege
this.modelVip.modifyVipData(session.GetUserId(), update)
session.SendMsg(string(this.GetType()), PrivilegeGetListResp, &pb.PrivilegeVipListResp{Data: vip})
} }

View File

@ -103,9 +103,5 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
return return
} }
// 监听玩家经验
//this.moduleTask.ModuleUser.EventUserChanged(session)
return return
} }

View File

@ -148,8 +148,7 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
// 日常登录任务 // 日常登录任务
this.module.ModuleRtask.SendToRtask(session, comm.Rtype7, 1) this.module.ModuleRtask.SendToRtask(session, comm.Rtype7, 1)
// 检查特权 并发送每日邮件 this.module.ModulePrivilege.CheckDailyPrivilegeMail(session)
this.module.ModulePrivilege.QueryPrivilege(session)
//推送登录公告 //推送登录公告
if this.module.modelUser.isLoginFirst(lastLoginTime) { if this.module.modelUser.isLoginFirst(lastLoginTime) {
this.chat.SendSysChatToUser(session, comm.ChatSystem2, 0, 0) this.chat.SendSysChatToUser(session, comm.ChatSystem2, 0, 0)

View File

@ -31,7 +31,7 @@ func (this *ModelUser) Init(service core.IService, module core.IModule, comp cor
err = this.MCompModel.Init(service, module, comp, options) err = this.MCompModel.Init(service, module, comp, options)
this.module = module.(*User) this.module = module.(*User)
this.EventApp = event_v2.NewApp() this.EventApp = event_v2.NewApp()
this.EventApp.Listen(comm.EventUserChanged, this.ChangeVipExp) this.EventApp.Listen(comm.EventUserVipChanged, this.ChangeVipExp)
this.EventApp.Listen(comm.EventUserChanged, this.ChangeLevel) this.EventApp.Listen(comm.EventUserChanged, this.ChangeLevel)
// 通过uid创建索引 // 通过uid创建索引
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
@ -61,7 +61,6 @@ func (this *ModelUser) NickNameIsExist(name string) bool {
if err == mongo.ErrNoDocuments { //无记录 if err == mongo.ErrNoDocuments { //无记录
return true return true
} }
} }
return false return false
} }
@ -76,7 +75,13 @@ func (this *ModelUser) User_Create(user *pb.DBUser) (err error) {
user.Lv = 1 //初始等级 user.Lv = 1 //初始等级
user.Ctime = now user.Ctime = now
user.Logintime = now user.Logintime = now
return this.Add(user.Uid, user) _, err = this.DB.InsertOne(comm.TableUser, user)
key := fmt.Sprintf("%s:%s", this.TableName, user.Uid)
if err = this.Redis.HMSet(key, user); err != nil {
this.module.Error("创建用户", log.Fields{"sid": user.Sid, "account": user.Binduid})
return
}
return
} }
//获取用户 //获取用户
@ -174,45 +179,51 @@ func (this *ModelUser) updateOfflineTime(uid string) {
func (this *ModelUser) ChangeVipExp(event interface{}, next func(event interface{})) { func (this *ModelUser) ChangeVipExp(event interface{}, next func(event interface{})) {
ul := event.(*UserListen) ul := event.(*UserListen)
var ( var (
curExp int32 curExp int64
bChange bool bChange bool
) )
vipExp := ul.vipexp vipExp := ul.vipexp
vipLv := ul.viplv vipLv := ul.viplv
conf := this.module.configure.GetVipConfigureData(vipLv) conf := this.module.configure.GetVipConfigureData(vipLv + 1)
curExp = conf.UpExp if conf == nil {
return
}
curExp = int64(conf.UpExp)
for vipExp >= curExp { for vipExp >= curExp {
vipLv++ vipLv++
vipExp -= curExp vipExp -= curExp
tmpConf := this.module.configure.GetVipConfigureData(vipLv) tmpConf := this.module.configure.GetVipConfigureData(vipLv + 1)
if tmpConf == nil { if tmpConf == nil {
vipLv-- vipLv--
vipExp += curExp vipExp += curExp
break break
} }
curExp = tmpConf.UpExp curExp = int64(tmpConf.UpExp)
bChange = true bChange = true
} }
if bChange { if bChange {
update := map[string]interface{}{ update := map[string]interface{}{
"viplv": vipLv, "vip": vipLv,
"vip": vipExp, "vipexp": vipExp,
} }
if err := this.module.modelUser.Change(ul.session.GetUserId(), update); err != nil { if err := this.module.modelUser.Change(ul.session.GetUserId(), update); err != nil {
this.module.Error("玩家Vip等级经验更新", log.Fields{"uid": ul.session.GetUserId(), "vipLv": vipLv, "vipExp": vipExp}) this.module.Error("玩家Vip等级经验更新", log.Fields{"uid": ul.session.GetUserId(), "vipLv": vipLv, "vipExp": vipExp})
return return
} }
if ul.viplv != vipLv { // 新获得了vip
this.module.ModulePrivilege.AddVipData(ul.session, ul.viplv, vipLv)
}
// 推送玩家vip 经验变化
ul.session.SendMsg(string(this.module.GetType()), UserSubTypeVipChangedPush,
&pb.UserVipChangedPush{
Uid: ul.session.GetUserId(),
VipExp: int64(vipExp),
VipLv: vipLv,
})
} }
// 推送玩家vip 经验变化 return
ul.session.SendMsg(string(this.module.GetType()), UserSubTypeVipChangedPush,
&pb.UserVipChangedPush{
Uid: ul.session.GetUserId(),
VipExp: int64(vipExp),
VipLv: vipLv,
})
next(ul)
} }
//change level //change level
@ -293,6 +304,6 @@ type UserListen struct {
exp int64 exp int64
lv int32 lv int32
name string name string
vipexp int32 vipexp int64
viplv int32 viplv int32
} }

View File

@ -404,14 +404,29 @@ func (this *User) AddAttributeValues(session comm.IUserSession, attrs map[string
if bPush { //推送玩家账号信息变化消息 if bPush { //推送玩家账号信息变化消息
session.SendMsg(string(this.GetType()), "reschanged", _change) session.SendMsg(string(this.GetType()), "reschanged", _change)
} }
if key == comm.ResExp || key == comm.VipExp { if key == comm.ResExp {
this.ModuleUser.EventUserChanged(session) this.ModuleUser.EventUserChanged(session)
} else if key == comm.VipExp {
this.ModuleUser.EventUserVipChanged(session)
} }
} }
return return
} }
// 用户事件变化
func (this *User) EventUserVipChanged(session comm.IUserSession) {
ul := new(UserListen)
user := this.GetUser(session.GetUserId())
if user != nil {
ul.session = session
ul.name = user.Name
ul.vipexp = user.Vipexp
ul.viplv = user.Vip
}
this.modelUser.EventApp.Dispatch(comm.EventUserVipChanged, ul)
}
// 用户事件变化 // 用户事件变化
func (this *User) EventUserChanged(session comm.IUserSession) { func (this *User) EventUserChanged(session comm.IUserSession) {
ul := new(UserListen) ul := new(UserListen)
@ -421,8 +436,6 @@ func (this *User) EventUserChanged(session comm.IUserSession) {
ul.exp = user.Exp ul.exp = user.Exp
ul.lv = user.Lv ul.lv = user.Lv
ul.name = user.Name ul.name = user.Name
ul.vipexp = user.Vip
ul.viplv = user.Viplv
} }
this.modelUser.EventApp.Dispatch(comm.EventUserChanged, ul) this.modelUser.EventApp.Dispatch(comm.EventUserChanged, ul)
} }
@ -549,3 +562,17 @@ func (this *User) RpcGetCrossUserSession(ctx context.Context, req *pb.UIdReq, re
func (this *User) RpcQueryUser(ctx context.Context, req *pb.NameReq, reply *pb.UserDataListResp) error { func (this *User) RpcQueryUser(ctx context.Context, req *pb.NameReq, reply *pb.UserDataListResp) error {
return this.queryUserFromRemoteDb(req.Name, reply) return this.queryUserFromRemoteDb(req.Name, reply)
} }
func (this *User) CheckTujianHero(session comm.IUserSession, heros []string) []bool {
sz := make([]bool, len(heros))
userEx, err := this.GetUserExpand(session.GetUserId())
if err != nil {
return sz
}
for i, heroid := range heros {
if _, ok := userEx.Tujian[heroid]; ok {
sz[i] = true
}
}
return sz
}

View File

@ -26,13 +26,12 @@ type DBPrivilege struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
CId string `protobuf:"bytes,3,opt,name=cId,proto3" json:"cId" bson:"cId"` //计费点数ID CId string `protobuf:"bytes,3,opt,name=cId,proto3" json:"cId" bson:"cId"` //计费点数ID
PrivilegeID []int32 `protobuf:"varint,4,rep,packed,name=privilegeID,proto3" json:"privilegeID" bson:"privilegeID"` //特权ID CTime int64 `protobuf:"varint,4,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` ////购买时间
CTime int64 `protobuf:"varint,5,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` ////购买时间 ETime int64 `protobuf:"varint,5,opt,name=eTime,proto3" json:"eTime" bson:"eTime"` ////到期时间
ETime int64 `protobuf:"varint,6,opt,name=eTime,proto3" json:"eTime" bson:"eTime"` ////到期时间 RewardTime int64 `protobuf:"varint,6,opt,name=rewardTime,proto3" json:"rewardTime" bson:"rewardTime"` //每日奖励时间
RewardTime int64 `protobuf:"varint,7,opt,name=rewardTime,proto3" json:"rewardTime" bson:"rewardTime"` //每日奖励时间
} }
func (x *DBPrivilege) Reset() { func (x *DBPrivilege) Reset() {
@ -88,13 +87,6 @@ func (x *DBPrivilege) GetCId() string {
return "" return ""
} }
func (x *DBPrivilege) GetPrivilegeID() []int32 {
if x != nil {
return x.PrivilegeID
}
return nil
}
func (x *DBPrivilege) GetCTime() int64 { func (x *DBPrivilege) GetCTime() int64 {
if x != nil { if x != nil {
return x.CTime return x.CTime
@ -116,23 +108,70 @@ func (x *DBPrivilege) GetRewardTime() int64 {
return 0 return 0
} }
type PrivilegeList struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
PrivilegeID []int32 `protobuf:"varint,1,rep,packed,name=privilegeID,proto3" json:"privilegeID" bson:"privilegeID"` //特权ID
}
func (x *PrivilegeList) Reset() {
*x = PrivilegeList{}
if protoimpl.UnsafeEnabled {
mi := &file_privilege_privilege_db_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PrivilegeList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PrivilegeList) ProtoMessage() {}
func (x *PrivilegeList) ProtoReflect() protoreflect.Message {
mi := &file_privilege_privilege_db_proto_msgTypes[1]
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 PrivilegeList.ProtoReflect.Descriptor instead.
func (*PrivilegeList) Descriptor() ([]byte, []int) {
return file_privilege_privilege_db_proto_rawDescGZIP(), []int{1}
}
func (x *PrivilegeList) GetPrivilegeID() []int32 {
if x != nil {
return x.PrivilegeID
}
return nil
}
type DBVip struct { type DBVip struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
Reward map[int32]bool `protobuf:"bytes,3,rep,name=reward,proto3" json:"reward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` Reward map[int32]bool `protobuf:"bytes,3,rep,name=reward,proto3" json:"reward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key vip 等级
PrivilegeID []int32 `protobuf:"varint,4,rep,packed,name=privilegeID,proto3" json:"privilegeID" bson:"privilegeID"` //特权ID Privilege map[int32]*PrivilegeList `protobuf:"bytes,4,rep,name=privilege,proto3" json:"privilege" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" bson:"privilege"` //特权ID
CTime int64 `protobuf:"varint,5,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` ////购买时间 CTime int64 `protobuf:"varint,5,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` ////购买时间
RewardTime int64 `protobuf:"varint,6,opt,name=rewardTime,proto3" json:"rewardTime" bson:"rewardTime"` //每日奖励时间 RewardTime int64 `protobuf:"varint,6,opt,name=rewardTime,proto3" json:"rewardTime" bson:"rewardTime"` //每日奖励时间
} }
func (x *DBVip) Reset() { func (x *DBVip) Reset() {
*x = DBVip{} *x = DBVip{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_privilege_privilege_db_proto_msgTypes[1] mi := &file_privilege_privilege_db_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -145,7 +184,7 @@ func (x *DBVip) String() string {
func (*DBVip) ProtoMessage() {} func (*DBVip) ProtoMessage() {}
func (x *DBVip) ProtoReflect() protoreflect.Message { func (x *DBVip) ProtoReflect() protoreflect.Message {
mi := &file_privilege_privilege_db_proto_msgTypes[1] mi := &file_privilege_privilege_db_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -158,7 +197,7 @@ func (x *DBVip) ProtoReflect() protoreflect.Message {
// Deprecated: Use DBVip.ProtoReflect.Descriptor instead. // Deprecated: Use DBVip.ProtoReflect.Descriptor instead.
func (*DBVip) Descriptor() ([]byte, []int) { func (*DBVip) Descriptor() ([]byte, []int) {
return file_privilege_privilege_db_proto_rawDescGZIP(), []int{1} return file_privilege_privilege_db_proto_rawDescGZIP(), []int{2}
} }
func (x *DBVip) GetId() string { func (x *DBVip) GetId() string {
@ -182,9 +221,9 @@ func (x *DBVip) GetReward() map[int32]bool {
return nil return nil
} }
func (x *DBVip) GetPrivilegeID() []int32 { func (x *DBVip) GetPrivilege() map[int32]*PrivilegeList {
if x != nil { if x != nil {
return x.PrivilegeID return x.Privilege
} }
return nil return nil
} }
@ -207,34 +246,41 @@ var File_privilege_privilege_db_proto protoreflect.FileDescriptor
var file_privilege_privilege_db_proto_rawDesc = []byte{ var file_privilege_privilege_db_proto_rawDesc = []byte{
0x0a, 0x1c, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x0a, 0x1c, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x2f, 0x70, 0x72, 0x69, 0x76,
0x69, 0x6c, 0x65, 0x67, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d,
0x01, 0x0a, 0x0b, 0x44, 0x42, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x0e, 0x01, 0x0a, 0x0b, 0x44, 0x42, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 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, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64,
0x12, 0x10, 0x0a, 0x03, 0x63, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63,
0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x49, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x44, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x54, 0x69, 0x6d,
0x67, 0x65, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e,
0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x54, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01,
0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x31,
0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x0a, 0x0d, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12,
0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x49, 0x44, 0x18, 0x01,
0x22, 0xe8, 0x01, 0x0a, 0x05, 0x44, 0x42, 0x56, 0x69, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x49,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x44, 0x22, 0xc9, 0x02, 0x0a, 0x05, 0x44, 0x42, 0x56, 0x69, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75,
0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x44, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2a, 0x0a,
0x42, 0x56, 0x69, 0x70, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e,
0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x44, 0x42, 0x56, 0x69, 0x70, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72,
0x69, 0x6c, 0x65, 0x67, 0x65, 0x49, 0x44, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x79, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x33, 0x0a, 0x09, 0x70, 0x72, 0x69,
0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x54, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44,
0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x56, 0x69, 0x70, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x45, 0x6e,
0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x74, 0x72, 0x79, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x14,
0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x0a, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63,
0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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, 0x1a,
0x4c, 0x0a, 0x0e, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x72,
0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
0x6b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x4c, 0x69,
0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -249,19 +295,23 @@ func file_privilege_privilege_db_proto_rawDescGZIP() []byte {
return file_privilege_privilege_db_proto_rawDescData return file_privilege_privilege_db_proto_rawDescData
} }
var file_privilege_privilege_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_privilege_privilege_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_privilege_privilege_db_proto_goTypes = []interface{}{ var file_privilege_privilege_db_proto_goTypes = []interface{}{
(*DBPrivilege)(nil), // 0: DBPrivilege (*DBPrivilege)(nil), // 0: DBPrivilege
(*DBVip)(nil), // 1: DBVip (*PrivilegeList)(nil), // 1: PrivilegeList
nil, // 2: DBVip.RewardEntry (*DBVip)(nil), // 2: DBVip
nil, // 3: DBVip.RewardEntry
nil, // 4: DBVip.PrivilegeEntry
} }
var file_privilege_privilege_db_proto_depIdxs = []int32{ var file_privilege_privilege_db_proto_depIdxs = []int32{
2, // 0: DBVip.reward:type_name -> DBVip.RewardEntry 3, // 0: DBVip.reward:type_name -> DBVip.RewardEntry
1, // [1:1] is the sub-list for method output_type 4, // 1: DBVip.privilege:type_name -> DBVip.PrivilegeEntry
1, // [1:1] is the sub-list for method input_type 1, // 2: DBVip.PrivilegeEntry.value:type_name -> PrivilegeList
1, // [1:1] is the sub-list for extension type_name 3, // [3:3] is the sub-list for method output_type
1, // [1:1] is the sub-list for extension extendee 3, // [3:3] is the sub-list for method input_type
0, // [0:1] is the sub-list for field type_name 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_privilege_privilege_db_proto_init() } func init() { file_privilege_privilege_db_proto_init() }
@ -283,6 +333,18 @@ func file_privilege_privilege_db_proto_init() {
} }
} }
file_privilege_privilege_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_privilege_privilege_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PrivilegeList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_privilege_privilege_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBVip); i { switch v := v.(*DBVip); i {
case 0: case 0:
return &v.state return &v.state
@ -301,7 +363,7 @@ func file_privilege_privilege_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_privilege_privilege_db_proto_rawDesc, RawDescriptor: file_privilege_privilege_db_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 3, NumMessages: 5,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -296,6 +296,91 @@ func (x *PrivilegeBuyGiftResp) GetData() *DBVip {
return nil return nil
} }
type PrivilegeVipListReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *PrivilegeVipListReq) Reset() {
*x = PrivilegeVipListReq{}
if protoimpl.UnsafeEnabled {
mi := &file_privilege_privilege_msg_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PrivilegeVipListReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PrivilegeVipListReq) ProtoMessage() {}
func (x *PrivilegeVipListReq) ProtoReflect() protoreflect.Message {
mi := &file_privilege_privilege_msg_proto_msgTypes[6]
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 PrivilegeVipListReq.ProtoReflect.Descriptor instead.
func (*PrivilegeVipListReq) Descriptor() ([]byte, []int) {
return file_privilege_privilege_msg_proto_rawDescGZIP(), []int{6}
}
type PrivilegeVipListResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *DBVip `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *PrivilegeVipListResp) Reset() {
*x = PrivilegeVipListResp{}
if protoimpl.UnsafeEnabled {
mi := &file_privilege_privilege_msg_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PrivilegeVipListResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PrivilegeVipListResp) ProtoMessage() {}
func (x *PrivilegeVipListResp) ProtoReflect() protoreflect.Message {
mi := &file_privilege_privilege_msg_proto_msgTypes[7]
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 PrivilegeVipListResp.ProtoReflect.Descriptor instead.
func (*PrivilegeVipListResp) Descriptor() ([]byte, []int) {
return file_privilege_privilege_msg_proto_rawDescGZIP(), []int{7}
}
func (x *PrivilegeVipListResp) GetData() *DBVip {
if x != nil {
return x.Data
}
return nil
}
var File_privilege_privilege_msg_proto protoreflect.FileDescriptor var File_privilege_privilege_msg_proto protoreflect.FileDescriptor
var file_privilege_privilege_msg_proto_rawDesc = []byte{ var file_privilege_privilege_msg_proto_rawDesc = []byte{
@ -320,8 +405,12 @@ var file_privilege_privilege_msg_proto_rawDesc = []byte{
0x22, 0x32, 0x0a, 0x14, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x42, 0x75, 0x79, 0x22, 0x32, 0x0a, 0x14, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x42, 0x75, 0x79,
0x47, 0x69, 0x66, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x47, 0x69, 0x66, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x70, 0x52, 0x04, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x70, 0x52, 0x04,
0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x64, 0x61, 0x74, 0x61, 0x22, 0x15, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67,
0x6f, 0x74, 0x6f, 0x33, 0x65, 0x56, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x32, 0x0a, 0x14, 0x50,
0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x56, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52,
0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x06, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x70, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -336,7 +425,7 @@ func file_privilege_privilege_msg_proto_rawDescGZIP() []byte {
return file_privilege_privilege_msg_proto_rawDescData return file_privilege_privilege_msg_proto_rawDescData
} }
var file_privilege_privilege_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_privilege_privilege_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_privilege_privilege_msg_proto_goTypes = []interface{}{ var file_privilege_privilege_msg_proto_goTypes = []interface{}{
(*PrivilegeGetListReq)(nil), // 0: PrivilegeGetListReq (*PrivilegeGetListReq)(nil), // 0: PrivilegeGetListReq
(*PrivilegeGetListResp)(nil), // 1: PrivilegeGetListResp (*PrivilegeGetListResp)(nil), // 1: PrivilegeGetListResp
@ -344,18 +433,21 @@ var file_privilege_privilege_msg_proto_goTypes = []interface{}{
(*PrivilegeBuyYuekaResp)(nil), // 3: PrivilegeBuyYuekaResp (*PrivilegeBuyYuekaResp)(nil), // 3: PrivilegeBuyYuekaResp
(*PrivilegeBuyGiftReq)(nil), // 4: PrivilegeBuyGiftReq (*PrivilegeBuyGiftReq)(nil), // 4: PrivilegeBuyGiftReq
(*PrivilegeBuyGiftResp)(nil), // 5: PrivilegeBuyGiftResp (*PrivilegeBuyGiftResp)(nil), // 5: PrivilegeBuyGiftResp
(*DBPrivilege)(nil), // 6: DBPrivilege (*PrivilegeVipListReq)(nil), // 6: PrivilegeVipListReq
(*DBVip)(nil), // 7: DBVip (*PrivilegeVipListResp)(nil), // 7: PrivilegeVipListResp
(*DBPrivilege)(nil), // 8: DBPrivilege
(*DBVip)(nil), // 9: DBVip
} }
var file_privilege_privilege_msg_proto_depIdxs = []int32{ var file_privilege_privilege_msg_proto_depIdxs = []int32{
6, // 0: PrivilegeGetListResp.data:type_name -> DBPrivilege 8, // 0: PrivilegeGetListResp.data:type_name -> DBPrivilege
6, // 1: PrivilegeBuyYuekaResp.data:type_name -> DBPrivilege 8, // 1: PrivilegeBuyYuekaResp.data:type_name -> DBPrivilege
7, // 2: PrivilegeBuyGiftResp.data:type_name -> DBVip 9, // 2: PrivilegeBuyGiftResp.data:type_name -> DBVip
3, // [3:3] is the sub-list for method output_type 9, // 3: PrivilegeVipListResp.data:type_name -> DBVip
3, // [3:3] is the sub-list for method input_type 4, // [4:4] is the sub-list for method output_type
3, // [3:3] is the sub-list for extension type_name 4, // [4:4] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension extendee 4, // [4:4] is the sub-list for extension type_name
0, // [0:3] is the sub-list for field type_name 4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
} }
func init() { file_privilege_privilege_msg_proto_init() } func init() { file_privilege_privilege_msg_proto_init() }
@ -437,6 +529,30 @@ func file_privilege_privilege_msg_proto_init() {
return nil return nil
} }
} }
file_privilege_privilege_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PrivilegeVipListReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_privilege_privilege_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PrivilegeVipListResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -444,7 +560,7 @@ func file_privilege_privilege_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_privilege_privilege_msg_proto_rawDesc, RawDescriptor: file_privilege_privilege_msg_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 6, NumMessages: 8,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -122,13 +122,12 @@ type DBUser struct {
Starcoin int64 `protobuf:"varint,16,opt,name=starcoin,proto3" json:"starcoin" bson:"starcoin"` //星座图币 Starcoin int64 `protobuf:"varint,16,opt,name=starcoin,proto3" json:"starcoin" bson:"starcoin"` //星座图币
Created bool `protobuf:"varint,17,opt,name=created,proto3" json:"created" bson:"created"` //创角 Created bool `protobuf:"varint,17,opt,name=created,proto3" json:"created" bson:"created"` //创角
Lv int32 `protobuf:"varint,18,opt,name=lv,proto3" json:"lv" bson:"lv"` //等级 Lv int32 `protobuf:"varint,18,opt,name=lv,proto3" json:"lv" bson:"lv"` //等级
Vip int32 `protobuf:"varint,19,opt,name=vip,proto3" json:"vip" bson:"vip"` // vip Vip int32 `protobuf:"varint,19,opt,name=vip,proto3" json:"vip" bson:"vip"` // vip等级
Diamond int64 `protobuf:"varint,20,opt,name=diamond,proto3" json:"diamond" bson:"diamond"` // 钻石 Diamond int64 `protobuf:"varint,20,opt,name=diamond,proto3" json:"diamond" bson:"diamond"` // 钻石
Title int32 `protobuf:"varint,21,opt,name=title,proto3" json:"title" bson:"title"` //头衔 Title int32 `protobuf:"varint,21,opt,name=title,proto3" json:"title" bson:"title"` //头衔
Offlinetime int64 `protobuf:"varint,22,opt,name=offlinetime,proto3" json:"offlinetime" bson:"offlinetime"` //离线时间 Offlinetime int64 `protobuf:"varint,22,opt,name=offlinetime,proto3" json:"offlinetime" bson:"offlinetime"` //离线时间
Figure int32 `protobuf:"varint,23,opt,name=figure,proto3" json:"figure" bson:"figure"` //主角形象 Figure int32 `protobuf:"varint,23,opt,name=figure,proto3" json:"figure" bson:"figure"` //主角形象
Bgp string `protobuf:"bytes,24,opt,name=bgp,proto3" json:"bgp" bson:"bgp"` //背景 Bgp string `protobuf:"bytes,24,opt,name=bgp,proto3" json:"bgp" bson:"bgp"` //背景
Viplv int32 `protobuf:"varint,25,opt,name=viplv,proto3" json:"viplv" bson:"viplv"` // vip等级
} }
func (x *DBUser) Reset() { func (x *DBUser) Reset() {
@ -331,13 +330,6 @@ func (x *DBUser) GetBgp() string {
return "" return ""
} }
func (x *DBUser) GetViplv() int32 {
if x != nil {
return x.Viplv
}
return 0
}
type DBUserSetting struct { type DBUserSetting struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -590,7 +582,7 @@ var file_user_user_db_proto_rawDesc = []byte{
0x61, 0x67, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x61, 0x67, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x61, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x61,
0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x0e, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0xc8, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0xb2,
0x04, 0x0a, 0x06, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x0a, 0x06, 0x44, 0x42, 0x55, 0x73, 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, 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, 0x75, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75,
@ -626,40 +618,39 @@ var file_user_user_db_proto_rawDesc = []byte{
0x66, 0x6c, 0x69, 0x6e, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x67,
0x75, 0x72, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x75, 0x72, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72,
0x65, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x67, 0x70, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x67, 0x70, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x62, 0x67, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x69, 0x70, 0x6c, 0x76, 0x18, 0x19, 0x20, 0x01, 0x62, 0x67, 0x70, 0x22, 0xc7, 0x02, 0x0a, 0x0d, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
0x28, 0x05, 0x52, 0x05, 0x76, 0x69, 0x70, 0x6c, 0x76, 0x22, 0xc7, 0x02, 0x0a, 0x0d, 0x44, 0x42, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x12,
0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x1c, 0x0a, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x18, 0x04, 0x20, 0x01,
0x75, 0x61, 0x7a, 0x68, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x28, 0x0d, 0x52, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x12, 0x1a, 0x0a,
0x68, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52,
0x63, 0x68, 0x69, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x18, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x75, 0x6c,
0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x12, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x12, 0x14, 0x0a,
0x12, 0x0a, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x77, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x75,
0x75, 0x6c, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x07, 0x20, 0x01, 0x73, 0x69, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20,
0x28, 0x08, 0x52, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x66, 0x66, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67,
0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x75, 0x61, 0x6a, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x67, 0x75, 0x61, 0x6a,
0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08,
0x52, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x52, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75,
0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x12,
0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x74, 0x18, 0x0a, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08,
0x61, 0x6e, 0x73, 0x75, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x52, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x78, 0x75, 0x61,
0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x12, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x78, 0x75,
0x1c, 0x0a, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69,
0x28, 0x08, 0x52, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x22, 0xa2, 0x01,
0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x61, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x69, 0x6a, 0x69, 0x22, 0xa2, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69,
0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x69,
0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x43, 0x6f,
0x28, 0x03, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x43,
0x73, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x05, 0x20,
0x09, 0x73, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69,
0x6f, 0x75, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05,
0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x54, 0x69,
0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x03, 0x52, 0x05, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x6f, 0x33,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@ -63,7 +63,7 @@ func Dispose(ctx context.Context, concurrency, totalNumber uint64, request *mode
// 并发建立长链接 // 并发建立长链接
go func(i uint64) { go func(i uint64) {
r := robot.NewRobot(request.URL) r := robot.NewRobot(request.URL)
r.SetAccount("c71112" + strconv.Itoa(int(i))) r.SetAccount("d71112" + strconv.Itoa(int(i)))
//head := &pb.UserMessage{MainType: "user", SubType: "login"} //head := &pb.UserMessage{MainType: "user", SubType: "login"}
// 先登录 // 先登录

View File

@ -12,8 +12,10 @@ import "errors"
type GamePrivilegeData struct { type GamePrivilegeData struct {
PrivilegeId int32 PrivilegeId int32
PrivilegeType int32
PrivilegeDescribeFront string PrivilegeDescribeFront string
PrivilegeDescribeAfter string PrivilegeDescribeAfter string
PrivilegeParameter int32
} }
const TypeId_GamePrivilegeData = 40320255 const TypeId_GamePrivilegeData = 40320255
@ -24,8 +26,10 @@ func (*GamePrivilegeData) GetTypeId() int32 {
func (_v *GamePrivilegeData)Deserialize(_buf map[string]interface{}) (err error) { func (_v *GamePrivilegeData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["privilege_id"].(float64); !_ok_ { err = errors.New("privilege_id error"); return }; _v.PrivilegeId = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["privilege_id"].(float64); !_ok_ { err = errors.New("privilege_id error"); return }; _v.PrivilegeId = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["privilege_type"].(float64); !_ok_ { err = errors.New("privilege_type error"); return }; _v.PrivilegeType = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["privilege_DescribeFront"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.PrivilegeDescribeFront error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.PrivilegeDescribeFront, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["privilege_DescribeFront"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.PrivilegeDescribeFront error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.PrivilegeDescribeFront, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["privilege_DescribeAfter"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.PrivilegeDescribeAfter error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.PrivilegeDescribeAfter, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["privilege_DescribeAfter"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.PrivilegeDescribeAfter error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.PrivilegeDescribeAfter, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["privilege_parameter"].(float64); !_ok_ { err = errors.New("privilege_parameter error"); return }; _v.PrivilegeParameter = int32(_tempNum_) }
return return
} }