![]() |
DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
|
|
#include "quakedef.h"
#include "thread.h"
#include "lhnet.h"
#include "hmac.h"
#include "mdfour.h"
#include <time.h>
Go to the source code of this file.
Macros | |
#define | DPMASTER_COUNT sizeof(sv_masters) / sizeof(cvar_t) |
#define | DPMASTER_PORT 27950 |
#define | QWMASTER_COUNT sizeof(sv_qwmasters) / sizeof(cvar_t) |
#define | QWMASTER_PORT 27000 |
Typedefs | |
typedef qbool(* | rcon_matchfunc_t) (lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen) |
Functions | |
static qbool | hmac_mdfour_challenge_matching (lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen) |
static qbool | hmac_mdfour_time_matching (lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen) |
static void | Net_Heartbeat_f (cmd_state_t *cmd) |
void | Net_Stats_f (cmd_state_t *cmd) |
static int | NetConn_AddCryptoFlag (crypto_t *crypto) |
static void | NetConn_BuildChallengeString (char *buffer, int bufferlength) |
static qbool | NetConn_BuildStatusResponse (const char *challenge, char *out_msg, size_t out_size, qbool fullstatus) |
(div0) build the full response only if possible; better a getinfo response than no response at all if getstatus won't fit | |
qbool | NetConn_CanSend (netconn_t *conn) |
lhnetsocket_t * | NetConn_ChooseClientSocketForAddress (lhnetaddress_t *address) |
lhnetsocket_t * | NetConn_ChooseServerSocketForAddress (lhnetaddress_t *address) |
static void | NetConn_CL_UpdateSockets_Callback (cvar_t *var) |
void | NetConn_ClearFlood (lhnetaddress_t *peeraddress, server_floodaddress_t *floodlist, size_t floodlength) |
void | NetConn_ClientFrame (void) |
static int | NetConn_ClientParsePacket (lhnetsocket_t *mysocket, unsigned char *data, int length, lhnetaddress_t *peeraddress) |
void | NetConn_Close (netconn_t *conn) |
void | NetConn_CloseClientPorts (void) |
void | NetConn_CloseServerPorts (void) |
static void | NetConn_ConnectionEstablished (lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress, protocolversion_t initialprotocol) |
qbool | NetConn_HaveClientPorts (void) |
qbool | NetConn_HaveServerPorts (void) |
void | NetConn_Heartbeat (int priority) |
void | NetConn_Init (void) |
int | NetConn_IsLocalGame (void) |
netconn_t * | NetConn_Open (lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress) |
static void | NetConn_OpenClientPort (const char *addressstring, lhnetaddresstype_t addresstype, int defaultport) |
void | NetConn_OpenClientPorts (void) |
static qbool | NetConn_OpenServerPort (const char *addressstring, lhnetaddresstype_t addresstype, int defaultport, int range) |
void | NetConn_OpenServerPorts (int opennetports) |
static qbool | NetConn_PreventFlood (lhnetaddress_t *peeraddress, server_floodaddress_t *floodlist, size_t floodlength, double floodtime, qbool renew) |
int | NetConn_Read (lhnetsocket_t *mysocket, void *data, int maxlength, lhnetaddress_t *peeraddress) |
static int | NetConn_ReceivedMessage (netconn_t *conn, const unsigned char *data, size_t length, protocolversion_t protocol, double newtimeout) |
int | NetConn_SendUnreliableMessage (netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, int burstsize, qbool quakesignon_suppressreliables) |
void | NetConn_ServerFrame (void) |
static int | NetConn_ServerParsePacket (lhnetsocket_t *mysocket, unsigned char *data, int length, lhnetaddress_t *peeraddress) |
void | NetConn_Shutdown (void) |
static void | NetConn_sv_netport_Callback (cvar_t *var) |
static void | NetConn_UpdateCleartime (double *cleartime, int rate, int burstsize, int len) |
void | NetConn_UpdateSockets (void) |
int | NetConn_Write (lhnetsocket_t *mysocket, const void *data, int length, const lhnetaddress_t *peeraddress) |
int | NetConn_WriteString (lhnetsocket_t *mysocket, const char *string, const lhnetaddress_t *peeraddress) |
static qbool | plaintext_matching (lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen) |
static void | PrintStats (netconn_t *conn) |
static const char * | RCon_Authenticate (lhnetaddress_t *peeraddress, const char *password, const char *s, const char *endpos, rcon_matchfunc_t comparator, const char *cs, int cslen) |
returns a string describing the user level, or NULL for auth failure | |
static void | RCon_Execute (lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress, const char *addressstring2, const char *userlevel, const char *s, const char *endpos, qbool proquakeprotocol) |
Variables | |
challenge_t | challenges [MAX_CHALLENGES] |
sizebuf_t | cl_message |
static unsigned char | cl_message_buf [NET_MAXMESSAGE] |
char | cl_net_extresponse [NET_EXTRESPONSE_MAX][1400] |
unsigned | cl_net_extresponse_count = 0 |
unsigned | cl_net_extresponse_last = 0 |
cvar_t | cl_netport = {CF_CLIENT, "cl_port", "0", "forces client to use chosen port number if not 0"} |
static unsigned | cl_numsockets |
char | cl_readstring [MAX_INPUTLINE] |
static lhnetsocket_t * | cl_sockets [16] |
static int | clientport = -1 |
static int | clientport2 = -1 |
cvar_t | developer_networking = {CF_CLIENT | CF_SERVER, "developer_networking", "0", "prints all received and sent packets (recommended only for debugging)"} |
static cvar_t | gameversion = {CF_SERVER, "gameversion", "0", "version of game data (mod-specific) to be sent to querying clients"} |
static cvar_t | gameversion_max = {CF_CLIENT | CF_SERVER, "gameversion_max", "-1", "maximum version of game data (mod-specific), when client and server gameversion mismatch in the server browser the server is shown as incompatible; if -1, gameversion is used alone"} |
static cvar_t | gameversion_min = {CF_CLIENT | CF_SERVER, "gameversion_min", "-1", "minimum version of game data (mod-specific), when client and server gameversion mismatch in the server browser the server is shown as incompatible; if -1, gameversion is used alone"} |
cvar_t | hostname = {CF_SERVER | CF_ARCHIVE, "hostname", "UNNAMED", "server message to show in server browser"} |
static int | hostport = -1 |
unsigned | masterquerycount = 0 |
double | masterquerytime = -1000 |
unsigned | masterreplycount = 0 |
cvar_t | net_address = {CF_CLIENT | CF_SERVER, "net_address", "", "network address to open ipv4 ports on (if empty, use default interfaces)"} |
cvar_t | net_address_ipv6 = {CF_CLIENT | CF_SERVER, "net_address_ipv6", "", "network address to open ipv6 ports on (if empty, use default interfaces)"} |
cvar_t | net_burstreserve = {CF_SERVER, "net_burstreserve", "0.3", "how much of the burst time to reserve for packet size spikes"} |
cvar_t | net_challengefloodblockingtimeout = {CF_SERVER, "net_challengefloodblockingtimeout", "0.5", "when a challenge packet is received, it will block all future challenge packets from that IP address for this many seconds (cuts down on challenge floods). DarkPlaces clients retry once per second, so this should be <= 1. Failure here may lead to connect attempts failing."} |
cvar_t | net_connect_entnum_ofs = {CF_SERVER, "net_connect_entnum_ofs", "0", "entity number offset of human clients (for developer testing only)"} |
cvar_t | net_connectfloodblockingtimeout = {CF_SERVER, "net_connectfloodblockingtimeout", "5", "when a connection packet is received, it will block all future connect packets from that IP address for this many seconds (cuts down on connect floods). Note that this does not include retries from the same IP; these are handled earlier and let in."} |
cvar_t | net_connecttimeout = {CF_CLIENT | CF_SERVER, "net_connecttimeout","15", "after requesting a connection, the client must reply within this many seconds or be dropped (cuts down on connect floods). Must be above 10 seconds."} |
cvar_t | net_fakelag = {CF_CLIENT, "net_fakelag","0", "lags local loopback connection by this much ping time (useful to play more fairly on your own server with people with higher pings)"} |
static cvar_t | net_fakeloss_receive = {CF_CLIENT, "net_fakeloss_receive","0", "drops this percentage of incoming packets, useful for testing network protocol robustness (jerky movement, effects failing to start, sounds failing to play, etc)"} |
static cvar_t | net_fakeloss_send = {CF_CLIENT, "net_fakeloss_send","0", "drops this percentage of outgoing packets, useful for testing network protocol robustness (jerky movement, prediction errors, etc)"} |
cvar_t | net_getstatusfloodblockingtimeout = {CF_SERVER, "net_getstatusfloodblockingtimeout", "1", "when a getstatus packet is received, it will block all future getstatus packets from that IP address for this many seconds (cuts down on getstatus floods). DarkPlaces retries every net_slist_timeout seconds, and qstat retries once per second, so this should be <= 1. Failure here may lead to server not showing up in the server list."} |
cvar_t | net_messagetimeout = {CF_CLIENT | CF_SERVER, "net_messagetimeout","300", "drops players who have not sent any packets for this many seconds"} |
cvar_t | net_sourceaddresscheck = {CF_CLIENT, "net_sourceaddresscheck", "1", "compare the source IP address for replies (more secure, may break some bad multihoming setups"} |
cvar_t | net_test = {CF_CLIENT | CF_SERVER, "net_test", "0", "internal development use only, leave it alone (usually does nothing anyway)"} |
static cvar_t | net_tos_dscp = {CF_CLIENT | CF_ARCHIVE, "net_tos_dscp", "32", "DiffServ Codepoint for network sockets (may need game restart to apply)"} |
cvar_t | net_usesizelimit = {CF_SERVER, "net_usesizelimit", "2", "use packet size limiting (0: never, 1: in non-CSQC mode, 2: always)"} |
netconn_t * | netconn_list = NULL |
mempool_t * | netconn_mempool = NULL |
void * | netconn_mutex = NULL |
static double | nextheartbeattime = 0 |
static cvar_t | rcon_restricted_commands = {CF_SERVER, "rcon_restricted_commands", "", "allowed commands for rcon when the restricted mode password was used"} |
static cvar_t | rcon_restricted_password = {CF_SERVER | CF_PRIVATE, "rcon_restricted_password", "", "password to authenticate rcon commands in restricted mode; may be set to a string of the form user1:pass1 user2:pass2 user3:pass3 to allow multiple user accounts - the client then has to specify ONE of these combinations"} |
cvar_t | rcon_secure |
cvar_t | rcon_secure_challengetimeout |
static cvar_t | rcon_secure_maxdiff = {CF_SERVER, "rcon_secure_maxdiff", "5", "maximum time difference between rcon request and server system clock (to protect against replay attack)"} |
uint8_t | serverlist_querystage = 0 |
bitfield because in theory we could be doing QW & DP simultaneously | |
unsigned | serverquerycount = 0 |
unsigned | serverreplycount = 0 |
static cvar_t | sv_heartbeatperiod = {CF_SERVER | CF_ARCHIVE, "sv_heartbeatperiod", "120", "how often to send heartbeat in seconds (only used if sv_public is 1)"} |
static cvar_t | sv_masters [] |
sizebuf_t | sv_message |
static unsigned char | sv_message_buf [NET_MAXMESSAGE] |
char | sv_net_extresponse [NET_EXTRESPONSE_MAX][1400] |
unsigned | sv_net_extresponse_count = 0 |
unsigned | sv_net_extresponse_last = 0 |
cvar_t | sv_netport = {CF_SERVER, "port", "26000", "server port for players to connect to"} |
static unsigned | sv_numsockets |
cvar_t | sv_public = {CF_SERVER, "sv_public", "0", "1: advertises this server on the master server (so that players can find it in the server browser); 0: allow direct queries only; -1: do not respond to direct queries; -2: do not allow anyone to connect; -3: already block at getchallenge level"} |
cvar_t | sv_public_rejectreason = {CF_SERVER, "sv_public_rejectreason", "The server is closing.", "Rejection reason for connects when sv_public is -2"} |
char | sv_readstring [MAX_INPUTLINE] |
static lhnetsocket_t * | sv_sockets [16] |
cvar_t | sv_status_privacy |
#define DPMASTER_COUNT sizeof(sv_masters) / sizeof(cvar_t) |
Definition at line 125 of file netconn.c.
Referenced by NetConn_Heartbeat(), and NetConn_Init().
#define DPMASTER_PORT 27950 |
Definition at line 33 of file netconn.c.
Referenced by NetConn_Heartbeat().
#define QWMASTER_COUNT sizeof(sv_qwmasters) / sizeof(cvar_t) |
Definition at line 126 of file netconn.c.
Referenced by NetConn_Init().
typedef qbool(* rcon_matchfunc_t) (lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen) |
|
static |
Definition at line 3009 of file netconn.c.
References challenges, CON_ERROR, Con_Print(), HMAC_MDFOUR_16BYTES, i, LHNETADDRESS_Compare(), MAX_CHALLENGES, strlen(), challenge_t::time, and time.
Referenced by NetConn_ServerParsePacket().
|
static |
Definition at line 2988 of file netconn.c.
References CON_ERROR, Con_Print(), HMAC_MDFOUR_16BYTES, cvar_t::integer, NULL, rcon_secure_maxdiff, strlen(), and time.
Referenced by NetConn_ServerParsePacket().
|
static |
Definition at line 4017 of file netconn.c.
References server_t::active, Con_Print(), NetConn_Heartbeat(), and sv.
Referenced by NetConn_Init().
void Net_Stats_f | ( | cmd_state_t * | cmd | ) |
Definition at line 4042 of file netconn.c.
References Con_Print(), netconn_list, netconn_t::next, and PrintStats().
Referenced by NetConn_Init().
Definition at line 823 of file netconn.c.
References crypto_t::authenticated, NETFLAG_CRYPTO0, NETFLAG_CRYPTO1, NETFLAG_CRYPTO2, and r.
Referenced by NetConn_ReceivedMessage(), and NetConn_SendUnreliableMessage().
Definition at line 2741 of file netconn.c.
Referenced by NetConn_ServerParsePacket().
|
static |
(div0) build the full response only if possible; better a getinfo response than no response at all if getstatus won't fit
\TODO: we should add more information for the full status string
Definition at line 2757 of file netconn.c.
References client_t::active, bound, server_static_t::clients, clientstatus, client_t::colors, com_modname, Crypto_GetInfoResponseDataString(), crypto_idstring, dp_strlcpy, dpsnprintf(), client_t::frags, gamemode, gamenetworkfiltername, gameversion, hostname, i, int(), cvar_t::integer, IS_NEXUIZ_DERIVED, ISWHITESPACE, length, server_static_t::maxclients, client_t::name, NET_PROTOCOL_VERSION, client_t::netconnection, client_t::ping, PRVM_EDICT_NUM, PRVM_GetString(), PRVM_serveredictstring, PRVM_serverglobalstring, cvar_t::string, sv, svs, SVVM_prog, teamplay, server_t::worldbasename, and worldstatus.
Referenced by NetConn_ServerParsePacket().
Definition at line 789 of file netconn.c.
References netgraphitem_t::ackbytes, netconn_t::cleartime, netgraphitem_t::cleartime, host, NETGRAPH_CHOKEDPACKET, NETGRAPH_NOPACKET, NETGRAPH_PACKETS, netconn_t::outgoing_netgraph, netconn_t::outgoing_packetcounter, host_static_t::realtime, netgraphitem_t::reliablebytes, netgraphitem_t::time, and netgraphitem_t::unreliablebytes.
Referenced by CL_SendMove(), and SV_SendClientDatagram().
lhnetsocket_t * NetConn_ChooseClientSocketForAddress | ( | lhnetaddress_t * | address | ) |
Definition at line 1198 of file netconn.c.
References a, cl_numsockets, cl_sockets, i, LHNET_AddressFromSocket(), LHNETADDRESS_GetAddressType(), and NULL.
Referenced by CL_EstablishConnection(), CL_Packet_f(), CL_PQRcon_f(), CL_Rcon_f(), and Log_DestBuffer_Flush_NoLock().
lhnetsocket_t * NetConn_ChooseServerSocketForAddress | ( | lhnetaddress_t * | address | ) |
Definition at line 1209 of file netconn.c.
References a, i, LHNET_AddressFromSocket(), LHNETADDRESS_GetAddressType(), NULL, sv_numsockets, and sv_sockets.
Referenced by CL_Packet_f(), Log_DestBuffer_Flush_NoLock(), and NetConn_Heartbeat().
Definition at line 1272 of file netconn.c.
References ca_connected, ca_dedicated, ca_disconnected, cl_numsockets, clientport, clientport2, cls, Con_Print(), cvar_t::integer, NetConn_CloseClientPorts(), NetConn_OpenClientPorts(), and client_static_t::state.
Referenced by NetConn_Init().
void NetConn_ClearFlood | ( | lhnetaddress_t * | peeraddress, |
server_floodaddress_t * | floodlist, | ||
size_t | floodlength ) |
Definition at line 2966 of file netconn.c.
References server_floodaddress_t::address, lhnetaddress_t::addresstype, server_floodaddress_t::lasttime, LHNETADDRESS_Compare(), LHNETADDRESS_SetPort(), and LHNETADDRESSTYPE_NONE.
Referenced by NetConn_Close().
Definition at line 2674 of file netconn.c.
References server_t::active, CCREQ_CONNECT, cl_connect_status, CL_DisconnectEx(), cl_message, cl_numsockets, cl_sockets, cls, CON_ERROR, Con_Printf(), client_static_t::connect_address, client_static_t::connect_mysocket, client_static_t::connect_nextsendtime, client_static_t::connect_remainingtries, client_static_t::connect_trying, sizebuf_t::cursize, sizebuf_t::data, dp_strlcpy, dpsnprintf(), host, i, length, LHNETADDRESS_ToString(), MSG_WriteByte(), MSG_WriteLong(), MSG_WriteString(), NET_HEADERSIZE, NET_MAXMESSAGE, NET_PROTOCOL_VERSION, client_static_t::netcon, NetConn_ClientParsePacket(), NetConn_Read(), NetConn_UpdateSockets(), NetConn_Write(), NetConn_WriteString(), NETFLAG_CTL, NETFLAG_LENGTH_MASK, host_static_t::realtime, StoreBigLong(), sv, SZ_Clear(), and netconn_t::timeout.
Referenced by CL_Frame(), and CL_KeepaliveMessage().
|
static |
Definition at line 2019 of file netconn.c.
References buf, BuffBigLong(), CCREP_ACCEPT, CCREP_PLAYER_INFO, CCREP_RCON, CCREP_REJECT, CCREP_RULE_INFO, CCREP_SERVER_INFO, cl_connect_status, cl_message, cl_net_extresponse, cl_net_extresponse_count, cl_net_extresponse_last, CL_ParseServerMessage(), cl_readstring, cls, Com_HexDumpToConsole(), Con_DPrintf(), CON_ERROR, Con_Printf(), CON_WARN, client_static_t::connect_address, client_static_t::connect_trying, client_static_t::connect_userinfo, Crypto_ClientParsePacket(), CRYPTO_DISCARD, CRYPTO_HEADERSIZE, CRYPTO_MATCH, CRYPTO_NOMATCH, CRYPTO_REPLACE, data, developer_extra, developer_networking, dp_strlcpy, dpsnprintf(), ENCRYPTION_REQUIRED, HMAC_MDFOUR_16BYTES, host, i, InfoString_GetValue(), InfoString_SetValue(), int(), cvar_t::integer, key_dest, key_game, length, LHNETADDRESS_Compare(), LHNETADDRESS_SetPort(), LHNETADDRESS_ToString(), max, MAX_INPUTLINE, MAX_RCONS, min, MSG_BeginReading(), MSG_ReadByte, MSG_ReadLong, MSG_ReadString(), netconn_t::mysocket, n, NET_EXTRESPONSE_MAX, NET_HEADERSIZE, NET_MAXMESSAGE, net_messagetimeout, net_sourceaddresscheck, client_static_t::netcon, NetConn_ConnectionEstablished(), NetConn_ReceivedMessage(), NetConn_Write(), NetConn_WriteString(), NETFLAG_CTL, NULL, netconn_t::peeraddress, client_static_t::proquake_serverflags, client_static_t::proquake_servermod, client_static_t::proquake_serverversion, client_static_t::protocol, PROTOCOL_DARKPLACES3, Protocol_Names(), PROTOCOL_QUAKE, PROTOCOL_QUAKEWORLD, qport, client_static_t::qw_qport, client_static_t::rcon_address, client_static_t::rcon_addresses, client_static_t::rcon_commands, rcon_password, client_static_t::rcon_ringpos, rcon_secure_challengetimeout, client_static_t::rcon_timeout, client_static_t::rcon_trying, host_static_t::realtime, ret, SERVERLIST_TOTALSIZE, cvar_t::string, string, strlen(), SZ_Clear(), SZ_Write(), client_static_t::userinfo, and cvar_t::value.
Referenced by NetConn_ClientFrame().
Definition at line 1240 of file netconn.c.
References server_t::connectfloodaddresses, Mem_Free, NetConn_ClearFlood(), netconn_list, netconn_t::next, netconn_t::peeraddress, and sv.
Referenced by CL_DisconnectEx(), and SV_DropClient().
Definition at line 1062 of file netconn.c.
References cl_numsockets, cl_sockets, and LHNET_CloseSocket().
Referenced by NetConn_CL_UpdateSockets_Callback(), NetConn_OpenClientPorts(), and NetConn_Shutdown().
Definition at line 1121 of file netconn.c.
References LHNET_CloseSocket(), sv_numsockets, and sv_sockets.
Referenced by Log_DestBuffer_Flush_NoLock(), NetConn_OpenServerPorts(), NetConn_Shutdown(), and SV_Shutdown().
|
static |
Definition at line 1641 of file netconn.c.
References netconn_t::address, crypto_t::authenticated, buf, ca_connected, cl_connect_status, CL_Disconnect(), CL_ForwardToServer(), clc_nop, crypto_t::client_idfp, crypto_t::client_issigned, crypto_t::client_keyfp, cls, Con_Printf(), client_static_t::connect_trying, client_static_t::crypto, netconn_t::crypto, Crypto_FinishInstance(), crypto_keyfp_recommended_length, sizebuf_t::data, client_static_t::demonum, client_static_t::demoplayback, dp_strlcpy, key_dest, key_game, m_none, m_state, sizebuf_t::maxsize, MSG_WriteChar(), client_static_t::netcon, NetConn_Open(), NetConn_SendUnreliableMessage(), client_static_t::protocol, PROTOCOL_QUAKE, PROTOCOL_QUAKEWORLD, crypto_t::server_idfp, crypto_t::server_issigned, crypto_t::server_keyfp, client_static_t::servermovesequence, client_static_t::signon, client_static_t::state, and crypto_t::use_aes.
Referenced by NetConn_ClientParsePacket().
Definition at line 1052 of file netconn.c.
References cl_numsockets.
Referenced by Log_DestBuffer_Flush_NoLock().
Definition at line 1057 of file netconn.c.
References sv_numsockets.
Referenced by Log_DestBuffer_Flush_NoLock().
Definition at line 3984 of file netconn.c.
References server_t::active, Cvar_SetValueQuick(), DPMASTER_COUNT, DPMASTER_PORT, host, cvar_t::integer, LHNETADDRESS_FromString(), server_static_t::maxclients, NetConn_ChooseServerSocketForAddress(), NetConn_WriteString(), nextheartbeattime, host_static_t::realtime, sv, sv_heartbeatperiod, sv_masters, sv_public, svs, and cvar_t::value.
Referenced by Net_Heartbeat_f(), NetConn_ServerParsePacket(), SV_DropClient(), SV_Frame(), SV_Shutdown(), SV_SpawnServer(), and SV_ThreadFunc().
Definition at line 4094 of file netconn.c.
References sys_t::argc, sys_t::argv, CF_CLIENT, CF_SERVER, CF_SHARED, cl_message, cl_message_buf, cl_netport, cl_numsockets, Cmd_AddCommand(), CON_ERROR, Con_Printf(), sizebuf_t::cursize, Cvar_RegisterCallback(), Cvar_RegisterVariable(), Cvar_RegisterVirtual(), Cvar_SetQuick(), Cvar_SetValueQuick(), sizebuf_t::data, developer_networking, DPMASTER_COUNT, gameversion, gameversion_max, gameversion_min, hostname, i, LHNET_Init(), LHNETADDRESS_FromString(), sizebuf_t::maxsize, Mem_AllocPool, net_address, net_address_ipv6, net_burstreserve, net_challengefloodblockingtimeout, net_connect_entnum_ofs, net_connectfloodblockingtimeout, net_connecttimeout, net_fakelag, net_fakeloss_receive, net_fakeloss_send, net_getstatusfloodblockingtimeout, Net_Heartbeat_f(), net_messagetimeout, net_sourceaddresscheck, Net_Stats_f(), net_test, net_tos_dscp, net_usesizelimit, NetConn_CL_UpdateSockets_Callback(), netconn_mempool, netconn_mutex, NetConn_sv_netport_Callback(), NULL, QWMASTER_COUNT, rcon_restricted_commands, rcon_restricted_password, rcon_secure_maxdiff, sv_heartbeatperiod, sv_masters, sv_message, sv_message_buf, sv_netport, sv_numsockets, sv_public, sv_public_rejectreason, sys, Sys_CheckParm(), Thread_CreateMutex, and Thread_HasThreads().
Referenced by Host_Init().
Definition at line 1696 of file netconn.c.
References server_t::active, ca_connected, cl, cls, client_state_t::maxclients, client_static_t::state, and sv.
Referenced by CL_ParseServerInfo().
netconn_t * NetConn_Open | ( | lhnetsocket_t * | mysocket, |
lhnetaddress_t * | peeraddress ) |
Definition at line 1220 of file netconn.c.
References netconn_t::address, sizebuf_t::cursize, sizebuf_t::data, host, netconn_t::lastMessageTime, LHNETADDRESS_ToString(), sizebuf_t::maxsize, Mem_Alloc, netconn_t::message, netconn_t::messagedata, netconn_t::mysocket, net_connecttimeout, netconn_list, netconn_mempool, netconn_t::next, netconn_t::peeraddress, host_static_t::realtime, netconn_t::timeout, and cvar_t::value.
Referenced by NetConn_ConnectionEstablished(), and NetConn_ServerParsePacket().
|
static |
Definition at line 1069 of file netconn.c.
References cl_numsockets, cl_sockets, CON_ERROR, Con_Printf(), LHNET_AddressFromSocket(), LHNET_OpenSocket_Connectionless(), LHNETADDRESS_FromPort(), LHNETADDRESS_FromString(), LHNETADDRESS_ToString(), and LHNETADDRESSTYPE_LOOP.
Referenced by NetConn_OpenClientPorts().
Definition at line 1098 of file netconn.c.
References bound, cl_netport, Con_Printf(), Crypto_LoadKeys(), Cvar_SetValueQuick(), cvar_t::integer, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, LHNETADDRESSTYPE_LOOP, net_address, net_address_ipv6, NetConn_CloseClientPorts(), NetConn_OpenClientPort(), NULL, cvar_t::string, SV_LockThreadMutex, and SV_UnlockThreadMutex.
Referenced by NetConn_CL_UpdateSockets_Callback().
|
static |
Definition at line 1128 of file netconn.c.
References CON_ERROR, Con_Printf(), LHNET_AddressFromSocket(), LHNET_OpenSocket_Connectionless(), LHNETADDRESS_FromPort(), LHNETADDRESS_FromString(), LHNETADDRESS_ToString(), LHNETADDRESSTYPE_LOOP, sv_numsockets, and sv_sockets.
Referenced by NetConn_OpenServerPorts().
Definition at line 1168 of file netconn.c.
References bound, ca_dedicated, cls, Crypto_LoadKeys(), Cvar_SetValueQuick(), Host_Error(), cvar_t::integer, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, LHNETADDRESSTYPE_LOOP, net_address, net_address_ipv6, NetConn_CloseServerPorts(), NetConn_OpenServerPort(), NetConn_UpdateSockets(), NULL, client_static_t::state, cvar_t::string, SV_LockThreadMutex, sv_netport, sv_numsockets, and SV_UnlockThreadMutex.
Referenced by Log_DestBuffer_Flush_NoLock(), and SV_SpawnServer().
|
static |
Definition at line 2923 of file netconn.c.
References server_floodaddress_t::address, host, server_floodaddress_t::lasttime, LHNETADDRESS_Compare(), LHNETADDRESS_SetPort(), and host_static_t::realtime.
Referenced by NetConn_ServerParsePacket().
int NetConn_Read | ( | lhnetsocket_t * | mysocket, |
void * | data, | ||
int | maxlength, | ||
lhnetaddress_t * | peeraddress ) |
Definition at line 726 of file netconn.c.
References lhnetsocket_t::address, lhnetaddress_t::addresstype, cl_numsockets, cl_sockets, Com_HexDumpToConsole(), Con_Printf(), data, developer_networking, i, cvar_t::integer, length, LHNET_AddressFromSocket(), LHNET_Read(), LHNETADDRESS_ToString(), LHNETADDRESSTYPE_LOOP, net_fakeloss_receive, netconn_mutex, Thread_LockMutex, and Thread_UnlockMutex.
Referenced by NetConn_ClientFrame(), and NetConn_ServerFrame().
|
static |
Definition at line 1331 of file netconn.c.
References netgraphitem_t::ackbytes, netconn_t::netconn_nq_s::ackSequence, BuffBigLong(), cl_message, cl_rate, cl_rate_burstsize, netconn_t::cleartime, netgraphitem_t::cleartime, cls, Con_DPrint(), Con_Printf(), count, netconn_t::crypto, Crypto_DecryptPacket(), Crypto_EncryptPacket(), CRYPTO_HEADERSIZE, data, netconn_t::droppedDatagrams, flags, host, netconn_t::netconn_qw_s::incoming_acknowledged, netconn_t::incoming_cleartime, netconn_t::incoming_netgraph, netconn_t::incoming_packetcounter, netconn_t::netconn_qw_s::incoming_reliable_acknowledged, netconn_t::netconn_qw_s::incoming_reliable_sequence, netconn_t::netconn_qw_s::incoming_sequence, int(), cvar_t::integer, netconn_t::lastMessageTime, netconn_t::lastSendTime, length, LittleLong, MAX_PACKETFRAGMENT, MSG_BeginReading(), netconn_t::mysocket, NET_HEADERSIZE, NET_MAXMESSAGE, net_test, client_static_t::netcon, NetConn_AddCryptoFlag(), NetConn_UpdateCleartime(), NetConn_Write(), NETFLAG_ACK, NETFLAG_CTL, NETFLAG_DATA, NETFLAG_EOM, NETFLAG_LENGTH_MASK, NETFLAG_UNRELIABLE, NETGRAPH_LOSTPACKET, NETGRAPH_NOPACKET, NETGRAPH_PACKETS, netconn_t::nq, netconn_t::outgoing_netgraph, netconn_t::outgoing_packetcounter, netconn_t::packetsReceived, netconn_t::packetsSent, netconn_t::peeraddress, PROTOCOL_QUAKEWORLD, netconn_t::qw, client_static_t::qw_incoming_sequence, host_static_t::realtime, netconn_t::receivedDuplicateCount, netconn_t::receiveMessage, netconn_t::receiveMessageLength, netconn_t::netconn_nq_s::receiveSequence, netconn_t::netconn_qw_s::reliable_sequence, netgraphitem_t::reliablebytes, netconn_t::reliableMessagesReceived, netconn_t::sendMessage, netconn_t::sendMessageLength, netconn_t::netconn_nq_s::sendSequence, StoreBigLong(), sv_message, SZ_Clear(), SZ_Write(), netgraphitem_t::time, netconn_t::timeout, netgraphitem_t::unreliablebytes, netconn_t::unreliableMessagesReceived, and netconn_t::netconn_nq_s::unreliableReceiveSequence.
Referenced by NetConn_ClientParsePacket(), and NetConn_ServerParsePacket().
int NetConn_SendUnreliableMessage | ( | netconn_t * | conn, |
sizebuf_t * | data, | ||
protocolversion_t | protocol, | ||
int | rate, | ||
int | burstsize, | ||
qbool | quakesignon_suppressreliables ) |
Definition at line 844 of file netconn.c.
References netconn_t::cleartime, netgraphitem_t::cleartime, cls, Con_Print(), Con_Printf(), netconn_t::crypto, Crypto_EncryptPacket(), CRYPTO_HEADERSIZE, sizebuf_t::cursize, data, sizebuf_t::data, developer_networking, host, netconn_t::netconn_qw_s::incoming_acknowledged, netconn_t::netconn_qw_s::incoming_reliable_acknowledged, netconn_t::netconn_qw_s::incoming_reliable_sequence, netconn_t::netconn_qw_s::incoming_sequence, int(), cvar_t::integer, netconn_t::netconn_qw_s::last_reliable_sequence, netconn_t::lastSendTime, LittleShort, MAX_PACKETFRAGMENT, netconn_t::message, netconn_t::mysocket, NET_HEADERSIZE, NET_MAXMESSAGE, client_static_t::netcon, NetConn_AddCryptoFlag(), NetConn_UpdateCleartime(), NetConn_Write(), NETFLAG_DATA, NETFLAG_EOM, NETFLAG_UNRELIABLE, NETGRAPH_CHOKEDPACKET, NETGRAPH_NOPACKET, netconn_t::nq, netconn_t::outgoing_netgraph, netconn_t::outgoing_packetcounter, netconn_t::outgoing_unreliable_sequence, sizebuf_t::overflowed, netconn_t::packetsReSent, netconn_t::packetsSent, netconn_t::peeraddress, PROTOCOL_QUAKEWORLD, netconn_t::qw, client_static_t::qw_outgoing_sequence, client_static_t::qw_qport, host_static_t::realtime, netconn_t::netconn_qw_s::reliable_sequence, netgraphitem_t::reliablebytes, netconn_t::reliableMessagesSent, netconn_t::sendMessage, netconn_t::sendMessageLength, netconn_t::netconn_nq_s::sendSequence, StoreBigLong(), StoreLittleLong(), SZ_Clear(), SZ_HexDumpToConsole(), netgraphitem_t::unreliablebytes, and netconn_t::unreliableMessagesSent.
Referenced by CL_DisconnectEx(), CL_KeepaliveMessage(), CL_SendMove(), NetConn_ConnectionEstablished(), SV_DropClient(), and SV_SendClientDatagram().
Definition at line 3861 of file netconn.c.
References i, length, NET_HEADERSIZE, NET_MAXMESSAGE, NetConn_Read(), NetConn_ServerParsePacket(), sv_numsockets, and sv_sockets.
Referenced by SV_Frame(), and SV_ThreadFunc().
|
static |
Definition at line 3193 of file netconn.c.
References client_t::active, server_t::active, challenge_t::address, netconn_t::address, crypto_t::authenticated, client_t::begun, BuffBigLong(), CCREP_ACCEPT, CCREP_PLAYER_INFO, CCREP_REJECT, CCREP_RULE_INFO, CCREP_SERVER_INFO, CCREQ_CONNECT, CCREQ_PLAYER_INFO, CCREQ_RCON, CCREQ_RULE_INFO, CCREQ_SERVER_INFO, CF_NOTIFY, challenges, crypto_t::client_idfp, crypto_t::client_issigned, crypto_t::client_keyfp, server_static_t::clients, cmd(), client_t::colors, Com_HexDumpToConsole(), Con_DPrintf(), Con_Printf(), server_t::connectfloodaddresses, client_t::connecttime, netconn_t::crypto, crypto_developer, CRYPTO_DISCARD, Crypto_FinishInstance(), CRYPTO_HEADERSIZE, crypto_keyfp_recommended_length, CRYPTO_MATCH, CRYPTO_NOMATCH, CRYPTO_REPLACE, Crypto_ServerAppendToChallenge(), Crypto_ServerGetInstance(), Crypto_ServerParsePacket(), sizebuf_t::cursize, Cvar_FindVarAfter(), cvars_all, data, sizebuf_t::data, developer_extra, dp_strlcpy, dpsnprintf(), ENCRYPTION_REQUIRED, client_t::frags, server_t::getstatusfloodaddresses, hmac_mdfour_challenge_matching(), hmac_mdfour_time_matching(), host, host_client, hostname, i, InfoString_GetValue(), int(), cvar_t::integer, ISWHITESPACE, length, LHNET_AddressFromSocket(), LHNETADDRESS_Compare(), LHNETADDRESS_GetAddressType(), LHNETADDRESS_GetPort(), LHNETADDRESS_ToString(), LHNETADDRESSTYPE_LOOP, MAX_CHALLENGES, MAX_INPUTLINE, server_static_t::maxclients, min, MSG_BeginReading(), MSG_ReadByte, MSG_ReadString(), MSG_WriteByte(), MSG_WriteLong(), MSG_WriteString(), MSG_WriteUnterminatedString(), netconn_t::mysocket, client_t::name, cvar_t::name, net_challengefloodblockingtimeout, net_connect_entnum_ofs, net_connectfloodblockingtimeout, net_connecttimeout, NET_EXTRESPONSE_MAX, net_getstatusfloodblockingtimeout, NET_HEADERSIZE, NET_MAXMESSAGE, net_messagetimeout, NET_PROTOCOL_VERSION, NetConn_BuildChallengeString(), NetConn_BuildStatusResponse(), NetConn_Heartbeat(), NetConn_Open(), NetConn_PreventFlood(), NetConn_ReceivedMessage(), NetConn_Write(), NetConn_WriteString(), client_t::netconnection, NETFLAG_CTL, NETFLAG_LENGTH_MASK, NULL, netconn_t::peeraddress, plaintext_matching(), server_t::protocol, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, RCon_Authenticate(), RCon_Execute(), rcon_secure, host_static_t::realtime, ret, crypto_t::server_idfp, crypto_t::server_issigned, crypto_t::server_keyfp, StoreBigLong(), cvar_t::string, string, strlen(), sv, SV_ConnectClient(), sv_message, sv_net_extresponse, sv_net_extresponse_count, sv_net_extresponse_last, sv_public, sv_public_rejectreason, SV_ReadClientMessage(), sv_readstring, SV_SendServerinfo(), sv_status_privacy, svs, SZ_Clear(), SZ_Write(), challenge_t::time, time, crypto_t::use_aes, cvar_t::value, and server_t::worldbasename.
Referenced by NetConn_ServerFrame().
Definition at line 4201 of file netconn.c.
References LHNET_Shutdown(), NetConn_CloseClientPorts(), NetConn_CloseServerPorts(), netconn_mutex, NULL, and Thread_DestroyMutex.
Referenced by Host_Shutdown().
Definition at line 1296 of file netconn.c.
References server_t::active, Con_Print(), hostport, cvar_t::integer, and sv.
Referenced by NetConn_Init().
Definition at line 806 of file netconn.c.
References host, cvar_t::integer, net_test, and host_static_t::realtime.
Referenced by NetConn_ReceivedMessage(), and NetConn_SendUnreliableMessage().
Definition at line 1306 of file netconn.c.
References cls, Con_Printf(), host, i, cvar_t::integer, LHNET_DefaultDSCP(), LHNETADDRESS_ToString(), MAX_RCONS, net_tos_dscp, client_static_t::rcon_addresses, client_static_t::rcon_commands, client_static_t::rcon_ringpos, client_static_t::rcon_timeout, client_static_t::rcon_trying, and host_static_t::realtime.
Referenced by CL_EstablishConnection(), CL_PlayDemo(), CL_StartVideo(), Host_Frame(), NetConn_ClientFrame(), and NetConn_OpenServerPorts().
int NetConn_Write | ( | lhnetsocket_t * | mysocket, |
const void * | data, | ||
int | length, | ||
const lhnetaddress_t * | peeraddress ) |
Definition at line 758 of file netconn.c.
References lhnetsocket_t::address, lhnetaddress_t::addresstype, cl_numsockets, cl_sockets, Com_HexDumpToConsole(), Con_Printf(), data, developer_networking, i, cvar_t::integer, length, LHNET_AddressFromSocket(), LHNET_Write(), LHNETADDRESS_ToString(), LHNETADDRESSTYPE_LOOP, net_fakeloss_send, netconn_mutex, ret, Thread_LockMutex, and Thread_UnlockMutex.
Referenced by CL_Packet_f(), CL_PQRcon_f(), CL_Rcon_f(), Con_Rcon_Redirect_Flush(), NetConn_ClientFrame(), NetConn_ClientParsePacket(), NetConn_ReceivedMessage(), NetConn_SendUnreliableMessage(), NetConn_ServerParsePacket(), and NetConn_WriteString().
int NetConn_WriteString | ( | lhnetsocket_t * | mysocket, |
const char * | string, | ||
const lhnetaddress_t * | peeraddress ) |
Definition at line 783 of file netconn.c.
References NetConn_Write(), and strlen().
Referenced by CL_Rcon_f(), Log_DestBuffer_Flush_NoLock(), NetConn_ClientFrame(), NetConn_ClientParsePacket(), NetConn_Heartbeat(), and NetConn_ServerParsePacket().
|
static |
Definition at line 3043 of file netconn.c.
References CON_ERROR, and Con_Print().
Referenced by NetConn_ServerParsePacket().
Definition at line 4025 of file netconn.c.
References server_t::active, netconn_t::address, ca_connected, cls, Con_Printf(), netconn_t::droppedDatagrams, netconn_t::netconn_qw_s::incoming_sequence, netconn_t::nq, netconn_t::outgoing_unreliable_sequence, netconn_t::packetsReceived, netconn_t::packetsReSent, netconn_t::packetsSent, client_static_t::protocol, server_t::protocol, PROTOCOL_QUAKEWORLD, netconn_t::qw, netconn_t::receivedDuplicateCount, netconn_t::netconn_nq_s::receiveSequence, netconn_t::reliableMessagesReceived, netconn_t::reliableMessagesSent, netconn_t::sendMessageLength, netconn_t::netconn_nq_s::sendSequence, client_static_t::state, sv, netconn_t::unreliableMessagesReceived, and netconn_t::unreliableMessagesSent.
Referenced by Net_Stats_f().
|
static |
returns a string describing the user level, or NULL for auth failure
Definition at line 3054 of file netconn.c.
References buf, COM_ParseToken_Console(), com_token, dp_ustr2stp(), matchpattern_with_separator(), MAX_INPUTLINE, NULL, rcon_password, rcon_restricted_commands, rcon_restricted_password, cvar_t::string, strlen(), and va().
Referenced by NetConn_ServerParsePacket().
|
static |
Definition at line 3152 of file netconn.c.
References cmd_local, Cmd_PreprocessAndExecuteString(), CON_ERROR, Con_Printf(), Con_Rcon_Redirect_End(), Con_Rcon_Redirect_Init(), host_client, LHNETADDRESS_GetAddressType(), LHNETADDRESSTYPE_LOOP, client_t::name, client_t::netconnection, netconn_t::peeraddress, src_local, and strlen().
Referenced by NetConn_ServerParsePacket().
challenge_t challenges[MAX_CHALLENGES] |
Definition at line 123 of file netconn.c.
Referenced by Crypto_ServerParsePacket_Internal(), hmac_mdfour_challenge_matching(), and NetConn_ServerParsePacket().
sizebuf_t cl_message |
Definition at line 71 of file netconn.c.
Referenced by CL_KeepaliveMessage(), CL_Parse_DumpPacket(), CL_ParseBaseline(), CL_ParseBeam(), CL_ParseClientdata(), CL_ParseDownload(), CL_ParseEffect(), CL_ParseEffect2(), CL_ParseParticleEffect(), CL_ParsePointParticles(), CL_ParsePointParticles1(), CL_ParseServerInfo(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseStaticSound(), CL_ParseTempEntity(), CL_ParseTrailParticles(), CL_ReadDemoMessage(), CL_VM_Parse_TempEntity(), CSQC_ReadEntities(), EntityFrame4_CL_ReadFrame(), EntityFrame5_CL_ReadFrame(), EntityFrame_CL_ReadFrame(), EntityFrameQuake_ReadEntity(), EntityFrameQW_CL_ReadFrame(), EntityState5_ReadUpdate(), EntityState_ReadExtendBits(), EntityState_ReadFields(), EntityStateQW_ReadEntityUpdate(), EntityStateQW_ReadPlayerUpdate(), NetConn_ClientFrame(), NetConn_ClientParsePacket(), NetConn_Init(), NetConn_ReceivedMessage(), QW_CL_ParseDownload(), QW_CL_ParseModelList(), QW_CL_ParseNails(), QW_CL_ParseSoundList(), QW_CL_ServerInfo(), QW_CL_SetInfo(), QW_CL_UpdateUserInfo(), SHOWLMP_decodehide(), SHOWLMP_decodeshow(), V_ParseDamage(), VM_CL_ReadAngle(), VM_CL_ReadByte(), VM_CL_ReadChar(), VM_CL_ReadCoord(), VM_CL_ReadFloat(), VM_CL_ReadLong(), VM_CL_ReadPicture(), VM_CL_ReadShort(), and VM_CL_ReadString().
|
static |
Definition at line 73 of file netconn.c.
Referenced by NetConn_Init().
char cl_net_extresponse[NET_EXTRESPONSE_MAX][1400] |
Definition at line 160 of file netconn.c.
Referenced by NetConn_ClientParsePacket(), and VM_CL_getextresponse().
unsigned cl_net_extresponse_count = 0 |
Definition at line 161 of file netconn.c.
Referenced by NetConn_ClientParsePacket(), and VM_CL_getextresponse().
unsigned cl_net_extresponse_last = 0 |
Definition at line 162 of file netconn.c.
Referenced by NetConn_ClientParsePacket(), and VM_CL_getextresponse().
Definition at line 155 of file netconn.c.
Referenced by CL_DisconnectEx(), CL_Init(), NetConn_Init(), and NetConn_OpenClientPorts().
|
static |
Definition at line 146 of file netconn.c.
Referenced by NetConn_ChooseClientSocketForAddress(), NetConn_CL_UpdateSockets_Callback(), NetConn_ClientFrame(), NetConn_CloseClientPorts(), NetConn_HaveClientPorts(), NetConn_Init(), NetConn_OpenClientPort(), NetConn_Read(), and NetConn_Write().
char cl_readstring[MAX_INPUTLINE] |
Definition at line 75 of file netconn.c.
Referenced by CL_ParseServerInfo(), CL_ParseServerMessage(), CL_ParseTempEntity(), NetConn_ClientParsePacket(), QW_CL_ParseModelList(), QW_CL_ParseSoundList(), QW_CL_ServerInfo(), QW_CL_SetInfo(), QW_CL_UpdateUserInfo(), SHOWLMP_decodehide(), SHOWLMP_decodeshow(), VM_CL_ReadPicture(), and VM_CL_ReadString().
|
static |
Definition at line 147 of file netconn.c.
Referenced by NetConn_ChooseClientSocketForAddress(), NetConn_ClientFrame(), NetConn_CloseClientPorts(), NetConn_OpenClientPort(), NetConn_Read(), and NetConn_Write().
|
static |
Definition at line 1268 of file netconn.c.
Referenced by NetConn_CL_UpdateSockets_Callback().
|
static |
Definition at line 1269 of file netconn.c.
Referenced by NetConn_CL_UpdateSockets_Callback().
cvar_t developer_networking = {CF_CLIENT | CF_SERVER, "developer_networking", "0", "prints all received and sent packets (recommended only for debugging)"} |
Definition at line 89 of file netconn.c.
Referenced by Crypto_DecryptPacket(), Crypto_EncryptPacket(), NetConn_ClientParsePacket(), NetConn_Init(), NetConn_Read(), NetConn_SendUnreliableMessage(), NetConn_Write(), and SV_ReadClientMessage().
|
static |
Definition at line 108 of file netconn.c.
Referenced by NetConn_BuildStatusResponse(), and NetConn_Init().
|
static |
|
static |
cvar_t hostname = {CF_SERVER | CF_ARCHIVE, "hostname", "UNNAMED", "server message to show in server browser"} |
Definition at line 88 of file netconn.c.
Referenced by M_GameOptions_Draw(), M_GameOptions_Key(), NetConn_BuildStatusResponse(), NetConn_Init(), NetConn_ServerParsePacket(), SV_Pause_f(), SV_Say(), SV_SpawnServer(), and SV_Tell_f().
|
static |
Definition at line 1293 of file netconn.c.
Referenced by NetConn_sv_netport_Callback().
unsigned masterquerycount = 0 |
Definition at line 118 of file netconn.c.
Referenced by M_ServerList_Draw(), and VM_M_getserverliststat().
double masterquerytime = -1000 |
Definition at line 117 of file netconn.c.
Referenced by M_ServerList_Draw().
unsigned masterreplycount = 0 |
Definition at line 119 of file netconn.c.
Referenced by M_ServerList_Draw(), and VM_M_getserverliststat().
cvar_t net_address = {CF_CLIENT | CF_SERVER, "net_address", "", "network address to open ipv4 ports on (if empty, use default interfaces)"} |
Definition at line 157 of file netconn.c.
Referenced by NetConn_Init(), NetConn_OpenClientPorts(), and NetConn_OpenServerPorts().
cvar_t net_address_ipv6 = {CF_CLIENT | CF_SERVER, "net_address_ipv6", "", "network address to open ipv6 ports on (if empty, use default interfaces)"} |
Definition at line 158 of file netconn.c.
Referenced by NetConn_Init(), NetConn_OpenClientPorts(), and NetConn_OpenServerPorts().
cvar_t net_burstreserve = {CF_SERVER, "net_burstreserve", "0.3", "how much of the burst time to reserve for packet size spikes"} |
Definition at line 80 of file netconn.c.
Referenced by NetConn_Init(), and SV_SendClientDatagram().
cvar_t net_challengefloodblockingtimeout = {CF_SERVER, "net_challengefloodblockingtimeout", "0.5", "when a challenge packet is received, it will block all future challenge packets from that IP address for this many seconds (cuts down on challenge floods). DarkPlaces clients retry once per second, so this should be <= 1. Failure here may lead to connect attempts failing."} |
Definition at line 85 of file netconn.c.
Referenced by NetConn_Init(), and NetConn_ServerParsePacket().
cvar_t net_connect_entnum_ofs = {CF_SERVER, "net_connect_entnum_ofs", "0", "entity number offset of human clients (for developer testing only)"} |
Definition at line 83 of file netconn.c.
Referenced by NetConn_Init(), and NetConn_ServerParsePacket().
cvar_t net_connectfloodblockingtimeout = {CF_SERVER, "net_connectfloodblockingtimeout", "5", "when a connection packet is received, it will block all future connect packets from that IP address for this many seconds (cuts down on connect floods). Note that this does not include retries from the same IP; these are handled earlier and let in."} |
Definition at line 84 of file netconn.c.
Referenced by NetConn_Init(), and NetConn_ServerParsePacket().
cvar_t net_connecttimeout = {CF_CLIENT | CF_SERVER, "net_connecttimeout","15", "after requesting a connection, the client must reply within this many seconds or be dropped (cuts down on connect floods). Must be above 10 seconds."} |
Definition at line 82 of file netconn.c.
Referenced by NetConn_Init(), NetConn_Open(), NetConn_ServerParsePacket(), and SV_SendServerinfo().
cvar_t net_fakelag = {CF_CLIENT, "net_fakelag","0", "lags local loopback connection by this much ping time (useful to play more fairly on your own server with people with higher pings)"} |
Definition at line 91 of file netconn.c.
Referenced by LHNET_Read(), and NetConn_Init().
|
static |
Definition at line 93 of file netconn.c.
Referenced by NetConn_Init(), and NetConn_Read().
|
static |
Definition at line 92 of file netconn.c.
Referenced by NetConn_Init(), and NetConn_Write().
cvar_t net_getstatusfloodblockingtimeout = {CF_SERVER, "net_getstatusfloodblockingtimeout", "1", "when a getstatus packet is received, it will block all future getstatus packets from that IP address for this many seconds (cuts down on getstatus floods). DarkPlaces retries every net_slist_timeout seconds, and qstat retries once per second, so this should be <= 1. Failure here may lead to server not showing up in the server list."} |
Definition at line 86 of file netconn.c.
Referenced by NetConn_Init(), and NetConn_ServerParsePacket().
cvar_t net_messagetimeout = {CF_CLIENT | CF_SERVER, "net_messagetimeout","300", "drops players who have not sent any packets for this many seconds"} |
Definition at line 81 of file netconn.c.
Referenced by NetConn_ClientParsePacket(), NetConn_Init(), and NetConn_ServerParsePacket().
cvar_t net_sourceaddresscheck = {CF_CLIENT, "net_sourceaddresscheck", "1", "compare the source IP address for replies (more secure, may break some bad multihoming setups"} |
Definition at line 87 of file netconn.c.
Referenced by Crypto_ClientParsePacket(), NetConn_ClientParsePacket(), and NetConn_Init().
cvar_t net_test = {CF_CLIENT | CF_SERVER, "net_test", "0", "internal development use only, leave it alone (usually does nothing anyway)"} |
Definition at line 78 of file netconn.c.
Referenced by NetConn_Init(), NetConn_ReceivedMessage(), and NetConn_UpdateCleartime().
|
static |
Definition at line 107 of file netconn.c.
Referenced by NetConn_Init(), and NetConn_UpdateSockets().
cvar_t net_usesizelimit = {CF_SERVER, "net_usesizelimit", "2", "use packet size limiting (0: never, 1: in non-CSQC mode, 2: always)"} |
Definition at line 79 of file netconn.c.
Referenced by NetConn_Init(), and SV_SendClientDatagram().
Definition at line 151 of file netconn.c.
Referenced by Net_Stats_f(), NetConn_Close(), and NetConn_Open().
Definition at line 152 of file netconn.c.
Referenced by NetConn_Init(), and NetConn_Open().
Definition at line 153 of file netconn.c.
Referenced by NetConn_Init(), NetConn_Read(), NetConn_Shutdown(), and NetConn_Write().
|
static |
Definition at line 69 of file netconn.c.
Referenced by NetConn_Heartbeat().
|
static |
Definition at line 112 of file netconn.c.
Referenced by NetConn_Init(), and RCon_Authenticate().
|
static |
Definition at line 111 of file netconn.c.
Referenced by NetConn_Init(), and RCon_Authenticate().
|
extern |
|
extern |
Definition at line 91 of file console.c.
Referenced by Con_Init(), and NetConn_ClientParsePacket().
|
static |
Definition at line 113 of file netconn.c.
Referenced by hmac_mdfour_time_matching(), and NetConn_Init().
uint8_t serverlist_querystage = 0 |
bitfield because in theory we could be doing QW & DP simultaneously
Definition at line 129 of file netconn.c.
Referenced by CL_Frame().
unsigned serverquerycount = 0 |
Definition at line 120 of file netconn.c.
Referenced by M_ServerList_Draw(), and VM_M_getserverliststat().
unsigned serverreplycount = 0 |
Definition at line 121 of file netconn.c.
Referenced by M_ServerList_Draw(), and VM_M_getserverliststat().
|
static |
Definition at line 38 of file netconn.c.
Referenced by NetConn_Heartbeat(), and NetConn_Init().
|
static |
Definition at line 41 of file netconn.c.
Referenced by NetConn_Heartbeat(), and NetConn_Init().
sizebuf_t sv_message |
Definition at line 72 of file netconn.c.
Referenced by NetConn_Init(), NetConn_ReceivedMessage(), NetConn_ServerParsePacket(), SV_ReadClientMessage(), and SV_ReadClientMove().
|
static |
Definition at line 74 of file netconn.c.
Referenced by NetConn_Init().
char sv_net_extresponse[NET_EXTRESPONSE_MAX][1400] |
Definition at line 164 of file netconn.c.
Referenced by NetConn_ServerParsePacket(), and VM_SV_getextresponse().
unsigned sv_net_extresponse_count = 0 |
Definition at line 165 of file netconn.c.
Referenced by NetConn_ServerParsePacket(), and VM_SV_getextresponse().
unsigned sv_net_extresponse_last = 0 |
Definition at line 166 of file netconn.c.
Referenced by NetConn_ServerParsePacket(), and VM_SV_getextresponse().
Definition at line 156 of file netconn.c.
Referenced by CL_Packet_f(), CL_PQRcon_f(), CL_Rcon_f(), M_LanConfig_Key(), NetConn_Init(), NetConn_OpenServerPorts(), and SV_Init().
|
static |
Definition at line 148 of file netconn.c.
Referenced by NetConn_ChooseServerSocketForAddress(), NetConn_CloseServerPorts(), NetConn_HaveServerPorts(), NetConn_Init(), NetConn_OpenServerPort(), NetConn_OpenServerPorts(), and NetConn_ServerFrame().
cvar_t sv_public = {CF_SERVER, "sv_public", "0", "1: advertises this server on the master server (so that players can find it in the server browser); 0: allow direct queries only; -1: do not respond to direct queries; -2: do not allow anyone to connect; -3: already block at getchallenge level"} |
Definition at line 36 of file netconn.c.
Referenced by Crypto_ServerParsePacket_Internal(), M_GameOptions_Draw(), M_NetStart_Change(), NetConn_Heartbeat(), NetConn_Init(), NetConn_ServerParsePacket(), and SV_ServerOptions().
cvar_t sv_public_rejectreason = {CF_SERVER, "sv_public_rejectreason", "The server is closing.", "Rejection reason for connects when sv_public is -2"} |
Definition at line 37 of file netconn.c.
Referenced by NetConn_Init(), and NetConn_ServerParsePacket().
char sv_readstring[MAX_INPUTLINE] |
Definition at line 76 of file netconn.c.
Referenced by NetConn_ServerParsePacket(), and SV_ReadClientMessage().
|
static |
Definition at line 149 of file netconn.c.
Referenced by NetConn_ChooseServerSocketForAddress(), NetConn_CloseServerPorts(), NetConn_OpenServerPort(), and NetConn_ServerFrame().
|
extern |
Definition at line 30 of file sv_ccmds.c.
Referenced by NetConn_ServerParsePacket(), SV_InitOperatorCommands(), and SV_Status_f().