use of com.tvd12.ezyfox.constant.EzyConstant in project ezyfox-server by youngmonkeys.
the class EzySimpleDataHandler method handleReceivedData.
protected void handleReceivedData(EzyConstant cmd, EzyArray msg) {
EzyArray data = msg.get(1, EzyArray.class);
debugLogReceivedData(cmd, data);
updateSessionBeforeHandleRequest();
handleRequest(cmd, data);
}
use of com.tvd12.ezyfox.constant.EzyConstant in project ezyfox-server by youngmonkeys.
the class EzyUserDataHandler method newRequest.
@SuppressWarnings({ "rawtypes" })
protected EzyRequest newRequest(EzyConstant cmd, EzyArray data) {
EzySimpleRequest request = requestFactory.newRequest(cmd);
request.setSession(session);
request.setUser(user);
request.deserializeParams(data);
return request;
}
use of com.tvd12.ezyfox.constant.EzyConstant in project ezyfox-server by youngmonkeys.
the class EzyZoneUserManagerImpl method unmapSessionUser.
@Override
public void unmapSessionUser(EzySession session, EzyConstant reason) {
EzyUser user = usersBySession.remove(session);
if (user != null) {
user.removeSession(session);
logger.debug("zone: {} remove session {} from user {} by reason {}, " + "user remain: {} sessions, usersBySession.size: {}", zoneName, session.getClientAddress(), user, reason, user.getSessionCount(), usersBySession.size());
if (shouldRemoveUserNow(user)) {
removeUser(user, reason);
}
}
}
use of com.tvd12.ezyfox.constant.EzyConstant in project ezyfox-server by youngmonkeys.
the class EzySocketUserRemovalHandler method processUserRemoval.
private void processUserRemoval(EzySocketUserRemoval removal) {
try {
EzyUser user = removal.getUser();
try {
EzyConstant reason = removal.getReason();
EzyZoneContext zoneContext = removal.getZoneContext();
EzyUserRemovedEvent event = newUserRemovedEvent(user, reason);
removeUserFromApps(zoneContext, event);
notifyUserRemovedToPlugins(zoneContext, event);
} finally {
user.destroy();
}
logger.debug("user {} has destroyed", user);
} finally {
removal.release();
}
}
Aggregations