Skip to content

Commit

Permalink
- added DayZ and Arma3 as games
Browse files Browse the repository at this point in the history
- simplified GetGameCaption from enum values
  • Loading branch information
PredatH0r committed May 25, 2015
1 parent 6d11acc commit 49bb530
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 36 deletions.
6 changes: 5 additions & 1 deletion QueryMaster/QueryMaster/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ public enum Game

Toxikk = 324810,
Reflex = 328070,
QuakeLiveTesting = 344320
QuakeLive_Testing = 344320,
DayZ = 221100,
Arma_3 = 107410,
Arma_3_dedicated_server = 233780,

}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ServerBrowser/ServerBrowserForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 9 additions & 34 deletions ServerBrowser/ServerBrowserForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.IO;
using System.Net;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using DevExpress.LookAndFeel;
Expand Down Expand Up @@ -136,7 +135,7 @@ private void InitGameInfoExtenders()
{
extenders.Add(Game.Toxikk, new Toxikk());
extenders.Add(Game.Reflex, new Reflex());
extenders.Add(Game.QuakeLiveTesting, new QuakeLive());
extenders.Add(Game.QuakeLive_Testing, new QuakeLive());
}

#endregion
Expand Down Expand Up @@ -239,30 +238,7 @@ private void InitFavGameRadioButtons()
#region GetGameCaption()
private string GetGameCaption(Game game)
{
string rawName = game.ToString();
var sb = new StringBuilder();
bool prevWasUpper = true;
foreach (char c in rawName)
{
if (c == '_')
{
sb.Append(" ");
prevWasUpper = true;
continue;
}

if (Char.IsUpper(c))
{
if (!prevWasUpper)
sb.Append(" ");
prevWasUpper = true;
}
else
prevWasUpper = false;

sb.Append(c);
}
return sb.ToString();
return game.ToString().Replace("_", " ");
}
#endregion

Expand Down Expand Up @@ -413,15 +389,14 @@ private void UpdateServerDetails(ServerRow row, int requestId, Action callback =
using (Server server = ServerQuery.GetServerInstance(EngineType.Source, row.EndPoint, false, 500, 500))
{
row.Retries = 0;
row.Status = "updating";
this.serverListUpdateNeeded = true;
server.Retries = 3;
status =
UpdateServerInfo(row, server, requestId) &&
UpdatePlayers(row, server, requestId) &&
UpdateRules(row, server, requestId)
? "ok"
: "timeout";
status = "timeout";
if (this.UpdateServerInfo(row, server, requestId))
{
this.UpdatePlayers(row, server, requestId);
this.UpdateRules(row, server, requestId);
status = "ok";
}
}

if (requestId != this.currentRequestId) // status might have changed
Expand Down

0 comments on commit 49bb530

Please sign in to comment.