32 lines
749 B
Go
32 lines
749 B
Go
package arena
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.ArenaInfoReq) (code pb.ErrorCode) {
|
|
|
|
return
|
|
}
|
|
|
|
///获取自己的排行榜信息
|
|
func (this *apiComp) Info(session comm.IUserSession, req *pb.ArenaInfoReq) (code pb.ErrorCode, data proto.Message) {
|
|
var (
|
|
info *pb.DBArenaUser
|
|
err error
|
|
)
|
|
if code = this.InfoCheck(session, req); code != pb.ErrorCode_Success {
|
|
return
|
|
}
|
|
if info, err = this.module.modelArena.queryPlayerInfo(session.GetUserId()); err != nil {
|
|
code = pb.ErrorCode_DBError
|
|
return
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), "Info", &pb.ArenaInfoResp{Info: info})
|
|
return
|
|
}
|