Quake II RTX doxygen
1.0 dev
|
|
#include "ui.h"
#include "common/files.h"
#include "common/net/net.h"
#include "client/video.h"
#include "system/system.h"
Go to the source code of this file.
|
static void | UpdateSelection (void) |
|
static void | UpdateStatus (void) |
|
static void | FreeSlot (serverslot_t *slot) |
|
static serverslot_t * | FindSlot (const netadr_t *search, int *index_p) |
|
static uint32_t | ColorForStatus (const serverStatus_t *status) |
|
void | UI_StatusEvent (const serverStatus_t *status) |
|
void | UI_ErrorEvent (netadr_t *from) |
|
static menuSound_t | SetRconAddress (void) |
|
static menuSound_t | CopyAddress (void) |
|
static menuSound_t | PingSelected (void) |
|
static void | AddServer (const netadr_t *address, const char *hostname) |
|
static void | ParsePlain (void *data, size_t len, size_t chunk) |
|
static void | ParseBinary (void *data, size_t len, size_t chunk) |
|
static void | ParseAddressBook (void) |
|
static void | ParseMasterArgs (netadr_t *broadcast) |
|
static void | ClearServers (void) |
|
static void | FinishPingStage (void) |
|
static void | CalcPingRate (void) |
|
void | UI_Frame (int msec) |
|
static void | PingServers (void) |
|
static int | statuscmp (serverslot_t *s1, serverslot_t *s2) |
|
static int | namecmp (serverslot_t *s1, serverslot_t *s2, int col) |
|
static int | pingcmp (serverslot_t *s1, serverslot_t *s2) |
|
static int | playercmp (serverslot_t *s1, serverslot_t *s2) |
|
static int | addresscmp (serverslot_t *s1, serverslot_t *s2) |
|
static int | slotcmp (const void *p1, const void *p2) |
|
static menuSound_t | Sort (menuList_t *self) |
|
static void | ui_sortservers_changed (cvar_t *self) |
|
static menuSound_t | Connect (menuCommon_t *self) |
|
static menuSound_t | Change (menuCommon_t *self) |
|
static void | SizeCompact (void) |
|
static void | SizeFull (void) |
|
static void | Size (menuFrameWork_t *self) |
|
static menuSound_t | Keydown (menuFrameWork_t *self, int key) |
|
static void | DrawStatus (void) |
|
static void | Draw (menuFrameWork_t *self) |
|
static qboolean | Push (menuFrameWork_t *self) |
|
static void | Pop (menuFrameWork_t *self) |
|
static void | Expose (menuFrameWork_t *self) |
|
static void | Free (menuFrameWork_t *self) |
|
static void | ui_colorservers_changed (cvar_t *self) |
|
void | M_Menu_Servers (void) |
|
◆ COL_MAP
◆ COL_MAX
◆ COL_MOD
◆ COL_NAME
◆ COL_PLAYERS
◆ COL_RTT
◆ MAX_STATUS_RULES
#define MAX_STATUS_RULES 64 |
◆ MAX_STATUS_SERVERS
#define MAX_STATUS_SERVERS 1024 |
◆ PING_STAGES
◆ SLOT_EXTRASIZE
◆ addresscmp()
◆ AddServer()
static void AddServer |
( |
const netadr_t * |
address, |
|
|
const char * |
hostname |
|
) |
| |
|
static |
◆ CalcPingRate()
◆ Change()
◆ ClearServers()
◆ ColorForStatus()
static uint32_t ColorForStatus |
( |
const serverStatus_t * |
status | ) |
|
|
static |
◆ Connect()
◆ CopyAddress()
◆ Draw()
◆ DrawStatus()
◆ Expose()
◆ FindSlot()
◆ FinishPingStage()
◆ Free()
◆ FreeSlot()
◆ Keydown()
◆ M_Menu_Servers()
◆ namecmp()
◆ ParseAddressBook()
◆ ParseBinary()
static void ParseBinary |
( |
void * |
data, |
|
|
size_t |
len, |
|
|
size_t |
chunk |
|
) |
| |
|
static |
Definition at line 503 of file servers.c.
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);
Referenced by ParseMasterArgs().
◆ ParseMasterArgs()
static void ParseMasterArgs |
( |
netadr_t * |
broadcast | ) |
|
|
static |
Definition at line 540 of file servers.c.
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);
Referenced by PingServers().
◆ ParsePlain()
static void ParsePlain |
( |
void * |
data, |
|
|
size_t |
len, |
|
|
size_t |
chunk |
|
) |
| |
|
static |
◆ pingcmp()
◆ PingSelected()
Definition at line 396 of file servers.c.
413 "???",
"???",
"?/?",
"???", NULL);
414 slot->
status = SLOT_PENDING;
417 slot->
color = U32_WHITE;
427 CL_SendStatusRequest(&slot->
address);
Referenced by Keydown().
◆ PingServers()
Definition at line 714 of file servers.c.
729 memset(&broadcast, 0,
sizeof(broadcast));
736 CL_SendStatusRequest(&broadcast);
Referenced by Expose(), and Keydown().
◆ playercmp()
◆ Pop()
◆ Push()
◆ SetRconAddress()
◆ Size()
◆ SizeCompact()
◆ SizeFull()
◆ slotcmp()
static int slotcmp |
( |
const void * |
p1, |
|
|
const void * |
p2 |
|
) |
| |
|
static |
◆ Sort()
◆ statuscmp()
◆ ui_colorservers_changed()
static void ui_colorservers_changed |
( |
cvar_t * |
self | ) |
|
|
static |
◆ UI_ErrorEvent()
void UI_ErrorEvent |
( |
netadr_t * |
from | ) |
|
Definition at line 319 of file servers.c.
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;
◆ UI_Frame()
◆ ui_sortservers_changed()
static void ui_sortservers_changed |
( |
cvar_t * |
self | ) |
|
|
static |
◆ UI_StatusEvent()
void UI_StatusEvent |
( |
const serverStatus_t * |
status | ) |
|
Definition at line 206 of file servers.c.
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,
Referenced by CL_ParsePrintMessage().
◆ UpdateSelection()
◆ UpdateStatus()
Definition at line 134 of file servers.c.
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");
Referenced by PingSelected(), PingServers(), and UI_StatusEvent().
◆ m_servers
Definition at line 82 of file servers.c.
Referenced by AddServer(), CalcPingRate(), ClearServers(), Connect(), CopyAddress(), DrawStatus(), FindSlot(), FinishPingStage(), Free(), Keydown(), M_Menu_Servers(), namecmp(), ParseMasterArgs(), pingcmp(), PingSelected(), PingServers(), playercmp(), Pop(), Push(), SetRconAddress(), SizeCompact(), SizeFull(), slotcmp(), Sort(), ui_colorservers_changed(), UI_ErrorEvent(), UI_Frame(), ui_sortservers_changed(), UI_StatusEvent(), UpdateSelection(), and UpdateStatus().
◆ ui_colorservers
◆ ui_pingrate
◆ ui_sortservers
static void ui_sortservers_changed(cvar_t *self)
cvar_t * Cvar_Set(const char *var_name, const char *value)
enum serverslot_t::@8 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)
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)
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)