上传创号修改

This commit is contained in:
liwei1dao 2023-11-14 20:43:15 +08:00
parent 30d611525f
commit 7d95d4523d
2 changed files with 20 additions and 17 deletions

View File

@ -62,19 +62,19 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (e
} }
//查询昵称是否重复 //查询昵称是否重复
if ok := this.module.modelUser.NickNameIsExist(req.NickName); !ok { // if ok := this.module.modelUser.NickNameIsExist(req.NickName); !ok {
errdata = &pb.ErrorData{ // errdata = &pb.ErrorData{
Code: pb.ErrorCode_UserNickNameExist, // Code: pb.ErrorCode_UserNickNameExist,
Title: pb.ErrorCode_UserNickNameExist.ToString(), // Title: pb.ErrorCode_UserNickNameExist.ToString(),
} // }
return // return
} // }
update := map[string]interface{}{ update := map[string]interface{}{
"name": req.NickName, //设置昵称 // "name": req.NickName, //设置昵称
"created": true, //创角标识 "created": true, //创角标识
"figure": req.Figure, //设置形象 "figure": req.Figure, //设置形象
"gender": req.Gender, //设置性别 "gender": req.Gender, //设置性别
"ps": 0, //设置初始体力 调整未0 由策划初始表发放 "ps": 0, //设置初始体力 调整未0 由策划初始表发放
} }
globalConf := this.module.globalConf globalConf := this.module.globalConf
if req.Gender == 0 { if req.Gender == 0 {
@ -95,9 +95,8 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (e
) )
return return
} }
if req.Figure != 0 {
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype72, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype72, 1))
}
session.SendMsg(string(this.module.GetType()), UserSubTypeCreate, &pb.UserCreateResp{ session.SendMsg(string(this.module.GetType()), UserSubTypeCreate, &pb.UserCreateResp{
NickName: req.NickName, NickName: req.NickName,
Figure: req.Figure, Figure: req.Figure,

View File

@ -72,8 +72,8 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err
firstLogin = true firstLogin = true
expand = &pb.DBUserExpand{} expand = &pb.DBUserExpand{}
user.CurSkin = this.module.ModuleTools.GetGlobalConf().Initper.T // user.CurSkin = this.module.ModuleTools.GetGlobalConf().Initper.T
user.Skins = []string{user.CurSkin} // user.Skins = []string{user.CurSkin}
} }
// 玩家是否封号 // 玩家是否封号
if user.Ban { if user.Ban {
@ -146,6 +146,10 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err
return return
} }
session.SetSession(session.GetIP(), session.GetSessionId(), session.GetServiecTag(), session.GetGatewayServiceId(), user.Uid) session.SetSession(session.GetIP(), session.GetSessionId(), session.GetServiecTag(), session.GetGatewayServiceId(), user.Uid)
if user.CurSkin == "" {
user.CurSkin = this.module.ModuleTools.GetGlobalConf().Initper.T
}
session.SendMsg(string(this.module.GetType()), UserSubTypeLogin, &pb.UserLoginResp{ session.SendMsg(string(this.module.GetType()), UserSubTypeLogin, &pb.UserLoginResp{
Data: user, Data: user,
Ex: expand, Ex: expand,