// Token: 0x06000962 RID: 2402 RVA: 0x0003B254 File Offset: 0x00039454
    private void DoMenuBar(Rect rect)
    {
        GUI.enabled = !Singleton <SceneLoader> .Instance.IsLoading;
        if (MenuPageManager.Instance == null)
        {
            if (GUI.Button(new Rect(rect.x + 9f, rect.y + 6f, 100f, 32f), "Back", BlueStonez.button_white))
            {
                Singleton <GameStateController> .Instance.LeaveGame(true);
            }
        }
        else if (!MenuPageManager.Instance.IsCurrentPage(PageType.Home) && GUITools.Button(new Rect(rect.x + 9f, rect.y + 6f, 100f, 32f), new GUIContent("Back"), BlueStonez.button_white))
        {
            if (MenuPageManager.Instance.IsCurrentPage(PageType.Play) && Singleton <GameServerController> .Instance.SelectedServer != null)
            {
                PlayPageGUI.Instance.ShowServerSelection();
            }
            else if (MenuPageManager.Instance.IsCurrentPage(PageType.Training))
            {
                MenuPageManager.Instance.LoadPage(PageType.Play, false);
            }
            else
            {
                Singleton <GameStateController> .Instance.Client.Disconnect();

                MenuPageManager.Instance.LoadPage(PageType.Home, false);
            }
        }
        int num = 0;

        if (ApplicationDataManager.IsMobile)
        {
            num = 44;
        }
        if (!GameState.Current.HasJoinedGame || GamePageManager.HasPage)
        {
            Rect       position = new Rect(rect.width - 420f + (float)num, 12f, 100f, 20f);
            GUIContent content  = new GUIContent(this.PointsValue.ToString("N0"), ShopIcons.IconPoints20x20);
            GUI.color = new Color(1f, 1f, 1f, this.PointsAlpha);
            GUI.Label(position, content, BlueStonez.label_interparkbold_13pt);
            Rect       position2 = new Rect(rect.width - 310f + (float)num, 12f, 100f, 20f);
            GUIContent content2  = new GUIContent(this.CreditsValue.ToString("N0"), ShopIcons.IconCredits20x20);
            GUI.color = new Color(1f, 1f, 1f, this.CreditsAlpha);
            GUI.Label(position2, content2, BlueStonez.label_interparkbold_13pt);
            GUI.color = Color.white;
            if (GUITools.Button(new Rect(rect.width - 200f + (float)num, rect.y + 9f, 100f, 26f), new GUIContent("Get Credits", LocalizedStrings.ClickHereBuyCreditsMsg), BlueStonez.buttongold_medium))
            {
                ApplicationDataManager.OpenBuyCredits();
            }
        }
        if (!ApplicationDataManager.IsMobile)
        {
            GUIContent content3 = (!Screen.fullScreen) ? new GUIContent(string.Empty, GlobalUiIcons.QuadpanelButtonFullscreen, "Enter Fullscreen mode.") : new GUIContent(string.Empty, GlobalUiIcons.QuadpanelButtonNormalize, "Return to windowed mode.");
            if (GUI.Button(new Rect((float)(Screen.width - 88), this._yOffset, 44f, 44f), content3, BlueStonez.buttondark_medium))
            {
                ScreenResolutionManager.IsFullScreen = !Screen.fullScreen;
            }
        }
        this._optionsDropdown.SetRect(new Rect((float)(Screen.width - 44), this._yOffset, 44f, 44f));
        this._optionsDropdown.Draw();
    }
Ejemplo n.º 2
0
        private async void InvokeConvert()
        {
            await Task.Run(() =>
            {
                IsBackingUp                       = true;
                Model.StateChangeInfo             = new VersionStateChangeInfo();
                Model.StateChangeInfo.IsBackingUp = true;
                Application.Current.Dispatcher.Invoke(() => { OnGameStateChanged(GameStateArgs.Empty); });

                try
                {
                    var data = ApplicationDataManager.CreateForPackageFamily(MINECRAFT_PACKAGE_FAMILY);

                    string recoveryPath = Path.Combine(Filepaths.GetInstallationsFolderPath(ConfigManager.CurrentProfile, "Recovery_Data"), "LocalState");

                    if (!Directory.Exists(recoveryPath))
                    {
                        Directory.CreateDirectory(recoveryPath);
                    }

                    Program.Log("Moving backup Minecraft data to: " + recoveryPath);
                    RestoreCopy(data.LocalFolder.Path, recoveryPath);
                    ConfigManager.CreateInstallation("Recovery_Data", null, "Recovery_Data");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }

                IsBackingUp           = false;
                Model.StateChangeInfo = null;
                Application.Current.Dispatcher.Invoke(() => { OnGameStateChanged(GameStateArgs.Empty); });
            });
        }
 // Token: 0x0600128E RID: 4750 RVA: 0x0006E744 File Offset: 0x0006C944
 private void OnMicroTxnCallback(MicroTxnAuthorizationResponse_t param)
 {
     Debug.Log("Steam MicroTxnParams: " + param);
     if (param.m_bAuthorized > 0)
     {
         ShopWebServiceClient.FinishBuyBundleSteam(param.m_ulOrderID.ToString(), delegate(bool success)
         {
             if (success)
             {
                 PopupSystem.ClearAll();
                 PopupSystem.ShowMessage("Purchase Successful", "Thank you, your purchase was successful.", PopupSystem.AlertType.OK, delegate()
                 {
                     ApplicationDataManager.RefreshWallet();
                 });
             }
             else
             {
                 Debug.Log("Managed error from WebServices");
                 PopupSystem.ClearAll();
                 PopupSystem.ShowMessage("Purchase Failed", "Sorry, there was a problem processing your payment. Please visit support.uberstrike.com for help.", PopupSystem.AlertType.OK);
             }
         }, delegate(Exception ex)
         {
             Debug.Log(ex.Message);
             PopupSystem.ClearAll();
             PopupSystem.ShowMessage("Purchase Failed", "Sorry, there was a problem processing your payment. Please visit support.uberstrike.com for help.", PopupSystem.AlertType.OK);
         });
     }
     else
     {
         Debug.Log("Purchase canceled");
         PopupSystem.ClearAll();
     }
 }
Ejemplo n.º 4
0
    public IEnumerator StartGetLoadout()
    {
        if (!Singleton <ItemManager> .Instance.ValidateItemMall())
        {
            PopupSystem.ShowMessage("Error Getting Shop Data", "The shop is empty, perhaps there\nwas an error getting the Shop data?", PopupSystem.AlertType.OK, new Action(HandleWebServiceError));
            yield break;
        }
        yield return(UserWebServiceClient.GetLoadout(AuthToken, delegate(LoadoutView ev)
        {
            if (ev != null)
            {
                CheckLoadoutForExpiredItems(ev);
                Singleton <LoadoutManager> .Instance.UpdateLoadout(ev);
                GameState.Current.Avatar.SetLoadout(new Loadout(Singleton <LoadoutManager> .Instance.Loadout));
                _localPlayerSkinColor = ColorConverter.HexToColor(ev.SkinColor);
            }
            else
            {
                ApplicationDataManager.LockApplication("It seems that you account is corrupted. Please visit support.uberstrike.com for advice.");
            }
        }, delegate(Exception ex)
        {
            ApplicationDataManager.LockApplication("There was an error getting your loadout.");
        }));

        yield break;
    }
Ejemplo n.º 5
0
        public override void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            base.LoadDropDownListSources(fieldName, dropDownListControl);

            if (fieldName.Equals("Application"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                var dv = applicationData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);

                dropDownListControl.SelectedValue = SessionVariables.RequestProfile.ApplicationId.ToString();
            }
            else if (fieldName.Equals("systemEntityType"))
            {
                var systemEntityData = FunctionalityEntityStatusDataManager.GetUniqueIdList(
                    "systemEntityType", SessionVariables.RequestProfile);
                var systemEntityDataList     = SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);
                var filteredsystemEntityData = GetFilteredList("systemEntityType", systemEntityData, systemEntityDataList);
                filteredsystemEntityData.DefaultView.Sort = SystemEntityTypeDataModel.DataColumns.EntityName + " ASC";
                var sorteddt = filteredsystemEntityData.DefaultView.ToTable();
                UIHelper.LoadDropDown(sorteddt, dropDownListControl, SystemEntityTypeDataModel.DataColumns.EntityName,
                                      SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);
            }

            else if (fieldName.Equals("Functionality"))
            {
                var functionalityData = FunctionalityEntityStatusDataManager.GetUniqueIdList(
                    "Functionality", SessionVariables.RequestProfile);
                var functionalityDataList     = FunctionalityDataManager.GetList(SessionVariables.RequestProfile);
                var filteredfunctionalityData = GetFilteredList("Functionality", functionalityData, functionalityDataList);
                UIHelper.LoadDropDown(filteredfunctionalityData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityDataModel.DataColumns.FunctionalityId);
            }

            else if (fieldName.Equals("FunctionalityPriority"))
            {
                var functionalityPriorityData = FunctionalityPriorityDataManager.GetList(SessionVariables.RequestProfile);
                var dv = functionalityPriorityData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityPriorityDataModel.DataColumns.FunctionalityPriorityId);
            }
            else if (fieldName.Equals("FunctionalityActiveStatus"))
            {
                var functionalityActiveStatusData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile);
                var dv = functionalityActiveStatusData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId);
            }

            dropDownListControl.SelectedIndex = 0;
        }
Ejemplo n.º 6
0
 /************************************************
  *
  *  Constructor
  *
  ************************************************/
 public ApplicationManager(ApplicationDataManager DataManager, Password frmPassword, string currentPassword, string CONFIG_FILE)
 {
     this.DataManager = DataManager;
     this.frmPassword = frmPassword;
     this.currentPassword = currentPassword;
     this.CONFIG_FILE = CONFIG_FILE;
     InitializeComponent();
 }
Ejemplo n.º 7
0
        private void SetupDropdown()
        {
            var isTesting  = SessionVariables.IsTesting;
            var personData = ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(personData, drpPersonList, ApplicationUserDataModel.DataColumns.FirstName,
                                  ApplicationUserDataModel.DataColumns.ApplicationUserId);

            drpPersonList.SelectedValue = SessionVariables.RequestProfile.AuditId.ToString();

            var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(applicationData, drpApplicationList, ApplicationDataModel.DataColumns.Name,
                                  ApplicationDataModel.DataColumns.ApplicationId);

            if (isTesting)
            {
                //drpPersonList.AutoPostBack = true;


                if (drpPersonList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtPersonId.Text.Trim()))
                    {
                        drpPersonList.SelectedValue = txtPersonId.Text;
                    }
                    else
                    {
                        txtPersonId.Text = drpPersonList.SelectedItem.Value;
                    }
                }

                if (drpApplicationList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtApplicationId.Text.Trim()))
                    {
                        drpApplicationList.SelectedValue = txtApplicationId.Text;
                    }
                    else
                    {
                        txtApplicationId.Text = drpApplicationList.SelectedItem.Value;
                    }
                }
                txtPersonId.Visible      = true;
                txtApplicationId.Visible = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtPersonId.Text.Trim()))
                {
                    drpPersonList.SelectedValue = txtPersonId.Text;
                }
                if (!string.IsNullOrEmpty(txtApplicationId.Text.Trim()))
                {
                    drpApplicationList.SelectedValue = txtApplicationId.Text;
                }
            }
        }
Ejemplo n.º 8
0
    public IEnumerator StartGetMember()
    {
        yield return(UserWebServiceClient.GetMember(AuthToken, new Action <UberstrikeUserViewModel>(OnGetMemberEventReturn), delegate(Exception ex)
        {
            ApplicationDataManager.LockApplication("There was an error getting your player data.");
        }));

        yield break;
    }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            const string xmlFileName = @"C:\Users\mlesniak\Desktop\Settings.xml";
            ApplicationDataManager DataManager = new ApplicationDataManager();

            DataManager.SetConfigurationData("127.0.0.1", "3306", "sessionmanager", "asd", 1, "Adult", "asd", xmlFileName);
            DataManager.GetConfigurationData(xmlFileName);
            Console.WriteLine(DataManager.Id + " " + DataManager.SqlPassword);
            Console.ReadLine();
        }
    // Token: 0x06001913 RID: 6419 RVA: 0x00086688 File Offset: 0x00084888
    internal void DisableNetworkConnection(string message)
    {
        Debug.LogError("DisableNetworkConnection");
        if (GameState.Current.HasJoinedGame)
        {
            global::EventHandler.Global.Fire(new GameEvents.PlayerPause());
        }
        AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Dispose();

        Singleton <GameStateController> .Instance.Client.Dispose();

        ApplicationDataManager.LockApplication(message);
    }
Ejemplo n.º 11
0
        public override void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            base.LoadDropDownListSources(fieldName, dropDownListControl);

            if (fieldName.Equals("ApplicationId"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(applicationData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);

                dropDownListControl.SelectedValue = SessionVariables.RequestProfile.ApplicationId.ToString();
            }
        }
Ejemplo n.º 12
0
    // Token: 0x06001239 RID: 4665 RVA: 0x0006D3E4 File Offset: 0x0006B5E4
    public static void OpenBuyCredits()
    {
        ChannelType channel = ApplicationDataManager.Channel;

        if (channel != ChannelType.Steam)
        {
            ApplicationDataManager.LoadBuyCreditsPage();
            Debug.LogWarning("Buying credits might not be supported on channel: " + ApplicationDataManager.Channel);
        }
        else
        {
            ApplicationDataManager.LoadBuyCreditsPage();
        }
    }
        private void RestoreMinecraftDataFromReinstall(string packageFamily)
        {
            string tmpDir = GetBackupMinecraftDataDir();

            if (!Directory.Exists(tmpDir))
            {
                return;
            }
            var data = ApplicationDataManager.CreateForPackageFamily(packageFamily);

            Debug.WriteLine("Moving backup Minecraft data to: " + data.LocalFolder.Path);
            RestoreMove(tmpDir, data.LocalFolder.Path);
            Directory.Delete(tmpDir, true);
        }
        private void BackupMinecraftDataForRemoval(string packageFamily)
        {
            var    data   = ApplicationDataManager.CreateForPackageFamily(packageFamily);
            string tmpDir = GetBackupMinecraftDataDir();

            if (Directory.Exists(tmpDir))
            {
                Debug.WriteLine("BackupMinecraftDataForRemoval error: " + tmpDir + " already exists");
                Process.Start("explorer.exe", tmpDir);
                MessageBox.Show("The temporary directory for backing up MC data already exists. This probably means that we failed last time backing up the data. Please back the directory up manually.");
                throw new Exception("Temporary dir exists");
            }
            Debug.WriteLine("Moving Minecraft data to: " + tmpDir);
            Directory.Move(data.LocalFolder.Path, tmpDir);
        }
 // Token: 0x06000989 RID: 2441 RVA: 0x0003BF2C File Offset: 0x0003A12C
 public void Draw(Rect rect)
 {
     GUI.Label(new Rect(8f, rect.y + 1f, 160f, 14f), this.Date, BlueStonez.label_interparkmed_11pt_left);
     if (this.View.Priority == 0)
     {
         GUI.color = Color.red;
     }
     GUI.Label(new Rect(80f, rect.y, this.Length, 14f), this.View.Description, BlueStonez.label_interparkbold_11pt_left);
     GUI.color        = Color.white;
     GUI.contentColor = ((this.View.Priority != 0) ? ColorScheme.UberStrikeYellow : Color.red);
     if (!string.IsNullOrEmpty(this.View.Url) && GUITools.Button(new Rect(90f + this.Length, rect.y, 78f, 16f), new GUIContent(LocalizedStrings.MoreInfo, LocalizedStrings.OpenThisLinkInANewBrowserWindow), BlueStonez.buttondark_medium))
     {
         ScreenResolutionManager.IsFullScreen = false;
         ApplicationDataManager.OpenUrl(this.View.Description, this.View.Url);
     }
     GUI.contentColor = Color.white;
 }
Ejemplo n.º 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetUpDateRangeControl();
            if (!IsPostBack)
            {
                var auData = ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);

                UIHelper.LoadDropDown(auData, drpApplicationUser, ApplicationUserDataModel.DataColumns.EmailAddress,
                                      ApplicationUserDataModel.DataColumns.EmailAddress);
                drpApplicationUser.Items.Insert(0, "All");

                var auData1 = ApplicationDataManager.GetList(SessionVariables.RequestProfile);

                UIHelper.LoadDropDown(auData1, drpApplicationId, ApplicationDataModel.DataColumns.Name,
                                      ApplicationDataModel.DataColumns.ApplicationId);
                drpApplicationId.Items.Insert(0, "All");
            }
        }
Ejemplo n.º 17
0
 // Token: 0x06000D00 RID: 3328 RVA: 0x000597CC File Offset: 0x000579CC
 private void DrawLoginPanel()
 {
     GUI.BeginGroup(this._rect, GUIContent.none, BlueStonez.window);
     GUI.depth = 3;
     GUI.Label(new Rect(0f, 0f, this._rect.width, 23f), "Add an existing UberStrike Account to Steam", BlueStonez.tab_strip);
     GUI.Label(new Rect(0f, 48f, this._rect.width - 10f, 48f), "Your UberStrike account will be permanently associated with your Steam account", BlueStonez.label_interparkbold_11pt);
     GUI.Label(new Rect(20f, 108f, 100f, 24f), "Email:");
     this._emailAddress = GUI.TextField(new Rect(128f, 108f, this._rect.width - 164f, 24f), this._emailAddress, 100, BlueStonez.textField);
     if (string.IsNullOrEmpty(this._emailAddress))
     {
         GUI.color = Color.white.SetAlpha(0.3f);
         GUI.color = Color.white;
     }
     GUI.Label(new Rect(20f, 144f, 100f, 24f), "Password:"******"Cancel"), BlueStonez.buttondark_medium))
     {
         this.Hide();
         Singleton <AuthenticationManager> .Instance.LoginByChannel();
     }
     if (GUITools.Button(new Rect(210f, 190f, 100f, 52f), new GUIContent("Add"), BlueStonez.button_green))
     {
         this.HideKeyboard();
         this.Login(this._emailAddress, this._password);
     }
     GUI.Label(new Rect(8f, 256f, this._rect.width - 16f, 8f), GUIContent.none, BlueStonez.horizontal_line_grey95);
     if (GUITools.Button(new Rect(20f, 264f, 100f, 40f), new GUIContent("Forgot password?"), BlueStonez.label_interparkbold_11pt_url))
     {
         this.HideKeyboard();
         ApplicationDataManager.OpenUrl(string.Empty, "http://www.uberstrike.com/#forgot_password");
     }
     if (GUITools.Button(new Rect(this._rect.width - 118f, 264f, 98f, 40f), new GUIContent("Facebook player?"), BlueStonez.label_interparkbold_11pt_url))
     {
         this.HideKeyboard();
         ApplicationDataManager.OpenUrl(string.Empty, "http://www.uberstrike.com/steam");
     }
     GUI.enabled = true;
     GUI.EndGroup();
 }
Ejemplo n.º 18
0
        private void InvokeConvert()
        {
            Task.Run(async() =>
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    ConfigManager.MainThread.ProgressBarGrid.Visibility = Visibility.Visible;
                });

                try
                {
                    var data      = ApplicationDataManager.CreateForPackageFamily(MINECRAFT_PACKAGE_FAMILY);
                    string tmpDir = GetBackupMinecraftDataDir();
                    if (!Directory.Exists(tmpDir))
                    {
                        Debug.WriteLine("Moving Minecraft data to: " + tmpDir);
                        Directory.Move(data.LocalFolder.Path, tmpDir);
                    }

                    string recoveryPath = Constants.GetInstallationsFolderPath(ConfigManager.CurrentProfile, "Recovery_Data");

                    if (!Directory.Exists(recoveryPath))
                    {
                        Directory.CreateDirectory(recoveryPath);
                    }

                    Debug.WriteLine("Moving backup Minecraft data to: " + recoveryPath);
                    RestoreMove(tmpDir, recoveryPath);
                    Directory.Delete(tmpDir, true);

                    ConfigManager.CreateInstallation("Recovery_Data", null);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }

                Application.Current.Dispatcher.Invoke(() =>
                {
                    ConfigManager.MainThread.ProgressBarGrid.Visibility = Visibility.Collapsed;
                });
            });
        }
Ejemplo n.º 19
0
        public static async void RegisterWithMobileServices(string provider)
        {
            App.CurrentUser.Id               = Guid.NewGuid().ToString();
            App.CurrentUser.ProviderIdLong   = App.MobileServicesUser.UserId;
            App.CurrentUser.ProviderIdShort  = IdentityProviderParser.GetShortProvider(App.CurrentUser.ProviderIdLong);
            App.CurrentUser.Token            = App.MobileServicesUser.MobileServiceAuthenticationToken;
            App.CurrentUser.IdentityProvider = IdentityProviderConverter.GetProvider(provider);

            string registrationId = String.Empty;

            try
            {
                Channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();

                Channel.PushNotificationReceived += NotificationReceived;
                HardwareToken token = HardwareIdentification.GetPackageSpecificToken(null);
                registrationId                = CryptographicBuffer.EncodeToBase64String(token.Id);
                CurrentChannel.Id             = Guid.NewGuid().ToString();
                CurrentChannel.ChannelUri     = Channel.Uri;
                CurrentChannel.DeviceType     = Enums.DeviceType.Windows8;
                CurrentChannel.UserId         = CurrentUser.ProviderIdLong;
                CurrentChannel.RegistrationId = registrationId;
            }
            catch (Exception ex)
            {
                HandleInsertChannelException(ex);
            }
            try
            {
                ApplicationDataManager.StoreValue(ApplicationConstants.UserKey, App.CurrentUser);
                await UsersTable.InsertAsync(App.CurrentUser);

                await ChannelsTable.InsertAsync(App.CurrentChannel);
            }
            catch (Exception ex)
            {
                HandleInsertChannelException(ex);
            }

            CompleteUserProfile();
            RetrieveFriends();
        }
Ejemplo n.º 20
0
        private async static void CompleteUserProfile()
        {
            try
            {
                UserEntityProfileCompletion result = await App.MobileService.InvokeApiAsync <UserEntityProfileCompletion>(ApplicationConstants.COMPLETE_USER_PROFILE_METHOD, HttpMethod.Get, null);

                if (result != null)
                {
                    App.CurrentUser.Name              = result.Name;
                    App.CurrentUser.Picture           = result.Picture;
                    App.CurrentUser.AccessToken       = result.AccessToken;
                    App.CurrentUser.AccessTokenSecret = result.AccessTokenSecret;
                    ApplicationDataManager.StoreValue(ApplicationConstants.UserKey, App.CurrentUser);
                }
            }
            catch (Exception ex)
            {
                HandleInsertChannelException(ex);
            }
        }
Ejemplo n.º 21
0
    public IEnumerator StartGetMemberWallet()
    {
        if (Cmid < 1)
        {
            Debug.LogError("Player CMID is invalid! Have you called AuthenticationManager.StartAuthenticateMember?");
            ApplicationDataManager.LockApplication("The authentication process failed. Please sign in on www.uberstrike.com and restart UberStrike.");
        }
        else
        {
            IPopupDialog popupDialog = PopupSystem.ShowMessage("Updating", "Updating your points and credits balance...", PopupSystem.AlertType.None);
            yield return(UserWebServiceClient.GetMemberWallet(AuthToken, new Action <MemberWalletView>(OnGetMemberWalletEventReturn), delegate(Exception ex)
            {
            }));

            yield return(new WaitForSeconds(0.5f));

            PopupSystem.HideMessage(popupDialog);
        }
        yield break;
    }
Ejemplo n.º 22
0
        private void SetupDropdown()
        {
            var isTesting = SessionVariables.IsTesting;

            drpParentMenu.ClearSelection();

            var parentMenudata = MenuDataManager.GetList(null, SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(parentMenudata, drpParentMenu, MenuDataModel.DataColumns.MenuDisplayName,
                                  MenuDataModel.DataColumns.MenuId);

            var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(applicationData, drpApplicationName, ApplicationDataModel.DataColumns.Name,
                                  ApplicationDataModel.DataColumns.ApplicationId);

            if (isTesting)
            {
                drpParentMenu.AutoPostBack = true;
                if (drpParentMenu.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtParentMenuId.Text.Trim()))
                    {
                        drpParentMenu.SelectedValue = txtParentMenuId.Text;
                    }
                    else
                    {
                        txtParentMenuId.Text = drpParentMenu.SelectedItem.Value;
                    }
                }
                txtParentMenuId.Visible = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtParentMenuId.Text.Trim()))
                {
                    drpParentMenu.SelectedValue = txtParentMenuId.Text;
                }
            }
        }
Ejemplo n.º 23
0
        static private bool GetACInfo(string packageFamilyName, out string acSid, out string tempDir)
        {
            IntPtr acPSID;

            acSid   = null;
            tempDir = null;

            if (DeriveAppContainerSidFromAppContainerName(packageFamilyName, out acPSID) < 0)
            {
                return(false);
            }

            if (ConvertSidToStringSid(acPSID, out acSid) == 0)
            {
                return(false);
            }

            ApplicationData appData = ApplicationDataManager.CreateForPackageFamily(packageFamilyName);

            tempDir = appData.TemporaryFolder.Path;

            return(true);
        }
Ejemplo n.º 24
0
        private async void InvokeConvert()
        {
            await Task.Run(() =>
            {
                Application.Current.Dispatcher.Invoke(() => { OnGameStateChanged(GameStateArgs.Empty); });

                try
                {
                    var data      = ApplicationDataManager.CreateForPackageFamily(MINECRAFT_PACKAGE_FAMILY);
                    string tmpDir = GetBackupMinecraftDataDir();
                    if (!Directory.Exists(tmpDir))
                    {
                        Debug.WriteLine("Moving Minecraft data to: " + tmpDir);
                        Directory.Move(data.LocalFolder.Path, tmpDir);
                    }

                    string recoveryPath = Filepaths.GetInstallationsFolderPath(ConfigManager.CurrentProfile, "Recovery_Data");

                    if (!Directory.Exists(recoveryPath))
                    {
                        Directory.CreateDirectory(recoveryPath);
                    }

                    Debug.WriteLine("Moving backup Minecraft data to: " + recoveryPath);
                    RestoreMove(tmpDir, recoveryPath);
                    Directory.Delete(tmpDir, true);

                    ConfigManager.CreateInstallation("Recovery_Data", null, "Recovery_Data");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }

                Application.Current.Dispatcher.Invoke(() => { OnGameStateChanged(GameStateArgs.Empty); });
            });
        }
Ejemplo n.º 25
0
    // Token: 0x0600122C RID: 4652 RVA: 0x0006D314 File Offset: 0x0006B514
    static ApplicationDataManager()
    {
        try
        {
            ApplicationDataManager.ImagePath = (ApplicationDataManager.WebServiceBaseUrl = File.ReadAllText(Path.Combine(Application.dataPath, ".uberstrok")));
        }
        catch
        {
            ApplicationDataManager.LockApplication("Failed to load '.uberstrok' host config.");
        }
        try
        {
            string hsbPath = Path.Combine(Application.dataPath, "HSB.ogg");
            string url     = "file:///" + hsbPath;
            WWW    hsb     = new WWW(url);

            // delay until it's loaded.
            // probably not the most efficient way of dealing with things?
            while (hsb.progress < 1)
            {
                ;
            }
            if (hsb.progress >= 1)
            {
                GameAudio.HomeSceneBackground = hsb.audioClip;
            }
        }
        catch
        {
        }
        ApplicationDataManager.IsDebug             = true;
        ApplicationDataManager.applicationDateTime = 0f;
        ApplicationDataManager.serverDateTime      = DateTime.Now;
        ApplicationDataManager.WebPlayerHasResult  = false;
        ApplicationDataManager.ApplicationOptions  = new ApplicationOptions();
    }
Ejemplo n.º 26
0
        public void CalculateRNandSDWorkedHoursForAllUsers(int appId)
        {
            var resultArray  = new ArrayList();
            var appUserName  = string.Empty;
            var emailAddress = string.Empty;
            var obj          = new ApplicationUserDataModel();
            var dt           = ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);
            var dt1          = ApplicationDataManager.GetList(SessionVariables.RequestProfile);


            for (var i = 0; i < dt.Rows.Count; i++)
            {
                emailAddress = (string)(dt.Rows[i][ApplicationUserDataModel.DataColumns.EmailAddress]);
                //appUserId = (int)(dt.Rows[i][ApplicationUserDataModel.DataColumns.ApplicationUserId]);
                //appId = (int)(dt1.Rows[i][ApplicationDataModel.DataColumns.ApplicationId]);
                appUserName = dt.Rows[i][ApplicationUserDataModel.DataColumns.FirstName] + " " + dt.Rows[i][ApplicationUserDataModel.DataColumns.LastName];
                var result = CalculateRNandSDWorkedHours(emailAddress, appId);
                result.TotalRNHrs = string.Format("{0}.00", result.TotalRNHrs);
                resultArray.Add(result);
            }

            gv.DataSource = resultArray;
            gv.DataBind();
        }
Ejemplo n.º 27
0
        public virtual void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            DataTable dataSource = null;

            if (fieldName.Equals("Application"))
            {
                dataSource = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);

                dropDownListControl.SelectedValue = SessionVariables.RequestProfile.ApplicationId.ToString();
            }
            else if (fieldName.Equals("ParentMenu"))
            {
                var data = new MenuDataModel();

                var appId = BaseSearchFilterControl.GetParameterValueAsInt("Application");
                if (appId.HasValue)
                {
                    data.ApplicationId = appId.Value;
                }
                else
                {
                    data.ApplicationId = SessionVariables.RequestProfile.ApplicationId;
                }

                dataSource = MenuDataManager.ListOfParentMenuOnly(data, SessionVariables.RequestProfile);
                dataSource.DefaultView.Sort = StandardDataModel.StandardDataColumns.Name + " ASC";
                dataSource = dataSource.DefaultView.ToTable();

                dropDownListControl.Items.Clear();

                dropDownListControl.Items.Add(new ListItem("All", "-1"));

                dropDownListControl.DataSource     = dataSource;
                dropDownListControl.DataTextField  = StandardDataModel.StandardDataColumns.Name;
                dropDownListControl.DataValueField = MenuDataModel.DataColumns.MenuId;

                dropDownListControl.DataBind();
            }
            else if (fieldName.Equals("FunctionalityId"))
            {
                dataSource = FunctionalityDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityDataModel.DataColumns.FunctionalityId);
            }
            else if (fieldName.Equals("DeveloperRoleId"))
            {
                dataSource = DeveloperRoleDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DeveloperRoleDataModel.DataColumns.DeveloperRoleId);
            }
            else if (fieldName.Equals("FeatureOwnerStatusId"))
            {
                dataSource = FeatureOwnerStatusDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId);
            }

            else if (fieldName.Equals("EntityId"))
            {
                dataSource = Framework.Components.Core.SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DataModel.Framework.Core.SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);
            }

            else if (fieldName.Equals("ProjectId"))
            {
                dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectDataModel.DataColumns.ProjectId);
            }
            else if (fieldName.Equals("ApplicationId"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                var dv = applicationData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);
            }
            else if (fieldName.Equals("FunctionalityOwner"))
            {
                var drData = FunctionalityOwnerDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                var originalList  = new ArrayList();
                var duplicateList = new ArrayList();
                foreach (DataRow dtRow in drData.Rows)
                {
                    if (originalList.Contains(dtRow["Developer"]))
                    {
                        duplicateList.Add(dtRow);
                    }
                    else
                    {
                        originalList.Add(dtRow["Developer"]);
                    }
                }
                foreach (DataRow dtRow in duplicateList)
                {
                    drData.Rows.Remove(dtRow);
                }
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityOwnerDataModel.DataColumns.Developer,
                                      FunctionalityOwnerDataModel.DataColumns.FunctionalityOwnerId);
            }
            else if (fieldName.Equals("FunctionalityActiveStatus"))
            {
                var drData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId);
            }
            else if (fieldName.Equals("FunctionalityImage"))
            {
                var drData = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityImageDataModel.DataColumns.Title,
                                      FunctionalityImageDataModel.DataColumns.FunctionalityImageId);
            }
            else if (fieldName.Equals("FunctionalityImageAttribute"))
            {
                var drData = FunctionalityImageAttributeDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityImageAttributeDataModel.DataColumns.FunctionalityImageAttributeId);
            }
        }
Ejemplo n.º 28
0
        public IEnumerable <ApplicationDataModel> GetApplicationList()
        {
            var items = ApplicationDataManager.GetEntityDetails(ApplicationDataModel.Empty, SessionVariables.RequestProfile);

            return(items);
        }
Ejemplo n.º 29
0
        private async void InvokeBackup()
        {
            await Task.Run(() =>
            {
                ViewModels.LauncherModel.Default.ShowProgressBar = true;
                ViewModels.LauncherModel.Default.CurrentState    = ViewModels.LauncherModel.StateChange.isBackingUp;

                try
                {
                    var data = ApplicationDataManager.CreateForPackageFamily(MINECRAFT_PACKAGE_FAMILY);
                    string dataPath;

                    try { dataPath = data.LocalFolder.Path; }
                    catch { dataPath = string.Empty; }

                    if (dataPath != string.Empty)
                    {
                        string recoveryPath = Path.Combine(Filepaths.GetInstallationsFolderPath(ConfigManager.CurrentProfile, "Recovery_Data"), "LocalState");
                        if (!Directory.Exists(recoveryPath))
                        {
                            Directory.CreateDirectory(recoveryPath);
                        }
                        System.Diagnostics.Debug.WriteLine("Moving backup Minecraft data to: " + recoveryPath);
                        RestoreCopy(dataPath, recoveryPath);
                        ConfigManager.CreateInstallation("Recovery_Data", null, "Recovery_Data");
                    }
                }
                catch (Exception ex) { ErrorScreenShow.exceptionmsg(ex); }

                ViewModels.LauncherModel.Default.ShowProgressBar = false;
                ViewModels.LauncherModel.Default.CurrentState    = ViewModels.LauncherModel.StateChange.None;
            });

            ConfigManager.OnConfigStateChanged(this, Events.ConfigStateArgs.Empty);


            void RestoreCopy(string from, string to)
            {
                int Total = Directory.GetFiles(from, "*", SearchOption.AllDirectories).Length;

                ViewModels.LauncherModel.Default.TotalProgress   = Total;
                ViewModels.LauncherModel.Default.CurrentProgress = 0;

                RestoreCopy_Step(from, to);
            }

            void RestoreCopy_Step(string from, string to)
            {
                foreach (var f in Directory.EnumerateFiles(from))
                {
                    string ft = Path.Combine(to, Path.GetFileName(f));
                    if (File.Exists(ft))
                    {
                        if (MessageBox.Show(string.Format(Application.Current.FindResource("GameManager_RecoveringDataIssue_FileNotExistant_Text").ToString(), ft), Application.Current.FindResource("GameManager_RecoveringDataIssue_Title").ToString(), MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                        {
                            continue;
                        }
                        File.Delete(ft);
                    }
                    File.Copy(f, ft);
                    ViewModels.LauncherModel.Default.CurrentProgress += 1;
                }
                foreach (var f in Directory.EnumerateDirectories(from))
                {
                    string tp = Path.Combine(to, Path.GetFileName(f));
                    if (!Directory.Exists(tp))
                    {
                        if (File.Exists(tp) && MessageBox.Show(string.Format(Application.Current.FindResource("GameManager_RecoveringDataIssue_NotaDirectory_Text").ToString(), tp), Application.Current.FindResource("GameManager_RecoveringDataIssue_Title").ToString(), MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                        {
                            continue;
                        }
                        Directory.CreateDirectory(tp);
                    }
                    RestoreCopy_Step(f, tp);
                }
            }
        }
Ejemplo n.º 30
0
        public virtual void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            DataTable dataSource = null;

            if (fieldName.Equals("FunctionalityId"))
            {
                dataSource = FunctionalityDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityDataModel.DataColumns.FunctionalityId);
            }
            else if (fieldName.Equals("ProjectId"))
            {
                dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectDataModel.DataColumns.ProjectId);
            }
            else if (fieldName.Equals("DeveloperRoleId"))
            {
                dataSource = DeveloperRoleDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DeveloperRoleDataModel.DataColumns.DeveloperRoleId);
            }
            else if (fieldName.Equals("UseCaseId"))
            {
                dataSource = UseCaseDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      UseCaseDataModel.DataColumns.UseCaseId);
            }

            else if (fieldName.Equals("NeedId"))
            {
                dataSource = NeedDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      NeedDataModel.DataColumns.NeedId);
            }

            else if (fieldName.Equals("ProjectUseCaseStatusId"))
            {
                dataSource = ProjectUseCaseStatusDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectUseCaseStatusDataModel.DataColumns.ProjectUseCaseStatusId);
            }
            else if (fieldName.Equals("FeatureOwnerStatusId"))
            {
                dataSource = FeatureOwnerStatusDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId);
            }

            else if (fieldName.Equals("EntityId"))
            {
                dataSource = Framework.Components.Core.SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DataModel.Framework.Core.SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);
            }

            else if (fieldName.Equals("ProjectId"))
            {
                dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectDataModel.DataColumns.ProjectId);
            }

            else if (fieldName.Equals("ApplicationId"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                var dv = applicationData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);
            }
            else if (fieldName.Equals("FunctionalityOwner"))
            {
                var drData = FunctionalityOwnerDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                var originalList  = new ArrayList();
                var duplicateList = new ArrayList();
                foreach (DataRow dtRow in drData.Rows)
                {
                    if (originalList.Contains(dtRow["Developer"]))
                    {
                        duplicateList.Add(dtRow);
                    }
                    else
                    {
                        originalList.Add(dtRow["Developer"]);
                    }
                }
                foreach (DataRow dtRow in duplicateList)
                {
                    drData.Rows.Remove(dtRow);
                }
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityOwnerDataModel.DataColumns.Developer,
                                      FunctionalityOwnerDataModel.DataColumns.FunctionalityOwnerId);
            }
            else if (fieldName.Equals("FunctionalityActiveStatus"))
            {
                var drData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId);
            }
            else if (fieldName.Equals("FunctionalityImage"))
            {
                var drData = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityImageDataModel.DataColumns.Title,
                                      FunctionalityImageDataModel.DataColumns.FunctionalityImageId);
            }
            else if (fieldName.Equals("FunctionalityImageAttribute"))
            {
                var drData = FunctionalityImageAttributeDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityImageAttributeDataModel.DataColumns.FunctionalityImageAttributeId);
            }
            else if (fieldName.Equals("TabParentStructure"))
            {
                var drData = TabParentStructureDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      TabParentStructureDataModel.DataColumns.TabParentStructureId);
            }
        }
Ejemplo n.º 31
0
 private void ExecuteLogOutCommand()
 {
     App.MobileService.Logout();
     ApplicationDataManager.RemoveEntry(ApplicationConstants.UserKey);
     _navigationService.Navigate(typeof(LoginPage));
 }
Ejemplo n.º 32
0
        protected override DataTable GetData()
        {
            var dt = ApplicationDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile);

            return(dt);
        }