一些bug
This commit is contained in:
parent
643808f353
commit
0c2b4fcd1c
@ -54,6 +54,8 @@ type (
|
|||||||
GetSpecifiedHero(session IUserSession, heroConfId string, star, lv, amount int32) (code pb.ErrorCode)
|
GetSpecifiedHero(session IUserSession, heroConfId string, star, lv, amount int32) (code pb.ErrorCode)
|
||||||
// 英雄加经验
|
// 英雄加经验
|
||||||
AddHeroExp(session IUserSession, heroObjID string, exp int32) (code pb.ErrorCode)
|
AddHeroExp(session IUserSession, heroObjID string, exp int32) (code pb.ErrorCode)
|
||||||
|
// 英雄练功
|
||||||
|
//KungFuHero(session IUserSession, heroObjID string) (code pb.ErrorCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
//玩家
|
//玩家
|
||||||
|
@ -29,7 +29,6 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
|
|||||||
code = pb.ErrorCode_PagodaNotFound
|
code = pb.ErrorCode_PagodaNotFound
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
req.PagodaType = 101
|
|
||||||
cfg := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID)
|
cfg := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID)
|
||||||
if cfg == nil {
|
if cfg == nil {
|
||||||
code = pb.ErrorCode_PagodaNotFound
|
code = pb.ErrorCode_PagodaNotFound
|
||||||
@ -54,12 +53,13 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
|
|||||||
rst.Uid = session.GetUserId()
|
rst.Uid = session.GetUserId()
|
||||||
rst.Id = primitive.NewObjectID().Hex()
|
rst.Id = primitive.NewObjectID().Hex()
|
||||||
rst.Type = req.PagodaType
|
rst.Type = req.PagodaType
|
||||||
rst.Nickname = "123"
|
rst.Nickname = this.module.ModuleUser.GetUser(session.GetUserId()).Name
|
||||||
|
rst.Lv = this.module.ModuleUser.GetUser(session.GetUserId()).Lv
|
||||||
rst.PagodaId = pagoda.PagodaId
|
rst.PagodaId = pagoda.PagodaId
|
||||||
this.module.modulerank.AddRank(session.GetUserId(), rst)
|
this.module.modulerank.AddRank(session.GetUserId(), rst)
|
||||||
} else {
|
} else {
|
||||||
mapData := make(map[string]interface{}, 0)
|
mapData := make(map[string]interface{}, 0)
|
||||||
mapData["pagodaId"] = pagoda.PagodaId
|
mapData["pagodaId"] = cfg.LayerNum
|
||||||
mapData["type"] = pagoda.Type
|
mapData["type"] = pagoda.Type
|
||||||
|
|
||||||
this.module.modulerank.ChangeUserRank(session.GetUserId(), mapData)
|
this.module.modulerank.ChangeUserRank(session.GetUserId(), mapData)
|
||||||
|
@ -31,7 +31,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq
|
|||||||
//_mData := make(map[string]interface{}, 0)
|
//_mData := make(map[string]interface{}, 0)
|
||||||
result.Uid = session.GetUserId()
|
result.Uid = session.GetUserId()
|
||||||
result.PagodaId = 1 // 初始数据1层
|
result.PagodaId = 1 // 初始数据1层
|
||||||
//_mData[result.Id] = result
|
result.Type = 101
|
||||||
this.module.modelPagoda.addNewPagoda(session.GetUserId(), result)
|
this.module.modelPagoda.addNewPagoda(session.GetUserId(), result)
|
||||||
session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: result})
|
session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: result})
|
||||||
return
|
return
|
||||||
|
@ -8,14 +8,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) RankLisCheck(session comm.IUserSession, req *pb.PagodaRankListReq) (code pb.ErrorCode) {
|
func (this *apiComp) RankListCheck(session comm.IUserSession, req *pb.PagodaRankListReq) (code pb.ErrorCode) {
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *apiComp) RankLis(session comm.IUserSession, req *pb.PagodaRankListReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) RankList(session comm.IUserSession, req *pb.PagodaRankListReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
|
|
||||||
code = this.RankLisCheck(session, req)
|
code = this.RankListCheck(session, req)
|
||||||
if code != pb.ErrorCode_Success {
|
if code != pb.ErrorCode_Success {
|
||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ func (this *ModelRank) ChangeUserRank(uid string, value map[string]interface{})
|
|||||||
// 临时测试
|
// 临时测试
|
||||||
func (this *ModelRank) GetRankData(floorId int32, pagodaType int32) (data []*pb.DBPagodaRank, err error) {
|
func (this *ModelRank) GetRankData(floorId int32, pagodaType int32) (data []*pb.DBPagodaRank, err error) {
|
||||||
if floorId == 0 {
|
if floorId == 0 {
|
||||||
if _data, err := this.DB.Find(comm.TablePagodaRank, bson.M{"type": pagodaType}, options.Find().SetSort(bson.M{"pagodaId": 1})); err == nil {
|
if _data, err := this.DB.Find(comm.TablePagodaRank, bson.M{"type": pagodaType}, options.Find().SetSort(bson.M{"pagodaId": -1})); err == nil {
|
||||||
for _data.Next(context.TODO()) {
|
for _data.Next(context.TODO()) {
|
||||||
temp := &pb.DBPagodaRank{}
|
temp := &pb.DBPagodaRank{}
|
||||||
if err = _data.Decode(temp); err == nil {
|
if err = _data.Decode(temp); err == nil {
|
||||||
@ -71,7 +71,7 @@ func (this *ModelRank) GetRankData(floorId int32, pagodaType int32) (data []*pb.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if _data, err := this.DB.Find(comm.TablePagodaRank, bson.M{"pagodaId": bson.M{"$gte": floorId}, "type": pagodaType}, options.Find().SetSort(bson.M{"pagodaId": 1})); err == nil {
|
if _data, err := this.DB.Find(comm.TablePagodaRank, bson.M{"pagodaId": bson.M{"$gte": floorId}, "type": pagodaType}, options.Find().SetSort(bson.M{"pagodaId": -1})); err == nil {
|
||||||
for _data.Next(context.TODO()) {
|
for _data.Next(context.TODO()) {
|
||||||
temp := &pb.DBPagodaRank{}
|
temp := &pb.DBPagodaRank{}
|
||||||
if err = _data.Decode(temp); err == nil {
|
if err = _data.Decode(temp); err == nil {
|
||||||
|
@ -110,6 +110,8 @@ type DBPagodaRank struct {
|
|||||||
Type int32 `protobuf:"varint,4,opt,name=type,proto3" json:"type"` // 塔类型
|
Type int32 `protobuf:"varint,4,opt,name=type,proto3" json:"type"` // 塔类型
|
||||||
Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname"` // 昵称
|
Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname"` // 昵称
|
||||||
Icon string `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon"` // 头像
|
Icon string `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon"` // 头像
|
||||||
|
Lv int32 `protobuf:"varint,7,opt,name=lv,proto3" json:"lv"` // 等级
|
||||||
|
CostTime int32 `protobuf:"varint,8,opt,name=costTime,proto3" json:"costTime" bson:"costTime"` //塔层
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DBPagodaRank) Reset() {
|
func (x *DBPagodaRank) Reset() {
|
||||||
@ -186,6 +188,20 @@ func (x *DBPagodaRank) GetIcon() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DBPagodaRank) GetLv() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Lv
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBPagodaRank) GetCostTime() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.CostTime
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
var File_pagoda_pagoda_db_proto protoreflect.FileDescriptor
|
var File_pagoda_pagoda_db_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_pagoda_pagoda_db_proto_rawDesc = []byte{
|
var file_pagoda_pagoda_db_proto_rawDesc = []byte{
|
||||||
@ -203,7 +219,7 @@ var file_pagoda_pagoda_db_proto_rawDesc = []byte{
|
|||||||
0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
|
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,
|
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,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
|
||||||
0x01, 0x22, 0x90, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61,
|
0x01, 0x22, 0xbc, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61,
|
||||||
0x6e, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
|
0x6e, 0x6b, 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,
|
0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x49, 0x64,
|
0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x49, 0x64,
|
||||||
@ -212,8 +228,10 @@ var file_pagoda_pagoda_db_proto_rawDesc = []byte{
|
|||||||
0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65,
|
0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65,
|
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
||||||
0x69, 0x63, 0x6f, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
0x69, 0x63, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05,
|
||||||
0x6f, 0x74, 0x6f, 0x33,
|
0x52, 0x02, 0x6c, 0x76, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65,
|
||||||
|
0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65,
|
||||||
|
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user