using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace QueryMaster
{
///
/// Contains information about the server
///
[Serializable]
public class ServerInfo
{
///
/// Returns true if server replies with Obsolete response format.
///
public bool IsObsolete { get; internal set; }
///
/// Socket address of server.
///
public string Address { get; internal set; }
///
/// Protocol version used by the server.
///
public byte Protocol { get; internal set; }
///
/// Name of the server.
///
public string Name { get; internal set; }
///
/// Map the server has currently loaded.
///
public string Map { get; internal set; }
///
/// Name of the folder containing the game files.
///
public string Directory { get; internal set; }
///
/// Full name of the game.
///
public string Description { get; internal set; }
///
/// Steam Application ID of game.
///
public short Id { get; internal set; }
///
/// Number of players on the server.
///
public int Players { get; internal set; }
///
/// Maximum number of players the server reports it can hold.
///
public byte MaxPlayers { get; internal set; }
///
/// Number of bots on the server.
///
public byte Bots { get; internal set; }
///
/// Indicates the type of server.(Dedicated/Non-dedicated/Proxy)
///
public string ServerType { get; internal set; }
///
/// Indicates the operating system of the server.(Linux/Windows/Mac)
///
public string Environment { get; internal set; }
///
/// Indicates whether the server requires a password
///
public bool IsPrivate { get; internal set; }
///
/// Specifies whether the server uses VAC.
///
public bool IsSecure { get; internal set; }
///
/// Version of the game installed on the server.
///
public string GameVersion { get; internal set; }
///
/// Round-trip delay time.
///
public long Ping { get; internal set; }
///
/// Additional information provided by server.
///
public ExtraInfo Extra { get; internal set; }
///
/// Valid only if the server is running The Ship.
///
public TheShip ShipInfo { get; internal set; }
///
/// Indicates whether the game is a mod(Halflofe/HalfLifeMod)
///
/// Present only in Obsolete server responses.
public bool IsModded { get; internal set; }
///
/// Valid only if IsModded =true
///
/// Present only in Obsolete server responses.
public Mod ModInfo { get; internal set; }
}
///
/// Contains extra information about the Ship server
///
[Serializable]
public class TheShip
{
///
/// Indicates the game mode.(Hunt/Elimination/Duel/Deathmatch/VIP Team/Team Elimination)
///
public string Mode { get; internal set; }
///
/// The number of witnesses necessary to have a player arrested.
///
public byte Witnesses { get; internal set; }
///
/// Time (in seconds) before a player is arrested while being witnessed.
///
public byte Duration { get; internal set; }
}
///
/// Contains information about the Mod.
///
/// Present only in Obsolete server responses.
[Serializable]
public class Mod
{
///
/// URL to mod website.
///
public string Link { get; internal set; }
///
/// URL to download the mod.
///
public string DownloadLink { get; internal set; }
///
/// Version of mod installed on server.
///
public long Version { get; internal set; }
///
/// Space (in bytes) the mod takes up.
///
public long Size { get; internal set; }
///
/// Indicates the type of mod.
///
public bool IsOnlyMultiPlayer { get; internal set; }
///
/// Indicates whether mod uses its own DLL
///
public bool IsHalfLifeDll { get; internal set; }
}
///
/// Contains information of a player currently in server
///
[Serializable]
public class Player
{
///
/// Name of the player.
///
public string Name { get; internal set; }
///
/// Player's score (usually "frags" or "kills".)
///
public long Score { get; internal set; }
///
/// Time player has been connected to the server.(returns TimeSpan instance)
///
public TimeSpan Time { get; internal set; }
}
///
/// Contains information of a server rule
///
[Serializable]
public class Rule
{
///
/// Name of the rule.
///
public string Name { get; internal set; }
///
/// Value of the rule.
///
public string Value { get; internal set; }
}
///
/// Contains information of a player
///
[Serializable]
public class PlayerInfo
{
///
/// Name of player
///
public string Name { get; internal set; }
///
/// UId of player(Steam ID)
///
public string Uid { get; internal set; }
///
/// Won Id
///
public string WonId { get; internal set; }
///
/// Player's Team Name
///
public string Team { get; internal set; }
}
///
/// Contains extra information about server
///
[Serializable]
public class ExtraInfo
{
///
/// The server's game port number.
///
public short Port { get; internal set; }
///
/// Server's SteamID.
///
public int SteamID { get; internal set; }
///
/// Contains information on Source TV.(if it is Source TV)
///
public SourceTVInfo SpecInfo { get; internal set; }
///
/// Tags that describe the game according to the server.
///
public string Keywords { get; internal set; }
///
/// The server's 64-bit GameID.
///
public int GameId { get; internal set; }
}
///
/// Contains information on SourceTV
///
[Serializable]
public class SourceTVInfo
{
///
/// Spectator port number for SourceTV.
///
public short Port { get; internal set; }
///
/// Name of the spectator server for SourceTV.
///
public string Name { get; internal set; }
}
}