diff --git a/comm/const.go b/comm/const.go index 1a6236d3a..976f5a42e 100644 --- a/comm/const.go +++ b/comm/const.go @@ -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" //公会数据变化 ) diff --git a/comm/imodule.go b/comm/imodule.go index f5e3afc82..04889b95f 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -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 @@ -279,12 +280,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) + // 检查特权 参数 计费点 返回值 是否有特权 + 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 { diff --git a/modules/gm/api_cmd.go b/modules/gm/api_cmd.go index 3113b0bae..cec27457d 100644 --- a/modules/gm/api_cmd.go +++ b/modules/gm/api_cmd.go @@ -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) { diff --git a/modules/gm/module.go b/modules/gm/module.go index bf562f433..ccfd6c859 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -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}) } } diff --git a/modules/pagoda/api_warorder.go b/modules/pagoda/api_warorder.go index ade434c61..bf7662f92 100644 --- a/modules/pagoda/api_warorder.go +++ b/modules/pagoda/api_warorder.go @@ -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 { // 层数校验 diff --git a/modules/privilege/api_buygift.go b/modules/privilege/api_buygift.go index 69657e27f..fde416306 100644 --- a/modules/privilege/api_buygift.go +++ b/modules/privilege/api_buygift.go @@ -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 } diff --git a/modules/privilege/api_viplist.go b/modules/privilege/api_viplist.go index 0a287b548..0fed30caf 100644 --- a/modules/privilege/api_viplist.go +++ b/modules/privilege/api_viplist.go @@ -19,6 +19,6 @@ func (this *apiComp) VipList(session comm.IUserSession, req *pb.PrivilegeVipList if err != nil { this.module.Errorf("can't get privilege list :%v", err) } - session.SendMsg(string(this.module.GetType()), PrivilegeGetListResp, &pb.PrivilegeVipListResp{Data: list}) + session.SendMsg(string(this.module.GetType()), PrivilegeVipListResp, &pb.PrivilegeVipListResp{Data: list}) return } diff --git a/modules/privilege/module.go b/modules/privilege/module.go index e2ab5b60b..0681b167e 100644 --- a/modules/privilege/module.go +++ b/modules/privilege/module.go @@ -124,7 +124,7 @@ func (this *Privilege) CreatePrivilegeCard(session comm.IUserSession, cId string Id: primitive.NewObjectID().Hex(), Uid: session.GetUserId(), Reward: map[int32]bool{}, - Privilege: map[int32]*pb.PrivilegeData{}, + Privilege: map[int32]*pb.PrivilegeList{}, CTime: configure.Now().Unix(), RewardTime: 0, } @@ -151,7 +151,7 @@ func (this *Privilege) CreatePrivilegeCard(session comm.IUserSession, cId string vip.Privilege[conf.PrivilegeType].PrivilegeID = append(vip.Privilege[conf.PrivilegeType].PrivilegeID, v) } } else { - sz := &pb.PrivilegeData{} + sz := &pb.PrivilegeList{} sz.PrivilegeID = append(sz.PrivilegeID, v) vip.Privilege[conf.PrivilegeType] = sz } @@ -169,7 +169,7 @@ func (this *Privilege) CreatePrivilegeCard(session comm.IUserSession, cId string return } // 推送 - session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeGetListResp{Data: list}) + session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeBuyYuekaResp{Data: list}) return } @@ -208,25 +208,20 @@ 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 } // 检查特权 并发送每日邮件 @@ -320,8 +315,16 @@ 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 @@ -332,7 +335,7 @@ func (this *Privilege) AddVipData(session comm.IUserSession, oldVip, newVip int3 Id: primitive.NewObjectID().Hex(), Uid: session.GetUserId(), Reward: map[int32]bool{}, - Privilege: map[int32]*pb.PrivilegeData{}, + Privilege: map[int32]*pb.PrivilegeList{}, CTime: configure.Now().Unix(), RewardTime: 0, } @@ -342,17 +345,16 @@ func (this *Privilege) AddVipData(session comm.IUserSession, oldVip, newVip int3 } } update := map[string]interface{}{} - for i := oldVip; i < newVip; i++ { + 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.PrivilegeData{} + sz := &pb.PrivilegeList{} sz.PrivilegeID = append(sz.PrivilegeID, v) vip.Privilege[data.PrivilegeType] = sz } @@ -362,7 +364,6 @@ func (this *Privilege) AddVipData(session comm.IUserSession, oldVip, newVip int3 } update["privilege"] = vip.Privilege this.modelVip.modifyVipData(session.GetUserId(), update) - if err != nil { // 推送 - session.SendMsg(string(this.GetType()), PrivilegeGetListResp, &pb.PrivilegeVipListResp{Data: vip}) - } + + session.SendMsg(string(this.GetType()), PrivilegeGetListResp, &pb.PrivilegeVipListResp{Data: vip}) } diff --git a/modules/task/api_receive.go b/modules/task/api_receive.go index ce3c6fdd9..196e27132 100644 --- a/modules/task/api_receive.go +++ b/modules/task/api_receive.go @@ -103,9 +103,5 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq) return } - // 监听玩家经验 - - //this.moduleTask.ModuleUser.EventUserChanged(session) - return } diff --git a/modules/user/model_user.go b/modules/user/model_user.go index 6ab8d82e0..b3adda323 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -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{ @@ -179,49 +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, + }) } - // - 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, - }) - next(ul) + return } //change level @@ -302,6 +304,6 @@ type UserListen struct { exp int64 lv int32 name string - vipexp int32 + vipexp int64 viplv int32 } diff --git a/modules/user/module.go b/modules/user/module.go index 25b94478b..4dc28e9d6 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -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) } diff --git a/pb/privilege_db.pb.go b/pb/privilege_db.pb.go index b10d88bd0..4f7392184 100644 --- a/pb/privilege_db.pb.go +++ b/pb/privilege_db.pb.go @@ -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 - // repeated int32 privilegeID = 4; //@go_tags(`bson:"privilegeID"`) 特权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"` //每日奖励时间 + 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() { @@ -109,7 +108,7 @@ func (x *DBPrivilege) GetRewardTime() int64 { return 0 } -type PrivilegeData struct { +type PrivilegeList struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -117,8 +116,8 @@ type PrivilegeData struct { PrivilegeID []int32 `protobuf:"varint,1,rep,packed,name=privilegeID,proto3" json:"privilegeID" bson:"privilegeID"` //特权ID } -func (x *PrivilegeData) Reset() { - *x = PrivilegeData{} +func (x *PrivilegeList) Reset() { + *x = PrivilegeList{} if protoimpl.UnsafeEnabled { mi := &file_privilege_privilege_db_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -126,13 +125,13 @@ func (x *PrivilegeData) Reset() { } } -func (x *PrivilegeData) String() string { +func (x *PrivilegeList) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PrivilegeData) ProtoMessage() {} +func (*PrivilegeList) ProtoMessage() {} -func (x *PrivilegeData) ProtoReflect() protoreflect.Message { +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)) @@ -144,12 +143,12 @@ func (x *PrivilegeData) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PrivilegeData.ProtoReflect.Descriptor instead. -func (*PrivilegeData) Descriptor() ([]byte, []int) { +// Deprecated: Use PrivilegeList.ProtoReflect.Descriptor instead. +func (*PrivilegeList) Descriptor() ([]byte, []int) { return file_privilege_privilege_db_proto_rawDescGZIP(), []int{1} } -func (x *PrivilegeData) GetPrivilegeID() []int32 { +func (x *PrivilegeList) GetPrivilegeID() []int32 { if x != nil { return x.PrivilegeID } @@ -164,7 +163,7 @@ type DBVip struct { 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]*PrivilegeData `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 + 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"` //每日奖励时间 } @@ -222,7 +221,7 @@ func (x *DBVip) GetReward() map[int32]bool { return nil } -func (x *DBVip) GetPrivilege() map[int32]*PrivilegeData { +func (x *DBVip) GetPrivilege() map[int32]*PrivilegeList { if x != nil { return x.Privilege } @@ -257,7 +256,7 @@ var file_privilege_privilege_db_proto_rawDesc = []byte{ 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, 0x44, 0x61, 0x74, 0x61, 0x12, + 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, @@ -279,8 +278,8 @@ var file_privilege_privilege_db_proto_rawDesc = []byte{ 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, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, + 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, } @@ -299,7 +298,7 @@ func file_privilege_privilege_db_proto_rawDescGZIP() []byte { var file_privilege_privilege_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_privilege_privilege_db_proto_goTypes = []interface{}{ (*DBPrivilege)(nil), // 0: DBPrivilege - (*PrivilegeData)(nil), // 1: PrivilegeData + (*PrivilegeList)(nil), // 1: PrivilegeList (*DBVip)(nil), // 2: DBVip nil, // 3: DBVip.RewardEntry nil, // 4: DBVip.PrivilegeEntry @@ -307,7 +306,7 @@ var file_privilege_privilege_db_proto_goTypes = []interface{}{ var file_privilege_privilege_db_proto_depIdxs = []int32{ 3, // 0: DBVip.reward:type_name -> DBVip.RewardEntry 4, // 1: DBVip.privilege:type_name -> DBVip.PrivilegeEntry - 1, // 2: DBVip.PrivilegeEntry.value:type_name -> PrivilegeData + 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 @@ -334,7 +333,7 @@ func file_privilege_privilege_db_proto_init() { } } file_privilege_privilege_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrivilegeData); i { + switch v := v.(*PrivilegeList); i { case 0: return &v.state case 1: diff --git a/pb/user_db.pb.go b/pb/user_db.pb.go index 0fb58589d..ec2207d43 100644 --- a/pb/user_db.pb.go +++ b/pb/user_db.pb.go @@ -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 (