Search in sources :

Example 96 with EzyArray

use of com.tvd12.ezyfoxserver.client.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);
    }
}
Also used : EzyArray(com.tvd12.ezyfoxserver.client.entity.EzyArray)

Example 97 with EzyArray

use of com.tvd12.ezyfoxserver.client.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);
}
Also used : EzyZone(com.tvd12.ezyfoxserver.client.entity.EzyZone) EzyApp(com.tvd12.ezyfoxserver.client.entity.EzyApp) EzyAppManager(com.tvd12.ezyfoxserver.client.manager.EzyAppManager)

Example 98 with EzyArray

use of com.tvd12.ezyfoxserver.client.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;
}
Also used : EzySimpleApp(com.tvd12.ezyfoxserver.client.entity.EzySimpleApp)

Example 99 with EzyArray

use of com.tvd12.ezyfoxserver.client.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);
}
Also used : EzyRequest(com.tvd12.ezyfoxserver.client.request.EzyRequest)

Example 100 with EzyArray

use of com.tvd12.ezyfoxserver.client.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);
}
Also used : EzyZone(com.tvd12.ezyfoxserver.client.entity.EzyZone) EzyApp(com.tvd12.ezyfoxserver.client.entity.EzyApp) EzyAppManager(com.tvd12.ezyfoxserver.client.manager.EzyAppManager)

Aggregations

EzyArray (com.tvd12.ezyfox.entity.EzyArray)80 Test (org.testng.annotations.Test)45 EzySession (com.tvd12.ezyfoxserver.entity.EzySession)30 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)17 EzyResponseApi (com.tvd12.ezyfoxserver.api.EzyResponseApi)15 EzyAbstractSession (com.tvd12.ezyfoxserver.entity.EzyAbstractSession)14 EzySimpleServer (com.tvd12.ezyfoxserver.EzySimpleServer)13 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)13 EzySimpleLoginRequest (com.tvd12.ezyfoxserver.request.EzySimpleLoginRequest)13 FieldSetting (com.tvd12.dahlia.core.setting.FieldSetting)12 EzyObject (com.tvd12.ezyfox.entity.EzyObject)12 EzyLoginController (com.tvd12.ezyfoxserver.controller.EzyLoginController)12 EzySimpleUser (com.tvd12.ezyfoxserver.entity.EzySimpleUser)11 EzySimpleServerContext (com.tvd12.ezyfoxserver.context.EzySimpleServerContext)9 CollectionSetting (com.tvd12.dahlia.core.setting.CollectionSetting)8 BaseCoreTest (com.tvd12.ezyfoxserver.testing.BaseCoreTest)8 Collection (com.tvd12.dahlia.core.entity.Collection)7 EzyArray (com.tvd12.ezyfoxserver.client.entity.EzyArray)7 EzySessionManager (com.tvd12.ezyfoxserver.wrapper.EzySessionManager)7 Record (com.tvd12.dahlia.core.entity.Record)5