|
UFO: Alien Invasion
|
Serverlist management for multiplayer. More...
#include "../../cl_shared.h"#include "../cl_game.h"#include "../../../shared/parse.h"#include "../../ui/ui_data.h"#include "../../../shared/infostring.h"#include "mp_serverlist.h"#include "mp_callbacks.h"
Go to the source code of this file.
Macros | |
| #define | MAX_SERVERLIST 128 |
| #define | SERVERQUERYTIMEOUT 40000 |
Enumerations | |
| enum | serverListStatus_t { SERVERLIST_SHOWALL , SERVERLIST_HIDEFULL , SERVERLIST_HIDEEMPTY } |
Functions | |
| static bool | GAME_MP_ProcessPingReply (serverList_t *server, const char *msg) |
| Parsed the server ping response. | |
| static bool | GAME_MP_ShowServer (const serverList_t *server) |
| Perform the server filtering. | |
| static void | GAME_MP_PingServerCallback (struct net_stream *s) |
| static void | GAME_MP_PingServer (serverList_t *server) |
| Pings all servers in serverList. | |
| static void | GAME_MP_PrintServerList_f (void) |
| Prints all the servers on the list to game console. | |
| static void | GAME_MP_AddServerToList (const char *node, const char *service) |
| Adds a server to the serverlist cache. | |
| void | GAME_MP_ParseTeamInfoMessage (dbuffer *msg) |
| Team selection text. | |
| static void | GAME_MP_ParseServerInfoMessage (dbuffer *msg, const char *hostname) |
| Serverbrowser text. | |
| static void | GAME_MP_ServerInfoCallback (struct net_stream *s) |
| static void | GAME_MP_QueryMasterServerThread (const char *responseBuf, void *userdata) |
| static void | GAME_MP_ServerListDiscoveryCallback (struct datagram_socket *s, const char *buf, int len, struct sockaddr *from) |
| static void | GAME_MP_BookmarkAdd_f (void) |
| Add a new bookmark. | |
| static void | GAME_MP_ServerInfo_f (void) |
| static void | GAME_MP_ServerListClick_f (void) |
| Callback for bookmark nodes in multiplayer menu (mp_bookmarks). | |
| void | GAME_MP_PingServers_f (void) |
| The first function called when entering the multiplayer menu, then CL_Frame takes over. | |
| void | GAME_MP_ServerListInit (const cgame_import_t *import) |
| void | GAME_MP_ServerListShutdown (void) |
Variables | |
| static const cgame_import_t * | cgi |
| static serverList_t | serverList [MAX_SERVERLIST] |
| serverList_t * | selectedServer |
| static char | serverText [1024] |
| static int | serverListLength |
| static int | serverListPos |
| static cvar_t * | cl_serverlist |
| static struct datagram_socket * | netDatagramSocket |
| static char | serverInfoText [1024] |
| static char | userInfoText [256] |
| static bool | serversAlreadyQueried = false |
| static int | lastServerQuery = 0 |
| static const cmdList_t | serverListCmds [] |
Serverlist management for multiplayer.
Definition in file mp_serverlist.cpp.
| #define MAX_SERVERLIST 128 |
Definition at line 34 of file mp_serverlist.cpp.
Referenced by GAME_MP_AddServerToList(), and GAME_MP_QueryMasterServerThread().
| #define SERVERQUERYTIMEOUT 40000 |
ms until the server query timed out
Definition at line 524 of file mp_serverlist.cpp.
Referenced by GAME_MP_PingServers_f().
| enum serverListStatus_t |
| Enumerator | |
|---|---|
| SERVERLIST_SHOWALL | |
| SERVERLIST_HIDEFULL | |
| SERVERLIST_HIDEEMPTY | |
Definition at line 86 of file mp_serverlist.cpp.
|
static |
Adds a server to the serverlist cache.
Definition at line 184 of file mp_serverlist.cpp.
References cgi, GAME_MP_PingServer(), i, MAX_SERVERLIST, OBJZERO, Q_streq, serverList, and serverListLength.
Referenced by GAME_MP_QueryMasterServerThread(), and GAME_MP_ServerListDiscoveryCallback().
Add a new bookmark.
bookmarks are saved in cvar adr[0-15]
Definition at line 433 of file mp_serverlist.cpp.
References _, cgi, i, MAX_BOOKMARKS, and va().
Serverbrowser text.
Definition at line 275 of file mp_serverlist.cpp.
References _, cgi, Com_Parse(), Com_sprintf(), DEBUG_CLIENT, Info_BoolForKey(), Info_ValueForKey(), MAX_INFO_STRING, Q_strcat(), Q_strncpyz(), Q_strnull(), S_COLOR_GREEN, serverInfoText, TEXT_LIST, TEXT_STANDARD, and userInfoText.
Referenced by GAME_MP_ServerInfoCallback().
Team selection text.
This function fills the multiplayer_selectteam menu with content
Definition at line 208 of file mp_serverlist.cpp.
References _, cgi, DEBUG_CLIENT, Info_IntegerForKey(), Info_ValueForKey(), MAX_TEAMS, OBJZERO, TEAM_NO_ACTIVE, teamData, TEXT_MULTIPLAYER_USERLIST, TEXT_MULTIPLAYER_USERTEAM, user, and va().
Referenced by GAME_MP_HandleServerCommand().
|
static |
Pings all servers in serverList.
Definition at line 153 of file mp_serverlist.cpp.
References cgi, DEBUG_CLIENT, GAME_MP_PingServerCallback(), serverList_t::node, PROTOCOL_VERSION, serverList_t::service, and SV_CMD_INFO.
Referenced by GAME_MP_AddServerToList().
|
static |
Definition at line 109 of file mp_serverlist.cpp.
References cgi, serverList_t::clients, DEBUG_CLIENT, GAME_MP_ProcessPingReply(), GAME_MP_ShowServer(), serverList_t::gametype, serverList_t::mapname, Q_strcat(), serverList_t::serverListPos, serverListPos, serverText, serverList_t::sv_hostname, serverList_t::sv_maxclients, and svc_oob.
Referenced by GAME_MP_PingServer().
The first function called when entering the multiplayer menu, then CL_Frame takes over.
Definition at line 531 of file mp_serverlist.cpp.
References cgi, DEBUG_CLIENT, DOUBLEQUOTE, GAME_MP_QueryMasterServerThread(), GAME_MP_ServerListDiscoveryCallback(), i, lastServerQuery, netDatagramSocket, OBJZERO, PORT_CLIENT, PORT_SERVER, Q_streq, selectedServer, serverList, serverListLength, serverListPos, SERVERQUERYTIMEOUT, serversAlreadyQueried, serverText, and TEXT_LIST.
Prints all the servers on the list to game console.
Definition at line 169 of file mp_serverlist.cpp.
References cgi, i, serverList_t::node, serverList_t::pinged, serverList, serverListLength, and serverList_t::service.
|
static |
Parsed the server ping response.
| [out] | server | The server data to store the parsed information in |
| [in] | msg | The ping response with the server information to parse |
true if the server is compatible, msg is not null and the server wasn't pinged already, false otherwise Definition at line 55 of file mp_serverlist.cpp.
References serverList_t::clients, Com_DPrintf(), DEBUG_CLIENT, serverList_t::gametype, Info_IntegerForKey(), Info_ValueForKey(), serverList_t::mapname, serverList_t::pinged, PROTOCOL_VERSION, Q_streq, Q_strncpyz(), serverList_t::sv_dedicated, serverList_t::sv_hostname, serverList_t::sv_maxclients, UFO_VERSION, and serverList_t::version.
Referenced by GAME_MP_PingServerCallback().
Definition at line 376 of file mp_serverlist.cpp.
References cgi, Com_DPrintf(), Com_Parse(), DEBUG_CLIENT, GAME_MP_AddServerToList(), i, MAX_SERVERLIST, MAX_VAR, and Q_strncpyz().
Referenced by GAME_MP_PingServers_f().
Definition at line 461 of file mp_serverlist.cpp.
References cgi, DOUBLEQUOTE, GAME_MP_ServerInfoCallback(), port, PORT_SERVER, PROTOCOL_VERSION, selectedServer, and SV_CMD_STATUS.
|
static |
Definition at line 354 of file mp_serverlist.cpp.
References cgi, GAME_MP_ParseServerInfoMessage(), Q_streq, and svc_oob.
Referenced by GAME_MP_ServerInfo_f().
Callback for bookmark nodes in multiplayer menu (mp_bookmarks).
Definition at line 498 of file mp_serverlist.cpp.
References cgi, i, selectedServer, serverInfoText, serverList, serverListLength, serverListPos, and TEXT_STANDARD.
|
static |
Definition at line 417 of file mp_serverlist.cpp.
References cgi, GAME_MP_AddServerToList(), len, and MAX_VAR.
Referenced by GAME_MP_PingServers_f().
| void GAME_MP_ServerListInit | ( | const cgame_import_t * | import | ) |
Definition at line 586 of file mp_serverlist.cpp.
References cgi, cl_serverlist, CVAR_ARCHIVE, i, MAX_BOOKMARKS, serverListCmds, and va().
Referenced by GAME_MP_InitStartup().
Definition at line 597 of file mp_serverlist.cpp.
References cgi, netDatagramSocket, and serverListCmds.
Referenced by GAME_MP_Shutdown().
|
inlinestatic |
Perform the server filtering.
| [in] | server | The server data |
true if the server should be visible for the current filter settings, false otherwise Definition at line 97 of file mp_serverlist.cpp.
References cl_serverlist, serverList_t::clients, SERVERLIST_HIDEEMPTY, SERVERLIST_HIDEFULL, SERVERLIST_SHOWALL, and serverList_t::sv_maxclients.
Referenced by GAME_MP_PingServerCallback().
|
static |
Definition at line 36 of file mp_serverlist.cpp.
|
static |
Definition at line 43 of file mp_serverlist.cpp.
Referenced by GAME_MP_ServerListInit(), and GAME_MP_ShowServer().
|
static |
Definition at line 522 of file mp_serverlist.cpp.
Referenced by GAME_MP_PingServers_f().
|
static |
Definition at line 44 of file mp_serverlist.cpp.
Referenced by GAME_MP_PingServers_f(), and GAME_MP_ServerListShutdown().
| serverList_t* selectedServer |
Definition at line 39 of file mp_serverlist.cpp.
Referenced by GAME_MP_Connect_f(), GAME_MP_PingServers_f(), GAME_MP_ServerInfo_f(), and GAME_MP_ServerListClick_f().
|
static |
Definition at line 264 of file mp_serverlist.cpp.
Referenced by GAME_MP_ParseServerInfoMessage(), and GAME_MP_ServerListClick_f().
|
static |
Definition at line 38 of file mp_serverlist.cpp.
Referenced by GAME_MP_AddServerToList(), GAME_MP_PingServers_f(), GAME_MP_PrintServerList_f(), and GAME_MP_ServerListClick_f().
|
static |
Definition at line 578 of file mp_serverlist.cpp.
Referenced by GAME_MP_ServerListInit(), and GAME_MP_ServerListShutdown().
|
static |
Definition at line 41 of file mp_serverlist.cpp.
Referenced by GAME_MP_AddServerToList(), GAME_MP_PingServers_f(), GAME_MP_PrintServerList_f(), and GAME_MP_ServerListClick_f().
|
static |
Definition at line 42 of file mp_serverlist.cpp.
Referenced by GAME_MP_PingServerCallback(), GAME_MP_PingServers_f(), and GAME_MP_ServerListClick_f().
|
static |
this is true if pingservers was already executed
Definition at line 521 of file mp_serverlist.cpp.
Referenced by GAME_MP_PingServers_f().
|
static |
Definition at line 40 of file mp_serverlist.cpp.
Referenced by GAME_MP_PingServerCallback(), and GAME_MP_PingServers_f().
|
static |
Definition at line 265 of file mp_serverlist.cpp.
Referenced by GAME_MP_ParseServerInfoMessage().