use of com.tvd12.ezyfox.entity.EzyArray in project ezyfox-server-android-client by youngmonkeys.
the class EzyTcpClient method send.
@Override
public void send(EzyCommand cmd, EzyArray data, boolean encrypted) {
boolean shouldEncrypted = encrypted;
if (encrypted && sessionKey == null) {
if (config.isEnableDebug()) {
shouldEncrypted = false;
} else {
throw new IllegalArgumentException("can not send command: " + cmd + " " + "you must enable SSL or enable debug mode by configuration " + "when you create the client");
}
}
EzyArray array = requestSerializer.serialize(cmd, data);
if (socketClient != null) {
socketClient.sendMessage(array, shouldEncrypted);
printSentData(cmd, data);
}
}
use of com.tvd12.ezyfox.entity.EzyArray in project ezyfox-server-android-client by youngmonkeys.
the class EzyAppAccessHandler method handle.
@Override
public void handle(EzyArray data) {
EzyZone zone = client.getZone();
EzyAppManager appManager = zone.getAppManager();
EzyApp app = newApp(zone, data);
appManager.addApp(app);
postHandle(app, data);
}
use of com.tvd12.ezyfox.entity.EzyArray in project ezyfox-server-android-client by youngmonkeys.
the class EzyAppAccessHandler method newApp.
protected EzyApp newApp(EzyZone zone, EzyArray data) {
int appId = data.get(0, int.class);
String appName = data.get(1, String.class);
EzySimpleApp app = new EzySimpleApp(zone, appId, appName);
return app;
}
use of com.tvd12.ezyfox.entity.EzyArray in project ezyfox-server-android-client by youngmonkeys.
the class EzyHandshakeHandler method handleLogin.
protected void handleLogin(EzyArray data) {
EzyRequest loginRequest = getLoginRequest();
client.send(loginRequest);
}
use of com.tvd12.ezyfox.entity.EzyArray in project ezyfox-server-android-client by youngmonkeys.
the class EzyAppExitHandler method handle.
@Override
public void handle(EzyArray data) {
EzyZone zone = client.getZone();
EzyAppManager appManager = zone.getAppManager();
int appId = data.get(0, int.class);
int reasonId = data.get(1, int.class);
EzyApp app = appManager.removeApp(appId);
EzyLogger.info("user exit app: " + app + " reason: " + reasonId);
postHandle(app, data);
}
Aggregations