Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
39d46f3a01
File diff suppressed because it is too large
Load Diff
@ -20,9 +20,9 @@
|
||||
}
|
||||
],
|
||||
"privilege_id": [
|
||||
10001,
|
||||
10002,
|
||||
10003
|
||||
10101,
|
||||
10201,
|
||||
10301
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -46,9 +46,9 @@
|
||||
}
|
||||
],
|
||||
"privilege_id": [
|
||||
10004,
|
||||
10005,
|
||||
10006
|
||||
10401,
|
||||
10501,
|
||||
10601
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -59,8 +59,6 @@
|
||||
"renew_day": 0,
|
||||
"day_reward": [],
|
||||
"disposable_reward": [],
|
||||
"privilege_id": [
|
||||
10007
|
||||
]
|
||||
"privilege_id": []
|
||||
}
|
||||
]
|
@ -228,7 +228,7 @@ const ( //Rpc
|
||||
Rpc_ModuleRtaskSendTask core.Rpc_Key = "Rpc_ModuleRtaskSendTask" //随机任务触发
|
||||
// friend
|
||||
Rpc_ModuleFriendUseAssitHero core.Rpc_Key = "Rpc_ModuleFriendUseAssitHero" //使用助战英雄
|
||||
|
||||
Rpc_ModuleFriendDB core.Rpc_Key = "Rpc_ModuleFriendDB"
|
||||
// arena
|
||||
Rpc_ModuleArenaRaceSettlement core.Rpc_Key = "Rpc_ModuleArenaRaceSettlement" //竞技场比赛结算信息
|
||||
Rpc_ModuleArenaModifyIntegral core.Rpc_Key = "Rpc_ModuleArenaModifyIntegral" //竞技场修改积分
|
||||
@ -260,9 +260,9 @@ const (
|
||||
EventCreateUser core.Event_Key = "Event_CreateUser" //创建角色事件
|
||||
EventUserOffline core.Event_Key = "Event_UserOffline" //用户离线事件
|
||||
|
||||
EventUserChanged core.Event_Key = "event_user_changed" //用户数据变化
|
||||
EventTaskChanged core.Event_Key = "event_task_changed" //任务数据变化
|
||||
|
||||
EventUserChanged core.Event_Key = "event_user_changed" //用户数据变化
|
||||
EventTaskChanged core.Event_Key = "event_task_changed" //任务数据变化
|
||||
EventUserVipChanged core.Event_Key = "event_uservip_changed" //用户数据变化
|
||||
EventSociatyRankChanged core.Event_Key = "event_sociatyRank_changed" //公会数据变化
|
||||
)
|
||||
|
||||
@ -645,3 +645,17 @@ const (
|
||||
Arena = "arena"
|
||||
Sign = "sign"
|
||||
)
|
||||
|
||||
// 特权类型
|
||||
const (
|
||||
PrivilegeType1 = iota + 1 //每日获得
|
||||
PrivilegeType2 //金币商店每日免费刷新次数
|
||||
PrivilegeType3 //维京远征每日可购买挑战次数
|
||||
PrivilegeType4 //狩猎每日可购买挑战次数
|
||||
PrivilegeType5 //竞技场每日可购买挑战次数
|
||||
PrivilegeType6 //梦境每日可购买挑战次数
|
||||
PrivilegeType7 //巨怪商队背包容量
|
||||
PrivilegeType8 //美食馆每日最大制作时间
|
||||
PrivilegeType9 //武馆每日最大练功时间
|
||||
PrivilegeType10 //铁匠铺每日最大锻造时间
|
||||
)
|
||||
|
@ -104,6 +104,7 @@ type (
|
||||
AddAttributeValues(session IUserSession, attrs map[string]int32, bPush bool) (code pb.ErrorCode)
|
||||
//用户改变事件
|
||||
EventUserChanged(session IUserSession)
|
||||
EventUserVipChanged(session IUserSession)
|
||||
//获取用户expand
|
||||
GetUserExpand(uid string) (result *pb.DBUserExpand, err error)
|
||||
//更新用户expand
|
||||
@ -118,6 +119,8 @@ type (
|
||||
CrossSearchUser(nickname string) ([]*pb.DBUser, error)
|
||||
// 搜索远程用户
|
||||
SearchRmoteUser(nickname string) ([]*pb.DBUser, error)
|
||||
// 检查是不是新获得的英雄
|
||||
CheckTujianHero(session IUserSession, heros []string) []bool
|
||||
}
|
||||
//武器模块
|
||||
IEquipment interface {
|
||||
@ -279,10 +282,14 @@ type (
|
||||
CreatePrivilegeCard(session IUserSession, cId string) (code pb.ErrorCode)
|
||||
// 续费特权卡
|
||||
RenewPrivilegeCard(session IUserSession, cId string) (code pb.ErrorCode)
|
||||
// 检查特权
|
||||
CheckPrivilege(session IUserSession, cId string) (privilege *pb.DBPrivilege)
|
||||
// 查询玩家当前所有特权 返回特权id
|
||||
QueryPrivilege(session IUserSession) (privilegeID []int32)
|
||||
// 检查特权 参数 计费点 返回值 是否有特权
|
||||
CheckPrivilege(session IUserSession, cId string) bool
|
||||
// 检查每日特权邮件
|
||||
CheckDailyPrivilegeMail(session IUserSession)
|
||||
// 获得vip
|
||||
AddVipData(session IUserSession, oldVip, newVip int32)
|
||||
// 查询所有特权 key 对应comm.PrivilegeType1类型
|
||||
CheckAllPrivilege(session IUserSession) map[int32]*pb.PrivilegeList
|
||||
}
|
||||
//武馆
|
||||
IMartialhall interface {
|
||||
|
@ -69,6 +69,9 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c
|
||||
|
||||
//将目标加入到自己的好友列表中
|
||||
for _, userId := range agreeIds {
|
||||
//将目标从申请列表中删除
|
||||
self.ApplyIds = utils.DeleteString(self.ApplyIds, userId)
|
||||
|
||||
if _, ok := utils.Find(self.FriendIds, userId); !ok {
|
||||
if self.FriendIds == nil {
|
||||
self.FriendIds = []string{}
|
||||
@ -82,6 +85,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c
|
||||
code = pb.ErrorCode_FriendTargetNoData
|
||||
return
|
||||
}
|
||||
target.ApplyIds = utils.DeleteString(target.ApplyIds, self.Uid)
|
||||
if _, ok := utils.Find(target.FriendIds, self.Uid); !ok {
|
||||
if target.FriendIds == nil {
|
||||
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)
|
||||
}
|
||||
|
||||
//将目标从申请列表中删除
|
||||
self.ApplyIds = utils.DeleteString(self.ApplyIds, userId)
|
||||
optNum++
|
||||
}
|
||||
|
||||
//更新
|
||||
err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
|
||||
"applyIds": self.ApplyIds,
|
||||
"friendIds": self.FriendIds,
|
||||
})
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
if optNum > 0 {
|
||||
//更新
|
||||
err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
|
||||
"applyIds": self.ApplyIds,
|
||||
"friendIds": self.FriendIds,
|
||||
})
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 拥有xx个好友
|
||||
|
@ -31,6 +31,13 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
|
||||
)
|
||||
|
||||
uid := session.GetUserId()
|
||||
|
||||
//判断是否是自己
|
||||
if req.FriendId == uid {
|
||||
code = pb.ErrorCode_FriendNotSelf
|
||||
return
|
||||
}
|
||||
|
||||
//获取玩家自己好友数据
|
||||
self = this.moduleFriend.modelFriend.GetFriend(uid)
|
||||
if self == nil {
|
||||
@ -38,6 +45,19 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
|
||||
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)
|
||||
if target == nil {
|
||||
@ -45,15 +65,9 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
|
||||
return
|
||||
}
|
||||
|
||||
//判断是否是自己
|
||||
if req.FriendId == uid {
|
||||
code = pb.ErrorCode_FriendNotSelf
|
||||
return
|
||||
}
|
||||
globalConf := this.moduleFriend.globalConf
|
||||
//判断是否超过最大好友数量
|
||||
if len(self.FriendIds) >= int(globalConf.FriendMaxnum) {
|
||||
code = pb.ErrorCode_FriendSelfMax
|
||||
//判断自己是否在目标用户的申请列表中
|
||||
if _, ok := utils.Find(target.ApplyIds, self.Uid); ok {
|
||||
code = pb.ErrorCode_FriendApplyYet
|
||||
return
|
||||
}
|
||||
|
||||
@ -63,18 +77,6 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
|
||||
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 {
|
||||
code = pb.ErrorCode_FriendSelfBlackYet
|
||||
|
@ -1,6 +1,7 @@
|
||||
package friend
|
||||
|
||||
import (
|
||||
"context"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
@ -14,12 +15,13 @@ import (
|
||||
|
||||
type ModelFriend struct {
|
||||
modules.MCompModel
|
||||
moduleFriend *Friend
|
||||
}
|
||||
|
||||
func (this *ModelFriend) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.TableName = comm.TableFriend
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
|
||||
this.moduleFriend = module.(*Friend)
|
||||
return
|
||||
}
|
||||
|
||||
@ -38,14 +40,28 @@ func (this *ModelFriend) Frined_FindCond(nickName string) *pb.DBUser {
|
||||
//查询好友
|
||||
func (this *ModelFriend) GetFriend(uid string) *pb.DBFriend {
|
||||
friend := &pb.DBFriend{Uid: uid}
|
||||
err := this.Get(uid, friend)
|
||||
if err != nil {
|
||||
if err == redis.RedisNil || err == mongo.ErrNoDocuments {
|
||||
if err := this.Add(uid, friend); err != nil {
|
||||
return nil
|
||||
if this.moduleFriend.IsCross() {
|
||||
err := this.Get(uid, friend)
|
||||
if err != nil {
|
||||
if err == redis.RedisNil || err == mongo.ErrNoDocuments {
|
||||
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
|
||||
}
|
||||
|
@ -15,10 +15,12 @@ import (
|
||||
"go_dreamfactory/lego/base"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/lego/sys/redis"
|
||||
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
|
||||
"github.com/spf13/cast"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
)
|
||||
|
||||
var _ comm.IFriend = (*Friend)(nil)
|
||||
@ -56,6 +58,7 @@ func (this *Friend) OnInstallComp() {
|
||||
func (this *Friend) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
this.service.RegisterFunctionName(string(comm.Rpc_ModuleFriendUseAssitHero), this.RpcUseAssisHero)
|
||||
this.service.RegisterFunctionName(string(comm.Rpc_ModuleFriendDB), this.RpcFriendDB)
|
||||
this.globalConf = this.configure.GetGlobalConf()
|
||||
if this.globalConf == nil {
|
||||
err = errors.New("global config not found")
|
||||
@ -109,6 +112,23 @@ func (this *Friend) RpcUseAssisHero(ctx context.Context, req *pb.RPCGeneralReqA2
|
||||
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
|
||||
func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) {
|
||||
|
@ -30,6 +30,7 @@ import (
|
||||
15、bingo:sociatyexp,100 // 设置工会经验
|
||||
15、bingo:sociatyactivity,100 // 设置工会活跃
|
||||
16、bingo:alltask // bingo所有任务
|
||||
16、bingo:allhero // bingo所有英雄
|
||||
*/
|
||||
//参数校验
|
||||
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode) {
|
||||
|
@ -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})
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -70,7 +70,19 @@ func GetMonthStartEnd() (int64, int64) {
|
||||
return _d1, _d2
|
||||
}
|
||||
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)
|
||||
for _, v := range ids {
|
||||
fmt.Printf("%d", v)
|
||||
|
@ -38,9 +38,7 @@ func (this *apiComp) WarOrder(session comm.IUserSession, req *pb.PagodaWarOrderR
|
||||
payPoint := this.module.configure.GetPassCheckPointByTtype(1)
|
||||
if payPoint != "" {
|
||||
// 获取特权信息
|
||||
if privilege := this.module.ModulePrivilege.CheckPrivilege(session, payPoint); privilege != nil {
|
||||
vip = true
|
||||
}
|
||||
vip = this.module.ModulePrivilege.CheckPrivilege(session, payPoint)
|
||||
}
|
||||
|
||||
if list.PagodaId < list.PassCheckID { // 层数校验
|
||||
|
@ -10,6 +10,7 @@ const (
|
||||
PrivilegeGetListResp = "getlist"
|
||||
PrivilegeBuyYuekaResp = "buyyueka"
|
||||
PrivilegeBuyGiftResp = "buygift"
|
||||
PrivilegeVipListResp = "viplist"
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
|
@ -24,7 +24,7 @@ func (this *apiComp) BuyGift(session comm.IUserSession, req *pb.PrivilegeBuyGift
|
||||
}
|
||||
|
||||
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 等级不足
|
||||
return
|
||||
}
|
||||
|
24
modules/privilege/api_viplist.go
Normal file
24
modules/privilege/api_viplist.go
Normal 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
|
||||
}
|
@ -47,20 +47,15 @@ func (this *configureComp) GetPrivilegeCard(id string) (configure *cfg.GamePrivi
|
||||
}
|
||||
|
||||
// 获取指定特权配置
|
||||
func (this *configureComp) GetPrivilegeData(id int32) (result *cfg.GamePrivilegeData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(game_privilege); err != nil {
|
||||
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)
|
||||
func (this *configureComp) GetPrivilegeData(id int32) (result *cfg.GamePrivilegeData) {
|
||||
|
||||
if v, err := this.GetConfigure(game_privilege); err == nil {
|
||||
|
||||
if c, ok := v.(*cfg.GamePrivilege); ok {
|
||||
result = c.Get(id)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
this.module.Errorf("GetPrivilegeData err, id:%d", id)
|
||||
return nil
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package privilege
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
@ -31,11 +30,10 @@ func (this *ModelVip) Init(service core.IService, module core.IModule, comp core
|
||||
// 获取vip信息
|
||||
func (this *ModelVip) getVipList(uid string) (vip *pb.DBVip, err error) {
|
||||
vip = &pb.DBVip{}
|
||||
if err = this.Get(uid, vip); err != nil && err != mgo.MongodbNil {
|
||||
if err = this.Get(uid, vip); err != nil {
|
||||
return
|
||||
}
|
||||
err = nil
|
||||
return vip, err
|
||||
return
|
||||
}
|
||||
|
||||
// 修改Vip信息
|
||||
@ -48,7 +46,8 @@ func (this *ModelVip) addVipData(uId string, vip *pb.DBVip) (err error) {
|
||||
|
||||
if err = this.Add(uId, vip); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
return err
|
||||
return
|
||||
}
|
||||
return nil
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/event"
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/configure"
|
||||
"go_dreamfactory/sys/db"
|
||||
"go_dreamfactory/utils"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
@ -46,6 +46,7 @@ func (this *Privilege) OnInstallComp() {
|
||||
this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||
this.modelPrivilege = this.RegisterComp(new(ModelPrivilege)).(*ModelPrivilege)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
this.modelVip = this.RegisterComp(new(ModelVip)).(*ModelVip)
|
||||
}
|
||||
|
||||
func (this *Privilege) Start() (err error) {
|
||||
@ -61,7 +62,7 @@ func (this *Privilege) Start() (err error) {
|
||||
|
||||
//Event------------------------------------------------------------------------------------------------------------
|
||||
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 {
|
||||
if v.CId == cId {
|
||||
update := map[string]interface{}{}
|
||||
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 {
|
||||
v.ETime = configure.Now().Unix() + int64(conf.AssertDay)*24*3600
|
||||
} else {
|
||||
if v.ETime-configure.Now().Unix() > int64(conf.RenewDay)*24*3600 {
|
||||
|
||||
code = pb.ErrorCode_PayRenewTimeErr
|
||||
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{}{
|
||||
"eTime": v.ETime,
|
||||
}); err != nil {
|
||||
if err = this.modelPrivilege.Change(session.GetUserId(), update); err != nil {
|
||||
this.Errorf("err:%v", err)
|
||||
return
|
||||
}
|
||||
@ -103,31 +107,69 @@ func (this *Privilege) CreatePrivilegeCard(session comm.IUserSession, cId string
|
||||
break
|
||||
}
|
||||
}
|
||||
if !bFind {
|
||||
if !bFind { // 创建一条新的信息
|
||||
|
||||
data := &pb.DBPrivilege{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: session.GetUserId(),
|
||||
CId: cId,
|
||||
PrivilegeID: []int32{},
|
||||
CTime: configure.Now().Unix(),
|
||||
ETime: 0,
|
||||
RewardTime: configure.Now().Unix(),
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: session.GetUserId(),
|
||||
CId: cId,
|
||||
CTime: configure.Now().Unix(),
|
||||
ETime: configure.Now().Unix() + int64(conf.AssertDay*24*3600), // 设置过期时间
|
||||
RewardTime: configure.Now().Unix(),
|
||||
}
|
||||
data.ETime = configure.Now().Unix() + int64(conf.AssertDay*24*3600) // 设置过期时间
|
||||
for _, v := range conf.PrivilegeId {
|
||||
data.PrivilegeID = append(data.PrivilegeID, v)
|
||||
// 特权插入
|
||||
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
|
||||
}
|
||||
}
|
||||
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)
|
||||
this.modelPrivilege.addNewPrivilegeData(session.GetUserId(), data)
|
||||
this.SendDailyMail(session, cId, 1, conf.PType)
|
||||
}
|
||||
|
||||
// 即使奖励 马上发送
|
||||
if code = this.DispenseRes(session, conf.DisposableReward, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
// 推送
|
||||
session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeGetListResp{Data: list})
|
||||
session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeBuyYuekaResp{Data: list})
|
||||
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())
|
||||
if err != nil {
|
||||
return
|
||||
return false
|
||||
}
|
||||
for _, v := range list {
|
||||
if v.CId == cId {
|
||||
if v.ETime < configure.Now().Unix() { // 判断当前特权是否过期
|
||||
if err := this.modelPrivilege.DelListlds(session.GetUserId(), v.Id); err != nil {
|
||||
this.Errorf("delete privilege failed:%v", err)
|
||||
}
|
||||
privilege = nil
|
||||
return
|
||||
return false
|
||||
}
|
||||
privilege = v
|
||||
return
|
||||
return true
|
||||
}
|
||||
}
|
||||
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())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
for _, v := range list {
|
||||
conf, err := this.configure.GetPrivilegeCard(v.CId)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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 {
|
||||
conf, err := this.configure.GetPrivilegeCard(v.CId)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
privilegeID = append(privilegeID, v.PrivilegeID...)
|
||||
// 检查 每日奖励是否发放
|
||||
if !utils.IsToday(v.RewardTime) {
|
||||
v.RewardTime = configure.Now().Unix()
|
||||
@ -259,5 +315,55 @@ func (this *Privilege) SendDailyMail(session comm.IUserSession, cId string, coun
|
||||
mail.ObjId = primitive.NewObjectID().Hex()
|
||||
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})
|
||||
}
|
||||
|
@ -103,9 +103,5 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
|
||||
return
|
||||
}
|
||||
|
||||
// 监听玩家经验
|
||||
|
||||
//this.moduleTask.ModuleUser.EventUserChanged(session)
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -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.ModulePrivilege.QueryPrivilege(session)
|
||||
this.module.ModulePrivilege.CheckDailyPrivilegeMail(session)
|
||||
//推送登录公告
|
||||
if this.module.modelUser.isLoginFirst(lastLoginTime) {
|
||||
this.chat.SendSysChatToUser(session, comm.ChatSystem2, 0, 0)
|
||||
|
@ -31,7 +31,7 @@ func (this *ModelUser) Init(service core.IService, module core.IModule, comp cor
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.module = module.(*User)
|
||||
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)
|
||||
// 通过uid创建索引
|
||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||
@ -61,7 +61,6 @@ func (this *ModelUser) NickNameIsExist(name string) bool {
|
||||
if err == mongo.ErrNoDocuments { //无记录
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
return false
|
||||
}
|
||||
@ -76,7 +75,13 @@ func (this *ModelUser) User_Create(user *pb.DBUser) (err error) {
|
||||
user.Lv = 1 //初始等级
|
||||
user.Ctime = 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{})) {
|
||||
ul := event.(*UserListen)
|
||||
var (
|
||||
curExp int32
|
||||
curExp int64
|
||||
bChange bool
|
||||
)
|
||||
vipExp := ul.vipexp
|
||||
vipLv := ul.viplv
|
||||
|
||||
conf := this.module.configure.GetVipConfigureData(vipLv)
|
||||
curExp = conf.UpExp
|
||||
conf := this.module.configure.GetVipConfigureData(vipLv + 1)
|
||||
if conf == nil {
|
||||
return
|
||||
}
|
||||
curExp = int64(conf.UpExp)
|
||||
|
||||
for vipExp >= curExp {
|
||||
vipLv++
|
||||
vipExp -= curExp
|
||||
tmpConf := this.module.configure.GetVipConfigureData(vipLv)
|
||||
tmpConf := this.module.configure.GetVipConfigureData(vipLv + 1)
|
||||
if tmpConf == nil {
|
||||
vipLv--
|
||||
vipExp += curExp
|
||||
break
|
||||
}
|
||||
curExp = tmpConf.UpExp
|
||||
curExp = int64(tmpConf.UpExp)
|
||||
bChange = true
|
||||
}
|
||||
if bChange {
|
||||
update := map[string]interface{}{
|
||||
"viplv": vipLv,
|
||||
"vip": vipExp,
|
||||
"vip": vipLv,
|
||||
"vipexp": vipExp,
|
||||
}
|
||||
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})
|
||||
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 经验变化
|
||||
ul.session.SendMsg(string(this.module.GetType()), UserSubTypeVipChangedPush,
|
||||
&pb.UserVipChangedPush{
|
||||
Uid: ul.session.GetUserId(),
|
||||
VipExp: int64(vipExp),
|
||||
VipLv: vipLv,
|
||||
})
|
||||
next(ul)
|
||||
return
|
||||
}
|
||||
|
||||
//change level
|
||||
@ -293,6 +304,6 @@ type UserListen struct {
|
||||
exp int64
|
||||
lv int32
|
||||
name string
|
||||
vipexp int32
|
||||
vipexp int64
|
||||
viplv int32
|
||||
}
|
||||
|
@ -404,14 +404,29 @@ func (this *User) AddAttributeValues(session comm.IUserSession, attrs map[string
|
||||
if bPush { //推送玩家账号信息变化消息
|
||||
session.SendMsg(string(this.GetType()), "reschanged", _change)
|
||||
}
|
||||
if key == comm.ResExp || key == comm.VipExp {
|
||||
if key == comm.ResExp {
|
||||
this.ModuleUser.EventUserChanged(session)
|
||||
} else if key == comm.VipExp {
|
||||
this.ModuleUser.EventUserVipChanged(session)
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
ul := new(UserListen)
|
||||
@ -421,8 +436,6 @@ func (this *User) EventUserChanged(session comm.IUserSession) {
|
||||
ul.exp = user.Exp
|
||||
ul.lv = user.Lv
|
||||
ul.name = user.Name
|
||||
ul.vipexp = user.Vip
|
||||
ul.viplv = user.Viplv
|
||||
}
|
||||
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 {
|
||||
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
|
||||
}
|
||||
|
@ -26,13 +26,12 @@ type DBPrivilege struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
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
|
||||
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,5,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` ////购买时间
|
||||
ETime int64 `protobuf:"varint,6,opt,name=eTime,proto3" json:"eTime" bson:"eTime"` ////到期时间
|
||||
RewardTime int64 `protobuf:"varint,7,opt,name=rewardTime,proto3" json:"rewardTime" bson:"rewardTime"` //每日奖励时间
|
||||
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
|
||||
CId string `protobuf:"bytes,3,opt,name=cId,proto3" json:"cId" bson:"cId"` //计费点数ID
|
||||
CTime int64 `protobuf:"varint,4,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` ////购买时间
|
||||
ETime int64 `protobuf:"varint,5,opt,name=eTime,proto3" json:"eTime" bson:"eTime"` ////到期时间
|
||||
RewardTime int64 `protobuf:"varint,6,opt,name=rewardTime,proto3" json:"rewardTime" bson:"rewardTime"` //每日奖励时间
|
||||
}
|
||||
|
||||
func (x *DBPrivilege) Reset() {
|
||||
@ -88,13 +87,6 @@ func (x *DBPrivilege) GetCId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBPrivilege) GetPrivilegeID() []int32 {
|
||||
if x != nil {
|
||||
return x.PrivilegeID
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBPrivilege) GetCTime() int64 {
|
||||
if x != nil {
|
||||
return x.CTime
|
||||
@ -116,23 +108,70 @@ func (x *DBPrivilege) GetRewardTime() int64 {
|
||||
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 {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
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
|
||||
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"`
|
||||
PrivilegeID []int32 `protobuf:"varint,4,rep,packed,name=privilegeID,proto3" json:"privilegeID" bson:"privilegeID"` //特权ID
|
||||
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"` //每日奖励时间
|
||||
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
|
||||
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 等级
|
||||
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"` ////购买时间
|
||||
RewardTime int64 `protobuf:"varint,6,opt,name=rewardTime,proto3" json:"rewardTime" bson:"rewardTime"` //每日奖励时间
|
||||
}
|
||||
|
||||
func (x *DBVip) Reset() {
|
||||
*x = DBVip{}
|
||||
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.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -145,7 +184,7 @@ func (x *DBVip) String() string {
|
||||
func (*DBVip) ProtoMessage() {}
|
||||
|
||||
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 {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -158,7 +197,7 @@ func (x *DBVip) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use DBVip.ProtoReflect.Descriptor instead.
|
||||
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 {
|
||||
@ -182,9 +221,9 @@ func (x *DBVip) GetReward() map[int32]bool {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBVip) GetPrivilegeID() []int32 {
|
||||
func (x *DBVip) GetPrivilege() map[int32]*PrivilegeList {
|
||||
if x != nil {
|
||||
return x.PrivilegeID
|
||||
return x.Privilege
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -207,34 +246,41 @@ var File_privilege_privilege_db_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_privilege_privilege_db_proto_rawDesc = []byte{
|
||||
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,
|
||||
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, 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,
|
||||
0x44, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65,
|
||||
0x67, 0x65, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x54,
|
||||
0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x22, 0xe8, 0x01, 0x0a, 0x05, 0x44, 0x42, 0x56, 0x69, 0x70, 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, 0x2a, 0x0a, 0x06,
|
||||
0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x44,
|
||||
0x42, 0x56, 0x69, 0x70, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76,
|
||||
0x69, 0x6c, 0x65, 0x67, 0x65, 0x49, 0x44, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x70,
|
||||
0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x54,
|
||||
0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65,
|
||||
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e,
|
||||
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x54, 0x69, 0x6d,
|
||||
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e,
|
||||
0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x31,
|
||||
0x0a, 0x0d, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12,
|
||||
0x20, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x49, 0x44, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x49,
|
||||
0x44, 0x22, 0xc9, 0x02, 0x0a, 0x05, 0x44, 0x42, 0x56, 0x69, 0x70, 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, 0x2a, 0x0a,
|
||||
0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e,
|
||||
0x44, 0x42, 0x56, 0x69, 0x70, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72,
|
||||
0x79, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x33, 0x0a, 0x09, 0x70, 0x72, 0x69,
|
||||
0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44,
|
||||
0x42, 0x56, 0x69, 0x70, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x79, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63,
|
||||
0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69,
|
||||
0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64,
|
||||
0x54, 0x69, 0x6d, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 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 (
|
||||
@ -249,19 +295,23 @@ func file_privilege_privilege_db_proto_rawDescGZIP() []byte {
|
||||
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{}{
|
||||
(*DBPrivilege)(nil), // 0: DBPrivilege
|
||||
(*DBVip)(nil), // 1: DBVip
|
||||
nil, // 2: DBVip.RewardEntry
|
||||
(*DBPrivilege)(nil), // 0: DBPrivilege
|
||||
(*PrivilegeList)(nil), // 1: PrivilegeList
|
||||
(*DBVip)(nil), // 2: DBVip
|
||||
nil, // 3: DBVip.RewardEntry
|
||||
nil, // 4: DBVip.PrivilegeEntry
|
||||
}
|
||||
var file_privilege_privilege_db_proto_depIdxs = []int32{
|
||||
2, // 0: DBVip.reward:type_name -> DBVip.RewardEntry
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
3, // 0: DBVip.reward:type_name -> DBVip.RewardEntry
|
||||
4, // 1: DBVip.privilege:type_name -> DBVip.PrivilegeEntry
|
||||
1, // 2: DBVip.PrivilegeEntry.value:type_name -> PrivilegeList
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_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{} {
|
||||
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 {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -301,7 +363,7 @@ func file_privilege_privilege_db_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_privilege_privilege_db_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -296,6 +296,91 @@ func (x *PrivilegeBuyGiftResp) GetData() *DBVip {
|
||||
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_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,
|
||||
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,
|
||||
0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x64, 0x61, 0x74, 0x61, 0x22, 0x15, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67,
|
||||
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 (
|
||||
@ -336,7 +425,7 @@ func file_privilege_privilege_msg_proto_rawDescGZIP() []byte {
|
||||
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{}{
|
||||
(*PrivilegeGetListReq)(nil), // 0: PrivilegeGetListReq
|
||||
(*PrivilegeGetListResp)(nil), // 1: PrivilegeGetListResp
|
||||
@ -344,18 +433,21 @@ var file_privilege_privilege_msg_proto_goTypes = []interface{}{
|
||||
(*PrivilegeBuyYuekaResp)(nil), // 3: PrivilegeBuyYuekaResp
|
||||
(*PrivilegeBuyGiftReq)(nil), // 4: PrivilegeBuyGiftReq
|
||||
(*PrivilegeBuyGiftResp)(nil), // 5: PrivilegeBuyGiftResp
|
||||
(*DBPrivilege)(nil), // 6: DBPrivilege
|
||||
(*DBVip)(nil), // 7: DBVip
|
||||
(*PrivilegeVipListReq)(nil), // 6: PrivilegeVipListReq
|
||||
(*PrivilegeVipListResp)(nil), // 7: PrivilegeVipListResp
|
||||
(*DBPrivilege)(nil), // 8: DBPrivilege
|
||||
(*DBVip)(nil), // 9: DBVip
|
||||
}
|
||||
var file_privilege_privilege_msg_proto_depIdxs = []int32{
|
||||
6, // 0: PrivilegeGetListResp.data:type_name -> DBPrivilege
|
||||
6, // 1: PrivilegeBuyYuekaResp.data:type_name -> DBPrivilege
|
||||
7, // 2: PrivilegeBuyGiftResp.data:type_name -> DBVip
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
8, // 0: PrivilegeGetListResp.data:type_name -> DBPrivilege
|
||||
8, // 1: PrivilegeBuyYuekaResp.data:type_name -> DBPrivilege
|
||||
9, // 2: PrivilegeBuyGiftResp.data:type_name -> DBVip
|
||||
9, // 3: PrivilegeVipListResp.data:type_name -> DBVip
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension 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() }
|
||||
@ -437,6 +529,30 @@ func file_privilege_privilege_msg_proto_init() {
|
||||
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{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
@ -444,7 +560,7 @@ func file_privilege_privilege_msg_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_privilege_privilege_msg_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumMessages: 8,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -122,13 +122,12 @@ type DBUser struct {
|
||||
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"` //创角
|
||||
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"` // 钻石
|
||||
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"` //离线时间
|
||||
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"` //背景
|
||||
Viplv int32 `protobuf:"varint,25,opt,name=viplv,proto3" json:"viplv" bson:"viplv"` // vip等级
|
||||
}
|
||||
|
||||
func (x *DBUser) Reset() {
|
||||
@ -331,13 +330,6 @@ func (x *DBUser) GetBgp() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBUser) GetViplv() int32 {
|
||||
if x != nil {
|
||||
return x.Viplv
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type DBUserSetting struct {
|
||||
state protoimpl.MessageState
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
@ -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,
|
||||
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,
|
||||
0x62, 0x67, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x69, 0x70, 0x6c, 0x76, 0x18, 0x19, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x05, 0x76, 0x69, 0x70, 0x6c, 0x76, 0x22, 0xc7, 0x02, 0x0a, 0x0d, 0x44, 0x42,
|
||||
0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75,
|
||||
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68,
|
||||
0x75, 0x61, 0x7a, 0x68, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63,
|
||||
0x68, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75,
|
||||
0x63, 0x68, 0x69, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x77,
|
||||
0x75, 0x6c, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x07, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x66, 0x66,
|
||||
0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63,
|
||||
0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e,
|
||||
0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x74,
|
||||
0x61, 0x6e, 0x73, 0x75, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67,
|
||||
0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 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, 0xa2, 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, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09,
|
||||
0x73, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x09, 0x73, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72,
|
||||
0x6f, 0x75, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63,
|
||||
0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x05, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x62, 0x67, 0x70, 0x22, 0xc7, 0x02, 0x0a, 0x0d, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
|
||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68,
|
||||
0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x12,
|
||||
0x1c, 0x0a, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x0d, 0x52, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x75, 0x6c,
|
||||
0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x75,
|
||||
0x73, 0x69, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67,
|
||||
0x75, 0x61, 0x6a, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x67, 0x75, 0x61, 0x6a,
|
||||
0x69, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75,
|
||||
0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x12,
|
||||
0x18, 0x0a, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 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, 0xa2, 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, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x69,
|
||||
0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x43, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x43,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69,
|
||||
0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x54, 0x69,
|
||||
0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -63,7 +63,7 @@ func Dispose(ctx context.Context, concurrency, totalNumber uint64, request *mode
|
||||
// 并发建立长链接
|
||||
go func(i uint64) {
|
||||
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"}
|
||||
|
||||
// 先登录
|
||||
|
@ -12,8 +12,10 @@ import "errors"
|
||||
|
||||
type GamePrivilegeData struct {
|
||||
PrivilegeId int32
|
||||
PrivilegeType int32
|
||||
PrivilegeDescribeFront string
|
||||
PrivilegeDescribeAfter string
|
||||
PrivilegeParameter int32
|
||||
}
|
||||
|
||||
const TypeId_GamePrivilegeData = 40320255
|
||||
@ -24,8 +26,10 @@ func (*GamePrivilegeData) GetTypeId() int32 {
|
||||
|
||||
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_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_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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user