Skip to content

Commit

Permalink
- cleaned up menu (only most important function are directly in the m…
Browse files Browse the repository at this point in the history
…enu bar, other items are in the drop downs)

- cleaned up option pane (moved quick filters and alert to a separate pane)
- added option dialogs for Quake Live, Reflex and TOXIKK
- show a splash screen when connecting to a server
- bring existing game window to front of screen when connecting
- option "hide timed out servers" is now applied without setting up table filters
- fixed UI not being updated after a refresh of the current server list
- removed XML settings and code for old AppSettings migration
  • Loading branch information
PredatH0r committed Oct 31, 2015
1 parent b7b4f09 commit f14bfc1
Show file tree
Hide file tree
Showing 36 changed files with 1,766 additions and 1,186 deletions.
1 change: 1 addition & 0 deletions CreateDistribZip.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cd "%cwd%\ServerBrowser\bin\x86\debug"
copy ServerBrowser.exe "%target%"
copy QueryMaster.dll "%target%"
copy Ionic.BZip2.dll "%target%"
copy steam_api.dll "%target%"

del "DevExpress*Office*"
del "DevExpress*Rich*"
Expand Down
1 change: 0 additions & 1 deletion QueryMaster/QueryMaster/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ public enum Game
Toxikk = 324810,
Reflex = 328070,
QuakeLive = 282440,
QuakeLive_Testing = 344320,
DayZ = 221100,
Arma_3 = 107410,
Arma_3_dedicated_server = 233780,
Expand Down
15 changes: 8 additions & 7 deletions QueryMaster/QueryMaster/UdpQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,22 @@ internal UdpQuery(IPEndPoint address, int sendTimeOut, int receiveTimeOut)
internal byte[] GetResponse(byte[] msg, EngineType type, Stopwatch sw = null)
{
Type = type;
byte[] recvData;
byte[] recvData = null;
if (this.isFirstPacket && this.SendFirstPacketTwice)
{
this.isFirstPacket = false;
SendData(msg);
}
sw?.Start();
SendData(msg);
recvData = ReceiveData();
sw?.Stop();
if (sw != null)
Thread.Yield(); // improve accuracy of Ping for other threads

try
{
sw?.Start();
SendData(msg);
recvData = ReceiveData();
sw?.Stop();
if (sw != null)
Thread.Yield(); // improve accuracy of Ping for other threads

var header = BitConverter.ToInt32(recvData, 0);
switch (header)
{
Expand Down
95 changes: 95 additions & 0 deletions ServerBrowser/ConnectingWaitForm.Designer.cs

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

43 changes: 43 additions & 0 deletions ServerBrowser/ConnectingWaitForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraWaitForm;

namespace ServerBrowser
{
public partial class ConnectingWaitForm : WaitForm
{
public ConnectingWaitForm()
{
InitializeComponent();
this.progressPanel1.AutoHeight = true;
}

#region Overrides

public override void SetCaption(string caption)
{
base.SetCaption(caption);
this.progressPanel1.Caption = caption;
}
public override void SetDescription(string description)
{
base.SetDescription(description);
this.progressPanel1.Description = description;
}
public override void ProcessCommand(Enum cmd, object arg)
{
base.ProcessCommand(cmd, arg);
}

#endregion

public enum WaitFormCommand
{
}
}
}
120 changes: 120 additions & 0 deletions ServerBrowser/ConnectingWaitForm.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
27 changes: 26 additions & 1 deletion ServerBrowser/Games/GameExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Text;
using DevExpress.Data;
using DevExpress.Utils;
using DevExpress.XtraGrid.Columns;
Expand All @@ -22,6 +23,16 @@ public class GameExtension
protected bool supportsPlayersQuery = true;
protected bool supportsConnectAsSpectator = false;

// menu

public string OptionMenuCaption { get; protected set; } = null;

public virtual void OnOptionMenuClick() { }

public virtual void LoadConfig(IniFile ini) { }
public virtual void SaveConfig(StringBuilder ini) { }


// server queries

#region SupportsPlayersQuery()
Expand Down Expand Up @@ -167,13 +178,27 @@ public virtual bool SupportsConnectAsSpectator(ServerRow server)
/// </summary>
public virtual bool Connect(ServerRow server, string password, bool spectate)
{
this.ActivateGameWindow(this.FindGameWindow());
var proc = Process.Start("steam://connect/" + server.EndPoint + (string.IsNullOrEmpty(password) ? "" : "/" + password));
return proc != null;
}
#endregion

protected virtual IntPtr FindGameWindow() => IntPtr.Zero;

#region ActivateGameWindow()
protected void ActivateGameWindow(IntPtr hWnd)
{
if (hWnd != IntPtr.Zero)
{
Win32.ShowWindow(hWnd, Win32.SW_RESTORE);
Win32.SetForegroundWindow(hWnd);
}
}
#endregion

// helper methods

#region AddColumn()
/// <summary>
/// Utility method for derived classes to add game specific columns to the server or player list
Expand Down
Loading

0 comments on commit f14bfc1

Please sign in to comment.