@Override
    public void initialize(AppStateManager stateManager, Application app) {
        super.initialize(stateManager, app);
        this.stateManager = stateManager;
        commonsConfig = new DDJOCommonsConfig();
            
        Serializer.registerClass(StartGameMessage.class);
        NetOwlSerializerRegister.registerClasses(commonsConfig);
        try {
            client = Network.connectToServer("DDJO", 0, ipAddress, port);
        } catch (IOException ex) {
            Logger.getLogger(LoginAppState.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        client.addMessageListener(this, StartGameMessage.class);
        client.start();
        
        ((SimpleApplication)app).getFlyByCamera().setDragToRotate(true);
    }