修复在线玩家
This commit is contained in:
parent
457ed31fff
commit
d3f0f0aada
@ -45,12 +45,19 @@ func (this *ModelSession) getUserSession(uid string) (user *pb.CacheUser) {
|
||||
|
||||
// 设置用户session
|
||||
func (this *ModelSession) addUserSession(uid string, session comm.IUserSession) (err error) {
|
||||
if err = this.AddList(comm.RDS_EMPTY, uid, map[string]interface{}{
|
||||
"uid": uid,
|
||||
"sessionId": session.GetSessionId(),
|
||||
"serviceTag": session.GetServiecTag(),
|
||||
"gatewayServiceId": session.GetGatewayServiceId(),
|
||||
"ip": session.GetIP(),
|
||||
// if err = this.AddList(comm.RDS_EMPTY, uid, map[string]interface{}{
|
||||
// "uid": uid,
|
||||
// "sessionId": session.GetSessionId(),
|
||||
// "serviceTag": session.GetServiecTag(),
|
||||
// "gatewayServiceId": session.GetGatewayServiceId(),
|
||||
// "ip": session.GetIP(),
|
||||
// }, db.SetDBMgoLog(false)); err != nil {
|
||||
if err = this.AddList(comm.RDS_EMPTY, uid, &pb.CacheUser{
|
||||
Uid: uid,
|
||||
SessionId: session.GetSessionId(),
|
||||
ServiceTag: session.GetServiecTag(),
|
||||
GatewayServiceId: session.GetGatewayServiceId(),
|
||||
Ip: session.GetIP(),
|
||||
}, db.SetDBMgoLog(false)); err != nil {
|
||||
log.Debug("setUserSession err:%v", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err})
|
||||
return
|
||||
|
@ -196,12 +196,19 @@ func (this *SCompGateRoute) NoticeUserLogin(ctx context.Context, args *pb.Notice
|
||||
return err
|
||||
}
|
||||
model := db.NewDBModel(comm.TableSession, 0, conn)
|
||||
model.AddList(comm.RDS_EMPTY, args.UserId, map[string]interface{}{
|
||||
"uid": args.UserId,
|
||||
"sessionId": args.UserSessionId,
|
||||
"serviceTag": args.ServiceTag,
|
||||
"gatewayServiceId": args.GatewayServiceId,
|
||||
"ip": args.Ip,
|
||||
// model.AddList(comm.RDS_EMPTY, args.UserId, map[string]interface{}{
|
||||
// "uid": args.UserId,
|
||||
// "sessionId": args.UserSessionId,
|
||||
// "serviceTag": args.ServiceTag,
|
||||
// "gatewayServiceId": args.GatewayServiceId,
|
||||
// "ip": args.Ip,
|
||||
// }, db.SetDBMgoLog(false))
|
||||
model.AddList(comm.RDS_EMPTY, args.UserId, &pb.CacheUser{
|
||||
Uid: args.UserId,
|
||||
SessionId: args.UserSessionId,
|
||||
ServiceTag: args.ServiceTag,
|
||||
GatewayServiceId: args.GatewayServiceId,
|
||||
Ip: args.Ip,
|
||||
}, db.SetDBMgoLog(false))
|
||||
session := this.pools.Get().(comm.IUserSession)
|
||||
session.SetSession(args.Ip, args.UserSessionId, args.ServiceTag, args.GatewayServiceId, args.UserId)
|
||||
|
Loading…
Reference in New Issue
Block a user