public DlgYesNoLater(FrmMain mainForm, string caption, string msg, bool expires) : base(mainForm)
 {
     this.components = null;
     this.CloseTimer = null;
     this.InitializeComponent();
     this.Text = Loc.Get(caption);
     this.gpgLabelQuestion.Text = Loc.Get(msg);
     if (expires)
     {
         this.CloseTimer = new StateTimer((double) (Program.Settings.Chat.PopupTimeout * 0x3e8));
     }
 }
Exemple #2
0
 public DlgBase()
 {
     this.components = null;
     this.mTestLog = false;
     this.mChangingWindowState = false;
     this.mLastChange = DateTime.Now;
     this.mMinimumSize = new Size();
     this.mRestoreWindowMode = false;
     this.mLayoutData = null;
     this.mErrors = new ErrorProvider();
     this.StatusTimer = null;
     this.mTileEffect = true;
     this.mStartCenterScreen = false;
     this.HasShown = false;
     this.dirname = "";
     this.mIsMaximized = false;
     this.mRestore = new Rectangle(0, 0, 100, 100);
     this.mHeightDiff = 0;
     this.mWidthDiff = 0;
     this.mLastX = 0;
     this.mLastY = 0;
     this.mLastMouseX = 0;
     this.mLastMouseY = 0;
     this.mLastWidth = 0;
     this.mLastHeight = 0;
     this.mIsMoving = false;
     this.mIsResizing = false;
     this.mStartResizing = false;
     this.RESIZE_RECT = 40;
     this.mResizeRect = new Rectangle();
     this.mCaptionFont = new Font("Arial", 10f, FontStyle.Bold);
     this.mMainForm = null;
     this.InitializeComponent();
     this.MainForm = Program.MainForm;
     this.SetRegion();
     this.Construct();
     base.Opacity = 1.0;
 }
Exemple #3
0
 private void InitializeComponent()
 {
     this.components = new Container();
     this.earthMap1 = new EarthMap();
     this.cmEarthMap = new ContextMenuStrip(this.components);
     this.miRefreshGamesList = new ToolStripMenuItem();
     this.miHideLocation = new ToolStripMenuItem();
     this.miToggleBoundaries = new ToolStripMenuItem();
     this.refreshTimer = new StateTimer();
     this.cbRegistrations = new GPGCheckBox();
     this.btnRefreshGames = new SkinButton();
     this.btnOptOut = new SkinButton();
     this.pBottomBG = new GPGPanel();
     this.lpChecks = new FlowLayoutPanel();
     this.cbReports = new GPGCheckBox();
     this.cbGames = new GPGCheckBox();
     this.cbFriends = new GPGCheckBox();
     this.cbClanmates = new GPGCheckBox();
     this.cbTop10 = new GPGCheckBox();
     this.cbOnline = new GPGCheckBox();
     this.cbAllPlayers = new GPGCheckBox();
     this.pbTicker = new GPGPictureBox();
     this.cmEarthMap.SuspendLayout();
     this.refreshTimer.BeginInit();
     this.pBottomBG.SuspendLayout();
     this.lpChecks.SuspendLayout();
     ((ISupportInitialize) this.pbTicker).BeginInit();
     base.SuspendLayout();
     base.ttDefault.DefaultController.AutoPopDelay = 0x3e8;
     base.ttDefault.DefaultController.ToolTipLocation = ToolTipLocation.RightTop;
     this.earthMap1.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
     this.earthMap1.BackColor = Color.Silver;
     this.earthMap1.ContextMenuStrip = this.cmEarthMap;
     this.earthMap1.Location = new Point(7, 0x3b);
     this.earthMap1.MapScale = 0.07f;
     this.earthMap1.MapX = 0f;
     this.earthMap1.MapY = 0f;
     this.earthMap1.Name = "earthMap1";
     this.earthMap1.ShowBorders = false;
     this.earthMap1.Size = new Size(0x377, 0x1a6);
     base.ttDefault.SetSuperTip(this.earthMap1, null);
     this.earthMap1.TabIndex = 7;
     this.earthMap1.Text = "earthMap1";
     this.earthMap1.WatermarkLeft = null;
     this.earthMap1.WatermarkRight = null;
     this.earthMap1.MouseClick += new MouseEventHandler(this.earthMap1_MouseClick);
     this.cmEarthMap.Items.AddRange(new ToolStripItem[] { this.miRefreshGamesList, this.miHideLocation, this.miToggleBoundaries });
     this.cmEarthMap.Name = "cmEarthMap";
     this.cmEarthMap.Size = new Size(0xef, 70);
     base.ttDefault.SetSuperTip(this.cmEarthMap, null);
     this.miRefreshGamesList.Name = "miRefreshGamesList";
     this.miRefreshGamesList.Size = new Size(0xee, 0x16);
     this.miRefreshGamesList.Text = "<LOC>Refresh Games List";
     this.miRefreshGamesList.Click += new EventHandler(this.miRefreshGamesList_Click);
     this.miHideLocation.Name = "miHideLocation";
     this.miHideLocation.Size = new Size(0xee, 0x16);
     this.miHideLocation.Text = "<LOC>Hide my location";
     this.miHideLocation.Click += new EventHandler(this.miHideLocation_Click);
     this.miToggleBoundaries.Name = "miToggleBoundaries";
     this.miToggleBoundaries.Size = new Size(0xee, 0x16);
     this.miToggleBoundaries.Text = "<LOC>Toggle country boundaries";
     this.miToggleBoundaries.Click += new EventHandler(this.miToggleBoundaries_Click);
     this.refreshTimer.Enabled = true;
     this.refreshTimer.ParentForm = null;
     this.refreshTimer.State = null;
     this.refreshTimer.SynchronizingObject = this;
     this.refreshTimer.Elapsed += new ElapsedEventHandler(this.refreshTimer_Elapsed);
     this.cbRegistrations.Anchor = AnchorStyles.Bottom;
     this.cbRegistrations.AutoSize = true;
     this.cbRegistrations.Checked = true;
     this.cbRegistrations.CheckState = CheckState.Checked;
     this.cbRegistrations.ForeColor = Color.Red;
     this.cbRegistrations.Location = new Point(15, 0x1a6);
     this.cbRegistrations.Name = "cbRegistrations";
     this.cbRegistrations.Size = new Size(0x8e, 0x11);
     base.ttDefault.SetSuperTip(this.cbRegistrations, null);
     this.cbRegistrations.TabIndex = 0x11;
     this.cbRegistrations.Text = "<LOC>Registrations";
     this.cbRegistrations.UsesBG = true;
     this.cbRegistrations.UseVisualStyleBackColor = true;
     this.cbRegistrations.Visible = false;
     this.cbRegistrations.Click += new EventHandler(this.cbOnline_Click);
     this.cbRegistrations.CheckedChanged += new EventHandler(this.cbOnline_CheckedChanged);
     this.btnRefreshGames.Anchor = AnchorStyles.Bottom;
     this.btnRefreshGames.AutoStyle = true;
     this.btnRefreshGames.BackColor = Color.Black;
     this.btnRefreshGames.DialogResult = DialogResult.OK;
     this.btnRefreshGames.DisabledForecolor = Color.Gray;
     this.btnRefreshGames.DrawEdges = true;
     this.btnRefreshGames.FocusColor = Color.Yellow;
     this.btnRefreshGames.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.btnRefreshGames.ForeColor = Color.White;
     this.btnRefreshGames.HorizontalScalingMode = ScalingModes.Tile;
     this.btnRefreshGames.IsStyled = true;
     this.btnRefreshGames.Location = new Point(0x3b, 0x14d);
     this.btnRefreshGames.Name = "btnRefreshGames";
     this.btnRefreshGames.Size = new Size(0xb6, 0x1c);
     this.btnRefreshGames.SkinBasePath = @"Controls\Button\Round Edge";
     base.ttDefault.SetSuperTip(this.btnRefreshGames, null);
     this.btnRefreshGames.TabIndex = 0x17;
     this.btnRefreshGames.Text = "<LOC>Refresh Games List";
     this.btnRefreshGames.TextAlign = ContentAlignment.MiddleCenter;
     this.btnRefreshGames.TextPadding = new Padding(0);
     this.btnRefreshGames.Visible = false;
     this.btnRefreshGames.Click += new EventHandler(this.btnRefreshGames_Click);
     this.btnOptOut.Anchor = AnchorStyles.Bottom;
     this.btnOptOut.AutoStyle = true;
     this.btnOptOut.BackColor = Color.Black;
     this.btnOptOut.DialogResult = DialogResult.OK;
     this.btnOptOut.DisabledForecolor = Color.Gray;
     this.btnOptOut.DrawEdges = true;
     this.btnOptOut.FocusColor = Color.Yellow;
     this.btnOptOut.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.btnOptOut.ForeColor = Color.White;
     this.btnOptOut.HorizontalScalingMode = ScalingModes.Tile;
     this.btnOptOut.IsStyled = true;
     this.btnOptOut.Location = new Point(0x3b, 0x16f);
     this.btnOptOut.Name = "btnOptOut";
     this.btnOptOut.Size = new Size(0xb6, 0x1c);
     this.btnOptOut.SkinBasePath = @"Controls\Button\Round Edge";
     base.ttDefault.SetSuperTip(this.btnOptOut, null);
     this.btnOptOut.TabIndex = 0x18;
     this.btnOptOut.Text = "<LOC>Hide my location";
     this.btnOptOut.TextAlign = ContentAlignment.MiddleCenter;
     this.btnOptOut.TextPadding = new Padding(0);
     this.btnOptOut.Visible = false;
     this.btnOptOut.Click += new EventHandler(this.btnOptOut_Click);
     this.pBottomBG.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
     this.pBottomBG.Controls.Add(this.lpChecks);
     this.pBottomBG.Controls.Add(this.pbTicker);
     this.pBottomBG.Location = new Point(5, 0x1e1);
     this.pBottomBG.Name = "pBottomBG";
     this.pBottomBG.Size = new Size(890, 0x63);
     base.ttDefault.SetSuperTip(this.pBottomBG, null);
     this.pBottomBG.TabIndex = 0x19;
     this.pBottomBG.Paint += new PaintEventHandler(this.pBottomBG_Paint);
     this.lpChecks.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this.lpChecks.BackColor = Color.Transparent;
     this.lpChecks.Controls.Add(this.cbReports);
     this.lpChecks.Controls.Add(this.cbGames);
     this.lpChecks.Controls.Add(this.cbFriends);
     this.lpChecks.Controls.Add(this.cbClanmates);
     this.lpChecks.Controls.Add(this.cbTop10);
     this.lpChecks.Controls.Add(this.cbOnline);
     this.lpChecks.Controls.Add(this.cbAllPlayers);
     this.lpChecks.Location = new Point(8, 0x2f);
     this.lpChecks.Name = "lpChecks";
     this.lpChecks.Size = new Size(0x36d, 0x45);
     base.ttDefault.SetSuperTip(this.lpChecks, null);
     this.lpChecks.TabIndex = 0x1c;
     this.cbReports.Checked = true;
     this.cbReports.CheckState = CheckState.Checked;
     this.cbReports.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.cbReports.Location = new Point(2, 2);
     this.cbReports.Margin = new Padding(2);
     this.cbReports.Name = "cbReports";
     this.cbReports.Padding = new Padding(2);
     this.cbReports.Size = new Size(0xaf, 0x17);
     base.ttDefault.SetSuperTip(this.cbReports, null);
     this.cbReports.TabIndex = 0x1f;
     this.cbReports.Text = "<LOC> Game Reports";
     this.cbReports.UsesBG = true;
     this.cbReports.UseVisualStyleBackColor = true;
     this.cbReports.Click += new EventHandler(this.cbOnline_Click);
     this.cbReports.Paint += new PaintEventHandler(this.cbFriends_Paint);
     this.cbReports.CheckedChanged += new EventHandler(this.cbOnline_CheckedChanged);
     this.cbGames.Checked = true;
     this.cbGames.CheckState = CheckState.Checked;
     this.cbGames.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.cbGames.ForeColor = Color.FromArgb(0xcc, 0xcc, 0x98);
     this.cbGames.Location = new Point(0xb5, 2);
     this.cbGames.Margin = new Padding(2);
     this.cbGames.Name = "cbGames";
     this.cbGames.Padding = new Padding(2);
     this.cbGames.Size = new Size(0xaf, 0x17);
     base.ttDefault.SetSuperTip(this.cbGames, null);
     this.cbGames.TabIndex = 0x22;
     this.cbGames.Text = "<LOC>Custom Games";
     this.cbGames.UsesBG = true;
     this.cbGames.UseVisualStyleBackColor = true;
     this.cbGames.Click += new EventHandler(this.cbOnline_Click);
     this.cbGames.Paint += new PaintEventHandler(this.cbFriends_Paint);
     this.cbGames.CheckedChanged += new EventHandler(this.cbOnline_CheckedChanged);
     this.cbFriends.Checked = true;
     this.cbFriends.CheckState = CheckState.Checked;
     this.cbFriends.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.cbFriends.ForeColor = Color.FromArgb(0xff, 0x9a, 0x66);
     this.cbFriends.Location = new Point(360, 2);
     this.cbFriends.Margin = new Padding(2);
     this.cbFriends.Name = "cbFriends";
     this.cbFriends.Padding = new Padding(2);
     this.cbFriends.Size = new Size(0xaf, 0x17);
     base.ttDefault.SetSuperTip(this.cbFriends, null);
     this.cbFriends.TabIndex = 0x1c;
     this.cbFriends.Text = "<LOC>Friends";
     this.cbFriends.UsesBG = true;
     this.cbFriends.UseVisualStyleBackColor = true;
     this.cbFriends.Click += new EventHandler(this.cbOnline_Click);
     this.cbFriends.Paint += new PaintEventHandler(this.cbFriends_Paint);
     this.cbFriends.CheckedChanged += new EventHandler(this.cbOnline_CheckedChanged);
     this.cbClanmates.Checked = true;
     this.cbClanmates.CheckState = CheckState.Checked;
     this.cbClanmates.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.cbClanmates.ForeColor = Color.FromArgb(0xcc, 0x33, 0x35);
     this.cbClanmates.Location = new Point(0x21b, 2);
     this.cbClanmates.Margin = new Padding(2);
     this.cbClanmates.Name = "cbClanmates";
     this.cbClanmates.Padding = new Padding(2);
     this.cbClanmates.Size = new Size(0xaf, 0x17);
     base.ttDefault.SetSuperTip(this.cbClanmates, null);
     this.cbClanmates.TabIndex = 0x1d;
     this.cbClanmates.Text = "<LOC>Clanmates";
     this.cbClanmates.UsesBG = true;
     this.cbClanmates.UseVisualStyleBackColor = true;
     this.cbClanmates.Click += new EventHandler(this.cbOnline_Click);
     this.cbClanmates.Paint += new PaintEventHandler(this.cbFriends_Paint);
     this.cbClanmates.CheckedChanged += new EventHandler(this.cbOnline_CheckedChanged);
     this.cbTop10.Checked = true;
     this.cbTop10.CheckState = CheckState.Checked;
     this.cbTop10.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.cbTop10.ForeColor = Color.FromArgb(0x98, 0xcc, 0xfc);
     this.cbTop10.Location = new Point(2, 0x1d);
     this.cbTop10.Margin = new Padding(2);
     this.cbTop10.Name = "cbTop10";
     this.cbTop10.Padding = new Padding(2);
     this.cbTop10.Size = new Size(0xaf, 0x17);
     base.ttDefault.SetSuperTip(this.cbTop10, null);
     this.cbTop10.TabIndex = 30;
     this.cbTop10.Text = "<LOC>Top 10";
     this.cbTop10.UsesBG = true;
     this.cbTop10.UseVisualStyleBackColor = true;
     this.cbTop10.Click += new EventHandler(this.cbOnline_Click);
     this.cbTop10.Paint += new PaintEventHandler(this.cbFriends_Paint);
     this.cbTop10.CheckedChanged += new EventHandler(this.cbOnline_CheckedChanged);
     this.cbOnline.Checked = true;
     this.cbOnline.CheckState = CheckState.Checked;
     this.cbOnline.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.cbOnline.ForeColor = Color.FromArgb(3, 0xfe, 0);
     this.cbOnline.Location = new Point(0xb5, 0x1d);
     this.cbOnline.Margin = new Padding(2);
     this.cbOnline.Name = "cbOnline";
     this.cbOnline.Padding = new Padding(2);
     this.cbOnline.Size = new Size(0xaf, 0x17);
     base.ttDefault.SetSuperTip(this.cbOnline, null);
     this.cbOnline.TabIndex = 0x20;
     this.cbOnline.Text = "<LOC>Online";
     this.cbOnline.UsesBG = true;
     this.cbOnline.UseVisualStyleBackColor = true;
     this.cbOnline.Click += new EventHandler(this.cbOnline_Click);
     this.cbOnline.Paint += new PaintEventHandler(this.cbFriends_Paint);
     this.cbOnline.CheckedChanged += new EventHandler(this.cbOnline_CheckedChanged);
     this.cbAllPlayers.Checked = true;
     this.cbAllPlayers.CheckState = CheckState.Checked;
     this.cbAllPlayers.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.cbAllPlayers.ForeColor = Color.FromArgb(0xff, 0xff, 0x35);
     this.cbAllPlayers.Location = new Point(360, 0x1d);
     this.cbAllPlayers.Margin = new Padding(2);
     this.cbAllPlayers.Name = "cbAllPlayers";
     this.cbAllPlayers.Padding = new Padding(2);
     this.cbAllPlayers.Size = new Size(0xaf, 0x17);
     base.ttDefault.SetSuperTip(this.cbAllPlayers, null);
     this.cbAllPlayers.TabIndex = 0x21;
     this.cbAllPlayers.Text = "<LOC>All Players";
     this.cbAllPlayers.UsesBG = true;
     this.cbAllPlayers.UseVisualStyleBackColor = true;
     this.cbAllPlayers.Click += new EventHandler(this.cbOnline_Click);
     this.cbAllPlayers.Paint += new PaintEventHandler(this.cbFriends_Paint);
     this.cbAllPlayers.CheckedChanged += new EventHandler(this.cbOnline_CheckedChanged);
     this.pbTicker.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this.pbTicker.Location = new Point(1, 9);
     this.pbTicker.Name = "pbTicker";
     this.pbTicker.Size = new Size(0x378, 0x23);
     base.ttDefault.SetSuperTip(this.pbTicker, null);
     this.pbTicker.TabIndex = 0x1a;
     this.pbTicker.TabStop = false;
     this.pbTicker.Paint += new PaintEventHandler(this.pbTicker_Paint);
     base.AutoScaleDimensions = new SizeF(7f, 13f);
     base.AutoScaleMode = AutoScaleMode.Font;
     base.ClientSize = new Size(900, 0x261);
     base.Controls.Add(this.btnOptOut);
     base.Controls.Add(this.btnRefreshGames);
     base.Controls.Add(this.cbRegistrations);
     base.Controls.Add(this.earthMap1);
     base.Controls.Add(this.pBottomBG);
     this.Font = new Font("Verdana", 8f);
     base.Location = new Point(0, 0);
     this.MinimumSize = new Size(0x2ed, 600);
     base.Name = "DlgWorldMap";
     base.ttDefault.SetSuperTip(this, null);
     this.Text = "<LOC>World Map";
     base.SizeChanged += new EventHandler(this.DlgWorldMap_SizeChanged);
     base.Load += new EventHandler(this.DlgWorldMap_Load);
     base.Controls.SetChildIndex(this.pBottomBG, 0);
     base.Controls.SetChildIndex(this.earthMap1, 0);
     base.Controls.SetChildIndex(this.cbRegistrations, 0);
     base.Controls.SetChildIndex(this.btnRefreshGames, 0);
     base.Controls.SetChildIndex(this.btnOptOut, 0);
     this.cmEarthMap.ResumeLayout(false);
     this.refreshTimer.EndInit();
     this.pBottomBG.ResumeLayout(false);
     this.lpChecks.ResumeLayout(false);
     ((ISupportInitialize) this.pbTicker).EndInit();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
 private void skinButtonYes_Click(object sender, EventArgs e)
 {
     if (this.CloseTimer != null)
     {
         this.CloseTimer.Stop();
         this.CloseTimer = null;
     }
     base.DialogResult = DialogResult.Yes;
     base.Close();
 }
 protected override void OnLoad(EventArgs e)
 {
     ElapsedEventHandler handler = null;
     base.OnLoad(e);
     if (this.CloseTimer != null)
     {
         this.CloseTimer.AutoReset = false;
         if (handler == null)
         {
             handler = delegate (object sender, ElapsedEventArgs e1) {
                 VGen0 method = null;
                 if (((base.InvokeRequired && !base.Disposing) && !base.IsDisposed) && (base.Handle != IntPtr.Zero))
                 {
                     if (method == null)
                     {
                         method = delegate {
                             if (this.CloseTimer != null)
                             {
                                 this.CloseTimer.Stop();
                                 this.CloseTimer = null;
                             }
                             base.DialogResult = DialogResult.Ignore;
                             base.Close();
                         };
                     }
                     base.BeginInvoke(method);
                 }
                 else if ((!base.Disposing && !base.IsDisposed) && (base.Handle != IntPtr.Zero))
                 {
                     if (this.CloseTimer != null)
                     {
                         this.CloseTimer.Stop();
                         this.CloseTimer = null;
                     }
                     base.DialogResult = DialogResult.Ignore;
                     base.Close();
                 }
             };
         }
         this.CloseTimer.Elapsed += handler;
         this.CloseTimer.Start();
     }
 }
Exemple #6
0
 public FrmMain()
 {
     WaitCallback callBack = null;
     MessageEventHandler handler = null;
     EventHandler handler2 = null;
     EventHandler handler3 = null;
     this.components = null;
     this.WebURL = null;
     this.IsGPGNetPatching = true;
     this.mNotFound = "";
     this.IsLatestVer = false;
     this.mPatchFileName = "";
     this.mServerGameVersion = null;
     this.mLastSelectedGame = null;
     this.mIsSupComVersionEnforced = null;
     this.mIsSupComPatching = false;
     this.DlgUpdate = null;
     this.SupComPatchThread = null;
     this.FriendsLoaded = false;
     this.FriendContainers = new BoundContainerList();
     this.FriendContainerLookup = new Dictionary<string, TextContainer>();
     this.ActiveDialogRequests = new List<string>();
     this.FriendRequests = new MappedObjectList<FriendRequest>();
     this.AwaitingLogin = true;
     this.ContinueLoading = null;
     this.LadderViews = new Dictionary<int, FrmLadderView>();
     this.mGameMenuItems = new List<ToolStripMenuItem>();
     this.mLastMoveItem = null;
     this.mConfigSleepRate = 0x493e0;
     this.mFirstConfig = true;
     this.mLastMOTD = "";
     this.mLastProcessList = "";
     this.mConfigThread = null;
     this.mConnected = true;
     this.mShuttingDown = false;
     this.CancelFade = false;
     this.HasFadeStarted = false;
     this.IsFading = false;
     this.TargetFade = 0.0;
     this.FadeIncrement = 0.0;
     this.StayActive = false;
     this.mIsActiveWindow = false;
     this.mWelcomePage = null;
     this.mRanInitializeChat = false;
     this.mHeightDiff = 0;
     this.mWidthDiff = 0;
     this.mLastX = 0;
     this.mLastY = 0;
     this.mLastMouseX = 0;
     this.mLastMouseY = 0;
     this.mLastWidth = 0;
     this.mLastHeight = 0;
     this.mIsMoving = false;
     this.mIsResizing = false;
     this.mStartResizing = false;
     this.RESIZE_RECT = 40;
     this.mResizeRect = new Rectangle();
     this.FirstPaint = true;
     this.mIsMaximized = false;
     this.mRestore = new Rectangle(0, 0, 100, 100);
     this.MinimizeLoc = new Point(-32000, -32000);
     this.MinimizeSize = new Size(640, 500);
     this.StatusTimer = null;
     this.mActiveDialogs = new List<DlgBase>();
     this.mActiveWindow = null;
     this.DlgAbout = null;
     this.DlgOptions = null;
     this.DlgUserFeedback = null;
     this.FrmStatsLadders = new List<FrmStatsLadder>();
     this.DlgGameKeys = null;
     this.DlgEmotes = null;
     this.DlgSelectChannel = null;
     this.DlgKeywordSearch = null;
     this.DlgSearchResults = null;
     this.DlgSolution = null;
     this.DlgSearchReplays = null;
     this.DlgTeamGame = null;
     this.DlgSelectGame = null;
     this.DlgActiveEfforts = null;
     this.DlgContentManager = null;
     this.mSearchingForAutomatch = false;
     this.mLastStatus = "";
     this.mCalcGridHeight = false;
     this.ToolstripSizeChanged = false;
     this.mCustomPaint = new List<ToolStripItem>();
     this.mLastCheckTime = DateTime.Now;
     this.mDlgWorldMap = null;
     this.mSelectedTab = null;
     this.mGameLinkClickTime = DateTime.Now;
     this.ChatRowPoints = new Dictionary<int, Rectangle>();
     this.ChatRowHeights = new Dictionary<int, int>();
     this.mFirstChatDraw = true;
     this.SelectedEmote = null;
     this.LastTick = 0;
     this.Divider = 1;
     this.CurrentFrame = 1;
     this.EmoteCount = 0;
     this.CountEmotes = true;
     this.PaintPending = false;
     this.mSelectedParticipantView = null;
     this.UIQueue = new ThreadQueue(true);
     this.IsSortingChatroom = false;
     this.IsSynchronizingChatroom = false;
     this.ChatSyncTimer = null;
     this._AddUser = null;
     this._UpdateUser = null;
     this._RemoveUser = null;
     this.mSelectedChatParticipant = null;
     this.ChatContainerLookup = new Dictionary<string, TextContainer<StatusTextLine>>();
     this.ChatContainers = new BoundContainerList<StatusTextLine>();
     this.RefreshData = false;
     this.BetweenChannels = false;
     this.mMainChatrom = "";
     this.ChatroomQueue = new ThreadQueue(true);
     this.mLastChatTimes = Hashtable.Synchronized(new Hashtable());
     this.mLastChatContent = Hashtable.Synchronized(new Hashtable());
     this.mChatLines = new BindingList<ChatLine>();
     this.PlayerChatEffects = new Dictionary<string, ChatEffectBase>();
     this.mSpeakingTimers = new Dictionary<string, StateTimer>();
     this.AwayTimer = new StateTimer();
     this.SelfLeaveTimer = new StateTimer();
     this.LastAction = DateTime.Now;
     this.mChatHistory = new LinkedList<string>();
     this.HistoryIndex = -1;
     this.SelectingTextList = false;
     this.PMTargets = new List<string>();
     this.mPrivateChats = new Dictionary<string, FrmPrivateChat>();
     this.PlayerProfileForm = null;
     this.ClanLoaded = false;
     this.ClanContainers = new BoundContainerList();
     this.ClanContainerLookup = new Dictionary<string, TextContainer>();
     this.ClanRequests = null;
     this.ClanInvites = null;
     this.ClanProfileForm = null;
     this.mBeforeGameChatroom = "";
     this.mIsInGame = false;
     this.StatusButtonRankedGameCancel = new SkinStatusButton();
     this.mGameName = "";
     this.mGameURL = "";
     this.mHostName = "";
     this.mSupcomGameManager = null;
     this.mPassword = "";
     this.mFirstRankedSupcomGame = true;
     this.PlayNowMatch = false;
     this.mAutoStatus = Loc.Get("<LOC>Searching for game ");
     this.LastGameChallenges = new Dictionary<int, bool>();
     this.LadderInvitePending = false;
     this.mCanDirectChallenge = true;
     this.mDirectChallengePlayer = "";
     this.AllowDirectChallenge = true;
     this.BeforeTeamGameChatroom = null;
     this.mTeamAutomatchExit = false;
     this.InviteAccepted = false;
     this.InvitePending = false;
     this.PendingJoinFrom = null;
     ThreadID = Thread.CurrentThread.ManagedThreadId;
     if (new DlgLogin().ShowDialog() == DialogResult.OK)
     {
         if (callBack == null)
         {
             callBack = delegate (object p) {
                 GameInformation.LoadGamesFromDB();
                 new QuazalQuery("RemoveSpaceSiegeGame", new object[0]).ExecuteNonQuery();
                 ConfigSettings.LoadSettings(DataAccess.GetQueryData("GetAllConfigs", new object[0]));
                 try
                 {
                     DataList queryData = null;
                     queryData = DataAccess.GetQueryData("GetTOSPrompt", new object[0]);
                     if ((queryData != null) && (queryData.Count < 1))
                     {
                         DataAccess.ExecuteQuery("CreatePlayerInfo", new object[0]);
                         queryData = DataAccess.GetQueryData("GetTOSPrompt", new object[0]);
                     }
                     if ((queryData != null) && (queryData.Count > 0))
                     {
                         if (Convert.ToInt32(queryData[0]["term_of_service_prompt"]) > 0)
                         {
                             if (new DlgTermsOfService(this, queryData[0]["url"]).ShowDialog() == DialogResult.OK)
                             {
                                 ThreadQueue.Quazal.Enqueue((VGen0)delegate {
                                     DataAccess.ExecuteQuery("SetTOSPrompt", new object[] { 0 });
                                 }, new object[0]);
                                 this.ContinueLoading = true;
                             }
                             else
                             {
                                 this.ContinueLoading = false;
                             }
                         }
                         else
                         {
                             this.ContinueLoading = true;
                         }
                     }
                     else
                     {
                         AuditLog.WriteLine("Unable to find Terms of Service agreement.", new object[0]);
                         this.ContinueLoading = true;
                     }
                 }
                 catch (Exception exception)
                 {
                     ErrorLog.WriteLine(exception);
                     this.ContinueLoading = false;
                 }
             };
         }
         ThreadQueue.QueueUserWorkItem(callBack, new object[0]);
         while (!this.ContinueLoading.HasValue)
         {
             Thread.Sleep(100);
         }
         if (this.ContinueLoading.Value)
         {
             if (ConfigSettings.GetBool("DoOldGameList", false))
             {
                 if (((User.Current.IsAdmin || (GameInformation.SelectedGame.GameID == -1)) || (GameKey.BetaKeys.Count > 0)) || ((GameKey.BetaKeys.Count < 1) && (new DlgNoBetaKey(this).ShowDialog() == DialogResult.OK)))
                 {
                     this.AwaitingLogin = false;
                 }
                 else
                 {
                     User.Logout();
                     this.ContinueLoading = false;
                     this.AwaitingLogin = false;
                 }
             }
             else if (((User.Current.IsAdmin || (GameInformation.SelectedGame.GameID == -1)) || (GameInformation.SelectedGame.CDKey != "")) || (new DlgNoBetaKey(this).ShowDialog() == DialogResult.OK))
             {
                 this.AwaitingLogin = false;
             }
             else
             {
                 User.Logout();
                 this.ContinueLoading = false;
                 this.AwaitingLogin = false;
             }
         }
         else
         {
             Application.Exit();
             this.AwaitingLogin = false;
         }
     }
     else
     {
         this.AwaitingLogin = false;
         if (OnCancelLoad != null)
         {
             OnCancelLoad(this, EventArgs.Empty);
         }
     }
     if (((User.Current == null) || base.Disposing) || base.IsDisposed)
     {
         if (OnCancelLoad != null)
         {
             OnCancelLoad(this, EventArgs.Empty);
         }
         base.Close();
     }
     else if (!(!this.ContinueLoading.HasValue ? false : this.ContinueLoading.Value))
     {
         if (OnCancelLoad != null)
         {
             OnCancelLoad(this, EventArgs.Empty);
         }
         base.Close();
     }
     else
     {
         Exception exception;
         this.InitializeComponent();
         this.InitializePlugins();
         this.SetToolTips();
         this.gpgChatGrid.IsCheckingExpand = false;
         DlgMessage.RegistermainForm(this);
         DlgSupcomTeamSelection.sFrmMain = this;
         if (this.GatheringDisplaycontrol is SkinGatheringDisplay)
         {
             (this.GatheringDisplaycontrol as SkinGatheringDisplay).MainForm = this;
         }
         this.ResetLobby();
         base.ShowInTaskbar = false;
         IntPtr handle = base.Handle;
         this.DoubleBuffered = true;
         this.SetSkin(Program.Settings.SkinName);
         this.StyleApplication(this, null);
         this.StyleChatroom(this, null);
         base.FormBorderStyle = FormBorderStyle.Sizable;
         User.LoggedOut += new EventHandler(this.LogoutLobby);
         this.SetRegion();
         this.PopulateLadderMenuItems();
         this.InitStatusDropdown();
         this.ChatFiltersChanged();
         this.SetLogo(this);
         this.ciChat_TeamInvite.DrawItem += new DrawItemEventHandler(this.miArrangedTeamsPopup_DrawItem);
         this.skinDropDownStatus.Enabled = false;
         this.textBoxMsg.Properties.MaxLength = 300;
         this.GatheringDisplaycontrol.Popup += new EventHandler(this.comboBoxGatherings_Popup);
         this.CheckControl(this);
         Messaging.NetDataRecieved += new NetDataEventHandler(FrmMain.Messaging_NetDataRecieved);
         Messaging.MessageRecieved += new MessageEventHandler(this.Messaging_MessageRecieved);
         Messaging.CommandRecieved += new MessageEventHandler(this.Messaging_CommandRecieved);
         if (handler == null)
         {
             handler = delegate (MessageEventArgs e) {
                 this.ParseCustomCommand(e.Command, e.CommandArgs);
             };
         }
         Messaging.CustomCommandRecieved += handler;
         if (handler2 == null)
         {
             handler2 = delegate (object s, EventArgs e) {
                 base.Invalidate(false);
             };
         }
         base.SizeChanged += handler2;
         if (handler3 == null)
         {
             handler3 = delegate (object s, EventArgs e) {
                 if (this.ActiveWindow != null)
                 {
                     this.ActiveWindow = null;
                 }
             };
         }
         base.Activated += handler3;
         base.MouseDown += new MouseEventHandler(this.this_MouseDown);
         this.pbTop.MouseDown += new MouseEventHandler(this.this_MouseDown);
         this.pbTopLeft.MouseDown += new MouseEventHandler(this.this_MouseDown);
         this.pbTopRight.MouseDown += new MouseEventHandler(this.this_MouseDown);
         this.pbBottomRight.MouseDown += new MouseEventHandler(this.this_MouseDown);
         base.MouseUp += new MouseEventHandler(this.this_MouseUp);
         this.pbTop.MouseUp += new MouseEventHandler(this.this_MouseUp);
         this.pbTopLeft.MouseUp += new MouseEventHandler(this.this_MouseUp);
         this.pbTopRight.MouseUp += new MouseEventHandler(this.this_MouseUp);
         this.gvChat.RowSeparatorHeight = Program.Settings.Chat.Appearance.ChatLineSpacing;
         this.BindToSettings();
         this.PreLoadChat();
         while (this.AwaitingLogin && (!base.Disposing && !base.IsDisposed))
         {
             Thread.Sleep(100);
         }
         ThreadQueue.Quazal.Enqueue(typeof(DataAccess), "GetQueryData", this, "OnGetConfigs", new object[] { "GetAllConfigs" });
         ThreadQueue.Quazal.Enqueue(typeof(DataAccess), "GetQueryData", this, "AddMenuItems", new object[] { "GetMenuItems" });
         try
         {
             ThreadQueue.QueueUserWorkItem(delegate (object state) {
                 DataAccess.ExecuteQuery("SetIP2", new object[] { User.HashPassword(DlgLogin.LastPass) });
                 DlgLogin.LastPass = "";
             }, new object[0]);
         }
         catch (Exception exception1)
         {
             exception = exception1;
             ErrorLog.WriteLine(exception);
         }
         ThreadQueue.QueueUserWorkItem(delegate (object state) {
             DataAccess.ExecuteQuery("AcceptAllLadderChallenges", new object[] { User.Current.ID });
         }, new object[0]);
         if (User.Current.IsAdmin)
         {
             this.miTranslate.Visible = true;
         }
         if (AccessControlList.HasAccessTo("PatchAdmins"))
         {
             this.miTools_LocPatches.Visible = true;
             this.miTools_LocPatches.Enabled = true;
         }
         if (AccessControlList.HasAccessTo("PrizeWinners"))
         {
             this.miGame_RedeemPrize.Visible = true;
             this.miGame_RedeemPrize.Enabled = true;
         }
         try
         {
             this.CreateGameList();
             this.RefreshGameList();
         }
         catch (Exception exception2)
         {
             exception = exception2;
         }
     }
 }
Exemple #7
0
 private void testGameDetectionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     StateTimer timer = new StateTimer(5000.0);
     timer.AutoReset = true;
     timer.Elapsed += new ElapsedEventHandler(this.timer_Elapsed);
     timer.Start();
 }
Exemple #8
0
 public void SetStatus(string status, int timeout, params object[] args)
 {
     VGen0 method = null;
     ElapsedEventHandler handler = null;
     try
     {
         if (!base.Disposing && !base.IsDisposed)
         {
             if (base.InvokeRequired)
             {
                 if (method == null)
                 {
                     method = delegate {
                         this.pbMiddle.Text = string.Format(Loc.Get(status), args);
                         if (this.StatusChanged != null)
                         {
                             this.StatusChanged(this, this.pbMiddle.Text);
                         }
                     };
                 }
                 base.BeginInvoke(method);
             }
             else
             {
                 this.pbMiddle.Text = string.Format(Loc.Get(status), args);
                 if (this.StatusChanged != null)
                 {
                     this.StatusChanged(this, this.pbMiddle.Text);
                 }
             }
             if (timeout > 0)
             {
                 this.StatusTimer = new StateTimer((double) timeout);
                 this.StatusTimer.AutoReset = false;
                 if (handler == null)
                 {
                     handler = delegate (object sender, ElapsedEventArgs e) {
                         this.SetStatus("", new object[0]);
                     };
                 }
                 this.StatusTimer.Elapsed += handler;
                 this.StatusTimer.Start();
             }
             else
             {
                 this.StatusTimer = null;
             }
         }
     }
     catch (Exception exception)
     {
         ErrorLog.WriteLine(exception);
     }
 }
Exemple #9
0
 public void ResetAwayTimer()
 {
     WaitCallback callBack = null;
     if (base.InvokeRequired)
     {
         if (!User.Current.IsAdmin && !User.Current.IsModerator)
         {
             this.AwayTimer = new StateTimer((double) this.AwayInterval);
             this.AwayTimer.AutoReset = false;
             this.AwayTimer.Elapsed += new ElapsedEventHandler(this.AwayTimer_Elapsed);
             this.AwayTimer.Start();
             this.SelfLeaveTimer = new StateTimer((double) this.SelfLeaveInterval);
             this.SelfLeaveTimer.AutoReset = false;
             this.SelfLeaveTimer.Elapsed += new ElapsedEventHandler(this.SelfLeaveTimer_Elapsed);
             this.SelfLeaveTimer.Start();
         }
     }
     else
     {
         if (callBack == null)
         {
             callBack = delegate (object s) {
                 this.ResetAwayTimer();
             };
         }
         ThreadPool.QueueUserWorkItem(callBack);
     }
 }
Exemple #10
0
 private void AddSpeaker(User user)
 {
     ElapsedEventHandler handler = null;
     if (Program.Settings.Chat.ShowSpeaking && Chatroom.InChatroom)
     {
         if (this.SpeakingTimers.ContainsKey(user.Name))
         {
             this.SpeakingTimers[user.Name].Interval = this.SpeakingInterval;
         }
         else
         {
             TextContainer<StatusTextLine> container;
             VGen0 gen = null;
             StatusTextLine userLine = this.ChatContainers.Pop(user.Name, out container);
             if (userLine != null)
             {
                 if (container.Count < 1)
                 {
                     this.RefreshData = true;
                 }
                 if (gen == null)
                 {
                     gen = delegate {
                         if (this.ChatContainerLookup["Speaking"].Count < 1)
                         {
                             this.RefreshData = true;
                         }
                         this.ChatContainerLookup["Speaking"].Add(userLine);
                     };
                 }
                 this.ChatroomQueue.Enqueue(gen, new object[0]);
             }
             StateTimer timer = new StateTimer((double) this.SpeakingInterval);
             timer.AutoReset = false;
             timer.State = user;
             if (handler == null)
             {
                 handler = delegate (object sender, ElapsedEventArgs e) {
                     VGen0 target = null;
                     User _user = (User) (sender as StateTimer).State;
                     if (this.SpeakingTimers.ContainsKey(_user.Name))
                     {
                         this.SpeakingTimers.Remove(_user.Name);
                         if (this.ChatContainerLookup["Speaking"].Remove(_user.Name))
                         {
                             if (this.ChatContainerLookup["Speaking"].Count < 1)
                             {
                                 this.RefreshData = true;
                             }
                             if (target == null)
                             {
                                 target = delegate {
                                     this.AddChatParticipant(_user);
                                 };
                             }
                             this.ChatroomQueue.Enqueue(target, new object[0]);
                         }
                     }
                 };
             }
             timer.Elapsed += handler;
             this.SpeakingTimers[user.Name] = timer;
             timer.Start();
         }
     }
 }