void roomJoinedEventHandler(AppWarp.ResultCode result)
 {
     if (result == AppWarp.ResultCode.SUCCESS)
     {
         matchParameters.Add("First player", "false");
         startGame();
     }
     else
     {
         customChoice.message     = "Room already deleted";
         customChoice.firstOption = "Return to main menu";
         customChoice.onChoice    = roomDeletedErrorChoice;
         mode = MenuMode.MP_MONO_CHOICE;
     }
 }
    void connectionStatusHandler(AppWarp.ResultCode result)
    {
        switch (result)
        {
        case AppWarp.ResultCode.SUCCESS:
            status = StatusCode.CONNECTED;
            mode   = MenuMode.MP_INIT;
            AppWarp.associateUserName();
            break;

        default:
            customChoice.message     = "Disconnected from server";
            customChoice.firstOption = "Return to main menu";
            customChoice.onChoice    = connectionErrorChoice;
            mode   = MenuMode.MP_MONO_CHOICE;
            status = StatusCode.DISCONNECTED;
            break;
        }
    }
示例#3
0
    void connectionStatusHandler(AppWarp.ResultCode result)
    {
        switch (result)
        {
        case AppWarp.ResultCode.SUCCESS_RECOVERED:
            status = StatusCode.OPERATIONAL;
            pauseGame(false);
            break;

        case AppWarp.ResultCode.CONNECTION_ERROR_RECOVERABLE:
            pauseGame(true);
            Invoke("reconnect", 5f);
            status = StatusCode.RECONNECTING;
            break;

        case AppWarp.ResultCode.CONNECTION_ERR:
            pauseGame(true);
            status = StatusCode.DISCONNECTED;
            break;
        }
    }