Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
aa8914c14e
@ -95,7 +95,7 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
||||
subsit := true
|
||||
for i, v := range equipments { //校验装备位置
|
||||
if v != nil {
|
||||
if i+1 != int(confs[i].Pos) {
|
||||
if i != int(confs[i].Pos) {
|
||||
log.Errorf("Equip conf:%+v Target:%d Incorrect range!", confs[i], i)
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
|
@ -122,6 +122,11 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
|
||||
this.module.Errorf("Upgrade code:%d", code)
|
||||
return
|
||||
}
|
||||
if conf.Pos >= 6 {
|
||||
code = pb.ErrorCode_ConfigurationException
|
||||
this.module.Errorf("Upgrade equipment Pos:%d", conf.Pos)
|
||||
return
|
||||
}
|
||||
hero.EquipID[conf.Pos] = equipment.Id //拆分后的装备是一个新的
|
||||
for i, v := range hero.EquipID {
|
||||
if v != "" {
|
||||
|
@ -60,11 +60,7 @@ func (this *User) GetUser(uid string) *pb.DBUser {
|
||||
|
||||
//获取用户会话
|
||||
func (this *User) GetUserSession(uid string) *pb.CacheUser {
|
||||
cuser := this.modelSession.getUserSession(uid)
|
||||
if cuser.Uid == "" {
|
||||
return nil
|
||||
}
|
||||
return cuser
|
||||
return this.modelSession.getUserSession(uid)
|
||||
}
|
||||
|
||||
// 清除session
|
||||
|
@ -186,7 +186,7 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag
|
||||
//RPC_NoticeUserClose 接收用户登录通知
|
||||
func (this *SCompGateRoute) NoticeUserLogin(ctx context.Context, args *pb.NoticeUserLoginReq, reply *pb.RPCMessageReply) error {
|
||||
model := db.NewDBModel(comm.TableSession, db.Local())
|
||||
model.Change(args.UserId, map[string]interface{}{
|
||||
model.AddList("online", args.UserId, map[string]interface{}{
|
||||
"uid": args.UserId,
|
||||
"sessionId": args.UserSessionId,
|
||||
"serviceTag": args.ServiceTag,
|
||||
|
Loading…
Reference in New Issue
Block a user