Search in sources :

Example 6 with EzyAppSetup

use of com.tvd12.ezyfoxserver.command.EzyAppSetup in project ezyfox-server-example by tvd12.

the class SimpleChatClient method setup.

protected EzyClient setup() {
    EzyClientConfig clientConfig = EzyClientConfig.builder().zoneName(ZONE_NAME).build();
    EzyClients clients = EzyClients.getInstance();
    EzyClient client = new EzyUTClient(clientConfig);
    clients.addClient(client);
    EzySetup setup = client.setup();
    setup.addEventHandler(EzyEventType.CONNECTION_SUCCESS, new EzyConnectionSuccessHandler());
    setup.addEventHandler(EzyEventType.CONNECTION_FAILURE, new EzyConnectionFailureHandler());
    setup.addDataHandler(EzyCommand.HANDSHAKE, new ExHandshakeEventHandler());
    setup.addDataHandler(EzyCommand.LOGIN, new ExLoginSuccessHandler());
    setup.addDataHandler(EzyCommand.APP_ACCESS, new ExAccessAppHandler());
    EzyAppSetup appSetup = setup.setupApp(APP_NAME);
    appSetup.addDataHandler("chat/sendMessage", new ChatSendMessageResponseHandler());
    appSetup.addDataHandler("greet", new ChatGreetResponseHandler());
    appSetup.addDataHandler("hello", new ChatHelloResponseHandler());
    return client;
}
Also used : EzyAppSetup(com.tvd12.ezyfoxserver.client.setup.EzyAppSetup) EzyClientConfig(com.tvd12.ezyfoxserver.client.config.EzyClientConfig) EzyClient(com.tvd12.ezyfoxserver.client.EzyClient) EzyConnectionFailureHandler(com.tvd12.ezyfoxserver.client.handler.EzyConnectionFailureHandler) EzyUTClient(com.tvd12.ezyfoxserver.client.EzyUTClient) EzySetup(com.tvd12.ezyfoxserver.client.setup.EzySetup) EzyConnectionSuccessHandler(com.tvd12.ezyfoxserver.client.handler.EzyConnectionSuccessHandler) EzyClients(com.tvd12.ezyfoxserver.client.EzyClients)

Example 7 with EzyAppSetup

use of com.tvd12.ezyfoxserver.command.EzyAppSetup in project ezyfox-server by youngmonkeys.

the class EzySimpleAppEntry method setAppRequestController.

private void setAppRequestController(EzyAppContext appContext, EzyBeanContext beanContext) {
    EzyAppSetup setup = appContext.get(EzyAppSetup.class);
    EzyAppRequestController controller = newUserRequestController(beanContext);
    setup.setRequestController(controller);
    Set<String> commands = ((EzyCommandsAware) controller).getCommands();
    appContext.setProperty(COMMANDS, commands);
}
Also used : EzyCommandsAware(com.tvd12.ezyfoxserver.support.controller.EzyCommandsAware) EzyAppSetup(com.tvd12.ezyfoxserver.command.EzyAppSetup) EzyAppRequestController(com.tvd12.ezyfoxserver.app.EzyAppRequestController)

Aggregations

EzyAppSetup (com.tvd12.ezyfoxserver.client.setup.EzyAppSetup)4 EzySetup (com.tvd12.ezyfoxserver.client.setup.EzySetup)4 EzyClient (com.tvd12.ezyfoxserver.client.EzyClient)3 EzyClients (com.tvd12.ezyfoxserver.client.EzyClients)3 EzyUTClient (com.tvd12.ezyfoxserver.client.EzyUTClient)3 EzyClientConfig (com.tvd12.ezyfoxserver.client.config.EzyClientConfig)3 EzyData (com.tvd12.ezyfox.entity.EzyData)2 EzyApp (com.tvd12.ezyfoxserver.client.entity.EzyApp)2 EzyAppSetup (com.tvd12.ezyfoxserver.command.EzyAppSetup)2 EzyBeanContext (com.tvd12.ezyfox.bean.EzyBeanContext)1 EzySingleton (com.tvd12.ezyfox.bean.annotation.EzySingleton)1 EzyArray (com.tvd12.ezyfox.entity.EzyArray)1 EzyObject (com.tvd12.ezyfox.entity.EzyObject)1 EzyStrings (com.tvd12.ezyfox.io.EzyStrings)1 EzyEntityObjects (com.tvd12.ezyfox.util.EzyEntityObjects)1 EzyApplication (com.tvd12.ezyfoxserver.EzyApplication)1 EzyAppRequestController (com.tvd12.ezyfoxserver.app.EzyAppRequestController)1 EzyCommand (com.tvd12.ezyfoxserver.client.constant.EzyCommand)1 EzyEventType (com.tvd12.ezyfoxserver.client.event.EzyEventType)1 com.tvd12.ezyfoxserver.client.handler (com.tvd12.ezyfoxserver.client.handler)1