From 18a50e539ec5034bb6ccc1b37d59283bec7d5d8b Mon Sep 17 00:00:00 2001 From: hbeham Date: Sat, 5 Sep 2015 15:23:10 +0200 Subject: [PATCH] - TOXIKK: added column to show mutators - fix: stale data was shown on screen (with missing location information) - fix: setting auto-refresh time to 0 caused 1sec refreshes and as a result throttling by Valve - upgraded to DX 15.1.6 library --- .gitignore | 1 + Main/Main.csproj | 5 +++-- Main/Program.cs | 2 +- ServerBrowser/Games/Toxikk.cs | 16 ++++++++++++++++ ServerBrowser/GeoIpClient.cs | 4 ++-- ServerBrowser/Properties/licenses.licx | 19 ++++++++----------- ServerBrowser/ServerBrowser.csproj | 20 +++++++++++--------- ServerBrowser/ServerBrowserForm.Designer.cs | 1 + ServerBrowser/ServerBrowserForm.cs | 9 ++++++--- ServerBrowser/ServerBrowserForm.resx | 6 +++--- changelog.md | 6 ++++++ 11 files changed, 58 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index 7ad38f9..5e9f3a2 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ ServerBrowser/images/flags/* packages/* ServerBrowser/amd64/ ServerBrowser/i386/ +_ReSharper.Caches/ diff --git a/Main/Main.csproj b/Main/Main.csproj index f8602b6..475ca8d 100644 --- a/Main/Main.csproj +++ b/Main/Main.csproj @@ -54,8 +54,9 @@ MinimumRecommendedRules.ruleset - - + + + diff --git a/Main/Program.cs b/Main/Program.cs index c3bf921..0b165c6 100644 --- a/Main/Program.cs +++ b/Main/Program.cs @@ -8,7 +8,7 @@ namespace Main { public static class Program { - private const string Version = "1.13"; + private const string Version = "1.14"; [STAThread] static void Main() diff --git a/ServerBrowser/Games/Toxikk.cs b/ServerBrowser/Games/Toxikk.cs index 93654c6..71b225c 100644 --- a/ServerBrowser/Games/Toxikk.cs +++ b/ServerBrowser/Games/Toxikk.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Globalization; +using System.Text; using System.Threading; using System.Windows.Forms; using DevExpress.Data; @@ -16,6 +17,7 @@ public class Toxikk : GameExtension private const string MinCombatants = "p268435703"; private const string ScoreLimit = "p268435704"; private const string TimeLimit = "p268435705"; + private const string Mutators = "p1073741828"; private const string IsOfficial = "s15"; private const int SecondsToWaitForMainWindowAfterLaunch = 45; @@ -43,6 +45,9 @@ public override void CustomizeServerGridColumns(GridView view) view.Columns["ServerInfo.Extra.Keywords"].Visible = false; + idx = view.Columns["ServerInfo.Map"].VisibleIndex; + AddColumn(view, Mutators, "Mutators", "Game modifications", 100, ++idx); + idx = view.Columns["ServerInfo.Ping"].VisibleIndex; AddColumn(view, "_skillclass", "Skill", "Skill Class: Min-Max", 45, idx, UnboundColumnType.Integer); AddColumn(view, "_best", "Best", "Best player's Skill Class", 40, ++idx, UnboundColumnType.Integer); @@ -67,6 +72,17 @@ public override object GetServerCellValue(ServerRow row, string fieldName) case "_gametype": var gt = row.ServerInfo.Description; return gt == null ? null : gt.Contains("BloodLust") ? "BL" : gt.Contains("TeamGame") ? "SA" : gt.Contains("Cell") ? "CC" : gt; + case Mutators: + var mods = (row.GetRule(fieldName) ?? "").ToLower(); + var buff = new StringBuilder(); + foreach (var mod in mods.Split('\x1c')) + { + if (mod.Length == 0) continue; + if (buff.Length > 0) buff.Append(", "); + foreach (var word in mod.Split(' ')) + buff.Append(char.ToUpper(word[0])).Append(word.Substring(1)); + } + return buff.ToString(); } return base.GetServerCellValue(row, fieldName); } diff --git a/ServerBrowser/GeoIpClient.cs b/ServerBrowser/GeoIpClient.cs index 039740a..d6b9e5e 100644 --- a/ServerBrowser/GeoIpClient.cs +++ b/ServerBrowser/GeoIpClient.cs @@ -10,7 +10,7 @@ namespace ServerBrowser { class GeoIpClient { - private const int ThreadCount = 10; + private const int ThreadCount = 7; private const string DefaultServiceUrlFormat = "http://freegeoip.net/csv/{0}"; /// /// the cache holds either a string with the 2-letter country ISO code, a simple callback delegate, or a multicast callback delegate @@ -39,7 +39,7 @@ private void ProcessLoop() try { var url = string.Format(this.ServiceUrlFormat, ip); - using (var client = new XWebClient()) + using (var client = new XWebClient(1000)) { var result = client.DownloadString(url); var callbacks = (Action)cache[ipInt]; diff --git a/ServerBrowser/Properties/licenses.licx b/ServerBrowser/Properties/licenses.licx index 3523e5e..d5c8d21 100644 --- a/ServerBrowser/Properties/licenses.licx +++ b/ServerBrowser/Properties/licenses.licx @@ -1,11 +1,8 @@ -DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraBars.Ribbon.GalleryControl, DevExpress.XtraBars.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox, DevExpress.XtraEditors.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.PictureEdit, DevExpress.XtraEditors.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit, DevExpress.XtraEditors.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.1, Version=15.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v15.1, Version=15.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v15.1, Version=15.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v15.1, Version=15.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v15.1, Version=15.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v15.1, Version=15.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox, DevExpress.XtraEditors.v15.1, Version=15.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit, DevExpress.XtraEditors.v15.1, Version=15.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/ServerBrowser/ServerBrowser.csproj b/ServerBrowser/ServerBrowser.csproj index 4235d0c..f3e0610 100644 --- a/ServerBrowser/ServerBrowser.csproj +++ b/ServerBrowser/ServerBrowser.csproj @@ -77,39 +77,41 @@ MinimumRecommendedRules.ruleset - + False True - + False True - + False True - + False True - + False True - + False True - + False True - + False True - + + + diff --git a/ServerBrowser/ServerBrowserForm.Designer.cs b/ServerBrowser/ServerBrowserForm.Designer.cs index a73460b..096ba90 100644 --- a/ServerBrowser/ServerBrowserForm.Designer.cs +++ b/ServerBrowser/ServerBrowserForm.Designer.cs @@ -1912,6 +1912,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.menuPlayers)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.menuRules)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/ServerBrowser/ServerBrowserForm.cs b/ServerBrowser/ServerBrowserForm.cs index ca0f942..9641b8f 100644 --- a/ServerBrowser/ServerBrowserForm.cs +++ b/ServerBrowser/ServerBrowserForm.cs @@ -795,7 +795,8 @@ private void btnQueryMaster_Click(object sender, EventArgs e) this.timerReloadServers.Stop(); ReloadServerList(); - this.timerReloadServers.Start(); + if (this.spinRefreshInterval.Value > 0) + this.timerReloadServers.Start(); } #endregion @@ -806,7 +807,8 @@ private void btnQuickRefresh_Click(object sender, EventArgs e) return; this.timerReloadServers.Stop(); this.queryLogic.RefreshAllServers(this.servers); - this.timerReloadServers.Start(); + if (this.spinRefreshInterval.Value > 0) + this.timerReloadServers.Start(); } #endregion @@ -962,7 +964,8 @@ private void timerUpdateServerList_Tick(object sender, EventArgs e) } finally { - this.timerUpdateServerList.Start(); + if (this.spinRefreshInterval.Value > 0) + this.timerUpdateServerList.Start(); } } #endregion diff --git a/ServerBrowser/ServerBrowserForm.resx b/ServerBrowser/ServerBrowserForm.resx index 07a3515..3448214 100644 --- a/ServerBrowser/ServerBrowserForm.resx +++ b/ServerBrowser/ServerBrowserForm.resx @@ -126,11 +126,11 @@ 269, 56 - + AAEAAAD/////AQAAAAAAAAAMAgAAAFpEZXZFeHByZXNzLlV0aWxzLnYxNS4xLCBWZXJzaW9uPTE1LjEu - NC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI4OGQxNzU0ZDcwMGU0OWEMAwAAAFFT + Ni4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI4OGQxNzU0ZDcwMGU0OWEMAwAAAFFT eXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRv a2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAAChEZXZFeHByZXNzLlV0aWxzLkltYWdlQ29sbGVjdGlvblN0 cmVhbWVyAgAAAAlJbWFnZVNpemUERGF0YQQHE1N5c3RlbS5EcmF3aW5nLlNpemUDAAAAAgIAAAAF/P// @@ -3814,7 +3814,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFpEZXZFeHByZXNzLlV0aWxzLnYxNS4xLCBWZXJzaW9uPTE1LjEu - NC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI4OGQxNzU0ZDcwMGU0OWEMAwAAAFFT + Ni4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI4OGQxNzU0ZDcwMGU0OWEMAwAAAFFT eXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRv a2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAAChEZXZFeHByZXNzLlV0aWxzLkltYWdlQ29sbGVjdGlvblN0 cmVhbWVyAgAAAAlJbWFnZVNpemUERGF0YQQHE1N5c3RlbS5EcmF3aW5nLlNpemUDAAAAAgIAAAAF/P// diff --git a/changelog.md b/changelog.md index 790163e..196125f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +1.14 +--- +- TOXIKK: added column to show mutators +- fix: stale data was shown on screen (with missing location information) +- fix: setting auto-refresh time to 0 caused 1sec refreshes and as a result throttling by Valve + 1.13 --- - added support to mark servers as favorites and keep them on top of the server list