Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
69dc6c91ec
@ -62,19 +62,22 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (e
|
|||||||
}
|
}
|
||||||
|
|
||||||
//查询昵称是否重复
|
//查询昵称是否重复
|
||||||
// if ok := this.module.modelUser.NickNameIsExist(req.NickName); !ok {
|
if req.NickName != "" {
|
||||||
// errdata = &pb.ErrorData{
|
if ok := this.module.modelUser.NickNameIsExist(req.NickName); !ok {
|
||||||
// Code: pb.ErrorCode_UserNickNameExist,
|
errdata = &pb.ErrorData{
|
||||||
// Title: pb.ErrorCode_UserNickNameExist.ToString(),
|
Code: pb.ErrorCode_UserNickNameExist,
|
||||||
// }
|
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,14 +98,6 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (e
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype72, 1))
|
|
||||||
session.SendMsg(string(this.module.GetType()), UserSubTypeCreate, &pb.UserCreateResp{
|
|
||||||
NickName: req.NickName,
|
|
||||||
Figure: req.Figure,
|
|
||||||
Gender: req.Gender,
|
|
||||||
Award: award,
|
|
||||||
})
|
|
||||||
//初始化创角资源
|
//初始化创角资源
|
||||||
if val, err := this.module.configure.GetGlobalInitConf(); err == nil {
|
if val, err := this.module.configure.GetGlobalInitConf(); err == nil {
|
||||||
for _, v := range val.GetDataList() {
|
for _, v := range val.GetDataList() {
|
||||||
@ -112,13 +107,21 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (e
|
|||||||
this.module.Error("发放资源失败!", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "err", Value: errdata.String()})
|
this.module.Error("发放资源失败!", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "err", Value: errdata.String()})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype72, 1))
|
||||||
|
session.SendMsg(string(this.module.GetType()), UserSubTypeCreate, &pb.UserCreateResp{
|
||||||
|
NickName: req.NickName,
|
||||||
|
Figure: req.Figure,
|
||||||
|
Gender: req.Gender,
|
||||||
|
Award: award,
|
||||||
|
})
|
||||||
|
|
||||||
//异步逻辑
|
//异步逻辑
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||||
this.mail.SendMailByCid(session, comm.Welcomemail, nil)
|
this.mail.SendMailByCid(session, comm.Welcomemail, nil)
|
||||||
if len(tasks) > 0 {
|
if len(tasks) > 0 {
|
||||||
this.module.ModuleBuried.TriggerBuried(session, tasks...)
|
this.module.ModuleBuried.TriggerBuried(session, tasks...)
|
||||||
}
|
}
|
||||||
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "UserCreateReq", res)
|
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "UserCreateReq", award)
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user