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 included ( GNU . txt ) 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"
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2004-11-29 01:21:00 +00:00
# ifndef CLIENTONLY
2005-11-29 13:22:58 +00:00
2004-08-23 00:15:46 +00:00
# include "winquake.h"
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
# include "fs.h"
2004-08-23 00:15:46 +00:00
2005-11-29 13:22:58 +00:00
# include "netinc.h"
2005-05-21 01:28:51 +00:00
2004-08-23 00:15:46 +00:00
void SV_MVDStop_f ( void ) ;
2004-12-10 21:34:42 +00:00
# define demo_size_padding 0x1000
2015-04-21 04:12:00 +00:00
static void QDECL SV_DemoDir_Callback ( struct cvar_s * var , char * oldvalue ) ;
2011-08-16 04:12:15 +00:00
2019-06-18 13:03:37 +00:00
cvar_t sv_demoAutoRecord = CVARAD ( " sv_demoAutoRecord " , " 0 " , " cl_autodemo " , " If set, automatically record demos. \n -1: record on client connection only. \n 1+: record once there's this many active players on the server (or if connected to a remote server). " ) ;
2016-07-12 00:40:13 +00:00
cvar_t sv_demoUseCache = CVARD ( " sv_demoUseCache " , " " , " If set, demo data will be flushed only periodically " ) ;
2011-08-16 04:12:15 +00:00
cvar_t sv_demoCacheSize = CVAR ( " sv_demoCacheSize " , " 0x80000 " ) ; //half a meg
2018-09-01 04:18:08 +00:00
cvar_t sv_demoMaxDirSize = CVARD ( " sv_demoMaxDirSize " , " 100mb " , " Maximum allowed serverside storage space for mvds. set to blank to remove the limit. New demos cannot be recorded once this size is reached. " ) ; //so ktpro autorecords.
cvar_t sv_demoMaxDirCount = CVARD ( " sv_demoMaxDirCount " , " 500 " , " Maximum allowed serverside mvds to record. Set to 0 to remove the limit. New demos cannot be recorded once this many demos have already been recorded. " ) ; //so ktpro autorecords.
cvar_t sv_demoMaxDirAge = CVARD ( " sv_demoMaxDirAge " , " 0 " , " Maximum allowed age for demos, any older demos will be deleted when sv_demoClearOld is set (this doesn't prevent recording new demos). " ) ;
cvar_t sv_demoClearOld = CVARD ( " sv_demoClearOld " , " 0 " , " Automatically delete demos to keep the demos count reasonable. " ) ;
2011-08-16 04:12:15 +00:00
cvar_t sv_demoDir = CVARC ( " sv_demoDir " , " demos " , SV_DemoDir_Callback ) ;
2019-04-01 10:16:36 +00:00
cvar_t sv_demoDirAlt = CVARCD ( " sv_demoDirAlt " , " " , SV_DemoDir_Callback , " Provides a fallback directory name for demo downloads, for when sv_demoDir doesn't contain the requested demo. " ) ;
2011-08-16 04:12:15 +00:00
cvar_t sv_demofps = CVAR ( " sv_demofps " , " 30 " ) ;
cvar_t sv_demoPings = CVARD ( " sv_demoPings " , " 10 " , " Interval between ping updates in mvds " ) ;
cvar_t sv_demoMaxSize = CVARD ( " sv_demoMaxSize " , " " , " Demos will be truncated to be no larger than this size. " ) ;
cvar_t sv_demoExtraNames = CVAR ( " sv_demoExtraNames " , " " ) ;
2018-08-24 00:35:16 +00:00
cvar_t sv_demoExtensions = CVARD ( " sv_demoExtensions " , " 1 " , " Enables protocol extensions within MVDs. This will cause older/non-fte clients to error upon playback. \n 0: off. \n 1: all extensions. \n 2: extensions also supported by a certain other engine. " ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
cvar_t sv_demoAutoCompress = CVARD ( " sv_demoAutoCompress " , " " , " Specifies whether to compress demos as they're recorded. \n 0 = no compression. \n 1 = gzip compression. " ) ;
2017-11-16 22:20:40 +00:00
cvar_t sv_demo_write_csqc = CVARD ( " sv_demo_write_csqc " , " " , " Writes a copy of the csprogs into recorded demos. This ensures that the demo can be played back despite future gamecode changes. " ) ;
2011-08-16 04:12:15 +00:00
cvar_t qtv_password = CVAR ( " qtv_password " , " " ) ;
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
cvar_t qtv_maxstreams = CVARAFD ( " qtv_maxstreams " , " 0 " ,
" mvd_maxstreams " , 0 , " This is the maximum number of QTV clients/proxies that may be directly connected to the server. If empty then there is no limit. 0 disallows any streaming. " ) ;
2011-08-16 04:12:15 +00:00
2018-09-01 04:18:08 +00:00
cvar_t sv_demoAutoPrefix = CVAR ( " sv_demoAutoPrefix " , " auto_ " ) ;
2011-08-16 04:12:15 +00:00
cvar_t sv_demoPrefix = CVAR ( " sv_demoPrefix " , " " ) ;
cvar_t sv_demoSuffix = CVAR ( " sv_demoSuffix " , " " ) ;
cvar_t sv_demotxt = CVAR ( " sv_demotxt " , " 1 " ) ;
void SV_WriteMVDMessage ( sizebuf_t * msg , int type , int to , float time ) ;
2012-08-04 01:35:52 +00:00
void SV_WriteRecordMVDMessage ( sizebuf_t * msg ) ;
2020-02-11 18:06:10 +00:00
# ifdef TCPCONNECT
void tobase64 ( unsigned char * out , int outlen , unsigned char * in , int inlen ) ;
# endif
2011-08-16 04:12:15 +00:00
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
static struct
{ //tracks the previously recorded demos, so we don't have to content with dates and filesystem ordering and stuff.
# define DEMOLOG_LENGTH 16
unsigned int sequence ; //incremented
struct
{
char filename [ MAX_QPATH ] ;
} log [ DEMOLOG_LENGTH ] ;
} demolog ;
2011-08-16 04:12:15 +00:00
demo_t demo ;
2012-08-04 01:35:52 +00:00
static float demo_prevtime ;
//static dbuffer_t *demobuffer;
//static int header = (char *)&((header_t*)0)->data - (char *)NULL;
static sizebuf_t demomsg ;
int demomsgtype ;
int demomsgto ;
static char demomsgbuf [ MAX_OVERALLMSGLEN ] ;
2011-08-16 04:12:15 +00:00
2020-02-26 00:37:52 +00:00
static void SV_MVD_Stopped ( void ) ;
2016-07-12 00:40:13 +00:00
static mvddest_t * singledest ; //used when a stream is starting up so redundant data doesn't get dumped into other streams
2020-02-11 18:06:10 +00:00
static struct reversedest_s
{
struct reversedest_s * next ;
qtvpendingstate_t info ;
vfsfile_t * stream ;
char inbuffer [ 2048 ] ;
int inbuffersize ;
double timeout ;
} * reversedest ; //used when a reverse stream is starting up
2004-12-10 21:34:42 +00:00
2019-05-10 09:31:21 +00:00
static mvddest_t * SV_MVD_InitStream ( vfsfile_t * stream , const char * info ) ;
2013-07-26 17:19:06 +00:00
qboolean SV_MVD_Record ( mvddest_t * dest ) ;
2009-04-01 22:03:56 +00:00
char * SV_MVDName2Txt ( char * name ) ;
2006-09-17 00:59:22 +00:00
extern cvar_t qtv_password ;
2013-03-12 22:44:00 +00:00
//does not unlink.
2016-07-12 00:40:13 +00:00
static void DestClose ( mvddest_t * d , enum mvdclosereason_e reason )
2004-12-10 21:34:42 +00:00
{
2016-07-12 00:40:13 +00:00
if ( d - > desttype = = DEST_THREADEDFILE )
{
while ( d - > flushing = = true )
COM_WorkerPartialSync ( d , & d - > flushing , true ) ;
}
2004-12-10 21:34:42 +00:00
if ( d - > cache )
BZ_Free ( d - > cache ) ;
if ( d - > file )
2017-02-19 00:15:42 +00:00
{
2009-04-01 22:03:56 +00:00
VFS_CLOSE ( d - > file ) ;
2019-05-10 09:31:21 +00:00
if ( d - > desttype ! = DEST_STREAM )
FS_FlushFSHashWritten ( d - > filename ) ;
2017-02-19 00:15:42 +00:00
}
2004-12-10 21:34:42 +00:00
2019-05-10 09:31:21 +00:00
if ( d - > desttype ! = DEST_STREAM )
2004-12-10 21:34:42 +00:00
{
2019-05-10 09:31:21 +00:00
if ( reason = = MVD_CLOSE_CANCEL )
{
FS_Remove ( d - > filename , FS_GAMEONLY ) ;
2004-12-10 21:34:42 +00:00
2019-05-10 09:31:21 +00:00
FS_Remove ( SV_MVDName2Txt ( d - > filename ) , FS_GAMEONLY ) ;
2016-07-12 00:40:13 +00:00
2019-05-10 09:31:21 +00:00
//SV_BroadcastPrintf (PRINT_CHAT, "Server recording canceled, demo removed\n");
}
else
{
char buf [ 512 ] ;
Q_strncpyz ( demolog . log [ demolog . sequence % DEMOLOG_LENGTH ] . filename , d - > simplename , sizeof ( demolog . log [ demolog . sequence % DEMOLOG_LENGTH ] . filename ) ) ;
demolog . sequence + + ;
SV_BroadcastPrintf ( PRINT_CHAT , " Server recording complete \n ^[/download %s^] \n " , COM_QuotedString ( va ( " demos/%s " , d - > simplename ) , buf , sizeof ( buf ) , false ) ) ;
}
2004-12-10 21:34:42 +00:00
}
Z_Free ( d ) ;
}
2016-07-12 00:40:13 +00:00
static void MVD_FlushDest_Flushed ( void * ctx , void * data , size_t a , size_t b )
{
mvddest_t * d = ctx ;
d - > flushing = false ;
}
static void MVD_FlushDest_Worker ( void * ctx , void * data , size_t datasize , size_t b )
{
mvddest_t * d = ctx ;
int len = VFS_WRITE ( d - > file , data , datasize ) ;
VFS_FLUSH ( d - > file ) ;
if ( len ! = datasize )
d - > error = true ;
d - > altcache = data ;
COM_AddWork ( WG_MAIN , MVD_FlushDest_Flushed , d , NULL , 0 , 0 ) ;
}
2004-12-10 21:34:42 +00:00
void DestFlush ( qboolean compleate )
{
int len ;
mvddest_t * d , * t ;
2016-09-08 19:04:35 +00:00
if ( compleate )
{
//make sure everything is flushed.
MVDWrite_Begin ( 255 , - 1 , 0 ) ;
}
2016-07-12 00:40:13 +00:00
2004-12-10 21:34:42 +00:00
if ( ! demo . dest )
return ;
while ( demo . dest - > error )
{
d = demo . dest ;
demo . dest = d - > nextdest ;
2016-07-12 00:40:13 +00:00
DestClose ( d , MVD_CLOSE_FSERROR ) ;
2005-09-06 01:19:26 +00:00
if ( ! demo . dest )
{
2016-07-12 00:40:13 +00:00
SV_MVDStop ( MVD_CLOSE_DISCONNECTED , false ) ;
2005-09-06 01:19:26 +00:00
return ;
}
2004-12-10 21:34:42 +00:00
}
for ( d = demo . dest ; d ; d = d - > nextdest )
{
switch ( d - > desttype )
{
case DEST_FILE :
2009-04-01 22:03:56 +00:00
VFS_FLUSH ( d - > file ) ;
2004-12-10 21:34:42 +00:00
break ;
case DEST_BUFFEREDFILE :
if ( d - > cacheused + demo_size_padding > d - > maxcachesize | | compleate )
{
2009-04-01 22:03:56 +00:00
len = VFS_WRITE ( d - > file , d - > cache , d - > cacheused ) ;
2004-12-10 21:34:42 +00:00
if ( len < d - > cacheused )
d - > error = true ;
2009-04-01 22:03:56 +00:00
VFS_FLUSH ( d - > file ) ;
2004-12-10 21:34:42 +00:00
d - > cacheused = 0 ;
}
break ;
2016-07-12 00:40:13 +00:00
case DEST_THREADEDFILE :
if ( d - > cacheused + demo_size_padding > d - > maxcachesize | | compleate )
{
void * data = d - > cache ;
while ( d - > flushing = = true )
COM_WorkerPartialSync ( d , & d - > flushing , true ) ;
d - > cache = d - > altcache ;
d - > altcache = NULL ;
d - > flushing = true ;
COM_AddWork ( WG_LOADER , MVD_FlushDest_Worker , d , data , d - > cacheused , 0 ) ;
d - > cacheused = 0 ;
}
break ;
2004-12-10 21:34:42 +00:00
case DEST_STREAM :
2006-03-23 19:22:12 +00:00
if ( d - > cacheused & & ! d - > error )
2004-12-10 21:34:42 +00:00
{
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
len = VFS_WRITE ( d - > file , d - > cache , d - > cacheused ) ;
if ( len < 0 ) //client died
2005-09-06 01:19:26 +00:00
d - > error = true ;
2006-03-23 19:22:12 +00:00
else if ( len > 0 ) //we put some data through
{ //move up the buffer
2005-10-07 02:03:17 +00:00
d - > cacheused - = len ;
memmove ( d - > cache , d - > cache + len , d - > cacheused ) ;
}
2004-12-10 21:34:42 +00:00
}
break ;
case DEST_NONE :
Sys_Error ( " DestFlush encoundered bad dest. " ) ;
}
if ( sv_demoMaxSize . value & & d - > totalsize > sv_demoMaxSize . value * 1024 )
d - > error = 2 ; //abort, but don't kill it.
while ( d - > nextdest & & d - > nextdest - > error )
{
t = d - > nextdest ;
d - > nextdest = t - > nextdest ;
2016-07-12 00:40:13 +00:00
DestClose ( t , MVD_CLOSE_FSERROR ) ;
2004-12-10 21:34:42 +00:00
}
}
}
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
enum qtvstatus_e
{
QTV_ERROR = - 1 , //corrupt/bad request that should be dropped.
QTV_RETRY = 0 , //still handshaking.
QTV_ACCEPT = 1 //stream is now owned by the qtv code
} ;
int SV_MVD_GotQTVRequest ( vfsfile_t * clientstream , char * headerstart , char * headerend , qtvpendingstate_t * p )
2006-09-17 00:59:22 +00:00
{
char * e ;
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
qboolean server = false ;
char * start , * lineend ;
int versiontouse = 0 ;
int raw = 0 ;
char password [ 256 ] = " " ;
2019-05-10 09:31:21 +00:00
char userinfo [ 1024 ] ;
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
enum {
2020-02-11 18:06:10 +00:00
//MUST BE ORDERED HIGHEST-PRIORITY-LAST
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
QTVAM_NONE ,
QTVAM_PLAIN ,
2020-02-11 18:06:10 +00:00
# ifdef TCPCONNECT
2017-06-21 01:24:25 +00:00
// QTVAM_CCITT, //16bit = ddos it
2021-10-05 05:06:04 +00:00
QTVAM_MD4 , //fucked. required for eztv compat
2020-02-11 18:06:10 +00:00
// QTVAM_MD5, //fucked, no hash implemented
QTVAM_SHA1 , //fucked too nowadays
2021-10-05 05:06:04 +00:00
QTVAM_SHA2_256 , //
QTVAM_SHA2_512 , //
2020-02-11 18:06:10 +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
} authmethod = QTVAM_NONE ;
start = headerstart ;
lineend = strchr ( start , ' \n ' ) ;
if ( ! lineend )
return QTV_ERROR ;
* lineend = ' \0 ' ;
COM_ParseToken ( start , NULL ) ;
start = lineend + 1 ;
if ( strcmp ( com_token , " QTV " ) )
{ //it's an error if it's not qtv.
if ( ! strcmp ( com_token , " QTVSV " ) )
server = true ;
else
return QTV_ERROR ;
2006-09-17 00:59:22 +00:00
}
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 ( server ! = p - > isreverse )
{ //just a small check
return QTV_ERROR ;
2006-09-17 00:59:22 +00:00
}
2019-05-10 09:31:21 +00:00
* userinfo = 0 ;
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
for ( ; ; )
2006-09-17 00:59:22 +00:00
{
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
lineend = strchr ( start , ' \n ' ) ;
if ( ! lineend )
break ;
* lineend = ' \0 ' ;
start = COM_ParseToken ( start , NULL ) ;
if ( start & & * start = = ' : ' )
2006-09-17 00:59:22 +00:00
{
//VERSION: a list of the different qtv protocols supported. Multiple versions can be specified. The first is assumed to be the prefered version.
//RAW: if non-zero, send only a raw mvd with no additional markup anywhere (for telnet use). Doesn't work with challenge-based auth, so will only be accepted when proxy passwords are not required.
//AUTH: specifies an auth method, the exact specs varies based on the method
// PLAIN: the password is sent as a PASSWORD line
// MD4: the server responds with an "AUTH: MD4\n" line as well as a "CHALLENGE: somerandomchallengestring\n" line, the client sends a new 'initial' request with CHALLENGE: MD4\nRESPONSE: hexbasedmd4checksumhere\n"
// MD5: same as md4
// CCITT: same as md4, but using the CRC stuff common to all quake engines.
// if the supported/allowed auth methods don't match, the connection is silently dropped.
//SOURCE: which stream to play from, DEFAULT is special. Without qualifiers, it's assumed to be a tcp address.
//COMPRESSION: Suggests a compression method (multiple are allowed). You'll get a COMPRESSION response, and compression will begin with the binary data.
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
start = start + 1 ;
while ( * start = = ' ' | | * start = = ' \t ' )
start + + ;
Con_DPrintf ( " qtv, got (%s) (%s) \n " , com_token , start ) ;
if ( ! strcmp ( com_token , " VERSION " ) )
{
start = COM_ParseToken ( start , NULL ) ;
if ( atoi ( com_token ) = = 1 )
versiontouse = 1 ;
}
else if ( ! strcmp ( com_token , " RAW " ) )
{
start = COM_ParseToken ( start , NULL ) ;
raw = atoi ( com_token ) ;
}
else if ( ! strcmp ( com_token , " PASSWORD " ) )
{
start = COM_ParseToken ( start , NULL ) ;
Q_strncpyz ( password , com_token , sizeof ( password ) ) ;
}
else if ( ! strcmp ( com_token , " AUTH " ) )
{
int thisauth ;
start = COM_ParseToken ( start , NULL ) ;
if ( ! strcmp ( com_token , " NONE " ) )
2020-02-11 18:06:10 +00:00
thisauth = QTVAM_NONE ;
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
else if ( ! strcmp ( com_token , " PLAIN " ) )
thisauth = QTVAM_PLAIN ;
2020-02-11 18:06:10 +00:00
# ifdef TCPCONNECT
2017-06-21 01:24:25 +00:00
// else if (!strcmp(com_token, "CCIT"))
// thisauth = QTVAM_CCITT;
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
else if ( ! strcmp ( com_token , " MD4 " ) )
thisauth = QTVAM_MD4 ;
2017-06-21 01:24:25 +00:00
// else if (!strcmp(com_token, "MD5"))
// thisauth = QTVAM_MD5;
else if ( ! strcmp ( com_token , " SHA1 " ) )
thisauth = QTVAM_SHA1 ;
2021-10-05 05:06:04 +00:00
else if ( ! strcmp ( com_token , " SHA2_256 " ) )
thisauth = QTVAM_SHA2_256 ;
else if ( ! strcmp ( com_token , " SHA2_512 " ) )
thisauth = QTVAM_SHA2_512 ;
2020-02-11 18:06:10 +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
else
{
thisauth = QTVAM_NONE ;
Con_DPrintf ( " qtv: received unrecognised auth method (%s) \n " , com_token ) ;
2006-09-17 00:59:22 +00:00
}
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 ( authmethod < thisauth )
authmethod = thisauth ;
}
else if ( ! strcmp ( com_token , " SOURCE " ) )
{
//servers don't support source, and ignore it.
//source is only useful for qtv proxy servers.
}
else if ( ! strcmp ( com_token , " COMPRESSION " ) )
{
//compression not supported yet
}
else if ( ! strcmp ( com_token , " QTV_EZQUAKE_EXT " ) )
{
//if we were treating this as a regular client over tcp (qizmo...)
}
else if ( ! strcmp ( com_token , " USERINFO " ) )
{
//if we were treating this as a regular client over tcp (qizmo...)
2019-05-10 09:31:21 +00:00
start = COM_ParseTokenOut ( start , NULL , userinfo , sizeof ( userinfo ) , & com_tokentype ) ;
2006-09-17 00:59:22 +00:00
}
else
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
{
//not recognised.
2006-09-17 00:59:22 +00:00
}
}
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
start = lineend + 1 ;
2006-09-17 00:59:22 +00:00
}
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
/*len = (headerend - headerstart)+2;
p - > insize - = len ;
memmove ( p - > inbuffer , p - > inbuffer + len , p - > insize ) ;
p - > inbuffer [ p - > insize ] = 0 ;
*/
e = NULL ;
if ( p - > hasauthed )
{
}
else if ( p - > isreverse )
p - > hasauthed = true ; //reverse connections do not need to auth.
else if ( ! * qtv_password . string )
p - > hasauthed = true ; //no password, no need to auth.
else if ( * password )
{
2021-10-05 05:06:04 +00:00
hashfunc_t * func = NULL ;
2020-02-11 18:06:10 +00:00
if ( ! * p - > challenge & & authmethod > QTVAM_PLAIN )
e = ( " QTVSV 1 \n "
" PERROR: Challenge wasn't given... \n \n " ) ;
else switch ( authmethod )
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
{
case QTVAM_NONE :
e = ( " QTVSV 1 \n "
" PERROR: You need to provide a password. \n \n " ) ;
break ;
case QTVAM_PLAIN :
p - > hasauthed = ! strcmp ( qtv_password . string , password ) ;
break ;
2020-02-11 18:06:10 +00:00
# ifdef TCPCONNECT
2017-06-21 01:24:25 +00:00
/*case QTVAM_CCITT:
{
unsigned short ushort_result ;
QCRC_Init ( & ushort_result ) ;
QCRC_AddBlock ( & ushort_result , p - > challenge , strlen ( p - > challenge ) ) ;
QCRC_AddBlock ( & ushort_result , qtv_password . string , strlen ( qtv_password . string ) ) ;
p - > hasauthed = ( ushort_result = = strtoul ( password , NULL , 0 ) ) ;
}
break ; */
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
case QTVAM_MD4 :
{
char hash [ 512 ] ;
int md4sum [ 4 ] ;
2020-02-11 18:06:10 +00:00
Q_snprintfz ( hash , sizeof ( hash ) , " %s%s " , p - > challenge , qtv_password . string ) ;
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
Com_BlockFullChecksum ( hash , strlen ( hash ) , ( unsigned char * ) md4sum ) ;
2020-02-11 18:06:10 +00:00
Q_snprintfz ( hash , sizeof ( hash ) , " %X%X%X%X " , md4sum [ 0 ] , md4sum [ 1 ] , md4sum [ 2 ] , md4sum [ 3 ] ) ;
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
p - > hasauthed = ! strcmp ( password , hash ) ;
}
break ;
2021-10-05 05:06:04 +00:00
# ifdef HAVE_LEGACY //to be disabled at some point.
2017-06-21 01:24:25 +00:00
case QTVAM_SHA1 :
{
char hash [ 512 ] ;
int digest [ 5 ] ;
2020-02-11 18:06:10 +00:00
Q_snprintfz ( hash , sizeof ( hash ) , " %s%s " , p - > challenge , qtv_password . string ) ;
2020-03-25 21:29:30 +00:00
CalcHash ( & hash_sha1 , ( char * ) digest , sizeof ( digest ) , hash , strlen ( hash ) ) ;
2020-02-11 18:06:10 +00:00
Q_snprintfz ( hash , sizeof ( hash ) , " %08X%08X%08X%08X%08X " , digest [ 0 ] , digest [ 1 ] , digest [ 2 ] , digest [ 3 ] , digest [ 4 ] ) ;
2017-06-21 01:24:25 +00:00
p - > hasauthed = ! strcmp ( password , hash ) ;
2021-10-05 05:06:04 +00:00
if ( ! p - > hasauthed )
func = & hash_sha1 ;
2017-06-21 01:24:25 +00:00
}
break ;
2021-10-05 05:06:04 +00:00
# else
case QTVAM_SHA1 : func = & hash_sha1 ; break ;
# endif
case QTVAM_SHA2_256 : func = & hash_sha256 ; break ;
case QTVAM_SHA2_512 : func = & hash_sha512 ; break ;
// case QTVAM_MD5: func = &hash_md5; break;
2020-02-11 18:06:10 +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
default :
e = ( " QTVSV 1 \n "
2020-02-11 18:06:10 +00:00
" PERROR: server bug detected. \n \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
break ;
}
2021-10-05 05:06:04 +00:00
if ( func )
{
char hash [ DIGEST_MAXSIZE * 2 + 1 ] ;
qbyte digest [ DIGEST_MAXSIZE ] ;
Q_snprintfz ( hash , sizeof ( hash ) , " %s%s " , p - > challenge , qtv_password . string ) ;
CalcHash ( func , digest , sizeof ( digest ) , hash , strlen ( hash ) ) ;
Base64_EncodeBlock ( digest , func - > digestsize , hash , sizeof ( hash ) ) ;
p - > hasauthed = ! strcmp ( password , hash ) ;
}
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 ( ! p - > hasauthed & & ! e )
{
if ( raw )
e = " " ;
else
e = ( " QTVSV 1 \n "
" PERROR: Bad password. \n \n " ) ;
}
}
else
{
//no password, and not automagically authed
switch ( authmethod )
{
case QTVAM_NONE :
if ( raw )
e = " " ;
else
e = ( " QTVSV 1 \n "
" PERROR: You need to provide a common auth method. \n \n " ) ;
break ;
case QTVAM_PLAIN :
p - > hasauthed = ! strcmp ( qtv_password . string , password ) ;
break ;
2020-02-11 18:06:10 +00:00
# ifdef TCPCONNECT
2017-06-21 01:24:25 +00:00
/*case QTVAM_CCITT:
2020-02-11 18:06:10 +00:00
e = ( " QTVSV 1 \n "
" AUTH: CCITT \n "
" CHALLENGE: " ) ;
goto hashedpassword ; */
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
case QTVAM_MD4 :
2020-02-11 18:06:10 +00:00
e = ( " QTVSV 1 \n "
" AUTH: MD4 \n "
" CHALLENGE: " ) ;
goto hashedpassword ;
2017-06-21 01:24:25 +00:00
/*case QTVAM_MD5:
2020-02-11 18:06:10 +00:00
e = ( " QTVSV 1 \n "
" AUTH: MD5 \n "
" CHALLENGE: " ) ;
goto hashedpassword ; */
2017-06-21 01:24:25 +00:00
case QTVAM_SHA1 :
2020-02-11 18:06:10 +00:00
e = ( " QTVSV 1 \n "
" AUTH: SHA1 \n "
" CHALLENGE: " ) ;
goto hashedpassword ;
2021-10-05 05:06:04 +00:00
case QTVAM_SHA2_256 :
e = ( " QTVSV 1 \n "
" AUTH: SHA2_256 \n "
" CHALLENGE: " ) ;
goto hashedpassword ;
case QTVAM_SHA2_512 :
e = ( " QTVSV 1 \n "
" AUTH: SHA2_512 \n "
" CHALLENGE: " ) ;
goto hashedpassword ;
2020-02-11 18:06:10 +00:00
hashedpassword :
{
char tmp [ 32 ] ;
Sys_RandomBytes ( tmp , sizeof ( tmp ) ) ;
tobase64 ( p - > challenge , sizeof ( p - > challenge ) , tmp , sizeof ( tmp ) ) ;
2017-06-21 01:24:25 +00:00
}
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
VFS_WRITE ( clientstream , e , strlen ( e ) ) ;
VFS_WRITE ( clientstream , p - > challenge , strlen ( p - > challenge ) ) ;
e = " \n \n " ;
VFS_WRITE ( clientstream , e , strlen ( e ) ) ;
return QTV_RETRY ;
2020-02-11 18:06:10 +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
default :
e = ( " QTVSV 1 \n "
2020-02-11 18:06:10 +00:00
" PERROR: server bug detected. \n \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
break ;
}
}
2020-02-11 18:06:10 +00:00
if ( * qtv_maxstreams . string & & ! p - > isreverse )
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
{
int count = 0 ;
mvddest_t * dest ;
for ( dest = demo . dest ; dest ; dest = dest - > nextdest )
{
if ( dest - > desttype = = DEST_STREAM )
count + + ;
}
if ( count > = qtv_maxstreams . value ) //sorry
{
if ( ! qtv_maxstreams . value )
e = " QTVSV 1 \n TERROR: QTV streaming from this server is blocked by qtv_maxstreams. \n \n " ;
else
e = " QTVSV 1 \n TERROR: This server enforces a limit on the number of proxies connected at any one time. Please try again later. \n \n " ;
}
}
if ( e )
{
}
else if ( ! versiontouse )
{
e = ( " QTVSV 1 \n "
" PERROR: Incompatible version (valid version is v1) \n \n " ) ;
}
else if ( raw )
{
if ( p - > hasauthed = = true )
{
2020-02-26 00:37:52 +00:00
if ( ! SV_MVD_Record ( SV_MVD_InitStream ( clientstream , userinfo ) ) )
return QTV_ERROR ;
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
return QTV_ACCEPT ;
}
}
else
{
if ( p - > hasauthed = = true )
{
mvddest_t * dst ;
e = ( " QTVSV 1 \n "
" BEGIN \n "
" \n " ) ;
VFS_WRITE ( clientstream , e , strlen ( e ) ) ;
e = NULL ;
2019-05-10 09:31:21 +00:00
dst = SV_MVD_InitStream ( clientstream , userinfo ) ;
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
dst - > droponmapchange = p - > isreverse ;
2020-02-26 00:37:52 +00:00
if ( ! SV_MVD_Record ( dst ) )
return QTV_ERROR ;
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
return QTV_ACCEPT ;
}
else
{
e = ( " QTVSV 1 \n "
" PERROR: You need to provide a password. \n \n " ) ;
}
}
if ( e & & ! raw ) //don't write any error messages to raw requests. that would confuse stuff.
VFS_WRITE ( clientstream , e , strlen ( e ) ) ;
return QTV_ERROR ;
2006-09-17 00:59:22 +00:00
}
2016-07-12 00:40:13 +00:00
static int DestCloseAllFlush ( enum mvdclosereason_e reason , qboolean mvdonly )
2004-12-10 21:34:42 +00:00
{
2006-11-03 15:53:04 +00:00
int numclosed = 0 ;
2007-01-06 09:35:16 +00:00
mvddest_t * d , * * prev , * next ;
2004-12-10 21:34:42 +00:00
DestFlush ( true ) ; //make sure it's all written.
2006-11-03 15:53:04 +00:00
prev = & demo . dest ;
d = demo . dest ;
while ( d )
2004-12-10 21:34:42 +00:00
{
2007-01-06 09:35:16 +00:00
next = d - > nextdest ;
2007-05-28 02:25:32 +00:00
if ( ! mvdonly | | d - > droponmapchange )
2006-11-03 15:53:04 +00:00
{
* prev = d - > nextdest ;
2016-07-12 00:40:13 +00:00
DestClose ( d , reason ) ;
2006-11-03 15:53:04 +00:00
numclosed + + ;
}
else
2007-01-06 09:35:16 +00:00
prev = & d - > nextdest ;
2004-12-10 21:34:42 +00:00
2007-01-06 09:35:16 +00:00
d = next ;
2004-12-10 21:34:42 +00:00
}
2006-11-03 15:53:04 +00:00
return numclosed ;
2004-12-10 21:34:42 +00:00
}
2016-07-12 00:40:13 +00:00
static int DemoWriteDest ( void * data , int len , mvddest_t * d )
2004-12-10 21:34:42 +00:00
{
if ( d - > error )
return 0 ;
d - > totalsize + = len ;
switch ( d - > desttype )
{
case DEST_FILE :
2009-04-01 22:03:56 +00:00
VFS_WRITE ( d - > file , data , len ) ;
2004-12-10 21:34:42 +00:00
break ;
case DEST_BUFFEREDFILE : //these write to a cache, which is flushed later
2016-07-12 00:40:13 +00:00
case DEST_THREADEDFILE :
2004-12-10 21:34:42 +00:00
case DEST_STREAM :
if ( d - > cacheused + len > d - > maxcachesize )
{
d - > error = true ;
return 0 ;
}
memcpy ( d - > cache + d - > cacheused , data , len ) ;
d - > cacheused + = len ;
break ;
2016-07-12 00:40:13 +00:00
default :
2004-12-10 21:34:42 +00:00
case DEST_NONE :
Sys_Error ( " DemoWriteDest encoundered bad dest. " ) ;
}
return len ;
}
2016-07-12 00:40:13 +00:00
static int DemoWrite ( void * data , int len ) //broadcast to all proxies/mvds
2004-12-10 21:34:42 +00:00
{
mvddest_t * d ;
for ( d = demo . dest ; d ; d = d - > nextdest )
{
if ( singledest & & singledest ! = d )
continue ;
DemoWriteDest ( data , len , d ) ;
}
return len ;
}
2004-08-23 00:15:46 +00:00
2006-09-17 00:59:22 +00:00
void DemoWriteQTVTimePad ( int msecs ) //broadcast to all proxies
{
mvddest_t * d ;
unsigned char buffer [ 6 ] ;
while ( msecs > 0 )
{
//duration
if ( msecs > 255 )
buffer [ 0 ] = 255 ;
else
buffer [ 0 ] = msecs ;
msecs - = buffer [ 0 ] ;
//message type
buffer [ 1 ] = dem_read ;
//length
buffer [ 2 ] = 0 ;
buffer [ 3 ] = 0 ;
buffer [ 4 ] = 0 ;
buffer [ 5 ] = 0 ;
for ( d = demo . dest ; d ; d = d - > nextdest )
{
if ( d - > desttype = = DEST_STREAM )
{
DemoWriteDest ( buffer , sizeof ( buffer ) , d ) ;
}
}
}
}
2004-08-23 00:15:46 +00:00
2011-12-24 04:05:28 +00:00
2004-08-23 00:15:46 +00:00
// returns the file size
// return -1 if file is not present
// the file should be in BINARY mode for stupid OSs that care
# define MAX_MVD_NAME 64
typedef struct
{
char name [ MAX_MVD_NAME ] ;
2018-09-01 04:18:08 +00:00
qofs_t size ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
time_t mtime ;
2018-09-01 04:18:08 +00:00
searchpathfuncs_t * path ;
2004-08-23 00:15:46 +00:00
} file_t ;
typedef struct
{
file_t * files ;
2018-09-01 04:18:08 +00:00
qofs_t size ;
2004-08-23 00:15:46 +00:00
int numfiles ;
int numdirs ;
2008-06-01 22:06:22 +00:00
int maxfiles ;
2004-08-23 00:15:46 +00:00
} dir_t ;
# define SORT_NO 0
# define SORT_BY_DATE 1
2016-07-12 00:40:13 +00:00
static int QDECL Sys_listdirFound ( const char * fname , qofs_t fsize , time_t mtime , void * uptr , searchpathfuncs_t * spath )
2004-08-23 00:15:46 +00:00
{
2009-04-01 22:03:56 +00:00
file_t * f ;
dir_t * dir = uptr ;
fname = COM_SkipPath ( fname ) ;
if ( ! * fname )
2004-08-23 00:15:46 +00:00
{
2009-04-01 22:03:56 +00:00
dir - > numdirs + + ;
return true ;
2004-08-23 00:15:46 +00:00
}
2009-04-01 22:03:56 +00:00
if ( dir - > numfiles = = dir - > maxfiles )
2018-09-01 04:18:08 +00:00
{
int nc = dir - > numfiles + 256 ;
file_t * n = realloc ( dir - > files , nc * sizeof ( * dir - > files ) ) ;
if ( ! n )
return false ;
dir - > files = n ;
dir - > maxfiles = nc ;
}
2009-04-01 22:03:56 +00:00
f = & dir - > files [ dir - > numfiles + + ] ;
Q_strncpyz ( f - > name , fname , sizeof ( f - > name ) ) ;
f - > size = fsize ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
f - > mtime = mtime ;
2018-09-01 04:18:08 +00:00
f - > path = spath ;
2009-04-01 22:03:56 +00:00
dir - > size + = fsize ;
2005-07-03 15:16:20 +00:00
2009-04-01 22:03:56 +00:00
return true ;
2008-06-01 22:06:22 +00:00
}
2017-04-18 11:12:17 +00:00
static int QDECL Sys_listdir_Sort ( const void * va , const void * vb )
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
{
const file_t * fa = va ;
const file_t * fb = vb ;
if ( fa - > mtime = = fb - > mtime )
return 0 ;
if ( fa - > mtime > = fb - > mtime )
return 1 ;
return - 1 ;
}
2018-09-01 04:18:08 +00:00
static dir_t * Sys_listdemos ( char * path , int ispublic , qboolean usesorting )
2004-08-23 00:15:46 +00:00
{
2018-09-01 04:18:08 +00:00
const char * exts [ ] = {
" .mvd " , " .mvd.gz " ,
" .qwz " , " .qwz.gz " ,
# ifdef NQPROT
" .dem " , " .dem.gz " ,
# endif
# if defined(Q2SERVER) || defined(Q2CLIENT)
" .dm2 " , " .dm2.gz "
# endif
} ;
2009-04-01 22:03:56 +00:00
char searchterm [ MAX_QPATH ] ;
2018-09-01 04:18:08 +00:00
size_t i ;
2011-05-19 13:34:07 +00:00
2018-09-01 04:18:08 +00:00
dir_t * dir = malloc ( sizeof ( * dir ) ) ;
2009-04-01 22:03:56 +00:00
memset ( dir , 0 , sizeof ( * dir ) ) ;
2018-09-01 04:18:08 +00:00
dir - > files = NULL ;
dir - > maxfiles = 0 ;
2004-08-23 00:15:46 +00:00
2018-09-01 04:18:08 +00:00
for ( i = 0 ; i < ( ispublic ? 2 : countof ( exts ) ) ; i + + )
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
{
2018-09-01 04:18:08 +00:00
Q_strncpyz ( searchterm , va ( " %s/*%s " , path , exts [ i ] ) , sizeof ( searchterm ) ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
COM_EnumerateFiles ( searchterm , Sys_listdirFound , dir ) ;
}
if ( usesorting )
qsort ( dir - > files , dir - > numfiles , sizeof ( * dir - > files ) , Sys_listdir_Sort ) ;
2009-04-01 22:03:56 +00:00
return dir ;
2004-08-23 00:15:46 +00:00
}
2016-07-12 00:40:13 +00:00
static void Sys_freedir ( dir_t * dir )
2008-06-01 22:06:22 +00:00
{
2018-09-01 04:18:08 +00:00
if ( dir )
free ( dir - > files ) ;
2008-06-01 22:06:22 +00:00
free ( dir ) ;
}
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
// only one .. is allowed (so we can get to the same dir as the quake exe)
2015-04-21 04:12:00 +00:00
static void QDECL SV_DemoDir_Callback ( struct cvar_s * var , char * oldvalue )
2004-08-23 00:15:46 +00:00
{
2004-12-10 21:34:42 +00:00
char * value ;
2007-09-01 01:51:34 +00:00
value = var - > string ;
if ( ! value [ 0 ] | | value [ 0 ] = = ' / ' | | ( value [ 0 ] = = ' \\ ' & & value [ 1 ] = = ' \\ ' ) )
2004-12-10 21:34:42 +00:00
{
2019-04-01 10:16:36 +00:00
Cvar_ForceSet ( var , var - > enginevalue ) ;
2004-12-10 21:34:42 +00:00
return ;
}
2004-08-23 00:15:46 +00:00
if ( value [ 0 ] = = ' . ' & & value [ 1 ] = = ' . ' )
value + = 2 ;
2004-12-10 21:34:42 +00:00
if ( strstr ( value , " .. " ) )
{
2019-04-01 10:16:36 +00:00
Cvar_ForceSet ( var , var - > enginevalue ) ;
2007-09-01 01:51:34 +00:00
return ;
2004-12-10 21:34:42 +00:00
}
2004-08-23 00:15:46 +00:00
}
void SV_MVDPings ( void )
{
2012-08-04 01:35:52 +00:00
sizebuf_t * msg ;
2004-08-23 00:15:46 +00:00
client_t * client ;
int j ;
2014-12-02 02:00:41 +00:00
for ( j = 0 , client = svs . clients ; j < demo . recorder . max_net_clients & & j < svs . allocated_client_slots ; j + + , client + + )
2004-08-23 00:15:46 +00:00
{
if ( client - > state ! = cs_spawned )
continue ;
2012-08-04 01:35:52 +00:00
msg = MVDWrite_Begin ( dem_all , 0 , 7 ) ;
MSG_WriteByte ( msg , svc_updateping ) ;
MSG_WriteByte ( msg , j ) ;
MSG_WriteShort ( msg , SV_CalcPing ( client , false ) ) ;
MSG_WriteByte ( msg , svc_updatepl ) ;
MSG_WriteByte ( msg , j ) ;
MSG_WriteByte ( msg , client - > lossage ) ;
2004-08-23 00:15:46 +00:00
}
}
2011-06-05 01:36:14 +00:00
void SV_MVD_FullClientUpdate ( sizebuf_t * msg , client_t * player )
{
2013-07-13 12:14:32 +00:00
char info [ EXTENDED_INFO_STRING ] ;
2011-06-05 01:36:14 +00:00
qboolean dosizes ;
2012-08-04 01:35:52 +00:00
2011-06-05 01:36:14 +00:00
if ( ! sv . mvdrecording )
return ;
2012-08-04 01:35:52 +00:00
dosizes = ! msg ;
2011-06-05 01:36:14 +00:00
if ( dosizes )
2012-08-04 01:35:52 +00:00
msg = MVDWrite_Begin ( dem_all , 0 , 4 ) ;
2011-06-05 01:36:14 +00:00
MSG_WriteByte ( msg , svc_updatefrags ) ;
MSG_WriteByte ( msg , player - svs . clients ) ;
MSG_WriteShort ( msg , player - > old_frags ) ;
if ( dosizes )
2012-08-04 01:35:52 +00:00
msg = MVDWrite_Begin ( dem_all , 0 , 4 ) ;
2011-06-05 01:36:14 +00:00
MSG_WriteByte ( msg , svc_updateping ) ;
MSG_WriteByte ( msg , player - svs . clients ) ;
2015-10-27 15:20:15 +00:00
MSG_WriteShort ( msg , SV_CalcPing ( player , false ) & 0xffff ) ;
2011-06-05 01:36:14 +00:00
if ( dosizes )
2012-08-04 01:35:52 +00:00
msg = MVDWrite_Begin ( dem_all , 0 , 3 ) ;
2011-06-05 01:36:14 +00:00
MSG_WriteByte ( msg , svc_updatepl ) ;
MSG_WriteByte ( msg , player - svs . clients ) ;
MSG_WriteByte ( msg , player - > lossage ) ;
if ( dosizes )
2012-08-04 01:35:52 +00:00
msg = MVDWrite_Begin ( dem_all , 0 , 6 ) ;
2011-06-05 01:36:14 +00:00
MSG_WriteByte ( msg , svc_updateentertime ) ;
MSG_WriteByte ( msg , player - svs . clients ) ;
MSG_WriteFloat ( msg , realtime - player - > connection_started ) ;
2018-07-05 16:21:44 +00:00
InfoBuf_ToString ( & player - > userinfo , info , sizeof ( info ) , basicuserinfos , privateuserinfos , NULL , & demo . recorder . infosync , player ) ;
2011-06-05 01:36:14 +00:00
if ( dosizes )
2012-08-04 01:35:52 +00:00
msg = MVDWrite_Begin ( dem_all , 0 , 7 + strlen ( info ) ) ;
2011-06-05 01:36:14 +00:00
MSG_WriteByte ( msg , svc_updateuserinfo ) ;
MSG_WriteByte ( msg , player - svs . clients ) ;
MSG_WriteLong ( msg , player - > userid ) ;
MSG_WriteString ( msg , info ) ;
}
2004-08-23 00:15:46 +00:00
2012-08-04 01:35:52 +00:00
sizebuf_t * MVDWrite_Begin ( qbyte type , int to , int size )
2004-08-23 00:15:46 +00:00
{
2016-09-08 19:04:35 +00:00
if ( demomsg . cursize & & ( demomsgtype ! = type | | demomsgto ! = to | | demomsg . cursize + size > sizeof ( demomsgbuf ) ) )
2016-07-12 00:40:13 +00:00
{
2012-08-04 01:35:52 +00:00
SV_WriteMVDMessage ( & demomsg , demomsgtype , demomsgto , demo_prevtime ) ;
2016-07-12 00:40:13 +00:00
demomsg . cursize = 0 ;
}
2004-08-23 00:15:46 +00:00
2012-08-04 01:35:52 +00:00
demomsgtype = type ;
demomsgto = to ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
demomsg . maxsize = demomsg . cursize + size ;
2012-08-04 01:35:52 +00:00
demomsg . data = demomsgbuf ;
2016-07-12 00:40:13 +00:00
demomsg . prim = demo . recorder . netchan . netprim ;
2012-08-04 01:35:52 +00:00
return & demomsg ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = =
SV_WriteMVDMessage
2012-08-04 01:35:52 +00:00
Dumps the current net message , along with framing
2004-08-23 00:15:46 +00:00
= = = = = = = = = = = = = = = = = = = =
*/
void SV_WriteMVDMessage ( sizebuf_t * msg , int type , int to , float time )
{
int len , i , msec ;
qbyte c ;
if ( ! sv . mvdrecording )
return ;
2016-09-08 19:04:35 +00:00
if ( msg - > overflowed )
{
msg - > overflowed = false ;
Con_Printf ( " SV_WriteMVDMessage: message overflowed \n " ) ;
return ;
}
2012-08-04 01:35:52 +00:00
msec = ( time - demo_prevtime ) * 1000 ;
if ( abs ( msec ) > 1000 )
{
//catastoptic slip. debugging? reset any sync
2016-09-08 19:04:35 +00:00
msec = 1 ;
2012-08-04 01:35:52 +00:00
demo_prevtime = time ;
}
2016-09-08 19:04:35 +00:00
else if ( msec > 0 )
{ //if there was any progress, make sure we write msecs >0
if ( msec > 255 )
msec = 255 ;
if ( msec < 1 )
msec = 1 ;
2012-08-04 01:35:52 +00:00
demo_prevtime + = msec * 0.001 ;
}
2016-09-08 19:04:35 +00:00
else
msec = 0 ;
2004-08-23 00:15:46 +00:00
c = msec ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & c , sizeof ( c ) ) ;
2004-08-23 00:15:46 +00:00
if ( demo . lasttype ! = type | | demo . lastto ! = to )
{
demo . lasttype = type ;
demo . lastto = to ;
switch ( demo . lasttype )
{
case dem_all :
c = dem_all ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & c , sizeof ( c ) ) ;
2004-08-23 00:15:46 +00:00
break ;
case dem_multiple :
c = dem_multiple ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & c , sizeof ( c ) ) ;
2004-08-23 00:15:46 +00:00
i = LittleLong ( demo . lastto ) ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & i , sizeof ( i ) ) ;
2004-08-23 00:15:46 +00:00
break ;
case dem_single :
case dem_stats :
c = demo . lasttype + ( demo . lastto < < 3 ) ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & c , sizeof ( c ) ) ;
2004-08-23 00:15:46 +00:00
break ;
default :
SV_MVDStop_f ( ) ;
Con_Printf ( " bad demo message type:%d " , type ) ;
return ;
}
} else {
c = dem_read ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & c , sizeof ( c ) ) ;
2004-08-23 00:15:46 +00:00
}
len = LittleLong ( msg - > cursize ) ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & len , 4 ) ;
DemoWrite ( msg - > data , msg - > cursize ) ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
DestFlush ( false ) ;
2004-08-23 00:15:46 +00:00
}
2013-09-06 22:57:44 +00:00
//if you use ClientReliable to write to demo.recorder's message buffer (for code reuse) call this function to ensure its flushed.
2016-09-08 19:04:35 +00:00
void SV_MVD_WriteReliables ( qboolean writebroadcasts )
2013-07-14 16:39:21 +00:00
{
int i ;
2015-11-18 07:37:39 +00:00
2016-09-08 19:04:35 +00:00
if ( writebroadcasts )
{
//chuck in the broadcast reliables
2017-06-26 09:31:02 +00:00
if ( sv . reliable_datagram . cursize )
{
ClientReliableCheckBlock ( & demo . recorder , sv . reliable_datagram . cursize ) ;
ClientReliableWrite_SZ ( & demo . recorder , sv . reliable_datagram . data , sv . reliable_datagram . cursize ) ;
}
2016-09-08 19:04:35 +00:00
//and the broadcast unreliables. everything is reliables when it comes to mvds
2017-06-26 09:31:02 +00:00
if ( sv . datagram . cursize )
{
ClientReliableCheckBlock ( & demo . recorder , sv . datagram . cursize ) ;
ClientReliableWrite_SZ ( & demo . recorder , sv . datagram . data , sv . datagram . cursize ) ;
}
2016-09-08 19:04:35 +00:00
}
2015-11-18 07:37:39 +00:00
2013-07-14 16:39:21 +00:00
if ( demo . recorder . netchan . message . cursize )
{
2016-09-08 19:04:35 +00:00
SV_WriteMVDMessage ( & demo . recorder . netchan . message , dem_all , 0 , demo_prevtime ) ;
2013-07-14 16:39:21 +00:00
demo . recorder . netchan . message . cursize = 0 ;
}
for ( i = 0 ; i < demo . recorder . num_backbuf ; i + + )
{
demo . recorder . backbuf . data = demo . recorder . backbuf_data [ i ] ;
demo . recorder . backbuf . cursize = demo . recorder . backbuf_size [ i ] ;
2015-11-18 07:37:39 +00:00
if ( demo . recorder . backbuf . cursize )
2016-09-08 19:04:35 +00:00
SV_WriteMVDMessage ( & demo . recorder . backbuf , dem_all , 0 , demo_prevtime ) ;
2013-07-14 16:39:21 +00:00
demo . recorder . backbuf_size [ i ] = 0 ;
}
2013-10-19 10:28:06 +00:00
demo . recorder . num_backbuf = 0 ;
2013-07-14 16:39:21 +00:00
demo . recorder . backbuf . cursize = 0 ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = =
SV_MVDWritePackets
Interpolates to get exact players position for current frame
and writes packets to the disk / memory
= = = = = = = = = = = = = = = = = = = =
*/
float adjustangle ( float current , float ideal , float fraction )
{
float move ;
move = ideal - current ;
if ( ideal > current )
{
if ( move > = 180 )
move = move - 360 ;
}
else
{
if ( move < = - 180 )
move = move + 360 ;
}
move * = fraction ;
return ( current + move ) ;
}
2007-09-10 14:39:08 +00:00
qboolean SV_MVDWritePackets ( int num )
2004-08-23 00:15:46 +00:00
{
demo_frame_t * frame , * nextframe ;
demo_client_t * cl , * nextcl = NULL ;
int i , j , flags ;
qboolean valid ;
double time , playertime , nexttime ;
float f ;
vec3_t origin , angles ;
sizebuf_t msg ;
qbyte msg_buf [ MAX_QWMSGLEN ] ;
demoinfo_t * demoinfo ;
if ( ! sv . mvdrecording )
2007-09-10 14:39:08 +00:00
return false ;
2018-10-27 16:59:41 +00:00
if ( demo . recorder . fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
return false ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
//flush any intermediate data
MVDWrite_Begin ( 255 , - 1 , 0 ) ;
2016-09-08 19:04:35 +00:00
msg . allowoverflow = true ; //fixme
msg . overflowed = false ;
2010-11-20 22:01:16 +00:00
msg . prim = svs . netprim ;
2004-08-23 00:15:46 +00:00
msg . data = msg_buf ;
msg . maxsize = sizeof ( msg_buf ) ;
if ( num > demo . parsecount - demo . lastwritten + 1 )
num = demo . parsecount - demo . lastwritten + 1 ;
// 'num' frames to write
for ( ; num ; num - - , demo . lastwritten + + )
{
frame = & demo . frames [ demo . lastwritten & DEMO_FRAMES_MASK ] ;
time = frame - > time ;
nextframe = frame ;
msg . cursize = 0 ;
// find two frames
// one before the exact time (time - msec) and one after,
// then we can interpolte exact position for current frame
2013-07-14 16:39:21 +00:00
for ( i = 0 , cl = frame - > clients , demoinfo = demo . info ; i < demo . recorder . max_net_clients ; i + + , cl + + , demoinfo + + )
2004-08-23 00:15:46 +00:00
{
if ( cl - > parsecount ! = demo . lastwritten )
continue ; // not valid
nexttime = playertime = time - cl - > sec ;
for ( j = demo . lastwritten + 1 , valid = false ; nexttime < time & & j < demo . parsecount ; j + + )
{
nextframe = & demo . frames [ j & DEMO_FRAMES_MASK ] ;
nextcl = & nextframe - > clients [ i ] ;
if ( nextcl - > parsecount ! = j )
break ; // disconnected?
if ( nextcl - > fixangle )
break ; // respawned, or walked into teleport, do not interpolate!
if ( ! ( nextcl - > flags & DF_DEAD ) & & ( cl - > flags & DF_DEAD ) )
break ; // respawned, do not interpolate
nexttime = nextframe - > time - nextcl - > sec ;
if ( nexttime > = time )
{
// good, found what we were looking for
valid = true ;
break ;
}
}
if ( valid )
{
f = ( time - nexttime ) / ( nexttime - playertime ) ;
for ( j = 0 ; j < 3 ; j + + ) {
angles [ j ] = adjustangle ( cl - > info . angles [ j ] , nextcl - > info . angles [ j ] , 1.0 + f ) ;
origin [ j ] = nextcl - > info . origin [ j ] + f * ( nextcl - > info . origin [ j ] - cl - > info . origin [ j ] ) ;
}
} else {
VectorCopy ( cl - > info . origin , origin ) ;
VectorCopy ( cl - > info . angles , angles ) ;
}
// now write it to buf
2014-12-02 02:00:41 +00:00
flags = cl - > flags ; //df_dead/df_gib
if ( demo . playerreset [ i ] )
{
demo . playerreset [ i ] = false ;
flags | = DF_RESET ;
}
2004-08-23 00:15:46 +00:00
2010-12-05 02:46:07 +00:00
if ( cl - > fixangle )
{
2004-08-23 00:15:46 +00:00
demo . fixangletime [ i ] = cl - > cmdtime ;
}
for ( j = 0 ; j < 3 ; j + + )
if ( origin [ j ] ! = demoinfo - > origin [ i ] )
2014-12-02 02:00:41 +00:00
flags | = DF_ORIGINX < < j ;
2004-08-23 00:15:46 +00:00
if ( cl - > fixangle | | demo . fixangletime [ i ] ! = cl - > cmdtime )
{
for ( j = 0 ; j < 3 ; j + + )
if ( angles [ j ] ! = demoinfo - > angles [ j ] )
2014-12-02 02:00:41 +00:00
flags | = DF_ANGLEX < < j ;
2004-08-23 00:15:46 +00:00
}
if ( cl - > info . model ! = demoinfo - > model )
flags | = DF_MODEL ;
if ( cl - > info . effects ! = demoinfo - > effects )
flags | = DF_EFFECTS ;
if ( cl - > info . skinnum ! = demoinfo - > skinnum )
flags | = DF_SKINNUM ;
if ( cl - > info . weaponframe ! = demoinfo - > weaponframe )
flags | = DF_WEAPONFRAME ;
MSG_WriteByte ( & msg , svc_playerinfo ) ;
MSG_WriteByte ( & msg , i ) ;
MSG_WriteShort ( & msg , flags ) ;
MSG_WriteByte ( & msg , cl - > frame ) ;
for ( j = 0 ; j < 3 ; j + + )
2014-12-02 02:00:41 +00:00
if ( flags & ( DF_ORIGINX < < j ) )
2004-08-23 00:15:46 +00:00
MSG_WriteCoord ( & msg , origin [ j ] ) ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
for ( j = 0 ; j < 3 ; j + + )
2014-12-02 02:00:41 +00:00
if ( flags & ( DF_ANGLEX < < j ) )
2004-08-23 00:15:46 +00:00
MSG_WriteAngle16 ( & msg , angles [ j ] ) ;
if ( flags & DF_MODEL )
MSG_WriteByte ( & msg , cl - > info . model ) ;
if ( flags & DF_SKINNUM )
MSG_WriteByte ( & msg , cl - > info . skinnum ) ;
if ( flags & DF_EFFECTS )
2015-10-27 15:20:15 +00:00
MSG_WriteByte ( & msg , cl - > info . effects & 0xff ) ;
2004-08-23 00:15:46 +00:00
if ( flags & DF_WEAPONFRAME )
MSG_WriteByte ( & msg , cl - > info . weaponframe ) ;
VectorCopy ( cl - > info . origin , demoinfo - > origin ) ;
VectorCopy ( cl - > info . angles , demoinfo - > angles ) ;
demoinfo - > skinnum = cl - > info . skinnum ;
demoinfo - > effects = cl - > info . effects ;
demoinfo - > weaponframe = cl - > info . weaponframe ;
demoinfo - > model = cl - > info . model ;
}
if ( msg . cursize )
SV_WriteMVDMessage ( & msg , dem_all , 0 , ( float ) time ) ;
2007-09-10 14:39:08 +00:00
/* The above functions can set this variable to false, but that's a really bad thing. Let's try to fix it. */
if ( ! sv . mvdrecording )
return false ;
2004-08-23 00:15:46 +00:00
}
if ( demo . lastwritten > demo . parsecount )
demo . lastwritten = demo . parsecount ;
2007-09-10 14:39:08 +00:00
return true ;
2004-08-23 00:15:46 +00:00
}
void MVD_Init ( void )
{
# define MVDVARGROUP "Server MVD cvars"
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
Cvar_Register ( & sv_demofps , MVDVARGROUP ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & sv_demoPings , MVDVARGROUP ) ;
Cvar_Register ( & sv_demoUseCache , MVDVARGROUP ) ;
Cvar_Register ( & sv_demoCacheSize , MVDVARGROUP ) ;
Cvar_Register ( & sv_demoMaxSize , MVDVARGROUP ) ;
Cvar_Register ( & sv_demoMaxDirSize , MVDVARGROUP ) ;
2018-09-01 04:18:08 +00:00
Cvar_Register ( & sv_demoMaxDirCount , MVDVARGROUP ) ;
Cvar_Register ( & sv_demoMaxDirAge , MVDVARGROUP ) ;
Cvar_Register ( & sv_demoClearOld , MVDVARGROUP ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
Cvar_Register ( & sv_demoDir , MVDVARGROUP ) ;
2019-03-23 07:06:37 +00:00
Cvar_Register ( & sv_demoDirAlt , MVDVARGROUP ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & sv_demoPrefix , MVDVARGROUP ) ;
Cvar_Register ( & sv_demoSuffix , MVDVARGROUP ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
Cvar_Register ( & sv_demotxt , MVDVARGROUP ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & sv_demoExtraNames , MVDVARGROUP ) ;
2011-08-16 04:12:15 +00:00
Cvar_Register ( & sv_demoExtensions , MVDVARGROUP ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
Cvar_Register ( & sv_demoAutoCompress , MVDVARGROUP ) ;
2018-09-01 04:18:08 +00:00
Cvar_Register ( & sv_demoAutoRecord , MVDVARGROUP ) ;
Cvar_Register ( & sv_demoAutoPrefix , MVDVARGROUP ) ;
2017-11-16 22:20:40 +00:00
Cvar_Register ( & sv_demo_write_csqc , MVDVARGROUP ) ;
2004-12-10 21:34:42 +00:00
}
static char * SV_PrintTeams ( void )
{
char * teams [ MAX_CLIENTS ] ;
// char *p;
int i , j , numcl = 0 , numt = 0 ;
client_t * clients [ MAX_CLIENTS ] ;
char buf [ 2048 ] = { 0 } ;
extern cvar_t teamplay ;
// extern char chartbl2[];
// count teams and players
2013-06-23 02:17:02 +00:00
for ( i = 0 ; i < sv . allocated_client_slots ; i + + )
2004-08-23 00:15:46 +00:00
{
2004-12-10 21:34:42 +00:00
if ( svs . clients [ i ] . state ! = cs_spawned )
continue ;
if ( svs . clients [ i ] . spectator )
continue ;
clients [ numcl + + ] = & svs . clients [ i ] ;
for ( j = 0 ; j < numt ; j + + )
2018-07-05 16:21:44 +00:00
if ( ! strcmp ( InfoBuf_ValueForKey ( & svs . clients [ i ] . userinfo , " team " ) , teams [ j ] ) )
2004-12-10 21:34:42 +00:00
break ;
if ( j ! = numt )
continue ;
2018-07-05 16:21:44 +00:00
teams [ numt + + ] = InfoBuf_ValueForKey ( & svs . clients [ i ] . userinfo , " team " ) ;
2004-08-23 00:15:46 +00:00
}
2004-12-10 21:34:42 +00:00
// create output
2005-07-03 15:16:20 +00:00
2004-12-10 21:34:42 +00:00
if ( numcl = = 2 ) // duel
2004-08-23 00:15:46 +00:00
{
2006-03-06 01:41:09 +00:00
snprintf ( buf , sizeof ( buf ) , " team1 %s \n team2 %s \n " , clients [ 0 ] - > name , clients [ 1 ] - > name ) ;
2005-07-03 15:16:20 +00:00
}
2004-12-10 21:34:42 +00:00
else if ( ! teamplay . value ) // ffa
2005-07-03 15:16:20 +00:00
{
2006-03-06 01:41:09 +00:00
snprintf ( buf , sizeof ( buf ) , " players: \n " ) ;
2004-12-10 21:34:42 +00:00
for ( i = 0 ; i < numcl ; i + + )
2006-03-06 01:41:09 +00:00
snprintf ( buf + strlen ( buf ) , sizeof ( buf ) - strlen ( buf ) , " %s \n " , clients [ i ] - > name ) ;
2005-07-03 15:16:20 +00:00
}
else
2004-12-10 21:34:42 +00:00
{ // teamplay
2005-07-03 15:16:20 +00:00
for ( j = 0 ; j < numt ; j + + )
2004-12-10 21:34:42 +00:00
{
2006-03-06 01:41:09 +00:00
snprintf ( buf + strlen ( buf ) , sizeof ( buf ) - strlen ( buf ) , " team %s: \n " , teams [ j ] ) ;
2004-12-10 21:34:42 +00:00
for ( i = 0 ; i < numcl ; i + + )
2018-07-05 16:21:44 +00:00
if ( ! strcmp ( InfoBuf_ValueForKey ( & clients [ i ] - > userinfo , " team " ) , teams [ j ] ) )
2006-03-06 01:41:09 +00:00
snprintf ( buf + strlen ( buf ) , sizeof ( buf ) - strlen ( buf ) , " %s \n " , clients [ i ] - > name ) ;
2004-12-10 21:34:42 +00:00
}
2004-08-23 00:15:46 +00:00
}
2004-12-10 21:34:42 +00:00
if ( ! numcl )
return " \n " ;
// for (p = buf; *p; p++) *p = chartbl2[(qbyte)*p];
return va ( " %s " , buf ) ;
2004-08-23 00:15:46 +00:00
}
2013-03-12 22:44:00 +00:00
mvddest_t * SV_FindRecordFile ( char * match , mvddest_t * * * link_out )
{
mvddest_t * * link , * f ;
for ( link = & demo . dest ; * link ; link = & ( * link ) - > nextdest )
{
f = * link ;
2016-07-12 00:40:13 +00:00
if ( f - > desttype = = DEST_FILE | | f - > desttype = = DEST_BUFFEREDFILE | | f - > desttype = = DEST_THREADEDFILE )
2013-03-12 22:44:00 +00:00
{
2017-02-19 00:15:42 +00:00
if ( ! match | | ! strcmp ( match , f - > simplename ) )
2013-03-12 22:44:00 +00:00
{
if ( link_out )
* link_out = link ;
return f ;
}
}
}
return NULL ;
}
2018-09-01 04:18:08 +00:00
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = =
SV_InitRecord
= = = = = = = = = = = = = = = = = = = =
*/
2016-07-12 00:40:13 +00:00
mvddest_t * SV_MVD_InitRecordFile ( char * name )
2004-08-23 00:15:46 +00:00
{
2018-09-01 04:18:08 +00:00
char * s , * txtname ;
2004-12-10 21:34:42 +00:00
mvddest_t * dst ;
2009-04-01 22:03:56 +00:00
vfsfile_t * file ;
2004-12-10 21:34:42 +00:00
2017-02-19 00:15:42 +00:00
if ( strlen ( name ) > = countof ( dst - > filename ) )
{
Con_Printf ( " ERROR: couldn't open \" %s \" . Too long. \n " , name ) ;
return NULL ;
}
2009-04-01 22:03:56 +00:00
file = FS_OpenVFS ( name , " wb " , FS_GAMEONLY ) ;
2004-12-10 21:34:42 +00:00
if ( ! file )
{
Con_Printf ( " ERROR: couldn't open \" %s \" \n " , name ) ;
return NULL ;
}
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
# ifdef AVAIL_GZDEC
2018-09-01 04:18:08 +00:00
if ( ! Q_strcasecmp ( " .gz " , COM_GetFileExtension ( name , NULL ) ) )
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
file = FS_GZ_WriteFilter ( file , true , true ) ;
# endif
2004-12-10 21:34:42 +00:00
dst = Z_Malloc ( sizeof ( mvddest_t ) ) ;
2017-02-19 00:15:42 +00:00
strcpy ( dst - > filename , name ) ;
2004-12-10 21:34:42 +00:00
2016-07-12 00:40:13 +00:00
# ifdef LOADERTHREAD
if ( ! * sv_demoUseCache . string )
dst - > desttype = DEST_THREADEDFILE ;
else
# endif
if ( sv_demoUseCache . value < = 0 )
dst - > desttype = DEST_FILE ;
else
dst - > desttype = DEST_BUFFEREDFILE ;
if ( dst - > desttype = = DEST_FILE )
2004-08-23 00:15:46 +00:00
{
2004-12-10 21:34:42 +00:00
dst - > desttype = DEST_FILE ;
dst - > file = file ;
dst - > maxcachesize = 0 ;
}
2005-07-03 15:16:20 +00:00
else
2016-07-12 00:40:13 +00:00
{ //cached or threaded
2004-12-10 21:34:42 +00:00
dst - > file = file ;
2011-08-16 04:12:15 +00:00
if ( sv_demoCacheSize . ival < 0x8000 )
dst - > maxcachesize = 0x8000 ;
else
dst - > maxcachesize = sv_demoCacheSize . ival ;
2004-12-10 21:34:42 +00:00
dst - > cache = BZ_Malloc ( dst - > maxcachesize ) ;
2016-07-12 00:40:13 +00:00
if ( dst - > desttype = = DEST_THREADEDFILE )
dst - > altcache = BZ_Malloc ( dst - > maxcachesize ) ;
else
dst - > altcache = NULL ;
2004-08-23 00:15:46 +00:00
}
2007-05-28 02:25:32 +00:00
dst - > droponmapchange = true ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
s = name + strlen ( name ) ;
while ( * s ! = ' / ' ) s - - ;
2017-02-19 00:15:42 +00:00
Q_strncpyz ( dst - > simplename , s + 1 , sizeof ( dst - > simplename ) ) ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
switch ( dst - > desttype )
{
default :
case DEST_NONE :
SV_BroadcastPrintf ( PRINT_CHAT , " Server starts recording (%s): \n %s \n " , " ERROR " , name ) ;
break ;
case DEST_STREAM :
SV_BroadcastPrintf ( PRINT_CHAT , " Server starts recording (%s): \n %s \n " , " ERROR: STREAM " , name ) ;
break ;
case DEST_BUFFEREDFILE :
SV_BroadcastPrintf ( PRINT_CHAT , " Server starts recording (%s): \n %s \n " , " memory " , name ) ;
break ;
case DEST_THREADEDFILE :
2018-09-01 04:18:08 +00:00
//SV_BroadcastPrintf (PRINT_CHAT, "Server starts recording (%s):\n%s\n", "worker thread", name);
SV_BroadcastPrintf ( PRINT_CHAT , " Server starts recording: \n %s \n " , name ) ;
2016-07-12 00:40:13 +00:00
break ;
case DEST_FILE :
SV_BroadcastPrintf ( PRINT_CHAT , " Server starts recording (%s): \n %s \n " , " disk " , name ) ;
break ;
}
2004-12-10 21:34:42 +00:00
2018-09-01 04:18:08 +00:00
txtname = SV_MVDName2Txt ( name ) ;
2004-12-10 21:34:42 +00:00
if ( sv_demotxt . value )
2004-12-08 04:14:52 +00:00
{
2009-04-01 22:03:56 +00:00
vfsfile_t * f ;
2004-12-10 21:34:42 +00:00
2018-09-01 04:18:08 +00:00
if ( sv_demotxt . value = = 2 )
2004-12-10 21:34:42 +00:00
{
2018-09-01 04:18:08 +00:00
//this is a special mode for mods that want to write it instead (done via the sv_demoinfoadd command).
f = FS_OpenVFS ( txtname , " wt " , FS_GAMEONLY ) ;
if ( f )
VFS_CLOSE ( f ) ;
}
else
{
f = FS_OpenVFS ( txtname , " wt " , FS_GAMEONLY ) ;
if ( f ! = NULL )
{
char buf [ 2000 ] ;
date_t date ;
2004-12-10 21:34:42 +00:00
2018-09-01 04:18:08 +00:00
COM_TimeOfDay ( & date ) ;
2004-12-10 21:34:42 +00:00
2018-09-01 04:18:08 +00:00
snprintf ( buf , sizeof ( buf ) , " date %s \n map %s \n teamplay %d \n deathmatch %d \n timelimit %d \n %s " , date . str , svs . name , ( int ) teamplay . value , ( int ) deathmatch . value , ( int ) timelimit . value , SV_PrintTeams ( ) ) ;
VFS_WRITE ( f , buf , strlen ( buf ) ) ;
VFS_FLUSH ( f ) ;
VFS_CLOSE ( f ) ;
}
2004-12-10 21:34:42 +00:00
}
2004-12-08 04:14:52 +00:00
}
2005-07-03 15:16:20 +00:00
else
2012-05-09 15:30:53 +00:00
{
2018-09-01 04:18:08 +00:00
FS_Remove ( txtname , FS_GAMEONLY ) ;
FS_FlushFSHashRemoved ( txtname ) ;
2012-05-09 15:30:53 +00:00
}
2004-12-08 04:14:52 +00:00
2004-12-10 21:34:42 +00:00
return dst ;
}
2011-09-03 03:49:43 +00:00
char * SV_Demo_CurrentOutput ( void )
{
mvddest_t * d ;
for ( d = demo . dest ; d ; d = d - > nextdest )
{
2016-07-12 00:40:13 +00:00
if ( d - > desttype = = DEST_FILE | | d - > desttype = = DEST_BUFFEREDFILE | | d - > desttype = = DEST_THREADEDFILE )
2017-02-19 00:15:42 +00:00
return d - > simplename ;
2011-09-03 03:49:43 +00:00
}
2019-06-05 20:48:06 +00:00
return " " ;
2011-09-03 03:49:43 +00:00
}
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
void SV_Demo_PrintOutputs ( void )
{
mvddest_t * d ;
for ( d = demo . dest ; d ; d = d - > nextdest )
{
if ( d - > desttype = = DEST_FILE | | d - > desttype = = DEST_BUFFEREDFILE | | d - > desttype = = DEST_THREADEDFILE )
Con_Printf ( " recording : %s \n " , d - > simplename ) ;
else if ( d - > desttype = = DEST_STREAM )
Con_Printf ( " streaming : %s \n " , d - > simplename ) ;
}
}
2011-09-03 03:49:43 +00:00
2019-05-10 09:31:21 +00:00
static mvddest_t * SV_MVD_InitStream ( vfsfile_t * stream , const char * info )
2004-12-10 21:34:42 +00:00
{
mvddest_t * dst ;
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
for ( dst = demo . dest ; dst ; dst = dst - > nextdest )
{
if ( dst - > desttype = = DEST_STREAM )
break ;
}
if ( ! dst )
SV_BroadcastPrintf ( PRINT_CHAT , " Smile, you're on QTV! \n " ) ;
2004-12-10 21:34:42 +00:00
dst = Z_Malloc ( sizeof ( mvddest_t ) ) ;
dst - > desttype = DEST_STREAM ;
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
dst - > file = stream ;
2005-09-06 01:19:26 +00:00
dst - > maxcachesize = 0x8000 ; //is this too small?
2004-12-10 21:34:42 +00:00
dst - > cache = BZ_Malloc ( dst - > maxcachesize ) ;
2007-05-28 02:25:32 +00:00
dst - > droponmapchange = false ;
2019-05-10 09:31:21 +00:00
* dst - > filename = 0 ;
* dst - > simplename = 0 ;
if ( info )
{
char * s = Info_ValueForKey ( info , " name " ) ;
Q_strncpyz ( dst - > simplename , s , sizeof ( dst - > simplename ) ) ;
s = Info_ValueForKey ( info , " streamid " ) ;
Q_strncpyz ( dst - > filename , s , sizeof ( dst - > filename ) ) ;
s = Info_ValueForKey ( info , " address " ) ;
if ( * dst - > filename & & * s )
Q_strncatz ( dst - > filename , " @ " , sizeof ( dst - > filename ) ) ;
Q_strncatz ( dst - > filename , s , sizeof ( dst - > filename ) ) ;
}
2004-12-10 21:34:42 +00:00
2007-05-28 02:25:32 +00:00
return dst ;
2006-09-17 00:59:22 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = =
SV_Stop
stop recording a demo
= = = = = = = = = = = = = = = = = = = =
*/
2016-07-12 00:40:13 +00:00
void SV_MVDStop ( enum mvdclosereason_e reason , qboolean mvdonly )
2004-08-23 00:15:46 +00:00
{
2012-08-04 01:35:52 +00:00
sizebuf_t * msg ;
2004-08-23 00:15:46 +00:00
if ( ! sv . mvdrecording )
{
Con_Printf ( " Not recording a demo. \n " ) ;
return ;
}
2016-07-12 00:40:13 +00:00
if ( reason = = MVD_CLOSE_CANCEL | | reason = = MVD_CLOSE_DISCONNECTED )
2004-08-23 00:15:46 +00:00
{
2016-07-12 00:40:13 +00:00
DestCloseAllFlush ( reason , mvdonly ) ;
2004-08-23 00:15:46 +00:00
// stop and remove
2004-12-10 21:34:42 +00:00
if ( ! demo . dest )
2020-02-26 00:37:52 +00:00
SV_MVD_Stopped ( ) ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
if ( reason = = MVD_CLOSE_DISCONNECTED )
2006-11-03 16:03:15 +00:00
SV_BroadcastPrintf ( PRINT_CHAT , " QTV disconnected \n " ) ;
else
SV_BroadcastPrintf ( PRINT_CHAT , " Server recording canceled, demo removed \n " ) ;
2004-08-23 00:15:46 +00:00
2004-11-29 01:21:00 +00:00
Cvar_ForceSet ( Cvar_Get ( " serverdemo " , " " , CVAR_NOSET , " " ) , " " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2012-08-04 01:35:52 +00:00
// write a disconnect message to the demo file
msg = MVDWrite_Begin ( dem_all , 0 , 2 + strlen ( " EndOfDemo " ) ) ;
MSG_WriteByte ( msg , svc_disconnect ) ;
MSG_WriteString ( msg , " EndOfDemo " ) ;
2004-08-23 00:15:46 +00:00
SV_MVDWritePackets ( demo . parsecount - demo . lastwritten + 1 ) ;
// finish up
2004-11-29 01:21:00 +00:00
2016-07-12 00:40:13 +00:00
DestCloseAllFlush ( reason , mvdonly ) ;
2004-11-29 01:21:00 +00:00
2016-07-12 00:40:13 +00:00
if ( ! demo . dest ) //might still be streaming qtv.
2020-02-26 00:37:52 +00:00
SV_MVD_Stopped ( ) ;
2004-08-23 00:15:46 +00:00
2004-11-29 01:21:00 +00:00
Cvar_ForceSet ( Cvar_Get ( " serverdemo " , " " , CVAR_NOSET , " " ) , " " ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = =
SV_Stop_f
= = = = = = = = = = = = = = = = = = = =
*/
void SV_MVDStop_f ( void )
{
2016-07-12 00:40:13 +00:00
SV_MVDStop ( MVD_CLOSE_STOPPED , true ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = =
SV_Cancel_f
Stops recording , and removes the demo
= = = = = = = = = = = = = = = = = = = =
*/
void SV_MVD_Cancel_f ( void )
{
2016-07-12 00:40:13 +00:00
SV_MVDStop ( MVD_CLOSE_CANCEL , true ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = =
SV_WriteMVDMessage
Dumps the current net message , prefixed by the length and view angles
= = = = = = = = = = = = = = = = = = = =
*/
2012-08-04 01:35:52 +00:00
void SV_WriteRecordMVDMessage ( sizebuf_t * msg )
2004-08-23 00:15:46 +00:00
{
int len ;
qbyte c ;
if ( ! sv . mvdrecording )
return ;
2004-12-10 21:34:42 +00:00
if ( ! msg - > cursize )
return ;
2004-08-23 00:15:46 +00:00
c = 0 ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & c , sizeof ( c ) ) ;
2004-08-23 00:15:46 +00:00
c = dem_read ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & c , sizeof ( c ) ) ;
2004-08-23 00:15:46 +00:00
len = LittleLong ( msg - > cursize ) ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & len , 4 ) ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
DemoWrite ( msg - > data , msg - > cursize ) ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
DestFlush ( false ) ;
2004-08-23 00:15:46 +00:00
}
void SV_WriteSetMVDMessage ( void )
{
int len ;
qbyte c ;
//Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
if ( ! sv . mvdrecording )
return ;
c = 0 ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & c , sizeof ( c ) ) ;
2004-08-23 00:15:46 +00:00
c = dem_set ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & c , sizeof ( c ) ) ;
2004-08-23 00:15:46 +00:00
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
len = LittleLong ( 0 ) ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & len , 4 ) ;
2004-08-23 00:15:46 +00:00
len = LittleLong ( 0 ) ;
2004-12-10 21:34:42 +00:00
DemoWrite ( & len , 4 ) ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
DestFlush ( false ) ;
2004-08-23 00:15:46 +00:00
}
2006-11-03 15:53:04 +00:00
void SV_MVD_SendInitialGamestate ( mvddest_t * dest ) ;
2013-07-26 17:19:06 +00:00
qboolean SV_MVD_Record ( mvddest_t * dest )
2004-08-23 00:15:46 +00:00
{
2019-05-10 09:31:21 +00:00
static int destid ;
2004-12-10 21:34:42 +00:00
if ( ! dest )
return false ;
2004-11-29 01:21:00 +00:00
2019-05-10 09:31:21 +00:00
dest - > id = + + destid ; //give each stream a unique id, for no real reason other than for other people to track it via SVC_Status(|32).
2016-09-08 19:04:35 +00:00
SV_MVD_WriteReliables ( false ) ;
2004-12-10 21:34:42 +00:00
DestFlush ( true ) ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
if ( ! sv . mvdrecording )
2004-08-23 00:15:46 +00:00
{
2004-12-10 21:34:42 +00:00
memset ( & demo , 0 , sizeof ( demo ) ) ;
2005-09-08 01:44:31 +00:00
demo . recorder . protocol = SCP_QUAKEWORLD ;
2010-11-20 22:01:16 +00:00
demo . recorder . netchan . netprim = sv . datagram . prim ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
demo . datagram . maxsize = sizeof ( demo . datagram_data ) ;
demo . datagram . data = demo . datagram_data ;
2010-11-20 22:01:16 +00:00
demo . datagram . prim = demo . recorder . netchan . netprim ;
2011-08-16 04:12:15 +00:00
2022-05-28 17:59:17 +00:00
demo . recorder . netchan . message . maxsize = sizeof ( demo . recorder . netchan . message_buf ) ;
demo . recorder . netchan . message . data = demo . recorder . netchan . message_buf ;
demo . recorder . netchan . message . prim = demo . recorder . netchan . netprim ;
2016-09-08 19:04:35 +00:00
if ( sv_demoExtensions . ival = = 2 | | ! * sv_demoExtensions . string )
2018-08-24 00:35:16 +00:00
{ /*more limited subset supported by ezquake, but not fuhquake/fodquake. sorry.*/
2018-03-31 19:47:03 +00:00
demo . recorder . fteprotocolextensions = /*PEXT_CHUNKEDDOWNLOADS|*/ PEXT_256PACKETENTITIES | /*PEXT_FLOATCOORDS|*/ PEXT_MODELDBL | PEXT_ENTITYDBL | PEXT_ENTITYDBL2 | PEXT_SPAWNSTATIC2 ;
------------------------------------------------------------------------
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
// demo.recorder.fteprotocolextensions |= PEXT_HLBSP; /*ezquake DOES have this, but it is pointless and should have been in some feature mask rather than protocol extensions*/
// demo.recorder.fteprotocolextensions |= PEXT_ACCURATETIMINGS; /*ezquake does not support this any more*/
// demo.recorder.fteprotocolextensions |= PEXT_TRANS; /*ezquake has no support for .alpha*/
2012-08-04 01:35:52 +00:00
demo . recorder . fteprotocolextensions2 = PEXT2_VOICECHAT ;
demo . recorder . zquake_extensions = Z_EXT_PM_TYPE | Z_EXT_PM_TYPE_NEW | Z_EXT_VIEWHEIGHT | Z_EXT_SERVERTIME | Z_EXT_PITCHLIMITS | Z_EXT_JOIN_OBSERVE | Z_EXT_VWEP ;
}
2013-03-12 22:13:26 +00:00
else if ( sv_demoExtensions . ival )
{ /*everything*/
2015-01-21 18:18:37 +00:00
extern cvar_t pext_replacementdeltas ;
2015-09-01 04:45:15 +00:00
demo . recorder . fteprotocolextensions = PEXT_CSQC | PEXT_COLOURMOD | PEXT_DPFLAGS | PEXT_CUSTOMTEMPEFFECTS | PEXT_ENTITYDBL | PEXT_ENTITYDBL2 | PEXT_FATNESS | PEXT_HEXEN2 | PEXT_HULLSIZE | PEXT_LIGHTSTYLECOL | PEXT_MODELDBL | PEXT_SCALE | PEXT_SETATTACHMENT | PEXT_SETVIEW | PEXT_SOUNDDBL | PEXT_SPAWNSTATIC2 | PEXT_TRANS ;
# ifdef PEXT_VIEW2
demo . recorder . fteprotocolextensions | = PEXT_VIEW2 ;
# endif
2017-03-26 01:46:08 +00:00
demo . recorder . fteprotocolextensions2 = PEXT2_VOICECHAT | PEXT2_SETANGLEDELTA | /*PEXT2_PRYDONCURSOR |*/ ( pext_replacementdeltas . ival ? PEXT2_REPLACEMENTDELTAS : 0 ) ;
2011-08-16 04:12:15 +00:00
/*enable these, because we might as well (stat ones are always useful)*/
demo . recorder . zquake_extensions = Z_EXT_PM_TYPE | Z_EXT_PM_TYPE_NEW | Z_EXT_VIEWHEIGHT | Z_EXT_SERVERTIME | Z_EXT_PITCHLIMITS | Z_EXT_JOIN_OBSERVE | Z_EXT_VWEP ;
2017-03-26 01:46:08 +00:00
// if (demo.recorder.fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS) //replacementdeltas makes a number of earlier extensions obsolete...
// demo.recorder.fteprotocolextensions &= ~(PEXT_COLOURMOD|PEXT_DPFLAGS|PEXT_ENTITYDBL|PEXT_ENTITYDBL2|PEXT_FATNESS|PEXT_HEXEN2|PEXT_HULLSIZE|PEXT_MODELDBL|PEXT_SCALE|PEXT_SETATTACHMENT|PEXT_SOUNDDBL|PEXT_SPAWNSTATIC2|PEXT_TRANS);
2011-08-16 04:12:15 +00:00
}
2013-03-12 22:13:26 +00:00
else
{
demo . recorder . fteprotocolextensions = 0 ;
demo . recorder . fteprotocolextensions2 = 0 ;
demo . recorder . zquake_extensions = Z_EXT_PM_TYPE | Z_EXT_PM_TYPE_NEW | Z_EXT_VIEWHEIGHT | Z_EXT_SERVERTIME | Z_EXT_PITCHLIMITS | Z_EXT_JOIN_OBSERVE | Z_EXT_VWEP ;
}
2011-09-21 06:42:50 +00:00
2012-08-04 01:35:52 +00:00
//pointless extensions that are redundant with mvds
2018-09-01 04:18:08 +00:00
demo . recorder . fteprotocolextensions & = ~ PEXT_ACCURATETIMINGS | PEXT_CHUNKEDDOWNLOADS ;
demo . recorder . fteprotocolextensions & = ~ PEXT1_HIDEPROTOCOLS ;
2004-11-29 01:21:00 +00:00
}
2005-10-07 02:03:17 +00:00
// else
// SV_WriteRecordMVDMessage(&buf, dem_read);
2004-12-08 04:14:52 +00:00
2004-12-10 21:34:42 +00:00
dest - > nextdest = demo . dest ;
demo . dest = dest ;
2004-08-23 00:15:46 +00:00
2019-06-05 20:48:06 +00:00
Cvar_ForceSet ( Cvar_Get ( " serverdemo " , " " , CVAR_NOSET , " " ) , SV_Demo_CurrentOutput ( ) ) ;
2013-03-12 22:44:00 +00:00
SV_ClientProtocolExtensionsChanged ( & demo . recorder ) ;
2006-11-03 15:53:04 +00:00
SV_MVD_SendInitialGamestate ( dest ) ;
return true ;
}
2016-09-08 19:04:35 +00:00
2020-02-26 00:37:52 +00:00
static void SV_MVD_Stopped ( void )
{ //all recording has stopped. clean up any demo.recorder state
if ( demo . recorder . frameunion . frames )
{
Z_Free ( demo . recorder . frameunion . frames ) ;
demo . recorder . frameunion . frames = NULL ;
}
sv . mvdrecording = false ;
memset ( & demo , 0 , sizeof ( demo ) ) ;
}
2013-03-12 22:44:00 +00:00
void SV_EnableClientsCSQC ( void ) ;
2006-11-03 15:53:04 +00:00
void SV_MVD_SendInitialGamestate ( mvddest_t * dest )
{
sizebuf_t buf ;
char buf_data [ MAX_QWMSGLEN ] ;
2014-12-23 15:26:42 +00:00
int i , j ;
// int n;
// const char *s;
2006-11-03 15:53:04 +00:00
client_t * player ;
char * gamedir ;
if ( ! demo . dest )
return ;
2016-09-08 19:04:35 +00:00
SV_MVD_WriteReliables ( false ) ;
2006-11-03 15:53:04 +00:00
sv . mvdrecording = true ;
2016-09-08 19:04:35 +00:00
demo . resetdeltas = true ;
2006-11-03 15:53:04 +00:00
2013-03-12 22:44:00 +00:00
host_client = & demo . recorder ;
2017-11-16 22:20:40 +00:00
if ( demo . recorder . fteprotocolextensions & PEXT_CSQC )
2013-03-12 22:44:00 +00:00
SV_EnableClientsCSQC ( ) ;
2006-11-03 15:53:04 +00:00
demo . pingtime = demo . time = sv . time ;
2004-12-10 21:34:42 +00:00
singledest = dest ;
2004-08-23 00:15:46 +00:00
/*-------------------------------------------------*/
// serverdata
// send the info about the new client to all connected clients
memset ( & buf , 0 , sizeof ( buf ) ) ;
buf . data = buf_data ;
buf . maxsize = sizeof ( buf_data ) ;
2010-11-20 22:01:16 +00:00
buf . prim = svs . netprim ;
2004-08-23 00:15:46 +00:00
// send the serverdata
2018-07-05 16:21:44 +00:00
gamedir = InfoBuf_ValueForKey ( & svs . info , " *gamedir " ) ;
2004-08-23 00:15:46 +00:00
if ( ! gamedir [ 0 ] )
2014-03-30 08:55:06 +00:00
gamedir = FS_GetGamedir ( true ) ;
2004-08-23 00:15:46 +00:00
2017-11-16 22:20:40 +00:00
//generate some meta info so the file can be identified later
{
char timestr [ 64 ] ;
time_t t ;
MSG_WriteByte ( & buf , svc_stufftext ) ;
MSG_WriteString ( & buf , va ( " //protocolname %s \n " , com_protocolname . string ) ) ; //so that the game is known when playing back, to deal with games that conventionally have entirely separate installations.
MSG_WriteByte ( & buf , svc_stufftext ) ;
t = time ( NULL ) ;
strftime ( timestr , sizeof ( timestr ) , " %Y-%m-%dT%H:%M:%SZ " , gmtime ( & t ) ) ;
MSG_WriteString ( & buf , va ( " //recorddate %s \n " , timestr ) ) ; //in order to avoid needing to depend upon file times that get destroyed in many different ways.
}
2004-08-23 00:15:46 +00:00
MSG_WriteByte ( & buf , svc_serverdata ) ;
2011-08-16 04:12:15 +00:00
//fix up extensions to match sv_bigcoords correctly. sorry for old clients not working.
2019-10-14 02:36:57 +00:00
if ( buf . prim . coordtype = = COORDTYPE_FLOAT_32 )
2011-08-16 04:12:15 +00:00
demo . recorder . fteprotocolextensions | = PEXT_FLOATCOORDS ;
else
demo . recorder . fteprotocolextensions & = ~ PEXT_FLOATCOORDS ;
if ( demo . recorder . fteprotocolextensions )
2004-12-10 21:34:42 +00:00
{
2019-05-10 09:31:21 +00:00
MSG_WriteLong ( & buf , PROTOCOL_VERSION_FTE1 ) ;
2011-08-16 04:12:15 +00:00
MSG_WriteLong ( & buf , demo . recorder . fteprotocolextensions ) ;
}
if ( demo . recorder . fteprotocolextensions2 )
{
MSG_WriteLong ( & buf , PROTOCOL_VERSION_FTE2 ) ;
MSG_WriteLong ( & buf , demo . recorder . fteprotocolextensions2 ) ;
2004-12-10 21:34:42 +00:00
}
2008-04-12 23:24:19 +00:00
MSG_WriteLong ( & buf , PROTOCOL_VERSION_QW ) ;
2004-08-23 00:15:46 +00:00
MSG_WriteLong ( & buf , svs . spawncount ) ;
MSG_WriteString ( & buf , gamedir ) ;
2012-02-12 05:18:31 +00:00
if ( demo . recorder . fteprotocolextensions2 & PEXT2_MAXPLAYERS )
2013-06-23 02:17:02 +00:00
MSG_WriteByte ( & buf , demo . recorder . max_net_ents ) ;
2004-08-23 00:15:46 +00:00
MSG_WriteFloat ( & buf , sv . time ) ;
// send full levelname
MSG_WriteString ( & buf , sv . mapname ) ;
// send the movevars
MSG_WriteFloat ( & buf , movevars . gravity ) ;
MSG_WriteFloat ( & buf , movevars . stopspeed ) ;
MSG_WriteFloat ( & buf , movevars . maxspeed ) ;
MSG_WriteFloat ( & buf , movevars . spectatormaxspeed ) ;
MSG_WriteFloat ( & buf , movevars . accelerate ) ;
MSG_WriteFloat ( & buf , movevars . airaccelerate ) ;
MSG_WriteFloat ( & buf , movevars . wateraccelerate ) ;
MSG_WriteFloat ( & buf , movevars . friction ) ;
MSG_WriteFloat ( & buf , movevars . waterfriction ) ;
MSG_WriteFloat ( & buf , movevars . entgravity ) ;
2014-12-02 02:00:41 +00:00
SV_WriteRecordMVDMessage ( & buf ) ;
SZ_Clear ( & buf ) ;
demo . recorder . prespawn_stage = PRESPAWN_SERVERINFO ;
demo . recorder . prespawn_idx = 0 ;
2016-07-15 12:26:24 +00:00
while ( demo . recorder . prespawn_stage ! = PRESPAWN_COMPLETED )
2014-12-02 02:00:41 +00:00
{
if ( demo . recorder . prespawn_stage = = PRESPAWN_MAPCHECK )
{
demo . recorder . prespawn_stage + + ; //client won't reply, so don't wait.
demo . recorder . prespawn_idx = 0 ;
}
2015-06-20 14:22:06 +00:00
demo . recorder . prespawn_allow_soundlist = true ; //normally set for the server to wait for ack. we don't want to wait.
demo . recorder . prespawn_allow_modellist = true ; //normally set for the server to wait for ack. we don't want to wait.
2014-12-02 02:00:41 +00:00
SV_SendClientPrespawnInfo ( & demo . recorder ) ;
2016-09-08 19:04:35 +00:00
SV_MVD_WriteReliables ( false ) ;
2014-12-02 02:00:41 +00:00
}
2004-08-23 00:15:46 +00:00
// send current status of all other players
2014-12-02 02:00:41 +00:00
for ( i = 0 ; i < demo . recorder . max_net_clients & & i < svs . allocated_client_slots ; i + + )
2004-08-23 00:15:46 +00:00
{
2013-07-14 16:39:21 +00:00
player = & svs . clients [ i ] ;
2004-08-23 00:15:46 +00:00
2011-06-05 01:36:14 +00:00
SV_MVD_FullClientUpdate ( & buf , player ) ;
2004-08-23 00:15:46 +00:00
if ( buf . cursize > MAX_QWMSGLEN / 2 )
{
2016-09-08 19:04:35 +00:00
//flush backbuffer
2012-08-04 01:35:52 +00:00
SV_WriteRecordMVDMessage ( & buf ) ;
2005-07-03 15:16:20 +00:00
SZ_Clear ( & buf ) ;
2004-08-23 00:15:46 +00:00
}
}
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
// send all current light styles
2019-09-10 15:40:04 +00:00
for ( i = 0 ; i < sv . maxlightstyles | | i < MAX_STANDARDLIGHTSTYLES ; i + + )
SV_SendLightstyle ( & demo . recorder , & buf , i , true ) ;
2004-08-23 00:15:46 +00:00
2014-12-02 02:00:41 +00:00
//invalidate stats+players somehow
for ( i = 0 ; i < MAX_CLIENTS ; i + + )
{
for ( j = 0 ; j < MAX_CL_STATS ; j + + )
{
2016-09-08 19:04:35 +00:00
demo . statsi [ i ] [ j ] = 0x7fffffff ;
2021-08-04 21:17:31 +00:00
demo . statsf [ i ] [ j ] = - FLT_MAX ;
2014-12-02 02:00:41 +00:00
}
demo . playerreset [ i ] = true ;
}
2004-08-23 00:15:46 +00:00
// get the client to check and download skins
// when that is completed, a begin command will be issued
MSG_WriteByte ( & buf , svc_stufftext ) ;
2005-09-06 01:19:26 +00:00
MSG_WriteString ( & buf , " skins \n " ) ;
2004-08-23 00:15:46 +00:00
2012-08-04 01:35:52 +00:00
SV_WriteRecordMVDMessage ( & buf ) ;
2016-09-08 19:04:35 +00:00
SV_MVD_WriteReliables ( false ) ;
2004-08-23 00:15:46 +00:00
SV_WriteSetMVDMessage ( ) ;
2004-12-10 21:34:42 +00:00
singledest = NULL ;
2004-08-23 00:15:46 +00:00
}
2017-03-26 01:46:08 +00:00
//double-underscores will get merged together.
const char * SV_GenCleanTable ( void )
{
static char tab [ 256 ] ;
static int tabbuilt = - 1 ;
int mode = com_parseutf8 . ival > 0 ;
int i ;
if ( tabbuilt = = mode )
return tab ;
//identity
for ( i = 0 ; i < 32 ; i + + )
tab [ i ] = ' _ ' ; //unprintables.
for ( ; i < 128 ; i + + )
tab [ i ] = i ;
//cheesy way around NUL.mvd etc filenames.
for ( i = ' A ' ; i < = ' Z ' ; i + + )
tab [ i ] = i + ( ' a ' - ' A ' ) ;
//these chars are reserved by windows, so its generally best to not use them, even on loonix
tab [ ' < ' ] = ' [ ' ;
tab [ ' > ' ] = ' ] ' ;
tab [ ' | ' ] = ' _ ' ;
tab [ ' : ' ] = ' _ ' ;
tab [ ' * ' ] = ' _ ' ;
tab [ ' ? ' ] = ' _ ' ;
tab [ ' \\ ' ] = ' _ ' ;
tab [ ' / ' ] = ' _ ' ;
tab [ ' \" ' ] = ' _ ' ;
//some extra ones to make unix scripts nicer.
tab [ ' & ' ] = ' _ ' ;
tab [ ' ~ ' ] = ' _ ' ;
tab [ ' ` ' ] = ' _ ' ;
tab [ ' , ' ] = ' _ ' ;
tab [ ' ' ] = ' _ ' ; //don't use spaces, it means files need quotes, and then stuff bugs out.
tab [ ' . ' ] = ' _ ' ; //many windows programs can't properly deal with multiple dots
if ( mode )
{
//high chars are regular utf-8. yay
for ( i = 128 ; i < 256 ; i + + )
tab [ i ] = i ;
}
else
{
//second row contains coloured numbers for the hud
tab [ 16 ] = ' [ ' ;
tab [ 17 ] = ' ] ' ;
for ( i = 0 ; i < 10 ; i + + )
tab [ 18 + i ] = ' 0 ' + i ;
tab [ 28 ] = ' _ ' ; //'.'
tab [ 29 ] = //line breaks
tab [ 30 ] =
tab [ 31 ] = ' _ ' ;
//high chars
//the first 16 chars of the high range are actually different.
tab [ 128 ] = ' _ ' ; //scrollbars
tab [ 129 ] = ' _ ' ;
tab [ 130 ] = ' _ ' ;
tab [ 130 ] = ' _ ' ;
for ( i = 132 ; i < 128 + 16 ; i + + )
tab [ 18 + i ] = ' _ ' ; //LEDs mostly
//but the rest of the table is just recoloured.
for ( i = 128 + 16 ; i < 256 ; i + + )
tab [ i ] = tab [ i & 127 ] ;
}
return tab ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = =
SV_CleanName
Cleans the demo name , removes restricted chars , makes name lowercase
= = = = = = = = = = = = = = = = = = = =
*/
char * SV_CleanName ( unsigned char * name )
{
static char text [ 1024 ] ;
char * out = text ;
2017-03-26 01:46:08 +00:00
const char * chartbl = SV_GenCleanTable ( ) ;
2004-08-23 00:15:46 +00:00
* out = chartbl [ * name + + ] ;
while ( * name & & out - text < sizeof ( text ) )
if ( * out = = ' _ ' & & chartbl [ * name ] = = ' _ ' )
name + + ;
else * + + out = chartbl [ * name + + ] ;
* + + out = 0 ;
2017-03-26 01:46:08 +00:00
out = text ;
while ( * out = = ' . ' )
out + + ; //leading dots (which could be caused by all sorts of things) are bad. boo hidden files.
return out ;
2004-08-23 00:15:46 +00:00
}
2018-09-01 04:18:08 +00:00
//figure out the actual size limit. this is somewhat approximate anyway.
qofs_t MVD_DemoMaxDirSize ( void )
{
char * e ;
double maxdirsize = strtod ( sv_demoMaxDirSize . string , & e ) ;
if ( * e = = ' ' | | * e = = ' \t ' )
e + + ;
//that will be trailed by g[b], m[b], k[b], or b
if ( * e = = ' b ' | | * e = = ' B ' )
return maxdirsize ;
else if ( * e = = ' k ' | | * e = = ' K ' )
return maxdirsize * 1024 ;
else if ( * e = = ' m ' | | * e = = ' M ' )
return maxdirsize * 1024 * 1024 ;
else if ( * e = = ' g ' | | * e = = ' G ' )
return maxdirsize * 1024 * 1024 * 1024 ;
else
return maxdirsize * 1024 ; //assume kb.
}
//returns if there's enough disk space to record another demo.
qboolean MVD_CheckSpace ( qboolean broadcastwarnings )
{
dir_t * dir ;
qofs_t maxdirsize = MVD_DemoMaxDirSize ( ) ;
if ( maxdirsize > 0 | | sv_demoMaxDirCount . ival > 0 | | sv_demoMaxDirAge . ival > 0 )
{
dir = Sys_listdemos ( sv_demoDir . string , false , SORT_BY_DATE ) ;
if ( sv_demoClearOld . ival & & * sv_demoDir . string )
{
time_t removebeforetime = time ( NULL ) - sv_demoMaxDirAge . value * 60 * 60 * 24 ;
while ( dir - > numfiles & & (
( maxdirsize > 0 & & dir - > size > maxdirsize ) | |
( sv_demoMaxDirCount . ival > 0 & & dir - > numfiles > = sv_demoMaxDirCount . ival ) | |
( sv_demoMaxDirAge . ival & & dir - > files [ dir - > numfiles - 1 ] . mtime & & dir - > files [ dir - > numfiles - 1 ] . mtime - removebeforetime < 0 ) ) )
{
file_t * f = & dir - > files [ dir - > numfiles - 1 ] ; //this is the file we want to kill.
if ( ! f - > path | | ! f - > path - > RemoveFile )
{ //erm, can't remove it...
dir - > size - = f - > size ;
dir - > numfiles - - ;
continue ;
}
if ( f - > path - > RemoveFile ( f - > path , f - > name ) )
{ //okay, looks like we managed to kill it.
Con_Printf ( CON_WARNING " Removed demo \" %s \" \n " , f - > name ) ;
dir - > size - = f - > size ;
dir - > numfiles - - ;
//Try to take the .txt too.
f - > path - > RemoveFile ( f - > path , SV_MVDName2Txt ( f - > name ) ) ;
continue ;
}
}
}
if ( dir - > numfiles & & sv_demoMaxDirCount . ival > 0 & & dir - > numfiles > = sv_demoMaxDirCount . ival )
{
if ( broadcastwarnings )
SV_BroadcastPrintf ( PRINT_MEDIUM , CON_WARNING " insufficient directory space, increase server's sv_demoMaxDirCount \n " ) ;
else
Con_Printf ( CON_WARNING " insufficient demo space, increase sv_demoMaxDirCount \n " ) ;
Sys_freedir ( dir ) ;
return false ;
}
if ( dir - > numfiles & & maxdirsize > 0 & & dir - > size > maxdirsize )
{
if ( broadcastwarnings )
SV_BroadcastPrintf ( PRINT_MEDIUM , CON_WARNING " insufficient directory space, increase server's sv_demoMaxDirSize \n " ) ;
else
Con_Printf ( CON_WARNING " insufficient demo space, increase sv_demoMaxDirSize \n " ) ;
Sys_freedir ( dir ) ;
return false ;
}
Sys_freedir ( dir ) ;
}
return true ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = =
SV_Record_f
record < demoname >
= = = = = = = = = = = = = = = = = = = =
*/
void SV_MVD_Record_f ( void )
{
int c ;
char name [ MAX_OSPATH + MAX_MVD_NAME ] ;
char newname [ MAX_MVD_NAME ] ;
c = Cmd_Argc ( ) ;
if ( c ! = 2 )
{
2005-07-25 13:36:42 +00:00
Con_Printf ( " mvdrecord <demoname> \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2004-12-10 21:34:42 +00:00
if ( sv . state ! = ss_active ) {
2004-08-23 00:15:46 +00:00
Con_Printf ( " Not active yet. \n " ) ;
return ;
}
2018-09-01 04:18:08 +00:00
if ( ! MVD_CheckSpace ( Cmd_FromGamecode ( ) ) )
2004-08-23 00:15:46 +00:00
return ;
Q_strncpyz ( newname , va ( " %s%s " , sv_demoPrefix . string , SV_CleanName ( Cmd_Argv ( 1 ) ) ) ,
sizeof ( newname ) - strlen ( sv_demoSuffix . string ) - 5 ) ;
Q_strncatz ( newname , sv_demoSuffix . string , MAX_MVD_NAME ) ;
2009-04-01 22:03:56 +00:00
snprintf ( name , MAX_OSPATH + MAX_MVD_NAME , " %s/%s " , sv_demoDir . string , newname ) ;
2004-08-23 00:15:46 +00:00
2006-03-11 03:12:10 +00:00
COM_StripExtension ( name , name , sizeof ( name ) ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
# ifdef AVAIL_GZDEC
if ( sv_demoAutoCompress . ival = = 1 )
COM_DefaultExtension ( name , " .mvd.gz " , sizeof ( name ) ) ;
else
# endif
COM_DefaultExtension ( name , " .mvd " , sizeof ( name ) ) ;
2010-07-18 08:42:59 +00:00
FS_CreatePath ( name , FS_GAMEONLY ) ;
2004-08-23 00:15:46 +00:00
2005-08-03 23:14:59 +00:00
//
// open the demo file and start recording
//
2016-07-12 00:40:13 +00:00
SV_MVD_Record ( SV_MVD_InitRecordFile ( name ) ) ;
2004-08-23 00:15:46 +00:00
}
2018-09-01 04:18:08 +00:00
//called when a connecting player becomes active.
void SV_MVD_AutoRecord ( void )
{
//not enabled (for the server) anyway.
if ( sv_demoAutoRecord . ival < = 0 )
return ;
//don't record multiple...
if ( sv . mvdrecording )
return ;
//only do it if we're underneath our quotas.
if ( ! MVD_CheckSpace ( true ) )
return ;
if ( sv_demoAutoRecord . ival > 0 )
{
int playercount = 0 , i ;
for ( i = 0 ; i < svs . allocated_client_slots ; i + + )
{
if ( svs . clients [ i ] . state > = cs_spawned )
playercount + + ;
}
if ( playercount > = sv_demoAutoRecord . ival )
{ //okay, we've reached our player count, its time to start recording now.
char name [ MAX_OSPATH ] ;
char timestamp [ 64 ] ;
time_t tm = time ( NULL ) ;
strftime ( timestamp , sizeof ( timestamp ) , " %Y%m%d_%H%M%S " , localtime ( & tm ) ) ;
Q_snprintfz ( name , sizeof ( name ) , " %s/%s%s_%s " , sv_demoDir . string , sv_demoAutoPrefix . string , svs . name , timestamp ) ;
# ifdef AVAIL_GZDEC
if ( sv_demoAutoCompress . ival = = 1 | | ! * sv_demoAutoCompress . string ) //default is to gzip.
Q_strncatz ( name , " .mvd.gz " , sizeof ( name ) ) ;
else
# endif
Q_strncatz ( name , " .mvd " , sizeof ( name ) ) ;
FS_CreatePath ( name , FS_GAMEONLY ) ;
SV_MVD_Record ( SV_MVD_InitRecordFile ( name ) ) ;
}
}
}
2020-02-11 18:06:10 +00:00
void SV_MVD_CheckReverse ( void )
{
struct reversedest_s * rd , * * link ;
enum qtvstatus_e s ;
int len ;
for ( link = & reversedest ; * link ; link = & rd - > next )
{
rd = * link ;
if ( realtime > rd - > timeout )
len = - 1 ;
else
len = VFS_READ ( rd - > stream , rd - > inbuffer + rd - > inbuffersize , sizeof ( rd - > inbuffer ) - 1 - rd - > inbuffersize ) ;
if ( len < 0 )
s = QTV_ERROR ;
else if ( ! len )
continue ; //keep waiting...
else
{
rd - > inbuffersize + = len ;
rd - > inbuffer [ rd - > inbuffersize ] = 0 ;
if ( rd - > inbuffersize > = 3 & & strncmp ( rd - > inbuffer , " QTV " , 3 ) )
s = QTV_ERROR ; //not qtv server...
else
{
char * e = strstr ( rd - > inbuffer , " \n \n " ) ;
if ( e )
s = SV_MVD_GotQTVRequest ( rd - > stream , rd - > inbuffer , rd - > inbuffer + rd - > inbuffersize , & rd - > info ) ;
else
continue ; //not nuff data yet
}
}
switch ( s )
{
case QTV_RETRY : //need to parse new stuff.
continue ;
case QTV_ACCEPT :
rd - > stream = NULL ;
//fallthrough
case QTV_ERROR :
if ( rd - > stream )
VFS_CLOSE ( rd - > stream ) ;
* link = rd - > next ;
Z_Free ( rd ) ;
return ;
}
}
}
2007-05-28 02:25:32 +00:00
void SV_MVD_QTVReverse_f ( void )
{
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 1 //ndef HAVE_TCP
2020-02-11 18:06:10 +00:00
// Con_Printf ("%s is not supported in this build\n", Cmd_Argv(0));
const char * ip = Cmd_Argv ( 1 ) ;
vfsfile_t * f ;
const char * msg = " QTV \n "
" VERSION: 1 \n "
" REVERSE \n "
" \n " ;
struct reversedest_s * rd ;
if ( sv . state < ss_loading )
return ;
2020-04-29 10:43:22 +00:00
f = FS_OpenTCP ( ip , 27599 , false ) ;
2020-02-11 18:06:10 +00:00
if ( ! f )
return ;
VFS_WRITE ( f , msg , strlen ( msg ) ) ;
rd = Z_Malloc ( sizeof ( * rd ) ) ;
rd - > stream = f ;
rd - > info . isreverse = true ;
rd - > timeout = realtime + 10 ;
reversedest = rd ;
2012-04-09 19:12:12 +00:00
# else
2007-05-28 02:25:32 +00:00
char * ip ;
if ( sv . state ! = ss_active )
{
Con_Printf ( " Server is not running \n " ) ;
return ;
}
if ( Cmd_Argc ( ) ! = 2 )
{
Con_Printf ( " %s ip:port \n " , Cmd_Argv ( 0 ) ) ;
return ;
}
ip = Cmd_Argv ( 1 ) ;
{
char * data ;
int sock ;
struct sockaddr_qstorage remote ;
// int fromlen;
2012-11-27 03:23:19 +00:00
int adrfam ;
int adrsz ;
2007-05-28 02:25:32 +00:00
unsigned int nonblocking = true ;
2012-11-27 03:23:19 +00:00
if ( ! NET_StringToSockaddr ( ip , 0 , & remote , & adrfam , & adrsz ) )
2007-05-28 02:25:32 +00:00
{
Con_Printf ( " qtvreverse: failed to resolve address \n " ) ;
return ;
}
2012-11-27 03:23:19 +00:00
if ( ( sock = socket ( adrfam , SOCK_STREAM , IPPROTO_TCP ) ) = = INVALID_SOCKET )
2007-05-28 02:25:32 +00:00
{
2014-02-07 08:38:40 +00:00
Con_Printf ( " qtvreverse: socket: %s \n " , strerror ( neterrno ( ) ) ) ;
2007-05-28 02:25:32 +00:00
return ;
}
2012-11-27 03:23:19 +00:00
if ( connect ( sock , ( void * ) & remote , adrsz ) = = INVALID_SOCKET )
2007-05-28 02:25:32 +00:00
{
closesocket ( sock ) ;
2014-02-07 08:38:40 +00:00
Con_Printf ( " qtvreverse: connect: %s \n " , strerror ( neterrno ( ) ) ) ;
2007-05-28 02:25:32 +00:00
return ;
}
2011-05-19 13:34:07 +00:00
if ( ioctlsocket ( sock , FIONBIO , ( u_long * ) & nonblocking ) = = INVALID_SOCKET )
2007-05-28 02:25:32 +00:00
{
closesocket ( sock ) ;
2014-02-07 08:38:40 +00:00
Con_Printf ( " qtvreverse: ioctl FIONBIO: %s \n " , strerror ( neterrno ( ) ) ) ;
2007-05-28 02:25:32 +00:00
return ;
}
data = " QTV \n "
" REVERSE \n "
" \n " ;
2007-11-04 08:21:19 +00:00
if ( send ( sock , data , strlen ( data ) , 0 ) = = INVALID_SOCKET )
2007-05-28 02:25:32 +00:00
{
closesocket ( sock ) ;
2014-02-07 08:38:40 +00:00
Con_Printf ( " qtvreverse: send: %s \n " , strerror ( neterrno ( ) ) ) ;
2007-05-28 02:25:32 +00:00
return ;
}
SV_MVD_InitPendingStream ( sock , ip ) - > isreverse = true ;
}
//SV_MVD_Record (dest);
2012-04-09 19:12:12 +00:00
# endif
2007-05-28 02:25:32 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = =
SV_EasyRecord_f
easyrecord [ demoname ]
= = = = = = = = = = = = = = = = = = = =
*/
2018-10-11 10:31:23 +00:00
int Dem_CountPlayers ( void )
2004-08-23 00:15:46 +00:00
{
int i , count ;
count = 0 ;
2013-06-23 02:17:02 +00:00
for ( i = 0 ; i < sv . allocated_client_slots ; i + + )
{
2004-08-23 00:15:46 +00:00
if ( svs . clients [ i ] . name [ 0 ] & & ! svs . clients [ i ] . spectator )
count + + ;
}
return count ;
}
char * Dem_Team ( int num )
{
int i ;
static char * lastteam [ 2 ] ;
qboolean first = true ;
client_t * client ;
static int index = 0 ;
index = 1 - index ;
2013-06-23 02:17:02 +00:00
for ( i = 0 , client = svs . clients ; num & & i < sv . allocated_client_slots ; i + + , client + + )
2004-08-23 00:15:46 +00:00
{
if ( ! client - > name [ 0 ] | | client - > spectator )
continue ;
2018-07-05 16:21:44 +00:00
if ( first | | strcmp ( lastteam [ index ] , InfoBuf_ValueForKey ( & client - > userinfo , " team " ) ) )
2004-08-23 00:15:46 +00:00
{
first = false ;
num - - ;
2018-07-05 16:21:44 +00:00
lastteam [ index ] = InfoBuf_ValueForKey ( & client - > userinfo , " team " ) ;
2004-08-23 00:15:46 +00:00
}
}
if ( num )
return " " ;
return lastteam [ index ] ;
}
char * Dem_PlayerName ( int num )
{
int i ;
client_t * client ;
2013-06-23 02:17:02 +00:00
for ( i = 0 , client = svs . clients ; i < sv . allocated_client_slots ; i + + , client + + )
2004-08-23 00:15:46 +00:00
{
if ( ! client - > name [ 0 ] | | client - > spectator )
continue ;
if ( ! - - num )
return client - > name ;
}
return " " ;
}
// -> scream
char * Dem_PlayerNameTeam ( char * t )
{
int i ;
client_t * client ;
static char n [ 1024 ] ;
int sep ;
n [ 0 ] = 0 ;
sep = 0 ;
2013-06-23 02:17:02 +00:00
for ( i = 0 , client = svs . clients ; i < sv . allocated_client_slots ; i + + , client + + )
2004-08-23 00:15:46 +00:00
{
if ( ! client - > name [ 0 ] | | client - > spectator )
continue ;
2018-07-05 16:21:44 +00:00
if ( strcmp ( t , InfoBuf_ValueForKey ( & client - > userinfo , " team " ) ) = = 0 )
2004-08-23 00:15:46 +00:00
{
if ( sep > = 1 )
Q_strncatz ( n , " _ " , sizeof ( n ) ) ;
// snprintf (n, sizeof(n), "%s_", n);
Q_strncatz ( n , client - > name , sizeof ( n ) ) ;
// snprintf (n, sizeof(n),"%s%s", n, client->name);
sep + + ;
}
}
return n ;
}
int Dem_CountTeamPlayers ( char * t )
{
int i , count ;
count = 0 ;
2013-06-23 02:17:02 +00:00
for ( i = 0 ; i < sv . allocated_client_slots ; i + + )
2004-08-23 00:15:46 +00:00
{
if ( svs . clients [ i ] . name [ 0 ] & & ! svs . clients [ i ] . spectator )
2018-07-05 16:21:44 +00:00
if ( strcmp ( InfoBuf_ValueForKey ( & svs . clients [ i ] . userinfo , " team " ) , t ) = = 0 )
2004-08-23 00:15:46 +00:00
count + + ;
}
return count ;
}
2020-09-08 05:11:09 +00:00
//takes a quake-mark-up string (subject to com_parseutf and ^ etc) and spits out a usable utf-8 name
//in and out may overlap.
static char * FS_UTF8FromQuakeFilename ( const char * in , qboolean dequake , qboolean keepmarkup , qboolean blockdirsep , char * out , size_t outsize )
{
conchar_t cline [ 8192 ] , * c ;
char * outend = out + outsize - 1 ; //-1 for our null
unsigned int charflags , codepoint ;
COM_ParseFunString ( CON_WHITEMASK , in , cline , sizeof ( cline ) , keepmarkup ) ;
for ( c = cline ; * c ; )
{
c = Font_Decode ( c , & charflags , & codepoint ) ;
if ( charflags & CON_HIDDEN )
continue ;
if ( dequake )
codepoint = COM_DeQuake ( codepoint ) ;
if ( codepoint = = ' / ' & & blockdirsep ) codepoint = ' - ' ; //spreading across multiple dirs is just awkward
else if ( codepoint < ' ' ) codepoint = ' - ' ; //C0 chars are all kinds of problematic
else if ( codepoint = = ' \\ ' ) codepoint = ' - ' ; //windows sucks. or string escapes do.
else if ( codepoint = = ' : ' ) codepoint = ' - ' ; //drives, or Alternative Data Streams (read: often hidden)
else if ( codepoint = = ' \" ' ) codepoint = ' - ' ; //erk! escapes necessitate escapes...
else if ( codepoint = = ' < ' ) codepoint = ' - ' ; //pipe stuff sucks
else if ( codepoint = = ' > ' ) codepoint = ' - ' ; //pipe stuff sucks
else if ( codepoint = = ' | ' ) codepoint = ' - ' ; //pipe stuff sucks
else if ( codepoint = = ' ? ' ) codepoint = ' - ' ; //wildcards complicate things
else if ( codepoint = = ' * ' ) codepoint = ' - ' ; //wildcards complicate things
out + = utf8_encode ( out , codepoint , outend - out ) ;
}
* out = 0 ;
return out ;
}
2004-08-23 00:15:46 +00:00
// <-
void SV_MVDEasyRecord_f ( void )
{
int c ;
char name [ 1024 ] ;
char name2 [ MAX_OSPATH * 7 ] ; // scream
//char name2[MAX_OSPATH*2];
int i ;
2009-04-01 22:03:56 +00:00
vfsfile_t * f ;
2004-08-23 00:15:46 +00:00
c = Cmd_Argc ( ) ;
2006-05-28 23:32:16 +00:00
if ( c > 2 )
2004-08-23 00:15:46 +00:00
{
Con_Printf ( " easyrecord [demoname] \n " ) ;
return ;
}
2006-05-28 23:31:30 +00:00
if ( sv . state < ss_active )
{
Con_Printf ( " Server isn't running or is still loading \n " ) ;
return ;
}
2018-09-01 04:18:08 +00:00
if ( ! MVD_CheckSpace ( Cmd_FromGamecode ( ) ) )
2004-08-23 00:15:46 +00:00
return ;
if ( c = = 2 )
2012-04-20 14:09:04 +00:00
{
2004-08-23 00:15:46 +00:00
Q_strncpyz ( name , Cmd_Argv ( 1 ) , sizeof ( name ) ) ;
2020-09-08 05:11:09 +00:00
FS_UTF8FromQuakeFilename ( name , true , false , false , name , sizeof ( name ) ) ;
2012-04-20 14:09:04 +00:00
}
2004-08-23 00:15:46 +00:00
else
{
i = Dem_CountPlayers ( ) ;
2013-07-26 17:19:06 +00:00
/*if (!deathmatch.ival)
{
if ( coop . ival | | i > 1 )
snprintf ( name , sizeof ( name ) , " coop_%s_%d(%d) " , sv . name , skill . ival , i ) ;
else
snprintf ( name , sizeof ( name ) , " sp_%s_%d_%s " , sv . name , skill . ival , Dem_PlayerName ( 0 ) ) ;
}
else */ if ( teamplay . value > = 1 & & i > 2 )
2004-08-23 00:15:46 +00:00
{
// Teamplay
2006-03-06 01:41:09 +00:00
snprintf ( name , sizeof ( name ) , " %don%d_ " , Dem_CountTeamPlayers ( Dem_Team ( 1 ) ) , Dem_CountTeamPlayers ( Dem_Team ( 2 ) ) ) ;
2004-08-23 00:15:46 +00:00
if ( sv_demoExtraNames . value > 0 )
{
2005-07-03 15:16:20 +00:00
Q_strncatz ( name , va ( " [%s]_%s_vs_[%s]_%s_%s " ,
Dem_Team ( 1 ) , Dem_PlayerNameTeam ( Dem_Team ( 1 ) ) ,
2004-08-23 00:15:46 +00:00
Dem_Team ( 2 ) , Dem_PlayerNameTeam ( Dem_Team ( 2 ) ) ,
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
svs . name ) , sizeof ( name ) ) ;
2004-08-23 00:15:46 +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
Q_strncatz ( name , va ( " %s_vs_%s_%s " , Dem_Team ( 1 ) , Dem_Team ( 2 ) , svs . name ) , sizeof ( name ) ) ;
2004-08-23 00:15:46 +00:00
} else {
if ( i = = 2 ) {
// Duel
2006-03-06 01:41:09 +00:00
snprintf ( name , sizeof ( name ) , " duel_%s_vs_%s_%s " ,
2004-08-23 00:15:46 +00:00
Dem_PlayerName ( 1 ) ,
Dem_PlayerName ( 2 ) ,
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
svs . name ) ;
2004-08-23 00:15:46 +00:00
} else {
// FFA
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
snprintf ( name , sizeof ( name ) , " ffa_%s(%d) " , svs . name , i ) ;
2004-08-23 00:15:46 +00:00
}
}
2020-09-08 05:11:09 +00:00
//convert to utf-8, so its readable on most systems (we convert utf-8 to utf-16 for windows, while linux tends to just use utf-8 in the first place)
FS_UTF8FromQuakeFilename ( name , true , false , true , name , sizeof ( name ) ) ;
2004-08-23 00:15:46 +00:00
}
// <-
// Make sure the filename doesn't contain illegal characters
Q_strncpyz ( name , va ( " %s%s " , sv_demoPrefix . string , SV_CleanName ( name ) ) ,
MAX_MVD_NAME - strlen ( sv_demoSuffix . string ) - 7 ) ;
Q_strncatz ( name , sv_demoSuffix . string , sizeof ( name ) ) ;
2009-04-01 22:03:56 +00:00
Q_strncpyz ( name , va ( " %s/%s " , sv_demoDir . string , name ) , sizeof ( name ) ) ;
2004-08-23 00:15:46 +00:00
// find a filename that doesn't exist yet
Q_strncpyz ( name2 , name , sizeof ( name2 ) ) ;
// COM_StripExtension(name2, name2);
2010-07-18 08:42:59 +00:00
FS_CreatePath ( name2 , FS_GAMEONLY ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
Q_strncatz ( name2 , " .mvd " , sizeof ( name2 ) ) ;
2009-04-01 22:03:56 +00:00
if ( ( f = FS_OpenVFS ( name2 , " rb " , FS_GAMEONLY ) ) = = 0 )
f = FS_OpenVFS ( va ( " %s.gz " , name2 ) , " rb " , FS_GAMEONLY ) ;
2005-07-03 15:16:20 +00:00
2004-12-10 21:34:42 +00:00
if ( f )
{
2004-08-23 00:15:46 +00:00
i = 1 ;
do {
2009-04-01 22:03:56 +00:00
VFS_CLOSE ( f ) ;
2006-03-06 01:41:09 +00:00
snprintf ( name2 , sizeof ( name2 ) , " %s_%02i " , name , i ) ;
2004-08-23 00:15:46 +00:00
// COM_StripExtension(name2, name2);
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
Q_strncatz ( name2 , " .mvd " , sizeof ( name2 ) ) ;
2009-04-01 22:03:56 +00:00
if ( ( f = FS_OpenVFS ( name2 , " rb " , FS_GAMEONLY ) ) = = 0 )
f = FS_OpenVFS ( va ( " %s.gz " , name2 ) , " rb " , FS_GAMEONLY ) ;
2004-08-23 00:15:46 +00:00
i + + ;
} while ( f ) ;
}
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
# ifdef AVAIL_GZDEC
if ( sv_demoAutoCompress . ival = = 1 )
Q_strncatz ( name2 , " .gz " , sizeof ( name2 ) ) ;
# endif
2016-07-12 00:40:13 +00:00
SV_MVD_Record ( SV_MVD_InitRecordFile ( name2 ) ) ;
2004-08-23 00:15:46 +00:00
}
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
//console command for servers/admins
2004-08-23 00:15:46 +00:00
void SV_MVDList_f ( void )
{
2004-12-10 21:34:42 +00:00
mvddest_t * d ;
2008-06-01 22:06:22 +00:00
dir_t * dir ;
2004-08-23 00:15:46 +00:00
file_t * list ;
float f ;
int i , j , show ;
2018-09-01 04:18:08 +00:00
qofs_t maxdirsize = MVD_DemoMaxDirSize ( ) ;
2004-08-23 00:15:46 +00:00
2009-04-01 22:03:56 +00:00
Con_Printf ( " content of %s/*.mvd \n " , sv_demoDir . string ) ;
2018-09-01 04:18:08 +00:00
dir = Sys_listdemos ( sv_demoDir . string , true , SORT_BY_DATE ) ;
2008-06-01 22:06:22 +00:00
list = dir - > files ;
2019-05-02 07:10:07 +00:00
if ( ! dir - > numfiles )
2004-08-23 00:15:46 +00:00
{
Con_Printf ( " no demos \n " ) ;
}
2008-12-03 02:23:53 +00:00
for ( i = 1 ; i < = dir - > numfiles ; i + + , list + + )
2004-08-23 00:15:46 +00:00
{
for ( j = 1 ; j < Cmd_Argc ( ) ; j + + )
if ( strstr ( list - > name , Cmd_Argv ( j ) ) = = NULL )
break ;
show = Cmd_Argc ( ) = = j ;
2004-12-10 21:34:42 +00:00
if ( show )
{
for ( d = demo . dest ; d ; d = d - > nextdest )
{
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 ( d - > desttype ! = DEST_STREAM & & ! strcmp ( list - > name , d - > simplename ) )
2018-09-01 04:18:08 +00:00
Con_Printf ( " *%d: ^[^7%s \\ demo \\ %s/%s^] %uk \n " , i , list - > name , sv_demoDir . string , list - > name , ( unsigned int ) ( d - > totalsize / 1024 ) ) ;
2004-12-10 21:34:42 +00:00
}
if ( ! d )
2018-09-01 04:18:08 +00:00
Con_Printf ( " %d: ^[^7%s \\ demo \\ %s/%s^] %uk \n " , i , list - > name , sv_demoDir . string , list - > name , ( unsigned int ) ( list - > size / 1024 ) ) ;
2004-08-23 00:15:46 +00:00
}
}
2004-12-10 21:34:42 +00:00
for ( d = demo . dest ; d ; d = d - > nextdest )
2008-06-01 22:06:22 +00:00
dir - > size + = d - > totalsize ;
2004-08-23 00:15:46 +00:00
2008-06-01 22:06:22 +00:00
Con_Printf ( " \n directory size: %.1fMB \n " , ( float ) dir - > size / ( 1024 * 1024 ) ) ;
2018-09-01 04:18:08 +00:00
if ( maxdirsize )
2004-12-10 21:34:42 +00:00
{
2018-09-01 04:18:08 +00:00
f = ( maxdirsize - dir - > size ) / ( 1024 * 1024 ) ;
2004-08-23 00:15:46 +00:00
if ( f < 0 )
f = 0 ;
Con_Printf ( " space available: %.1fMB \n " , f ) ;
}
2008-06-01 22:06:22 +00:00
Sys_freedir ( dir ) ;
2004-08-23 00:15:46 +00:00
}
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
//console command used to print to connected clients (we're acting as a dedicated server)
2008-06-01 22:06:22 +00:00
void SV_UserCmdMVDList_f ( void )
2004-08-23 00:15:46 +00:00
{
2008-06-01 22:06:22 +00:00
mvddest_t * d ;
dir_t * dir ;
2004-08-23 00:15:46 +00:00
file_t * list ;
2008-06-01 22:06:22 +00:00
float f ;
int i , j , show ;
2018-09-01 04:18:08 +00:00
qofs_t maxdirsize = MVD_DemoMaxDirSize ( ) ;
2008-06-01 22:06:22 +00:00
2010-01-11 17:39:56 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " available demos: \n " ) ;
2018-09-01 04:18:08 +00:00
dir = Sys_listdemos ( sv_demoDir . string , true , SORT_BY_DATE ) ;
2008-06-01 22:06:22 +00:00
list = dir - > files ;
2019-05-02 07:10:07 +00:00
if ( ! dir - > numfiles )
2008-06-01 22:06:22 +00:00
{
2010-01-11 17:39:56 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " no demos \n " ) ;
2008-06-01 22:06:22 +00:00
}
2008-12-03 02:23:53 +00:00
for ( i = 1 ; i < = dir - > numfiles ; i + + , list + + )
2008-06-01 22:06:22 +00:00
{
for ( j = 1 ; j < Cmd_Argc ( ) ; j + + )
if ( strstr ( list - > name , Cmd_Argv ( j ) ) = = NULL )
break ;
show = Cmd_Argc ( ) = = j ;
if ( show )
{
for ( d = demo . dest ; d ; d = d - > nextdest )
{
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 ( d - > desttype ! = DEST_STREAM & & ! strcmp ( list - > name , d - > simplename ) )
2010-01-11 17:39:56 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " *%d: %s %dk \n " , i , list - > name , d - > totalsize / 1024 ) ;
2008-06-01 22:06:22 +00:00
}
if ( ! d )
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
{
if ( host_client - > fteprotocolextensions2 & PEXT_CSQC ) //its a hack to use csqc this way, but oh well, but other clients don't want the gibberish.
2018-09-01 04:18:08 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " %d: ^[%s \\ type \\ /download demos/%s^] %dk \n " , i , list - > name , list - > name , ( unsigned int ) ( list - > size / 1024 ) ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
else
2018-09-01 04:18:08 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " %d: %s %dk \n " , i , list - > name , ( unsigned int ) ( list - > size / 1024 ) ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
}
2008-06-01 22:06:22 +00:00
}
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
2018-09-01 04:18:08 +00:00
if ( host_client - > num_backbuf > = MAX_BACK_BUFFERS / 2 )
{
2017-03-21 17:51:34 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " *MORE* \n " ) ;
2018-09-01 04:18:08 +00:00
break ;
}
2008-06-01 22:06:22 +00:00
}
2011-05-19 13:34:07 +00:00
2008-06-01 22:06:22 +00:00
for ( d = demo . dest ; d ; d = d - > nextdest )
dir - > size + = d - > totalsize ;
2010-01-11 17:39:56 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " \n directory size: %.1fMB \n " , ( float ) dir - > size / ( 1024 * 1024 ) ) ;
2018-09-01 04:18:08 +00:00
if ( maxdirsize )
2008-06-01 22:06:22 +00:00
{
2018-09-01 04:18:08 +00:00
f = ( maxdirsize - dir - > size ) / ( 1024 * 1024 ) ;
2008-06-01 22:06:22 +00:00
if ( f < 0 )
f = 0 ;
2010-01-11 17:39:56 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " space available: %.1fMB \n " , f ) ;
2008-06-01 22:06:22 +00:00
}
Sys_freedir ( dir ) ;
}
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
void SV_UserCmdMVDList_HTML ( vfsfile_t * pipe )
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
//#define EMBEDGAME
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
mvddest_t * d ;
dir_t * dir ;
file_t * list ;
float f ;
int i ;
2018-09-01 04:18:08 +00:00
qofs_t maxdirsize = MVD_DemoMaxDirSize ( ) ;
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
VFS_PRINTF ( pipe ,
" <html> "
" <head> "
2017-05-10 04:32:49 +00:00
" <title>%s - %s</title> "
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
" <meta charset='UTF-8'> "
" <style> "
" .mydiv { width: 20%%; height: 100%%; padding: 0px; margin: 0px; border: 0px solclass #aaaaaa; float:left; } "
" .game { width: 80%%; height: 100%%; padding: 0px; margin: 0px; border: 0px solclass #aaaaaa; float:left; } "
" </style> "
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# ifdef EMBEDGAME
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
" <script> "
" function playdemo(demo) "
" { "
2017-05-10 04:32:49 +00:00
" demo = window.location.origin+'/demos/'+demo; "
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
" thegame.postMessage({cmd:'playdemo',url:demo}, '*'); "
" } "
" </script> "
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +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
" </head> "
" <body> "
" <div class='mydiv'> \n "
2017-05-10 04:32:49 +00:00
, fs_manifest - > formalname , hostname . string ) ;
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
VFS_PRINTF ( pipe , " available demos:<br/> \n " ) ;
2018-09-01 04:18:08 +00:00
dir = Sys_listdemos ( sv_demoDir . string , true , SORT_BY_DATE ) ;
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
list = dir - > files ;
2019-05-02 07:10:07 +00:00
if ( ! dir - > numfiles )
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
{
VFS_PRINTF ( pipe , " no demos<br/> \n " ) ;
}
for ( i = 1 ; i < = dir - > numfiles ; i + + , list + + )
{
for ( d = demo . dest ; d ; d = d - > nextdest )
{
if ( d - > desttype ! = DEST_STREAM & & ! strcmp ( list - > name , d - > simplename ) )
VFS_PRINTF ( pipe , " *%d: %s %dk<br/> \n " , i , list - > name , d - > totalsize / 1024 ) ;
}
if ( ! d )
2017-05-18 10:24:09 +00:00
{
char datetime [ 64 ] ;
strftime ( datetime , sizeof ( datetime ) , " %Y-%m-%d %H:%M:%S " , localtime ( & list - > mtime ) ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# ifdef EMBEDGAME
2018-09-01 04:18:08 +00:00
VFS_PRINTF ( pipe , " %d: <a href='/demos/%s'>%s</a> %uk <a href='javascript:void(0)' onclick='playdemo( \" %s \" )'>play</a> %s<br/> \n " , i , list - > name , list - > name , ( unsigned int ) ( list - > size / 1024 ) , list - > name , datetime ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# else
VFS_PRINTF ( pipe , " %d: <a href='/demos/%s'>%s</a> %uk %s<br/> \n " , i , list - > name , list - > name , ( unsigned int ) ( list - > size / 1024 ) , datetime ) ;
# endif
2017-05-18 10:24:09 +00:00
}
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
}
for ( d = demo . dest ; d ; d = d - > nextdest )
dir - > size + = d - > totalsize ;
VFS_PRINTF ( pipe , " <br/> \n directory size: %.1fMB<br/> \n " , ( float ) dir - > size / ( 1024 * 1024 ) ) ;
2018-09-01 04:18:08 +00:00
if ( maxdirsize )
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
{
2018-09-01 04:18:08 +00:00
f = ( maxdirsize - dir - > size ) / ( 1024 * 1024 ) ;
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 ( f < 0 )
f = 0 ;
VFS_PRINTF ( pipe , " space available: %.1fMB<br/> \n " , f ) ;
}
VFS_PRINTF ( pipe ,
" </div> "
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# ifdef EMBEDGAME
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
" <div class='game'> "
" <iframe name='thegame' " //the name of the game is... thegame!
" src=' " ENGINEWEBSITE " /quake' allowfullscreen=true "
" frameborder='0' scrolling='no' marginheight='0' marginwidth='0' width='100%%' height='100%%' "
" onerror= \" alert('Failed to load engine') \" > "
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
" </iframe> "
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
" </div> "
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +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
" </body> \n "
" </html> \n " ) ;
Sys_freedir ( dir ) ;
}
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
const char * SV_MVDLastNum ( unsigned int num )
{
if ( ! num | | num > DEMOLOG_LENGTH )
return NULL ;
num = demolog . sequence - num ;
return demolog . log [ num % DEMOLOG_LENGTH ] . filename ;
}
char * SV_MVDNum ( char * buffer , int bufferlen , int num ) //lame number->name lookup according to a list generated at an arbitrary time
2008-06-01 22:06:22 +00:00
{
file_t * list ;
dir_t * dir ;
2004-08-23 00:15:46 +00:00
2018-09-01 04:18:08 +00:00
dir = Sys_listdemos ( sv_demoDir . string , true , SORT_BY_DATE ) ;
2008-06-01 22:06:22 +00:00
list = dir - > files ;
2004-08-23 00:15:46 +00:00
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
if ( num < 0 )
num = dir - > numfiles + num ;
2008-12-03 02:23:53 +00:00
if ( num > dir - > numfiles | | num < = 0 )
2008-06-01 22:06:22 +00:00
{
Sys_freedir ( dir ) ;
2004-08-23 00:15:46 +00:00
return NULL ;
2008-06-01 22:06:22 +00:00
}
2004-08-23 00:15:46 +00:00
num - - ;
2008-12-03 02:23:53 +00:00
list + = num ;
2004-08-23 00:15:46 +00:00
2008-12-03 02:23:53 +00:00
Q_strncpyz ( buffer , list - > name , bufferlen ) ;
2008-06-01 22:06:22 +00:00
Sys_freedir ( dir ) ;
return buffer ;
2004-08-23 00:15:46 +00:00
}
char * SV_MVDName2Txt ( char * name )
{
char s [ MAX_OSPATH ] ;
2018-09-01 04:18:08 +00:00
const char * ext ;
2004-08-23 00:15:46 +00:00
if ( ! name )
return NULL ;
Q_strncpyz ( s , name , MAX_OSPATH ) ;
2018-09-01 04:18:08 +00:00
ext = COM_GetFileExtension ( s , NULL ) ;
2021-06-02 15:29:44 +00:00
if ( ! Q_strcasecmp ( ext , " .gz " ) | | ! Q_strcasecmp ( ext , " .xz " ) )
2018-09-01 04:18:08 +00:00
ext = COM_GetFileExtension ( s , ext ) ;
if ( ! ext | | ! * ext ) //if there's no extension on there, then make sure we're pointing to the end of the string.
ext = s + strlen ( s ) ;
2018-09-23 19:35:24 +00:00
if ( ext > s + sizeof ( s ) - 4 ) //make sure we don't overflow the buffer by truncating the base/path, ensuring that we don't write some other type of file.
ext = s + sizeof ( s ) - 4 ; //should probably make this an error case and abort instead.
2018-09-01 04:18:08 +00:00
strcpy ( ( char * ) ext , " .txt " ) ;
2004-08-23 00:15:46 +00:00
return va ( " %s " , s ) ;
}
2008-06-01 22:06:22 +00:00
char * SV_MVDTxTNum ( char * buffer , int bufferlen , int num )
2004-08-23 00:15:46 +00:00
{
2008-06-01 22:06:22 +00:00
return SV_MVDName2Txt ( SV_MVDNum ( buffer , bufferlen , num ) ) ;
2004-08-23 00:15:46 +00:00
}
void SV_MVDRemove_f ( void )
{
char name [ MAX_MVD_NAME ] , * ptr ;
char path [ MAX_OSPATH ] ;
int i ;
2013-03-12 22:44:00 +00:00
mvddest_t * active ;
2004-08-23 00:15:46 +00:00
if ( Cmd_Argc ( ) ! = 2 )
{
2018-09-01 04:18:08 +00:00
Con_Printf ( " %s <demoname> - removes the demo \n rmdemo *<token> - removes demo with <token> in the name \n rmdemo * - removes all demos \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
ptr = Cmd_Argv ( 1 ) ;
if ( * ptr = = ' * ' )
{
2008-06-01 22:06:22 +00:00
dir_t * dir ;
2004-08-23 00:15:46 +00:00
file_t * list ;
// remove all demos with specified token
ptr + + ;
2018-09-01 04:18:08 +00:00
dir = Sys_listdemos ( sv_demoDir . string , true , SORT_BY_DATE ) ;
2008-06-01 22:06:22 +00:00
list = dir - > files ;
2008-12-03 02:23:53 +00:00
for ( i = 0 ; i < dir - > numfiles ; list + + )
2004-08-23 00:15:46 +00:00
{
if ( strstr ( list - > name , ptr ) )
{
2013-03-12 22:44:00 +00:00
mvddest_t * active = SV_FindRecordFile ( list - > name , NULL ) ;
if ( active )
2004-08-23 00:15:46 +00:00
SV_MVDStop_f ( ) ;
// stop recording first;
2009-04-01 22:03:56 +00:00
snprintf ( path , MAX_OSPATH , " %s/%s " , sv_demoDir . string , list - > name ) ;
2012-04-24 07:59:11 +00:00
if ( FS_Remove ( path , FS_GAMEONLY ) )
2004-12-10 21:34:42 +00:00
{
2004-08-23 00:15:46 +00:00
Con_Printf ( " removing %s... \n " , list - > name ) ;
i + + ;
}
2005-07-03 15:16:20 +00:00
2009-04-01 22:03:56 +00:00
FS_Remove ( SV_MVDName2Txt ( path ) , FS_GAMEONLY ) ;
2004-08-23 00:15:46 +00:00
}
}
2008-06-01 22:06:22 +00:00
Sys_freedir ( dir ) ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
if ( i )
{
2004-08-23 00:15:46 +00:00
Con_Printf ( " %d demos removed \n " , i ) ;
2004-12-10 21:34:42 +00:00
}
else
{
2004-08-23 00:15:46 +00:00
Con_Printf ( " no matching found \n " ) ;
}
return ;
}
Q_strncpyz ( name , Cmd_Argv ( 1 ) , MAX_MVD_NAME ) ;
2006-03-11 03:12:10 +00:00
COM_DefaultExtension ( name , " .mvd " , sizeof ( name ) ) ;
2004-08-23 00:15:46 +00:00
2009-04-01 22:03:56 +00:00
snprintf ( path , MAX_OSPATH , " %s/%s " , sv_demoDir . string , name ) ;
2004-08-23 00:15:46 +00:00
2013-03-12 22:44:00 +00:00
active = SV_FindRecordFile ( name , NULL ) ;
if ( active )
2004-08-23 00:15:46 +00:00
SV_MVDStop_f ( ) ;
2012-04-24 07:59:11 +00:00
if ( FS_Remove ( path , FS_GAMEONLY ) )
2004-08-23 00:15:46 +00:00
{
Con_Printf ( " demo %s successfully removed \n " , name ) ;
}
2005-07-03 15:16:20 +00:00
else
2004-08-23 00:15:46 +00:00
Con_Printf ( " unable to remove demo %s \n " , name ) ;
2009-04-01 22:03:56 +00:00
FS_Remove ( SV_MVDName2Txt ( path ) , FS_GAMEONLY ) ;
2004-08-23 00:15:46 +00:00
}
void SV_MVDRemoveNum_f ( void )
{
int num ;
2008-06-01 22:06:22 +00:00
char namebuf [ MAX_QPATH ] ;
2004-08-23 00:15:46 +00:00
char * val , * name ;
char path [ MAX_OSPATH ] ;
if ( Cmd_Argc ( ) ! = 2 )
{
2018-09-01 04:18:08 +00:00
Con_Printf ( " %s <#> \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
val = Cmd_Argv ( 1 ) ;
if ( ( num = atoi ( val ) ) = = 0 & & val [ 0 ] ! = ' 0 ' )
{
2018-09-01 04:18:08 +00:00
Con_Printf ( " %s <#> \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2008-06-01 22:06:22 +00:00
name = SV_MVDNum ( namebuf , sizeof ( namebuf ) , num ) ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
if ( name ! = NULL )
{
2013-03-12 22:44:00 +00:00
mvddest_t * active = SV_FindRecordFile ( name , NULL ) ;
if ( active )
2004-08-23 00:15:46 +00:00
SV_MVDStop_f ( ) ;
2009-04-01 22:03:56 +00:00
snprintf ( path , MAX_OSPATH , " %s/%s " , sv_demoDir . string , name ) ;
2012-04-24 07:59:11 +00:00
if ( FS_Remove ( path , FS_GAMEONLY ) )
2004-08-23 00:15:46 +00:00
{
Con_Printf ( " demo %s succesfully removed \n " , name ) ;
}
2005-07-03 15:16:20 +00:00
else
2004-08-23 00:15:46 +00:00
Con_Printf ( " unable to remove demo %s \n " , name ) ;
2009-04-01 22:03:56 +00:00
FS_Remove ( SV_MVDName2Txt ( path ) , FS_GAMEONLY ) ;
2004-12-10 21:34:42 +00:00
}
else
2004-08-23 00:15:46 +00:00
Con_Printf ( " invalid demo num \n " ) ;
}
void SV_MVDInfoAdd_f ( void )
{
2008-06-01 22:06:22 +00:00
char namebuf [ MAX_QPATH ] ;
2004-08-23 00:15:46 +00:00
char * name , * args , path [ MAX_OSPATH ] ;
2009-04-01 22:03:56 +00:00
vfsfile_t * f ;
2004-08-23 00:15:46 +00:00
2018-09-01 04:18:08 +00:00
//** is a special hack for ktx
2004-08-23 00:15:46 +00:00
if ( Cmd_Argc ( ) < 3 ) {
2018-09-01 04:18:08 +00:00
Con_Printf ( " %s <demonum> <info string> \n <demonum> = * for currently recorded demo \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2018-09-01 04:18:08 +00:00
if ( ! strcmp ( Cmd_Argv ( 1 ) , " * " ) | | ! strcmp ( Cmd_Argv ( 1 ) , " ** " ) )
2004-08-23 00:15:46 +00:00
{
2013-03-12 22:44:00 +00:00
mvddest_t * active = SV_FindRecordFile ( NULL , NULL ) ;
if ( ! active )
2004-12-10 21:34:42 +00:00
{
2004-08-23 00:15:46 +00:00
Con_Printf ( " Not recording demo! \n " ) ;
return ;
}
2017-02-19 00:15:42 +00:00
Q_strncpyz ( path , SV_MVDName2Txt ( active - > filename ) , sizeof ( path ) ) ;
2004-12-10 21:34:42 +00:00
}
else
{
2008-06-01 22:06:22 +00:00
name = SV_MVDTxTNum ( namebuf , sizeof ( namebuf ) , atoi ( Cmd_Argv ( 1 ) ) ) ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
if ( ! name )
{
2004-08-23 00:15:46 +00:00
Con_Printf ( " invalid demo num \n " ) ;
return ;
}
2009-04-01 22:03:56 +00:00
snprintf ( path , MAX_OSPATH , " %s/%s " , sv_demoDir . string , name ) ;
2004-08-23 00:15:46 +00:00
}
2018-09-01 04:18:08 +00:00
if ( ( f = FS_OpenVFS ( path , " ab " , FS_GAMEONLY ) ) = = NULL )
2004-08-23 00:15:46 +00:00
{
2018-09-01 04:18:08 +00:00
Con_Printf ( " %s: failed to open \" %s \" \n " , Cmd_Argv ( 0 ) , path ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2018-09-01 04:18:08 +00:00
if ( ! strcmp ( Cmd_Argv ( 1 ) , " ** " ) )
{
size_t fsize ;
args = FS_LoadMallocFile ( Cmd_Argv ( 2 ) , & fsize ) ;
if ( args )
{
VFS_WRITE ( f , args , fsize ) ;
FS_FreeFile ( args ) ;
}
else
Con_Printf ( " %s: failed to open input file \n " , Cmd_Argv ( 0 ) ) ;
}
else
{
// skip demonum
args = Cmd_Args ( ) ;
while ( * args > 32 ) args + + ;
while ( * args & & * args < = 32 ) args + + ;
2004-08-23 00:15:46 +00:00
2018-09-01 04:18:08 +00:00
VFS_WRITE ( f , args , strlen ( args ) ) ;
VFS_WRITE ( f , " \n " , 1 ) ;
}
2009-04-01 22:03:56 +00:00
VFS_FLUSH ( f ) ;
VFS_CLOSE ( f ) ;
2004-08-23 00:15:46 +00:00
}
void SV_MVDInfoRemove_f ( void )
{
2008-06-01 22:06:22 +00:00
char namebuf [ MAX_QPATH ] ;
2004-08-23 00:15:46 +00:00
char * name , path [ MAX_OSPATH ] ;
2004-12-10 21:34:42 +00:00
if ( Cmd_Argc ( ) < 2 )
{
2018-09-01 04:18:08 +00:00
Con_Printf ( " %s <demonum> \n <demonum> = * for currently recorded demo \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( ! strcmp ( Cmd_Argv ( 1 ) , " * " ) )
{
2013-03-12 22:44:00 +00:00
mvddest_t * active = SV_FindRecordFile ( NULL , NULL ) ;
if ( ! active )
2004-08-23 00:15:46 +00:00
{
Con_Printf ( " Not recording demo! \n " ) ;
return ;
}
2017-02-19 00:15:42 +00:00
snprintf ( path , MAX_OSPATH , " %s " , SV_MVDName2Txt ( active - > filename ) ) ;
2004-08-23 00:15:46 +00:00
}
else
{
2008-06-01 22:06:22 +00:00
name = SV_MVDTxTNum ( namebuf , sizeof ( namebuf ) , atoi ( Cmd_Argv ( 1 ) ) ) ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
if ( ! name )
{
2004-08-23 00:15:46 +00:00
Con_Printf ( " invalid demo num \n " ) ;
return ;
}
2009-04-01 22:03:56 +00:00
snprintf ( path , MAX_OSPATH , " %s/%s " , sv_demoDir . string , name ) ;
2004-08-23 00:15:46 +00:00
}
2017-02-19 00:15:42 +00:00
if ( FS_Remove ( path , FS_GAMEONLY ) )
{
FS_FlushFSHashRemoved ( path ) ;
Con_Printf ( " file removed \n " ) ;
}
else
2004-08-23 00:15:46 +00:00
Con_Printf ( " failed to remove the file \n " ) ;
2017-02-19 00:15:42 +00:00
2004-08-23 00:15:46 +00:00
}
2022-05-28 17:59:17 +00:00
static void SV_MVDInfo_f ( void )
{ //callable by client, so be careful.
2008-06-01 22:06:22 +00:00
int len ;
2004-08-23 00:15:46 +00:00
char buf [ 64 ] ;
2009-04-01 22:03:56 +00:00
vfsfile_t * f = NULL ;
2004-08-23 00:15:46 +00:00
char * name , path [ MAX_OSPATH ] ;
2004-12-10 21:34:42 +00:00
if ( Cmd_Argc ( ) < 2 )
{
2018-09-01 04:18:08 +00:00
Con_Printf ( " %s <demonum> \n <demonum> = * for currently recorded demo \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( ! strcmp ( Cmd_Argv ( 1 ) , " * " ) )
{
2013-03-12 22:44:00 +00:00
mvddest_t * active = SV_FindRecordFile ( NULL , NULL ) ;
if ( ! active )
2004-12-10 21:34:42 +00:00
{
2004-08-23 00:15:46 +00:00
Con_Printf ( " Not recording demo! \n " ) ;
return ;
}
2017-02-19 00:15:42 +00:00
Q_strncpyz ( path , SV_MVDName2Txt ( active - > filename ) , sizeof ( path ) ) ;
2004-12-10 21:34:42 +00:00
}
else
{
2008-06-01 22:06:22 +00:00
name = SV_MVDTxTNum ( buf , sizeof ( buf ) , atoi ( Cmd_Argv ( 1 ) ) ) ;
2004-08-23 00:15:46 +00:00
2004-12-10 21:34:42 +00:00
if ( ! name )
{
2004-08-23 00:15:46 +00:00
Con_Printf ( " invalid demo num \n " ) ;
return ;
}
2009-04-01 22:03:56 +00:00
snprintf ( path , MAX_OSPATH , " %s/%s " , sv_demoDir . string , name ) ;
2004-08-23 00:15:46 +00:00
}
2009-04-01 22:03:56 +00:00
if ( ( f = FS_OpenVFS ( path , " rt " , FS_GAMEONLY ) ) = = NULL )
2004-08-23 00:15:46 +00:00
{
Con_Printf ( " (empty) \n " ) ;
return ;
}
2008-06-01 22:06:22 +00:00
for ( ; ; )
2004-08-23 00:15:46 +00:00
{
2009-04-01 22:03:56 +00:00
len = VFS_READ ( f , buf , sizeof ( buf ) - 1 ) ;
2022-05-28 17:59:17 +00:00
if ( len < = 0 )
2008-06-01 22:06:22 +00:00
break ;
buf [ len ] = 0 ;
2004-08-23 00:15:46 +00:00
Con_Printf ( " %s " , buf ) ;
}
2009-04-01 22:03:56 +00:00
VFS_CLOSE ( f ) ;
2004-08-23 00:15:46 +00:00
}
2022-05-28 17:59:17 +00:00
void SV_UserMVDInfo_f ( void )
{
SV_BeginRedirect ( RD_CLIENT , host_client - > language ) ;
SV_MVDInfo_f ( ) ;
SV_EndRedirect ( ) ;
}
2004-08-23 00:15:46 +00:00
2017-06-21 01:24:25 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-08-23 00:15:46 +00:00
void SV_MVDPlayNum_f ( void )
{
2008-06-01 22:06:22 +00:00
char namebuf [ MAX_QPATH ] ;
2004-08-23 00:15:46 +00:00
char * name ;
int num ;
char * val ;
if ( Cmd_Argc ( ) ! = 2 )
{
2018-09-01 04:18:08 +00:00
Con_Printf ( " %s <#> \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
val = Cmd_Argv ( 1 ) ;
if ( ( num = atoi ( val ) ) = = 0 & & val [ 0 ] ! = ' 0 ' )
{
2018-09-01 04:18:08 +00:00
Con_Printf ( " %s <#> \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2008-06-01 22:06:22 +00:00
name = SV_MVDNum ( namebuf , sizeof ( namebuf ) , atoi ( val ) ) ;
2004-08-23 00:15:46 +00:00
if ( name )
Cbuf_AddText ( va ( " mvdplay %s \n " , name ) , Cmd_ExecLevel ) ;
else
Con_Printf ( " invalid demo num \n " ) ;
}
2017-06-21 01:24:25 +00:00
# endif
2004-08-23 00:15:46 +00:00
void SV_MVDInit ( void )
{
MVD_Init ( ) ;
2017-06-21 01:24:25 +00:00
//names that conflict with the client and thus only exist in dedicated servers (and thus shouldn't be used by mods that want mvds).
# ifdef SERVERONLY
Cmd_AddCommand ( " record " , SV_MVD_Record_f ) ;
Cmd_AddCommand ( " stop " , SV_MVDStop_f ) ; //client version should still work for mvds too.
2004-10-19 16:10:14 +00:00
# endif
2017-06-21 01:24:25 +00:00
//these don't currently conflict, but hey...
Cmd_AddCommand ( " cancel " , SV_MVD_Cancel_f ) ;
Cmd_AddCommand ( " easyrecord " , SV_MVDEasyRecord_f ) ;
Cmd_AddCommand ( " demolist " , SV_MVDList_f ) ;
Cmd_AddCommand ( " rmdemo " , SV_MVDRemove_f ) ;
Cmd_AddCommand ( " rmdemonum " , SV_MVDRemoveNum_f ) ;
//serverside only names that won't conflict (matching mvdsv)
Cmd_AddCommand ( " sv_demorecord " , SV_MVD_Record_f ) ;
Cmd_AddCommand ( " sv_demostop " , SV_MVDStop_f ) ;
Cmd_AddCommand ( " sv_democancel " , SV_MVD_Cancel_f ) ;
Cmd_AddCommand ( " sv_demoeasyrecord " , SV_MVDEasyRecord_f ) ;
Cmd_AddCommand ( " sv_demolist " , SV_MVDList_f ) ;
Cmd_AddCommand ( " sv_demoremove " , SV_MVDRemove_f ) ;
Cmd_AddCommand ( " sv_demonumremove " , SV_MVDRemoveNum_f ) ;
//old fte names to avoid conflicts.
Cmd_AddCommand ( " mvdrecord " , SV_MVD_Record_f ) ;
Cmd_AddCommand ( " mvdstop " , SV_MVDStop_f ) ;
Cmd_AddCommand ( " mvdcancel " , SV_MVD_Cancel_f ) ;
Cmd_AddCommand ( " mvdlist " , SV_MVDList_f ) ;
# ifdef SERVER_DEMO_PLAYBACK
Cmd_AddCommand ( " mvdplaynum " , SV_MVDPlayNum_f ) ;
# endif
Cmd_AddCommand ( " sv_demoinfoadd " , SV_MVDInfoAdd_f ) ;
Cmd_AddCommand ( " sv_demoinforemove " , SV_MVDInfoRemove_f ) ;
Cmd_AddCommand ( " sv_demoinfo " , SV_MVDInfo_f ) ;
2004-12-08 04:14:52 +00:00
2017-06-21 01:24:25 +00:00
Cmd_AddCommand ( " qtvreverse " , SV_MVD_QTVReverse_f ) ;
2006-09-17 00:59:22 +00:00
Cvar_Register ( & qtv_maxstreams , " MVD Streaming " ) ;
Cvar_Register ( & qtv_password , " MVD Streaming " ) ;
2004-08-23 00:15:46 +00:00
}
2004-11-29 01:21:00 +00:00
# endif
2018-09-01 04:18:08 +00:00
# endif