Exemple #1
0
 // Калл бэк при старте модуля
 public static void OnStartGameScene(GameScene scene)        // калл бэк при загрузке модуля: ...
 //var _this = getScenesController;
 {
     if (scene == GameScene.RAFFLE)
     {
         //var accountEvent = _this.getNetwork().GetComponent<AccountEvent>();
         AccountEvent.requestAccountInformation();
     }
 }
Exemple #2
0
 //void onMarketItemsRecive() {
 //AccountEvent.requestAccountInformation(); // запрашиваем данные об аккаунте
 //}
 void onRoomsReceive(RoomsData rooms) // █ получив комнаты
 {
     Rooms.setNewRoomsData(rooms);
     /////////////////////////////////////////////////////////
     //var controller = WindowController.getWinController;
     //MarketEvent marketEvent = controller.getMarketEvent();
     //marketEvent.OnReady += (sender, e) => controller.onMarketItemsRecive();
     //WindowController.requestContent(WindowController.TypePopUpWindow.NONE);
     /////////////////////////////////////////////////////////
     AccountEvent.requestAccountInformation(); // запрашиваем данные об аккаунте
 }
Exemple #3
0
    public static void showError(Api.ServerErrors serverErrorType, GameScene fromScene = GameScene.UNDEF)
    {
        switch (serverErrorType)
        {
        case Api.ServerErrors.E_VERSION_ERROR: showError(TypeError.ES_NEED_UPDATE, fromScene); break;

        case Api.ServerErrors.E_SESSION_EXPIRED: showError(TypeError.ES_SESSION_EXPIRED, fromScene); break;

        case Api.ServerErrors.E_REQUEST_PARAMS: show("Ошибка покупки", () => { WindowController.rebildCurrentWindow(); }); break;

        case Api.ServerErrors.E_DRAWING_END: ScenesController.loadScene(GameScene.MAIN_MENU); break;

        case Api.ServerErrors.E_NOT_ENOUGH: {
            var errWnd = show("Недостаточно средств для совершения операции.\nПопробуйте ещё.");
            errWnd.setAction(0, () => {
                    WindowController.rebildCurrentWindow();
                    AccountEvent.requestAccountInformation();
                    if (fromScene == GameScene.RAFFLE)
                    {
                        ScenesController.loadScene(GameScene.MAIN_MENU);
                    }
                });
        } break;

        case Api.ServerErrors.E_SESSION: { showErrorAndReAutification("Ошибка сессии"); } break;

        case Api.ServerErrors.E_SESSION_ID: { showErrorAndReAutification("Ошибка сессии"); } break;

        case Api.ServerErrors.E_DB_ERROR: showServerError("Ошибка сервера", fromScene); break;

        case Api.ServerErrors.E_TEMP_ERROR: showServerError("Временная ошибка сервера", fromScene); break;

        case Api.ServerErrors.E_PENDING: showServerError("ошибка сервера", fromScene); break;

        default: {
            if (fromScene != GameScene.AUTORIZATION)
            {
                var errWnd = show("Неизвестная ошибка");
                errWnd.setAction(0, () => { ScenesController.loadScene(GameScene.AUTORIZATION); });
            }
            else
            {
                var errWnd = show("Приложение не рабочее", "выход");
                errWnd.setAction(0, () => { MAIN.exit(); });
            }
        }  break;
        }
    }