public void AeriaMakePayment(IAuthRequest req, AuthEndResponseDelegate callbackHandler, Control ctrl) { this.FormsControl = ctrl; this.CallbackMethod = callbackHandler; this.mRequest = (XmlRpcAuthRequest)req; AuthProxy proxy = XmlRpcProxyGen.Create <AuthProxy>(); proxy.Url = this.EndpointUri; proxy.BeginAeriaMakePayment(this.mRequest.Request, new AsyncCallback(this.AeriaMakePaymentResponse), null); }
public XmlRpcAuthResponse RenameParish(IAuthRequest req, AuthEndResponseDelegate callbackHandler, Control ctrl, int timeout) { try { this.FormsControl = ctrl; this.CallbackMethod = callbackHandler; this.mRequest = (XmlRpcAuthRequest)req; AuthProxy proxy = XmlRpcProxyGen.Create <AuthProxy>(); proxy.Url = this.EndpointUri; proxy.Timeout = timeout; XmlRpcRespStruct struct2 = proxy.RenameParish(this.mRequest.Request); this.mResponse = new XmlRpcAuthResponse(struct2.mMessage, struct2.mSuccessCode); } catch (Exception) { this.mResponse = new XmlRpcAuthResponse("Login Server Unavailable, please try again later", 0, this.mRequest.UserGUID, this.mRequest.Username, this.mRequest.EmailAddress, this.mRequest.Password, this.mRequest.SessionID, this.mRequest.IPAddress, this.mRequest.Platform, null, 0, 0, 0, null, null, null, null); } return(this.mResponse); }
public XmlRpcAuthResponse AeriaMakePayment(IAuthRequest req, AuthEndResponseDelegate callbackHandler, Control ctrl, int timeout) { try { this.FormsControl = ctrl; this.CallbackMethod = callbackHandler; this.mRequest = (XmlRpcAuthRequest)req; AuthProxy proxy = XmlRpcProxyGen.Create <AuthProxy>(); proxy.Url = this.EndpointUri; proxy.Timeout = timeout; XmlRpcRespStruct struct2 = proxy.AeriaMakePayment(this.mRequest.Request); this.mResponse = new XmlRpcAuthResponse(struct2.mMessage, struct2.mSuccessCode, struct2.mUserGUID, struct2.mUsername, struct2.mEmailAddress, struct2.mPassword, struct2.mSessionID, struct2.mIPAddress, struct2.mPlatform, struct2.mRawCards, struct2.mCrowns, struct2.mCardpoints, struct2.mPremiumCards, struct2.mRawOffers, struct2.mRawPacks, struct2.mRawSharers, struct2.mRawTokens, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, struct2.mRawProducts, null); } catch (Exception) { this.mResponse = new XmlRpcAuthResponse("Login Server Unavailable, please try again later", 0, this.mRequest.UserGUID, this.mRequest.Username, this.mRequest.EmailAddress, this.mRequest.Password, this.mRequest.SessionID, this.mRequest.IPAddress, this.mRequest.Platform, null, 0, 0, 0, null, null, null, null); } return(this.mResponse); }
public int AeriaGetBalance(IAuthRequest req, AuthEndResponseDelegate callbackHandler, Control ctrl, int timeout, ref XmlRpcAuthResponse response) { try { this.FormsControl = ctrl; this.CallbackMethod = callbackHandler; this.mRequest = (XmlRpcAuthRequest)req; AuthProxy proxy = XmlRpcProxyGen.Create <AuthProxy>(); proxy.Url = this.EndpointUri; proxy.Timeout = timeout; XmlRpcRespStruct struct2 = proxy.AeriaGetBalance(this.mRequest.Request); int num = 0; num = struct2.mPoints.Value; this.mResponse = new XmlRpcAuthResponse(); this.mResponse.Products = struct2.mRawProducts; response = this.mResponse; return(num); } catch (Exception) { return(0); } }
public static void steam_run() { if (steamActive) { Steam_RunCallBacks(); bool lastOverlayState = Program.lastOverlayState; if (Steam_OverlayActive() > 0) { if (!Program.lastOverlayState) { Program.lastOverlayState = true; OLActive(); } } else if (Program.lastOverlayState) { Program.lastOverlayState = false; OLInactive(); } if (((!Program.lastOverlayState && !lastOverlayState) && (GameEngine.tabPressed && GameEngine.shiftPressed)) && ((Steam_IsOverlayEnabled() > 0) && !InterfaceMgr.Instance.isDXVisible())) { InterfaceMgr.Instance.changeTab(9); InterfaceMgr.Instance.changeTab(0); Steam_OpenOverlay(); } if (Steam_MT_Got_Response() > 0) { bool flag2 = Steam_MT_Authorised() == 1; ulong num = Steam_MT_OrderID(); Steam_MT_AppID(); Steam_MT_Clear_Response(); if (flag2) { XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", RemoteServices.Instance.SessionGuid.ToString().Replace("-", ""), null, null, null) { OrderID = num.ToString() }; if (provider.SteamPaymentFinal(req, null, null, 0x3a98).SuccessCode == 1) { MyMessageBox.Show(SK.Text("STEAM_AUTHORIZED_OK", "Your payment was received and your crowns have been credited - Thank You!")); } else { MyMessageBox.Show(SK.Text("STEAM_AUTHORIZED_BAD", "There was a problem processing your payment through Steam, please contact support.")); } } } } }
private void TransferUser() { XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest { SteamID = Program.steamID, Culture = Program.mySettings.LanguageIdent.ToLower(), Username = "******", EmailAddress = this.txtEmail.Text, Password = this.txtPassword.Text }; this.NextButton.Image = this.NextImageOver; this.NextButton.Enabled = false; this.txtEmail.Enabled = false; this.txtEmailconfirm.Enabled = false; this.txtUsername.Enabled = false; this.txtPassword.Enabled = false; this.txtPasswordconfirm.Enabled = false; provider.CreateUserSteam(req, new AuthEndResponseDelegate(this.createUserCallback), this); }
private void CreateUser() { XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest(); if (Program.gamersFirstInstall) { req.SteamID = "gamersfirst"; req.EmailAddress = ""; req.Password = Program.gamersFirstTokenMD5; } else if (Program.arcInstall) { req.SteamID = "arc"; req.EmailAddress = Program.arcUsername; req.Password = Program.getNewArcToken(); Program.arcToken = ""; } else { req.SteamID = Program.steamID; req.EmailAddress = this.txtEmail.Text; req.Password = this.txtPassword.Text; if (this.newsletterCheck.Checked) { req.ParishID = 100; } else { req.ParishID = 50; } } req.Culture = Program.mySettings.LanguageIdent.ToLower(); req.Username = this.lastUsernameChecked; this.NextButton.Image = this.NextImageOver; this.NextButton.Enabled = false; this.txtEmail.Enabled = false; this.txtEmailconfirm.Enabled = false; this.txtUsername.Enabled = false; this.txtPassword.Enabled = false; this.txtPasswordconfirm.Enabled = false; provider.CreateUserSteam(req, new AuthEndResponseDelegate(this.createUserCallback), this); }
private void ValidateUsername(bool create) { Regex regex = new Regex(this.usernamePattern); if (((this.txtUsername.Text.Length >= 4) && (this.txtUsername.Text.Length <= 0x12)) && regex.IsMatch(this.txtUsername.Text.Trim())) { if (!this.usernameValidationInProgress) { this.usernameNotChecked = false; this.usernameValidationInProgress = true; XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest { SteamID = Program.steamID, Culture = Program.mySettings.LanguageIdent.ToLower(), Username = this.txtUsername.Text.Trim() }; this.NextButton.Image = this.NextImageOver; this.NextButton.Enabled = false; if (create) { provider.CheckUsernameSteam(req, new AuthEndResponseDelegate(this.usernameCheckCallbackThenCreate), this); } else { provider.CheckUsernameSteam(req, new AuthEndResponseDelegate(this.usernameCheckCallback), this); } } else { this.usernameNotChecked = true; } } else { this.FeedbackLabel.Color = ARGBColors.Red; this.FeedbackLabel.Text = string.Empty; this.lastUsernameValid = false; this.ValidateNextButton(); } }
public void GetOfflineWorlds() { XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest("", "", "", "", "", "", "", ""); provider.GetWorlds(req, new AuthEndResponseDelegate(this.GetOfflineWorldsCallback), this); }
public void AuthenticateSteamAccount(IAuthRequest req, AuthEndResponseDelegate callbackHandler, Control ctrl) { this.FormsControl = ctrl; this.CallbackMethod = callbackHandler; this.mRequest = (XmlRpcAuthRequest) req; AuthProxy proxy = XmlRpcProxyGen.Create<AuthProxy>(); proxy.Url = this.EndpointUri; proxy.BeginAuthSteamAccount(this.mRequest.Request, new AsyncCallback(this.AuthenticateSteamAccountResponse), null); }
private void LoginBeta(string userguid, string sessionguid, string email, string admin) { GameEngine.Instance.World.isBigpointAccount = false; this.connectingCancelled = false; storedUserLoginEmail = email; IAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); IAuthRequest req = new XmlRpcAuthRequest(userguid, "", "", "", null, "", "Kingdoms Client v0.xx", admin) { SessionID = sessionguid, Admin = admin, WorldID = new int?(this.lastWorldLoggedIn) }; provider.LoginBetaUser(req, new AuthEndResponseDelegate(this.LoginCallback), this); Program.mySettings.Username = storedUserLoginEmail; Program.mySettings.Save(); }
private void btnClientLogout_Click() { if (Program.bigpointPartnerInstall) { this.forumLabel.Visible = false; if ((bp2_logoutURL != null) && (bp2_logoutURL.Length > 0)) { Process.Start(bp2_logoutURL); } RemoteServices.Instance.UserGuid = Guid.Empty; RemoteServices.Instance.SessionGuid = Guid.Empty; this.AdminGUID = null; this.bp2_loginMode = 0; this.PlayerGameworldCount = 0; this.GetOfflineWorlds(); this.RefreshControls(); this.geckoWebBrowser1.Navigate(URLs.NewsMainPage); this.EnablePanels(true); } else { XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", RemoteServices.Instance.SessionGuid.ToString().Replace("-", ""), "", "", ""); this.clearErrorMessages(); provider.clientLogout(req, new AuthEndResponseDelegate(this.ClientLogoutCallback), this); this.EnablePanels(false); this.geckoWebBrowser1.Enabled = false; if (LoggedInViaFacebook) { if (tempBrowser == null) { tempBrowser = new WebBrowser(); tempBrowser.Location = new Point(0x3e8, 0x3e8); } tempBrowser.Navigate("http://login.strongholdkingdoms.com/facebook/logout.php?access_token=" + Program.mySettings.facebookaccesstoken); Thread.Sleep(0x3e8); Program.mySettings.facebookaccesstoken = ""; } LoggedInViaFacebook = false; if (Program.aeriaInstall) { this.openAeriaPopup(true); } if (Program.bigpointInstall) { this.openBigPointPopup(true); } bool bigpointPartnerInstall = Program.bigpointPartnerInstall; } }
private void geckoWebBrowser1_ClientFeedback(object sender, EventArgs e) { this.EnablePanels(true); this.geckoWebBrowser1.Enabled = true; bool flag = false; bool flag2 = false; string sessionguid = string.Empty; string userguid = string.Empty; string email = string.Empty; string admin = string.Empty; string str5 = string.Empty; string str6 = string.Empty; string guid = string.Empty; string sessionid = string.Empty; string username = string.Empty; string str10 = ""; foreach (string str11 in this.geckoWebBrowser1.PageValues.Keys) { string str14 = str10; str10 = str14 + str11 + " : " + this.geckoWebBrowser1.PageValues[str11] + " "; if (str11 != "") { string text = this.geckoWebBrowser1.PageValues[str11]; if ((str11.ToLowerInvariant() == "errorcode") || (str11.ToLowerInvariant() == "errorCode")) { if (this.getInt32FromString(text) != 1) { flag2 = true; } } else if (str11.Trim().ToLowerInvariant() == "switchadmin") { str6 = text; } else if (str11.Trim().ToLowerInvariant() == "switchuser") { guid = text; } else if (str11.Trim().ToLowerInvariant() == "switchsession") { sessionid = text; } else if (str11.Trim().ToLowerInvariant() == "switchemail") { username = text; } else if ((str11.ToLowerInvariant() == "server") || (str11.ToLowerInvariant() == " server")) { flag = true; this.serverAddr = text; } else if (str11.Trim().ToLowerInvariant() == "email") { email = text; } else if (str11.Trim().ToLowerInvariant() == "sessionguid") { sessionguid = text; } else if (str11.Trim().ToLowerInvariant() == "userguid") { userguid = text; } else if (str11.Trim().ToLowerInvariant() == "adminguid") { admin = text; } else if (str11.Trim().ToLowerInvariant() == "worldname") { str5 = text.Replace('+', ' '); } else if (str11.Trim().ToLowerInvariant() == "openlink") { Process.Start("http://" + text.Replace("%2F", "/")); } else if (str11.Trim().ToLowerInvariant() == "selectedworldid") { int num2 = -1; string s = this.geckoWebBrowser1.PageValues[str11]; try { num2 = int.Parse(s, CultureInfo.InvariantCulture); } catch (Exception) { num2 = -1; } RemoteServices.Instance.ProfileWorldID = num2; } } } if (((str6.Length > 0) && (guid.Length > 0)) && (sessionid.Length > 0)) { this.geckoWebBrowser1.Document.Cookie = ""; this.AdminGUID = str6; XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest(guid, username, username, "", sessionid, "", "", str6); this.clearErrorMessages(); provider.clientLogin(req, new AuthEndResponseDelegate(this.ClientLoginCallback), this); this.EnablePanels(false); } if ((RemoteServices.Instance.ProfileWorldID == 0) || (RemoteServices.Instance.ProfileWorldID == -1)) { RemoteServices.Instance.ProfileWorldID = 5; } if ((flag && !flag2) && (this.serverAddr.Length > 0)) { if (str5 != string.Empty) { Program.WorldName = str5; } this.LoginBeta(userguid, sessionguid, email, admin); } else if (this.geckoWebBrowser1.Url.AbsoluteUri.ToLowerInvariant().Contains("gotogameworld")) { if (str10.Length > 0) { MyMessageBox.Show(SK.Text("ProfileLoginWindow_Connection_Problem", "There was a problem logging in, please check that Kingdoms is not blocked by your firewall or proxy.") + Environment.NewLine + str10); } else { MyMessageBox.Show(SK.Text("ProfileLoginWindow_Connection_Problem", "There was a problem logging in, please check that Kingdoms is not blocked by your firewall or proxy.") + Environment.NewLine + SK.Text("ProfileLoginWindow_No_Cookies_Written", "No cookies written!")); } this.RequestGameWorlds(RemoteServices.Instance.SessionGuid.ToString("N"), RemoteServices.Instance.UserGuid.ToString("N")); } }
public void update() { if (this.initialisedLanguage != Program.mySettings.LanguageIdent) { if (this.joinImage != null) { this.joinImage.Dispose(); } if (this.joinImageOver != null) { this.joinImageOver.Dispose(); } if (this.playImage != null) { this.playImage.Dispose(); } if (this.playImageOver != null) { this.playImageOver.Dispose(); } if (this.loginImage != null) { this.loginImage.Dispose(); } if (this.logoutImage != null) { this.logoutImage.Dispose(); } if (this.loginImageOver != null) { this.loginImageOver.Dispose(); } if (this.closedImage != null) { this.closedImage.Dispose(); } if (this.closedImageOver != null) { this.closedImageOver.Dispose(); } if (this.logoutImageOver != null) { this.logoutImageOver.Dispose(); } if (this.newsImage != null) { this.newsImage.Dispose(); } if (this.newsImageOver != null) { this.newsImageOver.Dispose(); } if (this.accountImage != null) { this.accountImage.Dispose(); } if (this.accountImageOver != null) { this.accountImageOver.Dispose(); } if (this.exitImage != null) { this.exitImage.Dispose(); } if (this.exitImageOver != null) { this.exitImageOver.Dispose(); } if (this.cancelImage != null) { this.cancelImage.Dispose(); } if (this.cancelImageOver != null) { this.cancelImageOver.Dispose(); } if (this.forgottenImage != null) { this.forgottenImage.Dispose(); } if (this.forgottenImageOver != null) { this.forgottenImageOver.Dispose(); } if (this.selectImage != null) { this.selectImage.Dispose(); } if (this.selectImageOver != null) { this.selectImageOver.Dispose(); } if (this.createAccountImage != null) { this.createAccountImage.Dispose(); } if (this.createAccountImageOver != null) { this.createAccountImageOver.Dispose(); } if (this.createAccountImage2 != null) { this.createAccountImage2.Dispose(); } if (this.createAccountImageOver2 != null) { this.createAccountImageOver2.Dispose(); } if (this.optionsImage != null) { this.optionsImage.Dispose(); } if (this.optionsImageOver != null) { this.optionsImageOver.Dispose(); } this.joinImage = this.joinImageOver = this.playImage = this.playImageOver = this.loginImage = this.logoutImage = this.loginImageOver = this.closedImage = this.closedImageOver = this.logoutImageOver = this.newsImage = this.newsImageOver = this.accountImage = this.accountImageOver = this.exitImage = this.exitImageOver = this.cancelImage = this.cancelImageOver = this.forgottenImage = this.forgottenImageOver = this.selectImage = this.selectImageOver = this.createAccountImage = this.createAccountImageOver = this.createAccountImage2 = this.createAccountImageOver2 = this.optionsImage = (Image) (this.optionsImageOver = null); if (WorldSelectPopupPanel.closeImage != null) { WorldSelectPopupPanel.closeImage.Dispose(); } if (WorldSelectPopupPanel.closeImageOver != null) { WorldSelectPopupPanel.closeImageOver.Dispose(); } if (WorldSelectPopupPanel.selectImageSelected != null) { WorldSelectPopupPanel.selectImageSelected.Dispose(); } if (WorldSelectPopupPanel.selectImage != null) { WorldSelectPopupPanel.selectImage.Dispose(); } if (WorldSelectPopupPanel.selectImageOver != null) { WorldSelectPopupPanel.selectImageOver.Dispose(); } if (WorldSelectPopupPanel.selectSpecialImage != null) { WorldSelectPopupPanel.selectSpecialImage.Dispose(); } if (WorldSelectPopupPanel.selectSpecialImageSelected != null) { WorldSelectPopupPanel.selectSpecialImageSelected.Dispose(); } if (WorldSelectPopupPanel.selectSpecialImageOver != null) { WorldSelectPopupPanel.selectSpecialImageOver.Dispose(); } if (WorldSelectPopupPanel.selectAIImage != null) { WorldSelectPopupPanel.selectAIImage.Dispose(); } if (WorldSelectPopupPanel.selectAIImageSelected != null) { WorldSelectPopupPanel.selectAIImageSelected.Dispose(); } if (WorldSelectPopupPanel.selectAIImageOver != null) { WorldSelectPopupPanel.selectAIImageOver.Dispose(); } if (WorldSelectPopupPanel.joinImage != null) { WorldSelectPopupPanel.joinImage.Dispose(); } if (WorldSelectPopupPanel.joinImageOver != null) { WorldSelectPopupPanel.joinImageOver.Dispose(); } if (WorldSelectPopupPanel.playImage != null) { WorldSelectPopupPanel.playImage.Dispose(); } if (WorldSelectPopupPanel.playImageOver != null) { WorldSelectPopupPanel.playImageOver.Dispose(); } if (WorldSelectPopupPanel.closedImage != null) { WorldSelectPopupPanel.closedImage.Dispose(); } WorldSelectPopupPanel.closeImage = WorldSelectPopupPanel.closeImageOver = WorldSelectPopupPanel.selectImageSelected = WorldSelectPopupPanel.selectImage = WorldSelectPopupPanel.selectImageOver = WorldSelectPopupPanel.selectSpecialImage = WorldSelectPopupPanel.selectSpecialImageSelected = WorldSelectPopupPanel.selectSpecialImageOver = WorldSelectPopupPanel.selectAIImage = WorldSelectPopupPanel.selectAIImageSelected = WorldSelectPopupPanel.selectAIImageOver = WorldSelectPopupPanel.joinImage = WorldSelectPopupPanel.joinImageOver = WorldSelectPopupPanel.playImage = WorldSelectPopupPanel.playImageOver = (Image) (WorldSelectPopupPanel.closedImage = null); if (BPPopupPanel.closeImage != null) { BPPopupPanel.closeImage.Dispose(); } if (BPPopupPanel.closeImageOver != null) { BPPopupPanel.closeImageOver.Dispose(); } if (BPPopupPanel.completeImage != null) { BPPopupPanel.completeImage.Dispose(); } if (BPPopupPanel.completeImageOver != null) { BPPopupPanel.completeImageOver.Dispose(); } BPPopupPanel.closeImage = BPPopupPanel.closeImageOver = BPPopupPanel.completeImage = (Image) (BPPopupPanel.completeImageOver = null); if (CreatePopupPanel.nextImage != null) { CreatePopupPanel.nextImage.Dispose(); } if (CreatePopupPanel.nextImageOver != null) { CreatePopupPanel.nextImageOver.Dispose(); } if (CreatePopupPanel.headerImage != null) { CreatePopupPanel.headerImage.Dispose(); } if (CreatePopupPanel.headerTransferImage != null) { CreatePopupPanel.headerTransferImage.Dispose(); } if (CreatePopupPanel.closeImage != null) { CreatePopupPanel.closeImage.Dispose(); } if (CreatePopupPanel.closeImageOver != null) { CreatePopupPanel.closeImageOver.Dispose(); } if (CreatePopupPanel.transferImage != null) { CreatePopupPanel.transferImage.Dispose(); } if (CreatePopupPanel.transferImageOver != null) { CreatePopupPanel.transferImageOver.Dispose(); } CreatePopupPanel.nextImage = CreatePopupPanel.nextImageOver = CreatePopupPanel.headerImage = CreatePopupPanel.headerTransferImage = CreatePopupPanel.closeImage = CreatePopupPanel.closeImageOver = CreatePopupPanel.transferImage = (Image) (CreatePopupPanel.transferImageOver = null); if (VacationCancelPopupPanel.cancelImageOver != null) { VacationCancelPopupPanel.cancelImageOver.Dispose(); } if (VacationCancelPopupPanel.closeImage != null) { VacationCancelPopupPanel.closeImage.Dispose(); } if (VacationCancelPopupPanel.closeImageOver != null) { VacationCancelPopupPanel.closeImageOver.Dispose(); } if (VacationCancelPopupPanel.headerImage != null) { VacationCancelPopupPanel.headerImage.Dispose(); } if (VacationCancelPopupPanel.cancelImage != null) { VacationCancelPopupPanel.cancelImage.Dispose(); } VacationCancelPopupPanel.closeImage = VacationCancelPopupPanel.closeImageOver = VacationCancelPopupPanel.headerImage = VacationCancelPopupPanel.cancelImage = (Image) (VacationCancelPopupPanel.cancelImageOver = null); if (this.chkAutoLogin != null) { this.chkAutoLogin.Checked = false; } this.init(); if (this.chkAutoLogin != null) { this.chkAutoLogin.Checked = false; } base.Invalidate(); } else if (this.delayedCreateUserOpen) { this.delayedCreateUserOpen = false; this.ShowCreateUserForm(); } else { if (this.emailOptInPopup) { this.emailOptInPopup = false; new EmailOptInPopup { m_Parent = this }.ShowDialog(Program.profileLogin); int num = 0; if (this.emailOptInState) { num = 1; } XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", RemoteServices.Instance.SessionGuid.ToString().Replace("-", ""), "", "", "", 0, 0, new int?(num)); provider.SetEmailOptIn(req, new AuthEndResponseDelegate(this.EmailOptInCallback), this); } InterfaceMgr.Instance.runTooltips(); if (this.lastLogoutClicked != DateTime.MinValue) { TimeSpan span = (TimeSpan) (DateTime.Now - this.lastLogoutClicked); if (span.TotalSeconds > 60.0) { this.lastLogoutClicked = DateTime.MinValue; } } int downloadingCounter = GameEngine.Instance.World.downloadingCounter; if (downloadingCounter != this.lastCount) { string str = SK.Text("ConnectingPopup_Retrieving_Data", "Retrieving Data From Server."); for (int i = 0; i < downloadingCounter; i++) { str = str + "."; } this.lblRetrieving.Text = str; if (this.lblRetrieving.Visible) { this.Text = this.defaultWindowTitle + " - " + this.lblRetrieving.Text; } this.lastCount = downloadingCounter; if (this.lblRetrieving.Visible) { this.feedbackProgress.Size = new Size(Math.Min((this.pnlFeedback.Width * (downloadingCounter + 2)) / 12, this.pnlFeedback.Width), this.pnlFeedback.Height); } else { this.feedbackProgress.Size = new Size(0, this.pnlFeedback.Height); } this.feedbackProgressArea.invalidate(); } if ((InterfaceMgr.Instance.isCreatePopup() || InterfaceMgr.Instance.isVacationCancelPopupWindow()) || (InterfaceMgr.Instance.isBPPopup() || InterfaceMgr.Instance.isWorldSelectPopup())) { InterfaceMgr.Instance.updatePopups(); } } }
public void JoinGameworld(int? playing, int? firstworld, int? worldid, string worldName) { if (playing.HasValue && (playing == 0)) { LastNumberOfWorldsPlaying++; } Program.mySettings.LastWorldID = worldid.Value; this.lastWorldLoggedIn = Program.mySettings.LastWorldID; Program.mySettings.Save(); this.lblRetrieving.Text = SK.Text("ProfileLogin_Connecting", "Connecting To : ") + worldName; this.lblRetrieving.Visible = true; this.tandcLabel.Visible = false; this.gameRulesLabel.Visible = false; this.forumLabel.Visible = false; this.supportLabel.Visible = false; this.feedbackProgress.Size = new Size(Math.Min(this.pnlFeedback.Width / 11, this.pnlFeedback.Width), this.pnlFeedback.Height); this.feedbackProgressArea.invalidate(); this.Text = this.defaultWindowTitle + " - " + this.lblRetrieving.Text; this.cancelButton.Visible = true; XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", RemoteServices.Instance.SessionGuid.ToString().Replace("-", ""), "", "", "", worldid, firstworld, playing); provider.ChooseWorld(req, new AuthEndResponseDelegate(this.JoinGameworldCallback), this); }
public void GetOnlineWorlds() { XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", "", "", "", ""); provider.GetWorlds(req, new AuthEndResponseDelegate(this.GetOnlineWorldsCallback), this); }
private static void Main(string[] args) { #if DEBUG AllocConsole(); #endif try { args = new string[] { "-InstallerVersion", CurrentInstallerBuild.ToString(), "en" }; #if DEBUG Console.WriteLine("Nichosy " + DataExport.version); #endif DataExport.Fill(); bool flag = false; bool flag2 = false; string str = "en"; if ((args == null) || (args.Length < 1)) { flag = true; } if ((args != null) && (args.Length > 1)) { if (args[0].ToLowerInvariant() == "-installerversion") { if (Convert.ToInt32(args[1]) < CurrentInstallerBuild) { flag2 = true; } } else if (!(args[0].ToLowerInvariant() == "-installer")) { flag = true; } if (args.Length > 2) { if (args[2].Length > 0) { str = args[2]; } if ((args.Length > 3) && (args[3].Length > 0)) { if (args[3] == "st") { steamInstall = true; } if (args[3] == "bp") { bigpointInstall = true; } if (args[3] == "bp2") { bigpointPartnerInstall = true; } if (args[3] == "ae") { aeriaInstall = true; } if (args[3] == "gf") { gamersFirstInstall = true; if ((args.Length > 4) && (args[4].Length > 0)) { gamersFirstTokenMD5 = args[4]; } } if (args[3] == "arc") { if (args.Length > 4) { arcUsername = args[4]; arcInstall = true; if (arcUsername.Length <= 0) { arcLauncherStart = true; } } else { arcLauncherStart = true; } } } } } else { flag2 = true; } xmas_period = HolidayPeriods.xmas(DateTime.Now); if (arcLauncherStart) { arc_launchClient(str); } else if (flag) { MessageBox.Show(SK.Text("ProgramMain_Launch_Failure1", "This is not the game exe!") + Environment.NewLine + Environment.NewLine + SK.Text("ProgramMain_Launch_Failure2", "Please run Stronghold Kingdoms in the normal manner."), SK.Text("ProgramMain_Launch_Failure", "Stronghold Kingdoms Error"), MessageBoxButtons.OK); } else if (flag2 && !steamInstall) { MessageBoxButtons oKCancel = MessageBoxButtons.OKCancel; if (MessageBox.Show(SK.Text("ProgramMain_New_nInstaller", "A new version of the Updater/Installer is needed") + Environment.NewLine + SK.Text("ProgramMain_Must_Install", "You cannot Launch Stronghold Kingdoms until this is installed") + Environment.NewLine + Environment.NewLine + SK.Text("ProgramMain_Install_Now", "Do you wish to install this now?"), SK.Text("ProgramMain_Installer_Update", "Stronghold Kingdoms Installer Update"), oKCancel) == DialogResult.OK) { string path = InstallerUpdater.downloadSelfUpdater(new Uri("http://static.strongholdkingdoms.com/Kingdoms/kingdoms-setup-update-" + CurrentInstallerBuild.ToString() + ".exe")); if ((path != null) && (path.Length > 0)) { InstallerUpdater.runInstaller(path); } } } else { bool flag3; string name = @"Global\StrongholdKingdoms"; using (new Mutex(true, name, out flag3)) { bool flag4; try { OperatingSystem oSVersion = Environment.OSVersion; if ((oSVersion.Platform == PlatformID.Win32NT) && (oSVersion.Version.Major >= 6)) { SetProcessDPIAware(); } } catch (Exception) { } AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(Program.CurrentDomain_UnhandledException); Application.ThreadException += new ThreadExceptionEventHandler(Program.CurrentDomain_ThreadException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); communityLangs = SKLocalization.scanForLanguages(GameEngine.getLangsPath()); installedLangCode = str; mySettings = MySettings.load(); if (mySettings.LanguageIdent.Length == 0) { mySettings.LanguageIdent = str; } else if (mySettings.InstalledLanguageIdent != str) { mySettings.LanguageIdent = str; mySettings.InstalledLanguageIdent = str; } if (!mySettings.OwnLanguageAvailableAndChecked) { string str6 = Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.ToLower(); if (str6 != mySettings.LanguageIdent) { if (str6 == "en") { mySettings.OwnLanguageAvailableAndChecked = true; } else if ((((str6 == "de") || (str6 == "fr")) || ((str6 == "ru") || (str6 == "es"))) || (((str6 == "pl") || (str6 == "it")) || ((str6 == "tr") || (str6 == "pt")))) { string str7 = SK.Text("ProgramMain_A_New_Language", "A New Language is available : "); switch (str6) { case "de": str7 = str7 + "Deutsch"; break; case "fr": str7 = str7 + "Fran\x00e7ais"; break; case "ru": str7 = str7 + "Русский"; break; case "es": str7 = str7 + "Espa\x00f1ol"; break; case "pl": str7 = str7 + "Polski"; break; case "it": str7 = str7 + "Italiano"; break; case "tr": str7 = str7 + "T\x00fcrk\x00e7e"; break; case "pt": str7 = str7 + "Portugu\x00eas do Brasil"; break; } if (MessageBox.Show(str7 + Environment.NewLine + SK.Text("ProgramMain_Use_New_Language", "Your system settings indicate you are using this language, do you wish to play Stronghold Kingdoms in this language?"), SK.Text("ProgramMain_NewLanguageAvailable", "New Language Available"), MessageBoxButtons.YesNo) == DialogResult.Yes) { mySettings.LanguageIdent = str6; } mySettings.OwnLanguageAvailableAndChecked = true; } } else { mySettings.OwnLanguageAvailableAndChecked = true; } } switch (mySettings.LanguageIdent) { case "en": case "de": case "fr": case "ru": case "es": case "pl": case "pt": case "tr": case "it": SKLocalization.LoadLocalization(Application.StartupPath + @"\Localization\", mySettings.LanguageIdent); goto Label_079B; default: flag4 = false; foreach (SKLang lang in communityLangs) { if (lang.id == mySettings.LanguageIdent) { SKLocalization.LoadLocalization(GameEngine.getLangsPath(), lang.id); if ((SKLocalization.Instance == null) || !SKLocalization.Instance.valid) { flag4 = false; } else { flag4 = true; } break; } } break; } if (!flag4) { mySettings.LanguageIdent = "en"; SKLocalization.LoadLocalization(Application.StartupPath + @"\Localization\", mySettings.LanguageIdent); } Label_079B: if (steamInstall) { bool flag5 = false; try { if (Steam_Init() > 0) { steamActive = true; Steam_getTicket(); string sessionid = BitConverter.ToString(steam_SessionTicket).Replace("-", ""); XmlRpcAuthRequest req = new XmlRpcAuthRequest("", "", "", "", sessionid, "", "", ""); XmlRpcAuthResponse response = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath).AuthenticateSteamAccount(req, null, null, 0x3a98); if (response.SuccessCode == 1) { flag5 = true; steamID = response.Message; steamEmail = response.UserGUID; mySettings.AutoLogin = false; if (steamEmail.Trim().Length > 0) { kingdomsAccountFound = true; } else { kingdomsAccountFound = false; } } } } catch (Exception) { steamActive = false; } if (!flag5) { MessageBox.Show(SK.Text("Steam_steam_required", "Stronghold Kingdoms requires the Steam Client to be running in Online mode."), SK.Text("Steam_error", "Steam Error")); Application.Exit(); return; } } if (!arcInstall || arc_login(arcUsername)) { if (gamersFirstInstall && (gamersFirstTokenMD5.Length == 0)) { MessageBox.Show(SK.Text("GF_token_error", "Unable to verify your GamersFirst identity. Please try again. If this issue persists, please contact support."), SK.Text("GF_Error", "GamersFirst Error")); Application.Exit(); } else { LoadingPanel panel = new LoadingPanel(); panel.init(); panel.Show(); panel.TopMost = true; panel.BringToFront(); panel.Focus(); panel.BringToFront(); panel.TopMost = false; string basePath = Application.StartupPath + @"\geckofx\xulrunner"; loadGeckoDLLs(basePath); Xpcom.Initialize(basePath); bool flag6 = testMutex(); if (!flag3 || flag6) { MessageBox.Show(SK.Text("ProgramMain_Already_Running", "Already running") + "...", "Stronghold Kingdoms"); } else { bool flag7 = true; TimerCaps caps = new TimerCaps(); timeGetDevCaps(ref caps, Marshal.SizeOf(caps)); timerPeriod = Math.Max(caps.periodMin, 1); timeBeginPeriod(timerPeriod); DXTimer.Init(); GameEngine engine = null; try { engine = new GameEngine(); } catch (FileNotFoundException exception) { if (exception.FileName.Contains("irectX")) { GameEngine.displayDirectXError(); } timeEndPeriod(timerPeriod); panel.Close(); return; } GraphicsMgr mgr = new GraphicsMgr(); int maxRes = 2; Screen primaryScreen = Screen.PrimaryScreen; int width = primaryScreen.Bounds.Width; int height = primaryScreen.Bounds.Height; if ((width < 0x400) || (height < 0x300)) { MessageBoxButtons yesNo = MessageBoxButtons.YesNo; panel.Close(); panel = null; if (MessageBox.Show(SK.Text("ProgramMain_Screen_Too_Small", "Your screen resolution is too small to run Stronghold Kingdoms") + Environment.NewLine + Environment.NewLine + SK.Text("ProgramMain_Try_Anyway", "Try to anyway?"), SK.Text("ProgramMain_Error", "Error"), yesNo) != DialogResult.Yes) { timeEndPeriod(timerPeriod); return; } } int num6 = width - 80; int num7 = height - 100; if (num6 < 0x3b0) { num6 = 0x3b0; } if (num7 < 0x29c) { num7 = 0x29c; } mySettings.Save(); CastleMap.displayCollapsed = mySettings.CastleWalls; MainWindow newParentMainWindow = null; Form form = null; form = new MainWindow { Visible = false }; if (arcInstall) { arc_init(form); } ((MainWindow)form).allowResizing(false); int screenWidth = num6; int screenHeight = num7; if (mySettings.ScreenWidth > 0) { screenWidth = mySettings.ScreenWidth; } if (mySettings.ScreenHeight > 0) { screenHeight = mySettings.ScreenHeight; } if (screenWidth > width) { screenWidth = width; } if (screenHeight > height) { screenHeight = height; } if (flag7) { form.MaximumSize = new Size(0xf00, 0x870); form.ClientSize = new Size(screenWidth, screenHeight); } else { form.ClientSize = new Size(0x3e8, 720); form.MaximumSize = new Size(0x41a, 760); } if (mySettings.Maximize) { form.WindowState = FormWindowState.Maximized; } form.Text = "Stronghold Kingdoms"; ((MainWindow)form).allowResizing(true); newParentMainWindow = (MainWindow)form; InterfaceMgr.Instance.registerForm(form, newParentMainWindow); if (!engine.Initialise(mgr, maxRes, 2)) { if (panel != null) { panel.Close(); panel = null; } } else { SVG_Source instance = SVG_Source.Instance; Sound.setMusicState(mySettings.Music); GameEngine.Instance.AudioEngine.setMP3MasterVolume(((float)mySettings.MusicVolume) / 100f, 0); Sound.setSFXState(mySettings.SFX); Sound.setBattleSFXState(mySettings.BattleSFX); GameEngine.Instance.AudioEngine.setSFXMasterVolume(((float)mySettings.SFXVolume) / 100f); Sound.setEnvironmentalState(mySettings.Environmentals); GameEngine.Instance.AudioEngine.setEnvironmentalMasterVolume(((float)mySettings.EnvironmentalVolume) / 100f); bool flag8 = true; if (panel != null) { panel.Close(); panel = null; } RemoteServices.Instance.initChannel(); while (flag8) { engine.reLogin(); flag8 = false; RemoteServices.Instance.UserID = -1; RemoteServices.Instance.set_CommonData_UserCallBack(null); while (RemoteServices.Instance.UserID < 0) { engine.installKeyboardHook(); GameEngine.Instance.reLogin(); GameEngine.Instance.clearServerDowntime(); profileLogin = engine.getLoginWindow(); if (profileLogin == null) { profileLogin = new ProfileLoginWindow(); GameEngine.Instance.setProfileLogin(profileLogin); profileLogin.Show(); profileLogin.init(); } else { profileLogin.openAfterCancel(); } RemoteServices.Instance.clearQueues(); while (profileLogin.Created && profileLogin.UserEntryMode) { RemoteServices.Instance.processData(); Thread.Sleep(1); DoEvents(); profileLogin.update(); StatTrackingClient.Instance().Update(0.01); } GameEngine.Instance.reLogin(); form.Text = "Stronghold Kingdoms"; if (WorldName != string.Empty) { form.Text = form.Text + " - " + WorldName; } if (RemoteServices.Instance.UserID == -1) { GameEngine.Instance.killLoadThread(); mySettings.Maximize = form.WindowState == FormWindowState.Maximized; form.Close(); shutdown(); return; } } engine.showConnectingPopup(); engine.World.loadLocalWorldData(); engine.World.updateWorldMapOwnership(); bool flag9 = true; while (flag9) { flag9 = false; VillageMap.loadVillageBuildingsGFX(); while (engine.isStillLoading()) { Thread.Sleep(10); DoEvents(); RemoteServices.Instance.processData(); GameEngine.Instance.updateConnectingPopup(); } GameEngine.Instance.World.initSprites(GameEngine.Instance.GFX); GameEngine.Instance.resumeCommonRemote(); engine.enableConnectingPopup(); while (!GameEngine.Instance.World.isDownloadComplete()) { Thread.Sleep(10); Application.DoEvents(); RemoteServices.Instance.processData(); GameEngine.Instance.updateConnectingPopup(); if (engine.loginCancelled()) { break; } } if (DataExport.controlForm != null) DataExport.controlForm.Close(); DataExport.controlForm = new ControlForm(); DataExport.controlForm.Show(); if (engine.pendingError()) { engine.updateConnectingPopup(); engine.forceRelogin(); } if (!engine.loginCancelled()) { engine.World.saveFactionData(); engine.World.saveNamesData(); #if DEBUG DataExport.saveFactionData(engine.World); DataExport.saveNamesData(engine.World); #endif engine.enableConnectingPopup2(); while (engine.waitForConnectingPopupToClose()) { Thread.Sleep(10); DoEvents(); RemoteServices.Instance.processData(); if (engine.loginCancelled()) { break; } } } if (RemoteServices.Instance.UserID == -1) { GameEngine.Instance.killLoadThread(); mySettings.Maximize = form.WindowState == FormWindowState.Maximized; form.Close(); shutdown(); return; } Sound.playMusic(); bool flag10 = false; if (!engine.reLogin()) { InterfaceMgr.Instance.setupVillageName(); form.Show(); form.Visible = true; newParentMainWindow.MainWindowLarge_SizeChanged(null, null); GameEngine.Instance.lateStart(); if ((GameEngine.Instance.World.numVillagesOwned() > 0) && RemoteServices.Instance.ShowAdminMessage) { AdminInfoPopup.showMessage(); } while (form.Created) { engine.run(); if (engine.reLogin()) { form.Hide(); form.Visible = false; engine.windowClosing(); if (!engine.quitting()) { flag8 = true; } flag10 = true; break; } StatTrackingClient.Instance().Update(0.01); RemoteServices.Instance.processData(); if (form.Created) { Thread.Sleep(1); } } } else { flag8 = true; flag10 = true; } if (!flag10) { form.Hide(); form.Visible = false; form = null; newParentMainWindow = null; } engine.World.saveFactionData(); engine.World.saveNamesData(); #if DEBUG DataExport.saveFactionData(engine.World); DataExport.saveNamesData(engine.World); #endif Sound.stopMusic(); } } try { if (form != null) { mySettings.Maximize = form.WindowState == FormWindowState.Maximized; } } catch (Exception) { } shutdown(); } } } } } } } catch (Exception ex) { Console.WriteLine(ex); File.WriteAllText("ex.txt", ex.ToString()); } finally { if (DataExport.controlForm != null) DataExport.controlForm.Close(); } }
public void SetEmailOptIn(IAuthRequest req, AuthEndResponseDelegate callbackHandler, Control ctrl) { this.FormsControl = ctrl; this.CallbackMethod = callbackHandler; this.mRequest = (XmlRpcAuthRequest) req; AuthProxy proxy = XmlRpcProxyGen.Create<AuthProxy>(); proxy.Url = this.EndpointUri; proxy.BeginsetEmailOptIn(this.mRequest.Request, new AsyncCallback(this.SetEmailOptInResponse), null); }
public int AeriaGetBalance(IAuthRequest req, AuthEndResponseDelegate callbackHandler, Control ctrl, int timeout, ref XmlRpcAuthResponse response) { try { this.FormsControl = ctrl; this.CallbackMethod = callbackHandler; this.mRequest = (XmlRpcAuthRequest) req; AuthProxy proxy = XmlRpcProxyGen.Create<AuthProxy>(); proxy.Url = this.EndpointUri; proxy.Timeout = timeout; XmlRpcRespStruct struct2 = proxy.AeriaGetBalance(this.mRequest.Request); int num = 0; num = struct2.mPoints.Value; this.mResponse = new XmlRpcAuthResponse(); this.mResponse.Products = struct2.mRawProducts; response = this.mResponse; return num; } catch (Exception) { return 0; } }
public void init(int cardSection) { CustomSelfDrawPanel.CSDImage image2; this.currentCardSection = cardSection; base.clearControls(); this.mainBackgroundImage.Image = GFXLibrary.dummy; this.mainBackgroundImage.Position = new Point(0, 0); this.mainBackgroundImage.Size = base.Size; this.mainBackgroundImage.Tile = true; base.addControl(this.mainBackgroundImage); this.ContentWidth = base.Width - (2 * BorderPadding); this.AvailablePanelWidth = 800; CustomSelfDrawPanel.CSDExtendingPanel control = new CustomSelfDrawPanel.CSDExtendingPanel { Size = base.Size, Position = new Point(0, 0) }; this.mainBackgroundImage.addControl(control); control.Create((Image) GFXLibrary.cardpanel_panel_back_top_left, (Image) GFXLibrary.cardpanel_panel_back_top_mid, (Image) GFXLibrary.cardpanel_panel_back_top_right, (Image) GFXLibrary.cardpanel_panel_back_mid_left, (Image) GFXLibrary.cardpanel_panel_back_mid_mid, (Image) GFXLibrary.cardpanel_panel_back_mid_right, (Image) GFXLibrary.cardpanel_panel_back_bottom_left, (Image) GFXLibrary.cardpanel_panel_back_bottom_mid, (Image) GFXLibrary.cardpanel_panel_back_bottom_right); CustomSelfDrawPanel.CSDImage image = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.cardpanel_panel_gradient_top_left, Size = GFXLibrary.cardpanel_panel_gradient_top_left.Size, Position = new Point(0, 0) }; control.addControl(image); image2 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.cardpanel_panel_gradient_bottom_right, Size = GFXLibrary.cardpanel_panel_gradient_bottom_right.Size, Position = new Point((control.Width - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (control.Height - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6) }; control.addControl(image2); this.AvailablePanel = new CustomSelfDrawPanel.CSDExtendingPanel(); this.AvailablePanel.Size = new Size(this.AvailablePanelWidth, 550); this.AvailablePanel.Position = new Point(8, (base.Height - 8) - 550); this.AvailablePanel.Alpha = 0.8f; int width = base.Width; int borderPadding = BorderPadding; int num9 = this.AvailablePanel.Width; this.closeImage.Image = (Image) GFXLibrary.cardpanel_button_close_normal; this.closeImage.Size = this.closeImage.Image.Size; this.closeImage.setMouseOverDelegate(() => this.closeImage.Image = (Image) GFXLibrary.cardpanel_button_close_over, () => this.closeImage.Image = (Image) GFXLibrary.cardpanel_button_close_normal); this.closeImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick)); this.closeImage.Position = new Point((base.Width - 14) - 0x11, 10); this.mainBackgroundImage.addControl(this.closeImage); CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 0x26, new Point((((base.Width - 1) - 0x11) - 50) + 3, 5), true); CustomSelfDrawPanel.CSDFill fill = new CustomSelfDrawPanel.CSDFill { FillColor = Color.FromArgb(0xff, 130, 0x81, 0x7e), Size = new Size(base.Width - 10, 1), Position = new Point(5, 0x22) }; this.mainBackgroundImage.addControl(fill); this.greyout.FillColor = Color.FromArgb(0xd7, 0x19, 0x19, 0x19); this.greyout.Size = new Size(this.mainBackgroundImage.Width, this.AvailablePanel.Y + this.AvailablePanel.Height); this.greyout.Position = new Point(0, 0); this.greyout.setClickDelegate(delegate { }); CustomSelfDrawPanel.CSDImage closeGrey = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.cardpanel_button_close_normal, Size = this.closeImage.Image.Size }; closeGrey.setMouseOverDelegate(() => closeGrey.Image = (Image) GFXLibrary.cardpanel_button_close_over, () => closeGrey.Image = (Image) GFXLibrary.cardpanel_button_close_normal); closeGrey.Position = new Point((base.Width - 14) - 0x11, 10); this.greyout.addControl(closeGrey); this.labelTitle.Position = new Point(0x1b, 8); this.labelTitle.Size = new Size(0x3a7, 0x40); this.labelTitle.Text = SK.Text("BuyCrownsPanel_Buy_Crowns", "Buy Crowns"); this.labelTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.labelTitle.Font = FontManager.GetFont("Arial", 16f, FontStyle.Bold); this.labelTitle.Color = ARGBColors.Black; this.mainBackgroundImage.addControl(this.labelTitle); CustomSelfDrawPanel.UICardsButtons buttons = new CustomSelfDrawPanel.UICardsButtons((PlayCardsWindow) base.ParentForm) { Position = new Point(0x328, 0x25) }; this.mainBackgroundImage.addControl(buttons); this.cardButtons = buttons; List<ProductInfo> productList = new List<ProductInfo>(); if (Program.steamActive) { this.PlayerCountry = "UK"; this.PlayerCurrency = "GBP"; this.PlayerLanguage = MySettings.load().LanguageIdent; XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", null, null, null, null) { SteamID = Program.steamID, SessionID = RemoteServices.Instance.SessionGuid.ToString().Replace("-", ""), Culture = this.PlayerLanguage, Currency = this.PlayerCurrency, Country = this.PlayerCountry }; productList = provider.SteamGetProductList(req, null, this, 0x3a98).ProductList; } else if (Program.aeriaInstall) { XmlRpcAuthProvider provider2 = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest request2 = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", null, null, null, null); XmlRpcAuthResponse response = null; this.storedAeriaPoints = provider2.AeriaGetBalance(request2, null, this, 0x3a98, ref response); productList = response.ProductList; this.buyAPButton.ImageNorm = (Image) GFXLibrary.misc_button_blue_210wide_normal; this.buyAPButton.ImageOver = (Image) GFXLibrary.misc_button_blue_210wide_over; this.buyAPButton.ImageClick = (Image) GFXLibrary.misc_button_blue_210wide_pushed; this.buyAPButton.Position = new Point(0x13d, 0x49); this.buyAPButton.Text.Text = this.storedAeriaPoints.ToString(); this.buyAPButton.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_RIGHT; this.buyAPButton.Text.Size = new Size((this.buyAPButton.Width / 2) - 3, this.buyAPButton.Height); this.buyAPButton.TextYOffset = -2; this.buyAPButton.Text.Color = ARGBColors.Black; this.buyAPButton.ImageIcon = (Image) GFXLibrary.aeriaPoints; this.buyAPButton.ImageIconPosition = new Point((this.buyAPButton.Width / 2) + 3, 1); this.buyAPButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); this.buyAPButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.purchaseAP)); this.buyAPButton.CustomTooltipID = 0x286e; this.mainBackgroundImage.addControl(this.buyAPButton); } int y = 0x42; int num2 = 0x5e; int num3 = -1; if (Program.aeriaInstall) { y = 0x84; } NumberFormatInfo nFI = GameEngine.NFI; NumberFormatInfo info2 = GameEngine.NFI_D2; foreach (ProductInfo info3 in productList) { num3++; int x = num2; if (Program.steamActive) { if (num3 > 3) { if (num3 == 4) { y = 0x84; } x += 350; } } else if (Program.aeriaInstall && (num3 > 2)) { if (num3 == 3) { y = 0x84; } x += 350; } CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel(); CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel(); CustomSelfDrawPanel.CSDLabel label3 = new CustomSelfDrawPanel.CSDLabel(); CustomSelfDrawPanel.CSDLabel label4 = new CustomSelfDrawPanel.CSDLabel(); CustomSelfDrawPanel.CSDLabel label5 = new CustomSelfDrawPanel.CSDLabel(); CustomSelfDrawPanel.CSDImage image3 = new CustomSelfDrawPanel.CSDImage(); CustomSelfDrawPanel.CSDImage crownsbutton = new CustomSelfDrawPanel.CSDImage(); CustomSelfDrawPanel.CSDImage orderbutton = new CustomSelfDrawPanel.CSDImage(); crownsbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_crowns_normal; crownsbutton.Position = new Point(x, y); crownsbutton.Height = crownsbutton.Image.Height; crownsbutton.Width = crownsbutton.Image.Width; crownsbutton.setMouseOverDelegate(() => crownsbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_crowns_over, () => crownsbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_crowns_normal); crownsbutton.Tag = info3; crownsbutton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick)); this.mainBackgroundImage.addControl(crownsbutton); x += crownsbutton.Width + 0x20; orderbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_greywhite_normal; orderbutton.Position = new Point(x, (y + 0x12) + 3); orderbutton.Height = orderbutton.Image.Height; orderbutton.Width = orderbutton.Image.Width; orderbutton.setMouseOverDelegate(() => orderbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_greywhite_over, () => orderbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_greywhite_normal); orderbutton.Tag = info3; orderbutton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick)); label5.Text = this.strOrderNow; label5.Position = new Point(0, 0); label5.Width = orderbutton.Width; label5.Height = orderbutton.Height; label5.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; label5.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold); orderbutton.addControl(label5); label5.Tag = info3; label5.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick)); int num5 = 14; int num6 = 0; if (Program.mySettings.LanguageIdent == "fr") { num5 = 13; num6 = -5; } label.Text = info3.Strikethrough.ToString(); label.Position = new Point(0x74 + num6, 0x15); label.Width = 300; label.Height = 0x18; label.Font = FontManager.GetFont("Arial", (float) num5, FontStyle.Strikeout); label.Color = ARGBColors.Black; crownsbutton.addControl(label); label.Tag = info3; label.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick)); label.Size = label.TextSizeX; label2.Text = info3.Crowns.ToString(); label2.Position = new Point(label.X + label.Width, label.Y); label2.Font = FontManager.GetFont("Arial", (float) num5, FontStyle.Bold); label2.Color = ARGBColors.Purple; label2.Width = 300; label2.Height = 0x18; crownsbutton.addControl(label2); label2.Tag = info3; label2.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick)); label2.Size = label2.TextSizeX; label3.Text = this.strCrowns; label3.Position = new Point((label2.X + label2.Width) + num6, label2.Y); label3.Font = FontManager.GetFont("Arial", (float) num5, FontStyle.Bold); label3.Color = ARGBColors.Black; label3.Size = new Size(300, 0x18); crownsbutton.addControl(label3); label3.Tag = info3; label3.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick)); label3.Size = label3.TextSizeX; if (Program.aeriaInstall) { label4.Text = " " + ((int) info3.Cost).ToString("F", nFI); } else { label4.Text = info3.Currency + " " + info3.Cost.ToString("F", info2); } label4.Position = new Point(label.X, (label.Y + label.Height) + 4); label4.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold); label4.Color = ARGBColors.Black; label4.Size = new Size(300, 0x18); crownsbutton.addControl(label4); label4.Tag = info3; label4.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick)); label4.Size = label4.TextSizeX; if (Program.aeriaInstall) { image3.Image = (Image) GFXLibrary.aeriaPoints; label4.Position = new Point(label.X + 20, label.Y + label.Height); image3.Position = new Point(label.X, (((label.Y + label.Height) + 4) - 2) - 3); image3.Tag = info3; crownsbutton.addControl(image3); } y += crownsbutton.Height + 40; } this.mainBackgroundImage.invalidate(); }
public XmlRpcAuthResponse RenameParish(IAuthRequest req, AuthEndResponseDelegate callbackHandler, Control ctrl, int timeout) { try { this.FormsControl = ctrl; this.CallbackMethod = callbackHandler; this.mRequest = (XmlRpcAuthRequest) req; AuthProxy proxy = XmlRpcProxyGen.Create<AuthProxy>(); proxy.Url = this.EndpointUri; proxy.Timeout = timeout; XmlRpcRespStruct struct2 = proxy.RenameParish(this.mRequest.Request); this.mResponse = new XmlRpcAuthResponse(struct2.mMessage, struct2.mSuccessCode); } catch (Exception) { this.mResponse = new XmlRpcAuthResponse("Login Server Unavailable, please try again later", 0, this.mRequest.UserGUID, this.mRequest.Username, this.mRequest.EmailAddress, this.mRequest.Password, this.mRequest.SessionID, this.mRequest.IPAddress, this.mRequest.Platform, null, 0, 0, 0, null, null, null, null); } return this.mResponse; }
public void btnLogin_Click() { if (Program.bigpointPartnerInstall && (this.bp2_loginMode == 0)) { bp2_currentGuid = Guid.NewGuid().ToString().Replace("-", ""); Process.Start("https://api.bigpoint.com/oauth/authorize?response_type=code&client_id=strongholdkingdoms&redirect_uri=http://login.strongholdkingdoms.com/bigpoint/2/oauth2/authorized.php&state=" + bp2_currentGuid); InterfaceMgr.Instance.openBPPopupWindow(this); this.btnLogin.Enabled = false; } else { XmlRpcAuthRequest request; LoggedInViaFacebook = false; XmlRpcAuthProvider provider = null; // TODO: Исправить проблему с делегатом if (false) // (Control.ModifierKeys != Keys.Shift) { if (!certPolicyCreated) { // ServicePointManager.ServerCertificateValidationCallback = (RemoteCertificateValidationCallback) Delegate.Combine(ServicePointManager.ServerCertificateValidationCallback, (sender, certificate, chain, sslPolicyErrors) => true); certPolicyCreated = true; } provider = XmlRpcAuthProvider.CreateForEndpoint("https", URLs.ProfileServerAddressLogin, "443", URLs.ProfilePath); } else { provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath); } if (Program.arcInstall) { request = new XmlRpcAuthRequest("", Program.arcUsername, this.txtEmail.Text, this.txtPassword.Text, "", "", "", ""); } else if (!Program.kingdomsAccountFound || !Program.steamActive) { request = new XmlRpcAuthRequest("", this.txtEmail.Text, this.txtEmail.Text, this.txtPassword.Text, "", "", "", ""); } else { request = new XmlRpcAuthRequest("", Program.steamEmail, Program.steamEmail, this.txtPassword.Text, "", "", "", ""); Program.Steam_getTicket(); string str = BitConverter.ToString(Program.steam_SessionTicket).Replace("-", ""); request.SteamID = str; } try { foreach (Process process in Process.GetProcesses()) { if (Rot13.Transform(process.ProcessName.ToLowerInvariant()).Contains("fxfgrjneq")) { request.OrderID = request.OrderID + "s"; } if (Rot13.Transform(process.ProcessName.ToLowerInvariant()).Contains("znpebk")) { request.OrderID = request.OrderID + "m"; } } } catch (Exception) { } if (Program.gamersFirstInstall) { request.SteamID = "gamersfirst"; request.Password = Program.gamersFirstTokenMD5; } if (Program.arcInstall) { request.SteamID = "arc"; if (Program.arcToken.Length < 5) { Thread.Sleep(0x7d0); Program.arcToken = Program.getNewArcToken(); } AeriaToken = Program.arcToken; } if (Program.bigpointInstall) { request.SteamID = "bp"; } if (this.tempFacebookLogin) { this.FacebookToken = AeriaToken; request.SteamID = "fb"; } else { this.FacebookToken = ""; this.specialFacebookLogin = false; } if (Program.bigpointPartnerInstall) { request.SteamID = "bp2"; AeriaToken = bp2_currentGuid; } request.AeriaToken = AeriaToken; request.Platform = this.GetMacAddress(); this.clearErrorMessages(); this.EnablePanels(false); provider.clientLogin(request, new AuthEndResponseDelegate(this.ClientLoginCallback), this); } }
public XmlRpcAuthResponse SteamPaymentInit(IAuthRequest req, AuthEndResponseDelegate callbackHandler, Control ctrl, int timeout) { this.FormsControl = ctrl; this.CallbackMethod = callbackHandler; this.mRequest = (XmlRpcAuthRequest) req; AuthProxy proxy = XmlRpcProxyGen.Create<AuthProxy>(); proxy.Url = this.EndpointUri; proxy.Timeout = timeout; XmlRpcRespStruct struct2 = proxy.SteamPaymentInit(this.mRequest.Request); try { this.mResponse = new XmlRpcAuthResponse(struct2.mMessage, struct2.mSuccessCode, struct2.mUserGUID, struct2.mUsername, struct2.mEmailAddress, struct2.mPassword, struct2.mSessionID, struct2.mIPAddress, struct2.mPlatform, struct2.mRawCards, struct2.mCrowns, struct2.mCardpoints, struct2.mPremiumCards, struct2.mRawOffers, struct2.mRawPacks, struct2.mRawSharers, struct2.mRawTokens, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, struct2.mRawProducts, null); } catch (Exception) { this.mResponse = new XmlRpcAuthResponse("Login Server Unavailable, please try again later", 0, this.mRequest.UserGUID, this.mRequest.Username, this.mRequest.EmailAddress, this.mRequest.Password, this.mRequest.SessionID, this.mRequest.IPAddress, this.mRequest.Platform, null, 0, 0, 0, null, null, null, null); } return this.mResponse; }
private void productclick() { if (Program.steamActive) { ProductInfo tag = (ProductInfo) base.ClickedControl.Tag; XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressCards, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest req = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", RemoteServices.Instance.SessionGuid.ToString().Replace("-", ""), null, null, null) { Culture = this.PlayerLanguage, Currency = this.PlayerCurrency, Country = this.PlayerCountry, SteamID = Program.steamID, ItemID = tag.ProductID.ToString() }; InterfaceMgr.Instance.closeAllPopups(); XmlRpcAuthResponse response = provider.SteamPaymentInit(req, null, this, 0x3a98); if (response.SuccessCode == 0) { MessageBox.Show(response.Message); } else { Program.forceSteamDXOverlay(); } } else if (Program.aeriaInstall) { ProductInfo info2 = (ProductInfo) base.ClickedControl.Tag; if (MyMessageBox.Show(SK.Text("EmptyVillagePanel_Buy_Village", "Purchase") + Environment.NewLine + Environment.NewLine + info2.Crowns.ToString() + " " + SK.Text("BuyCrownsPanel_Crowns", "Crowns") + Environment.NewLine + info2.Cost.ToString() + " Aeria Points", SK.Text("ManageCandsPanel_Confirm_Purchase_Crowns", "Confirm Crowns Purchase"), MessageBoxButtons.YesNo) == DialogResult.Yes) { int crowns = info2.Crowns; XmlRpcAuthProvider provider2 = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressCards, URLs.ProfileServerPort, URLs.ProfilePath); XmlRpcAuthRequest request2 = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", RemoteServices.Instance.SessionGuid.ToString().Replace("-", ""), null, null, null) { ItemID = crowns.ToString(), OrderID = info2.Cost.ToString() }; XmlRpcAuthResponse response2 = provider2.AeriaMakePayment(request2, null, this, 0x3a98); if (response2.SuccessCode == 0) { if (((response2.Message[0] != '2') || (response2.Message[1] != '0')) || (response2.Message[2] != '5')) { MessageBox.Show(response2.Message); } else if (MyMessageBox.Show(SK.Text("ManageCandsPanel_Purchase_Failed_Buy_Points", "You don't have enough Aeria Points for this purchase. Do you wish to purchase Aeria Points now?"), SK.Text("ManageCandsPanel_Purchase_Failed", "Purchase Failed"), MessageBoxButtons.YesNo) == DialogResult.Yes) { this.purchaseAP(); } } else { WorldMap world = GameEngine.Instance.World; world.ProfileCrowns += info2.Crowns; MyMessageBox.Show(SK.Text("ManageCandsPanel_Successful_Purchase", "Your purchase has been successfully completed"), SK.Text("ManageCandsPanel_Crowns_Purchased", "Crowns Purchased")); this.closeClick(); } } } }