积分boss 推荐阵容

This commit is contained in:
meixiongfeng 2023-12-25 18:31:07 +08:00
parent a0074c224b
commit 5691ecc4ca
9 changed files with 462 additions and 72 deletions

View File

@ -440,6 +440,9 @@ const (
TableEntertainRecode = "xxlrecode" //战报 TableEntertainRecode = "xxlrecode" //战报
TableDrawRecode = "drawrecode" //抽卡记录 TableDrawRecode = "drawrecode" //抽卡记录
// 积分boss 排行
TableIntegralRank = "integralrank" //排名
) )
// RPC服务接口定义处 // RPC服务接口定义处

View File

@ -12,12 +12,25 @@ func (this *apiComp) DrawRecordCheck(session comm.IUserSession, req *pb.HeroDraw
} }
func (this *apiComp) DrawRecord(session comm.IUserSession, req *pb.HeroDrawRecordReq) (errdata *pb.ErrorData) { func (this *apiComp) DrawRecord(session comm.IUserSession, req *pb.HeroDrawRecordReq) (errdata *pb.ErrorData) {
var () var (
results []*pb.DBHeroDrawRecord
err error
)
if errdata = this.DrawRecordCheck(session, req); errdata != nil { if errdata = this.DrawRecordCheck(session, req); errdata != nil {
return return
} }
session.SendMsg(string(this.module.GetType()), "drawrecord", &pb.HeroDrawRecordResp{}) if results, err = this.module.modelDrawRecode.getDrawCardRecord(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
session.SendMsg(string(this.module.GetType()), "drawrecord", &pb.HeroDrawRecordResp{
Record: results,
})
return return
} }

View File

@ -0,0 +1,57 @@
package integral
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
// 参数校验
func (this *apiComp) RankListCheck(session comm.IUserSession, req *pb.IntegralRankListReq) (errdata *pb.ErrorData) {
return
}
// /排行榜获取
func (this *apiComp) RankList(session comm.IUserSession, req *pb.IntegralRankListReq) (errdata *pb.ErrorData) {
var (
uids []string
ranks []*pb.DBIntegralBoss
players []*pb.DBIntegralRank
err error
)
if errdata = this.RankListCheck(session, req); errdata != nil {
return
}
if uids, err = this.module.modelRank.queryRankUser(); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
if ranks, err = this.module.modelIntegral.queryPlayers(uids); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
players = make([]*pb.DBIntegralRank, len(ranks))
for i, v := range ranks {
// rank := int32(i + 1)
players[i] = &pb.DBIntegralRank{
Id: v.Uid,
Uinfo: v.Uinfo,
Nandu: v.Nandu,
Score: v.Maxscore,
}
}
session.SendMsg(string(this.module.GetType()), "rank", &pb.IntegralRankListResp{
Ranks: players,
})
return
}

View File

@ -35,6 +35,15 @@ func (this *modelIntegral) modifyIntegralData(uid string, data map[string]interf
return this.Change(uid, data) return this.Change(uid, data)
} }
func (this *modelIntegral) queryPlayers(uIds []string) (result []*pb.DBIntegralBoss, err error) {
result = make([]*pb.DBIntegralBoss, 0)
if _, err = this.Gets(uIds, &result); err != nil && err != mgo.MongodbNil {
this.module.Errorln(err)
return
}
return
}
// 获取列表信息 // 获取列表信息
func (this *modelIntegral) getIntegralList(uid string) (result *pb.DBIntegralBoss, err error) { func (this *modelIntegral) getIntegralList(uid string) (result *pb.DBIntegralBoss, err error) {
result = &pb.DBIntegralBoss{} result = &pb.DBIntegralBoss{}
@ -51,7 +60,7 @@ func (this *modelIntegral) getIntegralList(uid string) (result *pb.DBIntegralBos
openTime := this.module.service.GetOpentime().Unix() openTime := this.module.service.GetOpentime().Unix()
for _, v := range szConf { for _, v := range szConf {
if curTime >= int64(v.Openday)+openTime && curTime <= int64(v.Endday)+openTime { if curTime >= int64(v.Openday)+openTime && curTime <= int64(v.Endday)+openTime {
result.Hid = v.Endday result.Hid = v.Hdid
result.Etime = int64(v.Endday) + openTime result.Etime = int64(v.Endday) + openTime
result.CTime = curTime result.CTime = curTime
break break

View File

@ -0,0 +1,68 @@
package integral
import (
"context"
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/redis/pipe"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"github.com/go-redis/redis/v8"
)
type modelRank struct {
modules.MCompModel
module *Integral
}
// 组件初始化接口
func (this *modelRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, opt core.IModuleOptions) (err error) {
this.TableName = comm.TableIntegralRank
this.MCompModel.Init(service, module, comp, opt)
this.module = module.(*Integral)
return
}
// 更新排名
func (this *modelRank) updateRank(data *pb.DBIntegralRank) (err error) {
var (
pipe *pipe.RedisPipe = this.DBModel.Redis.RedisPipe(context.TODO())
menbers *redis.Z
cmd *redis.IntCmd
)
menbers = &redis.Z{Score: float64(data.Score), Member: data.Uinfo.Uid}
if cmd = pipe.ZAdd(this.TableName, menbers); err != nil {
this.module.Errorln(err)
}
if _, err = pipe.Exec(); err != nil {
this.module.Errorln(err)
return
}
if _, err = cmd.Result(); err != nil {
this.module.Errorln(err)
return
}
return
}
// 获取排行榜前50的用户名单
func (this *modelRank) queryRankUser() (ranks []string, err error) {
var (
result []string
)
if result, err = this.DBModel.Redis.ZRevRange(this.TableName, 0, 50).Result(); err != nil {
this.module.Errorln(err)
return
}
ranks = make([]string, 0)
for i := 0; i < len(result); i += 1 {
ranks = append(ranks, result[i])
}
return
}

View File

@ -17,6 +17,8 @@ type Integral struct {
battle comm.IBattle battle comm.IBattle
service base.IRPCXService service base.IRPCXService
modelRank *modelRank
} }
func NewModule() core.IModule { func NewModule() core.IModule {
@ -53,6 +55,7 @@ func (this *Integral) OnInstallComp() {
this.api = this.RegisterComp(new(apiComp)).(*apiComp) this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelIntegral = this.RegisterComp(new(modelIntegral)).(*modelIntegral) this.modelIntegral = this.RegisterComp(new(modelIntegral)).(*modelIntegral)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp) this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
this.modelRank = this.RegisterComp(new(modelRank)).(*modelRank)
} }
// 任务条件达成通知 // 任务条件达成通知

View File

@ -2295,7 +2295,7 @@ type HeroDrawRecordResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Record *DBHeroDrawRecord `protobuf:"bytes,1,opt,name=record,proto3" json:"record"` // 扩展数据 Record []*DBHeroDrawRecord `protobuf:"bytes,1,rep,name=record,proto3" json:"record"`
} }
func (x *HeroDrawRecordResp) Reset() { func (x *HeroDrawRecordResp) Reset() {
@ -2330,7 +2330,7 @@ func (*HeroDrawRecordResp) Descriptor() ([]byte, []int) {
return file_hero_hero_msg_proto_rawDescGZIP(), []int{44} return file_hero_hero_msg_proto_rawDescGZIP(), []int{44}
} }
func (x *HeroDrawRecordResp) GetRecord() *DBHeroDrawRecord { func (x *HeroDrawRecordResp) GetRecord() []*DBHeroDrawRecord {
if x != nil { if x != nil {
return x.Record return x.Record
} }
@ -2550,7 +2550,7 @@ var file_hero_hero_msg_proto_rawDesc = []byte{
0x65, 0x72, 0x6f, 0x44, 0x72, 0x61, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x65, 0x72, 0x6f, 0x44, 0x72, 0x61, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71,
0x22, 0x3f, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x72, 0x61, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x22, 0x3f, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x72, 0x61, 0x77, 0x52, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x44,
0x72, 0x61, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x72, 0x61, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72,
0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33, 0x33,

View File

@ -39,6 +39,7 @@ type DBIntegralBoss struct {
Buff map[int32]int32 `protobuf:"bytes,12,rep,name=buff,proto3" json:"buff" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 激活的buff (key Integralcondition value :0 未激活) 注:事件类型 才有值 Buff map[int32]int32 `protobuf:"bytes,12,rep,name=buff,proto3" json:"buff" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 激活的buff (key Integralcondition value :0 未激活) 注:事件类型 才有值
Nandu int32 `protobuf:"varint,13,opt,name=nandu,proto3" json:"nandu"` // 已经解锁的难度 Nandu int32 `protobuf:"varint,13,opt,name=nandu,proto3" json:"nandu"` // 已经解锁的难度
Score map[int32]int32 `protobuf:"bytes,14,rep,name=score,proto3" json:"score" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 难度 value 积分 Score map[int32]int32 `protobuf:"bytes,14,rep,name=score,proto3" json:"score" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 难度 value 积分
Uinfo *BaseUserInfo `protobuf:"bytes,15,opt,name=uinfo,proto3" json:"uinfo"` //用户基础
} }
func (x *DBIntegralBoss) Reset() { func (x *DBIntegralBoss) Reset() {
@ -171,44 +172,133 @@ func (x *DBIntegralBoss) GetScore() map[int32]int32 {
return nil return nil
} }
func (x *DBIntegralBoss) GetUinfo() *BaseUserInfo {
if x != nil {
return x.Uinfo
}
return nil
}
// 积分boss 排行
type DBIntegralRank struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Uinfo *BaseUserInfo `protobuf:"bytes,2,opt,name=uinfo,proto3" json:"uinfo"` //用户基础
Nandu int32 `protobuf:"varint,3,opt,name=nandu,proto3" json:"nandu"`
Score int32 `protobuf:"varint,4,opt,name=score,proto3" json:"score"` // 积分
}
func (x *DBIntegralRank) Reset() {
*x = DBIntegralRank{}
if protoimpl.UnsafeEnabled {
mi := &file_integral_integral_db_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBIntegralRank) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBIntegralRank) ProtoMessage() {}
func (x *DBIntegralRank) ProtoReflect() protoreflect.Message {
mi := &file_integral_integral_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 DBIntegralRank.ProtoReflect.Descriptor instead.
func (*DBIntegralRank) Descriptor() ([]byte, []int) {
return file_integral_integral_db_proto_rawDescGZIP(), []int{1}
}
func (x *DBIntegralRank) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DBIntegralRank) GetUinfo() *BaseUserInfo {
if x != nil {
return x.Uinfo
}
return nil
}
func (x *DBIntegralRank) GetNandu() int32 {
if x != nil {
return x.Nandu
}
return 0
}
func (x *DBIntegralRank) GetScore() int32 {
if x != nil {
return x.Score
}
return 0
}
var File_integral_integral_db_proto protoreflect.FileDescriptor var File_integral_integral_db_proto protoreflect.FileDescriptor
var file_integral_integral_db_proto_rawDesc = []byte{ var file_integral_integral_db_proto_rawDesc = []byte{
0x0a, 0x1a, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x0a, 0x1a, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67,
0x72, 0x61, 0x6c, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x03, 0x0a, 0x72, 0x61, 0x6c, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f,
0x0e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x12, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9b, 0x04, 0x0a, 0x0e, 0x44, 0x42, 0x49,
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75,
0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a,
0x52, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x74,
0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01,
0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x54, 0x69,
0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12,
0x28, 0x03, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x64, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x68, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01,
0x61, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x28, 0x05, 0x52, 0x03, 0x68, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x73, 0x63,
0x61, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x73, 0x63,
0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x63, 0x6f, 0x72,
0x61, 0x6c, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x63,
0x64, 0x31, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x6f, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x31, 0x18, 0x0a,
0x31, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x32, 0x18, 0x0b, 0x20, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x31, 0x12, 0x18, 0x0a,
0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x32, 0x12, 0x2d, 0x0a, 0x04, 0x62, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x32, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
0x75, 0x66, 0x66, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x32, 0x12, 0x2d, 0x0a, 0x04, 0x62, 0x75, 0x66, 0x66, 0x18,
0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x2e, 0x42, 0x75, 0x66, 0x66, 0x45, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x62, 0x75, 0x66, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x2e, 0x42, 0x75, 0x66, 0x66, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x6e, 0x64, 0x75, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x52, 0x04, 0x62, 0x75, 0x66, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x18,
0x12, 0x30, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x12, 0x30, 0x0a, 0x05,
0x1a, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x44, 0x42,
0x2e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x2e, 0x53, 0x63, 0x6f,
0x72, 0x65, 0x1a, 0x37, 0x0a, 0x09, 0x42, 0x75, 0x66, 0x66, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x23,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x0a, 0x05, 0x75, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x75, 0x69,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x6e, 0x66, 0x6f, 0x1a, 0x37, 0x0a, 0x09, 0x42, 0x75, 0x66, 0x66, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x63, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a,
0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
0x72, 0x6f, 0x74, 0x6f, 0x33, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x71, 0x0a, 0x0e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65,
0x67, 0x72, 0x61, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x05, 0x75, 0x69, 0x6e, 0x66,
0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73,
0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x75, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a,
0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61,
0x6e, 0x64, 0x75, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01,
0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -223,20 +313,24 @@ func file_integral_integral_db_proto_rawDescGZIP() []byte {
return file_integral_integral_db_proto_rawDescData return file_integral_integral_db_proto_rawDescData
} }
var file_integral_integral_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_integral_integral_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_integral_integral_db_proto_goTypes = []interface{}{ var file_integral_integral_db_proto_goTypes = []interface{}{
(*DBIntegralBoss)(nil), // 0: DBIntegralBoss (*DBIntegralBoss)(nil), // 0: DBIntegralBoss
nil, // 1: DBIntegralBoss.BuffEntry (*DBIntegralRank)(nil), // 1: DBIntegralRank
nil, // 2: DBIntegralBoss.ScoreEntry nil, // 2: DBIntegralBoss.BuffEntry
nil, // 3: DBIntegralBoss.ScoreEntry
(*BaseUserInfo)(nil), // 4: BaseUserInfo
} }
var file_integral_integral_db_proto_depIdxs = []int32{ var file_integral_integral_db_proto_depIdxs = []int32{
1, // 0: DBIntegralBoss.buff:type_name -> DBIntegralBoss.BuffEntry 2, // 0: DBIntegralBoss.buff:type_name -> DBIntegralBoss.BuffEntry
2, // 1: DBIntegralBoss.score:type_name -> DBIntegralBoss.ScoreEntry 3, // 1: DBIntegralBoss.score:type_name -> DBIntegralBoss.ScoreEntry
2, // [2:2] is the sub-list for method output_type 4, // 2: DBIntegralBoss.uinfo:type_name -> BaseUserInfo
2, // [2:2] is the sub-list for method input_type 4, // 3: DBIntegralRank.uinfo:type_name -> BaseUserInfo
2, // [2:2] is the sub-list for extension type_name 4, // [4:4] is the sub-list for method output_type
2, // [2:2] is the sub-list for extension extendee 4, // [4:4] is the sub-list for method input_type
0, // [0:2] is the sub-list for field type_name 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_integral_integral_db_proto_init() } func init() { file_integral_integral_db_proto_init() }
@ -244,6 +338,7 @@ func file_integral_integral_db_proto_init() {
if File_integral_integral_db_proto != nil { if File_integral_integral_db_proto != nil {
return return
} }
file_comm_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_integral_integral_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_integral_integral_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBIntegralBoss); i { switch v := v.(*DBIntegralBoss); i {
@ -257,6 +352,18 @@ func file_integral_integral_db_proto_init() {
return nil return nil
} }
} }
file_integral_integral_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBIntegralRank); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -264,7 +371,7 @@ func file_integral_integral_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_integral_integral_db_proto_rawDesc, RawDescriptor: file_integral_integral_db_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 3, NumMessages: 4,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -430,6 +430,101 @@ func (x *IntegralGetRewardResp) GetAward() []*UserAtno {
return nil return nil
} }
// 获取排行榜
type IntegralRankListReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Nandu int32 `protobuf:"varint,1,opt,name=nandu,proto3" json:"nandu"` // 难度
}
func (x *IntegralRankListReq) Reset() {
*x = IntegralRankListReq{}
if protoimpl.UnsafeEnabled {
mi := &file_integral_integral_msg_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IntegralRankListReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IntegralRankListReq) ProtoMessage() {}
func (x *IntegralRankListReq) ProtoReflect() protoreflect.Message {
mi := &file_integral_integral_msg_proto_msgTypes[8]
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 IntegralRankListReq.ProtoReflect.Descriptor instead.
func (*IntegralRankListReq) Descriptor() ([]byte, []int) {
return file_integral_integral_msg_proto_rawDescGZIP(), []int{8}
}
func (x *IntegralRankListReq) GetNandu() int32 {
if x != nil {
return x.Nandu
}
return 0
}
type IntegralRankListResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Ranks []*DBIntegralRank `protobuf:"bytes,1,rep,name=ranks,proto3" json:"ranks"`
}
func (x *IntegralRankListResp) Reset() {
*x = IntegralRankListResp{}
if protoimpl.UnsafeEnabled {
mi := &file_integral_integral_msg_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IntegralRankListResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IntegralRankListResp) ProtoMessage() {}
func (x *IntegralRankListResp) ProtoReflect() protoreflect.Message {
mi := &file_integral_integral_msg_proto_msgTypes[9]
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 IntegralRankListResp.ProtoReflect.Descriptor instead.
func (*IntegralRankListResp) Descriptor() ([]byte, []int) {
return file_integral_integral_msg_proto_rawDescGZIP(), []int{9}
}
func (x *IntegralRankListResp) GetRanks() []*DBIntegralRank {
if x != nil {
return x.Ranks
}
return nil
}
var File_integral_integral_msg_proto protoreflect.FileDescriptor var File_integral_integral_msg_proto protoreflect.FileDescriptor
var file_integral_integral_msg_proto_rawDesc = []byte{ var file_integral_integral_msg_proto_rawDesc = []byte{
@ -474,8 +569,15 @@ var file_integral_integral_msg_proto_rawDesc = []byte{
0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x52, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x52,
0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52,
0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x22, 0x2b, 0x0a, 0x13, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x61, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a,
0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61,
0x6e, 0x64, 0x75, 0x22, 0x3d, 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52,
0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x05, 0x72,
0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x49,
0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e,
0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
} }
var ( var (
@ -490,7 +592,7 @@ func file_integral_integral_msg_proto_rawDescGZIP() []byte {
return file_integral_integral_msg_proto_rawDescData return file_integral_integral_msg_proto_rawDescData
} }
var file_integral_integral_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_integral_integral_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_integral_integral_msg_proto_goTypes = []interface{}{ var file_integral_integral_msg_proto_goTypes = []interface{}{
(*IntegralGetListReq)(nil), // 0: IntegralGetListReq (*IntegralGetListReq)(nil), // 0: IntegralGetListReq
(*IntegralGetListResp)(nil), // 1: IntegralGetListResp (*IntegralGetListResp)(nil), // 1: IntegralGetListResp
@ -500,25 +602,29 @@ var file_integral_integral_msg_proto_goTypes = []interface{}{
(*IntegralChallengeOverResp)(nil), // 5: IntegralChallengeOverResp (*IntegralChallengeOverResp)(nil), // 5: IntegralChallengeOverResp
(*IntegralGetRewardReq)(nil), // 6: IntegralGetRewardReq (*IntegralGetRewardReq)(nil), // 6: IntegralGetRewardReq
(*IntegralGetRewardResp)(nil), // 7: IntegralGetRewardResp (*IntegralGetRewardResp)(nil), // 7: IntegralGetRewardResp
(*DBIntegralBoss)(nil), // 8: DBIntegralBoss (*IntegralRankListReq)(nil), // 8: IntegralRankListReq
(*BattleFormation)(nil), // 9: BattleFormation (*IntegralRankListResp)(nil), // 9: IntegralRankListResp
(*BattleInfo)(nil), // 10: BattleInfo (*DBIntegralBoss)(nil), // 10: DBIntegralBoss
(*BattleReport)(nil), // 11: BattleReport (*BattleFormation)(nil), // 11: BattleFormation
(*UserAtno)(nil), // 12: UserAtno (*BattleInfo)(nil), // 12: BattleInfo
(*BattleReport)(nil), // 13: BattleReport
(*UserAtno)(nil), // 14: UserAtno
(*DBIntegralRank)(nil), // 15: DBIntegralRank
} }
var file_integral_integral_msg_proto_depIdxs = []int32{ var file_integral_integral_msg_proto_depIdxs = []int32{
8, // 0: IntegralGetListResp.data:type_name -> DBIntegralBoss 10, // 0: IntegralGetListResp.data:type_name -> DBIntegralBoss
9, // 1: IntegralChallengeReq.battle:type_name -> BattleFormation 11, // 1: IntegralChallengeReq.battle:type_name -> BattleFormation
10, // 2: IntegralChallengeResp.info:type_name -> BattleInfo 12, // 2: IntegralChallengeResp.info:type_name -> BattleInfo
11, // 3: IntegralChallengeOverReq.report:type_name -> BattleReport 13, // 3: IntegralChallengeOverReq.report:type_name -> BattleReport
8, // 4: IntegralChallengeOverResp.data:type_name -> DBIntegralBoss 10, // 4: IntegralChallengeOverResp.data:type_name -> DBIntegralBoss
8, // 5: IntegralGetRewardResp.data:type_name -> DBIntegralBoss 10, // 5: IntegralGetRewardResp.data:type_name -> DBIntegralBoss
12, // 6: IntegralGetRewardResp.award:type_name -> UserAtno 14, // 6: IntegralGetRewardResp.award:type_name -> UserAtno
7, // [7:7] is the sub-list for method output_type 15, // 7: IntegralRankListResp.ranks:type_name -> DBIntegralRank
7, // [7:7] is the sub-list for method input_type 8, // [8:8] is the sub-list for method output_type
7, // [7:7] is the sub-list for extension type_name 8, // [8:8] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension extendee 8, // [8:8] is the sub-list for extension type_name
0, // [0:7] is the sub-list for field type_name 8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
} }
func init() { file_integral_integral_msg_proto_init() } func init() { file_integral_integral_msg_proto_init() }
@ -626,6 +732,30 @@ func file_integral_integral_msg_proto_init() {
return nil return nil
} }
} }
file_integral_integral_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IntegralRankListReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_integral_integral_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IntegralRankListResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -633,7 +763,7 @@ func file_integral_integral_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_integral_integral_msg_proto_rawDesc, RawDescriptor: file_integral_integral_msg_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 8, NumMessages: 10,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },