use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server by youngmonkeys.
the class EzyPluginInfoController method handle.
@Override
public void handle(EzyServerContext ctx, EzyPluginInfoRequest request) {
EzyUser user = request.getUser();
EzySession session = request.getSession();
EzyPluginInfoParams params = request.getParams();
EzyZoneContext zoneCtx = ctx.getZoneContext(user.getZoneId());
EzyPluginContext pluginCtx = zoneCtx.getPluginContext(params.getPluginName());
if (pluginCtx != null) {
EzyPluginSetting setting = pluginCtx.getPlugin().getSetting();
EzyResponse response = newPluginInfoResponse(setting);
ctx.send(response, session, false);
}
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server by youngmonkeys.
the class EzySimpleAppUserDelegate method handleUserRemovedEvent.
protected void handleUserRemovedEvent(EzyUser user, EzyConstant reason) {
EzyEvent event = new EzySimpleUserRemovedEvent(user, reason);
appContext.handleEvent(EzyEventType.USER_REMOVED, event);
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server by youngmonkeys.
the class EzySimpleUserDelegate method onUserRemoved.
@Override
public void onUserRemoved(EzyUser user, EzyConstant reason) {
EzyZoneContext zoneContext = serverContext.getZoneContext(user.getZoneId());
EzySocketUserRemoval removal = new EzySimpleSocketUserRemoval(zoneContext, user, reason);
userRemovalQueue.add(removal);
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server by youngmonkeys.
the class EzySynchronizedUserManager method addUser.
@Override
public EzyUser addUser(EzyUser user) {
EzyUser answer;
synchronized (synchronizedLock) {
answer = doAddUser(user);
}
logger.info("{} add user: {}, locks.size = {}, usersById.size = {}, usersByName.size = {}", getMessagePrefix(), user, locks.size(), usersById.size(), usersByName.size());
return answer;
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server by youngmonkeys.
the class EzyLoginControllerTest method testSetUserProperties.
@Test
public void testSetUserProperties() {
EzySimpleServerContext ctx = (EzySimpleServerContext) newServerContext();
EzySimpleServer server = (EzySimpleServer) ctx.getServer();
server.setResponseApi(mock(EzyResponseApi.class));
EzySession session = newSession();
session.setToken("abcdef");
EzyArray data = newLoginData();
EzySimpleLoginRequest request = new EzySimpleLoginRequest();
request.deserializeParams(data);
request.setSession(session);
EzyLoginProcessor processor = new EzyLoginProcessor(ctx);
EzyZoneContext zoneContext = ctx.getZoneContext("example");
EzyLoginParams params = request.getParams();
EzySimpleUserLoginEvent event = new EzySimpleUserLoginEvent(session, params.getZoneName(), params.getUsername(), params.getPassword(), params.getData());
event.setUserProperty("dataId", 123L);
processor.apply(zoneContext, event);
event.release();
EzyZoneUserManager userManager = zoneContext.getZone().getUserManager();
EzyUser user = userManager.getUser("dungtv");
assert user.getProperty("dataId").equals(123L);
}
Aggregations