2004-08-23 00:15:46 +00:00
/*
Copyright ( C ) 1996 - 1997 Id Software , Inc .
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
2005-07-03 15:16:20 +00:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE .
2004-08-23 00:15:46 +00:00
See the GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
2013-03-31 04:21:08 +00:00
# include "quakedef.h"
2016-01-18 05:22:07 +00:00
# include "pr_common.h"
2004-08-23 00:15:46 +00:00
2004-11-29 01:21:00 +00:00
# ifndef CLIENTONLY
2007-10-25 07:29:59 +00:00
# ifndef INVALID_SOCKET
2005-12-21 03:07:33 +00:00
# define INVALID_SOCKET -1
# endif
2010-08-14 03:17:33 +00:00
int sv_allow_cheats ;
qboolean SV_MayCheat ( void )
{
if ( sv_allow_cheats = = 2 )
return sv . allocated_client_slots = = 1 ;
return sv_allow_cheats ! = 0 ;
}
2004-08-23 00:15:46 +00:00
extern cvar_t cl_warncmd ;
2016-09-08 19:04:35 +00:00
cvar_t sv_cheats = CVARF ( " sv_cheats " , " 0 " , CVAR_LATCH ) ;
2004-08-23 00:15:46 +00:00
extern redirect_t sv_redirected ;
extern cvar_t sv_public ;
2015-09-01 04:45:15 +00:00
static const struct banflags_s
{
unsigned int banflag ;
const char * names [ 2 ] ;
} banflags [ ] =
{
2016-02-15 06:01:17 +00:00
{ BAN_BAN , { " ban " } } ,
{ BAN_PERMIT , { " safe " , " permit " } } ,
{ BAN_CUFF , { " cuff " } } ,
{ BAN_MUTE , { " mute " } } ,
{ BAN_CRIPPLED , { " cripple " } } ,
{ BAN_DEAF , { " deaf " } } ,
{ BAN_LAGGED , { " lag " , " lagged " } } ,
{ BAN_VIP , { " vip " } } ,
{ BAN_BLIND , { " blind " } } ,
{ BAN_SPECONLY , { " spec " } } ,
2016-07-12 00:40:13 +00:00
{ BAN_STEALTH , { " stealth " } } ,
2016-07-16 13:21:23 +00:00
{ BAN_MAPPER , { " mapper " } } ,
2016-07-12 00:40:13 +00:00
{ BAN_USER1 , { " user1 " } } ,
{ BAN_USER2 , { " user2 " } } ,
{ BAN_USER3 , { " user3 " } } ,
{ BAN_USER4 , { " user4 " } } ,
{ BAN_USER5 , { " user5 " } } ,
{ BAN_USER6 , { " user6 " } } ,
{ BAN_USER7 , { " user7 " } } ,
{ BAN_USER8 , { " user8 " } }
2015-09-01 04:45:15 +00:00
} ;
2004-08-23 00:15:46 +00:00
//generic helper function for naming players.
2014-03-30 08:55:06 +00:00
client_t * SV_GetClientForString ( const char * name , int * id )
2004-08-23 00:15:46 +00:00
{
int i ;
2014-03-30 08:55:06 +00:00
const char * s ;
2004-08-23 00:15:46 +00:00
char nicename [ 80 ] ;
2009-10-06 00:41:42 +00:00
char niceclname [ 80 ] ;
2004-08-23 00:15:46 +00:00
client_t * cl ;
int first = 0 ;
if ( id & & * id ! = - 1 )
first = * id ;
if ( ! strcmp ( name , " * " ) ) //match with all
{
for ( i = first , cl = svs . clients + first ; i < sv . allocated_client_slots ; i + + , cl + + )
{
2014-03-30 08:55:06 +00:00
if ( cl - > state < = cs_loadzombie )
2004-08-23 00:15:46 +00:00
continue ;
* id = i + 1 ;
return cl ;
}
* id = sv . allocated_client_slots ;
return NULL ;
}
//check to make sure it's all an int
for ( s = name ; * s ; s + + )
{
if ( * s < ' 0 ' | | * s > ' 9 ' )
break ;
}
//we got to the end of the string and found only numbers. - it's a uid.
if ( ! * s )
{
int uid = Q_atoi ( name ) ;
for ( i = first , cl = svs . clients ; i < sv . allocated_client_slots ; i + + , cl + + )
{
2014-03-30 08:55:06 +00:00
if ( cl - > state < = cs_loadzombie )
2004-08-23 00:15:46 +00:00
continue ;
if ( cl - > userid = = uid )
{
2006-04-02 23:47:27 +00:00
if ( id )
* id = sv . allocated_client_slots ;
2004-08-23 00:15:46 +00:00
return cl ;
}
}
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
return NULL ;
2005-07-03 15:16:20 +00:00
}
2004-08-23 00:15:46 +00:00
for ( i = first , cl = svs . clients + first ; i < sv . allocated_client_slots ; i + + , cl + + )
{
2014-03-30 08:55:06 +00:00
if ( cl - > state < = cs_loadzombie )
2004-08-23 00:15:46 +00:00
continue ;
2009-10-06 00:41:42 +00:00
deleetstring ( niceclname , cl - > name ) ;
deleetstring ( nicename , name ) ;
2004-08-23 00:15:46 +00:00
2009-10-06 00:41:42 +00:00
if ( strstr ( niceclname , nicename ) )
2004-08-23 00:15:46 +00:00
{
2006-04-02 23:47:27 +00:00
if ( id )
* id = i + 1 ;
2004-08-23 00:15:46 +00:00
return cl ;
}
}
return NULL ;
}
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
OPERATOR CONSOLE ONLY COMMANDS
These commands can only be entered from stdin or by a remote operator datagram
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
/*
= = = = = = = = = = = = = = = = = =
SV_Quit_f
= = = = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_Quit_f ( void )
2004-08-23 00:15:46 +00:00
{
2014-03-30 08:55:06 +00:00
if ( sv . state > = ss_loading )
SV_FinalMessage ( " server shutdown \n " ) ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Shutting down. \n " ) ;
2004-08-23 00:15:46 +00:00
SV_Shutdown ( ) ;
Sys_Quit ( ) ;
}
/*
= = = = = = = = = = = =
SV_Fraglogfile_f
= = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_Fraglogfile_f ( void )
2004-08-23 00:15:46 +00:00
{
char name [ MAX_OSPATH ] ;
int i ;
if ( sv_fraglogfile )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Frag file logging off. \n " ) ;
2005-12-21 03:07:33 +00:00
VFS_CLOSE ( sv_fraglogfile ) ;
2004-08-23 00:15:46 +00:00
sv_fraglogfile = NULL ;
return ;
}
// find an unused name
for ( i = 0 ; i < 1000 ; i + + )
{
2005-12-21 03:07:33 +00:00
sprintf ( name , " frag_%i.log " , i ) ;
2006-01-02 22:33:23 +00:00
sv_fraglogfile = FS_OpenVFS ( name , " rb " , FS_GAME ) ;
2004-08-23 00:15:46 +00:00
if ( ! sv_fraglogfile )
{ // can't read it, so create this one
2006-01-02 22:33:23 +00:00
sv_fraglogfile = FS_OpenVFS ( name , " wb " , FS_GAME ) ;
2004-08-23 00:15:46 +00:00
if ( ! sv_fraglogfile )
i = 1000 ; // give error
break ;
}
2005-12-21 03:07:33 +00:00
VFS_CLOSE ( sv_fraglogfile ) ;
2004-08-23 00:15:46 +00:00
}
if ( i = = 1000 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Can't open any logfiles. \n " ) ;
2004-08-23 00:15:46 +00:00
sv_fraglogfile = NULL ;
return ;
}
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Logging frags to %s. \n " , name ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
SV_SetPlayer
Sets host_client and sv_player to the player with idnum Cmd_Argv ( 1 )
= = = = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static qboolean SV_SetPlayer ( void )
2004-08-23 00:15:46 +00:00
{
client_t * cl ;
int i ;
int idnum ;
idnum = atoi ( Cmd_Argv ( 1 ) ) ;
2011-04-25 03:25:22 +00:00
for ( i = 0 , cl = svs . clients ; i < sv . allocated_client_slots ; i + + , cl + + )
2004-08-23 00:15:46 +00:00
{
if ( ! cl - > state )
continue ;
if ( cl - > userid = = idnum )
{
host_client = cl ;
sv_player = host_client - > edict ;
return true ;
}
}
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Userid %i is not on the server \n " , idnum ) ;
2004-08-23 00:15:46 +00:00
return false ;
}
/*
= = = = = = = = = = = = = = = = = =
SV_God_f
Sets client to godmode
= = = = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_God_f ( void )
2004-08-23 00:15:46 +00:00
{
2010-08-14 03:17:33 +00:00
if ( ! SV_MayCheat ( ) )
2004-08-23 00:15:46 +00:00
{
2014-04-24 01:53:01 +00:00
Con_TPrintf ( " Please set sv_cheats 1 and restart the map first. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( ! SV_SetPlayer ( ) )
return ;
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " god cheat " ) ;
2005-03-28 00:11:59 +00:00
sv_player - > v - > flags = ( int ) sv_player - > v - > flags ^ FL_GODMODE ;
if ( ( int ) sv_player - > v - > flags & FL_GODMODE )
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " godmode ON \n " ) ;
2004-08-23 00:15:46 +00:00
else
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " godmode OFF \n " ) ;
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
static void SV_Noclip_f ( void )
2004-08-23 00:15:46 +00:00
{
2010-08-14 03:17:33 +00:00
if ( ! SV_MayCheat ( ) )
2004-08-23 00:15:46 +00:00
{
2014-04-24 01:53:01 +00:00
Con_TPrintf ( " Please set sv_cheats 1 and restart the map first. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( ! SV_SetPlayer ( ) )
return ;
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " noclip cheat " ) ;
2005-03-28 00:11:59 +00:00
if ( sv_player - > v - > movetype ! = MOVETYPE_NOCLIP )
2004-08-23 00:15:46 +00:00
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > movetype = MOVETYPE_NOCLIP ;
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " noclip ON \n " ) ;
2004-08-23 00:15:46 +00:00
}
else
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > movetype = MOVETYPE_WALK ;
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " noclip OFF \n " ) ;
2004-08-23 00:15:46 +00:00
}
}
2015-09-01 04:45:15 +00:00
# ifdef QUAKESTATS
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = =
SV_Give_f
= = = = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_Give_f ( void )
2004-08-23 00:15:46 +00:00
{
2016-02-10 23:23:43 +00:00
char * t = Cmd_Argv ( 2 ) ;
2004-08-23 00:15:46 +00:00
int v ;
2005-07-03 15:16:20 +00:00
2013-08-21 07:14:39 +00:00
if ( ! svprogfuncs )
return ;
2016-02-10 23:23:43 +00:00
if ( ! strcmp ( t , " damn " ) )
{
Con_TPrintf ( " %s not given. \n " , t ) ;
return ;
}
2010-08-14 03:17:33 +00:00
if ( ! SV_MayCheat ( ) )
2004-08-23 00:15:46 +00:00
{
2014-04-24 01:53:01 +00:00
Con_TPrintf ( " Please set sv_cheats 1 and restart the map first. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2005-07-03 15:16:20 +00:00
2014-06-25 03:53:11 +00:00
/* if (developer.value)
2005-01-04 08:01:03 +00:00
{
int oldself ;
oldself = pr_global_struct - > self ;
2009-11-04 21:16:50 +00:00
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv . world . edicts ) ;
2005-01-04 08:01:03 +00:00
Con_Printf ( " Result: %s \n " , svprogfuncs - > EvaluateDebugString ( svprogfuncs , Cmd_Args ( ) ) ) ;
pr_global_struct - > self = oldself ;
2008-11-09 22:29:28 +00:00
}
2014-06-25 03:53:11 +00:00
*/
2008-11-09 22:29:28 +00:00
if ( ! SV_SetPlayer ( ) )
{
2004-08-23 00:15:46 +00:00
return ;
2005-01-04 08:01:03 +00:00
}
2004-08-23 00:15:46 +00:00
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " give cheat " ) ;
2004-08-23 00:15:46 +00:00
v = atoi ( Cmd_Argv ( 3 ) ) ;
2005-07-03 15:16:20 +00:00
2008-11-09 22:29:28 +00:00
switch ( ( t [ 1 ] = = 0 ) ? t [ 0 ] : 0 )
2004-08-23 00:15:46 +00:00
{
case ' 2 ' :
case ' 3 ' :
case ' 4 ' :
case ' 5 ' :
case ' 6 ' :
case ' 7 ' :
case ' 8 ' :
case ' 9 ' :
2005-03-28 00:11:59 +00:00
sv_player - > v - > items = ( int ) sv_player - > v - > items | IT_SHOTGUN < < ( t [ 0 ] - ' 2 ' ) ;
2004-08-23 00:15:46 +00:00
break ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
case ' s ' :
2005-03-28 00:11:59 +00:00
sv_player - > v - > ammo_shells = v ;
2005-07-03 15:16:20 +00:00
break ;
2004-08-23 00:15:46 +00:00
case ' n ' :
2005-03-28 00:11:59 +00:00
sv_player - > v - > ammo_nails = v ;
2005-07-03 15:16:20 +00:00
break ;
2004-08-23 00:15:46 +00:00
case ' r ' :
2005-03-28 00:11:59 +00:00
sv_player - > v - > ammo_rockets = v ;
2005-07-03 15:16:20 +00:00
break ;
2004-08-23 00:15:46 +00:00
case ' h ' :
2005-03-28 00:11:59 +00:00
sv_player - > v - > health = v ;
2005-07-03 15:16:20 +00:00
break ;
2004-08-23 00:15:46 +00:00
case ' c ' :
2005-03-28 00:11:59 +00:00
sv_player - > v - > ammo_cells = v ;
2005-01-04 08:01:03 +00:00
break ;
2014-06-25 03:53:11 +00:00
/* default:
2005-01-04 08:01:03 +00:00
{
int oldself ;
oldself = pr_global_struct - > self ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
2008-11-09 22:29:28 +00:00
Cmd_ShiftArgs ( 1 , false ) ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Result: %s \n " , svprogfuncs - > EvaluateDebugString ( svprogfuncs , Cmd_Args ( ) ) ) ;
2005-01-04 08:01:03 +00:00
pr_global_struct - > self = oldself ;
}
2014-06-25 03:53:11 +00:00
*/
2004-08-23 00:15:46 +00:00
}
}
2015-09-01 04:45:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
2015-02-02 08:01:53 +00:00
static int QDECL ShowMapList ( const char * name , qofs_t flags , time_t mtime , void * parm , searchpathfuncs_t * spath )
2004-08-23 00:15:46 +00:00
{
2018-09-23 19:35:24 +00:00
const char * levelshots [ ] =
{
" levelshots/%s.tga " ,
" levelshots/%s.jpg " ,
" levelshots/%s.png " ,
" maps/%s.tga " ,
" maps/%s.jpg " ,
" maps/%s.png "
} ;
size_t u ;
2014-03-30 08:55:06 +00:00
char stripped [ 64 ] ;
2004-08-23 00:15:46 +00:00
if ( name [ 5 ] = = ' b ' & & name [ 6 ] = = ' _ ' ) //skip box models
return true ;
2014-03-30 08:55:06 +00:00
COM_StripExtension ( name + 5 , stripped , sizeof ( stripped ) ) ;
2018-09-23 19:35:24 +00:00
for ( u = 0 ; u < countof ( levelshots ) ; u + + )
{
const char * ls = va ( levelshots [ u ] , stripped ) ;
if ( COM_FCheckExists ( ls ) )
{
Con_Printf ( " ^[ \\ map \\ %s \\ img \\ %s \\ w \\ 64 \\ h \\ 48^] " , stripped , ls ) ;
Con_Printf ( " ^[[%s] \\ map \\ %s \\ tipimg \\ %s^] \n " , stripped , stripped , ls ) ;
return true ;
}
}
2015-04-14 23:12:17 +00:00
Con_Printf ( " ^[[%s] \\ map \\ %s^] \n " , stripped , stripped ) ;
return true ;
}
static int QDECL ShowMapListExt ( const char * name , qofs_t flags , time_t mtime , void * parm , searchpathfuncs_t * spath )
{
if ( name [ 5 ] = = ' b ' & & name [ 6 ] = = ' _ ' ) //skip box models
return true ;
Con_Printf ( " ^[[%s] \\ map \\ %s^] \n " , name + 5 , name + 5 ) ;
2004-08-23 00:15:46 +00:00
return true ;
}
2014-03-30 08:55:06 +00:00
static void SV_MapList_f ( void )
2004-08-23 00:15:46 +00:00
{
COM_EnumerateFiles ( " maps/*.bsp " , ShowMapList , NULL ) ;
2015-04-14 23:12:17 +00:00
COM_EnumerateFiles ( " maps/*.map " , ShowMapListExt , NULL ) ;
2011-12-05 15:23:40 +00:00
COM_EnumerateFiles ( " maps/*.cm " , ShowMapList , NULL ) ;
COM_EnumerateFiles ( " maps/*.hmp " , ShowMapList , NULL ) ;
2004-08-23 00:15:46 +00:00
}
2017-07-04 05:07:51 +00:00
static int QDECL CompleteMapList ( const char * name , qofs_t flags , time_t mtime , void * parm , searchpathfuncs_t * spath )
{
struct xcommandargcompletioncb_s * ctx = parm ;
char stripped [ 64 ] ;
if ( name [ 5 ] = = ' b ' & & name [ 6 ] = = ' _ ' ) //skip box models
return true ;
COM_StripExtension ( name + 5 , stripped , sizeof ( stripped ) ) ;
2018-04-15 02:48:23 +00:00
ctx - > cb ( stripped , NULL , NULL , ctx ) ;
2017-07-04 05:07:51 +00:00
return true ;
}
static int QDECL CompleteMapListExt ( const char * name , qofs_t flags , time_t mtime , void * parm , searchpathfuncs_t * spath )
{
struct xcommandargcompletioncb_s * ctx = parm ;
if ( name [ 5 ] = = ' b ' & & name [ 6 ] = = ' _ ' ) //skip box models
return true ;
2018-04-15 02:48:23 +00:00
ctx - > cb ( name + 5 , NULL , NULL , ctx ) ;
2017-07-04 05:07:51 +00:00
return true ;
}
2017-08-14 16:38:44 +00:00
static void SV_Map_c ( int argn , const char * partial , struct xcommandargcompletioncb_s * ctx )
2017-07-04 05:07:51 +00:00
{
if ( argn = = 1 )
{
COM_EnumerateFiles ( va ( " maps/%s*.bsp " , partial ) , CompleteMapList , ctx ) ;
COM_EnumerateFiles ( va ( " maps/%s*.map " , partial ) , CompleteMapListExt , ctx ) ;
COM_EnumerateFiles ( va ( " maps/%s*.cm " , partial ) , CompleteMapList , ctx ) ;
COM_EnumerateFiles ( va ( " maps/%s*.hmp " , partial ) , CompleteMapList , ctx ) ;
}
}
2014-09-17 03:04:08 +00:00
//static void gtcallback(struct cvar_s *var, char *oldvalue)
//{
// Con_Printf("g_gametype changed\n");
//}
2007-02-23 00:21:33 +00:00
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = = = =
SV_Map_f
2005-07-03 15:16:20 +00:00
handle a
2004-08-23 00:15:46 +00:00
map < mapname >
command from the console or progs .
2011-06-29 18:39:11 +00:00
quirks :
2014-08-25 07:35:41 +00:00
a leading ' * ' means new unit , meaning all old map state is flushed regardless of startspot
2011-06-29 18:39:11 +00:00
a ' + ' means ' set nextmap cvar to the following value and otherwise ignore , for q2 compat . only applies if there ' s also a ' . ' and the specified bsp doesn ' t exist , for q1 compat .
2018-08-23 06:03:31 +00:00
just a ' . ' is taken to mean ' restart ' . parms are not changed from their current values , startspot is also unchanged . Loads the last saved game instead when applicable .
2011-06-29 18:39:11 +00:00
2018-08-23 06:03:31 +00:00
variations :
' map ' will change map , for most games . strips parms + serverflags + cache . note that vanilla NQ kicks everyone ( NQ expects you to use changelevel for that ) .
2011-06-29 18:39:11 +00:00
' changelevel ' will not flush the level cache , for h2 compat ( won ' t save current level state in such a situation , as nq would prefer not )
' gamemap ' will save the game to ' save0 ' after loading , for q2 compat
' spmap ' is for q3 and sets ' gametype ' to ' 2 ' , otherwise identical to ' map ' . all other map commands will reset it to ' 0 ' if its ' 2 ' at the time .
2018-08-23 06:03:31 +00:00
' map_restart ' restarts the current map . Name is needed for q3 compat .
' restart ' is an alias for ' map_restart ' . Exists for NQ compat , but as an alias for QW mods that tried to use it for mod - specific things .
hexen2 fixme :
' restart restore ' restarts the map , reloading from a saved game if applicable .
' restart ' forgets the current map ( potentially breaking the game ) . we don ' t care much for that behaviour ( could make it a ' restart unit ' I guess ) .
quake2 :
' gamemap [ * ] foo . dm2 [ $ spot ] [ + nextserver ] '
* = = new unit
$ = = start spot
+ = = value for nextserver cvar ( used for cinematics ) .
' map ' is always a new unit .
quake :
+ is used in certain map names . * cannot be , but $ potentially could be .
2004-08-23 00:15:46 +00:00
= = = = = = = = = = = = = = = = = = = = = =
*/
void SV_Map_f ( void )
{
char level [ MAX_QPATH ] ;
char spot [ MAX_QPATH ] ;
2018-08-04 19:00:19 +00:00
char expanded [ MAX_QPATH + 64 ] ;
2004-08-23 00:15:46 +00:00
char * nextserver ;
2015-08-20 03:17:47 +00:00
qboolean preserveplayers = false ;
2014-08-25 07:35:41 +00:00
qboolean isrestart = false ; //don't hurt settings
2018-08-25 02:53:45 +00:00
# ifdef SAVEDGAMES
2014-08-25 07:35:41 +00:00
qboolean newunit = false ; //no hubcache
2018-08-25 02:53:45 +00:00
qboolean q2savetos0 = false ;
# endif
2014-08-25 07:35:41 +00:00
qboolean flushparms = false ; //flush parms+serverflags
qboolean cinematic = false ; //new map is .cin / .roq or something
2016-10-22 07:06:51 +00:00
# ifdef Q3SERVER
2014-08-25 07:35:41 +00:00
qboolean q3singleplayer = false ; //forces g_gametype to 2 (otherwise clears if it was 2).
2016-10-22 07:06:51 +00:00
# endif
2014-08-25 07:35:41 +00:00
qboolean waschangelevel = false ;
2004-08-23 00:15:46 +00:00
int i ;
char * startspot ;
2007-12-03 11:40:18 +00:00
nextserver = 0 ;
2006-10-15 03:34:05 +00:00
# ifndef SERVERONLY
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
if ( ! Renderer_Started ( ) & & ! isDedicated )
2006-10-15 03:34:05 +00:00
{
2014-08-25 07:35:41 +00:00
Cbuf_AddText ( va ( " wait;%s %s \n " , Cmd_Argv ( 0 ) , Cmd_Args ( ) ) , Cmd_ExecLevel ) ;
2006-10-15 03:34:05 +00:00
return ;
}
# endif
2018-01-22 19:18:04 +00:00
if ( ! Q_strcasecmp ( Cmd_Argv ( 0 ) , " map_restart " ) )
2004-08-23 00:15:46 +00:00
{
2018-10-11 10:31:23 +00:00
const char * arg = Cmd_Argv ( 1 ) ;
2018-10-13 06:20:49 +00:00
# ifdef SAVEDGAMES
2018-10-11 10:31:23 +00:00
if ( ! strcmp ( arg , " restore " ) ) //hexen2 reload-saved-game
;
else if ( ! strcmp ( arg , " initial " ) ) //force initial, even if it breaks saved games.
* sv . loadgame_on_restart = 0 ;
2018-10-13 06:20:49 +00:00
else
# endif
{
float delay = atof ( arg ) ;
if ( delay ) //q3's restart-after-delay
Con_DPrintf ( " map_restart delay not implemented yet \n " ) ;
}
2018-01-22 19:18:04 +00:00
Q_strncpyz ( level , " . " , sizeof ( level ) ) ;
startspot = NULL ;
//FIXME: if precaches+statics don't change, don't do the whole networking thing.
2004-08-23 00:15:46 +00:00
}
2018-01-22 19:18:04 +00:00
else
{
if ( Cmd_Argc ( ) ! = 2 & & Cmd_Argc ( ) ! = 3 )
{
if ( Cmd_IsInsecure ( ) )
return ;
Con_TPrintf ( " Available maps: \n " , Cmd_Argv ( 0 ) ) ;
SV_MapList_f ( ) ;
return ;
}
2007-03-04 19:17:16 +00:00
2018-01-22 19:18:04 +00:00
Q_strncpyz ( level , Cmd_Argv ( 1 ) , sizeof ( level ) ) ;
startspot = ( ( Cmd_Argc ( ) = = 2 ) ? NULL : Cmd_Argv ( 2 ) ) ;
}
2004-08-23 00:15:46 +00:00
2016-10-22 07:06:51 +00:00
# ifdef Q3SERVER
2014-08-25 07:35:41 +00:00
q3singleplayer = ! strcmp ( Cmd_Argv ( 0 ) , " spmap " ) ;
2016-10-22 07:06:51 +00:00
# endif
2014-08-25 07:35:41 +00:00
flushparms = ! strcmp ( Cmd_Argv ( 0 ) , " map " ) | | ! strcmp ( Cmd_Argv ( 0 ) , " spmap " ) ;
2018-08-25 02:53:45 +00:00
# ifdef SAVEDGAMES
2014-08-25 07:35:41 +00:00
newunit = flushparms | | ( ! strcmp ( Cmd_Argv ( 0 ) , " changelevel " ) & & ! startspot ) ;
2018-08-25 02:53:45 +00:00
q2savetos0 = ! strcmp ( Cmd_Argv ( 0 ) , " gamemap " ) & & ! isDedicated ; //q2
# endif
2005-05-13 10:42:48 +00:00
2018-01-22 19:18:04 +00:00
sv . mapchangelocked = false ;
2018-08-23 06:03:31 +00:00
if ( ! strcmp ( level , " . " ) )
; //restart current
else
2004-08-23 00:15:46 +00:00
{
2009-04-01 22:03:56 +00:00
snprintf ( expanded , sizeof ( expanded ) , " maps/%s.bsp " , level ) ; // this function and the if statement below, is a quake bugfix which stopped a map called "dm6++.bsp" from loading because of the + sign, quake2 map syntax interprets + character as "intro.cin+base1.bsp", to play a cinematic then load a map after
if ( ! COM_FCheckExists ( expanded ) )
2007-10-25 07:29:59 +00:00
{
2009-04-01 22:03:56 +00:00
nextserver = strchr ( level , ' + ' ) ;
if ( nextserver )
{
* nextserver = ' \0 ' ;
nextserver + + ;
}
2007-10-25 07:29:59 +00:00
}
2004-08-23 00:15:46 +00:00
}
if ( startspot )
{
strcpy ( spot , startspot ) ;
startspot = spot ;
}
else if ( ( startspot = strchr ( level , ' $ ' ) ) )
{
strcpy ( spot , startspot + 1 ) ;
* startspot = ' \0 ' ;
startspot = spot ;
}
else
startspot = NULL ;
if ( ! strcmp ( level , " . " ) ) //restart current
2005-07-03 15:16:20 +00:00
{
2009-04-01 22:03:56 +00:00
//grab the current map name
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
Q_strncpyz ( level , svs . name , sizeof ( level ) ) ;
2014-03-30 08:55:06 +00:00
isrestart = true ;
2014-08-25 07:35:41 +00:00
flushparms = false ;
2018-08-25 02:53:45 +00:00
# ifdef SAVEDGAMES
2014-08-25 07:35:41 +00:00
newunit = false ;
q2savetos0 = false ;
2018-08-25 02:53:45 +00:00
# endif
2004-08-23 00:15:46 +00:00
2009-04-01 22:03:56 +00:00
if ( ! * level )
2011-10-27 16:16:29 +00:00
{
sv . mapchangelocked = true ;
if ( Cmd_AliasExist ( " startmap_dm " , RESTRICT_LOCAL ) )
{
Cbuf_AddText ( " startmap_dm " , Cmd_ExecLevel ) ;
return ;
}
2009-04-01 22:03:56 +00:00
Q_strncpyz ( level , " start " , sizeof ( level ) ) ;
2011-10-27 16:16:29 +00:00
}
2009-04-01 22:03:56 +00:00
2015-08-20 03:17:47 +00:00
if ( startspot & & ! strcmp ( startspot , " . " ) )
{
preserveplayers = true ;
startspot = NULL ;
}
if ( ! startspot )
{
//revert the startspot if its not overridden
2018-07-05 16:21:44 +00:00
Q_strncpyz ( spot , InfoBuf_ValueForKey ( & svs . info , " *startspot " ) , sizeof ( spot ) ) ;
2015-08-20 03:17:47 +00:00
startspot = spot ;
}
2004-08-23 00:15:46 +00:00
}
2018-08-23 06:03:31 +00:00
# ifdef SAVEDGAMES
if ( isrestart & & * sv . loadgame_on_restart & & SV_Loadgame ( sv . loadgame_on_restart ) )
{ //we managed to reload a saved game instead!
//this is required in order to keep hub state consistent (dying mid-map would require saved games to store both current and start of map(not to be confused with initial state, which would be trivial))
return ;
}
# endif
2004-08-23 00:15:46 +00:00
// check to make sure the level exists
if ( * level = = ' * ' )
{
memmove ( level , level + 1 , strlen ( level ) ) ;
2018-08-25 02:53:45 +00:00
# ifdef SAVEDGAMES
2004-08-23 00:15:46 +00:00
newunit = true ;
2018-08-25 02:53:45 +00:00
# endif
2004-08-23 00:15:46 +00:00
}
2006-09-17 00:59:22 +00:00
# ifndef SERVERONLY
SCR_ImageName ( level ) ;
2012-05-09 15:30:53 +00:00
SCR_SetLoadingStage ( LS_SERVER ) ;
SCR_SetLoadingFile ( " finalize server " ) ;
# else
# define SCR_SetLoadingFile(s)
2006-09-17 00:59:22 +00:00
# endif
2014-10-05 20:04:11 +00:00
COM_FlushFSCache ( false , true ) ;
2004-08-23 00:15:46 +00:00
2017-04-18 11:12:17 +00:00
# ifdef Q2SERVER
2011-12-23 03:12:29 +00:00
if ( strlen ( level ) > 4 & &
( ! strcmp ( level + strlen ( level ) - 4 , " .cin " ) | |
! strcmp ( level + strlen ( level ) - 4 , " .roq " ) | |
2015-12-28 17:41:39 +00:00
! strcmp ( level + strlen ( level ) - 4 , " .pcx " ) | |
2011-12-23 03:12:29 +00:00
! strcmp ( level + strlen ( level ) - 4 , " .avi " ) ) )
2004-08-23 00:15:46 +00:00
{
cinematic = true ;
}
else
2017-04-18 11:12:17 +00:00
# endif
# ifdef TERRAIN
//'map doesntexist.map' should just auto-generate that map or something
if ( ! Q_strcasecmp ( " map " , COM_FileExtension ( level , expanded , sizeof ( expanded ) ) ) )
;
else
# endif
2004-08-23 00:15:46 +00:00
{
2018-10-27 04:32:18 +00:00
char * exts [ ] = { " maps/%s " , " maps/%s.bsp " , " maps/%s.cm " , " maps/%s.hmp " , /*"maps/%s.map",*/ /*"maps/%s.ent",*/ NULL } ;
2011-05-20 04:10:46 +00:00
int i , j ;
for ( i = 0 ; exts [ i ] ; i + + )
2004-08-23 00:15:46 +00:00
{
2011-05-20 04:10:46 +00:00
snprintf ( expanded , sizeof ( expanded ) , exts [ i ] , level ) ;
if ( COM_FCheckExists ( expanded ) )
break ;
}
if ( ! exts [ i ] )
{
for ( i = 0 ; exts [ i ] ; i + + )
2005-09-08 01:47:12 +00:00
{
2011-05-20 04:10:46 +00:00
//doesn't exist, so try lowercase. Q3 does this.
for ( j = 0 ; j < sizeof ( level ) & & level [ j ] ; j + + )
2011-02-25 04:22:14 +00:00
{
2011-05-20 04:10:46 +00:00
if ( level [ j ] > = ' A ' & & level [ j ] < = ' Z ' )
level [ j ] = level [ j ] - ' A ' + ' a ' ;
2011-02-25 04:22:14 +00:00
}
2011-05-20 04:10:46 +00:00
snprintf ( expanded , sizeof ( expanded ) , exts [ i ] , level ) ;
if ( COM_FCheckExists ( expanded ) )
break ;
}
if ( ! exts [ i ] )
{
// FTE is still a Quake engine so report BSP missing
2018-08-23 06:03:31 +00:00
snprintf ( expanded , sizeof ( expanded ) , exts [ 1 ] , level ) ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Can't find %s \n " , expanded ) ;
2013-06-23 02:17:02 +00:00
# ifndef SERVERONLY
SCR_SetLoadingStage ( LS_NONE ) ;
# endif
2014-09-08 23:47:19 +00:00
if ( SSV_IsSubServer ( ) )
Cbuf_AddText ( " \n quit \n " , RESTRICT_LOCAL ) ;
2011-05-20 04:10:46 +00:00
return ;
2005-09-08 01:47:12 +00:00
}
2004-08-23 00:15:46 +00:00
}
}
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2004-08-23 00:15:46 +00:00
if ( sv . mvdrecording )
SV_MVDStop_f ( ) ;
2018-09-01 04:18:08 +00:00
# endif
2004-08-23 00:15:46 +00:00
# ifndef SERVERONLY
if ( ! isDedicated ) //otherwise, info used on map loading isn't present
2018-01-28 04:12:59 +00:00
{
cl . haveserverinfo = true ;
2018-07-05 16:21:44 +00:00
InfoBuf_Clone ( & cl . serverinfo , & svs . info ) ;
2018-01-28 04:12:59 +00:00
CL_CheckServerInfo ( ) ;
}
2004-08-23 00:15:46 +00:00
if ( ! sv . state & & cls . state )
CL_Disconnect ( ) ;
# endif
2014-03-30 08:55:06 +00:00
if ( ! isrestart )
SV_SaveSpawnparms ( ) ;
2004-08-23 00:15:46 +00:00
2018-08-04 07:05:20 +00:00
# ifdef SAVEDGAMES
2014-08-25 07:35:41 +00:00
if ( newunit )
SV_FlushLevelCache ( ) ; //forget all on new unit
else if ( startspot & & ! isrestart & & ! newunit )
2005-03-18 06:13:11 +00:00
{
2005-07-03 15:16:20 +00:00
# ifdef Q2SERVER
2005-03-18 06:13:11 +00:00
if ( ge )
{
qboolean savedinuse [ MAX_CLIENTS ] ;
for ( i = 0 ; i < sv . allocated_client_slots ; i + + )
{
savedinuse [ i ] = svs . clients [ i ] . q2edict - > inuse ;
svs . clients [ i ] . q2edict - > inuse = false ;
}
2010-07-25 15:06:38 +00:00
SV_SaveLevelCache ( NULL , false ) ;
2005-03-18 06:13:11 +00:00
for ( i = 0 ; i < sv . allocated_client_slots ; i + + )
{
svs . clients [ i ] . q2edict - > inuse = savedinuse [ i ] ;
}
}
else
2005-07-03 15:16:20 +00:00
# endif
2010-07-25 15:06:38 +00:00
SV_SaveLevelCache ( NULL , false ) ;
2005-03-18 06:13:11 +00:00
}
2018-08-04 07:05:20 +00:00
# endif
2004-08-23 00:15:46 +00:00
2005-09-08 01:47:12 +00:00
# ifdef Q3SERVER
{
cvar_t * gametype ;
2007-02-23 00:21:33 +00:00
2009-05-24 10:11:17 +00:00
gametype = Cvar_Get ( " mapname " , " " , CVAR_LATCH | CVAR_SERVERINFO , " Q3 compatability " ) ;
2007-02-23 00:21:33 +00:00
gametype - > flags | = CVAR_SERVERINFO ;
Cvar_ForceSet ( gametype , level ) ;
2013-03-12 22:35:33 +00:00
gametype = Cvar_Get ( " g_gametype " , " " , CVAR_LATCH | CVAR_SERVERINFO , " Q3 compatability " ) ;
2014-09-17 03:04:08 +00:00
// gametype->callback = gtcallback;
2014-08-25 07:35:41 +00:00
if ( q3singleplayer )
2007-03-04 19:17:16 +00:00
Cvar_ForceSet ( gametype , " 2 " ) ; //singleplayer
else if ( gametype - > value = = 2 )
2013-03-12 22:35:33 +00:00
Cvar_ForceSet ( gametype , " " ) ; //force to ffa deathmatch
2005-09-08 01:47:12 +00:00
}
# endif
2015-07-27 09:00:18 +00:00
# if defined(MENU_DAT) && !defined(SERVERONLY)
2016-07-12 00:40:13 +00:00
if ( Key_Dest_Has ( kdm_gmenu ) )
MP_Toggle ( 0 ) ;
2015-07-27 08:21:34 +00:00
# endif
2015-08-20 03:17:47 +00:00
if ( preserveplayers & & svprogfuncs )
2004-08-23 00:15:46 +00:00
{
2015-08-20 03:17:47 +00:00
for ( i = 0 ; i < svs . allocated_client_slots ; i + + ) //we need to drop all q2 clients. We don't mix q1w with q2.
{
char buffer [ 8192 ] , * buf ;
size_t bufsize = 0 ;
if ( svs . clients [ i ] . state > cs_connected )
{
buf = svprogfuncs - > saveent ( svprogfuncs , buffer , & bufsize , sizeof ( buffer ) , svs . clients [ i ] . edict ) ;
if ( svs . clients [ i ] . spawninfo )
Z_Free ( svs . clients [ i ] . spawninfo ) ;
svs . clients [ i ] . spawninfo = Z_Malloc ( bufsize + 1 ) ;
memcpy ( svs . clients [ i ] . spawninfo , buf , bufsize + 1 ) ;
svs . clients [ i ] . spawninfotime = sv . time ;
}
}
}
else
{
for ( i = 0 ; i < svs . allocated_client_slots ; i + + ) //we need to drop all q2 clients. We don't mix q1w with q2.
{
if ( svs . clients [ i ] . state > cs_connected ) //so that we don't send a datagram
svs . clients [ i ] . state = cs_connected ;
}
2004-08-23 00:15:46 +00:00
}
# ifndef SERVERONLY
S_StopAllSounds ( true ) ;
2006-09-17 00:59:22 +00:00
// SCR_BeginLoadingPlaque();
SCR_ImageName ( level ) ;
2004-08-23 00:15:46 +00:00
# endif
2015-08-20 03:17:47 +00:00
// if (!preserveplayers)
2011-12-05 15:23:40 +00:00
{
2015-08-20 03:17:47 +00:00
for ( i = 0 , host_client = svs . clients ; i < svs . allocated_client_slots ; i + + , host_client + + )
2014-02-07 08:38:40 +00:00
{
2015-08-20 03:17:47 +00:00
/*pass the new map's name as an extension, so appropriate loading screens can be shown*/
if ( host_client - > controller = = NULL )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{
2015-08-20 03:17:47 +00:00
if ( ISNQCLIENT ( host_client ) )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{
2015-08-20 03:17:47 +00:00
if ( ISDPCLIENT ( host_client ) )
{
//DP clients cannot cope with being told the next map's name
SV_StuffcmdToClient ( host_client , " reconnect \n " ) ;
}
else
SV_StuffcmdToClient ( host_client , va ( " reconnect \" %s \" \n " , level ) ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
else
2015-08-20 03:17:47 +00:00
SV_StuffcmdToClient ( host_client , va ( " changing \" %s \" \n " , level ) ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
2015-08-20 03:17:47 +00:00
host_client - > prespawn_stage = PRESPAWN_INVALID ;
host_client - > prespawn_idx = 0 ;
2014-02-07 08:38:40 +00:00
}
2015-08-20 03:17:47 +00:00
SV_SendMessagesToAll ( ) ;
2006-09-17 00:59:22 +00:00
2015-08-20 03:17:47 +00:00
if ( flushparms )
svs . serverflags = 0 ;
}
2014-08-25 07:35:41 +00:00
2012-05-09 15:30:53 +00:00
SCR_SetLoadingFile ( " spawnserver " ) ;
2018-08-04 07:05:20 +00:00
# ifdef SAVEDGAMES
2018-08-23 06:03:31 +00:00
if ( newunit | | ! startspot | | cinematic | | ! SV_LoadLevelCache ( NULL , level , startspot , false ) )
2018-08-04 07:05:20 +00:00
# endif
2005-05-13 10:42:48 +00:00
{
if ( waschangelevel & & ! startspot )
startspot = " " ;
2004-08-23 00:15:46 +00:00
SV_SpawnServer ( level , startspot , false , cinematic ) ;
2005-05-13 10:42:48 +00:00
}
2012-05-09 15:30:53 +00:00
SCR_SetLoadingFile ( " server spawned " ) ;
2004-08-23 00:15:46 +00:00
2007-06-20 00:02:54 +00:00
//SV_BroadcastCommand ("cmd new\n");
2013-10-29 17:38:22 +00:00
for ( i = 0 , host_client = svs . clients ; i < svs . allocated_client_slots ; i + + , host_client + + )
2007-06-20 00:02:54 +00:00
{ //this expanded code cuts out a packet when changing maps...
//but more usefully, it stops dp(and probably nq too) from timing out.
2013-03-12 22:35:33 +00:00
//make sure its all reset.
host_client - > sentents . num_entities = 0 ;
host_client - > ratetime = 0 ;
2016-07-12 00:40:13 +00:00
if ( host_client - > pendingdeltabits )
host_client - > pendingdeltabits [ 0 ] = UF_REMOVE ;
2014-08-25 07:35:41 +00:00
if ( flushparms )
{
if ( host_client - > spawninfo )
Z_Free ( host_client - > spawninfo ) ;
host_client - > spawninfo = NULL ;
memset ( host_client - > spawn_parms , 0 , sizeof ( host_client - > spawn_parms ) ) ;
2017-05-28 15:42:32 +00:00
if ( host_client - > state > cs_zombie )
SV_GetNewSpawnParms ( host_client ) ;
2014-08-25 07:35:41 +00:00
}
2015-08-20 03:17:47 +00:00
if ( preserveplayers & & svprogfuncs & & host_client - > state = = cs_spawned & & host_client - > spawninfo )
{
2015-11-18 07:37:39 +00:00
size_t j = 0 ;
2015-08-20 03:17:47 +00:00
svprogfuncs - > restoreent ( svprogfuncs , host_client - > spawninfo , & j , host_client - > edict ) ;
host_client - > istobeloaded = true ;
host_client - > state = cs_connected ;
2018-03-04 14:41:16 +00:00
if ( host_client - > spectator )
sv . spawned_observer_slots + + ;
else
sv . spawned_client_slots + + ;
2015-08-20 03:17:47 +00:00
}
2007-06-20 00:02:54 +00:00
if ( host_client - > controller )
continue ;
if ( host_client - > state > = cs_connected )
{
2008-11-09 22:29:28 +00:00
if ( host_client - > protocol = = SCP_QUAKE3 )
continue ;
2009-07-25 11:05:06 +00:00
if ( host_client - > protocol = = SCP_BAD )
continue ;
2008-11-09 22:29:28 +00:00
2015-09-01 04:45:15 +00:00
# ifdef NQPROT
2007-06-20 00:02:54 +00:00
if ( ISNQCLIENT ( host_client ) )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{
2007-06-20 00:02:54 +00:00
SVNQ_New_f ( ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
host_client - > send_message = true ;
}
2007-06-20 00:02:54 +00:00
else
2015-09-01 04:45:15 +00:00
# endif
2007-06-20 00:02:54 +00:00
SV_New_f ( ) ;
}
}
2004-08-23 00:15:46 +00:00
2014-03-30 08:55:06 +00:00
if ( ! isrestart )
2004-08-23 00:15:46 +00:00
{
cvar_t * nsv ;
nsv = Cvar_Get ( " nextserver " , " " , 0 , " " ) ;
if ( nextserver )
2004-08-27 00:43:28 +00:00
Cvar_Set ( nsv , va ( " gamemap \" %s \" " , nextserver ) ) ;
2004-08-23 00:15:46 +00:00
else
Cvar_Set ( nsv , " " ) ;
}
2011-06-29 18:39:11 +00:00
2018-08-04 07:05:20 +00:00
# ifdef SAVEDGAMES
2014-08-25 07:35:41 +00:00
if ( q2savetos0 )
2011-06-29 18:39:11 +00:00
{
2016-01-18 05:22:07 +00:00
if ( sv . state ! = ss_cinematic ) //too weird.
SV_Savegame ( " s0 " , true ) ;
2011-06-29 18:39:11 +00:00
}
2018-08-04 07:05:20 +00:00
# endif
2013-07-14 12:22:51 +00:00
if ( isDedicated )
2013-10-29 17:38:22 +00:00
Mod_Purge ( MP_MAPCHANGED ) ;
2004-08-23 00:15:46 +00:00
}
2016-07-12 00:40:13 +00:00
static void SV_KillServer_f ( void )
2004-08-23 00:15:46 +00:00
{
SV_UnspawnServer ( ) ;
}
/*
= = = = = = = = = = = = = = = = = =
SV_Kick_f
Kick a user off of the server
= = = = = = = = = = = = = = = = = =
*/
2016-07-12 00:40:13 +00:00
static void SV_Kick_f ( void )
2005-07-03 15:16:20 +00:00
{
2004-08-23 00:15:46 +00:00
client_t * cl ;
int clnum = - 1 ;
2009-10-06 00:41:42 +00:00
if ( ! sv . state )
return ;
2016-07-12 00:40:13 +00:00
if ( ! strcmp ( Cmd_Argv ( 1 ) , " # " ) )
{
clnum = atoi ( Cmd_Argv ( 2 ) ) - 1 ;
if ( clnum > = 0 & & clnum < sv . allocated_client_slots )
{
cl = & svs . clients [ clnum ] ;
if ( cl - > state > = cs_connected )
{
SV_BroadcastTPrintf ( PRINT_HIGH , " %s was kicked \n " , cl - > name ) ;
// print directly, because the dropped client won't get the
// SV_BroadcastPrintf message
SV_ClientTPrintf ( cl , PRINT_HIGH , " You were kicked \n " ) ;
SV_LogPlayer ( cl , " kicked " ) ;
SV_DropClient ( cl ) ;
}
}
return ;
}
2004-08-23 00:15:46 +00:00
while ( ( cl = SV_GetClientForString ( Cmd_Argv ( 1 ) , & clnum ) ) )
{
2013-11-29 14:36:47 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH , " %s was kicked \n " , cl - > name ) ;
2004-08-23 00:15:46 +00:00
// print directly, because the dropped client won't get the
// SV_BroadcastPrintf message
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( cl , PRINT_HIGH , " You were kicked \n " ) ;
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( cl , " kicked " ) ;
2005-07-03 15:16:20 +00:00
SV_DropClient ( cl ) ;
}
2004-08-23 00:15:46 +00:00
if ( clnum = = - 1 )
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Couldn't find user number %s \n " , Cmd_Argv ( 1 ) ) ;
2004-08-23 00:15:46 +00:00
}
2009-10-06 00:41:42 +00:00
/*for q3's kick bot menu*/
2016-07-12 00:40:13 +00:00
static void SV_KickSlot_f ( void )
2009-10-06 00:41:42 +00:00
{
client_t * cl ;
int clnum = atoi ( Cmd_Argv ( 1 ) ) ;
if ( ! sv . state )
return ;
if ( clnum < sv . allocated_client_slots & & svs . clients [ clnum ] . state )
{
cl = & svs . clients [ clnum ] ;
2013-11-29 14:36:47 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH , " %s was kicked \n " , cl - > name ) ;
2009-10-06 00:41:42 +00:00
// print directly, because the dropped client won't get the
// SV_BroadcastPrintf message
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( cl , PRINT_HIGH , " You were kicked \n " ) ;
2009-10-06 00:41:42 +00:00
SV_LogPlayer ( cl , " kicked " ) ;
SV_DropClient ( cl ) ;
}
else
Con_Printf ( " Client %i is not active \n " , clnum ) ;
}
2014-08-03 14:47:47 +00:00
//ipv4ify if its an ipv6 ipv4-mapped address.
2016-07-12 00:40:13 +00:00
static netadr_t * NET_IPV4ify ( netadr_t * a , netadr_t * tmp )
2014-08-03 14:47:47 +00:00
{
if ( a - > type = = NA_IPV6 & &
! * ( int * ) & a - > address . ip6 [ 0 ] & &
! * ( int * ) & a - > address . ip6 [ 4 ] & &
! * ( short * ) & a - > address . ip6 [ 8 ] & &
* ( short * ) & a - > address . ip6 [ 10 ] = = ( short ) 0xffff )
{
tmp - > type = NA_IP ;
tmp - > connum = a - > connum ;
tmp - > scopeid = a - > scopeid ;
tmp - > port = a - > port ;
tmp - > address . ip [ 0 ] = a - > address . ip6 [ 12 ] ;
tmp - > address . ip [ 1 ] = a - > address . ip6 [ 13 ] ;
tmp - > address . ip [ 2 ] = a - > address . ip6 [ 14 ] ;
tmp - > address . ip [ 3 ] = a - > address . ip6 [ 15 ] ;
a = tmp ;
}
return a ;
}
2014-03-30 08:55:06 +00:00
//will kick clients if they got banned (without being safe)
void SV_EvaluatePenalties ( client_t * cl )
2004-08-23 00:15:46 +00:00
{
2014-03-30 08:55:06 +00:00
bannedips_t * banip ;
2014-06-25 03:53:11 +00:00
unsigned int penalties = 0 , delta , p ;
2015-11-18 07:37:39 +00:00
char * penaltyreason [ countof ( banflags ) ] = { NULL } ;
2015-09-01 04:45:15 +00:00
const char * activepenalties [ countof ( banflags ) ] ;
char * reasons [ countof ( banflags ) ] = { NULL } ;
2014-03-30 08:55:06 +00:00
int numpenalties = 0 ;
int numreasons = 0 ;
2014-06-25 03:53:11 +00:00
int i ;
2014-08-03 14:47:47 +00:00
netadr_t tmp , * a ;
2014-03-30 08:55:06 +00:00
if ( cl - > realip . type ! = NA_INVALID )
{
2014-08-03 14:47:47 +00:00
a = NET_IPV4ify ( & cl - > realip , & tmp ) ;
2014-03-30 08:55:06 +00:00
for ( banip = svs . bannedips ; banip ; banip = banip - > next )
{
2014-08-03 14:47:47 +00:00
if ( NET_CompareAdrMasked ( a , & banip - > adr , & banip - > adrmask ) )
2014-03-30 08:55:06 +00:00
{
2014-06-25 03:53:11 +00:00
for ( i = 0 ; i < sizeof ( penaltyreason ) / sizeof ( penaltyreason [ 0 ] ) ; i + + )
{
p = 1u < < i ;
if ( banip - > banflags & p )
{
if ( ! penaltyreason [ i ] )
penaltyreason [ i ] = banip - > reason ;
penalties | = p ;
}
}
2014-03-30 08:55:06 +00:00
}
}
}
2014-08-03 14:47:47 +00:00
a = NET_IPV4ify ( & cl - > netchan . remote_address , & tmp ) ;
2014-03-30 08:55:06 +00:00
for ( banip = svs . bannedips ; banip ; banip = banip - > next )
2006-05-22 22:51:14 +00:00
{
2014-08-03 14:47:47 +00:00
if ( NET_CompareAdrMasked ( a , & banip - > adr , & banip - > adrmask ) )
2014-03-30 08:55:06 +00:00
{
2014-06-25 03:53:11 +00:00
for ( i = 0 ; i < sizeof ( penaltyreason ) / sizeof ( penaltyreason [ 0 ] ) ; i + + )
{
p = 1u < < i ;
if ( banip - > banflags & p )
{
if ( ! penaltyreason [ i ] )
penaltyreason [ i ] = banip - > reason ;
penalties | = p ;
}
}
2014-03-30 08:55:06 +00:00
}
2006-05-22 22:51:14 +00:00
}
2014-06-25 03:53:11 +00:00
delta = cl - > penalties ^ penalties ;
cl - > penalties = penalties ;
if ( ( penalties & ( BAN_BAN | BAN_PERMIT ) ) = = BAN_BAN )
2006-05-25 04:47:03 +00:00
{
2014-06-25 03:53:11 +00:00
//we should only reach here by a player getting banned mid-game.
2015-11-18 07:37:39 +00:00
if ( penaltyreason [ BAN_BAN ] )
SV_BroadcastPrintf ( PRINT_HIGH , " %s was banned: %s \n " , cl - > name , penaltyreason [ BAN_BAN ] ) ;
2014-03-30 08:55:06 +00:00
else
2014-08-27 09:01:46 +00:00
SV_BroadcastPrintf ( PRINT_HIGH , " %s was banned \n " , cl - > name ) ;
2014-03-30 08:55:06 +00:00
cl - > drop = true ;
2006-05-25 04:47:03 +00:00
}
2014-06-25 03:53:11 +00:00
//don't announce these now.
delta & = ~ ( BAN_BAN | BAN_PERMIT ) ;
2004-08-23 00:15:46 +00:00
2014-06-25 03:53:11 +00:00
//deaf+mute sees no (other) penalty messages
if ( ( ( penalties | delta ) & ( BAN_MUTE | BAN_DEAF ) ) = = ( BAN_MUTE | BAN_DEAF ) )
2015-09-01 04:45:15 +00:00
delta & = ~ ( BAN_MUTE | BAN_DEAF ) ;
if ( penalties & BAN_STEALTH )
delta = 0 ; //don't announce ANY.
2014-06-25 03:53:11 +00:00
if ( cl - > controller )
delta = 0 ; //don't spam it for every player in a splitscreen client.
2008-05-25 22:23:43 +00:00
2014-06-25 03:53:11 +00:00
if ( delta & BAN_VIP )
2008-05-25 22:23:43 +00:00
{
2014-06-25 03:53:11 +00:00
delta & = ~ BAN_VIP ; //don't refer to this as a penalty
2014-06-30 21:57:35 +00:00
if ( penalties & BAN_VIP )
2014-06-25 03:53:11 +00:00
SV_PrintToClient ( cl , PRINT_HIGH , " You are a VIP, apparently \n " ) ;
else
SV_PrintToClient ( cl , PRINT_HIGH , " VIP expired \n " ) ;
2014-03-30 08:55:06 +00:00
}
2008-05-25 22:23:43 +00:00
2015-09-01 04:45:15 +00:00
for ( i = 0 ; i < countof ( banflags ) ; i + + )
2014-03-30 08:55:06 +00:00
{
2015-09-01 04:45:15 +00:00
p = banflags [ i ] . banflag ;
2014-06-25 03:53:11 +00:00
if ( delta & p )
2014-03-30 08:55:06 +00:00
{
2014-06-25 03:53:11 +00:00
if ( penalties & p )
2014-03-30 08:55:06 +00:00
{
2015-09-01 04:45:15 +00:00
if ( banflags [ i ] . names [ 0 ] )
activepenalties [ numpenalties + + ] = banflags [ i ] . names [ 0 ] ;
2014-06-25 03:53:11 +00:00
if ( reasons [ i ] & & * reasons [ i ] )
reasons [ numreasons + + ] = reasons [ i ] ;
2014-03-30 08:55:06 +00:00
}
2014-06-25 03:53:11 +00:00
else
2015-09-01 04:45:15 +00:00
SV_PrintToClient ( cl , PRINT_HIGH , va ( " Penalty expired: %s \n " , banflags [ i ] . names [ 0 ] ) ) ;
2014-03-30 08:55:06 +00:00
}
}
2008-05-25 22:23:43 +00:00
2014-03-30 08:55:06 +00:00
if ( numpenalties )
{
char penaltystring [ 1024 ] ;
int i , j ;
2014-06-25 03:53:11 +00:00
Q_strncpyz ( penaltystring , " You are penalised: " , sizeof ( penaltystring ) ) ;
2014-03-30 08:55:06 +00:00
for ( i = 0 ; i < numpenalties ; i + + )
2008-05-25 22:23:43 +00:00
{
2014-03-30 08:55:06 +00:00
if ( i & & i = = numpenalties - 1 )
Q_strncatz ( penaltystring , " and " , sizeof ( penaltystring ) ) ;
else if ( i )
Q_strncatz ( penaltystring , " , " , sizeof ( penaltystring ) ) ;
2014-06-25 03:53:11 +00:00
Q_strncatz ( penaltystring , activepenalties [ i ] , sizeof ( penaltystring ) ) ;
2014-03-30 08:55:06 +00:00
}
Q_strncatz ( penaltystring , " \n " , sizeof ( penaltystring ) ) ;
SV_PrintToClient ( cl , PRINT_HIGH , penaltystring ) ;
for ( i = 0 ; i < numreasons ; i + + )
{
if ( * reasons [ i ] )
{
for ( j = 0 ; j < i ; j + + )
if ( ! strcmp ( reasons [ i ] , reasons [ j ] ) )
break ;
if ( i = = j )
SV_PrintToClient ( cl , PRINT_HIGH , va ( " %s \n " , reasons [ i ] ) ) ;
}
2008-05-25 22:23:43 +00:00
}
}
2017-04-18 11:12:17 +00:00
if ( delta & BAN_VIP )
2018-07-05 16:21:44 +00:00
InfoBuf_SetStarKey ( & cl - > userinfo , " *VIP " , ( cl - > penalties & BAN_VIP ) ? " 1 " : " " ) ;
2017-04-18 11:12:17 +00:00
if ( delta & BAN_MAPPER )
2018-07-05 16:21:44 +00:00
InfoBuf_SetStarKey ( & cl - > userinfo , " *mapper " , ( cl - > penalties & BAN_MAPPER ) ? " 1 " : " " ) ;
2008-05-25 22:23:43 +00:00
}
2014-03-30 08:55:06 +00:00
static time_t reevaluatebantime ;
static qboolean reevaluatebans ;
//could use time(NULL) instead, but this avoids a system call.
static time_t SV_BanTime ( void )
2004-08-23 00:15:46 +00:00
{
2014-03-30 08:55:06 +00:00
static double bantimemark ;
static time_t banstarttime ;
if ( ! banstarttime )
2006-05-22 22:51:14 +00:00
{
2014-03-30 08:55:06 +00:00
banstarttime = time ( NULL ) ;
bantimemark = realtime ;
}
return banstarttime + ( realtime - bantimemark ) ;
}
//removes anything with an expiry time in the past.
//avoids walking the list if there's nothing changed.
//can be used to force penalty reevaluation.
void SV_KillExpiredBans ( void )
{
bannedips_t * * link , * banip ;
time_t curtime = SV_BanTime ( ) ;
int i ;
if ( reevaluatebantime & & curtime > reevaluatebantime )
{
reevaluatebantime = 0 ;
for ( link = & svs . bannedips ; ( banip = * link ) ! = NULL ; )
{
if ( banip - > expiretime )
{
if ( banip - > expiretime < curtime )
{
reevaluatebans = true ;
* link = banip - > next ;
Z_Free ( banip ) ;
continue ;
}
2014-10-27 15:27:51 +00:00
if ( ! reevaluatebantime | | reevaluatebantime > banip - > expiretime )
reevaluatebantime = banip - > expiretime + 1 ;
2014-03-30 08:55:06 +00:00
}
link = & banip - > next ;
}
2006-05-22 22:51:14 +00:00
}
2004-08-23 00:15:46 +00:00
2014-03-30 08:55:06 +00:00
if ( reevaluatebans )
2004-08-23 00:15:46 +00:00
{
2014-03-30 08:55:06 +00:00
reevaluatebans = false ;
for ( i = 0 ; i < svs . allocated_client_slots ; i + + )
{
if ( svs . clients [ i ] . state < = cs_loadzombie )
continue ;
SV_EvaluatePenalties ( & svs . clients [ i ] ) ;
}
2006-05-22 22:51:14 +00:00
}
2014-03-30 08:55:06 +00:00
}
2006-05-22 22:51:14 +00:00
2014-03-30 08:55:06 +00:00
//adds a new ban/penalty.
//will remove old penalties if the new one has a longer duration, otherwise will ignore the add.
static qboolean SV_AddBanEntry ( bannedips_t * proto , char * reason )
{
bannedips_t * nb , * * link ;
nb = svs . bannedips ;
while ( nb )
2006-05-22 22:51:14 +00:00
{
2014-03-30 08:55:06 +00:00
if ( NET_CompareAdr ( & nb - > adr , & proto - > adr ) & & NET_CompareAdr ( & nb - > adrmask , & proto - > adrmask ) )
{
//found a match, figure out which lasts longer
//the shorter ban duration gets its effective banflags stripped.
if ( ( proto - > expiretime & & proto - > expiretime < nb - > expiretime ) | | ! nb - > expiretime )
proto - > banflags & = ~ nb - > banflags ;
else
nb - > banflags & = ~ proto - > banflags ;
if ( ! proto - > banflags )
{
//we should not have been able to strip a previous nb->banflags if this ban was duped later.
return false ;
}
if ( ! nb - > banflags )
reevaluatebantime = nb - > expiretime = 1 ; //make sure it expires 'soon'.
}
nb = nb - > next ;
2006-05-22 22:51:14 +00:00
}
2014-03-30 08:55:06 +00:00
link = & svs . bannedips ;
2006-05-25 04:47:03 +00:00
2014-03-30 08:55:06 +00:00
// add IP and mask to filter list
nb = Z_Malloc ( sizeof ( bannedips_t ) + strlen ( reason ) ) ;
nb - > adr = proto - > adr ;
nb - > adrmask = proto - > adrmask ;
nb - > banflags = proto - > banflags ;
nb - > expiretime = proto - > expiretime ;
Q_strcpy ( nb - > reason , reason ) ;
nb - > next = * link ;
* link = nb ;
reevaluatebans = true ; //make sure the new ban/penalty applies to the right IPs.
2014-10-27 15:27:51 +00:00
if ( nb - > expiretime & & ( ! reevaluatebantime | | reevaluatebantime > nb - > expiretime ) )
2014-03-30 08:55:06 +00:00
reevaluatebantime = nb - > expiretime ;
return true ;
2008-05-25 22:23:43 +00:00
}
2014-03-30 08:55:06 +00:00
//slightly different logic.
//if duration is specified, just does an add instead.
//otherwise ignores durations.
//only really works with a single toggle. if any are found, will not add.
//returns 1 if added, 0 if removed, and -1 if tried to add and it already existed.
static int SV_ToggleBan ( bannedips_t * proto , char * reason )
2008-05-25 22:23:43 +00:00
{
2014-03-30 08:55:06 +00:00
qboolean found = false ;
bannedips_t * nb ;
if ( proto - > expiretime )
return SV_AddBanEntry ( proto , reason ) ? true : - 1 ;
2008-05-25 22:23:43 +00:00
2014-03-30 08:55:06 +00:00
nb = svs . bannedips ;
while ( nb )
2006-05-22 22:51:14 +00:00
{
2014-03-30 08:55:06 +00:00
if ( NET_CompareAdr ( & nb - > adr , & proto - > adr ) & & NET_CompareAdr ( & nb - > adrmask , & proto - > adrmask ) )
2008-05-25 22:23:43 +00:00
{
2014-03-30 08:55:06 +00:00
if ( nb - > banflags & proto - > banflags )
{
found = true ;
nb - > banflags & = ~ proto - > banflags ;
reevaluatebans = true ;
if ( ! nb - > banflags )
2014-10-27 15:27:51 +00:00
reevaluatebantime = nb - > expiretime = 1 ; //make sure it expires 'soon' (in the past).
2014-03-30 08:55:06 +00:00
}
2008-05-25 22:23:43 +00:00
}
2014-03-30 08:55:06 +00:00
nb = nb - > next ;
}
2006-05-22 22:51:14 +00:00
2014-03-30 08:55:06 +00:00
if ( found )
return 0 ;
return SV_AddBanEntry ( proto , reason ) ? true : - 1 ;
}
extern cvar_t filterban ;
//returns a reason if the client is banned. ignores other penalties.
char * SV_BannedReason ( netadr_t * a )
{
char * reason = filterban . value ? NULL : " " ; //"" = banned with no explicit reason
bannedips_t * banip ;
2014-08-03 14:47:47 +00:00
netadr_t tmp ;
2014-03-30 08:55:06 +00:00
if ( NET_IsLoopBackAddress ( a ) )
return NULL ; // never filter loopback
2014-08-03 14:47:47 +00:00
a = NET_IPV4ify ( a , & tmp ) ;
2014-03-30 08:55:06 +00:00
for ( banip = svs . bannedips ; banip ; banip = banip - > next )
{
if ( NET_CompareAdrMasked ( a , & banip - > adr , & banip - > adrmask ) )
2008-05-25 22:23:43 +00:00
{
2014-03-30 08:55:06 +00:00
if ( banip - > banflags & BAN_BAN )
return banip - > reason ; //banned, with reason.
if ( banip - > banflags & BAN_PERMIT )
return NULL ; //allowed
2004-08-23 00:15:46 +00:00
}
}
2014-03-30 08:55:06 +00:00
return reason ;
2006-05-25 04:47:03 +00:00
}
2014-03-30 08:55:06 +00:00
static void SV_FilterIP_f ( void )
2006-05-25 04:47:03 +00:00
{
2014-03-30 08:55:06 +00:00
bannedips_t proto ;
2006-05-25 04:47:03 +00:00
extern cvar_t filterban ;
2014-03-30 08:55:06 +00:00
char * s ;
2015-09-01 04:45:15 +00:00
int i ;
2006-05-25 04:47:03 +00:00
if ( Cmd_Argc ( ) < 2 )
{
2014-03-30 08:55:06 +00:00
Con_Printf ( " %s <address/mask|adress/maskbits> [flags] [+time] [reason] \n " , Cmd_Argv ( 0 ) ) ;
2015-09-01 04:45:15 +00:00
Con_Printf ( " allowed flags: %s " , banflags [ 0 ] . names [ 0 ] ) ;
for ( i = 1 ; i < countof ( banflags ) ; i + + )
Con_Printf ( " ,%s " , banflags [ i ] . names [ 0 ] ) ;
Con_Printf ( " . time is in seconds (omitting the plus will be taken to mean unix time). \n " ) ;
2006-05-25 04:47:03 +00:00
return ;
}
2017-02-11 16:14:06 +00:00
if ( ! NET_StringToAdrMasked ( Cmd_Argv ( 1 ) , true , & proto . adr , & proto . adrmask ) )
2006-05-25 04:47:03 +00:00
{
Con_Printf ( " invalid address or mask \n " ) ;
return ;
}
2014-03-30 08:55:06 +00:00
s = Cmd_Argv ( 2 ) ;
proto . banflags = 0 ;
while ( * s )
{
s = COM_ParseToken ( s , " , " ) ;
if ( ! Q_strcasecmp ( com_token , " , " ) )
2015-09-01 04:45:15 +00:00
i = - 1 ;
else for ( i = 0 ; i < countof ( banflags ) ; i + + )
{
if ( ! Q_strcasecmp ( com_token , banflags [ i ] . names [ 0 ] ) | | ( banflags [ i ] . names [ 1 ] & & ! Q_strcasecmp ( com_token , banflags [ i ] . names [ 1 ] ) ) )
{
proto . banflags | = banflags [ i ] . banflag ;
break ;
}
}
if ( i = = countof ( banflags ) )
2014-03-30 08:55:06 +00:00
Con_Printf ( " Unknown ban/penalty flag: %s. ignoring. \n " , com_token ) ;
2010-01-10 15:15:20 +00:00
}
2014-03-30 08:55:06 +00:00
//if no flags were specified,
if ( ! proto . banflags )
2006-05-25 04:47:03 +00:00
{
2014-03-30 08:55:06 +00:00
if ( ! strcmp ( Cmd_Argv ( 0 ) , " ban " ) )
proto . banflags = BAN_BAN ;
else
proto . banflags = filterban . ival ? BAN_BAN : BAN_PERMIT ;
2006-05-25 04:47:03 +00:00
}
2017-04-18 11:12:17 +00:00
if ( NET_IsLoopBackAddress ( & proto . adr ) & & ( proto . banflags & BAN_NOLOCALHOST ) )
{ //do allow them to be muted etc, just not banned outright.
Con_Printf ( " You're not allowed to filter loopback! \n " ) ;
return ;
}
2014-03-30 08:55:06 +00:00
s = Cmd_Argv ( 3 ) ;
if ( * s = = ' + ' )
2014-10-27 15:27:51 +00:00
{
time_t secs = strtoull ( s + 1 , & s , 0 ) ;
if ( * s = = ' : ' )
{
secs * = 60 ;
secs + = strtoull ( s + 1 , & s , 0 ) ;
}
proto . expiretime = SV_BanTime ( ) + secs ;
}
2014-03-30 08:55:06 +00:00
else
proto . expiretime = strtoull ( s , NULL , 0 ) ;
//and then add it
if ( ! SV_AddBanEntry ( & proto , Cmd_Argv ( 4 ) ) )
Con_Printf ( " addip: entry already exists \n " ) ;
2006-05-22 22:51:14 +00:00
}
2014-03-30 08:55:06 +00:00
static void SV_BanList_f ( void )
2006-05-22 22:51:14 +00:00
{
int bancount = 0 ;
2014-03-30 08:55:06 +00:00
bannedips_t * nb ;
2008-06-08 14:37:57 +00:00
char adr [ MAX_ADR_SIZE ] ;
2014-03-30 08:55:06 +00:00
char middlebit [ 256 ] ;
time_t bantime = SV_BanTime ( ) ;
2006-05-22 22:51:14 +00:00
2014-03-30 08:55:06 +00:00
SV_KillExpiredBans ( ) ;
for ( nb = svs . bannedips ; nb ; nb = nb - > next )
2006-05-22 22:51:14 +00:00
{
2014-03-30 08:55:06 +00:00
if ( nb - > banflags & BAN_BAN )
{
* middlebit = 0 ;
if ( nb - > expiretime )
2016-02-15 06:01:17 +00:00
Q_strncatz ( middlebit , va ( " , \t +% " PRIu64 , ( quint64_t ) ( nb - > expiretime - bantime ) ) , sizeof ( middlebit ) ) ;
2014-03-30 08:55:06 +00:00
if ( nb - > reason [ 0 ] )
Q_strncatz ( middlebit , " , \t " , sizeof ( middlebit ) ) ;
Con_Printf ( " %s%s%s \n " , NET_AdrToStringMasked ( adr , sizeof ( adr ) , & nb - > adr , & nb - > adrmask ) , middlebit , nb - > reason ) ;
bancount + + ;
}
2006-05-22 22:51:14 +00:00
}
Con_Printf ( " %i total entries in ban list \n " , bancount ) ;
}
2014-03-30 08:55:06 +00:00
static void SV_FilterList_f ( void )
2006-05-25 04:47:03 +00:00
{
int filtercount = 0 ;
2014-03-30 08:55:06 +00:00
bannedips_t * nb ;
2008-06-08 14:37:57 +00:00
char adr [ MAX_ADR_SIZE ] ;
2015-09-01 04:45:15 +00:00
char banflagtext [ 1024 ] ;
2014-03-30 08:55:06 +00:00
int i ;
2014-10-27 15:27:51 +00:00
time_t curtime = SV_BanTime ( ) ;
2014-03-30 08:55:06 +00:00
SV_KillExpiredBans ( ) ;
for ( nb = svs . bannedips ; nb ; )
{
2015-09-01 04:45:15 +00:00
* banflagtext = 0 ;
for ( i = 0 ; i < countof ( banflags ) ; i + + )
2014-03-30 08:55:06 +00:00
{
2015-09-01 04:45:15 +00:00
if ( nb - > banflags & banflags [ i ] . banflag )
2014-03-30 08:55:06 +00:00
{
2015-09-01 04:45:15 +00:00
if ( * banflagtext )
Q_strncatz ( banflagtext , " , " , sizeof ( banflagtext ) ) ;
Q_strncatz ( banflagtext , banflags [ i ] . names [ 0 ] , sizeof ( banflagtext ) ) ;
2014-03-30 08:55:06 +00:00
}
}
2006-05-25 04:47:03 +00:00
2014-10-27 15:27:51 +00:00
if ( nb - > expiretime )
{
time_t secs = nb - > expiretime - curtime ;
2016-02-15 06:01:17 +00:00
Con_Printf ( " %s %s +% " PRIu64 " :%02u \n " , NET_AdrToStringMasked ( adr , sizeof ( adr ) , & nb - > adr , & nb - > adrmask ) , banflagtext , ( quint64_t ) ( secs / 60 ) , ( unsigned int ) ( secs % 60 ) ) ;
2014-10-27 15:27:51 +00:00
}
else
2015-09-01 04:45:15 +00:00
Con_Printf ( " %s %s \n " , NET_AdrToStringMasked ( adr , sizeof ( adr ) , & nb - > adr , & nb - > adrmask ) , banflagtext ) ;
2006-05-25 04:47:03 +00:00
filtercount + + ;
nb = nb - > next ;
}
Con_Printf ( " %i total entries in filter list \n " , filtercount ) ;
}
2014-03-30 08:55:06 +00:00
static void SV_Unfilter_f ( void )
2006-05-22 22:51:14 +00:00
{
2014-03-30 08:55:06 +00:00
qboolean found = false ;
2006-05-22 22:51:14 +00:00
qboolean all = false ;
2013-08-27 18:09:14 +00:00
bannedips_t * * link ;
bannedips_t * nb ;
2006-05-22 22:51:14 +00:00
netadr_t unbanadr = { 0 } ;
netadr_t unbanmask = { 0 } ;
2008-06-08 14:37:57 +00:00
char adr [ MAX_ADR_SIZE ] ;
2015-09-01 04:45:15 +00:00
unsigned int clearbanflags , nf ;
2014-03-30 08:55:06 +00:00
char * s ;
2015-09-01 04:45:15 +00:00
int i ;
2014-03-30 08:55:06 +00:00
SV_KillExpiredBans ( ) ;
2006-05-22 22:51:14 +00:00
if ( Cmd_Argc ( ) < 2 )
{
2016-07-12 00:40:13 +00:00
Con_Printf ( " %s address/mask|address/maskbits|all [flags] \n " , Cmd_Argv ( 0 ) ) ;
2006-05-22 22:51:14 +00:00
return ;
}
if ( ! Q_strcasecmp ( Cmd_Argv ( 1 ) , " all " ) )
2014-01-17 08:05:25 +00:00
{
2014-03-30 08:55:06 +00:00
Con_Printf ( " removing all filtered addresses \n " ) ;
2006-05-22 22:51:14 +00:00
all = true ;
2014-01-17 08:05:25 +00:00
}
2017-02-11 16:14:06 +00:00
else if ( ! NET_StringToAdrMasked ( Cmd_Argv ( 1 ) , true , & unbanadr , & unbanmask ) )
2006-05-22 22:51:14 +00:00
{
Con_Printf ( " invalid address or mask \n " ) ;
return ;
}
2014-03-30 08:55:06 +00:00
s = Cmd_Argv ( 2 ) ;
2015-09-01 04:45:15 +00:00
clearbanflags = 0 ;
2014-03-30 08:55:06 +00:00
while ( * s )
{
s = COM_ParseToken ( s , " , " ) ;
if ( ! Q_strcasecmp ( com_token , " , " ) )
2015-09-01 04:45:15 +00:00
i = - 1 ;
else for ( i = 0 ; i < countof ( banflags ) ; i + + )
{
if ( ! Q_strcasecmp ( com_token , banflags [ i ] . names [ 0 ] ) | | ( banflags [ i ] . names [ 1 ] & & ! Q_strcasecmp ( com_token , banflags [ i ] . names [ 1 ] ) ) )
{
clearbanflags | = banflags [ i ] . banflag ;
break ;
}
}
if ( i = = countof ( banflags ) )
2014-03-30 08:55:06 +00:00
Con_Printf ( " Unknown ban/penalty flag: %s. ignoring. \n " , com_token ) ;
}
//if no flags were specified, assume all
2015-09-01 04:45:15 +00:00
if ( ! clearbanflags )
2016-07-12 00:40:13 +00:00
clearbanflags = ~ 0u ;
2014-03-30 08:55:06 +00:00
2013-08-27 18:09:14 +00:00
for ( link = & svs . bannedips ; ( nb = * link ) ; )
2006-05-22 22:51:14 +00:00
{
2015-09-01 04:45:15 +00:00
if ( ( nb - > banflags & clearbanflags ) & & ( all | | ( NET_CompareAdr ( & nb - > adr , & unbanadr ) & & NET_CompareAdr ( & nb - > adrmask , & unbanmask ) ) ) )
2006-05-22 22:51:14 +00:00
{
2014-03-30 08:55:06 +00:00
found = true ;
2006-05-22 22:51:14 +00:00
if ( ! all )
2014-03-30 08:55:06 +00:00
Con_Printf ( " unfiltered %s \n " , NET_AdrToStringMasked ( adr , sizeof ( adr ) , & nb - > adr , & nb - > adrmask ) ) ;
2009-04-28 15:49:20 +00:00
2015-09-01 04:45:15 +00:00
nf = nb - > banflags & clearbanflags ;
2014-03-30 08:55:06 +00:00
nb - > banflags - = nf ;
if ( ! nb - > banflags )
{
//this entry no longer has any flags
* link = nb - > next ;
Z_Free ( nb ) ;
}
else
link = & ( * link ) - > next ;
2006-05-22 22:51:14 +00:00
}
2013-08-27 18:09:14 +00:00
else
{
link = & ( * link ) - > next ;
}
2006-05-22 22:51:14 +00:00
}
2014-01-17 08:05:25 +00:00
2014-03-30 08:55:06 +00:00
if ( ! all & & ! found )
Con_Printf ( " address was not filtered \n " ) ;
2014-06-25 03:53:11 +00:00
if ( found )
{
reevaluatebans = true ;
SV_KillExpiredBans ( ) ;
}
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
static void SV_PenaltyToggle ( unsigned int banflag , char * penaltyname )
2006-05-25 04:47:03 +00:00
{
2014-08-15 02:20:41 +00:00
char * clname = Cmd_Argv ( 1 ) ;
2014-03-30 08:55:06 +00:00
char * duration = Cmd_Argv ( 2 ) ;
char * reason = Cmd_Argv ( 3 ) ;
bannedips_t proto ;
client_t * cl ;
qboolean found = false ;
int clnum = - 1 ;
2006-05-25 04:47:03 +00:00
2014-03-30 08:55:06 +00:00
proto . banflags = banflag ;
2006-05-25 04:47:03 +00:00
2014-03-30 08:55:06 +00:00
if ( * duration = = ' + ' )
proto . expiretime = SV_BanTime ( ) + strtoull ( duration + 1 , & duration , 0 ) ;
else
proto . expiretime = strtoull ( duration , & duration , 0 ) ;
2006-05-25 04:47:03 +00:00
2014-03-30 08:55:06 +00:00
//both of these should work
//cuff foo "cos they're morons"
//cuff foo +10 "cos they're morons"
if ( ! * reason & & * duration )
reason = duration ;
memset ( & proto . adrmask . address , 0xff , sizeof ( proto . adrmask . address ) ) ;
2014-08-15 02:20:41 +00:00
while ( ( cl = SV_GetClientForString ( clname , & clnum ) ) )
2006-05-25 04:47:03 +00:00
{
2014-03-30 08:55:06 +00:00
found = true ;
proto . adr = cl - > netchan . remote_address ;
proto . adr . port = 0 ;
proto . adrmask . type = cl - > netchan . remote_address . type ;
2006-05-25 04:47:03 +00:00
2017-04-18 11:12:17 +00:00
if ( NET_IsLoopBackAddress ( & proto . adr ) & & ( proto . banflags & BAN_NOLOCALHOST ) )
{
Con_Printf ( " You're not allowed to filter loopback! \n " ) ;
continue ;
}
2014-03-30 08:55:06 +00:00
switch ( SV_ToggleBan ( & proto , reason ) )
2014-01-17 08:05:25 +00:00
{
2014-03-30 08:55:06 +00:00
case 1 :
Con_Printf ( " %s: %s is now %s \n " , Cmd_Argv ( 0 ) , cl - > name , penaltyname ) ;
break ;
case 0 :
Con_Printf ( " %s: %s is no longer %s \n " , Cmd_Argv ( 0 ) , cl - > name , penaltyname ) ;
break ;
default :
case - 1 :
Con_Printf ( " %s: %s already %s \n " , Cmd_Argv ( 0 ) , cl - > name , penaltyname ) ;
break ;
2014-01-17 08:05:25 +00:00
}
2006-05-25 04:47:03 +00:00
}
2014-03-30 08:55:06 +00:00
if ( ! found )
Con_Printf ( " %s: no clients \n " , Cmd_Argv ( 0 ) ) ;
2006-05-25 04:47:03 +00:00
}
2016-07-12 00:40:13 +00:00
void SV_AutoAddPenalty ( client_t * cl , unsigned int banflag , int duration , char * reason )
{
bannedips_t proto ;
proto . banflags = banflag ;
proto . expiretime = SV_BanTime ( ) + duration ;
memset ( & proto . adrmask . address , 0xff , sizeof ( proto . adrmask . address ) ) ;
proto . adr = cl - > netchan . remote_address ;
proto . adr . port = 0 ;
proto . adrmask . type = proto . adr . type ;
SV_AddBanEntry ( & proto , reason ) ;
SV_EvaluatePenalties ( cl ) ;
}
2014-03-30 08:55:06 +00:00
static void SV_WriteIP_f ( void )
2006-05-29 16:12:21 +00:00
{
vfsfile_t * f ;
char name [ MAX_OSPATH ] ;
bannedips_t * bi ;
char * s ;
2008-06-08 14:37:57 +00:00
char adr [ MAX_ADR_SIZE ] ;
2015-09-01 04:45:15 +00:00
char banflagtext [ 1024 ] ;
2014-03-30 08:55:06 +00:00
int i ;
SV_KillExpiredBans ( ) ;
2006-05-29 16:12:21 +00:00
strcpy ( name , " listip.cfg " ) ;
Con_Printf ( " Writing %s. \n " , name ) ;
2015-02-02 08:01:53 +00:00
f = FS_OpenVFS ( name , " wb " , FS_GAMEONLY ) ;
2006-05-29 16:12:21 +00:00
if ( ! f )
{
Con_Printf ( " Couldn't open %s \n " , name ) ;
return ;
}
bi = svs . bannedips ;
while ( bi )
{
2015-09-01 04:45:15 +00:00
* banflagtext = 0 ;
for ( i = 0 ; i < countof ( banflags ) ; i + + )
2014-03-30 08:55:06 +00:00
{
2015-09-01 04:45:15 +00:00
if ( bi - > banflags & banflags [ i ] . banflag )
2014-03-30 08:55:06 +00:00
{
2015-09-01 04:45:15 +00:00
if ( * banflagtext )
Q_strncatz ( banflagtext , " , " , sizeof ( banflagtext ) ) ;
Q_strncatz ( banflagtext , banflags [ i ] . names [ 0 ] , sizeof ( banflagtext ) ) ;
2014-03-30 08:55:06 +00:00
}
}
2006-05-29 16:12:21 +00:00
if ( bi - > reason [ 0 ] )
2016-02-15 06:01:17 +00:00
s = va ( " addip %s %s % " PRIu64 " \" %s \" \n " , NET_AdrToStringMasked ( adr , sizeof ( adr ) , & bi - > adr , & bi - > adrmask ) , banflagtext , ( quint64_t ) bi - > expiretime , bi - > reason ) ;
2014-03-30 08:55:06 +00:00
else if ( bi - > expiretime )
2016-02-15 06:01:17 +00:00
s = va ( " addip %s %s % " PRIu64 " \n " , NET_AdrToStringMasked ( adr , sizeof ( adr ) , & bi - > adr , & bi - > adrmask ) , banflagtext , ( quint64_t ) bi - > expiretime ) ;
2006-05-29 16:12:21 +00:00
else
2015-09-01 04:45:15 +00:00
s = va ( " addip %s %s \n " , NET_AdrToStringMasked ( adr , sizeof ( adr ) , & bi - > adr , & bi - > adrmask ) , banflagtext ) ;
2006-05-29 16:12:21 +00:00
VFS_WRITE ( f , s , strlen ( s ) ) ;
bi = bi - > next ;
}
VFS_CLOSE ( f ) ;
}
2014-03-30 08:55:06 +00:00
static void SV_ForceName_f ( void )
2004-08-23 00:15:46 +00:00
{
client_t * cl ;
int clnum = - 1 ;
while ( ( cl = SV_GetClientForString ( Cmd_Argv ( 1 ) , & clnum ) ) )
{
2018-07-05 16:21:44 +00:00
InfoBuf_SetKey ( & cl - > userinfo , " name " , Cmd_Argv ( 2 ) ) ;
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( cl , " name forced " ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
SV_ExtractFromUserinfo ( cl , true ) ;
2005-09-27 05:53:31 +00:00
Q_strncpyz ( cl - > name , Cmd_Argv ( 2 ) , sizeof ( cl - > namebuf ) ) ;
2017-03-30 18:37:16 +00:00
SV_BroadcastUserinfoChange ( cl , true , " name " , cl - > name ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( clnum = = - 1 )
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Couldn't find user number %s \n " , Cmd_Argv ( 1 ) ) ;
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
static void SV_CripplePlayer_f ( void )
2004-08-23 00:15:46 +00:00
{
2014-03-30 08:55:06 +00:00
SV_PenaltyToggle ( BAN_CRIPPLED , " crippled " ) ;
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
static void SV_Mute_f ( void )
2004-08-23 00:15:46 +00:00
{
2014-03-30 08:55:06 +00:00
SV_PenaltyToggle ( BAN_MUTE , " muted " ) ;
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
static void SV_Cuff_f ( void )
2004-08-23 00:15:46 +00:00
{
2014-03-30 08:55:06 +00:00
SV_PenaltyToggle ( BAN_CUFF , " cuffed " ) ;
}
2004-08-23 00:15:46 +00:00
2014-03-30 08:55:06 +00:00
static void SV_BanClientIP_f ( void )
{
SV_PenaltyToggle ( BAN_BAN , " banned " ) ;
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
static void SV_Floodprot_f ( void )
2006-05-30 04:00:24 +00:00
{
extern cvar_t sv_floodprotect ;
extern cvar_t sv_floodprotect_messages ;
extern cvar_t sv_floodprotect_interval ;
extern cvar_t sv_floodprotect_silencetime ;
if ( Cmd_Argc ( ) = = 1 )
{
if ( sv_floodprotect_messages . value < = 0 | | ! sv_floodprotect . value )
Con_Printf ( " Flood protection is off. \n " ) ;
else
Con_Printf ( " Current flood protection settings: \n After %g msgs for %g seconds, silence for %g seconds \n " ,
sv_floodprotect_messages . value ,
sv_floodprotect_interval . value ,
sv_floodprotect_silencetime . value ) ;
return ;
}
if ( Cmd_Argc ( ) ! = 4 )
{
Con_Printf ( " Usage: %s <messagerate> <ratepersecond> <silencetime> \n " , Cmd_Argv ( 0 ) ) ;
return ;
}
Cvar_SetValue ( & sv_floodprotect_messages , atof ( Cmd_Argv ( 1 ) ) ) ;
Cvar_SetValue ( & sv_floodprotect_interval , atof ( Cmd_Argv ( 2 ) ) ) ;
Cvar_SetValue ( & sv_floodprotect_silencetime , atof ( Cmd_Argv ( 3 ) ) ) ;
}
2014-03-30 08:55:06 +00:00
static void SV_StuffToClient_f ( void )
2004-08-23 00:15:46 +00:00
{ //with this we emulate the progs 'stuffcmds' builtin
client_t * cl ;
int clnum = - 1 ;
char * clientname = Cmd_Argv ( 1 ) ;
char * str ;
char * c ;
char * key ;
2016-11-20 20:52:41 +00:00
if ( Cmd_Argc ( ) < 3 )
{
Con_Printf ( " %s <clientname> <consolecommand> \n " , Cmd_Argv ( 0 ) ) ;
return ;
}
2004-12-08 04:14:52 +00:00
Cmd_ShiftArgs ( 1 , Cmd_ExecLevel = = RESTRICT_LOCAL ) ;
2004-08-23 00:15:46 +00:00
if ( ! strcmp ( Cmd_Argv ( 1 ) , " bind " ) )
{
key = Z_Malloc ( strlen ( Cmd_Argv ( 2 ) ) + 1 ) ;
strcpy ( key , Cmd_Argv ( 2 ) ) ;
2004-12-08 04:14:52 +00:00
Cmd_ShiftArgs ( 2 , Cmd_ExecLevel = = RESTRICT_LOCAL ) ;
2004-08-23 00:15:46 +00:00
}
else
key = NULL ;
str = Cmd_Args ( ) ;
while ( * str < = ' ' ) //strim leading spaces
{
if ( ! * str )
break ;
str + + ;
}
//a list of safe, allowed commands. Allows any extention of this.
if ( strchr ( str , ' \n ' ) | | strchr ( str , ' ; ' ) | | (
2006-06-12 22:05:41 +00:00
! strncmp ( str , " setinfo " , 7 ) & &
! strncmp ( str , " quit " , 4 ) & &
! strncmp ( str , " gl_fb " , 5 ) & &
! strncmp ( str , " r_fb " , 4 ) & &
2006-06-15 21:40:54 +00:00
! strncmp ( str , " say " , 3 ) & & //note that the say parsing could be useful here.
2006-06-12 22:05:41 +00:00
! strncmp ( str , " echo " , 4 ) & &
! strncmp ( str , " name " , 4 ) & &
! strncmp ( str , " skin " , 4 ) & &
! strncmp ( str , " color " , 5 ) & &
! strncmp ( str , " cmd " , 3 ) & &
! strncmp ( str , " fov " , 3 ) & &
! strncmp ( str , " connect " , 7 ) & &
! strncmp ( str , " rate " , 4 ) & &
! strncmp ( str , " cd " , 2 ) & &
! strncmp ( str , " easyrecord " , 10 ) & &
! strncmp ( str , " leftisright " , 11 ) & &
! strncmp ( str , " menu_ " , 5 ) & &
! strncmp ( str , " r_fullbright " , 12 ) & &
! strncmp ( str , " toggleconsole " , 13 ) & &
! strncmp ( str , " v_i " , 3 ) & & //idlescale vars
! strncmp ( str , " bf " , 2 ) & &
! strncmp ( str , " + " , 1 ) & &
! strncmp ( str , " - " , 1 ) & &
! strncmp ( str , " impulse " , 7 ) & &
2004-08-23 00:15:46 +00:00
1 ) )
{
Con_Printf ( " You're not allowed to stuffcmd that \n " ) ;
if ( key )
Z_Free ( key ) ;
return ;
}
while ( ( cl = SV_GetClientForString ( clientname , & clnum ) ) )
{
2005-05-26 12:55:34 +00:00
if ( cl - > protocol = = SCP_QUAKE2 )
2004-08-23 00:15:46 +00:00
ClientReliableWrite_Begin ( cl , svcq2_stufftext , 3 + strlen ( str ) + ( key ? strlen ( key ) + 6 : 0 ) ) ;
else
ClientReliableWrite_Begin ( cl , svc_stufftext , 3 + strlen ( str ) + ( key ? strlen ( key ) + 6 : 0 ) ) ;
if ( key )
{
for ( c = " bind " ; * c ; c + + )
ClientReliableWrite_Byte ( cl , * c ) ;
for ( c = key ; * c ; c + + )
ClientReliableWrite_Byte ( cl , * c ) ;
ClientReliableWrite_Byte ( cl , ' ' ) ;
}
for ( c = str ; * c ; c + + )
ClientReliableWrite_Byte ( cl , * c ) ;
ClientReliableWrite_Byte ( cl , ' \n ' ) ;
ClientReliableWrite_Byte ( cl , ' \0 ' ) ;
}
if ( key )
Z_Free ( key ) ;
}
2014-03-30 08:55:06 +00:00
static char * ShowTime ( unsigned int seconds )
2009-04-01 22:03:56 +00:00
{
char buf [ 1024 ] ;
char * b = buf ;
* b = 0 ;
if ( seconds > 60 )
{
if ( seconds > 60 * 60 )
{
if ( seconds > 24 * 60 * 60 )
{
strcpy ( b , va ( " %id " , seconds / ( 24 * 60 * 60 ) ) ) ;
b + = strlen ( b ) ;
seconds % = 24 * 60 * 60 ;
}
strcpy ( b , va ( " %ih " , seconds / ( 60 * 60 ) ) ) ;
b + = strlen ( b ) ;
seconds % = 60 * 60 ;
}
strcpy ( b , va ( " %im " , seconds / 60 ) ) ;
b + = strlen ( b ) ;
seconds % = 60 ;
}
strcpy ( b , va ( " %is " , seconds ) ) ;
b + = strlen ( b ) ;
return va ( " %s " , buf ) ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = =
SV_Status_f
= = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_Status_f ( void )
2004-08-23 00:15:46 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
int i ;
2004-08-23 00:15:46 +00:00
client_t * cl ;
2015-10-27 15:20:15 +00:00
float cpu ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
char * s , * p ;
2008-06-08 14:37:57 +00:00
char adr [ MAX_ADR_SIZE ] ;
2014-07-02 03:20:40 +00:00
float pi , po , bi , bo ;
2004-08-23 00:15:46 +00:00
int columns = 80 ;
2017-09-20 11:27:13 +00:00
extern cvar_t sv_listen_qw ;
2018-08-25 02:53:45 +00:00
# if defined(TCPCONNECT) && !defined(CLIENTONLY)
2018-10-23 07:09:06 +00:00
# if defined(HAVE_SSL)
extern cvar_t net_enable_tls ;
# endif
extern cvar_t net_enable_http , net_enable_webrtcbroker , net_enable_websockets , net_enable_qizmo , net_enable_qtv ;
2018-08-25 02:53:45 +00:00
# endif
2017-09-20 11:27:13 +00:00
# ifdef NQPROT
extern cvar_t sv_listen_nq , sv_listen_dp ;
# endif
2017-05-18 10:24:09 +00:00
# ifdef QWOVERQ3
extern cvar_t sv_listen_q3 ;
# endif
# ifdef HAVE_DTLS
2018-03-24 04:02:09 +00:00
extern cvar_t net_enable_dtls ;
2017-05-18 10:24:09 +00:00
# endif
2004-08-23 00:15:46 +00:00
2017-01-24 10:27:39 +00:00
# ifndef SERVERONLY
if ( ! sv . state & & cls . state > = ca_connected & & ! cls . demoplayback & & cls . protocol = = CP_NETQUAKE )
{ //nq can normally forward the request to the server.
Cmd_ForwardToServer ( ) ;
return ;
}
# endif
2004-08-23 00:15:46 +00:00
if ( sv_redirected ! = RD_OBLIVION & & ( sv_redirected ! = RD_NONE
# ifndef SERVERONLY
| | ( vid . width < 68 * 8 & & qrenderer ! = QR_NONE )
# endif
) )
columns = 40 ;
2014-03-30 08:55:06 +00:00
NET_PrintAddresses ( svs . sockets ) ;
2004-08-23 00:15:46 +00:00
if ( ! sv . state )
{
Con_Printf ( " Server is not running \n " ) ;
return ;
}
if ( Cmd_Argc ( ) > 1 )
columns = atoi ( Cmd_Argv ( 1 ) ) ;
cpu = ( svs . stats . latched_active + svs . stats . latched_idle ) ;
if ( cpu )
cpu = 100 * svs . stats . latched_active / cpu ;
2011-09-03 03:49:43 +00:00
Con_Printf ( " cpu utilization : %3i%% \n " , ( int ) cpu ) ;
2015-10-27 15:20:15 +00:00
Con_Printf ( " avg response time: %i ms (%i max) \n " , ( int ) ( 1000 * svs . stats . latched_active / svs . stats . latched_count ) , ( int ) ( 1000 * svs . stats . latched_maxresponse ) ) ;
Con_Printf ( " packets/frame : %5.2f (%i max) \n " , ( float ) svs . stats . latched_packets / svs . stats . latched_count , svs . stats . latched_maxpackets ) ; //not relevent as a limit.
2014-07-02 03:20:40 +00:00
if ( NET_GetRates ( svs . sockets , & pi , & po , & bi , & bo ) )
Con_Printf ( " packets,bytes/sec: in: %g %g out: %g %g \n " , pi , bi , po , bo ) ; //not relevent as a limit.
2011-09-03 03:49:43 +00:00
Con_Printf ( " server uptime : %s \n " , ShowTime ( realtime ) ) ;
2014-09-02 02:44:43 +00:00
Con_Printf ( " public : %s \n " , sv_public . value ? " yes " : " no " ) ;
2017-05-18 10:24:09 +00:00
switch ( svs . gametype )
{
# ifdef Q3SERVER
case GT_QUAKE3 :
Con_Printf ( " client types :%s \n " , sv_listen_qw . ival ? " Q3 " : " " ) ;
break ;
# endif
# ifdef Q2SERVER
case GT_QUAKE2 :
Con_Printf ( " client types :%s \n " , sv_listen_qw . ival ? " Q2 " : " " ) ;
break ;
# endif
default :
Con_Printf ( " client types :%s " , sv_listen_qw . ival ? " QW " : " " ) ;
# ifdef NQPROT
Con_Printf ( " %s%s " , ( sv_listen_nq . ival = = 2 ) ? " -NQ " : ( sv_listen_nq . ival ? " NQ " : " " ) , sv_listen_dp . ival ? " DP " : " " ) ;
# endif
# ifdef QWOVERQ3
if ( sv_listen_q3 . ival ) Con_Printf ( " Q3 " ) ;
# endif
# ifdef HAVE_DTLS
2018-03-24 04:02:09 +00:00
if ( net_enable_dtls . ival > = 3 )
2017-09-20 11:27:13 +00:00
Con_Printf ( " DTLS-only " ) ;
2018-03-24 04:02:09 +00:00
else if ( net_enable_dtls . ival )
2017-05-18 10:24:09 +00:00
Con_Printf ( " DTLS " ) ;
# endif
2018-08-25 02:53:45 +00:00
# if defined(TCPCONNECT) && !defined(CLIENTONLY)
2018-10-23 07:09:06 +00:00
# if defined(HAVE_SSL)
2018-08-24 00:35:16 +00:00
if ( net_enable_tls . ival )
2017-05-18 10:24:09 +00:00
Con_Printf ( " TLS " ) ;
2018-10-23 07:09:06 +00:00
# endif
2017-05-18 10:24:09 +00:00
if ( net_enable_http . ival )
Con_Printf ( " HTTP " ) ;
if ( net_enable_webrtcbroker . ival )
Con_Printf ( " WebRTC " ) ;
if ( net_enable_websockets . ival )
Con_Printf ( " WS " ) ;
if ( net_enable_qizmo . ival )
Con_Printf ( " QZ " ) ;
if ( net_enable_qtv . ival )
2018-08-24 00:35:16 +00:00
Con_Printf ( " QTV " ) ;
2018-08-25 02:53:45 +00:00
# endif
2017-05-18 10:24:09 +00:00
Con_Printf ( " \n " ) ;
break ;
}
2014-09-02 02:44:43 +00:00
# ifdef SUBSERVERS
2014-03-30 08:55:06 +00:00
if ( sv . state = = ss_clustermode )
2014-09-02 02:44:43 +00:00
{
MSV_Status ( ) ;
2014-03-30 08:55:06 +00:00
return ;
2014-09-02 02:44:43 +00:00
}
# endif
2011-09-03 03:49:43 +00:00
Con_Printf ( " map uptime : %s \n " , ShowTime ( sv . world . physicstime ) ) ;
2009-04-01 22:03:56 +00:00
//show the current map+name (but hide name if its too long or would be ugly)
if ( columns > = 80 & & * sv . mapname & & strlen ( sv . mapname ) < 45 & & ! strchr ( sv . mapname , ' \n ' ) )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
Con_Printf ( " current map : %s (%s) \n " , svs . name , sv . mapname ) ;
2009-04-01 22:03:56 +00:00
else
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
Con_Printf ( " current map : %s \n " , svs . name ) ;
2009-04-01 22:03:56 +00:00
2013-03-31 04:21:08 +00:00
if ( svs . gametype = = GT_PROGS )
{
int count = 0 ;
2016-07-12 00:40:13 +00:00
Con_Printf ( " entities : %i/%i (mem: %.1f%%) \n " , sv . world . num_edicts , sv . world . max_edicts , 100 * ( float ) ( sv . world . progs - > stringtablesize / ( double ) sv . world . progs - > stringtablemaxsize ) ) ;
2014-09-17 03:04:08 +00:00
for ( count = 1 ; count < MAX_PRECACHE_MODELS ; count + + )
2013-03-31 04:21:08 +00:00
if ( ! sv . strings . model_precache [ count ] )
break ;
2014-09-17 03:04:08 +00:00
Con_Printf ( " models : %i/%i \n " , count , MAX_PRECACHE_MODELS ) ;
for ( count = 1 ; count < MAX_PRECACHE_SOUNDS ; count + + )
2016-01-18 05:22:07 +00:00
if ( ! sv . strings . sound_precache [ count ] )
2013-03-31 04:21:08 +00:00
break ;
2014-09-17 03:04:08 +00:00
Con_Printf ( " sounds : %i/%i \n " , count , MAX_PRECACHE_SOUNDS ) ;
2018-08-23 06:03:31 +00:00
for ( count = 1 ; count < MAX_SSPARTICLESPRE ; count + + )
if ( ! sv . strings . particle_precache [ count ] )
break ;
if ( count ! = 1 )
Con_Printf ( " particles : %i/%i \n " , count , MAX_SSPARTICLESPRE ) ;
2013-03-31 04:21:08 +00:00
}
2014-03-30 08:55:06 +00:00
Con_Printf ( " gamedir : %s \n " , FS_GetGamedir ( true ) ) ;
2009-04-01 22:03:56 +00:00
if ( sv . csqcdebug )
Con_Printf ( " csqc debug : true \n " ) ;
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
SV_Demo_PrintOutputs ( ) ;
2018-09-01 04:18:08 +00:00
# endif
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
NET_PrintConnectionsStatus ( svs . sockets ) ;
2008-06-01 22:06:22 +00:00
2004-08-23 00:15:46 +00:00
// min fps lat drp
if ( columns < 80 )
{
// most remote clients are 40 columns
// 0123456789012345678901234567890123456789
Con_Printf ( " name userid frags \n " ) ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
Con_Printf ( " address rate ping drop \n " ) ;
2004-08-23 00:15:46 +00:00
Con_Printf ( " ---------------- ---- ---- ----- \n " ) ;
2013-12-02 14:30:30 +00:00
for ( i = 0 , cl = svs . clients ; i < svs . allocated_client_slots ; i + + , cl + + )
2004-08-23 00:15:46 +00:00
{
if ( ! cl - > state )
continue ;
Con_Printf ( " %-16.16s " , cl - > name ) ;
Con_Printf ( " %6i %5i " , cl - > userid , ( int ) cl - > old_frags ) ;
if ( cl - > spectator )
Con_Printf ( " (s) \n " ) ;
2005-07-03 15:16:20 +00:00
else
2004-08-23 00:15:46 +00:00
Con_Printf ( " \n " ) ;
2014-03-30 08:55:06 +00:00
if ( cl - > state = = cs_loadzombie )
{
if ( cl - > istobeloaded )
s = " LoadZombie " ;
else
s = " ParmZombie " ;
}
2015-06-16 23:53:58 +00:00
else if ( cl - > reversedns )
s = cl - > reversedns ;
2014-03-30 08:55:06 +00:00
else if ( cl - > state = = cs_zombie & & cl - > netchan . remote_address . type = = NA_INVALID )
s = " none " ;
2005-09-08 01:47:12 +00:00
else if ( cl - > protocol = = SCP_BAD )
s = " bot " ;
else
2013-05-03 04:28:08 +00:00
s = NET_BaseAdrToString ( adr , sizeof ( adr ) , & cl - > netchan . remote_address ) ;
2004-08-23 00:15:46 +00:00
Con_Printf ( " %-16.16s " , s ) ;
if ( cl - > state = = cs_connected )
{
Con_Printf ( " CONNECTING \n " ) ;
continue ;
}
2014-03-30 08:55:06 +00:00
if ( cl - > state = = cs_zombie | | cl - > state = = cs_loadzombie )
2004-08-23 00:15:46 +00:00
{
Con_Printf ( " ZOMBIE \n " ) ;
continue ;
}
Con_Printf ( " %4i %4i %5.2f \n "
, ( int ) ( 1000 * cl - > netchan . frame_rate )
2010-02-06 01:25:04 +00:00
, ( int ) SV_CalcPing ( cl , false )
2004-08-23 00:15:46 +00:00
, 100.0 * cl - > netchan . drop_count / cl - > netchan . incoming_sequence ) ;
}
}
else
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# define COLUMNS C_FRAGS C_USERID C_ADDRESS C_NAME C_RATE C_PING C_DROP C_DLP C_DLS C_PROT C_ADDRESS2
2017-08-29 02:29:06 +00:00
# define C_FRAGS COLUMN(0, "frags", if (cl->spectator==1)Con_Printf("%-5s ", "spec"); else Con_Printf("%5i ", (int)cl->old_frags))
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# define C_USERID COLUMN(1, "userid", Con_Printf("%6i ", (int)cl->userid))
# define C_ADDRESS COLUMN(2, "address ", Con_Printf("%-16.16s", s))
# define C_NAME COLUMN(3, "name ", Con_Printf("%-16.16s", cl->name))
2016-07-12 00:40:13 +00:00
# define C_RATE COLUMN(4, "rate", Con_Printf("%4i ", cl->frameunion.frames?(int)(1 / cl->netchan.frame_rate):0))
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# define C_PING COLUMN(5, "ping", Con_Printf("%4i ", (int)SV_CalcPing (cl, false)))
# define C_DROP COLUMN(6, "drop", Con_Printf("%4.1f ", 100.0*cl->netchan.drop_count / cl->netchan.incoming_sequence))
# define C_DLP COLUMN(7, "dl ", if (!cl->download)Con_Printf(" ");else Con_Printf("%3g ", (cl->downloadcount*100.0) / cl->downloadsize))
# define C_DLS COLUMN(8, "dls", if (!cl->download)Con_Printf(" ");else Con_Printf("%3u ", (unsigned int)(cl->downloadsize / 1024)))
# define C_PROT COLUMN(9, "prot", Con_Printf("%-5.5s", p))
# define C_ADDRESS2 COLUMN(10, "address ", Con_Printf("%s", s))
int columns = ( 1 < < 6 ) - 1 ;
for ( i = 0 , cl = svs . clients ; i < svs . allocated_client_slots ; i + + , cl + + )
{
if ( cl - > netchan . drop_count )
columns | = 1 < < 6 ;
if ( cl - > download )
{
columns | = 1 < < 7 ;
columns | = 1 < < 8 ;
}
if ( cl - > protocol ! = SCP_QUAKEWORLD | | cl - > spectator | | ! ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) )
columns | = 1 < < 9 ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
if ( cl - > netchan . remote_address . type = = NA_IPV6 )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
columns = ( columns & ~ ( 1 < < 2 ) ) | ( 1 < < 10 ) ;
}
# define COLUMN(f,t,v) if (columns&(1<<f)) Con_Printf(t" ");
COLUMNS
# undef COLUMN
Con_Printf ( " \n " ) ;
# define COLUMN(f,t,v) if (columns&(1<<f)){for (i = 0; i < sizeof(t)-1; i++) Con_Printf("-"); Con_Printf(" ");}
COLUMNS
# undef COLUMN
Con_Printf ( " \n " ) ;
// Con_Printf ("frags userid name rate ping drop "" dl%% dls"" address \n");
// Con_Printf ("----- ------ --------------- ---- ---- -----"" --- ---"" --------------- \n");
2013-10-29 17:38:22 +00:00
for ( i = 0 , cl = svs . clients ; i < svs . allocated_client_slots ; i + + , cl + + )
2004-08-23 00:15:46 +00:00
{
if ( ! cl - > state )
continue ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2004-08-23 00:15:46 +00:00
2014-03-30 08:55:06 +00:00
if ( cl - > state = = cs_loadzombie )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{ //loadzombies have no specific address
2014-03-30 08:55:06 +00:00
if ( cl - > istobeloaded )
s = " LoadZombie " ;
else
s = " ParmZombie " ;
}
2015-06-16 23:53:58 +00:00
else if ( cl - > reversedns )
s = cl - > reversedns ;
2014-03-30 08:55:06 +00:00
else if ( cl - > state = = cs_zombie & & cl - > netchan . remote_address . type = = NA_INVALID )
s = " none " ;
2005-09-08 01:47:12 +00:00
else if ( cl - > protocol = = SCP_BAD )
s = " bot " ;
2004-08-23 00:15:46 +00:00
else
2013-05-03 04:28:08 +00:00
s = NET_BaseAdrToString ( adr , sizeof ( adr ) , & cl - > netchan . remote_address ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
switch ( cl - > protocol )
2004-08-23 00:15:46 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
default :
case SCP_BAD :
p = " " ;
break ;
2017-08-29 02:29:06 +00:00
case SCP_QUAKEWORLD : p = ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ? " fteq " : " qw " ; break ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
case SCP_QUAKE2 : p = " q2 " ; break ;
case SCP_QUAKE3 : p = " q3 " ; break ;
2017-08-29 02:29:06 +00:00
case SCP_NETQUAKE : p = ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ? " ften " : " nq " ; break ;
case SCP_BJP3 : p = ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ? " ften " : " bjp3 " ; break ;
case SCP_FITZ666 : p = ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ? " ften " : " fitz " ; break ;
case SCP_DARKPLACES6 : p = " dpp6 " ; break ;
case SCP_DARKPLACES7 : p = " dpp7 " ; break ;
2004-08-23 00:15:46 +00:00
}
2016-07-12 00:40:13 +00:00
if ( cl - > state = = cs_connected & & cl - > protocol > = SCP_NETQUAKE )
2017-08-29 02:29:06 +00:00
p = " nq " ; //not actually known yet.
2014-03-30 08:55:06 +00:00
else if ( cl - > state = = cs_zombie | | cl - > state = = cs_loadzombie )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
p = " zom " ;
2004-08-23 00:15:46 +00:00
2005-07-03 15:16:20 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# define COLUMN(f,t,v) if (columns&(1<<f)){v;}
COLUMNS
# undef COLUMN
Con_Printf ( " \n " ) ;
2004-08-23 00:15:46 +00:00
}
}
Con_Printf ( " \n " ) ;
}
/*
= = = = = = = = = = = = = = = = = =
SV_ConSay_f
= = = = = = = = = = = = = = = = = =
*/
void SV_ConSay_f ( void )
{
client_t * client ;
int j ;
char * p ;
char text [ 1024 ] ;
if ( Cmd_Argc ( ) < 2 )
return ;
Q_strcpy ( text , " console: " ) ;
p = Cmd_Args ( ) ;
if ( * p = = ' " ' )
{
p + + ;
p [ Q_strlen ( p ) - 1 ] = 0 ;
}
Q_strcat ( text , p ) ;
2013-10-29 17:38:22 +00:00
for ( j = 0 , client = svs . clients ; j < svs . allocated_client_slots ; j + + , client + + )
2004-08-23 00:15:46 +00:00
{
if ( client - > state = = cs_free )
continue ;
2014-06-25 03:53:11 +00:00
if ( client - > penalties & BAN_DEAF )
2014-03-30 08:55:06 +00:00
continue ;
2004-08-23 00:15:46 +00:00
SV_ClientPrintf ( client , PRINT_CHAT , " %s \n " , text ) ;
}
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2004-08-23 00:15:46 +00:00
if ( sv . mvdrecording )
{
2012-08-04 01:35:52 +00:00
sizebuf_t * msg ;
msg = MVDWrite_Begin ( dem_all , 0 , strlen ( text ) + 4 ) ;
MSG_WriteByte ( msg , svc_print ) ;
MSG_WriteByte ( msg , PRINT_CHAT ) ;
2011-06-05 01:36:14 +00:00
for ( j = 0 ; text [ j ] ; j + + )
2012-08-04 01:35:52 +00:00
MSG_WriteChar ( msg , text [ j ] ) ;
MSG_WriteChar ( msg , ' \n ' ) ;
MSG_WriteChar ( msg , 0 ) ;
2004-08-23 00:15:46 +00:00
}
2018-09-01 04:18:08 +00:00
# endif
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
static void SV_ConSayOne_f ( void )
2004-08-23 00:15:46 +00:00
{
char text [ 2048 ] ;
client_t * to ;
int i ;
char * s ;
int clnum = - 1 ;
if ( Cmd_Argc ( ) < 3 )
return ;
while ( ( to = SV_GetClientForString ( Cmd_Argv ( 1 ) , & clnum ) ) )
{
Q_strcpy ( text , " {console}: " ) ;
for ( i = 2 ; ; i + + )
{
s = Cmd_Argv ( i ) ;
if ( ! * s )
break ;
if ( strlen ( text ) + strlen ( s ) + 2 > = sizeof ( text ) - 1 )
break ;
strcat ( text , " " ) ;
strcat ( text , s ) ;
}
strcat ( text , " \n " ) ;
SV_ClientPrintf ( to , PRINT_CHAT , " %s " , text ) ;
}
if ( ! clnum )
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Couldn't find user number %s \n " , Cmd_Argv ( 1 ) ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
SV_Heartbeat_f
= = = = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_Heartbeat_f ( void )
2004-08-23 00:15:46 +00:00
{
2014-12-23 15:26:42 +00:00
SV_Master_ReResolve ( ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = =
SV_Serverinfo_f
Examine or change the serverinfo string
= = = = = = = = = = =
*/
void SV_Serverinfo_f ( void )
{
cvar_t * var ;
char value [ 512 ] ;
int i ;
if ( Cmd_Argc ( ) = = 1 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Server info settings: \n " ) ;
2018-07-05 16:21:44 +00:00
InfoBuf_Print ( & svs . info , " " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( Cmd_Argc ( ) < 3 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " usage: serverinfo [ <key> <value> ] \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( Cmd_Argv ( 1 ) [ 0 ] = = ' * ' )
{
2005-10-01 03:09:17 +00:00
if ( ! strcmp ( Cmd_Argv ( 1 ) , " * " ) )
if ( ! strcmp ( Cmd_Argv ( 2 ) , " " ) )
{ //clear it out
2018-07-05 16:21:44 +00:00
const char * k ;
2005-10-01 03:09:17 +00:00
for ( i = 0 ; ; )
{
2018-07-05 16:21:44 +00:00
k = InfoBuf_KeyForNumber ( & svs . info , i ) ;
if ( ! k )
2005-10-01 03:09:17 +00:00
break ; //no more.
else if ( * k = = ' * ' )
i + + ; //can't remove * keys
else if ( ( var = Cvar_FindVar ( k ) ) & & var - > flags & CVAR_SERVERINFO )
i + + ; //this one is a cvar.
else
2018-07-05 16:21:44 +00:00
InfoBuf_RemoveKey ( & svs . info , k ) ; //we can remove this one though, so yay.
2005-10-01 03:09:17 +00:00
}
2005-11-03 23:40:51 +00:00
2005-10-01 03:09:17 +00:00
return ;
}
2013-11-21 23:02:28 +00:00
Con_Printf ( " Can't set * keys \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2018-07-05 16:21:44 +00:00
if ( ! strcmp ( Cmd_Argv ( 0 ) , " serverinfoblob " ) )
2004-08-23 00:15:46 +00:00
{
2018-07-05 16:21:44 +00:00
qofs_t fsize ;
char * data = FS_MallocFile ( Cmd_Argv ( 2 ) , FS_GAME , & fsize ) ;
if ( ! data )
{
Con_Printf ( " Unable to read %s \n " , Cmd_Argv ( 2 ) ) ;
return ;
}
if ( fsize > 64 * 1024 * 1024 )
Con_Printf ( " File is over 64mb \n " ) ;
else
InfoBuf_SetStarBlobKey ( & svs . info , Cmd_Argv ( 1 ) , data , fsize ) ;
FS_FreeFile ( data ) ;
2004-08-23 00:15:46 +00:00
}
2018-07-05 16:21:44 +00:00
else
{
Q_strncpyz ( value , Cmd_Argv ( 2 ) , sizeof ( value ) ) ;
value [ sizeof ( value ) - 1 ] = ' \0 ' ;
for ( i = 3 ; i < Cmd_Argc ( ) ; i + + )
{
strncat ( value , " " , sizeof ( value ) - 1 ) ;
strncat ( value , Cmd_Argv ( i ) , sizeof ( value ) - 1 ) ;
}
2004-08-23 00:15:46 +00:00
2018-07-05 16:21:44 +00:00
InfoBuf_SetValueForKey ( & svs . info , Cmd_Argv ( 1 ) , value ) ;
}
2004-08-23 00:15:46 +00:00
2005-07-03 15:16:20 +00:00
// if this is a cvar, change it too
2004-08-23 00:15:46 +00:00
var = Cvar_FindVar ( Cmd_Argv ( 1 ) ) ;
if ( var )
{
Cvar_Set ( var , value ) ;
2005-07-03 15:16:20 +00:00
/* Z_Free (var->string); // free the old value string
2013-08-27 13:18:09 +00:00
var - > string = Z_StrDup ( value ) ;
2004-08-23 00:15:46 +00:00
var - > value = Q_atof ( var - > string ) ;
*/ }
}
/*
= = = = = = = = = = =
SV_Serverinfo_f
Examine or change the serverinfo string
= = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_Localinfo_f ( void )
2004-08-23 00:15:46 +00:00
{
char * old ;
if ( Cmd_Argc ( ) = = 1 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Local info settings: \n " ) ;
2018-07-05 16:21:44 +00:00
InfoBuf_Print ( & svs . localinfo , " " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( Cmd_Argc ( ) ! = 3 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " usage: localinfo [ <key> <value> ] \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( Cmd_Argv ( 1 ) [ 0 ] = = ' * ' )
{
2005-10-01 03:09:17 +00:00
if ( ! strcmp ( Cmd_Argv ( 1 ) , " * " ) )
if ( ! strcmp ( Cmd_Argv ( 2 ) , " " ) )
{ //clear it out
2018-07-05 16:21:44 +00:00
InfoBuf_Clear ( & svs . localinfo , false ) ;
2005-10-01 03:09:17 +00:00
return ;
}
2013-11-21 23:02:28 +00:00
Con_Printf ( " Can't set * keys \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2018-07-05 16:21:44 +00:00
old = InfoBuf_ValueForKey ( & svs . localinfo , Cmd_Argv ( 1 ) ) ;
InfoBuf_SetValueForKey ( & svs . localinfo , Cmd_Argv ( 1 ) , Cmd_Argv ( 2 ) ) ;
2004-08-23 00:15:46 +00:00
PR_LocalInfoChanged ( Cmd_Argv ( 1 ) , old , Cmd_Argv ( 2 ) ) ;
2005-07-01 19:23:00 +00:00
Con_DPrintf ( " Localinfo %s changed (%s -> %s) \n " , Cmd_Argv ( 1 ) , old , Cmd_Argv ( 2 ) ) ;
2004-08-23 00:15:46 +00:00
}
2005-12-21 03:07:33 +00:00
void SV_SaveInfos ( vfsfile_t * f )
2004-11-17 17:42:28 +00:00
{
2005-12-21 03:07:33 +00:00
VFS_WRITE ( f , " \n " , 1 ) ;
VFS_WRITE ( f , " serverinfo * \" \" \n " , 16 ) ;
2018-07-05 16:21:44 +00:00
InfoBuf_WriteToFile ( f , & svs . info , " serverinfo " , CVAR_SERVERINFO ) ;
2005-12-21 03:07:33 +00:00
VFS_WRITE ( f , " \n " , 1 ) ;
VFS_WRITE ( f , " localinfo * \" \" \n " , 15 ) ;
2018-07-05 16:21:44 +00:00
InfoBuf_WriteToFile ( f , & svs . localinfo , " localinfo " , 0 ) ;
2004-11-17 17:42:28 +00:00
}
2004-08-23 00:15:46 +00:00
2005-09-26 08:07:26 +00:00
/*
void SV_ResetInfos ( void )
{
// TODO: add me
}
*/
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = =
SV_User_f
Examine a users info strings
= = = = = = = = = = =
*/
void SV_User_f ( void )
{
2013-06-23 02:17:02 +00:00
double ftime , minf , maxf ;
int frames ;
2010-08-12 09:04:05 +00:00
client_t * cl ;
int clnum = - 1 ;
2013-06-23 02:17:02 +00:00
unsigned int u ;
char buf [ 256 ] ;
static const char * pext1names [ 32 ] = { " setview " , " scale " , " lightstylecol " , " trans " , " view2 " , " builletens " , " accuratetimings " , " sounddbl " ,
" fatness " , " hlbsp " , " bullet " , " hullsize " , " modeldbl " , " entitydbl " , " entitydbl2 " , " floatcoords " ,
" OLD vweap " , " q2bsp " , " q3bsp " , " colormod " , " splitscreen " , " hexen2 " , " spawnstatic2 " , " customtempeffects " ,
" packents " , " UNKNOWN " , " showpic " , " setattachment " , " UNKNOWN " , " chunkeddls " , " csqc " , " dpflags " } ;
2018-07-05 16:21:44 +00:00
static const char * pext2names [ 32 ] = { " prydoncursor " , " voip " , " setangledelta " , " rplcdeltas " , " maxplayers " , " predinfo " , " sizeenc " , " infoblobs " ,
2013-06-23 02:17:02 +00:00
" UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " ,
" UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " ,
" UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " , " UNKNOWN " } ;
2010-08-12 09:04:05 +00:00
2004-08-23 00:15:46 +00:00
if ( Cmd_Argc ( ) ! = 2 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Usage: info <userid> \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2013-06-23 02:17:02 +00:00
Con_Printf ( " Userinfo: \n " ) ;
2010-08-12 09:04:05 +00:00
while ( ( cl = SV_GetClientForString ( Cmd_Argv ( 1 ) , & clnum ) ) )
{
2018-07-05 16:21:44 +00:00
InfoBuf_Print ( & cl - > userinfo , " " ) ;
2013-06-23 02:17:02 +00:00
switch ( cl - > protocol )
{
case SCP_BAD :
Con_Printf ( " protocol: bot/invalid \n " ) ;
break ;
2018-07-05 16:21:44 +00:00
case SCP_QUAKEWORLD : //branding is everything...
if ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
Con_Printf ( " protocol: fteqw-nack \n " ) ;
else
Con_Printf ( " protocol: quakeworld \n " ) ;
2013-06-23 02:17:02 +00:00
break ;
case SCP_QUAKE2 :
Con_Printf ( " protocol: quake2 \n " ) ;
break ;
case SCP_QUAKE3 :
Con_Printf ( " protocol: quake3 \n " ) ;
break ;
case SCP_NETQUAKE :
2018-07-05 16:21:44 +00:00
if ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
Con_Printf ( " protocol: ftenq-nack \n " ) ;
else
Con_Printf ( " protocol: (net)quake \n " ) ;
2013-06-23 02:17:02 +00:00
break ;
2016-07-12 00:40:13 +00:00
case SCP_BJP3 :
Con_Printf ( " protocol: bjp3 \n " ) ;
2013-06-23 02:17:02 +00:00
break ;
case SCP_FITZ666 :
2018-07-05 16:21:44 +00:00
if ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
Con_Printf ( " protocol: fte666-nack \n " ) ;
else
Con_Printf ( " protocol: fitzquake 666 \n " ) ;
2013-06-23 02:17:02 +00:00
break ;
case SCP_DARKPLACES6 :
Con_Printf ( " protocol: dpp6 \n " ) ;
break ;
case SCP_DARKPLACES7 :
Con_Printf ( " protocol: dpp7 \n " ) ;
break ;
default :
Con_Printf ( " protocol: other (fixme) \n " ) ;
break ;
}
2016-07-12 00:40:13 +00:00
if ( cl - > fteprotocolextensions )
{
2018-07-05 16:21:44 +00:00
unsigned int effective = cl - > fteprotocolextensions ;
if ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) //these flags were made obsolete. don't list them.
effective & = ~ ( PEXT_SCALE | PEXT_TRANS | PEXT_ACCURATETIMINGS | PEXT_FATNESS | PEXT_HULLSIZE | PEXT_MODELDBL | PEXT_ENTITYDBL | PEXT_ENTITYDBL2 | PEXT_COLOURMOD | PEXT_SPAWNSTATIC2 | PEXT_SETATTACHMENT | PEXT_DPFLAGS ) ;
2016-07-12 00:40:13 +00:00
Con_Printf ( " pext1: " ) ;
for ( u = 0 ; u < 32 ; u + + )
2018-07-05 16:21:44 +00:00
if ( effective & ( 1u < < u ) )
2016-07-12 00:40:13 +00:00
Con_Printf ( " %s " , pext1names [ u ] ) ;
Con_Printf ( " \n " ) ;
}
if ( cl - > fteprotocolextensions2 )
{
Con_Printf ( " pext2: " ) ;
for ( u = 0 ; u < 32 ; u + + )
if ( cl - > fteprotocolextensions2 & ( 1u < < u ) )
Con_Printf ( " %s " , pext2names [ u ] ) ;
Con_Printf ( " \n " ) ;
}
2013-06-23 02:17:02 +00:00
Con_Printf ( " ip: %s \n " , NET_AdrToString ( buf , sizeof ( buf ) , & cl - > netchan . remote_address ) ) ;
switch ( cl - > realip_status )
{
case 1 :
Con_Printf ( " realip: %s ( " CON_WARNING " unverified " CON_DEFAULT " ) \n " , NET_AdrToString ( buf , sizeof ( buf ) , & cl - > realip ) ) ;
break ;
case 2 :
Con_Printf ( " realip: %s ( " CON_ERROR " unverifiable " CON_DEFAULT " ) \n " , NET_AdrToString ( buf , sizeof ( buf ) , & cl - > realip ) ) ;
break ;
case 3 :
Con_Printf ( " realip: %s (verified) \n " , NET_AdrToString ( buf , sizeof ( buf ) , & cl - > realip ) ) ;
break ;
}
if ( * cl - > guid )
Con_Printf ( " guid: %s \n " , cl - > guid ) ;
if ( cl - > download )
2014-08-03 14:47:47 +00:00
Con_Printf ( " download: \" %s \" %uk/%uk (%g%%) " , cl - > downloadfn , ( unsigned int ) ( cl - > downloadcount / 1024 ) , ( unsigned int ) ( cl - > downloadsize / 1024 ) , ( cl - > downloadcount * 100.0 ) / cl - > downloadsize ) ;
2013-06-23 02:17:02 +00:00
2014-06-25 03:53:11 +00:00
if ( cl - > penalties & BAN_CRIPPLED )
2014-03-30 08:55:06 +00:00
Con_Printf ( " crippled \n " ) ;
2014-06-25 03:53:11 +00:00
if ( cl - > penalties & BAN_CUFF )
2014-03-30 08:55:06 +00:00
Con_Printf ( " cuffed \n " ) ;
2014-06-25 03:53:11 +00:00
if ( cl - > penalties & BAN_DEAF )
2014-03-30 08:55:06 +00:00
Con_Printf ( " deaf \n " ) ;
2014-06-25 03:53:11 +00:00
if ( cl - > penalties & BAN_LAGGED )
2014-03-30 08:55:06 +00:00
Con_Printf ( " lagged \n " ) ;
2014-06-25 03:53:11 +00:00
if ( cl - > penalties & BAN_MUTE )
2014-03-30 08:55:06 +00:00
Con_Printf ( " muted \n " ) ;
2014-06-25 03:53:11 +00:00
if ( cl - > penalties & BAN_VIP )
2014-03-30 08:55:06 +00:00
Con_Printf ( " vip \n " ) ;
2013-06-23 02:17:02 +00:00
SV_CalcNetRates ( cl , & ftime , & frames , & minf , & maxf ) ;
if ( frames )
Con_Printf ( " net: %gfps (min%g max %g), c2s: %ibps, s2c: %ibps \n " , ftime / frames , minf , maxf , ( int ) cl - > inrate , ( int ) cl - > outrate ) ;
else
Con_Printf ( " net: unknown framerate, c2s: %ibps, s2c: %ibps \n " , ( int ) cl - > inrate , ( int ) cl - > outrate ) ;
2010-08-12 09:04:05 +00:00
}
2004-08-23 00:15:46 +00:00
2010-08-12 09:04:05 +00:00
if ( clnum = = - 1 )
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Userid %i is not on the server \n " , atoi ( Cmd_Argv ( 1 ) ) ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = =
SV_Floodport_f
Sets the gamedir and path to a different directory .
= = = = = = = = = = = = = = = =
*/
/*
= = = = = = = = = = = = = = = =
SV_Gamedir
Sets the fake * gamedir to a different directory .
= = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_Gamedir ( void )
2004-08-23 00:15:46 +00:00
{
char * dir ;
if ( Cmd_Argc ( ) = = 1 )
{
2018-07-05 16:21:44 +00:00
Con_TPrintf ( " Current gamedir: %s \n " , InfoBuf_ValueForKey ( & svs . info , " *gamedir " ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( Cmd_Argc ( ) ! = 2 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Usage: sv_gamedir <newgamedir> \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
dir = Cmd_Argv ( 1 ) ;
if ( strstr ( dir , " .. " ) | | strstr ( dir , " / " )
| | strstr ( dir , " \\ " ) | | strstr ( dir , " : " ) )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " %s should be a single filename, not a path \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2018-07-05 16:21:44 +00:00
InfoBuf_SetValueForStarKey ( & svs . info , " *gamedir " , dir ) ;
2004-08-23 00:15:46 +00:00
}
2018-05-21 13:47:53 +00:00
static int QDECL CompleteGamedirPath ( const char * name , qofs_t flags , time_t mtime , void * parm , searchpathfuncs_t * spath )
{
struct xcommandargcompletioncb_s * ctx = parm ;
char dirname [ MAX_QPATH ] ;
if ( * name )
{
size_t l = strlen ( name ) - 1 ;
if ( l < countof ( dirname ) & & name [ l ] = = ' / ' )
{ //directories are marked with an explicit trailing slash. because we're weird.
memcpy ( dirname , name , l ) ;
dirname [ l ] = 0 ;
ctx - > cb ( dirname , NULL , NULL , ctx ) ;
}
}
return true ;
}
static void SV_Gamedir_c ( int argn , const char * partial , struct xcommandargcompletioncb_s * ctx )
{
extern qboolean com_homepathenabled ;
if ( argn = = 1 )
{
if ( com_homepathenabled )
Sys_EnumerateFiles ( com_homepath , va ( " %s* " , partial ) , CompleteGamedirPath , ctx , NULL ) ;
Sys_EnumerateFiles ( com_gamepath , va ( " %s* " , partial ) , CompleteGamedirPath , ctx , NULL ) ;
}
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = =
SV_Gamedir_f
Sets the gamedir and path to a different directory .
2016-08-25 00:12:14 +00:00
FIXME : should block this if we ' re on a server at the time
2004-08-23 00:15:46 +00:00
= = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_Gamedir_f ( void )
2004-08-23 00:15:46 +00:00
{
char * dir ;
2016-08-25 00:12:14 +00:00
int argc = Cmd_Argc ( ) ;
2004-08-23 00:15:46 +00:00
2016-08-25 00:12:14 +00:00
if ( argc = = 1 )
2004-08-23 00:15:46 +00:00
{
2014-03-30 08:55:06 +00:00
Con_TPrintf ( " Current gamedir: %s \n " , FS_GetGamedir ( true ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2016-08-25 00:12:14 +00:00
if ( argc < 2 )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Usage: gamedir <newgamedir> \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2016-08-25 00:12:14 +00:00
if ( argc = = 2 )
dir = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
else
{
int i ;
size_t l = 1 ;
for ( i = 1 ; i < argc ; i + + )
l + = strlen ( Cmd_Argv ( i ) ) + 1 ;
dir = Z_Malloc ( l ) ;
for ( i = 1 ; i < argc ; i + + )
{ //disgusting hack for quakespasm's "game extendedgame -missionpack" crap.
//games with a leading hypen are inserted before others, with the hyphen ignored.
if ( * Cmd_Argv ( i ) ! = ' - ' )
continue ;
if ( * dir )
Q_strncatz ( dir , " ; " , l ) ;
Q_strncatz ( dir , Cmd_Argv ( i ) + 1 , l ) ;
}
for ( i = 1 ; i < argc ; i + + )
{
if ( * Cmd_Argv ( i ) = = ' - ' )
continue ;
if ( * dir )
Q_strncatz ( dir , " ; " , l ) ;
Q_strncatz ( dir , Cmd_Argv ( i ) , l ) ;
}
}
2004-08-23 00:15:46 +00:00
if ( strstr ( dir , " .. " ) | | strstr ( dir , " / " )
| | strstr ( dir , " \\ " ) | | strstr ( dir , " : " ) )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " %s should be a single filename, not a path \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
}
2016-08-25 00:12:14 +00:00
else
{
COM_Gamedir ( dir , NULL ) ;
2018-07-05 16:21:44 +00:00
InfoBuf_SetValueForStarKey ( & svs . info , " *gamedir " , dir ) ;
2016-08-25 00:12:14 +00:00
}
2013-06-23 02:17:02 +00:00
Z_Free ( dir ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = =
SV_Snap
= = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_Snap ( int uid )
2004-08-23 00:15:46 +00:00
{
client_t * cl ;
2005-07-03 15:16:20 +00:00
char pcxname [ 80 ] ;
2004-08-23 00:15:46 +00:00
char checkname [ MAX_OSPATH ] ;
int i ;
2013-10-29 17:38:22 +00:00
for ( i = 0 , cl = svs . clients ; i < svs . allocated_client_slots ; i + + , cl + + )
2004-08-23 00:15:46 +00:00
{
if ( ! cl - > state )
continue ;
if ( cl - > userid = = uid )
break ;
}
2013-12-02 14:30:30 +00:00
if ( i > = svs . allocated_client_slots )
2009-11-04 21:16:50 +00:00
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Couldn't find user number %i \n " , uid ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2005-07-01 19:23:00 +00:00
if ( ! ISQWCLIENT ( cl ) )
{
Con_Printf ( " Can only snap QW clients \n " ) ;
return ;
}
2004-08-23 00:15:46 +00:00
sprintf ( pcxname , " %d-00.pcx " , uid ) ;
2009-11-04 21:16:50 +00:00
strcpy ( checkname , " snap " ) ;
2005-07-03 15:16:20 +00:00
for ( i = 0 ; i < = 99 ; i + + )
{
pcxname [ strlen ( pcxname ) - 6 ] = i / 10 + ' 0 ' ;
pcxname [ strlen ( pcxname ) - 5 ] = i % 10 + ' 0 ' ;
2013-03-12 22:53:23 +00:00
Q_snprintfz ( checkname , sizeof ( checkname ) , " snap/%s " , pcxname ) ;
2009-11-04 21:16:50 +00:00
if ( ! COM_FCheckExists ( checkname ) )
2004-08-23 00:15:46 +00:00
break ; // file doesn't exist
2005-07-03 15:16:20 +00:00
}
if ( i = = 100 )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Snap: Couldn't create a file, clean some out. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
strcpy ( cl - > uploadfn , checkname ) ;
memcpy ( & cl - > snap_from , & net_from , sizeof ( net_from ) ) ;
if ( sv_redirected ! = RD_NONE )
cl - > remote_snap = true ;
else
cl - > remote_snap = false ;
ClientReliableWrite_Begin ( cl , svc_stufftext , 24 ) ;
2005-07-01 19:23:00 +00:00
ClientReliableWrite_String ( cl , " cmd snap \n " ) ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Requesting snap from user %d... \n " , uid ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = =
SV_Snap_f
= = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_Snap_f ( void )
2004-08-23 00:15:46 +00:00
{
int uid ;
if ( Cmd_Argc ( ) ! = 2 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Usage: snap <userid> \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
uid = atoi ( Cmd_Argv ( 1 ) ) ;
SV_Snap ( uid ) ;
}
/*
= = = = = = = = = = = = = = = =
SV_Snap
= = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
static void SV_SnapAll_f ( void )
2004-08-23 00:15:46 +00:00
{
client_t * cl ;
int i ;
2013-10-29 17:38:22 +00:00
for ( i = 0 , cl = svs . clients ; i < svs . allocated_client_slots ; i + + , cl + + )
2004-08-23 00:15:46 +00:00
{
if ( cl - > state < cs_connected | | cl - > spectator )
continue ;
SV_Snap ( cl - > userid ) ;
}
}
2014-03-30 08:55:06 +00:00
static float mytimer ;
static float lasttimer ;
static int ticsleft ;
static float timerinterval ;
static int timerlevel ;
static cvar_t * timercommand ;
2004-08-23 00:15:46 +00:00
void SV_CheckTimer ( void )
{
float ctime = Sys_DoubleTime ( ) ;
// if (ctime < lasttimer) //new map? (shouldn't happen)
2005-11-29 11:30:13 +00:00
// mytimer = ctime+5; //trigger in a few secs
2004-08-23 00:15:46 +00:00
lasttimer = ctime ;
if ( ticsleft )
{
2005-11-29 11:30:13 +00:00
if ( mytimer < ctime )
2004-08-23 00:15:46 +00:00
{
2005-11-29 11:30:13 +00:00
mytimer + = timerinterval ;
2004-08-23 00:15:46 +00:00
if ( ticsleft > 0 )
ticsleft - - ;
if ( timercommand )
{
Cbuf_AddText ( timercommand - > string , timerlevel ) ;
Cbuf_AddText ( " \n " , timerlevel ) ;
}
}
}
}
2014-03-30 08:55:06 +00:00
static void SV_SetTimer_f ( void )
2004-08-23 00:15:46 +00:00
{
int count ;
float interval ;
char * command ;
if ( Cmd_Argc ( ) < 2 )
{
2004-12-21 04:39:47 +00:00
Con_Printf ( " %s <count> <interval> <command> \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
count = atoi ( Cmd_Argv ( 1 ) ) ;
interval = atof ( Cmd_Argv ( 2 ) ) ;
if ( ! count & & Cmd_Argc ( ) = = 2 )
{
ticsleft = 0 ;
return ;
}
if ( interval < = 0 | | ( count < = 0 & & count ! = - 1 ) ) //makes sure the args are right. :)
{
Con_Printf ( " %s count interval command \n " , Cmd_Argv ( 0 ) ) ;
return ;
}
2004-12-08 04:14:52 +00:00
Cmd_ShiftArgs ( 2 , Cmd_ExecLevel = = RESTRICT_LOCAL ) ; //strip the two vars
2004-08-23 00:15:46 +00:00
command = Cmd_Args ( ) ;
timercommand = Cvar_Get ( " sv_timer " , " " , CVAR_NOSET , NULL ) ;
Cvar_ForceSet ( timercommand , command ) ;
2005-11-29 11:30:13 +00:00
mytimer = Sys_DoubleTime ( ) + interval ;
2004-08-23 00:15:46 +00:00
ticsleft = count ;
timerinterval = interval ;
timerlevel = Cmd_ExecLevel ;
}
2014-03-30 08:55:06 +00:00
static void SV_SendGameCommand_f ( void )
2004-08-23 00:15:46 +00:00
{
2005-09-08 01:47:12 +00:00
# ifdef Q3SERVER
if ( SVQ3_ConsoleCommand ( ) )
return ;
# endif
2007-09-03 22:37:13 +00:00
# ifdef VM_Q1
if ( Q1QVM_GameConsoleCommand ( ) )
return ;
# endif
2013-08-21 07:14:39 +00:00
if ( PR_ConsoleCmd ( Cmd_Args ( ) ) )
return ;
2004-08-23 00:15:46 +00:00
# ifdef Q2SERVER
if ( ge )
{
ge - > ServerCommand ( ) ;
}
else
# endif
2018-03-25 09:36:14 +00:00
Con_Printf ( " Mod-specific command \" %s \" not known \n " , Cmd_Argv ( 1 ) ) ;
2004-08-23 00:15:46 +00:00
}
2005-12-15 19:15:39 +00:00
void PIN_LoadMessages ( void ) ;
void PIN_SaveMessages ( void ) ;
void PIN_DeleteOldestMessage ( void ) ;
void PIN_MakeMessage ( char * from , char * msg ) ;
2014-03-30 08:55:06 +00:00
static void SV_Pin_Save_f ( void )
2005-12-15 19:15:39 +00:00
{
PIN_SaveMessages ( ) ;
}
2014-03-30 08:55:06 +00:00
static void SV_Pin_Reload_f ( void )
2005-12-15 19:15:39 +00:00
{
PIN_LoadMessages ( ) ;
}
2014-03-30 08:55:06 +00:00
static void SV_Pin_Delete_f ( void )
2005-12-15 19:15:39 +00:00
{
PIN_DeleteOldestMessage ( ) ;
}
2014-03-30 08:55:06 +00:00
static void SV_Pin_Add_f ( void )
2005-12-15 19:15:39 +00:00
{
2006-02-22 23:31:51 +00:00
PIN_MakeMessage ( Cmd_Argv ( 1 ) , Cmd_Argv ( 2 ) ) ;
2005-12-15 19:15:39 +00:00
}
2013-06-23 02:17:02 +00:00
/*
void SV_ReallyEvilHack_f ( void )
{
int clnum = - 1 ;
client_t * cl ;
while ( ( cl = SV_GetClientForString ( Cmd_Argv ( 1 ) , & clnum ) ) )
if ( cl )
{
//kick them back to map selection, ish.
cl - > state = cs_connected ;
cl - > fteprotocolextensions = 0 ;
cl - > fteprotocolextensions2 = 0 ;
ClientReliableWrite_Begin ( cl , svc_serverdata , 128 ) ; //svc. dur.
ClientReliableWrite_Long ( cl , PROTOCOL_VERSION_QW ) ; //protocol
ClientReliableWrite_Long ( cl , svs . spawncount ) ; //servercount
ClientReliableWrite_String ( cl , " . " ) ; //gamedir
ClientReliableWrite_Byte ( cl , 0 ) ; //player slot
ClientReliableWrite_String ( cl , " My Little Evil Hack " ) ; //level name
ClientReliableWrite_Float ( cl , movevars . gravity ) ;
ClientReliableWrite_Float ( cl , movevars . stopspeed ) ;
ClientReliableWrite_Float ( cl , movevars . maxspeed ) ;
ClientReliableWrite_Float ( cl , movevars . spectatormaxspeed ) ;
ClientReliableWrite_Float ( cl , movevars . accelerate ) ;
ClientReliableWrite_Float ( cl , movevars . airaccelerate ) ;
ClientReliableWrite_Float ( cl , movevars . wateraccelerate ) ;
ClientReliableWrite_Float ( cl , movevars . friction ) ;
ClientReliableWrite_Float ( cl , movevars . waterfriction ) ;
ClientReliableWrite_Float ( cl , movevars . entgravity ) ;
ClientReliableWrite_Begin ( cl , svc_stufftext , 128 ) ;
ClientReliableWrite_String ( cl , " download \" ezquake-security.dll \" \n " ) ;
}
}
*/
2005-12-15 19:15:39 +00:00
2015-06-04 06:15:14 +00:00
void SV_PrecacheList_f ( void )
{
unsigned int i ;
2018-08-23 06:03:31 +00:00
char * group = Cmd_Argv ( 1 ) ;
2018-09-01 04:18:08 +00:00
# ifndef NOLEGACY
2018-08-23 06:03:31 +00:00
if ( ! * group | | ! strncmp ( group , " vwep " , 4 ) )
2015-06-04 06:15:14 +00:00
{
2018-08-23 06:03:31 +00:00
for ( i = 0 ; i < sizeof ( sv . strings . vw_model_precache ) / sizeof ( sv . strings . vw_model_precache [ 0 ] ) ; i + + )
{
if ( sv . strings . vw_model_precache [ i ] )
Con_Printf ( " vwep %u: %s \n " , i , sv . strings . vw_model_precache [ i ] ) ;
}
2015-06-04 06:15:14 +00:00
}
2018-09-01 04:18:08 +00:00
# endif
2018-08-23 06:03:31 +00:00
if ( ! * group | | ! strncmp ( group , " model " , 5 ) )
2015-06-04 06:15:14 +00:00
{
2018-08-23 06:03:31 +00:00
for ( i = 0 ; i < MAX_PRECACHE_MODELS ; i + + )
{
if ( sv . strings . model_precache [ i ] )
2018-11-28 05:41:39 +00:00
Con_Printf ( " model %u: ^[%s \\ modelviewer \\ %s^] \n " , i , sv . strings . model_precache [ i ] , sv . strings . model_precache [ i ] ) ;
2018-08-23 06:03:31 +00:00
}
2015-06-04 06:15:14 +00:00
}
2018-08-23 06:03:31 +00:00
if ( ! * group | | ! strncmp ( group , " sound " , 5 ) )
2015-06-04 06:15:14 +00:00
{
2018-08-23 06:03:31 +00:00
for ( i = 0 ; i < MAX_PRECACHE_SOUNDS ; i + + )
{
if ( sv . strings . sound_precache [ i ] )
Con_Printf ( " sound %u: %s \n " , i , sv . strings . sound_precache [ i ] ) ;
}
2015-06-04 06:15:14 +00:00
}
2018-08-23 06:03:31 +00:00
if ( ! * group | | ! strncmp ( group , " part " , 4 ) )
2015-06-04 06:15:14 +00:00
{
2018-08-23 06:03:31 +00:00
for ( i = 0 ; i < MAX_SSPARTICLESPRE ; i + + )
{
if ( sv . strings . particle_precache [ i ] )
Con_Printf ( " part %u: %s \n " , i , sv . strings . particle_precache [ i ] ) ;
}
2015-06-04 06:15:14 +00:00
}
}
2015-06-14 12:26:01 +00:00
void SV_MemInfo_f ( void )
{
int sz , i , fr , csfr ;
laggedpacket_t * lp ;
client_t * cl ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
Cmd_ExecuteString ( " mod_memlist " , Cmd_ExecLevel ) ;
// Cmd_ExecuteString("hunkprint", Cmd_ExecLevel);
2015-06-14 12:26:01 +00:00
for ( i = 0 ; i < svs . allocated_client_slots ; i + + )
{
cl = & svs . clients [ i ] ;
if ( cl - > state )
{
Con_Printf ( " %s \n " , cl - > name ) ;
sz = 0 ;
for ( lp = cl - > laggedpacket ; lp ; lp = lp - > next )
sz + = lp - > length ;
fr = 0 ;
2017-05-28 15:42:32 +00:00
fr + = sizeof ( client_frame_t ) * UPDATE_BACKUP ;
2016-07-12 00:40:13 +00:00
if ( cl - > pendingdeltabits )
2015-06-14 12:26:01 +00:00
{
2017-05-28 15:42:32 +00:00
fr + = sizeof ( cl ) * UPDATE_BACKUP +
sizeof ( * cl - > pendingdeltabits ) * cl - > max_net_ents ;
2015-06-14 12:26:01 +00:00
}
2017-05-28 15:42:32 +00:00
fr + = sizeof ( * cl - > frameunion . frames [ 0 ] . resend ) * cl - > frameunion . frames [ 0 ] . maxresend * UPDATE_BACKUP ;
fr + = sizeof ( entity_state_t ) * cl - > frameunion . frames [ 0 ] . qwentities . max_entities * UPDATE_BACKUP ;
2015-06-14 12:26:01 +00:00
fr + = sizeof ( * cl - > sentents . entities ) * cl - > sentents . max_entities ;
2016-07-12 00:40:13 +00:00
csfr = sizeof ( * cl - > pendingcsqcbits ) * cl - > max_net_ents ;
2015-06-14 12:26:01 +00:00
2016-02-10 23:23:43 +00:00
Con_Printf ( " % " PRIuSIZE " minping=%i frame=%i, csqc=%i \n " , sizeof ( svs . clients [ i ] ) , sz , fr , csfr ) ;
2015-06-14 12:26:01 +00:00
}
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2017-05-28 15:42:32 +00:00
if ( sv . world . progs )
Con_Printf ( " ssqc: %u (used) / %u (reserved) \n " , sv . world . progs - > stringtablesize , sv . world . progs - > stringtablemaxsize ) ;
2015-06-14 12:26:01 +00:00
}
2016-07-12 00:40:13 +00:00
void SV_Download_f ( void )
2017-11-14 14:37:04 +00:00
{ //command for dedicated servers. apparently.
2016-07-12 00:40:13 +00:00
# ifdef WEBCLIENT
char * url = Cmd_Argv ( 1 ) ;
char * localname = Cmd_Argv ( 2 ) ;
if ( ! strnicmp ( url , " http:// " , 7 ) | | ! strnicmp ( url , " https:// " , 8 ) | | ! strnicmp ( url , " ftp:// " , 6 ) )
{
struct dl_download * dl ;
if ( Cmd_IsInsecure ( ) )
return ;
if ( ! * localname )
{
localname = strrchr ( url , ' / ' ) ;
if ( localname )
localname + + ;
else
{
Con_TPrintf ( " no local name specified \n " ) ;
return ;
}
}
dl = HTTP_CL_Get ( url , localname , NULL ) ;
# ifdef MULTITHREAD
if ( dl )
DL_CreateThread ( dl , NULL , NULL ) ;
# else
( void ) dl ;
# endif
return ;
}
# endif
Con_Printf ( " scheme not supported \n " ) ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = =
SV_InitOperatorCommands
= = = = = = = = = = = = = = = = = =
*/
void SV_InitOperatorCommands ( void )
{
# ifndef SERVERONLY
if ( isDedicated )
# endif
{
Cmd_AddCommand ( " quit " , SV_Quit_f ) ;
Cmd_AddCommand ( " say " , SV_ConSay_f ) ;
Cmd_AddCommand ( " sayone " , SV_ConSayOne_f ) ;
2010-11-06 14:22:33 +00:00
Cmd_AddCommand ( " tell " , SV_ConSayOne_f ) ;
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " serverinfo " , SV_Serverinfo_f ) ; //commands that conflict with client commands.
2018-07-05 16:21:44 +00:00
Cmd_AddCommand ( " serverinfoblob " , SV_Serverinfo_f ) ; //commands that conflict with client commands.
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " user " , SV_User_f ) ;
Cmd_AddCommand ( " god " , SV_God_f ) ;
2015-09-01 04:45:15 +00:00
# ifdef QUAKESTATS
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " give " , SV_Give_f ) ;
2015-09-01 04:45:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " noclip " , SV_Noclip_f ) ;
2016-07-12 00:40:13 +00:00
Cmd_AddCommand ( " download " , SV_Download_f ) ;
2004-08-23 00:15:46 +00:00
}
Cvar_Register ( & sv_cheats , " Server Permissions " ) ;
if ( COM_CheckParm ( " -cheats " ) )
{
Cvar_Set ( & sv_cheats , " 1 " ) ;
}
Cmd_AddCommand ( " fraglogfile " , SV_Fraglogfile_f ) ;
2009-07-14 23:42:54 +00:00
//ask clients to take a remote screenshot
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " snap " , SV_Snap_f ) ;
Cmd_AddCommand ( " snapall " , SV_SnapAll_f ) ;
2009-07-14 23:42:54 +00:00
//various punishments
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " kick " , SV_Kick_f ) ;
2009-10-06 00:41:42 +00:00
Cmd_AddCommand ( " clientkick " , SV_KickSlot_f ) ;
2014-03-30 08:55:06 +00:00
Cmd_AddCommand ( " renameclient " , SV_ForceName_f ) ;
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " mute " , SV_Mute_f ) ;
Cmd_AddCommand ( " cuff " , SV_Cuff_f ) ;
Cmd_AddCommand ( " cripple " , SV_CripplePlayer_f ) ;
2008-05-25 22:23:43 +00:00
Cmd_AddCommand ( " ban " , SV_BanClientIP_f ) ;
2014-03-30 08:55:06 +00:00
Cmd_AddCommand ( " banname " , SV_BanClientIP_f ) ; //legacy dupe-name crap
Cmd_AddCommand ( " banlist " , SV_BanList_f ) ; //shows only bans, not other penalties
Cmd_AddCommand ( " unban " , SV_Unfilter_f ) ; //merely renamed.
2004-08-23 00:15:46 +00:00
2006-05-25 04:47:03 +00:00
Cmd_AddCommand ( " addip " , SV_FilterIP_f ) ;
Cmd_AddCommand ( " removeip " , SV_Unfilter_f ) ;
2014-03-30 08:55:06 +00:00
Cmd_AddCommand ( " listip " , SV_FilterList_f ) ; //shows all penalties
2006-05-29 16:12:21 +00:00
Cmd_AddCommand ( " writeip " , SV_WriteIP_f ) ;
2006-05-25 04:47:03 +00:00
2006-05-30 04:00:24 +00:00
Cmd_AddCommand ( " floodprot " , SV_Floodprot_f ) ;
2014-03-30 08:55:06 +00:00
Cmd_AddCommand ( " status " , SV_Status_f ) ;
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " sv " , SV_SendGameCommand_f ) ;
2007-09-03 22:37:13 +00:00
Cmd_AddCommand ( " mod " , SV_SendGameCommand_f ) ;
2004-08-23 00:15:46 +00:00
2017-08-29 02:29:06 +00:00
# ifdef SUBSERVERS
Cmd_AddCommand ( " ssv " , MSV_SubServerCommand_f ) ;
Cmd_AddCommand ( " ssv_all " , MSV_SubServerCommand_f ) ;
Cmd_AddCommandAD ( " mapcluster " , MSV_MapCluster_f , SV_Map_c , " Sets this server up as a cluster-server gateway. Additional processes will be used to host individual maps. If an argument is given then that will be the name of the map that new clients will initially be directed to. This can also be used for single-player to off-load nearly all server functions - use the 'ssv' command to direct each subserver. " ) ;
# endif
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " killserver " , SV_KillServer_f ) ;
2015-06-04 06:15:14 +00:00
Cmd_AddCommandD ( " precaches " , SV_PrecacheList_f , " Displays a list of current server precaches. " ) ;
2017-07-04 05:07:51 +00:00
Cmd_AddCommandAD ( " map " , SV_Map_f , SV_Map_c , " Changes map. If a second argument is specified then that is normally the name of the initial start spot. " ) ;
2005-09-08 01:47:12 +00:00
# ifdef Q3SERVER
2017-07-04 05:07:51 +00:00
Cmd_AddCommandAD ( " spmap " , SV_Map_f , SV_Map_c , NULL ) ;
2005-09-08 01:47:12 +00:00
# endif
2017-07-04 05:07:51 +00:00
Cmd_AddCommandAD ( " gamemap " , SV_Map_f , SV_Map_c , NULL ) ;
Cmd_AddCommandAD ( " changelevel " , SV_Map_f , SV_Map_c , NULL ) ;
2018-01-22 19:18:04 +00:00
Cmd_AddCommandD ( " map_restart " , SV_Map_f , NULL ) ; //from q3.
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " listmaps " , SV_MapList_f ) ;
2014-03-30 08:55:06 +00:00
Cmd_AddCommand ( " maplist " , SV_MapList_f ) ;
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " heartbeat " , SV_Heartbeat_f ) ;
2005-07-03 15:16:20 +00:00
Cmd_AddCommand ( " localinfo " , SV_Localinfo_f ) ;
2018-05-21 13:47:53 +00:00
Cmd_AddCommandAD ( " gamedir " , SV_Gamedir_f , SV_Gamedir_c , " Change the current gamedir. " ) ;
Cmd_AddCommandAD ( " sv_gamedir " , SV_Gamedir , SV_Gamedir_c , " Change the gamedir reported to clients, without changing any actual paths on the server. " ) ;
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " sv_settimer " , SV_SetTimer_f ) ;
Cmd_AddCommand ( " stuffcmd " , SV_StuffToClient_f ) ;
2005-12-15 19:15:39 +00:00
Cmd_AddCommand ( " pin_save " , SV_Pin_Save_f ) ;
Cmd_AddCommand ( " pin_reload " , SV_Pin_Reload_f ) ;
Cmd_AddCommand ( " pin_delete " , SV_Pin_Delete_f ) ;
Cmd_AddCommand ( " pin_add " , SV_Pin_Add_f ) ;
2015-06-14 12:26:01 +00:00
Cmd_AddCommand ( " sv_meminfo " , SV_MemInfo_f ) ;
2013-06-23 02:17:02 +00:00
// Cmd_AddCommand ("reallyevilhack", SV_ReallyEvilHack_f);
2012-11-29 13:37:48 +00:00
if ( isDedicated )
cl_warncmd . value = 1 ;
2004-08-23 00:15:46 +00:00
}
2004-11-29 01:21:00 +00:00
# endif