// ------------------------------------------- /* * UpdateBasicInfo */ public void UpdateBasicInfo(string _email, string _password) { Email = _email; m_password = _password; m_passwordEncrypted = RJEncryptor.EncryptStringWithKey(_password, MenusScreenController.KYRJEncryption); PlayerPrefs.SetString(MenusScreenController.USER_EMAIL_COOCKIE, Email.ToLower()); PlayerPrefs.SetString(MenusScreenController.USER_PASSWORD_COOCKIE, RJEncryptor.EncryptStringWithKey(_password, MenusScreenController.KYRJEncryption)); }
private static void UserAccountD() { PlayerPrefs.DeleteAll(); PlayerPrefs.SetString(USER_EMAIL_COOCKIE, RJEncryptor.EncryptStringWithKey("*****@*****.**", MenusScreenController.KYRJEncryption)); PlayerPrefs.SetString(USER_PASSWORD_COOCKIE, RJEncryptor.EncryptStringWithKey("12345", MenusScreenController.KYRJEncryption)); #if ENABLE_BITCOIN PlayerPrefs.SetString(BitCoinController.NETWORK_TEST + BitCoinController.BITCOIN_PRIVATE_KEY_SELECTED, RJEncryptor.EncryptStringWithKey("cS5NzhNGZ4tjEB666RgGSMo2JYgo9vAdeRRMkscoVvxVTVQXTVXk", BitCoinController.ENCRYPTION_KEY)); PlayerPrefs.SetString(BitCoinController.NETWORK_TEST + BitCoinController.BITCOIN_PRIVATE_KEYS, RJEncryptor.EncryptStringWithKey("cS5NzhNGZ4tjEB666RgGSMo2JYgo9vAdeRRMkscoVvxVTVQXTVXk" + BitCoinController.SEPARATOR_COMA + "0", BitCoinController.ENCRYPTION_KEY)); #elif ENABLE_ETHEREUM PlayerPrefs.SetString(EthereumController.NETWORK_TEST + EthereumController.ETHEREUM_PRIVATE_KEY_SELECTED, RJEncryptor.EncryptStringWithKey("0x2e9942b76cd4b3072dd316c2475c26e55873dbfd16ae6c4f5c03fec7ae61ca61", EthereumController.ENCRYPTION_KEY)); PlayerPrefs.SetString(EthereumController.NETWORK_TEST + EthereumController.ETHEREUM_PRIVATE_KEYS, RJEncryptor.EncryptStringWithKey("0x2e9942b76cd4b3072dd316c2475c26e55873dbfd16ae6c4f5c03fec7ae61ca61" + EthereumController.SEPARATOR_COMA + "0", EthereumController.ENCRYPTION_KEY)); #endif PlayerPrefs.SetString(USER_NAME_COOCKIE, "Account Provider 2"); PlayerPrefs.SetInt(USER_FACEBOOK_CONNECTED_COOCKIE, 0); }
private static void UseAccountB() { PlayerPrefs.DeleteAll(); PlayerPrefs.SetString(USER_EMAIL_COOCKIE, RJEncryptor.EncryptStringWithKey("*****@*****.**", MenusScreenController.KYRJEncryption)); PlayerPrefs.SetString(USER_PASSWORD_COOCKIE, RJEncryptor.EncryptStringWithKey("12345", MenusScreenController.KYRJEncryption)); #if ENABLE_BITCOIN PlayerPrefs.SetString(BitCoinController.NETWORK_TEST + BitCoinController.BITCOIN_PRIVATE_KEY_SELECTED, RJEncryptor.EncryptStringWithKey("cTvjCsEcPrhNtRo8NzGmF7hfoht4ZgKkucsNPwPYcHHdebNtrvVv", BitCoinController.ENCRYPTION_KEY)); PlayerPrefs.SetString(BitCoinController.NETWORK_TEST + BitCoinController.BITCOIN_PRIVATE_KEYS, RJEncryptor.EncryptStringWithKey("cTvjCsEcPrhNtRo8NzGmF7hfoht4ZgKkucsNPwPYcHHdebNtrvVv" + BitCoinController.SEPARATOR_COMA + "0", BitCoinController.ENCRYPTION_KEY)); #elif ENABLE_ETHEREUM PlayerPrefs.SetString(EthereumController.NETWORK_TEST + EthereumController.ETHEREUM_PRIVATE_KEY_SELECTED, RJEncryptor.EncryptStringWithKey("0x5bd8bcbb596f6612bcd06d008d328482d9a986bef6d7a179db7022c35b7b69ae", EthereumController.ENCRYPTION_KEY)); PlayerPrefs.SetString(EthereumController.NETWORK_TEST + EthereumController.ETHEREUM_PRIVATE_KEYS, RJEncryptor.EncryptStringWithKey("0x5bd8bcbb596f6612bcd06d008d328482d9a986bef6d7a179db7022c35b7b69ae" + EthereumController.SEPARATOR_COMA + "0", EthereumController.ENCRYPTION_KEY)); #endif PlayerPrefs.SetString(USER_NAME_COOCKIE, "Account Customer 1"); PlayerPrefs.SetInt(USER_FACEBOOK_CONNECTED_COOCKIE, 0); }
private static void UserAccountC() { PlayerPrefs.DeleteAll(); PlayerPrefs.SetString(USER_EMAIL_COOCKIE, RJEncryptor.EncryptStringWithKey("*****@*****.**", MenusScreenController.KYRJEncryption)); PlayerPrefs.SetString(USER_PASSWORD_COOCKIE, RJEncryptor.EncryptStringWithKey("12345", MenusScreenController.KYRJEncryption)); #if ENABLE_BITCOIN PlayerPrefs.SetString(BitCoinController.NETWORK_TEST + BitCoinController.BITCOIN_PRIVATE_KEY_SELECTED, RJEncryptor.EncryptStringWithKey("cV3PCdEEABBFBCHP7S3kMnrVVPJSwBcDiJbbHawnzaP3YvGt9pr6", BitCoinController.ENCRYPTION_KEY)); PlayerPrefs.SetString(BitCoinController.NETWORK_TEST + BitCoinController.BITCOIN_PRIVATE_KEYS, RJEncryptor.EncryptStringWithKey("cV3PCdEEABBFBCHP7S3kMnrVVPJSwBcDiJbbHawnzaP3YvGt9pr6" + BitCoinController.SEPARATOR_COMA + "0", BitCoinController.ENCRYPTION_KEY)); #elif ENABLE_ETHEREUM PlayerPrefs.SetString(EthereumController.NETWORK_TEST + EthereumController.ETHEREUM_PRIVATE_KEY_SELECTED, RJEncryptor.EncryptStringWithKey("0x1f30969e98355945c2e1200bbc490443c9a3e71316bddc048e8c8a30b97725f7", EthereumController.ENCRYPTION_KEY)); PlayerPrefs.SetString(EthereumController.NETWORK_TEST + EthereumController.ETHEREUM_PRIVATE_KEYS, RJEncryptor.EncryptStringWithKey("0x1f30969e98355945c2e1200bbc490443c9a3e71316bddc048e8c8a30b97725f7" + EthereumController.SEPARATOR_COMA + "0", EthereumController.ENCRYPTION_KEY)); #endif PlayerPrefs.SetString(USER_NAME_COOCKIE, "Account Provider 2"); PlayerPrefs.SetInt(USER_FACEBOOK_CONNECTED_COOCKIE, 0); }
private static void UseAccountA() { PlayerPrefs.DeleteAll(); PlayerPrefs.SetString(USER_EMAIL_COOCKIE, RJEncryptor.EncryptStringWithKey("*****@*****.**", MenusScreenController.KYRJEncryption)); PlayerPrefs.SetString(USER_PASSWORD_COOCKIE, RJEncryptor.EncryptStringWithKey("12345", MenusScreenController.KYRJEncryption)); #if ENABLE_BITCOIN PlayerPrefs.SetString(BitCoinController.NETWORK_TEST + BitCoinController.BITCOIN_PRIVATE_KEY_SELECTED, RJEncryptor.EncryptStringWithKey("cUqTycDcKc56GEJBzXrpnJm8Pj8tVMQA6U4bhVRid7tYbb4T5S42", BitCoinController.ENCRYPTION_KEY)); PlayerPrefs.SetString(BitCoinController.NETWORK_TEST + BitCoinController.BITCOIN_PRIVATE_KEYS, RJEncryptor.EncryptStringWithKey("cUqTycDcKc56GEJBzXrpnJm8Pj8tVMQA6U4bhVRid7tYbb4T5S42" + BitCoinController.SEPARATOR_COMA + "0", BitCoinController.ENCRYPTION_KEY)); #elif ENABLE_ETHEREUM PlayerPrefs.SetString(EthereumController.NETWORK_TEST + EthereumController.ETHEREUM_PRIVATE_KEY_SELECTED, RJEncryptor.EncryptStringWithKey("0x1c6c36b151745ed7c93a6e353d0919a98a1b365474136723a743b8d0fa8144f6", EthereumController.ENCRYPTION_KEY)); PlayerPrefs.SetString(EthereumController.NETWORK_TEST + EthereumController.ETHEREUM_PRIVATE_KEYS, RJEncryptor.EncryptStringWithKey("0x1c6c36b151745ed7c93a6e353d0919a98a1b365474136723a743b8d0fa8144f6" + EthereumController.SEPARATOR_COMA + "0", EthereumController.ENCRYPTION_KEY)); #endif PlayerPrefs.SetString(USER_NAME_COOCKIE, "Account Provider"); PlayerPrefs.SetInt(USER_FACEBOOK_CONNECTED_COOCKIE, 0); }
// ------------------------------------------- /* * UpdateProfile */ public void UpdateProfile(string _password, string _email, string _name, string _village, string _mapdata, string _skills, string _description) { m_password = _password; m_passwordEncrypted = RJEncryptor.EncryptStringWithKey(_password, MenusScreenController.KYRJEncryption); Email = _email; m_nickname = _name; m_village = _village; m_mapdata = _mapdata; m_skills = _skills; m_description = _description; GetFormattedSkills(); UpdateLocalProfile(m_password, Email, m_nickname); }
// ------------------------------------------- /* * SaveFacebookLoginLocal */ private void UpdateLocalProfile(string _password, string _email, string _name) { PlayerPrefs.SetString(MenusScreenController.USER_PASSWORD_COOCKIE, RJEncryptor.EncryptStringWithKey(_password, MenusScreenController.KYRJEncryption)); PlayerPrefs.SetString(MenusScreenController.USER_EMAIL_COOCKIE, RJEncryptor.EncryptStringWithKey(_email.ToLower(), MenusScreenController.KYRJEncryption)); PlayerPrefs.SetString(MenusScreenController.USER_NAME_COOCKIE, _name); }
// ------------------------------------------- /* * SaveFacebookLoginLocal */ private void SaveLocalFacebookLogin(string _facebookId, string _name, string _email) { PlayerPrefs.SetString(MenusScreenController.USER_EMAIL_COOCKIE, RJEncryptor.EncryptStringWithKey(_email.ToLower(), MenusScreenController.KYRJEncryption)); PlayerPrefs.SetString(MenusScreenController.USER_NAME_COOCKIE, _name); PlayerPrefs.SetInt(MenusScreenController.USER_FACEBOOK_CONNECTED_COOCKIE, 1); }
// ------------------------------------------- /* * SaveEmailLoginLocal */ private void SaveLocalEmailLogin(string _email, string _password) { PlayerPrefs.SetString(MenusScreenController.USER_EMAIL_COOCKIE, RJEncryptor.EncryptStringWithKey(_email.ToLower(), MenusScreenController.KYRJEncryption)); PlayerPrefs.SetString(MenusScreenController.USER_PASSWORD_COOCKIE, RJEncryptor.EncryptStringWithKey(_password, MenusScreenController.KYRJEncryption)); PlayerPrefs.SetInt(MenusScreenController.USER_FACEBOOK_CONNECTED_COOCKIE, 0); }
// ------------------------------------------- /* * SetPassword */ public void SetPassword(string _password) { m_password = _password; m_passwordEncrypted = RJEncryptor.EncryptStringWithKey(_password, MenusScreenController.KYRJEncryption); PlayerPrefs.SetString(MenusScreenController.USER_PASSWORD_COOCKIE, RJEncryptor.EncryptStringWithKey(_password, MenusScreenController.KYRJEncryption)); }
// ------------------------------------------- /* * OnUIEvent */ private void OnUIEvent(string _nameEvent, params object[] _list) { if (_nameEvent == EVENT_IAP_CONFIRMATION) { bool success = (bool)_list[0]; string iapID = (string)_list[1]; if (MenusScreenController.Instance.DebugIAPs) { Debug.Log("EVENT_IAP_CONFIRMATION::success[" + success + "]::iapID[" + iapID + "]"); } if ((iapID.IndexOf(IAP_ENERGY_PACK_1) != -1) || (iapID.IndexOf(IAP_ENERGY_PACK_2) != -1) || (iapID.IndexOf(IAP_ENERGY_PACK_3) != -1) || (iapID.IndexOf(IAP_ENERGY_PACK_4) != -1)) { if (success) { int rentValue = int.Parse(iapID.Substring(iapID.Length - 1, 1)); UIEventController.Instance.DispatchUIEvent(UsersController.EVENT_USER_IAP_CALL_PURCHASE_RENT_PROVIDER, success, rentValue, m_currentCodeTransaction); } else { UIEventController.Instance.DispatchUIEvent(UsersController.EVENT_USER_IAP_CALL_PURCHASE_RENT_PROVIDER, success); } } else { if (iapID.IndexOf(IAP_POST_OFFER_NO_WAIT) != -1) { UIEventController.Instance.DispatchUIEvent(UsersController.EVENT_USER_IAP_CALL_PURCHASE_POST_OFFER, success, m_currentCodeTransaction); } else { if (iapID.IndexOf(IAP_CREATE_NEW_REQUEST) != -1) { UIEventController.Instance.DispatchUIEvent(UsersController.EVENT_USER_IAP_CALL_PURCHASE_NEW_REQUEST, success, m_currentCodeTransaction); } else { if (!success) { UIEventController.Instance.DispatchUIEvent(ScreenController.EVENT_FORCE_DESTRUCTION_POPUP); string title = LanguageController.Instance.GetText("message.error"); string description = LanguageController.Instance.GetText("message.iap.failure.any.operation"); MenusScreenController.Instance.CreateNewInformationScreen(ScreenInformationView.SCREEN_INFORMATION, UIScreenTypePreviousAction.KEEP_CURRENT_SCREEN, title, description, null, ""); } } } } } if (_nameEvent == EVENT_IAP_CALL_PURCHASE_RENT_PROVIDER) { m_currentEventIAP = EVENT_IAP_CALL_PURCHASE_RENT_PROVIDER; m_currentIdProduct = (string)_list[0]; m_currentCodeTransaction = Utilities.RandomCodeGeneration(UsersController.Instance.CurrentUser.Id.ToString()); string codeGeneratedInitial = RJEncryptor.EncryptStringWithKey(m_currentCodeTransaction, MenusScreenController.KYRJEncryption); CommsHTTPConstants.IAPRegisterCode(UsersController.Instance.CurrentUser.Id, UsersController.Instance.CurrentUser.Password, codeGeneratedInitial); } if (_nameEvent == EVENT_IAP_CALL_PURCHASE_POST_OFFER_NO_WAIT) { m_currentEventIAP = EVENT_IAP_CALL_PURCHASE_POST_OFFER_NO_WAIT; m_currentCodeTransaction = Utilities.RandomCodeGeneration(UsersController.Instance.CurrentUser.Id.ToString()); CommsHTTPConstants.IAPRegisterCode(UsersController.Instance.CurrentUser.Id, UsersController.Instance.CurrentUser.Password, RJEncryptor.EncryptStringWithKey(m_currentCodeTransaction, MenusScreenController.KYRJEncryption)); } if (_nameEvent == EVENT_IAP_CALL_PURCHASE_CREATE_NEW_REQUEST) { m_currentEventIAP = EVENT_IAP_CALL_PURCHASE_CREATE_NEW_REQUEST; m_currentCodeTransaction = Utilities.RandomCodeGeneration(UsersController.Instance.CurrentUser.Id.ToString()); CommsHTTPConstants.IAPRegisterCode(UsersController.Instance.CurrentUser.Id, UsersController.Instance.CurrentUser.Password, RJEncryptor.EncryptStringWithKey(m_currentCodeTransaction, MenusScreenController.KYRJEncryption)); } if (_nameEvent == EVENT_IAP_CODE_CONFIRMATION) { if ((bool)_list[0]) { string codeDecrypted = RJEncryptor.DecryptStringWithKey((string)_list[1], MenusScreenController.KYRJEncryption); if (codeDecrypted == m_currentCodeTransaction) { m_currentCodeTransaction = (string)_list[1]; if (m_currentEventIAP == EVENT_IAP_CALL_PURCHASE_RENT_PROVIDER) { if (m_currentIdProduct.Length > 0) { BuyProductID(m_currentIdProduct); } } if (m_currentEventIAP == EVENT_IAP_CALL_PURCHASE_POST_OFFER_NO_WAIT) { BuyProductID(IAP_POST_OFFER_NO_WAIT); } if (m_currentEventIAP == EVENT_IAP_CALL_PURCHASE_CREATE_NEW_REQUEST) { BuyProductID(IAP_CREATE_NEW_REQUEST); } m_currentEventIAP = ""; m_currentIdProduct = ""; } } } }