diff --git a/modules/hunting/api_ranklist.go b/modules/hunting/api_ranklist.go index 913999b5e..57b78267c 100644 --- a/modules/hunting/api_ranklist.go +++ b/modules/hunting/api_ranklist.go @@ -28,7 +28,7 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.HuntingRankList if errdata = this.RankListCheck(session, req); errdata != nil { return // 参数校验失败直接返回 } - if uids, err = this.module.modulerank.querySRankUser(int(req.BoosType)); err != nil { + if uids, err = this.module.modulerank.querySRankUser(int(req.BoosType),int(req.Nandu)); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, Title: pb.ErrorCode_DBError.ToString(), diff --git a/modules/hunting/model_rank.go b/modules/hunting/model_rank.go index 963105768..74244d38c 100644 --- a/modules/hunting/model_rank.go +++ b/modules/hunting/model_rank.go @@ -53,12 +53,12 @@ func (this *ModelRank) getHuntingRank(uid string) *pb.DBHuntingRecord { } // 获取排行榜前50的用户名单 -func (this *ModelRank) querySRankUser(bossid int) (ranks []string, err error) { +func (this *ModelRank) querySRankUser(bossid int,nandu int) (ranks []string, err error) { var ( result []string tableName string ) - tableName = fmt.Sprintf("%s-%s", db.CrossTag(), this.TableName+strconv.Itoa(int(bossid))) + tableName = fmt.Sprintf("%s-%s-%s", db.CrossTag(), this.TableName+strconv.Itoa(int(bossid)),strconv.Itoa(int(nandu))) if result, err = this.Redis.ZRevRange(tableName, 0, comm.MinRankList).Result(); err != nil { //this.module.Errorln(err) return @@ -173,7 +173,7 @@ func (this *ModelRank) CheckRank(uid string, boosID int32, difficulty int32, lin score int32 ) score = difficulty*10000 + (10000 - costTime) - tableName = fmt.Sprintf("%s-%s", db.CrossTag(), this.TableName+strconv.Itoa(int(boosID))) + tableName = fmt.Sprintf("%s-%s-%s", db.CrossTag(), this.TableName+strconv.Itoa(int(boosID)),strconv.Itoa(int(difficulty))) menbers = &redis.Z{Score: float64(score), Member: uid} if cmd := pipe.ZAdd(tableName, menbers); cmd != nil { diff --git a/pb/hunting_msg.pb.go b/pb/hunting_msg.pb.go index 0c41f2273..6b525011f 100644 --- a/pb/hunting_msg.pb.go +++ b/pb/hunting_msg.pb.go @@ -493,6 +493,7 @@ type HuntingRankListReq struct { unknownFields protoimpl.UnknownFields BoosType int32 `protobuf:"varint,1,opt,name=boosType,proto3" json:"boosType"` // boss 类型 + Nandu int32 `protobuf:"varint,2,opt,name=nandu,proto3" json:"nandu"` } func (x *HuntingRankListReq) Reset() { @@ -534,6 +535,13 @@ func (x *HuntingRankListReq) GetBoosType() int32 { return 0 } +func (x *HuntingRankListReq) GetNandu() int32 { + if x != nil { + return x.Nandu + } + return 0 +} + type HuntingRankListResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -786,34 +794,35 @@ var file_hunting_hunting_msg_proto_rawDesc = []byte{ 0x22, 0x30, 0x0a, 0x0e, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x22, 0x30, 0x0a, 0x12, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, + 0x74, 0x61, 0x22, 0x46, 0x0a, 0x12, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x73, - 0x54, 0x79, 0x70, 0x65, 0x22, 0x63, 0x0a, 0x13, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, - 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x05, 0x72, - 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x48, - 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, - 0x73, 0x12, 0x26, 0x0a, 0x06, 0x66, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, - 0x6b, 0x52, 0x06, 0x66, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x22, 0xcd, 0x01, 0x0a, 0x0f, 0x48, 0x75, - 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x77, 0x65, 0x65, 0x70, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, - 0x06, 0x62, 0x6f, 0x73, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, - 0x6f, 0x73, 0x73, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, - 0x6c, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, - 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x73, 0x77, 0x65, 0x65, 0x70, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x73, 0x77, 0x65, 0x65, 0x70, 0x6e, 0x75, 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x69, - 0x73, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, - 0x69, 0x73, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x77, 0x65, - 0x65, 0x70, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, - 0x77, 0x65, 0x65, 0x70, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x38, 0x0a, 0x10, 0x48, 0x75, 0x6e, - 0x74, 0x69, 0x6e, 0x67, 0x53, 0x77, 0x65, 0x65, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, - 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x53, 0x77, 0x65, 0x65, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x22, 0x63, 0x0a, 0x13, 0x48, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, + 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x66, 0x72, 0x61, 0x6e, 0x6b, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x06, 0x66, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x22, + 0xcd, 0x01, 0x0a, 0x0f, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x77, 0x65, 0x65, 0x70, + 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x73, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x6f, 0x73, 0x73, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, + 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x28, 0x0a, 0x06, 0x62, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, + 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x77, 0x65, 0x65, 0x70, 0x6e, 0x75, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x77, 0x65, 0x65, 0x70, 0x6e, 0x75, + 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x6e, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x6e, 0x64, 0x12, + 0x1e, 0x0a, 0x0a, 0x73, 0x77, 0x65, 0x65, 0x70, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x77, 0x65, 0x65, 0x70, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, + 0x38, 0x0a, 0x10, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x77, 0x65, 0x65, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x53, 0x77, 0x65, 0x65, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (