token验证
parent
91c017cbd5
commit
f5fb83d1b4
|
@ -184,8 +184,8 @@ public class ProtocolsManager implements ProtocolsAbstract {
|
|||
}
|
||||
//检查token
|
||||
// if (checkToken(session,packetNetData) != 0 ){
|
||||
// MessageUtil.sendErrorCode(session,0,"您的账号token不正确,请退出游戏重新登陆!");
|
||||
// return;
|
||||
// MessageUtil.sendErrorCode(session,0,"您的账号token不正确,请退出游戏重新登陆!");
|
||||
// return;
|
||||
// }
|
||||
|
||||
if( packetNetData.getMsgId()== MessageTypeProto.MessageType.RECONNECT_REQUEST_VALUE){
|
||||
|
@ -277,12 +277,16 @@ public class ProtocolsManager implements ProtocolsAbstract {
|
|||
int uid = packetNetData.getUserId();
|
||||
int token = packetNetData.getToken();
|
||||
session.setUid(uid);
|
||||
/* String tokenKey = RedisKey.getKey(RedisKey.TOKEN, String.valueOf(uid),false);
|
||||
int serverToken = Integer.parseInt((String)RedisUtil.getInstence().get(tokenKey));
|
||||
if (token == serverToken){
|
||||
session.setToken(token);
|
||||
return true;
|
||||
}*/
|
||||
// String tokenKey = RedisKey.getKey(RedisKey.TOKEN, String.valueOf(uid),false);
|
||||
// if(null==tokenKey||tokenKey.isEmpty()){
|
||||
// return false;
|
||||
// }
|
||||
// int serverToken = Integer.parseInt((String)RedisUtil.getInstence().get(tokenKey));
|
||||
// if (token == serverToken){
|
||||
// session.setToken(token);
|
||||
// session.setUserLoginTime(System.currentTimeMillis()/1000);
|
||||
// return true;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue