mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-01-19 15:01:13 +00:00
Ruleset expanded with ruleset_allow_localvolume. Set to 0 in 'nqr' and 'strict'. Made NET_AdrToString return a non-static pointer.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3002 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
f15fc6fefd
commit
33140dbf24
22 changed files with 168 additions and 110 deletions
|
@ -155,6 +155,7 @@ cvar_t ruleset_allow_overlongsounds = SCVAR("ruleset_allow_overlong_sounds", "1"
|
|||
cvar_t ruleset_allow_larger_models = SCVAR("ruleset_allow_larger_models", "1");
|
||||
cvar_t ruleset_allow_modified_eyes = SCVAR("ruleset_allow_modified_eyes", "0");
|
||||
cvar_t ruleset_allow_sensative_texture_replacements = SCVAR("ruleset_allow_sensative_texture_replacements", "1");
|
||||
cvar_t ruleset_allow_localvolume = SCVAR("ruleset_allow_localvolume", "1");
|
||||
|
||||
extern cvar_t cl_hightrack;
|
||||
|
||||
|
@ -1978,6 +1979,8 @@ void CL_ConnectionlessPacket (void)
|
|||
{
|
||||
char *s;
|
||||
int c;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
MSG_BeginReading ();
|
||||
MSG_ReadLong (); // skip the -1
|
||||
|
||||
|
@ -2026,7 +2029,7 @@ void CL_ConnectionlessPacket (void)
|
|||
}
|
||||
|
||||
if (cls.demoplayback == DPB_NONE)
|
||||
Con_TPrintf (TL_ST_COLON, NET_AdrToString (net_from));
|
||||
Con_TPrintf (TL_ST_COLON, NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
// Con_DPrintf ("%s", net_message.data + 4);
|
||||
|
||||
if (c == S2C_CHALLENGE)
|
||||
|
@ -2400,6 +2403,8 @@ CL_ReadPackets
|
|||
*/
|
||||
void CL_ReadPackets (void)
|
||||
{
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
// while (NET_GetPacket ())
|
||||
for(;;)
|
||||
{
|
||||
|
@ -2470,7 +2475,7 @@ void CL_ReadPackets (void)
|
|||
|
||||
if (net_message.cursize < 6 && (cls.demoplayback != DPB_MVD && cls.demoplayback != DPB_EZTV)) //MVDs don't have the whole sequence header thing going on
|
||||
{
|
||||
Con_TPrintf (TL_RUNTPACKET,NET_AdrToString(net_from));
|
||||
Con_TPrintf (TL_RUNTPACKET,NET_AdrToString(adr, sizeof(adr), net_from));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2489,7 +2494,7 @@ void CL_ReadPackets (void)
|
|||
!NET_CompareAdr (net_from, cls.netchan.remote_address))
|
||||
{
|
||||
Con_DPrintf ("%s:sequenced packet from wrong server\n"
|
||||
,NET_AdrToString(net_from));
|
||||
,NET_AdrToString(adr, sizeof(adr), net_from));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2917,6 +2922,7 @@ void CL_Init (void)
|
|||
Cvar_Register (&ruleset_allow_larger_models, cl_controlgroup);
|
||||
Cvar_Register (&ruleset_allow_modified_eyes, cl_controlgroup);
|
||||
Cvar_Register (&ruleset_allow_sensative_texture_replacements, cl_controlgroup);
|
||||
Cvar_Register (&ruleset_allow_localvolume, cl_controlgroup);
|
||||
|
||||
Cvar_Register (&qtvcl_forceversion1, cl_controlgroup);
|
||||
Cvar_Register (&qtvcl_eztvextensions, cl_controlgroup);
|
||||
|
|
|
@ -613,6 +613,7 @@ static
|
|||
int UI_SystemCallsEx(void *offset, unsigned int mask, int fn, const int *arg)
|
||||
{
|
||||
int ret=0;
|
||||
char adrbuf[MAX_ADR_SIZE];
|
||||
|
||||
//Remember to range check pointers.
|
||||
//The QVM must not be allowed to write to anything outside it's memory.
|
||||
|
@ -963,7 +964,7 @@ int UI_SystemCallsEx(void *offset, unsigned int mask, int fn, const int *arg)
|
|||
serverinfo_t *info = Master_InfoForServer(ui_pings[VM_LONG(arg[0])]);
|
||||
if (info)
|
||||
{
|
||||
adr = NET_AdrToString(info->adr);
|
||||
adr = NET_AdrToString(adrbuf, sizeof(adrbuf), info->adr);
|
||||
if (strlen(adr) < VM_LONG(arg[2]))
|
||||
{
|
||||
strcpy(buf, adr);
|
||||
|
@ -1058,7 +1059,7 @@ int UI_SystemCallsEx(void *offset, unsigned int mask, int fn, const int *arg)
|
|||
serverinfo_t *info = Master_InfoForNum(VM_LONG(arg[1]));
|
||||
if (info)
|
||||
{
|
||||
adr = NET_AdrToString(info->adr);
|
||||
adr = NET_AdrToString(adrbuf, sizeof(adrbuf), info->adr);
|
||||
if (strlen(adr) < VM_LONG(arg[3]))
|
||||
{
|
||||
strcpy(buf, adr);
|
||||
|
|
|
@ -662,6 +662,7 @@ extern cvar_t ruleset_allow_overlongsounds;
|
|||
extern cvar_t ruleset_allow_larger_models;
|
||||
extern cvar_t ruleset_allow_modified_eyes;
|
||||
extern cvar_t ruleset_allow_sensative_texture_replacements;
|
||||
extern cvar_t ruleset_allow_localvolume;
|
||||
|
||||
#define MAX_STATIC_ENTITIES 256 // torches, etc
|
||||
|
||||
|
|
|
@ -1016,6 +1016,7 @@ void CLQ3_SendAuthPacket(netadr_t gameserver)
|
|||
void CLQ3_SendConnectPacket(netadr_t to)
|
||||
{
|
||||
char data[2048];
|
||||
char adrbuf[MAX_ADR_SIZE];
|
||||
sizebuf_t msg;
|
||||
|
||||
memset(&ccs, 0, sizeof(ccs));
|
||||
|
@ -1027,7 +1028,7 @@ void CLQ3_SendConnectPacket(netadr_t to)
|
|||
msg.overflowed = msg.allowoverflow = 0;
|
||||
msg.maxsize = sizeof(data);
|
||||
MSG_WriteLong(&msg, -1);
|
||||
MSG_WriteString(&msg, va("connect \"\\challenge\\%i\\qport\\%i\\protocol\\%i\\ip\\%s%s\"", cls.challenge, cls.qport, PROTOCOL_VERSION_Q3, NET_AdrToString (net_local_cl_ipadr), cls.userinfo));
|
||||
MSG_WriteString(&msg, va("connect \"\\challenge\\%i\\qport\\%i\\protocol\\%i\\ip\\%s%s\"", cls.challenge, cls.qport, PROTOCOL_VERSION_Q3, NET_AdrToString (adrbuf, sizeof(adrbuf), net_local_cl_ipadr), cls.userinfo));
|
||||
Huff_EncryptPacket(&msg, 12);
|
||||
Huff_PreferedCompressionCRC();
|
||||
NET_SendPacket (NS_CLIENT, msg.cursize, msg.data, to);
|
||||
|
|
|
@ -299,6 +299,8 @@ void M_DrawServerList(void)
|
|||
int x;
|
||||
int y = 8*3;
|
||||
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
CL_QueryServers();
|
||||
|
||||
slist_numoptions = 0;
|
||||
|
@ -435,7 +437,7 @@ void M_DrawServerList(void)
|
|||
if (sb_showping.value)
|
||||
x = M_AddColumn(x, y, va("%i", server->ping), 4, colour, highlight); //frag limit
|
||||
if (sb_showaddress.value)
|
||||
x = M_AddColumn(x, y, NET_AdrToString(server->adr), 21, colour, highlight);
|
||||
x = M_AddColumn(x, y, NET_AdrToString(adr, sizeof(adr), server->adr), 21, colour, highlight);
|
||||
x = M_AddColumn(x, y, server->name, x/8-1, colour, highlight);
|
||||
}
|
||||
|
||||
|
@ -705,6 +707,7 @@ master_t *M_FindCurrentMaster(void)
|
|||
{
|
||||
master_t *mast;
|
||||
int op = slist_option;
|
||||
|
||||
for (mast = master; mast; mast = mast->next)
|
||||
{
|
||||
if (M_MasterIsFiltered(mast))
|
||||
|
@ -717,6 +720,8 @@ master_t *M_FindCurrentMaster(void)
|
|||
|
||||
void M_SListKey(int key)
|
||||
{
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (key == K_ESCAPE)
|
||||
{
|
||||
// if (selectedserver.inuse)
|
||||
|
@ -812,7 +817,7 @@ void M_SListKey(int key)
|
|||
}
|
||||
else if (key == 'c')
|
||||
{
|
||||
Sys_SaveClipboard(NET_AdrToString(selectedserver.adr));
|
||||
Sys_SaveClipboard(NET_AdrToString(adr, sizeof(adr), selectedserver.adr));
|
||||
}
|
||||
else if (key == 'f')
|
||||
{
|
||||
|
@ -857,9 +862,9 @@ void M_SListKey(int key)
|
|||
Cbuf_AddText("spectator 0\n", RESTRICT_LOCAL);
|
||||
|
||||
if (server->special & SS_NETQUAKE)
|
||||
Cbuf_AddText(va("nqconnect %s\n", NET_AdrToString(server->adr)), RESTRICT_LOCAL);
|
||||
Cbuf_AddText(va("nqconnect %s\n", NET_AdrToString(adr, sizeof(adr), server->adr)), RESTRICT_LOCAL);
|
||||
else
|
||||
Cbuf_AddText(va("connect %s\n", NET_AdrToString(server->adr)), RESTRICT_LOCAL);
|
||||
Cbuf_AddText(va("connect %s\n", NET_AdrToString(adr, sizeof(adr), server->adr)), RESTRICT_LOCAL);
|
||||
|
||||
M_ToggleMenu_f();
|
||||
M_ToggleMenu_f();
|
||||
|
@ -1050,6 +1055,8 @@ void SL_ServerDraw (int x, int y, menucustom_t *ths, menu_t *menu)
|
|||
serverinfo_t *si;
|
||||
int thisone = (int)ths->data + info->scrollpos;
|
||||
servertypes_t stype;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
si = Master_SortedServer(thisone);
|
||||
if (si)
|
||||
{
|
||||
|
@ -1084,7 +1091,7 @@ void SL_ServerDraw (int x, int y, menucustom_t *ths, menu_t *menu)
|
|||
if (sb_showmap.value) {Draw_FunStringLen((x-8)*8, y, si->map, 8); x-=9;}
|
||||
if (sb_showgamedir.value) {Draw_FunStringLen((x-8)*8, y, si->gamedir, 8); x-=9;}
|
||||
if (sb_showping.value) {Draw_FunStringLen((x-3)*8, y, va("%i", si->ping), 3); x-=4;}
|
||||
if (sb_showaddress.value) {Draw_FunStringLen((x-21)*8, y, NET_AdrToString(si->adr), 21); x-=22;}
|
||||
if (sb_showaddress.value) {Draw_FunStringLen((x-21)*8, y, NET_AdrToString(adr, sizeof(adr), si->adr), 21); x-=22;}
|
||||
Draw_FunStringLen(0, y, si->name, x);
|
||||
}
|
||||
}
|
||||
|
@ -1096,6 +1103,8 @@ qboolean SL_ServerKey (menucustom_t *ths, menu_t *menu, int key)
|
|||
extern int mousecursor_x, mousecursor_y;
|
||||
serverlist_t *info = (serverlist_t*)(menu + 1);
|
||||
serverinfo_t *server;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (key == K_MOUSE1)
|
||||
{
|
||||
oldselection = info->selectedpos;
|
||||
|
@ -1151,9 +1160,9 @@ joinserver:
|
|||
}
|
||||
|
||||
if (server->special & SS_NETQUAKE)
|
||||
Cbuf_AddText(va("nqconnect %s\n", NET_AdrToString(server->adr)), RESTRICT_LOCAL);
|
||||
Cbuf_AddText(va("nqconnect %s\n", NET_AdrToString(adr, sizeof(adr), server->adr)), RESTRICT_LOCAL);
|
||||
else
|
||||
Cbuf_AddText(va("connect %s\n", NET_AdrToString(server->adr)), RESTRICT_LOCAL);
|
||||
Cbuf_AddText(va("connect %s\n", NET_AdrToString(adr, sizeof(adr), server->adr)), RESTRICT_LOCAL);
|
||||
|
||||
M_RemoveAllMenus();
|
||||
}
|
||||
|
@ -1505,6 +1514,8 @@ void M_QuickConnect_PreDraw(menu_t *menu)
|
|||
{
|
||||
serverinfo_t *best = NULL;
|
||||
serverinfo_t *s;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
NET_CheckPollSockets(); //see if we were told something important.
|
||||
CL_QueryServers();
|
||||
|
||||
|
@ -1535,9 +1546,9 @@ void M_QuickConnect_PreDraw(menu_t *menu)
|
|||
Con_Printf("Quick connect found %s (gamedir %s, players %i/%i, ping %ims)\n", best->name, best->gamedir, best->players, best->maxplayers, best->ping);
|
||||
|
||||
if (best->special & SS_NETQUAKE)
|
||||
Cbuf_AddText(va("nqconnect %s\n", NET_AdrToString(best->adr)), RESTRICT_LOCAL);
|
||||
Cbuf_AddText(va("nqconnect %s\n", NET_AdrToString(adr, sizeof(adr), best->adr)), RESTRICT_LOCAL);
|
||||
else
|
||||
Cbuf_AddText(va("join %s\n", NET_AdrToString(best->adr)), RESTRICT_LOCAL);
|
||||
Cbuf_AddText(va("join %s\n", NET_AdrToString(adr, sizeof(adr), best->adr)), RESTRICT_LOCAL);
|
||||
|
||||
M_ToggleMenu_f();
|
||||
return;
|
||||
|
|
|
@ -447,6 +447,8 @@ float Master_ReadKeyFloat(serverinfo_t *server, int keynum)
|
|||
|
||||
char *Master_ReadKeyString(serverinfo_t *server, int keynum)
|
||||
{
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (keynum < SLKEY_CUSTOM)
|
||||
{
|
||||
switch(keynum)
|
||||
|
@ -456,7 +458,7 @@ char *Master_ReadKeyString(serverinfo_t *server, int keynum)
|
|||
case SLKEY_NAME:
|
||||
return server->name;
|
||||
case SLKEY_ADDRESS:
|
||||
return NET_AdrToString(server->adr);
|
||||
return NET_AdrToString(adr, sizeof(adr), server->adr);
|
||||
case SLKEY_GAMEDIR:
|
||||
return server->gamedir;
|
||||
|
||||
|
@ -772,6 +774,8 @@ int NET_CheckPollSockets(void)
|
|||
extern qbyte net_message_buffer[MAX_UDP_PACKET];
|
||||
int sock;
|
||||
SOCKET usesocket;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
for (sock = 0; sock < POLLUDPSOCKETS+POLLIPXSOCKETS; sock++)
|
||||
{
|
||||
int ret;
|
||||
|
@ -798,7 +802,7 @@ int NET_CheckPollSockets(void)
|
|||
{
|
||||
SockadrToNetadr (&from, &net_from);
|
||||
Con_Printf ("Warning: Oversize packet from %s\n",
|
||||
NET_AdrToString (net_from));
|
||||
NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
continue;
|
||||
}
|
||||
if (qerrno == ECONNABORTED || qerrno == ECONNRESET)
|
||||
|
@ -816,7 +820,7 @@ int NET_CheckPollSockets(void)
|
|||
net_message.cursize = ret;
|
||||
if (ret == sizeof(net_message_buffer) )
|
||||
{
|
||||
Con_Printf ("Oversize packet from %s\n", NET_AdrToString (net_from));
|
||||
Con_Printf ("Oversize packet from %s\n", NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -989,6 +993,8 @@ void MasterInfo_ProcessHTTP(char *name, qboolean success, int type)
|
|||
char *s;
|
||||
char *el;
|
||||
serverinfo_t *info;
|
||||
char adrbuf[MAX_ADR_SIZE];
|
||||
|
||||
if (!success)
|
||||
return;
|
||||
|
||||
|
@ -1026,7 +1032,7 @@ void MasterInfo_ProcessHTTP(char *name, qboolean success, int type)
|
|||
info->special = type;
|
||||
info->refreshtime = 0;
|
||||
|
||||
snprintf(info->name, sizeof(info->name), "%s", NET_AdrToString(info->adr));
|
||||
snprintf(info->name, sizeof(info->name), "%s", NET_AdrToString(adrbuf, sizeof(adrbuf), info->adr));
|
||||
|
||||
info->next = firstserver;
|
||||
firstserver = info;
|
||||
|
@ -1134,6 +1140,7 @@ void MasterInfo_WriteServers(void)
|
|||
master_t *mast;
|
||||
serverinfo_t *server;
|
||||
FILE *mf, *qws;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
mf = fopen("masters.txt", "wt");
|
||||
if (!mf)
|
||||
|
@ -1197,7 +1204,7 @@ void MasterInfo_WriteServers(void)
|
|||
if (mast->address)
|
||||
fprintf(mf, "%s\t%s\t%s\n", mast->address , typename, mast->name);
|
||||
else
|
||||
fprintf(mf, "%s\t%s\t%s\n", NET_AdrToString(mast->adr), typename, mast->name);
|
||||
fprintf(mf, "%s\t%s\t%s\n", NET_AdrToString(adr, sizeof(adr), mast->adr), typename, mast->name);
|
||||
}
|
||||
|
||||
if (slist_writeserverstxt.value)
|
||||
|
@ -1212,15 +1219,15 @@ void MasterInfo_WriteServers(void)
|
|||
if (server->special & SS_FAVORITE)
|
||||
{
|
||||
if (server->special & SS_QUAKE3)
|
||||
fprintf(mf, "%s\t%s\t%s\n", NET_AdrToString(server->adr), "favorite:q3", server->name);
|
||||
fprintf(mf, "%s\t%s\t%s\n", NET_AdrToString(adr, sizeof(adr), server->adr), "favorite:q3", server->name);
|
||||
else if (server->special & SS_QUAKE2)
|
||||
fprintf(mf, "%s\t%s\t%s\n", NET_AdrToString(server->adr), "favorite:q2", server->name);
|
||||
fprintf(mf, "%s\t%s\t%s\n", NET_AdrToString(adr, sizeof(adr), server->adr), "favorite:q2", server->name);
|
||||
else if (server->special & SS_NETQUAKE)
|
||||
fprintf(mf, "%s\t%s\t%s\n", NET_AdrToString(server->adr), "favorite:nq", server->name);
|
||||
fprintf(mf, "%s\t%s\t%s\n", NET_AdrToString(adr, sizeof(adr), server->adr), "favorite:nq", server->name);
|
||||
else if (qws) //servers.txt doesn't support the extra info.
|
||||
fprintf(qws, "%s\t%s\n", NET_AdrToString(server->adr), server->name);
|
||||
fprintf(qws, "%s\t%s\n", NET_AdrToString(adr, sizeof(adr), server->adr), server->name);
|
||||
else //read only? damn them!
|
||||
fprintf(mf, "%s\t%s\t%s\n", NET_AdrToString(server->adr), "favorite:qw", server->name);
|
||||
fprintf(mf, "%s\t%s\t%s\n", NET_AdrToString(adr, sizeof(adr), server->adr), "favorite:qw", server->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1478,6 +1485,7 @@ int CL_ReadServerInfo(char *msg, int servertype, qboolean favorite)
|
|||
int ping;
|
||||
int len;
|
||||
serverinfo_t *info;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
info = Master_InfoForServer(net_from);
|
||||
|
||||
|
@ -1492,7 +1500,7 @@ int CL_ReadServerInfo(char *msg, int servertype, qboolean favorite)
|
|||
|
||||
info->adr = net_from;
|
||||
|
||||
snprintf(info->name, sizeof(info->name), "%s", NET_AdrToString(info->adr));
|
||||
snprintf(info->name, sizeof(info->name), "%s", NET_AdrToString(adr, sizeof(adr), info->adr));
|
||||
|
||||
info->next = firstserver;
|
||||
firstserver = info;
|
||||
|
@ -1692,6 +1700,8 @@ void CL_MasterListParse(int type, qboolean slashpad)
|
|||
serverinfo_t *last, *old;
|
||||
|
||||
int p1, p2;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
MSG_ReadByte ();
|
||||
|
||||
last = firstserver;
|
||||
|
@ -1730,7 +1740,7 @@ void CL_MasterListParse(int type, qboolean slashpad)
|
|||
info->special = type;
|
||||
info->refreshtime = 0;
|
||||
|
||||
snprintf(info->name, sizeof(info->name), "%s", NET_AdrToString(info->adr));
|
||||
snprintf(info->name, sizeof(info->name), "%s", NET_AdrToString(adr, sizeof(adr), info->adr));
|
||||
|
||||
info->next = last;
|
||||
last = info;
|
||||
|
|
|
@ -2029,9 +2029,10 @@ static void PF_cs_serverkey (progfuncs_t *prinst, struct globalvars_s *pr_global
|
|||
{
|
||||
char *keyname = PF_VarString(prinst, 0, pr_globals);
|
||||
char *ret;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (!strcmp(keyname, "ip"))
|
||||
ret = NET_AdrToString(cls.netchan.remote_address);
|
||||
ret = NET_AdrToString(adr, sizeof(adr), cls.netchan.remote_address);
|
||||
else if (!strcmp(keyname, "protocol"))
|
||||
{ //using this is pretty acedemic, really. Not particuarly portable.
|
||||
switch (cls.protocol)
|
||||
|
|
|
@ -835,7 +835,7 @@ void SND_Spatialize(soundcardinfo_t *sc, channel_t *ch)
|
|||
{
|
||||
for (i = 0; i < sc->sn.numchannels; i++)
|
||||
{
|
||||
ch->vol[i] = ch->master_vol * snd_playersoundvolume.value;
|
||||
ch->vol[i] = ch->master_vol * (ruleset_allow_localvolume.value ? snd_playersoundvolume.value : 1);
|
||||
ch->delay[i] = 0;
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -310,12 +310,14 @@ void Validation_FlushFileList(void)
|
|||
|
||||
static void Validation_Server(void)
|
||||
{
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#warning is allowing the user to turn this off practical?..
|
||||
#endif
|
||||
if (!allow_f_server.value)
|
||||
return;
|
||||
Cbuf_AddText(va("say server is %s\n", NET_AdrToString(cls.netchan.remote_address)), RESTRICT_LOCAL);
|
||||
Cbuf_AddText(va("say server is %s\n", NET_AdrToString(adr, sizeof(adr), cls.netchan.remote_address)), RESTRICT_LOCAL);
|
||||
}
|
||||
|
||||
static void Validation_Skins(void)
|
||||
|
@ -404,6 +406,7 @@ rulesetrule_t rulesetrules_strict[] = {
|
|||
{"ruleset_allow_larger_models", "0"},
|
||||
{"ruleset_allow_modified_eyes", "0"},
|
||||
{"ruleset_allow_sensative_texture_replacements", "0"},
|
||||
{"ruleset_allow_localvolume", "0"},
|
||||
{"tp_disputablemacros", "0"},
|
||||
{"cl_instantrotate", "0"},
|
||||
{NULL}
|
||||
|
@ -417,6 +420,7 @@ rulesetrule_t rulesetrules_nqr[] = {
|
|||
{"ruleset_allow_frj", "0"},
|
||||
{"ruleset_allow_modified_eyes", "0"},
|
||||
{"ruleset_allow_sensative_texture_replacements", "0"},
|
||||
{"ruleset_allow_localvolume", "0"},
|
||||
{"gl_shadeq1", "0"},
|
||||
{"gl_shadeq3", "0"},
|
||||
{NULL}
|
||||
|
|
|
@ -2684,6 +2684,7 @@ char *COM_GetPathInfo (int i, int *crc)
|
|||
|
||||
searchpath_t *s;
|
||||
static char name[MAX_OSPATH];
|
||||
char adr[MAX_ADR_SIZE];
|
||||
char *protocol;
|
||||
|
||||
for (s=com_searchpaths ; s ; s=s->next)
|
||||
|
@ -2697,7 +2698,7 @@ char *COM_GetPathInfo (int i, int *crc)
|
|||
|
||||
#ifdef WEBSERVER
|
||||
if (httpserver.value)
|
||||
protocol = va("http://%s/", NET_AdrToString (net_local_sv_ipadr));
|
||||
protocol = va("http://%s/", NET_AdrToString(adr, sizeof(adr), net_local_sv_ipadr));
|
||||
else
|
||||
#endif
|
||||
protocol = "qw://";
|
||||
|
|
|
@ -270,10 +270,13 @@ void Con_Log (char *s)
|
|||
void SV_LogPlayer(client_t *cl, char *msg)
|
||||
{
|
||||
char line[2048];
|
||||
char remote_adr[MAX_ADR_SIZE];
|
||||
char realip_adr[MAX_ADR_SIZE];
|
||||
|
||||
snprintf(line, sizeof(line),
|
||||
"%s\\%s\\%i\\%s\\%s\\%i%s\n",
|
||||
msg, cl->name, cl->userid,
|
||||
NET_BaseAdrToString(cl->netchan.remote_address), (cl->realip_status > 0 ? NET_BaseAdrToString(cl->realip) : "??"),
|
||||
NET_BaseAdrToString(remote_adr, sizeof(remote_adr), cl->netchan.remote_address), (cl->realip_status > 0 ? NET_BaseAdrToString(realip_adr, sizeof(realip_adr), cl->realip) : "??"),
|
||||
cl->netchan.remote_address.port, cl->userinfo);
|
||||
|
||||
Log_String(LOG_PLAYER, line);
|
||||
|
|
|
@ -79,8 +79,8 @@ void NET_SendPacket (netsrc_t socket, int length, void *data, netadr_t to);
|
|||
|
||||
qboolean NET_CompareAdr (netadr_t a, netadr_t b);
|
||||
qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b);
|
||||
char *NET_AdrToString (netadr_t a);
|
||||
char *NET_BaseAdrToString (netadr_t a);
|
||||
char *NET_AdrToString (char *s, int len, netadr_t a);
|
||||
char *NET_BaseAdrToString (char *s, int len, netadr_t a);
|
||||
qboolean NET_StringToSockaddr (char *s, struct sockaddr_qstorage *sadr);
|
||||
qboolean NET_StringToAdr (char *s, netadr_t *a);
|
||||
qboolean NET_IsClientLegal(netadr_t *adr);
|
||||
|
@ -88,7 +88,7 @@ qboolean NET_IsClientLegal(netadr_t *adr);
|
|||
qboolean NET_IsLoopBackAddress (netadr_t adr);
|
||||
|
||||
qboolean NET_StringToAdrMasked (char *s, netadr_t *a, netadr_t *amask);
|
||||
char *NET_AdrToStringMasked (netadr_t a, netadr_t amask);
|
||||
char *NET_AdrToStringMasked (char *s, int len, netadr_t a, netadr_t amask);
|
||||
void NET_IntegerToMask (netadr_t *a, netadr_t *amask, int bits);
|
||||
qboolean NET_CompareAdrMasked(netadr_t a, netadr_t b, netadr_t mask);
|
||||
|
||||
|
@ -97,6 +97,7 @@ qboolean NET_CompareAdrMasked(netadr_t a, netadr_t b, netadr_t mask);
|
|||
#define OLD_AVG 0.99 // total = oldtotal*OLD_AVG + new*(1-OLD_AVG)
|
||||
|
||||
#define MAX_LATENT 32
|
||||
#define MAX_ADR_SIZE 64
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
@ -346,6 +346,7 @@ void Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
|
|||
sizebuf_t send;
|
||||
qbyte send_buf[MAX_OVERALLMSGLEN + PACKET_HEADER];
|
||||
qboolean send_reliable;
|
||||
char remote_adr[MAX_ADR_SIZE];
|
||||
unsigned w1, w2;
|
||||
int i;
|
||||
|
||||
|
@ -422,7 +423,7 @@ void Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
|
|||
{
|
||||
chan->fatal_error = true;
|
||||
Con_TPrintf (TL_OUTMESSAGEOVERFLOW
|
||||
, NET_AdrToString (chan->remote_address));
|
||||
, NET_AdrToString (remote_adr, sizeof(remote_adr), chan->remote_address));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -527,6 +528,7 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
{
|
||||
unsigned sequence, sequence_ack;
|
||||
unsigned reliable_ack, reliable_message;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
#ifndef CLIENTONLY
|
||||
int qport;
|
||||
#endif
|
||||
|
@ -600,7 +602,7 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
{
|
||||
if (showdrop.value)
|
||||
Con_TPrintf (TL_OUTOFORDERPACKET
|
||||
, NET_AdrToString (chan->remote_address)
|
||||
, NET_AdrToString (adr, sizeof(adr), chan->remote_address)
|
||||
, sequence
|
||||
, chan->incoming_sequence);
|
||||
return false;
|
||||
|
@ -616,7 +618,7 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
|
||||
if (showdrop.value)
|
||||
Con_TPrintf (TL_DROPPEDPACKETCOUNT
|
||||
, NET_AdrToString (chan->remote_address)
|
||||
, NET_AdrToString (adr, sizeof(adr), chan->remote_address)
|
||||
, sequence-(chan->incoming_sequence+1)
|
||||
, sequence);
|
||||
}
|
||||
|
|
|
@ -317,11 +317,10 @@ qboolean NET_AddressSmellsFunny(netadr_t a)
|
|||
}
|
||||
}
|
||||
|
||||
char *NET_AdrToString (netadr_t a)
|
||||
char *NET_AdrToString (char *s, int len, netadr_t a)
|
||||
{
|
||||
qboolean doneblank;
|
||||
char *p;
|
||||
static char s[64];
|
||||
int i;
|
||||
|
||||
switch(a.type)
|
||||
|
@ -410,10 +409,9 @@ char *NET_AdrToString (netadr_t a)
|
|||
return s;
|
||||
}
|
||||
|
||||
char *NET_BaseAdrToString (netadr_t a)
|
||||
char *NET_BaseAdrToString (char *s, int len, netadr_t a)
|
||||
{
|
||||
int i, doneblank;
|
||||
static char s[64];
|
||||
char *p;
|
||||
|
||||
switch(a.type)
|
||||
|
@ -1080,23 +1078,17 @@ int UniformMaskedBits(netadr_t mask)
|
|||
return bits; // all checks passed
|
||||
}
|
||||
|
||||
char *NET_AdrToStringMasked (netadr_t a, netadr_t amask)
|
||||
char *NET_AdrToStringMasked (char *s, int len, netadr_t a, netadr_t amask)
|
||||
{
|
||||
static char s[128];
|
||||
int i;
|
||||
char adr[MAX_ADR_SIZE], mask[MAX_ADR_SIZE];
|
||||
|
||||
i = UniformMaskedBits(amask);
|
||||
|
||||
if (i >= 0)
|
||||
sprintf(s, "%s/%i", NET_AdrToString(a), i);
|
||||
sprintf(s, "%s/%i", NET_AdrToString(adr, sizeof(adr), a), i);
|
||||
else
|
||||
{
|
||||
// has to be done this way due to NET_AdrToString returning a
|
||||
// static address
|
||||
Q_strncatz(s, NET_AdrToString(a), sizeof(s));
|
||||
Q_strncatz(s, "/", sizeof(s));
|
||||
Q_strncatz(s, NET_AdrToString(amask), sizeof(s));
|
||||
}
|
||||
sprintf(s, "%s/%s", NET_AdrToString(adr, sizeof(adr), a), NET_AdrToString(mask, sizeof(mask), amask));
|
||||
|
||||
return s;
|
||||
}
|
||||
|
@ -1303,6 +1295,7 @@ qboolean NET_GetPacket (netsrc_t netsrc)
|
|||
int i;
|
||||
int socket;
|
||||
int err;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (NET_GetLoopPacket(netsrc, &net_from, &net_message))
|
||||
return true;
|
||||
|
@ -1353,7 +1346,7 @@ qboolean NET_GetPacket (netsrc_t netsrc)
|
|||
{
|
||||
SockadrToNetadr (&from, &net_from);
|
||||
Con_TPrintf (TL_OVERSIZEPACKETFROM,
|
||||
NET_AdrToString (net_from));
|
||||
NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
continue;
|
||||
}
|
||||
if (err == ECONNABORTED || err == ECONNRESET)
|
||||
|
@ -1383,7 +1376,7 @@ qboolean NET_GetPacket (netsrc_t netsrc)
|
|||
net_message.cursize = ret;
|
||||
if (net_message.cursize == sizeof(net_message_buffer) )
|
||||
{
|
||||
Con_TPrintf (TL_OVERSIZEPACKETFROM, NET_AdrToString (net_from));
|
||||
Con_TPrintf (TL_OVERSIZEPACKETFROM, NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1440,7 +1433,7 @@ qboolean NET_GetPacket (netsrc_t netsrc)
|
|||
{
|
||||
closesocket(cls.sockettcp);
|
||||
cls.sockettcp = INVALID_SOCKET;
|
||||
Con_TPrintf (TL_OVERSIZEPACKETFROM, NET_AdrToString (net_from));
|
||||
Con_TPrintf (TL_OVERSIZEPACKETFROM, NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
return false;
|
||||
}
|
||||
if (net_message.cursize+2 > cls.tcpinlen)
|
||||
|
@ -1538,7 +1531,7 @@ qboolean NET_GetPacket (netsrc_t netsrc)
|
|||
net_message.cursize = BigShort(*(short*)st->inbuffer);
|
||||
if (net_message.cursize >= sizeof(net_message_buffer) )
|
||||
{
|
||||
Con_TPrintf (TL_OVERSIZEPACKETFROM, NET_AdrToString (net_from));
|
||||
Con_TPrintf (TL_OVERSIZEPACKETFROM, NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
goto closesvstream;
|
||||
}
|
||||
if (net_message.cursize+2 > st->inlen)
|
||||
|
@ -2065,6 +2058,7 @@ qboolean NET_Sleep(int msec, qboolean stdinissocket)
|
|||
void NET_GetLocalAddress (int socket, netadr_t *out)
|
||||
{
|
||||
char buff[512];
|
||||
char adrbuf[MAX_ADR_SIZE];
|
||||
struct sockaddr_qstorage address;
|
||||
int namelen;
|
||||
netadr_t adr = {0};
|
||||
|
@ -2096,7 +2090,7 @@ void NET_GetLocalAddress (int socket, netadr_t *out)
|
|||
if (notvalid)
|
||||
Con_Printf("Couldn't detect local ip\n");
|
||||
else
|
||||
Con_TPrintf(TL_IPADDRESSIS, NET_AdrToString (*out) );
|
||||
Con_TPrintf(TL_IPADDRESSIS, NET_AdrToString (adrbuf, sizeof(adrbuf), *out) );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -829,6 +829,7 @@ int VARGS Plug_Net_Accept(void *offset, unsigned int mask, const int *arg)
|
|||
int addrlen;
|
||||
int sock;
|
||||
int _true = 1;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (handle < 0 || handle >= pluginstreamarraylen || pluginstreamarray[handle].plugin != currentplug || pluginstreamarray[handle].type != STREAM_SOCKET)
|
||||
return -2;
|
||||
|
@ -851,7 +852,7 @@ int VARGS Plug_Net_Accept(void *offset, unsigned int mask, const int *arg)
|
|||
netadr_t a;
|
||||
char *s;
|
||||
SockadrToNetadr((struct sockaddr_qstorage *)&address, &a);
|
||||
s = NET_AdrToString(a);
|
||||
s = NET_AdrToString(adr, sizeof(adr), a);
|
||||
Q_strncpyz(VM_POINTER(arg[1]), s, addrlen);
|
||||
}
|
||||
|
||||
|
|
|
@ -535,6 +535,7 @@ qboolean Netchan_ProcessQ3 (netchan_t *chan)
|
|||
qboolean fragment;
|
||||
int fragmentStart;
|
||||
int fragmentLength;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
// Get sequence number
|
||||
MSG_BeginReading();
|
||||
|
@ -589,7 +590,7 @@ qboolean Netchan_ProcessQ3 (netchan_t *chan)
|
|||
|
||||
if (chan->drop_count > 0)// && (net_showdrop->integer || net_showpackets->integer))
|
||||
{
|
||||
Con_DPrintf("%s:Dropped %i packets at %i\n", NET_AdrToString(chan->remote_address), chan->drop_count, sequence);
|
||||
Con_DPrintf("%s:Dropped %i packets at %i\n", NET_AdrToString(adr, sizeof(adr), chan->remote_address), chan->drop_count, sequence);
|
||||
}
|
||||
|
||||
if (!fragment)
|
||||
|
@ -611,7 +612,7 @@ qboolean Netchan_ProcessQ3 (netchan_t *chan)
|
|||
{
|
||||
// if(net_showdrop->integer || net_showpackets->integer)
|
||||
{
|
||||
Con_Printf("%s:Dropped a message fragment\n", NET_AdrToString(chan->remote_address));
|
||||
Con_Printf("%s:Dropped a message fragment\n", NET_AdrToString(adr, sizeof(adr), chan->remote_address));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -638,7 +639,7 @@ qboolean Netchan_ProcessQ3 (netchan_t *chan)
|
|||
// Check if assembled message fits in buffer
|
||||
if (chan->in_fragment_length > net_message.maxsize)
|
||||
{
|
||||
Con_Printf("%s:fragmentLength %i > net_message.maxsize\n", NET_AdrToString(chan->remote_address), chan->in_fragment_length);
|
||||
Con_Printf("%s:fragmentLength %i > net_message.maxsize\n", NET_AdrToString(adr, sizeof(adr), chan->remote_address), chan->in_fragment_length);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -737,11 +738,12 @@ void Netchan_TransmitQ3( netchan_t *chan, int length, const qbyte *data )
|
|||
int i;
|
||||
sizebuf_t send;
|
||||
qbyte send_buf[MAX_OVERALLMSGLEN+6];
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
// Check for message overflow
|
||||
if( length > MAX_OVERALLMSGLEN )
|
||||
{
|
||||
Con_Printf( "%s: outgoing message overflow\n", NET_AdrToString( chan->remote_address ) );
|
||||
Con_Printf( "%s: outgoing message overflow\n", NET_AdrToString( adr, sizeof(adr), chan->remote_address ) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -756,7 +758,7 @@ void Netchan_TransmitQ3( netchan_t *chan, int length, const qbyte *data )
|
|||
Netchan_TransmitNextFragment( chan );
|
||||
if( chan->reliable_length )
|
||||
{
|
||||
Con_Printf( "%s: unsent fragments\n", NET_AdrToString( chan->remote_address ) );
|
||||
Con_Printf( "%s: unsent fragments\n", NET_AdrToString( adr, sizeof(adr), chan->remote_address ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1408,6 +1408,7 @@ qboolean PR_GameCodePacket(char *s)
|
|||
globalvars_t *pr_globals;
|
||||
int i;
|
||||
client_t *cl;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (!SV_ParseConnectionlessPacket)
|
||||
return false;
|
||||
|
@ -1431,7 +1432,7 @@ qboolean PR_GameCodePacket(char *s)
|
|||
|
||||
|
||||
|
||||
G_INT(OFS_PARM0) = PR_SetString(svprogfuncs, NET_AdrToString (net_from));
|
||||
G_INT(OFS_PARM0) = PR_SetString(svprogfuncs, NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
|
||||
G_INT(OFS_PARM1) = PR_SetString(svprogfuncs, s);
|
||||
PR_ExecuteProgram (svprogfuncs, SV_ParseConnectionlessPacket);
|
||||
|
@ -5288,7 +5289,7 @@ char *PF_infokey_Internal (int entnum, char *key)
|
|||
{
|
||||
char *value;
|
||||
char ov[256];
|
||||
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (entnum == 0)
|
||||
{
|
||||
|
@ -5304,7 +5305,7 @@ char *PF_infokey_Internal (int entnum, char *key)
|
|||
{
|
||||
value = ov;
|
||||
if (!strcmp(key, "ip") || !strcmp(key, "realip")) //note: FTE doesn't support mvdsv's realip stuff, so pretend that we do if the mod asks
|
||||
value = strcpy(ov, NET_BaseAdrToString (svs.clients[entnum-1].netchan.remote_address));
|
||||
value = strcpy(ov, NET_BaseAdrToString (adr, sizeof(adr), svs.clients[entnum-1].netchan.remote_address));
|
||||
else if (!strcmp(key, "ping"))
|
||||
sprintf(ov, "%d", SV_CalcPing (&svs.clients[entnum-1]));
|
||||
else if (!strcmp(key, "*userid"))
|
||||
|
|
|
@ -860,13 +860,14 @@ void SV_BanList_f (void)
|
|||
{
|
||||
int bancount = 0;
|
||||
bannedips_t *nb = svs.bannedips;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
while (nb)
|
||||
{
|
||||
if (nb->reason[0])
|
||||
Con_Printf("%s, %s\n", NET_AdrToStringMasked(nb->adr, nb->adrmask), nb->reason);
|
||||
Con_Printf("%s, %s\n", NET_AdrToStringMasked(adr, sizeof(adr), nb->adr, nb->adrmask), nb->reason);
|
||||
else
|
||||
Con_Printf("%s\n", NET_AdrToStringMasked(nb->adr, nb->adrmask));
|
||||
Con_Printf("%s\n", NET_AdrToStringMasked(adr, sizeof(adr), nb->adr, nb->adrmask));
|
||||
bancount++;
|
||||
nb = nb->next;
|
||||
}
|
||||
|
@ -878,10 +879,11 @@ void SV_FilterList_f (void)
|
|||
{
|
||||
int filtercount = 0;
|
||||
filteredips_t *nb = svs.filteredips;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
while (nb)
|
||||
{
|
||||
Con_Printf("%s\n", NET_AdrToStringMasked(nb->adr, nb->adrmask));
|
||||
Con_Printf("%s\n", NET_AdrToStringMasked(adr, sizeof(adr), nb->adr, nb->adrmask));
|
||||
filtercount++;
|
||||
nb = nb->next;
|
||||
}
|
||||
|
@ -896,6 +898,7 @@ void SV_Unban_f (void)
|
|||
bannedips_t *nbnext;
|
||||
netadr_t unbanadr = {0};
|
||||
netadr_t unbanmask = {0};
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (Cmd_Argc() < 2)
|
||||
{
|
||||
|
@ -917,7 +920,7 @@ void SV_Unban_f (void)
|
|||
if (all || (NET_CompareAdr(nb->adr, unbanadr) && NET_CompareAdr(nb->adrmask, unbanmask)))
|
||||
{
|
||||
if (!all)
|
||||
Con_Printf("unbanned %s\n", NET_AdrToStringMasked(nb->adr, nb->adrmask));
|
||||
Con_Printf("unbanned %s\n", NET_AdrToStringMasked(adr, sizeof(adr), nb->adr, nb->adrmask));
|
||||
if (svs.bannedips == nb)
|
||||
svs.bannedips = nbnext;
|
||||
Z_Free(nb);
|
||||
|
@ -935,6 +938,7 @@ void SV_Unfilter_f (void)
|
|||
filteredips_t *nbnext;
|
||||
netadr_t unbanadr = {0};
|
||||
netadr_t unbanmask = {0};
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (Cmd_Argc() < 2)
|
||||
{
|
||||
|
@ -956,7 +960,7 @@ void SV_Unfilter_f (void)
|
|||
if (all || (NET_CompareAdr(nb->adr, unbanadr) && NET_CompareAdr(nb->adrmask, unbanmask)))
|
||||
{
|
||||
if (!all)
|
||||
Con_Printf("unfiltered %s\n", NET_AdrToStringMasked(nb->adr, nb->adrmask));
|
||||
Con_Printf("unfiltered %s\n", NET_AdrToStringMasked(adr, sizeof(adr), nb->adr, nb->adrmask));
|
||||
if (svs.filteredips == nb)
|
||||
svs.filteredips = nbnext;
|
||||
Z_Free(nb);
|
||||
|
@ -974,6 +978,7 @@ void SV_WriteIP_f (void)
|
|||
bannedips_t *bi;
|
||||
filteredips_t *fi;
|
||||
char *s;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
strcpy (name, "listip.cfg");
|
||||
|
||||
|
@ -993,9 +998,9 @@ void SV_WriteIP_f (void)
|
|||
while (bi)
|
||||
{
|
||||
if (bi->reason[0])
|
||||
s = va("banip %s \"%s\"\n", NET_AdrToStringMasked(bi->adr, bi->adrmask), bi->reason);
|
||||
s = va("banip %s \"%s\"\n", NET_AdrToStringMasked(adr, sizeof(adr), bi->adr, bi->adrmask), bi->reason);
|
||||
else
|
||||
s = va("banip %s\n", NET_AdrToStringMasked(bi->adr, bi->adrmask));
|
||||
s = va("banip %s\n", NET_AdrToStringMasked(adr, sizeof(adr), bi->adr, bi->adrmask));
|
||||
VFS_WRITE(f, s, strlen(s));
|
||||
bi = bi->next;
|
||||
}
|
||||
|
@ -1006,7 +1011,7 @@ void SV_WriteIP_f (void)
|
|||
fi = svs.filteredips;
|
||||
while (fi)
|
||||
{
|
||||
s = va("addip %s\n", NET_AdrToStringMasked(fi->adr, fi->adrmask));
|
||||
s = va("addip %s\n", NET_AdrToStringMasked(adr, sizeof(adr), fi->adr, fi->adrmask));
|
||||
VFS_WRITE(f, s, strlen(s));
|
||||
fi = fi->next;
|
||||
}
|
||||
|
@ -1279,6 +1284,7 @@ void SV_Status_f (void)
|
|||
client_t *cl;
|
||||
float cpu, avg, pak;
|
||||
char *s;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
int columns = 80;
|
||||
|
||||
|
@ -1292,9 +1298,9 @@ void SV_Status_f (void)
|
|||
if (!sv.state)
|
||||
{
|
||||
if (net_local_sv_ipadr.type != NA_LOOPBACK)
|
||||
Con_Printf ("ip address : %s\n",NET_AdrToString (net_local_sv_ipadr));
|
||||
Con_Printf ("ip address : %s\n",NET_AdrToString (adr, sizeof(adr), net_local_sv_ipadr));
|
||||
if (net_local_sv_ip6adr.type != NA_LOOPBACK)
|
||||
Con_Printf ("ipv6 address : %s\n",NET_AdrToString (net_local_sv_ip6adr));
|
||||
Con_Printf ("ipv6 address : %s\n",NET_AdrToString (adr, sizeof(adr), net_local_sv_ip6adr));
|
||||
|
||||
Con_Printf("Server is not running\n");
|
||||
return;
|
||||
|
@ -1313,17 +1319,17 @@ void SV_Status_f (void)
|
|||
{
|
||||
extern cvar_t pr_imitatemvdsv;
|
||||
if (pr_imitatemvdsv.value) //ktpro requires 'net address' for some reason that I don't remember
|
||||
Con_Printf ("net address : %s\n",NET_AdrToString (net_local_sv_ipadr));
|
||||
Con_Printf ("net address : %s\n",NET_AdrToString (adr, sizeof(adr), net_local_sv_ipadr));
|
||||
else
|
||||
Con_Printf ("ip address : %s\n",NET_AdrToString (net_local_sv_ipadr));
|
||||
Con_Printf ("ip address : %s\n",NET_AdrToString (adr, sizeof(adr), net_local_sv_ipadr));
|
||||
}
|
||||
if (svs.socketip6 != INVALID_SOCKET && net_local_sv_ip6adr.type != NA_LOOPBACK)
|
||||
Con_Printf ("ipv6 address : %s\n",NET_AdrToString (net_local_sv_ip6adr));
|
||||
Con_Printf ("ipv6 address : %s\n",NET_AdrToString (adr, sizeof(adr), net_local_sv_ip6adr));
|
||||
if (svs.socketipx != INVALID_SOCKET && net_local_sv_ipxadr.type != NA_LOOPBACK)
|
||||
Con_Printf ("ipx address : %s\n",NET_AdrToString (net_local_sv_ipxadr));
|
||||
Con_Printf ("ipx address : %s\n",NET_AdrToString (adr, sizeof(adr), net_local_sv_ipxadr));
|
||||
#ifdef TCPCONNECT
|
||||
if (svs.sockettcp != INVALID_SOCKET && net_local_sv_tcpipadr.type != NA_LOOPBACK)
|
||||
Con_Printf ("tcp address : %s\n",NET_AdrToString (net_local_sv_tcpipadr));
|
||||
Con_Printf ("tcp address : %s\n",NET_AdrToString (adr, sizeof(adr), net_local_sv_tcpipadr));
|
||||
#endif
|
||||
|
||||
Con_Printf ("cpu utilization : %3i%%\n",(int)cpu);
|
||||
|
@ -1358,7 +1364,7 @@ void SV_Status_f (void)
|
|||
else if (cl->protocol == SCP_BAD)
|
||||
s = "bot";
|
||||
else
|
||||
s = NET_BaseAdrToString ( cl->netchan.remote_address);
|
||||
s = NET_BaseAdrToString (adr, sizeof(adr), cl->netchan.remote_address);
|
||||
Con_Printf (" %-16.16s", s);
|
||||
if (cl->state == cs_connected)
|
||||
{
|
||||
|
@ -1391,7 +1397,7 @@ void SV_Status_f (void)
|
|||
else if (cl->protocol == SCP_BAD)
|
||||
s = "bot";
|
||||
else
|
||||
s = NET_BaseAdrToString ( cl->netchan.remote_address);
|
||||
s = NET_BaseAdrToString (adr, sizeof(adr), cl->netchan.remote_address);
|
||||
Con_Printf ("%s", s);
|
||||
l = 16 - strlen(s);
|
||||
for (j=0 ; j<l ; j++)
|
||||
|
|
|
@ -1110,6 +1110,7 @@ void SVC_Log (void)
|
|||
{
|
||||
int seq;
|
||||
char data[MAX_DATAGRAM+64];
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (Cmd_Argc() == 2)
|
||||
seq = atoi(Cmd_Argv(1));
|
||||
|
@ -1123,7 +1124,7 @@ void SVC_Log (void)
|
|||
return;
|
||||
}
|
||||
|
||||
Con_DPrintf ("sending log %i to %s\n", svs.logsequence-1, NET_AdrToString(net_from));
|
||||
Con_DPrintf ("sending log %i to %s\n", svs.logsequence-1, NET_AdrToString(adr, sizeof(adr), net_from));
|
||||
|
||||
sprintf (data, "stdlog %i\n", svs.logsequence-1);
|
||||
strcat (data, (char *)svs.log_buf[((svs.logsequence-1)&1)]);
|
||||
|
@ -1498,6 +1499,7 @@ client_t *SVC_DirectConnect(void)
|
|||
|
||||
|
||||
char *name;
|
||||
char adrbuf[MAX_ADR_SIZE];
|
||||
|
||||
if (*(Cmd_Argv(0)+7) == '\\')
|
||||
{
|
||||
|
@ -1641,7 +1643,7 @@ client_t *SVC_DirectConnect(void)
|
|||
stricmp(spectator_password.string, "none") &&
|
||||
strcmp(spectator_password.string, s) )
|
||||
{ // failed
|
||||
Con_Printf ("%s:spectator password failed\n", NET_AdrToString (net_from));
|
||||
Con_Printf ("%s:spectator password failed\n", NET_AdrToString (adrbuf, sizeof(adrbuf), net_from));
|
||||
SV_RejectMessage (protocol, "requires a spectator password\n\n");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1656,7 +1658,7 @@ client_t *SVC_DirectConnect(void)
|
|||
stricmp(password.string, "none") &&
|
||||
strcmp(password.string, s) )
|
||||
{
|
||||
Con_Printf ("%s:password failed\n", NET_AdrToString (net_from));
|
||||
Con_Printf ("%s:password failed\n", NET_AdrToString (adrbuf, sizeof(adrbuf), net_from));
|
||||
SV_RejectMessage (protocol, "server requires a password\n\n");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1707,14 +1709,14 @@ client_t *SVC_DirectConnect(void)
|
|||
if (cl->state == cs_connected)
|
||||
{
|
||||
if (cl->protocol != protocol)
|
||||
Con_Printf("%s: diff prot connect\n", NET_AdrToString (adr));
|
||||
Con_Printf("%s: diff prot connect\n", NET_AdrToString (adrbuf, sizeof(adrbuf), adr));
|
||||
else
|
||||
Con_Printf("%s:dup connect\n", NET_AdrToString (adr));
|
||||
Con_Printf("%s:dup connect\n", NET_AdrToString (adrbuf, sizeof(adrbuf), adr));
|
||||
nextuserid--;
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
Con_Printf ("%s:reconnect\n", NET_AdrToString (adr));
|
||||
Con_Printf ("%s:reconnect\n", NET_AdrToString (adrbuf, sizeof(adrbuf), adr));
|
||||
// SV_DropClient (cl);
|
||||
}
|
||||
break;
|
||||
|
@ -1803,7 +1805,7 @@ client_t *SVC_DirectConnect(void)
|
|||
|| (!spectator && clients >= (int)maxclients.value)
|
||||
|| (clients + spectators >= sv.allocated_client_slots) ))
|
||||
{
|
||||
Con_Printf ("%s:full connect\n", NET_AdrToString (adr));
|
||||
Con_Printf ("%s:full connect\n", NET_AdrToString (adrbuf, sizeof(adrbuf), adr));
|
||||
SV_RejectMessage (protocol, "\nserver is full\n\n");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1823,7 +1825,7 @@ client_t *SVC_DirectConnect(void)
|
|||
Con_Printf ("WARNING: miscounted available clients\n");
|
||||
else
|
||||
{
|
||||
Con_Printf ("%s:full connect\n", NET_AdrToString (adr));
|
||||
Con_Printf ("%s:full connect\n", NET_AdrToString (adrbuf, sizeof(adrbuf), adr));
|
||||
SV_RejectMessage (protocol, "server is full\n\n");
|
||||
}
|
||||
return NULL;
|
||||
|
@ -2169,12 +2171,13 @@ void SVC_RemoteCommand (void)
|
|||
{
|
||||
int i;
|
||||
char remaining[1024];
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
{
|
||||
bannedips_t *banip = SV_BannedAddress(&net_from);
|
||||
if (banip)
|
||||
{
|
||||
Con_Printf ("Rcon from banned ip %s\n", NET_AdrToString (net_from));
|
||||
Con_Printf ("Rcon from banned ip %s\n", NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2209,7 +2212,7 @@ void SVC_RemoteCommand (void)
|
|||
|
||||
|
||||
Con_Printf ("Rcon from %s:\n%s\n"
|
||||
, NET_AdrToString (net_from), net_message.data+4);
|
||||
, NET_AdrToString (adr, sizeof(adr), net_from), net_message.data+4);
|
||||
|
||||
SV_BeginRedirect (RD_PACKET, LANGDEFAULT);
|
||||
|
||||
|
@ -2222,7 +2225,7 @@ void SVC_RemoteCommand (void)
|
|||
Con_Printf("Rcon was too long\n");
|
||||
SV_EndRedirect ();
|
||||
Con_Printf ("Rcon from %s:\n%s\n"
|
||||
, NET_AdrToString (net_from), "Was too long - possible buffer overflow attempt");
|
||||
, NET_AdrToString (adr, sizeof(adr), net_from), "Was too long - possible buffer overflow attempt");
|
||||
return;
|
||||
}
|
||||
strcat (remaining, Cmd_Argv(i) );
|
||||
|
@ -2239,7 +2242,7 @@ void SVC_RemoteCommand (void)
|
|||
#endif
|
||||
|
||||
Con_Printf ("Bad rcon from %s:\n%s\n"
|
||||
, NET_AdrToString (net_from), net_message.data+4);
|
||||
, NET_AdrToString (adr, sizeof(adr), net_from), net_message.data+4);
|
||||
|
||||
SV_BeginRedirect (RD_PACKET, LANGDEFAULT);
|
||||
|
||||
|
@ -2250,7 +2253,7 @@ void SVC_RemoteCommand (void)
|
|||
{
|
||||
|
||||
Con_Printf ("Rcon from %s:\n%s\n"
|
||||
, NET_AdrToString (net_from), net_message.data+4);
|
||||
, NET_AdrToString (adr, sizeof(adr), net_from), net_message.data+4);
|
||||
|
||||
SV_BeginRedirect (RD_PACKET, LANGDEFAULT);
|
||||
|
||||
|
@ -2263,7 +2266,7 @@ void SVC_RemoteCommand (void)
|
|||
Con_Printf("Rcon was too long\n");
|
||||
SV_EndRedirect ();
|
||||
Con_Printf ("Rcon from %s:\n%s\n"
|
||||
, NET_AdrToString (net_from), "Was too long - possible buffer overflow attempt");
|
||||
, NET_AdrToString (adr, sizeof(adr), net_from), "Was too long - possible buffer overflow attempt");
|
||||
return;
|
||||
}
|
||||
strcat (remaining, Cmd_Argv(i) );
|
||||
|
@ -2282,6 +2285,7 @@ void SVC_RealIP (void)
|
|||
unsigned int slotnum;
|
||||
int cookie;
|
||||
bannedips_t *banip;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
slotnum = atoi(Cmd_Argv(1));
|
||||
cookie = atoi(Cmd_Argv(2));
|
||||
|
@ -2304,8 +2308,8 @@ void SVC_RealIP (void)
|
|||
|
||||
if (NET_AddressSmellsFunny(net_from))
|
||||
{
|
||||
Con_Printf("funny realip address: %s, ", NET_AdrToString(net_from));
|
||||
Con_Printf("proxy address: %s\n", NET_AdrToString(svs.clients[slotnum].netchan.remote_address));
|
||||
Con_Printf("funny realip address: %s, ", NET_AdrToString(adr, sizeof(adr), net_from));
|
||||
Con_Printf("proxy address: %s\n", NET_AdrToString(adr, sizeof(adr), svs.clients[slotnum].netchan.remote_address));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2328,6 +2332,8 @@ void SVC_RealIP (void)
|
|||
void SVC_ACK (void)
|
||||
{
|
||||
int slotnum;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
for (slotnum = 0; slotnum < MAX_CLIENTS; slotnum++)
|
||||
{
|
||||
if (svs.clients[slotnum].state)
|
||||
|
@ -2349,7 +2355,7 @@ void SVC_ACK (void)
|
|||
}
|
||||
}
|
||||
}
|
||||
Con_Printf ("A2A_ACK from %s\n", NET_AdrToString (net_from));
|
||||
Con_Printf ("A2A_ACK from %s\n", NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2366,12 +2372,13 @@ qboolean SV_ConnectionlessPacket (void)
|
|||
{
|
||||
char *s;
|
||||
char *c;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
MSG_BeginReading ();
|
||||
|
||||
if (net_message.cursize >= MAX_QWMSGLEN) //add a null term in message space
|
||||
{
|
||||
Con_Printf("Oversized packet from %s\n", NET_AdrToString (net_from));
|
||||
Con_Printf("Oversized packet from %s\n", NET_AdrToString (adr, sizeof(adr), net_from));
|
||||
net_message.cursize=MAX_QWMSGLEN-1;
|
||||
}
|
||||
net_message.data[net_message.cursize] = '\0'; //terminate it properly. Just in case.
|
||||
|
@ -2432,7 +2439,7 @@ qboolean SV_ConnectionlessPacket (void)
|
|||
SVC_RealIP ();
|
||||
else if (!PR_GameCodePacket(net_message.data+4))
|
||||
Con_Printf ("bad connectionless packet from %s:\n%s\n"
|
||||
, NET_AdrToString (net_from), s);
|
||||
, NET_AdrToString (adr, sizeof(adr), net_from), s);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -3512,6 +3519,7 @@ void Master_Heartbeat (void)
|
|||
int active;
|
||||
int i, j;
|
||||
qboolean madeqwstring = false;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (!sv_public.value)
|
||||
return;
|
||||
|
@ -3547,7 +3555,7 @@ void Master_Heartbeat (void)
|
|||
}
|
||||
|
||||
if (sv_reportheartbeats.value)
|
||||
Con_Printf ("Sending heartbeat to %s\n", NET_AdrToString (sv_masterlist[i].adr));
|
||||
Con_Printf ("Sending heartbeat to %s\n", NET_AdrToString (adr, sizeof(adr), sv_masterlist[i].adr));
|
||||
|
||||
NET_SendPacket (NS_SERVER, strlen(string), string, sv_masterlist[i].adr);
|
||||
break;
|
||||
|
@ -3555,7 +3563,7 @@ void Master_Heartbeat (void)
|
|||
if (sv_listen_dp.value) //set listen to 1 to allow qw connections, 2 to allow nq connections too.
|
||||
{
|
||||
if (sv_reportheartbeats.value)
|
||||
Con_Printf ("Sending heartbeat to %s\n", NET_AdrToString (sv_masterlist[i].adr));
|
||||
Con_Printf ("Sending heartbeat to %s\n", NET_AdrToString (adr, sizeof(adr), sv_masterlist[i].adr));
|
||||
|
||||
{
|
||||
char *str = "\377\377\377\377heartbeat DarkPlaces\x0A";
|
||||
|
@ -3608,6 +3616,7 @@ Informs all masters that this server is going down
|
|||
void Master_Shutdown (void)
|
||||
{
|
||||
char string[2048];
|
||||
char adr[MAX_ADR_SIZE];
|
||||
int i;
|
||||
|
||||
sprintf (string, "%c\n", S2M_SHUTDOWN);
|
||||
|
@ -3620,7 +3629,7 @@ void Master_Shutdown (void)
|
|||
{
|
||||
case false:
|
||||
if (sv_reportheartbeats.value)
|
||||
Con_Printf ("Sending heartbeat to %s\n", NET_AdrToString (sv_masterlist[i].adr));
|
||||
Con_Printf ("Sending heartbeat to %s\n", NET_AdrToString (adr, sizeof(adr), sv_masterlist[i].adr));
|
||||
|
||||
NET_SendPacket (NS_SERVER, strlen(string), string, sv_masterlist[i].adr);
|
||||
break;
|
||||
|
|
|
@ -2410,6 +2410,7 @@ void SV_MVDStream_Poll(void)
|
|||
qboolean wanted;
|
||||
mvddest_t *dest;
|
||||
char *ip;
|
||||
char adrbuf[MAX_ADR_SIZE];
|
||||
|
||||
if (!sv.state || !qtv_streamport.value)
|
||||
wanted = false;
|
||||
|
@ -2473,7 +2474,7 @@ void SV_MVDStream_Poll(void)
|
|||
}
|
||||
|
||||
SockadrToNetadr(&addr, &na);
|
||||
ip = NET_AdrToString(na);
|
||||
ip = NET_AdrToString(adrbuf, sizeof(adrbuf), na);
|
||||
Con_Printf("MVD streaming client attempting to connect from %s\n", ip);
|
||||
|
||||
SV_MVD_InitPendingStream(client, ip);
|
||||
|
|
|
@ -3619,6 +3619,7 @@ void SV_ExecuteUserCommand (char *s, qboolean fromQC)
|
|||
{
|
||||
ucmd_t *u;
|
||||
client_t *oldhost = host_client;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
Con_DPrintf("Client command: %s\n", s);
|
||||
|
||||
|
@ -3708,7 +3709,7 @@ void SV_ExecuteUserCommand (char *s, qboolean fromQC)
|
|||
host_client = oldhost;
|
||||
SV_EndRedirect ();
|
||||
Con_Printf ("cmd from %s:\n%s\n"
|
||||
, NET_AdrToString (net_from), "Was too long - possible buffer overflow attempt");
|
||||
, NET_AdrToString (adr, sizeof(adr), net_from), "Was too long - possible buffer overflow attempt");
|
||||
return;
|
||||
}
|
||||
strcat (remaining, Cmd_Argv(i) );
|
||||
|
@ -4505,7 +4506,7 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
|
|||
int oldmsec;
|
||||
double tmp_time;
|
||||
qboolean jumpable;
|
||||
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
// DMW copied this KK hack copied from QuakeForge anti-cheat
|
||||
// (also extra inside parm on all SV_RunCmds that follow)
|
||||
|
@ -4530,7 +4531,7 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
|
|||
{
|
||||
SV_BroadcastTPrintf(PRINT_HIGH,
|
||||
STL_SPEEDCHEATKICKED,
|
||||
host_client->name, NET_AdrToString(host_client->netchan.remote_address));
|
||||
host_client->name, NET_AdrToString(adr, sizeof(adr), host_client->netchan.remote_address));
|
||||
host_client->drop = true; //drop later
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2924,6 +2924,7 @@ void SVQ3_DirectConnect(void) //Actually connect the client, use up a slot, and
|
|||
int challenge;
|
||||
int qport;
|
||||
bannedips_t *banip;
|
||||
char adr[MAX_ADR_SIZE];
|
||||
|
||||
if (net_message.cursize < 13)
|
||||
return;
|
||||
|
@ -2970,7 +2971,7 @@ void SVQ3_DirectConnect(void) //Actually connect the client, use up a slot, and
|
|||
cls.challenge = challenge = 500;
|
||||
#endif
|
||||
Q_strncpyz(cl->userinfo, userinfo, sizeof(cl->userinfo));
|
||||
reason = NET_AdrToString(net_from);
|
||||
reason = NET_AdrToString(adr, sizeof(adr), net_from);
|
||||
Info_SetValueForStarKey(cl->userinfo, "ip", reason, sizeof(cl->userinfo));
|
||||
|
||||
ret = VM_Call(q3gamevm, GAME_CLIENT_CONNECT, (int)(cl-svs.clients), false, false);
|
||||
|
|
Loading…
Reference in a new issue