Quake II RTX doxygen
1.0 dev
|
|
Go to the documentation of this file.
20 #include "common/files.h"
21 #include "common/net/net.h"
22 #include "client/video.h"
23 #include "system/system.h"
33 #define MAX_STATUS_RULES 64
34 #define MAX_STATUS_SERVERS 1024
36 #define SLOT_EXTRASIZE q_offsetof(serverslot_t, name)
60 char *players[MAX_STATUS_PLAYERS];
95 if (s->
status == SLOT_VALID) {
137 int i, totalplayers = 0, totalservers = 0;
141 if (slot->
status == SLOT_VALID) {
148 "%d player%s on %d server%s",
149 totalplayers, totalplayers == 1 ?
"" :
"s",
150 totalservers, totalservers == 1 ?
"" :
"s");
158 for (i = 0; i < slot->
numRules; i++)
172 if (!NET_IsEqualBaseAdr(search, &slot->
address))
174 if (search->port && search->port != slot->
address.port)
193 if (Q_stricmp(
Info_ValueForKey(status->infostring,
"NoFake"),
"ENABLED") == 0)
209 char *hostname, *host, *mod, *map, *
maxclients;
210 unsigned timestamp, ping;
211 const char *info = status->infostring;
212 char key[MAX_INFO_STRING];
213 char value[MAX_INFO_STRING];
269 slot->
status = SLOT_VALID;
283 strcpy(key,
"<MISSING KEY>");
286 strcpy(value,
"<MISSING VALUE>");
293 for (i = 0; i < status->numPlayers; i++) {
296 va(
"%d", status->players[i].score),
297 va(
"%d", status->players[i].ping),
298 status->players[i].name,
324 unsigned timestamp, ping;
336 if (slot->
status != SLOT_PENDING)
352 "???",
"???",
"down",
va(
"%u", ping), NULL);
353 slot->
status = SLOT_ERROR;
356 slot->
color = U32_WHITE;
374 if (slot->
status == SLOT_ERROR)
413 "???",
"???",
"?/?",
"???", NULL);
414 slot->
status = SLOT_PENDING;
417 slot->
color = U32_WHITE;
427 CL_SendStatusRequest(&slot->
address);
431 static void AddServer(
const netadr_t *address,
const char *hostname)
445 Com_Printf(
"Bad server address: %s\n", hostname);
460 if (BigShort(address->port) < 1024) {
461 Com_Printf(
"Bad server port: %s\n", hostname);
466 "???",
"???",
"?/?",
"???", NULL);
470 slot->
color = U32_WHITE;
487 p = strchr(list,
'\n');
489 if (p > list && *(p - 1) ==
'\r')
511 memset(&address, 0,
sizeof(address));
512 address.type = NA_IP;
515 while (len >= chunk) {
516 memcpy(address.ip.u8, ptr, 4);
517 memcpy(&address.port, ptr + 4, 2);
544 void (*parse)(
void *, size_t, size_t);
555 broadcast->type = NA_BROADCAST;
556 broadcast->port = BigShort(PORT_SERVER);
560 for (i = 0; i < argc; i++) {
568 if (*s ==
'+' || *s ==
'-') {
570 chunk = strtoul(s, &p, 10);
581 if (!strncmp(s,
"file://", 7)) {
582 len = FS_LoadFile(s + 7, &data);
585 (*parse)(data, len, chunk);
590 if (!strncmp(s,
"http://", 7)) {
592 len = HTTP_FetchFile(s + 7, &data);
595 (*parse)(data, len, chunk);
598 Com_Printf(
"Can't fetch '%s', no HTTP support compiled in.\n", s);
603 if (!strncmp(s,
"favorites://", 12)) {
608 if (!strncmp(s,
"broadcast://", 12)) {
609 broadcast->type = NA_BROADCAST;
610 broadcast->port = BigShort(PORT_SERVER);
614 if (!strncmp(s,
"quake2://", 9)) {
620 Com_Printf(
"Ignoring invalid master URL: %s\n", s);
697 if (slot->
status > SLOT_PENDING)
699 slot->
status = SLOT_PENDING;
701 CL_SendStatusRequest(&slot->
address);
729 memset(&broadcast, 0,
sizeof(broadcast));
736 CL_SendStatusRequest(&broadcast);
754 if (s1->
status != SLOT_VALID && s2->
status == SLOT_VALID)
756 if (s2->
status != SLOT_VALID && s1->
status == SLOT_VALID)
795 static int slotcmp(
const void *p1,
const void *p2)
873 if (slot->
status == SLOT_ERROR)
1026 if (slot->
status > SLOT_PENDING) {
static void ui_sortservers_changed(cvar_t *self)
cvar_t * Cvar_Set(const char *var_name, const char *value)
enum serverslot_t::@8 status
void UI_StatusEvent(const serverStatus_t *status)
char * NET_AdrToString(const netadr_t *a)
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
static void FinishPingStage(void)
static void DrawStatus(void)
static void Free(menuFrameWork_t *self)
static menuSound_t CopyAddress(void)
void S_StopAllSounds(void)
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
static void Pop(menuFrameWork_t *self)
void SCR_UpdateScreen(void)
static void Expose(menuFrameWork_t *self)
static void ui_colorservers_changed(cvar_t *self)
static cvar_t * ui_colorservers
static int slotcmp(const void *p1, const void *p2)
static void ParseMasterArgs(netadr_t *broadcast)
static void FreeSlot(serverslot_t *slot)
static qboolean Push(menuFrameWork_t *self)
void(* R_DrawFill8)(int x, int y, int w, int h, int c)
char * UI_GetColumn(char *s, int n)
void Cmd_TokenizeString(const char *text, qboolean macroExpand)
void UI_ErrorEvent(netadr_t *from)
static void ClearServers(void)
char * Cmd_RawArgsFrom(int from)
void * UI_FormatColumns(int extrasize,...)
static void AddServer(const netadr_t *address, const char *hostname)
unsigned Sys_Milliseconds(void)
static int addresscmp(serverslot_t *s1, serverslot_t *s2)
char * rules[MAX_STATUS_RULES]
static void SizeCompact(void)
#define MLIST_SCROLLBAR_WIDTH
static void ParseBinary(void *data, size_t len, size_t chunk)
static void PingServers(void)
void Cbuf_AddText(cmdbuf_t *buf, const char *text)
char * Info_ValueForKey(const char *s, const char *key)
char * va(const char *format,...)
static void Draw(menuFrameWork_t *self)
static menuSound_t Change(menuCommon_t *self)
void UI_DrawString(int x, int y, int flags, const char *string)
void M_Menu_Servers(void)
static int statuscmp(serverslot_t *s1, serverslot_t *s2)
qboolean NET_StringToAdr(const char *s, netadr_t *a, int default_port)
static menuSound_t SetRconAddress(void)
void(APIENTRY *qwglDrawBuffer)(GLenum mode)
static menuSound_t Keydown(menuFrameWork_t *self, int key)
qboolean COM_IsWhite(const char *s)
qboolean COM_IsUint(const char *s)
static m_servers_t m_servers
static void ParsePlain(void *data, size_t len, size_t chunk)
struct uiStatic_s::@9 color
static int playercmp(serverslot_t *s1, serverslot_t *s2)
void * names[MAX_STATUS_SERVERS]
static void Size(menuFrameWork_t *self)
static int namecmp(serverslot_t *s1, serverslot_t *s2, int col)
static void UpdateStatus(void)
int Cvar_ClampInteger(cvar_t *var, int min, int max)
static serverslot_t * FindSlot(const netadr_t *search, int *index_p)
static cvar_t * ui_sortservers
char * players[MAX_STATUS_PLAYERS]
static cvar_t * ui_pingrate
#define MAX_STATUS_SERVERS
static void UpdateSelection(void)
qhandle_t backgroundHandle
static void ParseAddressBook(void)
void VID_SetClipboardData(const char *data)
cvar_t * Cvar_FindVar(const char *var_name)
static uint32_t ColorForStatus(const serverStatus_t *status)
void Info_NextPair(const char **string, char *key, char *value)
static menuSound_t Sort(menuList_t *self)
static void SizeFull(void)
static menuSound_t Connect(menuCommon_t *self)
static void CalcPingRate(void)
static int pingcmp(serverslot_t *s1, serverslot_t *s2)
static menuSound_t PingSelected(void)