// Token: 0x06000D02 RID: 3330 RVA: 0x00059AF8 File Offset: 0x00057CF8 private void Login(string emailAddress, string password) { CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Player_AutoLogin, this._rememberPassword); if (this._rememberPassword) { CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Password, password); CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Email, emailAddress); } this._errorAlpha = 1f; if (string.IsNullOrEmpty(emailAddress)) { LoginPanelGUI.ErrorMessage = LocalizedStrings.EnterYourEmailAddress; } else if (string.IsNullOrEmpty(password)) { LoginPanelGUI.ErrorMessage = LocalizedStrings.EnterYourPassword; } else if (!ValidationUtilities.IsValidEmailAddress(emailAddress)) { LoginPanelGUI.ErrorMessage = LocalizedStrings.EmailAddressIsInvalid; } else if (!ValidationUtilities.IsValidPassword(password)) { LoginPanelGUI.ErrorMessage = LocalizedStrings.PasswordIsInvalid; } else { this.Hide(); UnityRuntime.StartRoutine(Singleton <AuthenticationManager> .Instance.StartLoginMemberEmail(emailAddress, password)); } }
// Token: 0x060007EC RID: 2028 RVA: 0x000368E0 File Offset: 0x00034AE0 public void SaveApplicationOptions() { CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_VideoIsUsingCustom, this.IsUsingCustom); CmunePrefs.WriteKey <int>(CmunePrefs.Key.Options_VideoTextureQuality, this.VideoTextureQuality); CmunePrefs.WriteKey <int>(CmunePrefs.Key.Options_VideoVSyncCount, this.VideoVSyncCount); CmunePrefs.WriteKey <int>(CmunePrefs.Key.Options_VideoAntiAliasing, this.VideoAntiAliasing); CmunePrefs.WriteKey <int>(CmunePrefs.Key.Options_VideoWaterMode, this.VideoWaterMode); CmunePrefs.WriteKey <int>(CmunePrefs.Key.Options_VideoCurrentQualityLevel, this.VideoQualityLevel); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_VideoBloomAndFlares, this.VideoBloomAndFlares); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_VideoColorCorrection, this.VideoVignetting); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_VideoMotionBlur, this.VideoMotionBlur); CmunePrefs.WriteKey <int>(CmunePrefs.Key.Options_VideoScreenRes, this.ScreenResolution); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_VideoIsFullscreen, this.IsFullscreen); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_VideoShowFps, this.VideoShowFps); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_VideoPostProcessing, this.VideoPostProcessing); CmunePrefs.WriteKey <float>(CmunePrefs.Key.Options_InputXMouseSensitivity, this.InputXMouseSensitivity); CmunePrefs.WriteKey <float>(CmunePrefs.Key.Options_InputYMouseSensitivity, this.InputYMouseSensitivity); CmunePrefs.WriteKey <float>(CmunePrefs.Key.Options_InputMouseRotationMaxX, this.InputMouseRotationMaxX); CmunePrefs.WriteKey <float>(CmunePrefs.Key.Options_InputMouseRotationMaxY, this.InputMouseRotationMaxY); CmunePrefs.WriteKey <float>(CmunePrefs.Key.Options_InputMouseRotationMinX, this.InputMouseRotationMinX); CmunePrefs.WriteKey <float>(CmunePrefs.Key.Options_InputMouseRotationMinY, this.InputMouseRotationMinY); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_InputInvertMouse, this.InputInvertMouse); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_InputEnableGamepad, AutoMonoBehaviour <InputManager> .Instance.IsGamepadEnabled); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_GameplayAutoPickupEnabled, this.GameplayAutoPickupEnabled); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_GameplayAutoEquipEnabled, this.GameplayAutoEquipEnabled); CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Options_AudioEnabled, this.AudioEnabled); CmunePrefs.WriteKey <float>(CmunePrefs.Key.Options_AudioEffectsVolume, this.AudioEffectsVolume); CmunePrefs.WriteKey <float>(CmunePrefs.Key.Options_AudioMusicVolume, this.AudioMusicVolume); CmunePrefs.WriteKey <float>(CmunePrefs.Key.Options_AudioMasterVolume, this.AudioMasterVolume); }
// Token: 0x06000CFA RID: 3322 RVA: 0x00009A7D File Offset: 0x00007C7D private void Start() { this._rememberPassword = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Player_AutoLogin); if (this._rememberPassword) { this._password = CmunePrefs.ReadKey <string>(CmunePrefs.Key.Player_Password); this._emailAddress = CmunePrefs.ReadKey <string>(CmunePrefs.Key.Player_Email); } }
// Token: 0x06001C2A RID: 7210 RVA: 0x0008F2E8 File Offset: 0x0008D4E8 public static bool TryGetKey <T>(CmunePrefs.Key k, out T value) { if (PlayerPrefs.HasKey(k.ToString())) { value = CmunePrefs.ReadKey <T>(k, default(T)); return(true); } value = default(T); return(false); }
// Token: 0x060007EB RID: 2027 RVA: 0x0003662C File Offset: 0x0003482C public void Initialize() { string @string = PlayerPrefs.GetString("Version", "Invalid"); bool flag = false; if ("4.7.1" != @string) { flag = true; CmunePrefs.Reset(); QualitySettings.SetQualityLevel(2, true); PlayerPrefs.SetString("Version", "4.7.1"); } Application.targetFrameRate = -1; QualitySettings.maxQueuedFrames = -1; this.IsUsingCustom = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_VideoIsUsingCustom, this.IsUsingCustom); this.VideoWaterMode = CmunePrefs.ReadKey <int>(CmunePrefs.Key.Options_VideoWaterMode, this.VideoWaterMode); if ((Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.OSXWebPlayer || Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android) && this.VideoWaterMode == 2) { this.VideoWaterMode = 1; } this.VideoTextureQuality = CmunePrefs.ReadKey <int>(CmunePrefs.Key.Options_VideoTextureQuality, this.VideoTextureQuality); this.VideoVSyncCount = CmunePrefs.ReadKey <int>(CmunePrefs.Key.Options_VideoVSyncCount, this.VideoVSyncCount); this.VideoAntiAliasing = CmunePrefs.ReadKey <int>(CmunePrefs.Key.Options_VideoAntiAliasing, this.VideoAntiAliasing); this.VideoQualityLevel = CmunePrefs.ReadKey <int>(CmunePrefs.Key.Options_VideoCurrentQualityLevel, this.VideoQualityLevel); this.VideoBloomAndFlares = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_VideoBloomAndFlares, this.VideoBloomAndFlares); this.VideoVignetting = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_VideoColorCorrection, this.VideoVignetting); this.VideoMotionBlur = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_VideoMotionBlur, this.VideoMotionBlur); this.VideoShowFps = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_VideoShowFps, this.VideoShowFps); this.VideoPostProcessing = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_VideoPostProcessing, this.VideoPostProcessing); this.IsFullscreen = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_VideoIsFullscreen, true); this.ScreenResolution = CmunePrefs.ReadKey <int>(CmunePrefs.Key.Options_VideoScreenRes, ScreenResolutionManager.CurrentResolutionIndex); this.InputXMouseSensitivity = Mathf.Clamp(CmunePrefs.ReadKey <float>(CmunePrefs.Key.Options_InputXMouseSensitivity, 3f), 1f, 10f); this.InputYMouseSensitivity = Mathf.Clamp(CmunePrefs.ReadKey <float>(CmunePrefs.Key.Options_InputYMouseSensitivity, 3f), 1f, 10f); this.InputMouseRotationMaxX = CmunePrefs.ReadKey <float>(CmunePrefs.Key.Options_InputMouseRotationMaxX, 360f); this.InputMouseRotationMaxY = CmunePrefs.ReadKey <float>(CmunePrefs.Key.Options_InputMouseRotationMaxY, 90f); this.InputMouseRotationMinX = CmunePrefs.ReadKey <float>(CmunePrefs.Key.Options_InputMouseRotationMinX, -360f); this.InputMouseRotationMinY = CmunePrefs.ReadKey <float>(CmunePrefs.Key.Options_InputMouseRotationMinY, -90f); this.InputInvertMouse = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_InputInvertMouse, false); bool flag2 = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_InputEnableGamepad, false); AutoMonoBehaviour <InputManager> .Instance.IsGamepadEnabled = (Input.GetJoystickNames().Length > 0 && flag2); this.GameplayAutoPickupEnabled = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_GameplayAutoPickupEnabled, true); this.GameplayAutoEquipEnabled = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_GameplayAutoEquipEnabled, false); this.AudioEnabled = CmunePrefs.ReadKey <bool>(CmunePrefs.Key.Options_AudioEnabled, true); this.AudioEffectsVolume = CmunePrefs.ReadKey <float>(CmunePrefs.Key.Options_AudioEffectsVolume, 0.7f); this.AudioMusicVolume = CmunePrefs.ReadKey <float>(CmunePrefs.Key.Options_AudioMusicVolume, 0.5f); this.AudioMasterVolume = CmunePrefs.ReadKey <float>(CmunePrefs.Key.Options_AudioMasterVolume, 0.5f); if (flag) { this.SaveApplicationOptions(); } }
// Token: 0x060013D1 RID: 5073 RVA: 0x00072728 File Offset: 0x00070928 private void WriteAllKeyMappings() { this._unassignedKeyMappings = false; foreach (KeyValuePair <int, UserInputMap> keyValuePair in this._keyMapping) { if (keyValuePair.Value.IsConfigurable) { CmunePrefs.WriteKey <string>(InputManager.GetPrefsKeyForSlot(keyValuePair.Key), keyValuePair.Value.GetPlayerPrefs()); if (keyValuePair.Value.Channel == null) { this._unassignedKeyMappings = true; } } } }
// Token: 0x060013D2 RID: 5074 RVA: 0x000727D0 File Offset: 0x000709D0 public void ReadAllKeyMappings() { this._unassignedKeyMappings = false; foreach (KeyValuePair <int, UserInputMap> keyValuePair in this._keyMapping) { if (keyValuePair.Value.IsConfigurable) { string pref; if (CmunePrefs.TryGetKey <string>(InputManager.GetPrefsKeyForSlot(keyValuePair.Key), out pref)) { keyValuePair.Value.ReadPlayerPrefs(pref); if (keyValuePair.Value.Channel == null) { this._unassignedKeyMappings = true; } } } } }
// Token: 0x06001C2D RID: 7213 RVA: 0x0008F480 File Offset: 0x0008D680 public static T ReadKey <T>(CmunePrefs.Key k) { return(CmunePrefs.ReadKey <T>(k, default(T))); }
// Token: 0x06000D66 RID: 3430 RVA: 0x0005D9FC File Offset: 0x0005BBFC private void OnGUI() { if (Mathf.Abs(this._keyboardOffset - this._targetKeyboardOffset) > 2f) { this._keyboardOffset = Mathf.Lerp(this._keyboardOffset, this._targetKeyboardOffset, Time.deltaTime * 4f); } else { this._keyboardOffset = this._targetKeyboardOffset; } Rect position = new Rect((float)(Screen.width - 500) * 0.5f, ((float)Screen.height - this._height) * 0.5f - this._keyboardOffset, 500f, this._height); GUI.BeginGroup(position, GUIContent.none, BlueStonez.window); GUI.Label(new Rect(0f, 0f, position.width, 56f), LocalizedStrings.Welcome, BlueStonez.tab_strip); Rect position2 = new Rect(20f, 55f, position.width - 40f, position.height - 78f); GUI.Label(position2, GUIContent.none, BlueStonez.window_standard_grey38); GUI.BeginGroup(position2); GUI.Label(new Rect(0f, 0f, position2.width, 60f), LocalizedStrings.PleaseProvideValidEmailPasswordMsg, BlueStonez.label_interparkbold_18pt); GUI.Label(new Rect(0f, 76f, 170f, 11f), LocalizedStrings.Email, BlueStonez.label_interparkbold_11pt_right); GUI.Label(new Rect(0f, 110f, 170f, 11f), LocalizedStrings.Password, BlueStonez.label_interparkbold_11pt_right); GUI.Label(new Rect(0f, 147f, 170f, 11f), LocalizedStrings.VerifyPassword, BlueStonez.label_interparkbold_11pt_right); GUI.enabled = this._enableGUI; GUI.SetNextControlName("@Email"); this._emailAddress = GUI.TextField(new Rect(180f, 69f, 180f, 22f), this._emailAddress, BlueStonez.textField); if (string.IsNullOrEmpty(this._emailAddress) && GUI.GetNameOfFocusedControl() != "@Email") { GUI.color = new Color(1f, 1f, 1f, 0.3f); GUI.Label(new Rect(188f, 75f, 180f, 22f), LocalizedStrings.EnterYourEmailAddress, BlueStonez.label_interparkmed_11pt_left); GUI.color = Color.white; } GUI.SetNextControlName("@Password1"); this._password1 = GUI.PasswordField(new Rect(180f, 104f, 180f, 22f), this._password1, '*', BlueStonez.textField); if (string.IsNullOrEmpty(this._password1) && GUI.GetNameOfFocusedControl() != "@Password1") { GUI.color = new Color(1f, 1f, 1f, 0.3f); GUI.Label(new Rect(188f, 110f, 172f, 18f), LocalizedStrings.EnterYourPassword, BlueStonez.label_interparkmed_11pt_left); GUI.color = Color.white; } GUI.SetNextControlName("@Password2"); this._password2 = GUI.PasswordField(new Rect(180f, 140f, 180f, 22f), this._password2, '*', BlueStonez.textField); if (string.IsNullOrEmpty(this._password2) && GUI.GetNameOfFocusedControl() != "@Password2") { GUI.color = new Color(1f, 1f, 1f, 0.3f); GUI.Label(new Rect(188f, 146f, 180f, 22f), LocalizedStrings.RetypeYourPassword, BlueStonez.label_interparkmed_11pt_left); GUI.color = Color.white; } GUI.enabled = true; GUI.contentColor = this._errorMessageColor; GUI.Label(new Rect(0f, 175f, position2.width, 40f), this._errorMessage, BlueStonez.label_interparkbold_11pt); GUI.contentColor = Color.white; GUI.EndGroup(); GUI.Label(new Rect(100f, position.height - 42f - 22f, 300f, 16f), "By clicking OK you agree to the", BlueStonez.label_interparkbold_11pt); if (GUI.Button(new Rect(185f, position.height - 30f - 12f, 130f, 20f), "Terms of Service", BlueStonez.buttondark_small)) { ApplicationDataManager.OpenUrl("Terms Of Service", "http://www.cmune.com/index.php/terms-of-service/"); this.HideKeyboard(); } GUI.Label(new Rect(207f, position.height - 15f - 22f, 90f, 20f), GUIContent.none, BlueStonez.horizontal_line_grey95); GUI.enabled = this._enableGUI; if (GUITools.Button(new Rect(position.width - 150f, position.height - 42f - 22f, 120f, 32f), new GUIContent(LocalizedStrings.OkCaps), BlueStonez.button_green)) { this.HideKeyboard(); if (!ValidationUtilities.IsValidEmailAddress(this._emailAddress)) { this._targetHeight = 340f; this._errorMessageColor = Color.red; this._errorMessage = LocalizedStrings.EmailAddressIsInvalid; } else if (this._password1 != this._password2) { this._targetHeight = 340f; this._errorMessageColor = Color.red; this._errorMessage = LocalizedStrings.PasswordDoNotMatch; } else if (!ValidationUtilities.IsValidPassword(this._password1)) { this._targetHeight = 340f; this._errorMessageColor = Color.red; this._errorMessage = LocalizedStrings.PasswordInvalidCharsMsg; } else { this._enableGUI = false; this._targetHeight = 340f; this._errorMessageColor = Color.grey; this._errorMessage = LocalizedStrings.PleaseWait; AuthenticationWebServiceClient.CreateUser(this._emailAddress, this._password1, ApplicationDataManager.Channel, ApplicationDataManager.CurrentLocale.ToString(), SystemInfo.deviceUniqueIdentifier, delegate(MemberRegistrationResult result) { if (result == MemberRegistrationResult.Ok) { this.Hide(); CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Email, this._emailAddress); CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Password, this._password1); UnityRuntime.StartRoutine(Singleton <AuthenticationManager> .Instance.StartLoginMemberEmail(this._emailAddress, this._password1)); this._targetHeight = 300f; this._errorMessage = string.Empty; this._emailAddress = string.Empty; this._password1 = string.Empty; this._password2 = string.Empty; this._errorMessageColor = Color.red; this._enableGUI = true; } else { this._enableGUI = true; this._targetHeight = 340f; this._errorMessageColor = Color.red; this._errorMessages.TryGetValue(result, out this._errorMessage); } }, delegate(Exception ex) { this._enableGUI = true; this._targetHeight = 300f; this._errorMessage = string.Empty; this.ShowSignUpErrorPopup(LocalizedStrings.Error, "Sign Up was unsuccessful. There was an error communicating with the server."); }); } } if (GUITools.Button(new Rect(30f, position.height - 42f - 22f, 120f, 32f), new GUIContent(LocalizedStrings.BackCaps), BlueStonez.button)) { this.Hide(); this.HideKeyboard(); PanelManager.Instance.OpenPanel(PanelType.Login); } GUI.enabled = true; GUI.EndGroup(); }