BF2MC-Matchmaker
|
Class representing game server information. More...
#include <gameserver.h>
Public Types | |
enum class | Regions : uint64_t { Unknown = 0 , America = 1 , Asia = 2048 , Europe = 65536 } |
Enumeration defining regions where a game server can be located. More... | |
enum class | MapCyclingOptions : uint8_t { Unknown = 0 , LevelMapWithMapName = 1 , AllMaps = 2 , AssaultMaps = 3 , IncursionMaps = 4 , DominationMaps = 5 } |
Enumeration defining the map cycling options. More... | |
typedef bool(Battlefield::GameServer::* | SetterFunc) (const std::string &) |
Public Member Functions | |
int | GetId () const |
std::string | GetIp () const |
void | GetIpArray (uint8_t *ip) const |
uint16_t | GetPort () const |
uint8_t | GetFlag () const |
std::string | GetLocalIp () const |
uint16_t | GetLocalPort () const |
uint8_t | GetNatNeg () const |
std::string | GetGameName () const |
std::string | GetHostName () const |
uint16_t | GetHostPort () const |
std::string | GetGameVersion () const |
std::string | GetClientVersion () const |
std::string | GetRV () const |
std::string | GetMap () const |
uint8_t | GetMapCycling () const |
uint8_t | GetMapName () const |
uint8_t | GetGC () const |
std::string | GetGameType () const |
std::string | GetGameVariant () const |
uint8_t | GetNumPlayers () const |
uint8_t | GetMaxPlayers () const |
uint8_t | GetNumTeams () const |
std::string | GetGameMode () const |
uint8_t | GetTeamplay () const |
uint8_t | GetFlagLimit () const |
uint8_t | GetTeamFragLimit () const |
uint16_t | GetTimeLimit () const |
uint16_t | GetTimeElapsed () const |
uint8_t | GetPassword () const |
uint8_t | GetMinRank () const |
uint8_t | GetMaxRank () const |
uint8_t | GetFriendlyFire () const |
uint8_t | GetStatsTracking () const |
uint8_t | GetReconfigurable () const |
int64_t | GetMinIpRange () const |
int64_t | GetMaxIpRange () const |
uint8_t | GetQM () const |
uint64_t | GetRegion () const |
int | GetClan1Id () const |
int | GetClan2Id () const |
std::string | GetClan1Name () const |
std::string | GetClan2Name () const |
uint8_t | GetClan1Claimed () const |
uint8_t | GetClan2Claimed () const |
std::string | GetTeam1Name () const |
std::string | GetTeam2Name () const |
int16_t | GetTeam1Score () const |
int16_t | GetTeam2Score () const |
std::string | GetUpdatedAt () const |
bool | isVerified () const |
GameServerPlayers | GetPlayers () const |
bool | SetId (int id) |
bool | SetIp (const std::string &ip) |
bool | SetPort (uint16_t port) |
bool | SetFlag (uint8_t flag) |
bool | SetLocalIp (const std::string &localip) |
bool | SetLocalPort (uint16_t localport) |
bool | SetLocalPort (const std::string &str_localport) |
bool | SetNatNeg (uint8_t natneg) |
bool | SetNatNeg (const std::string &str_natneg) |
bool | SetGameName (const std::string &gamename) |
bool | SetHostName (const std::string &hostname) |
bool | SetHostPort (uint16_t hostport) |
bool | SetHostPort (const std::string &str_hostport) |
bool | SetGameVersion (const std::string &gamever) |
bool | SetClientVersion (const std::string &clientver) |
bool | SetRV (const std::string &rv) |
bool | SetMap (const std::string &map) |
bool | SetMapCycling (uint8_t mc) |
bool | SetMapCycling (const std::string &str_mc) |
bool | SetMapName (uint8_t mapname) |
bool | SetMapName (const std::string &str_mapname) |
bool | SetGC (uint8_t gc) |
bool | SetGC (const std::string &str_gc) |
bool | SetGameType (const std::string &gametype) |
bool | SetGameVariant (const std::string &gamevariant) |
bool | SetNumPlayers (uint8_t numplayers) |
bool | SetNumPlayers (const std::string &str_numplayers) |
bool | SetMaxPlayers (uint8_t maxplayers) |
bool | SetMaxPlayers (const std::string &str_maxplayers) |
bool | SetNumTeams (uint8_t numteams) |
bool | SetNumTeams (const std::string &str_numteams) |
bool | SetGameMode (const std::string &gamemode) |
bool | SetTeamplay (uint8_t teamplay) |
bool | SetTeamplay (const std::string &str_teamplay) |
bool | SetFlagLimit (uint8_t fraglimit) |
bool | SetFlagLimit (const std::string &str_fraglimit) |
bool | SetTeamFragLimit (uint8_t teamfraglimit) |
bool | SetTeamFragLimit (const std::string &str_teamfraglimit) |
bool | SetTimeLimit (uint16_t timelimit) |
bool | SetTimeLimit (const std::string &str_timelimit) |
bool | SetTimeElapsed (uint16_t timeelapsed) |
bool | SetTimeElapsed (const std::string &str_timeelapsed) |
bool | SetPassword (uint8_t password) |
bool | SetPassword (const std::string &str_password) |
bool | SetMinRank (uint8_t nr) |
bool | SetMinRank (const std::string &str_nr) |
bool | SetMaxRank (uint8_t xr) |
bool | SetMaxRank (const std::string &str_xr) |
bool | SetFriendlyFire (uint8_t ff) |
bool | SetFriendlyFire (const std::string &str_ff) |
bool | SetStatsTracking (uint8_t sr) |
bool | SetStatsTracking (const std::string &str_sr) |
bool | SetReconfigurable (uint8_t rc) |
bool | SetReconfigurable (const std::string &str_rc) |
bool | SetMinIpRange (int64_t ni) |
bool | SetMinIpRange (const std::string &str_ni) |
bool | SetMaxIpRange (int64_t xi) |
bool | SetMaxIpRange (const std::string &str_xi) |
bool | SetQM (uint8_t qm) |
bool | SetQM (const std::string &str_qm) |
bool | SetRegion (uint64_t region) |
bool | SetRegion (const std::string &str_region) |
bool | SetClan1Id (int c0) |
bool | SetClan1Id (const std::string &str_c0) |
bool | SetClan2Id (int c1) |
bool | SetClan2Id (const std::string &str_c1) |
bool | SetClan1Name (const std::string &n0) |
bool | SetClan2Name (const std::string &n1) |
bool | SetClan1Claimed (uint8_t c0c) |
bool | SetClan1Claimed (const std::string &str_c0c) |
bool | SetClan2Claimed (uint8_t c1c) |
bool | SetClan2Claimed (const std::string &str_c1c) |
bool | SetTeam1Name (const std::string &team0) |
bool | SetTeam2Name (const std::string &team1) |
bool | SetTeam1Score (int16_t score0) |
bool | SetTeam1Score (const std::string &str_score0) |
bool | SetTeam2Score (int16_t score1) |
bool | SetTeam2Score (const std::string &str_score1) |
bool | SetUpdatedAt (MYSQL_TIME updated_at) |
bool | SetVerified (bool verified) |
bool | SetVerified (uint8_t verified) |
void | AddPlayer (const GameServerPlayer &gsplayer) |
Adds a player to the game server. More... | |
bool | IsAlive () |
Checks if the game server is alive. More... | |
void | useExample () |
Performs an example operation using the GameServer class. More... | |
void | Debug () |
Static Public Attributes | |
static std::unordered_map< std::string, SetterFunc > | SetterMap |
Private Attributes | |
int | _id = -1 |
std::string | _ip = "" |
uint16_t | _port = 3658 |
uint8_t | _flag = 59 |
std::string | _localip0 = "" |
uint16_t | _localport = 3658 |
uint8_t | _natneg = 0 |
std::string | _gamename = "" |
std::string | _hostname = "" |
uint16_t | _hostport = 3658 |
std::string | _gamever = "V1.31a" |
std::string | _cl = "" |
std::string | _rv = "" |
std::string | _map = "" |
uint8_t | _mc = 0 |
uint8_t | _mapname = 0 |
uint8_t | _gc = 0 |
std::string | _gametype = "" |
std::string | _gamevariant = "" |
uint8_t | _numplayers = 0 |
uint8_t | _maxplayers = 0 |
uint8_t | _numteams = 0 |
std::string | _gamemode = "" |
uint8_t | _teamplay = 0 |
uint8_t | _fraglimit = 0 |
uint8_t | _teamfraglimit = 0 |
uint16_t | _timelimit = 0 |
uint16_t | _timeelapsed = 0 |
uint8_t | _password = 0 |
uint8_t | _nr = 0 |
uint8_t | _xr = 0 |
uint8_t | _ff = 0 |
uint8_t | _sr = 0 |
uint8_t | _rc = 0 |
int64_t | _ni = 0 |
int64_t | _xi = 0 |
uint8_t | _qm = 0 |
uint64_t | _region = 1 |
int | _c0 = -1 |
int | _c1 = -1 |
std::string | _n0 = "" |
std::string | _n1 = "" |
uint8_t | _c0c = 0 |
uint8_t | _c1c = 0 |
std::string | _team0 = "" |
std::string | _team1 = "" |
int16_t | _score0 = 0 |
int16_t | _score1 = 0 |
std::string | _updated_at = "" |
bool | _verified = false |
std::vector< GameServerPlayer > | _players |
Class representing game server information.
This class encapsulates information about a game server, including its region.
Definition at line 62 of file gameserver.h.
|
strong |
Enumeration defining the map cycling options.
Enumerator | |
---|---|
Unknown | Unknown map cycling option. |
LevelMapWithMapName | Level map with map name. |
AllMaps | All maps. |
AssaultMaps | Assault maps. |
IncursionMaps | Incursion maps. |
DominationMaps | Domination maps. |
Definition at line 85 of file gameserver.h.
|
strong |
Enumeration defining regions where a game server can be located.
This enumeration specifies the regions where a game server can be located, including America, Asia, Europe, and Unknown.
For more information, see: https://documentation.help/GameSpy-SDK/Gamespy%20Server%20Browsing%20SDK.html#Appendix-Region-Codes-and-Usage
Enumerator | |
---|---|
Unknown | Unknown region code |
America | America region code |
Asia | Asia region code |
Europe | Europe region code |
Definition at line 74 of file gameserver.h.
void Battlefield::GameServer::AddPlayer | ( | const GameServerPlayer & | gsplayer | ) |
Adds a player to the game server.
gsplayer | The GameServerPlayer object representing the player to add. |
Definition at line 763 of file gameserver.cpp.
bool Battlefield::GameServer::IsAlive | ( | ) |
Checks if the game server is alive.
This function determines the liveness of the game server based on its last update time. A game server is considered alive if its last update time is within the last two minutes.
The function calculates the difference between the server's last update time and the current time. If the difference is less than or equal to 0 (i.e., the server's last update time is in the past), and if the difference between the last update time and two minutes ago is greater than or equal to 0, then the server is considered alive.
Definition at line 768 of file gameserver.cpp.
void Battlefield::GameServer::useExample | ( | ) |
Performs an example operation using the GameServer class.
This member function demonstrates an example operation using the GameServer class. It serves as a placeholder for illustrating the usage of the GameServer class.
Definition at line 54 of file gameserver.cpp.
|
private |
Clan ID for team 1.
Definition at line 171 of file gameserver.h.
|
private |
Indicates if team 1 is claimed (1: true, 0: false).
Definition at line 175 of file gameserver.h.
|
private |
Clan ID for team 2.
Definition at line 172 of file gameserver.h.
|
private |
Indicates if team 2 is claimed (1: true, 0: false).
Definition at line 176 of file gameserver.h.
|
private |
Client version.
Definition at line 110 of file gameserver.h.
|
private |
Friendly fire (1: true, 0: false).
Definition at line 155 of file gameserver.h.
|
private |
Flag indicating server information.
Definition at line 99 of file gameserver.h.
|
private |
Number of kills or points for level change or game restart.
Definition at line 148 of file gameserver.h.
|
private |
Game status:
Definition at line 139 of file gameserver.h.
|
private |
Name of the game.
Definition at line 105 of file gameserver.h.
|
private |
String which specifies the type of game or the mod being played.
Definition at line 123 of file gameserver.h.
|
private |
Game variant or code name.
Definition at line 125 of file gameserver.h.
|
private |
Version of the game.
Definition at line 109 of file gameserver.h.
|
private |
Game type.
Definition at line 117 of file gameserver.h.
|
private |
Host name of the game server.
Definition at line 106 of file gameserver.h.
|
private |
Host port number of the game server.
Definition at line 107 of file gameserver.h.
|
private |
Unique identifier for the game server.
Definition at line 96 of file gameserver.h.
|
private |
IP address of the game server.
Definition at line 97 of file gameserver.h.
|
private |
Local IP address of the game server.
Definition at line 102 of file gameserver.h.
|
private |
Local port number of the game server.
Definition at line 103 of file gameserver.h.
|
private |
Name of the current map.
Definition at line 113 of file gameserver.h.
|
private |
Map ID.
Definition at line 115 of file gameserver.h.
|
private |
Maximum number of players.
Definition at line 127 of file gameserver.h.
|
private |
Map cycling option. See MapCyclingOptions enum for available options.
Definition at line 114 of file gameserver.h.
|
private |
Clan name for team 1.
Definition at line 173 of file gameserver.h.
|
private |
Clan name for team 2.
Definition at line 174 of file gameserver.h.
|
private |
Enable client-to-client connections (1: true, 0: false).
Definition at line 104 of file gameserver.h.
|
private |
Minimum IP range.
Definition at line 158 of file gameserver.h.
|
private |
Minimum rank number filter.
Definition at line 153 of file gameserver.h.
|
private |
Number of players.
Definition at line 126 of file gameserver.h.
|
private |
Number of teams.
Definition at line 128 of file gameserver.h.
|
private |
Password requirement to join (1: true, 0: false).
Definition at line 152 of file gameserver.h.
|
private |
Vector containing information about players currently in the server.
Definition at line 187 of file gameserver.h.
|
private |
Port number of the game server.
Definition at line 98 of file gameserver.h.
|
private |
Server status:
Definition at line 166 of file gameserver.h.
|
private |
Server is reconfigurable (1: true, 0: false).
Definition at line 157 of file gameserver.h.
|
private |
Server region. See Battlefield::GameServer::Regions enum for possible values.
Definition at line 168 of file gameserver.h.
|
private |
Retail version.
Definition at line 111 of file gameserver.h.
|
private |
Score of team 1.
Definition at line 181 of file gameserver.h.
|
private |
Score of team 2.
Definition at line 182 of file gameserver.h.
|
private |
Stats tracking (1: true, 0: false).
Definition at line 156 of file gameserver.h.
|
private |
Name of team 1.
Definition at line 179 of file gameserver.h.
|
private |
Name of team 2.
Definition at line 180 of file gameserver.h.
|
private |
Number of team kills or points for level change or game restart.
Definition at line 149 of file gameserver.h.
|
private |
Type of teamplay in use, or 0 for no teamplay.
Definition at line 146 of file gameserver.h.
|
private |
Time elapsed since current level or game started (in seconds).
Definition at line 151 of file gameserver.h.
|
private |
Total time before level change or game restart (in seconds).
Definition at line 150 of file gameserver.h.
|
private |
Datetime when server information was last updated.
Definition at line 184 of file gameserver.h.
|
private |
Indicates whether the server is verified in the database.
Definition at line 185 of file gameserver.h.
|
private |
Maximum IP range.
Definition at line 159 of file gameserver.h.
|
private |
Maximum rank number filter.
Definition at line 154 of file gameserver.h.