public DlgFriendRequests(FrmMain mainForm, MappedObjectList<FriendRequest> requests) { this.InitializeComponent(); base.MainForm = mainForm; this.mRequestList = requests; this.RefreshList(); }
public FrmStatsLadder() { this.mSelectedRating = null; this.mLastRating = -1; this.mCategory = null; this.mCurrentPage = 0; this.mCurrentDataSet = null; this.components = null; this.InitializeComponent(); }
public ClanView(GPG.Multiplayer.Client.Clans.Clan clan, MappedObjectList<ClanMember> members, string name, bool isPlayerName) { this.mClan = clan; this.mMembers = members; if (isPlayerName) { this.mPlayerName = name; } else { this.mClanName = name; } }
public PlayerView(User player, MappedObjectList<User> friends) { this.mPlayer = player; this.mFriends = friends; }
public void PollComplete(DataList poll) { this.NotifyStatus(Loc.Get("<LOC>Searching for game"), true); EventLog.WriteLine("Polling complete", LogCategory.Get("Automatch"), new object[0]); MappedObjectList<AutomatchPlayers> list = new MappedObjectList<AutomatchPlayers>(poll); if ((list != null) && ((this.mKind != "FFA") || (list.Count > 4))) { foreach (AutomatchPlayers players in list) { Messaging.SendCustomCommand(players.Name, CustomCommands.AutomatchRequest, new object[0]); } } }
private void RefreshChannels() { VGen0 target = null; VGen0 callback = null; try { base.SetStatus("<LOC>Refreshing List...", new object[0]); this.skinButtonOK.Enabled = false; this.skinButtonrefresh.Enabled = false; if (target == null) { target = delegate { try { this.mChannels = DataAccess.GetObjects<CustomRoom>("GetCustomChannels", new object[0]); } catch (Exception exception) { ErrorLog.WriteLine(exception); } }; } if (callback == null) { callback = delegate { VGen0 method = null; try { if ((base.InvokeRequired && !base.Disposing) && !base.IsDisposed) { if (method == null) { method = delegate { this.gpgDataGridRooms.DataSource = null; this.gpgDataGridRooms.DataSource = this.Channels; this.skinButtonOK.Enabled = true; this.skinButtonrefresh.Enabled = true; }; } base.Invoke(method); } else if (!(base.Disposing || base.IsDisposed)) { this.gpgDataGridRooms.DataSource = null; this.gpgDataGridRooms.DataSource = this.Channels; this.skinButtonOK.Enabled = true; this.skinButtonrefresh.Enabled = true; } } catch (Exception exception) { ErrorLog.WriteLine(exception); } finally { base.ClearStatus(); } }; } ThreadQueue.Quazal.Enqueue(target, callback, new object[0]); } catch (Exception exception) { ErrorLog.WriteLine(exception); base.ClearStatus(); } }
public FrmLadderView(LadderInstance ladder) { EventHandler handler = null; VGen0 method = null; this.components = null; this.mLadder = null; this.IsLadderParticipant = false; this.IsJoinPending = false; this.IsLeavePending = false; this.IsViewingChallengers = false; this.mSelectedParticipant = null; this.mCurrentPage = 0; this.mLastRating = -1; this.mCurrentDataSet = null; this.ToolstripSizeChanged = false; this.mCustomPaint = new List<ToolStripItem>(); this.mLadder = ladder; this.InitializeComponent(); base.MainForm.LadderGamePlayed += new EventHandler(this.MainForm_LadderGamePlayed); this.gpgLabelDates.Text = string.Format("{0} - {1}", this.Ladder.StartDate.ToShortDateString(), this.Ladder.EndDate.ToShortDateString()); this.backLabelTitle.Text = this.Ladder.Description; this.gpgLabelRules.Text = this.Ladder.LadderDefinition.RulesDescription; this.gpgLabelDescription.Text = string.Format("{0}. {1}", this.Ladder.LadderDefinition.Name, this.Ladder.LadderDefinition.Description); this.Text = string.Format("<LOC>Ladder View - {0}", this.Ladder.LadderDefinition.Name); string data = "<LOC>Individual Ladder"; if (this.Ladder.LadderDefinition.IsTeam) { data = "<LOC>Team Ladder"; } else if (this.Ladder.LadderDefinition.IsClan) { data = "<LOC>Clan Ladder"; } if (!this.AcceptingChallenges) { this.btnToggleMyChallenges.Image = SkinManager.GetImage(@"Dialog\LadderView\decline_challenges.png"); this.btnToggleMyChallenges.ToolTipText = Loc.Get("<LOC>Declining Challenges"); } else { this.btnToggleMyChallenges.Image = SkinManager.GetImage(@"Dialog\LadderView\accept_challenges.png"); this.btnToggleMyChallenges.ToolTipText = Loc.Get("<LOC>Accepting Challenges"); } this.gpgLabelType.Text = Loc.Get(data); if (handler == null) { handler = delegate (object o, EventArgs e) { this.backLabelTitle.Refresh(); this.ResizePageLinks(); }; } base.SizeChanged += handler; this.IsLadderParticipant = new QuazalQuery("IsLadderParticipant", new object[] { User.Current.ID, this.Ladder.ID }).GetBool(); this.IsJoinPending = new QuazalQuery("IsLadderJoinPending", new object[] { User.Current.ID, this.Ladder.ID }).GetBool(); this.IsLeavePending = new QuazalQuery("IsLadderRemovePending", new object[] { User.Current.ID, this.Ladder.ID }).GetBool(); if ((!base.Disposing && !base.IsDisposed) && base.IsHandleCreated) { if (method == null) { method = delegate { if (this.IsJoinPending) { this.btnJoinLeave.ToolTipText = Loc.Get("<LOC>Join Pending"); } else if (this.IsLeavePending) { this.btnJoinLeave.ToolTipText = Loc.Get("<LOC>Leave Pending"); } else if (this.IsLadderParticipant) { this.btnJoinLeave.ToolTipText = Loc.Get("<LOC>Leave This Ladder"); this.btnJoinLeave.Image = this.btnJoinLeave.Image; } else { this.btnJoinLeave.ToolTipText = Loc.Get("<LOC>Join This Ladder"); this.btnJoinLeave.Image = this.btnJoinLeave.Image; } this.RefreshToolstrip(); }; } base.BeginInvoke(method); } this.RefreshDataSynchronous(); }
private void OnRefreshData(DataList data) { if ((data != null) && (data.Count > 0)) { this.mCurrentDataSet = new MappedObjectList<LadderParticipant>(data); this.gpgDataGridLadder.DataSource = null; this.gpgDataGridLadder.DataSource = this.CurrentDataSet; this.gvLadder.RefreshData(); } else { this.gpgDataGridLadder.DataSource = null; this.gvLadder.RefreshData(); } this.gvLadder_FocusedRowChanged(null, null); this.RefreshToolstrip(); this.ResizePageLinks(); }
public static void LoadSettings(DataList data) { mSettings = new MappedObjectList<ConfigSetting>(data); }
private void OnRefreshGatherings(DataList data, bool clearFirst) { MappedObjectList<Chatroom> rooms = new MappedObjectList<Chatroom>(data); int num = 0; if (ConfigSettings.GetBool("ShowChannels", false)) { num = 2; } clearFirst = this.GatheringDisplaycontrol.RoomCount != (rooms.Count + num); this.GatheringDisplaycontrol.RefreshGatherings(rooms, clearFirst); this.GatheringDisplaycontrol.Popup += new EventHandler(this.comboBoxGatherings_Popup); }
private void FinishList(object result) { MappedObjectList<GameItem> list = result as MappedObjectList<GameItem>; MappedObjectList<GameItem> list2 = new MappedObjectList<GameItem>(); foreach (GameItem item in list) { if (item.Description.IndexOf("AUTOMATCH") != 0) { list2.Add(item); } } this.gpgGameGrid.DataSource = list2; this.skinButtonRefresh.Enabled = true; if (list.Count > 0) { this.skinButtonJoin.Enabled = true; } }
private void OnRefreshData(DataList data) { if ((data != null) && (data.Count > 0)) { this.mCurrentDataSet = new MappedObjectList<PlayerRating>(data); this.gpgDataGridLadder.DataSource = null; this.gpgDataGridLadder.DataSource = this.CurrentDataSet; this.gvLadder.RefreshData(); this.ResizePageLinks(); } }
public FrmStatsLadder(FrmMain mainForm, string category) : base(mainForm) { this.mSelectedRating = null; this.mLastRating = -1; this.mCategory = null; this.mCurrentPage = 0; this.mCurrentDataSet = null; this.components = null; this.InitializeComponent(); this.SetCategory(category, true); }
public void AddUsers(MappedObjectList<User> users) { this.AddUsers(users, false); }
private void RecieveClanInviteRequest(string senderName, int senderId) { VGen0 method = null; if ((this.ClanRequests != null) && this.ClanRequests.ContainsIndex("name", senderName)) { Messaging.SendCustomCommand(senderName, CustomCommands.SystemMessage, new object[] { "<LOC>You already have a pending request with {0}.", User.Current.Name }); } else { if (method == null) { method = delegate { string msg = string.Format(Loc.Get("<LOC>{0} has requested to join your clan. You may accept the request, decline it, or save it and decide later."), senderName); switch (new DlgYesNoLater(this, "<LOC>Clan Invitation Request", msg, true).ShowDialog(this)) { case DialogResult.Ignore: { if (!DataAccess.ExecuteQuery("SaveOfflineClanRequest", new object[] { senderId })) { this.ErrorMessage("<LOC>Unable to save request, ensure you do not already have a pending request from this target.", new object[0]); break; } if (this.ClanRequests == null) { this.ClanRequests = new MappedObjectList<ClanRequest>(); } ClanRequest item = new ClanRequest(senderId, senderName, User.Current.ID, User.Current.Name, DateTime.Now); this.ClanRequests.Add(item); this.ClanRequests.IndexObject(item); this.RefreshClanRequestCount(); this.SystemMessage("<LOC>This request has been saved for future action. Please check the Clan tab to review it.", new object[0]); Messaging.SendCustomCommand(senderName, CustomCommands.SystemEvent, new object[] { "<LOC>{0} has decided to save your request and review it later..", User.Current.Name }); break; } case DialogResult.Yes: this.InviteToClan(senderName); break; default: Messaging.SendCustomCommand(senderName, CustomCommands.SystemEvent, new object[] { "<LOC>{0} has declined your request.", User.Current.Name }); this.SystemMessage("<LOC>A rejection notification has been sent.", new object[0]); break; } }; } base.BeginInvoke(method); } }
public void AddUsers(MappedObjectList<User> users, bool block) { foreach (User user in users) { this.AddUser(user, block, false); } if (this.AutoRefresh) { this.RefreshData(); } }
private void FrmMain_Clan(VGen0 callback) { ThreadQueue.QueueUserWorkItem(delegate (object none) { User user; VGen0 gen = null; VGen0 gen2 = null; VGen0 gen3 = null; VGen0 gen4 = null; VGen0 gen5 = null; VGen0 gen6 = null; MappedObjectList<Clan> objects = DataAccess.GetObjects<Clan>("GetClanByMember2", new object[] { User.Current.Name }); if ((objects == null) || (objects.Count <= 0)) { User.Current.ClanName = null; User.Current.ClanAbbreviation = null; if (Chatroom.InChatroom && Chatroom.GatheringParticipants.TryFindByIndex("name", User.Current.Name, out user)) { user.ClanName = null; user.ClanAbbreviation = null; } this.ClanLoaded = true; if (this.FriendsLoaded) { this.NotifyOnLogin(); } if (this.ClanInvites == null) { this.ClanInvites = DataAccess.GetObjects<ClanInvite>("GetAllClanInvites", new object[0]); if (gen5 == null) { gen5 = delegate { this.RefreshClanInviteCount(); }; } this.Invoke(gen5); } if (gen6 == null) { gen6 = delegate { VGen0 method = null; if ((((Clan.Current != null) || (ClanMember.Current != null)) || (Clan.CurrentMembers != null)) || (Clan.CurrentMembersMsgList.Length > 0)) { User.Current.ClanAbbreviation = null; User.Current.ClanName = null; Clan.Current = null; Clan.CurrentMembers = null; ClanMember.Current = null; this.RefreshGathering(); } if ((this.InvokeRequired && !this.Disposing) && !this.IsDisposed) { if (method == null) { method = delegate { this.skinLabelClanName.Text = ""; this.skinLabelClanName.Cursor = Cursors.Default; this.pnlUserListClan.Visible = false; this.gpgScrollPanelClan.Visible = false; this.gpgScrollPanelNoClan.Visible = true; this.gpgScrollPanelNoClan.BringToFront(); }; } this.BeginInvoke(method); } else if (!(this.Disposing || this.IsDisposed)) { this.skinLabelClanName.Text = ""; this.skinLabelClanName.Cursor = Cursors.Default; this.pnlUserListClan.Visible = false; this.gpgScrollPanelClan.Visible = false; this.gpgScrollPanelNoClan.Visible = true; this.gpgScrollPanelNoClan.BringToFront(); } if (Chatroom.InChatroom && Chatroom.Current.IsClanRoom) { this.SystemMessage("<LOC>You have been removed from clan chat.", new object[0]); this.LeaveChat(); } }; } this.Invoke(gen6); } else { Clan.Current = objects[0]; Clan.CurrentMembers = DataAccess.GetObjects<ClanMember>("GetClanMembers", new object[] { Clan.Current.ID }); User.Current.ClanName = Clan.Current.Name; User.Current.ClanAbbreviation = Clan.Current.Abbreviation; if (Chatroom.InChatroom && Chatroom.GatheringParticipants.TryFindByIndex("name", User.Current.Name, out user)) { user.ClanName = Clan.Current.Name; user.ClanAbbreviation = Clan.Current.Abbreviation; } foreach (ClanMember member in Clan.CurrentMembers) { if (member.ID == User.Current.ID) { ClanMember.Current = member; break; } } if (!(!this.FriendsLoaded || this.ClanLoaded)) { this.NotifyOnLogin(); } this.ClanLoaded = true; this.pnlUserListClan.RefreshData(); if (this.ClanRequests == null) { this.ClanRequests = DataAccess.GetObjects<ClanRequest>("GetAllClanRequests", new object[0]); if (gen == null) { gen = delegate { this.RefreshClanRequestCount(); }; } this.Invoke(gen); } if (gen2 == null) { gen2 = delegate { this.pnlUserListClan.AutoRefresh = true; this.ClanContainers.Clear(); this.ClanContainerLookup.Clear(); this.ClanContainerLookup["Online"] = new TextContainer(Loc.Get("<LOC>Online")); this.ClanContainers.Add(this.ClanContainerLookup["Online"]); this.ClanContainerLookup["Offline"] = new TextContainer(Loc.Get("<LOC>Offline")); this.ClanContainers.Add(this.ClanContainerLookup["Offline"]); }; } this.Invoke(gen2); if ((this.InvokeRequired && !this.Disposing) && !this.IsDisposed) { if (gen3 == null) { gen3 = delegate { this.pnlUserListClan.Visible = true; this.gpgScrollPanelClan.Visible = true; this.gpgScrollPanelNoClan.Visible = false; this.skinLabelClanName.Text = Clan.Current.Name; this.skinLabelClanName.ForeColor = Program.Settings.Chat.Appearance.ClanColor; this.skinLabelClanName.Cursor = Cursors.Hand; }; } this.BeginInvoke(gen3); } else { if (gen4 == null) { gen4 = delegate { this.pnlUserListClan.Visible = true; this.gpgScrollPanelClan.Visible = true; this.gpgScrollPanelNoClan.Visible = false; this.skinLabelClanName.Text = Clan.Current.Name; this.skinLabelClanName.ForeColor = Program.Settings.Chat.Appearance.ClanColor; this.skinLabelClanName.Cursor = Cursors.Hand; }; } this.Invoke(gen4); } } if (callback != null) { callback(); } }, new object[0]); }
private void Populate(MappedObjectList<VolunteerEffort> efforts) { this.gpgPanelEfforts.Controls.Clear(); int num = 4; GPGLabel label = null; foreach (VolunteerEffort effort in efforts) { if (effort.HasVolunteered) { continue; } GPGLabel label2 = new GPGLabel(); label2.AutoSize = false; label2.Width = this.gpgPanelEfforts.Width - (num * 2); label2.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; label2.Text = effort.Description; label2.Tag = effort; label2.Click += new EventHandler(this.label_Click); label2.TextStyle = TextStyles.Link; label2.Left = num; if (label == null) { label2.Top = num; } else { label2.Top = label.Bottom + num; } label = label2; this.gpgPanelEfforts.Controls.Add(label2); effort.Volunteered += new EventHandler(this.effort_Volunteered); } if (this.gpgPanelEfforts.Controls.Count == 0) { this.gpgLabelNoVolunteer.Show(); this.gpgPanelEfforts.Hide(); } else { this.gpgPanelEfforts.Show(); this.gpgLabelNoVolunteer.Hide(); } base.ClearStatus(); this.skinButtonRefresh.Enabled = true; }
private void FrmMain_Friends() { ThreadQueue.Quazal.Enqueue((OGen0)delegate { this.FriendRequests = DataAccess.GetObjects<FriendRequest>("GetFriendRequests", new object[0]); return null; }, (VGen1)delegate (object o) { this.RefreshFriendInvites(); }, new object[0]); ThreadQueue.QueueUserWorkItem(delegate (object none) { MappedObjectList<User> friends = DataAccess.GetObjects<User>("GetFriendsByPlayerID", new object[] { User.Current.ID }); User.CurrentFriends = friends; if (!(!this.ClanLoaded || this.FriendsLoaded)) { this.NotifyOnLogin(); } this.FriendsLoaded = true; ThreadPool.QueueUserWorkItem(delegate (object state) { bool flag = false; foreach (User user in friends) { User user2; if (this.FriendRequests.ContainsIndex("name", user.Name)) { flag = true; this.FriendRequests.RemoveByIndex("name", user.Name); ThreadQueue.Quazal.Enqueue((VGen1)delegate (object o) { DataAccess.ExecuteQuery("RemoveFriendRequest", new object[] { o }); }, new object[] { user.ID }); } if (Chatroom.GatheringParticipants.TryFindByIndex("name", user.Name, out user2) && !user2.IsFriend) { user2.IsFriend = true; this.UpdateUser(user2); } user.IsFriend = true; } this.pnlUserListFriends.AddUsers(friends, false); if (flag) { this.RefreshFriendInvites(); } }); base.Invoke((VGen0)delegate { VGen0 method = null; VGen0 gen2 = null; if (friends.Count > 0) { this.FriendContainers = new BoundContainerList(); this.FriendContainerLookup = new Dictionary<string, TextContainer>(); this.FriendContainers.Clear(); this.FriendContainerLookup.Clear(); this.FriendContainerLookup["Online"] = new TextContainer(Loc.Get("<LOC>Friends Online")); this.FriendContainerLookup["Online"].AutoSort = false; this.FriendContainers.Add(this.FriendContainerLookup["Online"]); this.FriendContainerLookup["Offline"] = new TextContainer(Loc.Get("<LOC>Friends Offline")); this.FriendContainerLookup["Offline"].AutoSort = false; this.FriendContainers.Add(this.FriendContainerLookup["Offline"]); if ((this.InvokeRequired && !this.Disposing) && !this.IsDisposed) { if (method == null) { method = delegate { this.pnlUserListFriends.Visible = true; this.gpgLabelNoFriends.Visible = false; }; } this.BeginInvoke(method); } else { this.pnlUserListFriends.Visible = true; this.gpgLabelNoFriends.Visible = false; } foreach (FrmPrivateChat chat in this.PrivateChats.Values) { if (!(chat.Disposing || chat.IsDisposed)) { chat.ChatTarget.IsFriend = friends.ContainsIndex("name", chat.ChatTarget.Name); chat.RefreshToolstrip(); } } } else { if ((this.InvokeRequired && !this.Disposing) && !this.IsDisposed) { if (gen2 == null) { gen2 = delegate { this.pnlUserListFriends.Visible = false; this.gpgLabelNoFriends.Visible = true; }; } this.BeginInvoke(gen2); } else { this.pnlUserListFriends.Visible = false; this.gpgLabelNoFriends.Visible = true; } foreach (FrmPrivateChat chat in this.PrivateChats.Values) { if (!(chat.Disposing || chat.IsDisposed)) { chat.ChatTarget.IsFriend = false; chat.RefreshToolstrip(); } } } }); }, new object[0]); }
private void _OnRefreshData(DataList data, int selectRow) { VGen0 method = null; if (((base.InvokeRequired && !base.Disposing) && !base.IsDisposed) && base.IsHandleCreated) { if (method == null) { method = delegate { this._OnRefreshData(data, selectRow); }; } base.BeginInvoke(method); } else if ((!base.Disposing && !base.IsDisposed) && base.IsHandleCreated) { if ((data != null) && (data.Count > 0)) { this.mCurrentDataSet = new MappedObjectList<LadderParticipant>(data); this.gpgDataGridLadder.DataSource = null; this.gpgDataGridLadder.DataSource = this.CurrentDataSet; this.gvLadder.RefreshData(); } else { this.gpgDataGridLadder.DataSource = null; this.gvLadder.RefreshData(); } if (this.gvLadder.IsValidRowHandle(selectRow)) { this.gvLadder.MakeRowVisible(selectRow, true); this.gvLadder.FocusedRowHandle = selectRow; } else { this.gvLadder_FocusedRowChanged(null, null); } this.RefreshToolstrip(); this.ResizePageLinks(); } }
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; } } }
public void RefreshGatherings(MappedObjectList<Chatroom> rooms, bool clearFirst) { this.RefreshGatherings(rooms.ToArray(), clearFirst); }
private void OnGetURLs(DataList data) { this.WebURL = new MappedObjectList<URLInfo>(data); if (this.mWelcomePage == null) { this.ShowWelcome(); } this.mWelcomePage.MainForm = this; this.mWelcomePage.HomePage = this.HOME_URL; this.wbMain.Navigate(this.UrlById("BANNER")); if (!ApplicationDeployment.IsNetworkDeployed) { ParameterizedThreadStart start = new ParameterizedThreadStart(this.DownloadPatch); Thread thread = new Thread(start); thread.IsBackground = true; thread.Start(this.UrlById("PATCH")); } else { this.IsGPGNetPatching = false; this.UpdateSupCom(); } }
private void UpdateComments(MappedObjectList<ContentComment> comments) { EventHandler handler = null; EventHandler handler2 = null; try { this.gpgPanelComments.Controls.Clear(); this.gpgPanelComments.Refresh(); bool flag = false; if (comments.Count > 0) { this.gpgLabelNoComments.Visible = false; this.gpgPanelComments.Visible = true; foreach (ContentComment comment in comments) { if ((this.DeletedComment <= 0) || (comment.ID != this.DeletedComment)) { PnlContentComment comment2 = new PnlContentComment(this.Content, comment); this.gpgPanelComments.Controls.Add(comment2); if (handler == null) { handler = delegate (object s, EventArgs e) { this.DeletedComment = (s as ContentComment).ID; this.CommentCount--; this.UpdateComments(); }; } comment2.DeleteComment += handler; if (handler2 == null) { handler2 = delegate (object s, EventArgs e) { this.LayoutComments(); }; } comment2.UpdateComment += handler2; flag = true; } } this.LayoutComments(); } else { this.gpgPanelComments.Visible = false; this.skinButtonPostCommentBottom.Visible = false; this.gpgLabelNoComments.Visible = true; this.gpgLabelNoComments.BringToFront(); } if (!flag) { this.gpgPanelComments.Visible = false; this.gpgLabelNoComments.Visible = true; this.gpgLabelNoComments.BringToFront(); } } catch (Exception exception) { ErrorLog.WriteLine(exception); } finally { this.DeletedComment = -1; } }
private void UpdateComments(MappedObjectList<ReplayComment> comments) { EventHandler handler = null; try { this.gpgPanelComments.SuspendLayout(); this.gpgPanelComments.Controls.Clear(); bool flag = false; if (comments.Count > 0) { this.gpgLabelNoComments.Visible = false; this.gpgPanelComments.Visible = true; this.gpgPanelComments.BringToFront(); foreach (ReplayComment comment in comments) { if ((this.DeletedComment <= 0) || (comment.ID != this.DeletedComment)) { PnlReplayComment comment2 = new PnlReplayComment(this.Replay, comment); this.gpgPanelComments.Controls.Add(comment2); comment2.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; if (handler == null) { handler = delegate (object s, EventArgs e) { this.DeletedComment = (s as ReplayComment).ID; this.CommentCount--; this.UpdateComments(); }; } comment2.DeleteComment += handler; flag = true; } } this.LayoutComments(); } else { this.gpgPanelComments.Visible = false; this.gpgLabelNoComments.Visible = true; this.gpgLabelNoComments.BringToFront(); } if (!flag) { this.gpgPanelComments.Visible = false; this.gpgLabelNoComments.Visible = true; this.gpgLabelNoComments.BringToFront(); } this.gpgPanelComments.ResumeLayout(true); this.gpgGroupBoxComments.Refresh(); } catch (Exception exception) { ErrorLog.WriteLine(exception); } finally { this.DeletedComment = -1; } }