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-06-15 04:45:26 +00:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE .
2004-08-23 00:15:46 +00:00
See the GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
// cl_main.c -- client main loop
# include "quakedef.h"
# include "winquake.h"
2005-04-18 03:21:16 +00:00
# include <sys/types.h>
2005-12-02 01:14:20 +00:00
# include "netinc.h"
2006-02-11 14:51:36 +00:00
# include "cl_master.h"
# include "cl_ignore.h"
2011-12-05 15:23:40 +00:00
# include "shader.h"
2013-03-12 22:47:42 +00:00
# include <ctype.h>
2006-04-15 06:57:13 +00:00
// callbacks
2015-04-21 04:12:00 +00:00
void QDECL CL_Sbar_Callback ( struct cvar_s * var , char * oldvalue ) ;
2015-09-01 04:45:15 +00:00
# ifdef NQPROT
2015-04-21 04:12:00 +00:00
void QDECL Name_Callback ( struct cvar_s * var , char * oldvalue ) ;
2015-09-01 04:45:15 +00:00
# else
# define Name_Callback NULL
# endif
2006-04-15 06:57:13 +00:00
2017-01-13 00:39:50 +00:00
static void CL_ForceStopDownload ( qboolean finish ) ;
2016-01-18 05:22:07 +00:00
2004-08-23 00:15:46 +00:00
// we need to declare some mouse variables here, because the menu system
// references them even when on a unix system.
qboolean noclip_anglehack ; // remnant from old quake
2017-01-24 10:27:39 +00:00
int startuppending ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
void Host_FinishLoading ( void ) ;
2004-08-23 00:15:46 +00:00
2018-12-06 04:55:35 +00:00
cvar_t cl_crypt_rcon = CVARFD ( " cl_crypt_rcon " , " 1 " , CVAR_ARCHIVE | CVAR_NOTFROMSERVER , " Controls whether to send a hash instead of sending your rcon password as plain-text. Set to 1 for security, or 0 for backwards compatibility. \n Your command and any responses will still be sent as plain text. \n Instead, it is recommended to use rcon ONLY via dtls/tls/wss connections. " ) ; //CVAR_NOTFROMSERVER prevents evil servers from degrading it to send plain-text passwords.
2016-09-08 19:04:35 +00:00
cvar_t rcon_password = CVARF ( " rcon_password " , " " , CVAR_NOUNSAFEEXPAND ) ;
2004-08-23 00:15:46 +00:00
2016-09-08 19:04:35 +00:00
cvar_t rcon_address = CVARF ( " rcon_address " , " " , CVAR_NOUNSAFEEXPAND ) ;
2004-08-23 00:15:46 +00:00
2016-09-08 19:04:35 +00:00
cvar_t cl_timeout = CVAR ( " cl_timeout " , " 60 " ) ;
2004-08-23 00:15:46 +00:00
2012-03-20 03:52:16 +00:00
cvar_t cl_shownet = CVARD ( " cl_shownet " , " 0 " , " Debugging var. 0 shows nothing. 1 shows incoming packet sizes. 2 shows individual messages. 3 shows entities too. " ) ; // can be 0, 1, or 2
2004-08-23 00:15:46 +00:00
2019-01-29 07:18:07 +00:00
cvar_t cl_disconnectreason = CVARAFD ( " _cl_disconnectreason " , " " , " com_errorMessage " , CVAR_NOSAVE , " This cvar contains the reason for the last disconnection, so that mod menus can know why things failed. " ) ;
2018-12-06 04:55:35 +00:00
2013-07-13 12:14:32 +00:00
cvar_t cl_pure = CVARD ( " cl_pure " , " 0 " , " 0=standard quake rules. \n 1=clients should prefer files within packages present on the server. \n 2=clients should use *only* files within packages present on the server. \n Due to quake 1.01/1.06 differences, a setting of 2 is only reliable with total conversions. \n If sv_pure is set, the client will prefer the highest value set. " ) ;
2010-07-11 02:22:39 +00:00
cvar_t cl_sbar = CVARFC ( " cl_sbar " , " 0 " , CVAR_ARCHIVE , CL_Sbar_Callback ) ;
cvar_t cl_hudswap = CVARF ( " cl_hudswap " , " 0 " , CVAR_ARCHIVE ) ;
2019-02-19 06:49:03 +00:00
cvar_t cl_maxfps = CVARFD ( " cl_maxfps " , " 250 " , CVAR_ARCHIVE , " Sets the maximum allowed framerate. If you're using vsync or want to uncap framerates entirely then you should probably set this to 0. Set cl_yieldcpu 0 if you're trying to benchmark. " ) ;
cvar_t cl_idlefps = CVARFD ( " cl_idlefps " , " 60 " , CVAR_ARCHIVE , " This is the maximum framerate to attain while idle/paused/unfocused. " ) ;
2018-07-22 11:49:37 +00:00
cvar_t cl_yieldcpu = CVARFD ( " cl_yieldcpu " , " 1 " , CVAR_ARCHIVE , " Attempt to yield between frames. This can resolve issues with certain drivers and background software, but can mean less consistant frame times. Will reduce power consumption/heat generation so should be set on laptops or similar (over-hot/battery powered) devices. " ) ;
2010-07-11 02:22:39 +00:00
cvar_t cl_nopext = CVARF ( " cl_nopext " , " 0 " , CVAR_ARCHIVE ) ;
cvar_t cl_pext_mask = CVAR ( " cl_pext_mask " , " 0xffffffff " ) ;
2016-07-15 12:26:24 +00:00
cvar_t cl_nolerp = CVARD ( " cl_nolerp " , " 0 " , " Disables interpolation. If set, missiles/monsters will be show exactly what was last received, which will be jerky. Does not affect players. A value of 2 means 'interpolate only in single-player/coop'. " ) ;
2011-12-05 15:23:40 +00:00
cvar_t cl_nolerp_netquake = CVARD ( " cl_nolerp_netquake " , " 0 " , " Disables interpolation when connected to an NQ server. Does affect players, even the local player. You probably don't want to set this. " ) ;
2019-06-17 04:21:41 +00:00
cvar_t cl_fullpitch_nq = CVARAFD ( " cl_fullpitch " , " 0 " , " pq_fullpitch " , CVAR_SEMICHEAT , " When set, attempts to unlimit the default view pitch. Note that some servers will screw over your angles if you use this, resulting in terrible gameplay, while some may merely clamp your angle serverside. This is also considered a cheat in quakeworld, ^1so this will not function there^7. For the equivelent in quakeworld, use serverinfo minpitch+maxpitch instead, which applies to all players fairly. " ) ;
2015-04-21 04:12:00 +00:00
cvar_t * hud_tracking_show ;
2015-11-18 07:37:39 +00:00
cvar_t * hud_miniscores_show ;
2014-04-27 23:16:07 +00:00
extern cvar_t net_compress ;
2004-08-23 00:15:46 +00:00
2018-04-07 12:33:06 +00:00
cvar_t cl_defaultport =
# ifdef GAME_DEFAULTPORT //remove the confusing port alias if we're running as a TC, as well as info about irrelevant games.
CVARFD ( " cl_defaultport " , STRINGIFY ( PORT_DEFAULTSERVER ) , 0 , " The default port used to connect to servers. " )
# else
CVARAFD ( " cl_defaultport " , STRINGIFY ( PORT_DEFAULTSERVER ) , " port " , 0 , " The default port used to connect to servers. "
" \n QW: " STRINGIFY ( PORT_QWSERVER )
" , NQ: " STRINGIFY ( PORT_NQSERVER )
" , Q2: " STRINGIFY ( PORT_Q2SERVER )
" , Q3: " STRINGIFY ( PORT_Q3SERVER )
" . "
)
# endif
;
2011-06-16 02:03:57 +00:00
2015-06-12 14:44:50 +00:00
cvar_t cfg_save_name = CVARFD ( " cfg_save_name " , " fte " , CVAR_ARCHIVE | CVAR_NOTFROMSERVER , " This is the config name that is saved by default when no argument is specified. " ) ;
2004-08-23 00:15:46 +00:00
2012-03-19 06:30:41 +00:00
cvar_t cl_splitscreen = CVARD ( " cl_splitscreen " , " 0 " , " Enables splitscreen support. See also: allow_splitscreen, in_rawinput*, the \" p \" command. " ) ;
2004-08-23 00:15:46 +00:00
2010-07-11 02:22:39 +00:00
cvar_t lookspring = CVARF ( " lookspring " , " 0 " , CVAR_ARCHIVE ) ;
cvar_t lookstrafe = CVARF ( " lookstrafe " , " 0 " , CVAR_ARCHIVE ) ;
cvar_t sensitivity = CVARF ( " sensitivity " , " 10 " , CVAR_ARCHIVE ) ;
2004-08-23 00:15:46 +00:00
2015-06-15 21:07:52 +00:00
cvar_t cl_staticsounds = CVARF ( " cl_staticsounds " , " 1 " , CVAR_ARCHIVE ) ;
2005-01-13 16:29:20 +00:00
2010-07-11 02:22:39 +00:00
cvar_t m_pitch = CVARF ( " m_pitch " , " 0.022 " , CVAR_ARCHIVE ) ;
cvar_t m_yaw = CVARF ( " m_yaw " , " 0.022 " , CVAR_ARCHIVE ) ;
cvar_t m_forward = CVARF ( " m_forward " , " 1 " , CVAR_ARCHIVE ) ;
cvar_t m_side = CVARF ( " m_side " , " 0.8 " , CVAR_ARCHIVE ) ;
2004-08-23 00:15:46 +00:00
2019-01-20 01:00:18 +00:00
cvar_t cl_lerp_maxinterval = CVARD ( " cl_lerp_maxinterval " , " 0.3 " , " Maximum interval between keyframes, in seconds. Larger values can result in entities drifting very slowly when they move sporadically. " ) ;
2015-01-21 18:18:37 +00:00
cvar_t cl_lerp_players = CVARD ( " cl_lerp_players " , " 1 " , " Set this to make other players smoother, though it may increase effective latency. Affects only QuakeWorld. " ) ;
2015-06-28 03:43:10 +00:00
cvar_t cl_predict_players = CVARD ( " cl_predict_players " , " 1 " , " Clear this cvar to see ents exactly how they are on the server. " ) ;
cvar_t cl_predict_players_frac = CVARD ( " cl_predict_players_frac " , " 0.9 " , " How much of other players to predict. Values less than 1 will help minimize overruns. " ) ;
cvar_t cl_predict_players_latency = CVARD ( " cl_predict_players_latency " , " 1.0 " , " Push the player back according to your latency, to give a smooth consistent simulation of the server. " ) ;
cvar_t cl_predict_players_nudge = CVARD ( " cl_predict_players_nudge " , " 0.02 " , " An extra nudge of time, to cover video latency. " ) ;
------------------------------------------------------------------------
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
cvar_t cl_solid_players = CVARD ( " cl_solid_players " , " 1 " , " Consider other players as solid for player prediction. " ) ;
2011-12-05 15:23:40 +00:00
cvar_t cl_noblink = CVARD ( " cl_noblink " , " 0 " , " Disable the ^^b text blinking feature. " ) ;
------------------------------------------------------------------------
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
cvar_t cl_servername = CVARD ( " cl_servername " , " none " , " The hostname of the last server you connected to " ) ;
cvar_t cl_serveraddress = CVARD ( " cl_serveraddress " , " none " , " The address of the last server you connected to " ) ;
2010-07-11 02:22:39 +00:00
cvar_t qtvcl_forceversion1 = CVAR ( " qtvcl_forceversion1 " , " 0 " ) ;
cvar_t qtvcl_eztvextensions = CVAR ( " qtvcl_eztvextensions " , " 0 " ) ;
2004-08-23 00:15:46 +00:00
2015-07-07 02:44:27 +00:00
cvar_t record_flush = CVARD ( " record_flush " , " 0 " , " If set, explicitly flushes demo data to disk while recording. This may be inefficient, depending on how your operating system is configured. " ) ;
2015-06-16 23:53:58 +00:00
cvar_t cl_demospeed = CVARF ( " cl_demospeed " , " 1 " , 0 ) ;
2014-08-15 02:20:41 +00:00
cvar_t cl_demoreel = CVARFD ( " cl_demoreel " , " 0 " , CVAR_SAVE , " When enabled, the engine will begin playing a demo loop on startup. " ) ;
2004-12-24 08:45:56 +00:00
2017-08-29 02:29:06 +00:00
cvar_t cl_loopbackprotocol = CVARD ( " cl_loopbackprotocol " , " qw " , " Which protocol to use for single-player/the internal client. Should be one of: qw, qwid, nqid, nq, fitz, bjp3, dp6, dp7, auto. If 'auto', will use qw protocols for qw mods, and nq protocols for nq mods. " ) ;
2009-02-08 04:39:46 +00:00
2005-03-12 23:40:42 +00:00
2017-08-29 02:29:06 +00:00
cvar_t cl_threadedphysics = CVARD ( " cl_threadedphysics " , " 0 " , " When set, client input frames are generated and sent on a worker thread " ) ;
2005-03-12 23:40:42 +00:00
2014-06-02 16:50:40 +00:00
# ifdef QUAKESPYAPI
2006-02-11 02:09:43 +00:00
cvar_t localid = SCVAR ( " localid " , " " ) ;
2014-06-02 16:50:40 +00:00
static qboolean allowremotecmd = true ;
# endif
2004-08-23 00:15:46 +00:00
------------------------------------------------------------------------
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
cvar_t r_drawflame = CVARD ( " r_drawflame " , " 1 " , " Set to -1 to disable ALL static entities. Set to 0 to disable only wall torches and standing flame. Set to 1 for everything drawn as normal. " ) ;
2006-03-05 04:46:10 +00:00
2013-03-12 22:40:16 +00:00
qboolean forcesaveprompt ;
2004-08-23 00:15:46 +00:00
2006-05-07 20:57:30 +00:00
extern int total_loading_size , current_loading_size , loading_stage ;
2004-08-23 00:15:46 +00:00
//
// info mirrors
//
2013-06-23 02:17:02 +00:00
cvar_t password = CVARAF ( " password " , " " , " pq_password " , CVAR_USERINFO | CVAR_NOUNSAFEEXPAND ) ; //this is parhaps slightly dodgy... added pq_password alias because baker seems to be using this for user accounts.
cvar_t spectator = CVARF ( " spectator " , " " , CVAR_USERINFO ) ;
2014-08-15 02:20:41 +00:00
cvar_t name = CVARFC ( " name " , " Player " , CVAR_ARCHIVE | CVAR_USERINFO , Name_Callback ) ;
2013-06-23 02:17:02 +00:00
cvar_t team = CVARF ( " team " , " " , CVAR_ARCHIVE | CVAR_USERINFO ) ;
2017-08-29 02:29:06 +00:00
cvar_t skin = CVARAF ( " skin " , " " , " _cl_playerskin " , CVAR_ARCHIVE | CVAR_USERINFO ) ;
cvar_t model = CVARAF ( " model " , " " , " _cl_playermodel " , CVAR_ARCHIVE | CVAR_USERINFO ) ;
2013-06-23 02:17:02 +00:00
cvar_t topcolor = CVARF ( " topcolor " , " " , CVAR_ARCHIVE | CVAR_USERINFO ) ;
cvar_t bottomcolor = CVARF ( " bottomcolor " , " " , CVAR_ARCHIVE | CVAR_USERINFO ) ;
2014-03-30 08:55:06 +00:00
cvar_t rate = CVARFD ( " rate " , " 30000 " /*"6480"*/ , CVAR_ARCHIVE | CVAR_USERINFO , " A rough measure of the bandwidth to try to use while playing. Too high a value may result in 'buffer bloat'. " ) ;
2016-07-12 00:40:13 +00:00
cvar_t drate = CVARFD ( " drate " , " 3000000 " , CVAR_ARCHIVE | CVAR_USERINFO , " A rough measure of the bandwidth to try to use while downloading (in bytes per second). " ) ; // :)
2013-06-23 02:17:02 +00:00
cvar_t noaim = CVARF ( " noaim " , " " , CVAR_ARCHIVE | CVAR_USERINFO ) ;
cvar_t msg = CVARFD ( " msg " , " 1 " , CVAR_ARCHIVE | CVAR_USERINFO , " Filter console prints/messages. Only functions on QuakeWorld servers. 0=pickup messages. 1=death messages. 2=critical messages. 3=chat. " ) ;
cvar_t b_switch = CVARF ( " b_switch " , " " , CVAR_ARCHIVE | CVAR_USERINFO ) ;
cvar_t w_switch = CVARF ( " w_switch " , " " , CVAR_ARCHIVE | CVAR_USERINFO ) ;
2018-08-21 18:52:25 +00:00
# ifdef HEXEN2
cvar_t cl_playerclass = CVARF ( " cl_playerclass " , " " , CVAR_ARCHIVE | CVAR_USERINFO ) ;
# endif
2013-06-23 02:17:02 +00:00
cvar_t cl_nofake = CVARD ( " cl_nofake " , " 2 " , " value 0: permits \\ r chars in chat messages \n value 1: blocks all \\ r chars \n value 2: allows \\ r chars, but only from teammates " ) ;
cvar_t cl_chatsound = CVAR ( " cl_chatsound " , " 1 " ) ;
cvar_t cl_enemychatsound = CVAR ( " cl_enemychatsound " , " misc/talk.wav " ) ;
cvar_t cl_teamchatsound = CVAR ( " cl_teamchatsound " , " misc/talk.wav " ) ;
cvar_t r_torch = CVARF ( " r_torch " , " 0 " , CVAR_CHEAT ) ;
cvar_t r_rocketlight = CVARFC ( " r_rocketlight " , " 1 " , CVAR_ARCHIVE , Cvar_Limiter_ZeroToOne_Callback ) ;
cvar_t r_lightflicker = CVAR ( " r_lightflicker " , " 1 " ) ;
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
cvar_t cl_r2g = CVARFD ( " cl_r2g " , " 0 " , CVAR_ARCHIVE , " Uses progs/grenade.mdl instead of progs/missile.mdl when 1. " ) ;
2013-06-23 02:17:02 +00:00
cvar_t r_powerupglow = CVAR ( " r_powerupglow " , " 1 " ) ;
cvar_t v_powerupshell = CVARF ( " v_powerupshell " , " 0 " , CVAR_ARCHIVE ) ;
cvar_t cl_gibfilter = CVARF ( " cl_gibfilter " , " 0 " , CVAR_ARCHIVE ) ;
2015-08-04 15:16:24 +00:00
cvar_t cl_deadbodyfilter = CVARF ( " cl_deadbodyfilter " , " 0 " , CVAR_ARCHIVE ) ;
2013-06-23 02:17:02 +00:00
cvar_t cl_gunx = CVAR ( " cl_gunx " , " 0 " ) ;
cvar_t cl_guny = CVAR ( " cl_guny " , " 0 " ) ;
cvar_t cl_gunz = CVAR ( " cl_gunz " , " 0 " ) ;
cvar_t cl_gunanglex = CVAR ( " cl_gunanglex " , " 0 " ) ;
cvar_t cl_gunangley = CVAR ( " cl_gunangley " , " 0 " ) ;
cvar_t cl_gunanglez = CVAR ( " cl_gunanglez " , " 0 " ) ;
2015-07-07 02:03:31 +00:00
cvar_t cl_proxyaddr = CVAR ( " cl_proxyaddr " , " " ) ;
2017-09-20 11:27:13 +00:00
cvar_t cl_sendguid = CVARD ( " cl_sendguid " , " " , " Send a randomly generated 'globally unique' id to servers, which can be used by servers for score rankings and stuff. Different servers will see different guids. Delete the 'qkey' file in order to appear as a different user. \n If set to 2, all servers will see the same guid. Be warned that this can show other people the guid that you're using. " ) ;
2019-02-24 08:32:45 +00:00
cvar_t cl_downloads = CVARAFD ( " cl_downloads " , " 1 " , /*q3*/ " cl_allowDownload " , CVAR_NOTFROMSERVER , " Allows you to block all automatic downloads. " ) ;
2013-06-23 02:17:02 +00:00
cvar_t cl_download_csprogs = CVARFD ( " cl_download_csprogs " , " 1 " , CVAR_NOTFROMSERVER , " Download updated client gamecode if available. Warning: If you clear this to avoid downloading vm code, you should also clear cl_download_packages. " ) ;
2016-01-18 05:22:07 +00:00
cvar_t cl_download_redirection = CVARFD ( " cl_download_redirection " , " 2 " , CVAR_NOTFROMSERVER , " Follow download redirection to download packages instead of individual files. Also allows the server to send nearly arbitary download commands. \n 2: allows redirection only to named packages files (and demos/*.mvd), which is a bit safer. " ) ;
2018-01-22 19:18:04 +00:00
cvar_t cl_download_mapsrc = CVARFD ( " cl_download_mapsrc " , " " , CVAR_ARCHIVE , " Specifies an http location prefix for map downloads. EG: \" http://example.com/path/quakemaps/ \" " ) ;
2013-06-23 02:17:02 +00:00
cvar_t cl_download_packages = CVARFD ( " cl_download_packages " , " 1 " , CVAR_NOTFROMSERVER , " 0=Do not download packages simply because the server is using them. 1=Download and load packages as needed (does not affect games which do not use this package). 2=Do download and install permanently (use with caution!) " ) ;
cvar_t requiredownloads = CVARFD ( " requiredownloads " , " 1 " , CVAR_ARCHIVE , " 0=join the game before downloads have even finished (might be laggy). 1=wait for all downloads to complete before joining. " ) ;
cvar_t cl_muzzleflash = CVAR ( " cl_muzzleflash " , " 1 " ) ;
2015-08-10 18:28:23 +00:00
cvar_t gl_simpleitems = CVARF ( " gl_simpleitems " , " 0 " , CVAR_ARCHIVE ) ;
2013-06-23 02:17:02 +00:00
cvar_t cl_item_bobbing = CVARF ( " cl_model_bobbing " , " 0 " , CVAR_ARCHIVE ) ;
cvar_t cl_countpendingpl = CVARD ( " cl_countpendingpl " , " 0 " , " If set to 1, packet loss percentages will show packets still in transit as lost, even if they might still be received. " ) ;
cvar_t cl_standardchat = CVARFD ( " cl_standardchat " , " 0 " , CVAR_ARCHIVE , " Disables auto colour coding in chat messages. " ) ;
cvar_t msg_filter = CVARD ( " msg_filter " , " 0 " , " Filter out chat messages: 0=neither. 1=broadcast chat. 2=team chat. 3=all chat. " ) ;
2015-04-14 23:12:17 +00:00
cvar_t msg_filter_frags = CVARD ( " msg_filter_frags " , " 0 " , " Prevents frag messages from appearing on the console. " ) ;
2016-07-26 11:47:59 +00:00
cvar_t msg_filter_pickups = CVARD ( " msg_filter_pickups " , " 0 " , " Prevents pickup messages from appearing on the console. This would normally be filtered by 'msg 1', but nq servers cannot respect that (nor nq mods running in qw servers). " ) ;
2013-06-23 02:17:02 +00:00
cvar_t cl_standardmsg = CVARFD ( " cl_standardmsg " , " 0 " , CVAR_ARCHIVE , " Disables auto colour coding in console prints. " ) ;
cvar_t cl_parsewhitetext = CVARD ( " cl_parsewhitetext " , " 1 " , " When parsing chat messages, enable support for messages like: red{white}red " ) ;
cvar_t cl_dlemptyterminate = CVAR ( " cl_dlemptyterminate " , " 1 " ) ;
cvar_t host_mapname = CVARAF ( " mapname " , " " ,
" host_mapname " , 0 ) ;
2019-07-16 02:59:12 +00:00
# define RULESETADVICE " You should not normally change this cvar from its permissive default, instead impose limits on yourself only through the 'ruleset' cvar."
cvar_t ruleset_allow_playercount = CVARD ( " ruleset_allow_playercount " , " 1 " , " Specifies whether teamplay triggers that count nearby players are allowed in the current ruleset. " RULESETADVICE ) ;
cvar_t ruleset_allow_frj = CVARD ( " ruleset_allow_frj " , " 1 " , " Specifies whether Forward-Rocket-Jump scripts are allowed in the current ruleset. If 0, limits on yaw speed will be imposed so they cannot be scripted. " RULESETADVICE ) ;
cvar_t ruleset_allow_semicheats = CVARD ( " ruleset_allow_semicheats " , " 1 " , " If 0, this blocks a range of cvars that are marked as semi-cheats. Such cvars will be locked to their empty/0 value. " RULESETADVICE ) ;
cvar_t ruleset_allow_packet = CVARD ( " ruleset_allow_packet " , " 1 " , " If 0, network packets sent via the 'packet' command will be blocked. This makes scripting timers a little harder. " RULESETADVICE ) ;
cvar_t ruleset_allow_particle_lightning = CVARD ( " ruleset_allow_particle_lightning " , " 1 " , " A setting of 0 blocks using the particle system to replace lightning gun trails. This prevents making the trails thinner thus preventing them from obscuring your view of your enemies. " RULESETADVICE ) ;
cvar_t ruleset_allow_overlongsounds = CVARD ( " ruleset_allow_overlong_sounds " , " 1 " , " A setting of 0 will block the use of extra-long pickup sounds as item respawn timers. " RULESETADVICE ) ;
cvar_t ruleset_allow_larger_models = CVARD ( " ruleset_allow_larger_models " , " 1 " , " Enforces a maximum bounds limit on models, to prevent the use of additional spikes attached to the model from being used as a kind of wallhack. " RULESETADVICE ) ;
cvar_t ruleset_allow_modified_eyes = CVARD ( " ruleset_allow_modified_eyes " , " 0 " , " When 0, completely hides progs/eyes.mdl if it is not strictly identical to vanilla quake. " RULESETADVICE ) ;
cvar_t ruleset_allow_sensitive_texture_replacements = CVARD ( " ruleset_allow_sensitive_texture_replacements " , " 1 " , " Allows the replacement of certain model textures (as well as the models themselves). This prevents adding extra fullbrights to make them blatently obvious. " RULESETADVICE ) ;
cvar_t ruleset_allow_localvolume = CVARD ( " ruleset_allow_localvolume " , " 1 " , " Allows the use of the snd_playersoundvolume cvar. Muting your own sounds can make it easier to hear where your opponent is. " RULESETADVICE ) ;
cvar_t ruleset_allow_shaders = CVARFD ( " ruleset_allow_shaders " , " 1 " , CVAR_SHADERSYSTEM , " When 0, this completely disables the use of external shader files, preventing custom shaders from being used for wallhacks. " RULESETADVICE ) ;
cvar_t ruleset_allow_watervis = CVARFD ( " ruleset_allow_watervis " , " 1 " , CVAR_SHADERSYSTEM , " When 0, this enforces ugly opaque water. " RULESETADVICE ) ;
cvar_t ruleset_allow_fbmodels = CVARFD ( " ruleset_allow_fbmodels " , " 0 " , CVAR_SHADERSYSTEM , " When 1, allows all models to be displayed fullbright, completely ignoring the lightmaps. This feature exists only for parity with ezquake's defaults. " RULESETADVICE ) ;
2007-08-23 21:25:18 +00:00
2004-08-23 00:15:46 +00:00
extern cvar_t cl_hightrack ;
2009-04-07 01:26:47 +00:00
extern cvar_t vid_renderer ;
2004-08-23 00:15:46 +00:00
char cl_screengroup [ ] = " Screen options " ;
char cl_controlgroup [ ] = " client operation options " ;
char cl_inputgroup [ ] = " client input controls " ;
char cl_predictiongroup [ ] = " Client side prediction " ;
client_static_t cls ;
client_state_t cl ;
2005-09-09 02:01:30 +00:00
// alot of this should probably be dynamically allocated
2006-07-24 04:24:41 +00:00
entity_state_t * cl_baselines ;
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
static_entity_t * cl_static_entities ;
unsigned int cl_max_static_entities ;
2019-09-10 15:40:04 +00:00
lightstyle_t * cl_lightstyle ;
size_t cl_max_lightstyles ;
2009-11-04 21:16:50 +00:00
dlight_t * cl_dlights ;
2018-11-19 06:37:25 +00:00
size_t cl_maxdlights ; /*size of cl_dlights array*/
2004-08-23 00:15:46 +00:00
2006-07-24 04:24:41 +00:00
int cl_baselines_count ;
2018-11-19 06:37:25 +00:00
size_t rtlights_first , rtlights_max ;
2006-05-11 03:14:41 +00:00
2004-08-23 00:15:46 +00:00
// refresh list
// this is double buffered so the last frame
// can be scanned for oldorigins of trailing objects
2011-04-30 17:21:10 +00:00
int cl_numvisedicts ;
------------------------------------------------------------------------
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
int cl_maxvisedicts ;
entity_t * cl_visedicts ;
2015-03-03 07:54:10 +00:00
int cl_framecount ;
2004-08-23 00:15:46 +00:00
2009-11-04 21:16:50 +00:00
scenetris_t * cl_stris ;
2015-03-03 00:14:43 +00:00
vecV_t * fte_restrict cl_strisvertv ;
vec4_t * fte_restrict cl_strisvertc ;
vec2_t * fte_restrict cl_strisvertt ;
index_t * fte_restrict cl_strisidx ;
2009-11-04 21:16:50 +00:00
unsigned int cl_numstrisidx ;
unsigned int cl_maxstrisidx ;
unsigned int cl_numstrisvert ;
unsigned int cl_maxstrisvert ;
unsigned int cl_numstris ;
unsigned int cl_maxstris ;
2014-03-30 08:55:06 +00:00
static struct
{
qboolean trying ;
qboolean istransfer ; //ignore the user's desired server (don't change connect.adr).
2016-07-12 00:40:13 +00:00
netadr_t adr ; //address that we're trying to transfer to. FIXME: support multiple resolved addresses, eg both ::1 AND 127.0.0.1
2017-05-18 10:24:09 +00:00
# ifdef HAVE_DTLS
enum
{
DTLS_DISABLE ,
DTLS_TRY ,
DTLS_REQUIRE ,
DTLS_ACTIVE
} dtlsupgrade ;
# endif
2014-03-30 08:55:06 +00:00
int mtu ;
2014-05-10 13:42:13 +00:00
unsigned int compresscrc ;
2015-12-28 17:41:39 +00:00
int protocol ; //nq/qw/q2/q3. guessed based upon server replies
int subprotocol ; //the monkeys are trying to eat me.
unsigned int fteext1 ;
unsigned int fteext2 ;
2019-03-23 07:06:37 +00:00
unsigned int ezext1 ;
2015-12-28 17:41:39 +00:00
int qport ;
2014-03-30 08:55:06 +00:00
int challenge ; //tracked as part of guesswork based upon what replies we get.
double time ; //for connection retransmits
int defaultport ;
int tries ; //increased each try, every fourth trys nq connect packets.
unsigned char guid [ 64 ] ;
} connectinfo ;
2004-08-23 00:15:46 +00:00
quakeparms_t host_parms ;
qboolean host_initialized ; // true if into command execution
qboolean nomaster ;
double host_frametime ;
double realtime ; // without any filtering or bounding
double oldrealtime ; // last frame run
int host_framecount ;
qbyte * host_basepal ;
2010-08-28 17:14:38 +00:00
qbyte * h2playertranslations ;
2004-08-23 00:15:46 +00:00
2016-09-08 19:04:35 +00:00
cvar_t host_speeds = CVAR ( " host_speeds " , " 0 " ) ; // set for running times
2004-08-23 00:15:46 +00:00
int fps_count ;
2013-03-12 22:40:16 +00:00
qboolean forcesaveprompt ;
2004-08-23 00:15:46 +00:00
jmp_buf host_abort ;
void Master_Connect_f ( void ) ;
2005-06-15 04:45:26 +00:00
char emodel_name [ ] =
2004-08-23 00:15:46 +00:00
{ ' e ' ^ 0xff , ' m ' ^ 0xff , ' o ' ^ 0xff , ' d ' ^ 0xff , ' e ' ^ 0xff , ' l ' ^ 0xff , 0 } ;
2005-06-15 04:45:26 +00:00
char pmodel_name [ ] =
2004-08-23 00:15:46 +00:00
{ ' p ' ^ 0xff , ' m ' ^ 0xff , ' o ' ^ 0xff , ' d ' ^ 0xff , ' e ' ^ 0xff , ' l ' ^ 0xff , 0 } ;
2005-06-15 04:45:26 +00:00
char prespawn_name [ ] =
2004-08-23 00:15:46 +00:00
{ ' p ' ^ 0xff , ' r ' ^ 0xff , ' e ' ^ 0xff , ' s ' ^ 0xff , ' p ' ^ 0xff , ' a ' ^ 0xff , ' w ' ^ 0xff , ' n ' ^ 0xff ,
' ' ^ 0xff , ' % ' ^ 0xff , ' i ' ^ 0xff , ' ' ^ 0xff , ' 0 ' ^ 0xff , ' ' ^ 0xff , ' % ' ^ 0xff , ' i ' ^ 0xff , 0 } ;
2005-06-15 04:45:26 +00:00
char modellist_name [ ] =
{ ' m ' ^ 0xff , ' o ' ^ 0xff , ' d ' ^ 0xff , ' e ' ^ 0xff , ' l ' ^ 0xff , ' l ' ^ 0xff , ' i ' ^ 0xff , ' s ' ^ 0xff , ' t ' ^ 0xff ,
2004-08-23 00:15:46 +00:00
' ' ^ 0xff , ' % ' ^ 0xff , ' i ' ^ 0xff , ' ' ^ 0xff , ' % ' ^ 0xff , ' i ' ^ 0xff , 0 } ;
2005-06-15 04:45:26 +00:00
char soundlist_name [ ] =
{ ' s ' ^ 0xff , ' o ' ^ 0xff , ' u ' ^ 0xff , ' n ' ^ 0xff , ' d ' ^ 0xff , ' l ' ^ 0xff , ' i ' ^ 0xff , ' s ' ^ 0xff , ' t ' ^ 0xff ,
2004-08-23 00:15:46 +00:00
' ' ^ 0xff , ' % ' ^ 0xff , ' i ' ^ 0xff , ' ' ^ 0xff , ' % ' ^ 0xff , ' i ' ^ 0xff , 0 } ;
2012-09-30 05:52:03 +00:00
void CL_UpdateWindowTitle ( void )
{
if ( VID_SetWindowCaption )
{
2016-07-12 00:40:13 +00:00
if ( cl . windowtitle )
{ //gamecode wanted some explicit title.
VID_SetWindowCaption ( cl . windowtitle ) ;
return ;
}
else
2012-09-30 05:52:03 +00:00
{
2016-07-12 00:40:13 +00:00
char title [ 2048 ] ;
switch ( cls . state )
{
default :
2012-09-30 05:52:03 +00:00
# ifndef CLIENTONLY
2016-07-12 00:40:13 +00:00
if ( sv . state )
Q_snprintfz ( title , sizeof ( title ) , " %s: %s " , fs_gamename . string , svs . name ) ;
else
2012-09-30 05:52:03 +00:00
# endif
2016-07-12 00:40:13 +00:00
if ( cls . demoplayback )
2017-07-12 08:15:27 +00:00
Q_snprintfz ( title , sizeof ( title ) , " %s: %s " , fs_gamename . string , cls . lastdemoname ) ;
2016-07-12 00:40:13 +00:00
else
Q_snprintfz ( title , sizeof ( title ) , " %s: %s " , fs_gamename . string , cls . servername ) ;
break ;
case ca_disconnected :
if ( CSQC_UnconnectedOkay ( false ) ) //pure csqc mods can have a world model and yet be disconnected. we don't really know what the current map should be called though.
Q_snprintfz ( title , sizeof ( title ) , " %s " , fs_gamename . string ) ;
else
Q_snprintfz ( title , sizeof ( title ) , " %s: disconnected " , fs_gamename . string ) ;
break ;
2015-06-12 14:44:50 +00:00
}
2016-07-12 00:40:13 +00:00
VID_SetWindowCaption ( title ) ;
2012-09-30 05:52:03 +00:00
}
}
}
2005-07-14 01:57:34 +00:00
void CL_MakeActive ( char * gamename )
{
2012-02-27 12:23:15 +00:00
extern int fs_finds ;
if ( fs_finds )
{
Con_DPrintf ( " %i additional FS searches \n " , fs_finds ) ;
fs_finds = 0 ;
}
2015-06-14 01:28:01 +00:00
cl . matchgametimestart = 0 ;
2005-07-14 01:57:34 +00:00
cls . state = ca_active ;
2015-07-03 02:07:41 +00:00
//this might be expensive, don't count any of this as time spent *playing* the demo. this avoids skipping the first $LOADDURATION seconds.
cl . stillloading = true ;
//kill sounds left over from the last map.
S_Purge ( true ) ;
2005-07-14 01:57:34 +00:00
2015-07-03 02:07:41 +00:00
//kill models left over from the last map.
2013-10-29 17:38:22 +00:00
Mod_Purge ( MP_MAPCHANGED ) ;
2013-07-14 12:22:51 +00:00
2015-07-03 02:07:41 +00:00
//and reload shaders now if needed (this was blocked earlier)
Shader_DoReload ( ) ;
2018-11-27 16:48:19 +00:00
//and now free any textures that were not still needed.
Image_Purge ( ) ;
2015-07-03 02:07:41 +00:00
SCR_EndLoadingPlaque ( ) ;
CL_UpdateWindowTitle ( ) ;
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
if ( sv_demoAutoRecord . ival & & ! sv . mvdrecording & & ! cls . demorecording & & ! cls . demoplayback & & MVD_CheckSpace ( false ) )
{ //don't auto-record if we're already recording... or playing a different demo.
extern cvar_t sv_demoAutoPrefix ;
char timestamp [ 64 ] ;
time_t tm = time ( NULL ) ;
strftime ( timestamp , sizeof ( timestamp ) , " %Y%m%d_%H%M%S " , localtime ( & tm ) ) ;
Cbuf_AddText ( va ( " record %s%s%s%s_%s \n " , sv_demoDir . string , * sv_demoDir . string ? " / " : " " , sv_demoAutoPrefix . string , host_mapname . string , timestamp ) , RESTRICT_LOCAL ) ;
}
# endif
2015-06-16 23:53:58 +00:00
TP_ExecTrigger ( " f_begin " , true ) ;
if ( cls . demoplayback )
TP_ExecTrigger ( " f_spawndemo " , true ) ;
else
TP_ExecTrigger ( " f_spawn " , false ) ;
2005-07-14 01:57:34 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = =
CL_Quit_f
= = = = = = = = = = = = = = = = = =
*/
void CL_Quit_f ( void )
{
2015-06-04 06:15:14 +00:00
if ( ! host_initialized )
return ;
2015-03-03 00:14:43 +00:00
if ( forcesaveprompt & & strcmp ( Cmd_Argv ( 1 ) , " force " ) )
2013-03-12 22:40:16 +00:00
{
2015-03-03 00:14:43 +00:00
forcesaveprompt = false ;
2013-03-12 22:41:34 +00:00
if ( Cmd_Exists ( " menu_quit " ) )
{
Cmd_ExecuteString ( " menu_quit " , RESTRICT_LOCAL ) ;
return ;
}
2013-03-12 22:40:16 +00:00
}
2006-04-02 23:25:03 +00:00
2015-06-16 23:53:58 +00:00
TP_ExecTrigger ( " f_quit " , true ) ;
2005-07-14 01:57:34 +00:00
Cbuf_Execute ( ) ;
2012-04-24 07:59:11 +00:00
/*
2004-11-29 01:21:00 +00:00
# ifndef CLIENTONLY
2004-08-23 00:15:46 +00:00
if ( ! isDedicated )
2004-11-29 01:21:00 +00:00
# endif
2004-08-23 00:15:46 +00:00
{
M_Menu_Quit_f ( ) ;
return ;
2012-04-24 07:59:11 +00:00
} */
2004-08-23 00:15:46 +00:00
Sys_Quit ( ) ;
}
2019-05-10 09:31:21 +00:00
# ifdef NQPROT
2013-05-03 04:28:08 +00:00
void CL_ConnectToDarkPlaces ( char * challenge , netadr_t * adr )
2004-11-20 01:12:02 +00:00
{
char data [ 2048 ] ;
cls . fteprotocolextensions = 0 ;
2009-11-04 21:16:50 +00:00
cls . fteprotocolextensions2 = 0 ;
2017-12-28 16:24:50 +00:00
cls . ezprotocolextensions1 = 0 ;
2004-11-20 01:12:02 +00:00
2014-03-30 08:55:06 +00:00
connectinfo . time = realtime ; // for retransmit requests
2004-11-20 01:12:02 +00:00
2017-08-29 02:29:06 +00:00
Q_snprintfz ( data , sizeof ( data ) , " %c%c%c%cconnect \\ protocol \\ darkplaces 3 \\ protocols \\ DP7 DP6 DP5 RMQ FITZ NEHAHRABJP2 NEHAHRABJP NEHAHRABJP3 QUAKE \\ challenge \\ %s \\ name \\ %s " , 255 , 255 , 255 , 255 , challenge , name . string ) ;
2004-11-20 01:12:02 +00:00
2018-12-28 00:04:36 +00:00
NET_SendPacket ( cls . sockets , strlen ( data ) , data , adr ) ;
2004-11-20 01:12:02 +00:00
cl . splitclients = 0 ;
}
2019-05-10 09:31:21 +00:00
# endif
2004-08-23 00:15:46 +00:00
2019-03-23 07:06:37 +00:00
void CL_SupportedFTEExtensions ( unsigned int * pext1 , unsigned int * pext2 , unsigned int * ezpext1 )
2005-06-15 04:45:26 +00:00
{
2019-05-10 09:31:21 +00:00
unsigned int fteprotextsupported1 = Net_PextMask ( PROTOCOL_VERSION_FTE1 , false ) ;
unsigned int fteprotextsupported2 = Net_PextMask ( PROTOCOL_VERSION_FTE2 , false ) ;
unsigned int ezprotextsupported1 = Net_PextMask ( PROTOCOL_VERSION_EZQUAKE1 , false ) & EZPEXT1_CLIENTADVERTISE ;
2009-11-04 21:16:50 +00:00
2019-03-23 07:06:37 +00:00
fteprotextsupported1 & = strtoul ( cl_pext_mask . string , NULL , 16 ) ;
2009-11-04 21:16:50 +00:00
// fteprotextsupported2 &= strtoul(cl_pext2_mask.string, NULL, 16);
2019-03-23 07:06:37 +00:00
// ezprotextsupported1 &= strtoul(cl_ezpext1_mask.string, NULL, 16);
2008-11-28 20:34:51 +00:00
2009-11-04 21:16:50 +00:00
if ( cl_nopext . ival )
{
2019-03-23 07:06:37 +00:00
fteprotextsupported1 = 0 ;
2009-11-04 21:16:50 +00:00
fteprotextsupported2 = 0 ;
2019-03-23 07:06:37 +00:00
ezprotextsupported1 = 0 ;
2009-11-04 21:16:50 +00:00
}
2008-11-28 20:34:51 +00:00
2019-03-23 07:06:37 +00:00
* pext1 = fteprotextsupported1 ;
2009-11-04 21:16:50 +00:00
* pext2 = fteprotextsupported2 ;
2019-03-23 07:06:37 +00:00
* ezpext1 = ezprotextsupported1 ;
2005-11-30 01:20:53 +00:00
}
2017-09-20 11:27:13 +00:00
char * CL_GUIDString ( netadr_t * adr , const char * guidstring )
2011-07-30 14:14:56 +00:00
{
static qbyte buf [ 2048 ] ;
static int buflen ;
unsigned int digest [ 4 ] ;
char serveraddr [ 256 ] ;
void * blocks [ 2 ] ;
int lens [ 2 ] ;
2014-03-30 08:55:06 +00:00
2017-09-20 11:27:13 +00:00
if ( ! * cl_sendguid . string & & guidstring & & * guidstring )
{
serveraddr [ 0 ] = ' # ' ; //leading hash is to stop servers from being able to scrape from other servers.
Q_strncpyz ( serveraddr + 1 , guidstring , sizeof ( serveraddr ) - 1 ) ;
}
else if ( cl_sendguid . ival = = 2 )
* serveraddr = 0 ;
else if ( cl_sendguid . ival )
NET_AdrToString ( serveraddr , sizeof ( serveraddr ) , adr ) ;
else
2014-05-10 13:42:13 +00:00
return NULL ;
2014-03-30 08:55:06 +00:00
if ( * connectinfo . guid & & connectinfo . istransfer )
return connectinfo . guid ;
2011-07-30 14:14:56 +00:00
if ( ! buflen )
{
vfsfile_t * f ;
f = FS_OpenVFS ( " qkey " , " rb " , FS_ROOT ) ;
if ( f )
{
buflen = VFS_GETLEN ( f ) ;
if ( buflen > 2048 )
buflen = 2048 ;
buflen = VFS_READ ( f , buf , buflen ) ;
VFS_CLOSE ( f ) ;
}
if ( buflen < 16 )
{
buflen = sizeof ( buf ) ;
if ( ! Sys_RandomBytes ( buf , buflen ) )
{
int i ;
srand ( time ( NULL ) ) ;
for ( i = 0 ; i < buflen ; i + + )
buf [ i ] = rand ( ) & 0xff ;
}
f = FS_OpenVFS ( " qkey " , " wb " , FS_ROOT ) ;
if ( f )
{
VFS_WRITE ( f , buf , buflen ) ;
VFS_CLOSE ( f ) ;
}
}
}
blocks [ 0 ] = buf ; lens [ 0 ] = buflen ;
blocks [ 1 ] = serveraddr ; lens [ 1 ] = strlen ( serveraddr ) ;
Com_BlocksChecksum ( 2 , blocks , lens , ( void * ) digest ) ;
2014-03-30 08:55:06 +00:00
Q_snprintfz ( connectinfo . guid , sizeof ( connectinfo . guid ) , " %08x%08x%08x%08x " , digest [ 0 ] , digest [ 1 ] , digest [ 2 ] , digest [ 3 ] ) ;
return connectinfo . guid ;
2011-07-30 14:14:56 +00:00
}
2005-11-30 01:20:53 +00:00
/*
= = = = = = = = = = = = = = = = = = = = = = =
CL_SendConnectPacket
called by CL_Connect_f and CL_CheckResend
= = = = = = = = = = = = = = = = = = = = = =
*/
2014-03-30 08:55:06 +00:00
void CL_SendConnectPacket ( netadr_t * to , int mtu ,
2019-03-23 07:06:37 +00:00
unsigned int ftepext1 , unsigned int ftepext2 , unsigned int ezpext1 ,
2017-09-20 11:27:13 +00:00
int compressioncrc ,
const char * guidhash
/*, ...*/ )
2005-11-30 01:20:53 +00:00
{
2008-11-09 22:29:28 +00:00
extern cvar_t qport ;
2014-03-30 08:55:06 +00:00
netadr_t addr ;
2005-11-30 01:20:53 +00:00
char data [ 2048 ] ;
2011-07-30 14:14:56 +00:00
char * info ;
2005-11-30 01:20:53 +00:00
double t1 , t2 ;
2019-03-23 07:06:37 +00:00
int fteprotextsupported1 = 0 ;
2009-11-04 21:16:50 +00:00
int fteprotextsupported2 = 0 ;
2019-03-23 07:06:37 +00:00
int ezprotextsupported1 = 0 ;
2015-07-07 02:03:31 +00:00
char * a ;
2005-11-30 01:20:53 +00:00
// JACK: Fixed bug where DNS lookups would cause two connects real fast
// Now, adds lookup time to the connect time.
// Should I add it to realtime instead?!?!
2014-03-30 08:55:06 +00:00
if ( ! connectinfo . trying )
2005-11-30 01:20:53 +00:00
return ;
2009-11-04 21:16:50 +00:00
if ( cl_nopext . ival ) //imagine it's an unenhanced server
2005-11-30 01:20:53 +00:00
{
compressioncrc = 0 ;
}
2005-04-16 16:21:27 +00:00
# ifdef Q2CLIENT
2016-01-18 05:22:07 +00:00
if ( connectinfo . protocol = = CP_QUAKE2 )
{
2019-03-23 07:06:37 +00:00
fteprotextsupported1 = ftepext1 & ( PEXT_MODELDBL | PEXT_SOUNDDBL | PEXT_SPLITSCREEN ) ;
2016-01-18 05:22:07 +00:00
fteprotextsupported2 = 0 ;
2019-03-23 07:06:37 +00:00
ezprotextsupported1 = 0 ;
2016-01-18 05:22:07 +00:00
}
else
2005-04-16 16:21:27 +00:00
# endif
2016-01-18 05:22:07 +00:00
{
2019-03-23 07:06:37 +00:00
CL_SupportedFTEExtensions ( & fteprotextsupported1 , & fteprotextsupported2 , & ezprotextsupported1 ) ;
2016-01-18 05:22:07 +00:00
2019-03-23 07:06:37 +00:00
fteprotextsupported1 & = ftepext1 ;
2016-01-18 05:22:07 +00:00
fteprotextsupported2 & = ftepext2 ;
2019-03-23 07:06:37 +00:00
ezprotextsupported1 & = ezpext1 ;
2016-01-18 05:22:07 +00:00
if ( connectinfo . protocol ! = CP_QUAKEWORLD )
{
2019-03-23 07:06:37 +00:00
fteprotextsupported1 = 0 ;
2016-01-18 05:22:07 +00:00
fteprotextsupported2 = 0 ;
2019-03-23 07:06:37 +00:00
ezprotextsupported1 = 0 ;
2016-01-18 05:22:07 +00:00
}
}
2005-03-18 06:14:07 +00:00
2019-03-23 07:06:37 +00:00
connectinfo . fteext1 = fteprotextsupported1 ;
2015-12-28 17:41:39 +00:00
connectinfo . fteext2 = fteprotextsupported2 ;
2019-03-23 07:06:37 +00:00
connectinfo . ezext1 = ezprotextsupported1 ;
2004-08-23 00:15:46 +00:00
t1 = Sys_DoubleTime ( ) ;
2014-03-30 08:55:06 +00:00
if ( ! to )
2004-08-23 00:15:46 +00:00
{
2014-03-30 08:55:06 +00:00
to = & addr ;
2018-04-07 12:33:06 +00:00
if ( ! NET_StringToAdr ( cls . servername , PORT_DEFAULTSERVER , to ) )
2014-03-30 08:55:06 +00:00
{
2017-12-02 22:11:20 +00:00
Con_TPrintf ( " CL_SendConnectPacket: Bad server address \" %s \" \n " , cls . servername ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = false ;
return ;
}
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
NET_AdrToString ( data , sizeof ( data ) , to ) ;
2009-01-14 16:07:07 +00:00
Cvar_ForceSet ( & cl_serveraddress , data ) ;
2017-05-18 10:24:09 +00:00
// Info_SetValueForStarKey (cls.userinfo, "*ip", data, MAX_INFO_STRING);
2009-01-14 16:07:07 +00:00
2014-03-30 08:55:06 +00:00
if ( ! NET_IsClientLegal ( to ) )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Illegal server address \n " ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = false ;
2004-08-23 00:15:46 +00:00
return ;
}
t2 = Sys_DoubleTime ( ) ;
2014-03-30 08:55:06 +00:00
connectinfo . time = realtime + t2 - t1 ; // for retransmit requests
2004-08-23 00:15:46 +00:00
2015-12-28 17:41:39 +00:00
//fixme: we shouldn't cycle these so much
connectinfo . qport = qport . value ;
2019-07-02 04:12:20 +00:00
if ( connectinfo . adr . type ! = NA_LOOPBACK )
Cvar_SetValue ( & qport , ( connectinfo . qport + 1 ) & 0xffff ) ;
2015-12-28 17:41:39 +00:00
if ( connectinfo . protocol = = CP_QUAKE2 & & ( connectinfo . subprotocol = = PROTOCOL_VERSION_R1Q2 | | connectinfo . subprotocol = = PROTOCOL_VERSION_Q2PRO ) )
connectinfo . qport & = 0xff ;
2004-08-23 00:15:46 +00:00
2004-12-24 08:45:56 +00:00
# ifdef Q3CLIENT
2014-03-30 08:55:06 +00:00
if ( connectinfo . protocol = = CP_QUAKE3 )
2004-12-24 08:45:56 +00:00
{ //q3 requires some very strange things.
2015-12-28 17:41:39 +00:00
CLQ3_SendConnectPacket ( to , connectinfo . challenge , connectinfo . qport ) ;
2004-12-24 08:45:56 +00:00
return ;
}
# endif
2011-07-22 15:11:35 +00:00
Q_snprintfz ( data , sizeof ( data ) , " %c%c%c%cconnect " , 255 , 255 , 255 , 255 ) ;
2004-12-24 08:45:56 +00:00
2015-12-28 17:41:39 +00:00
Q_strncatz ( data , va ( " %i %i %i " , connectinfo . subprotocol , connectinfo . qport , connectinfo . challenge ) , sizeof ( data ) ) ;
2004-08-23 00:15:46 +00:00
2015-07-07 02:03:31 +00:00
//userinfo0 has some twiddles for extensions from other qw engines.
Q_strncatz ( data , " \" " , sizeof ( data ) ) ;
//qwfwd proxy routing
if ( ( a = strrchr ( cls . servername , ' @ ' ) ) )
{
* a = 0 ;
Q_strncatz ( data , va ( " \\ prx \\ %s " , cls . servername ) , sizeof ( data ) ) ;
* a = ' @ ' ;
}
//the info itself
2018-07-05 16:21:44 +00:00
{
static const char * prioritykeys [ ] = { " name " , " password " , " spectator " , " lang " , " rate " , " team " , " topcolor " , " bottomcolor " , " skin " , " _ " , " * " , NULL } ;
InfoBuf_ToString ( & cls . userinfo [ 0 ] , data + strlen ( data ) , sizeof ( data ) - strlen ( data ) , prioritykeys , NULL , NULL , & cls . userinfosync , & cls . userinfo [ 0 ] ) ;
}
2015-07-07 02:03:31 +00:00
if ( connectinfo . protocol = = CP_QUAKEWORLD ) //zquake extension info.
2019-03-01 22:53:51 +00:00
Q_strncatz ( data , va ( " \\ *z_ext \\ %i " , CLIENT_SUPPORTED_Z_EXTENSIONS ) , sizeof ( data ) ) ;
2015-07-07 02:03:31 +00:00
Q_strncatz ( data , " \" " , sizeof ( data ) ) ;
2015-12-28 17:41:39 +00:00
if ( connectinfo . protocol = = CP_QUAKE2 & & connectinfo . subprotocol = = PROTOCOL_VERSION_R1Q2 )
Q_strncatz ( data , va ( " %d %d " , mtu , 1905 ) , sizeof ( data ) ) ; //mti, sub-sub-version
else if ( connectinfo . protocol = = CP_QUAKE2 & & connectinfo . subprotocol = = PROTOCOL_VERSION_Q2PRO )
Q_strncatz ( data , va ( " %d 0 0 %d " , mtu , 1021 ) , sizeof ( data ) ) ; //mtu, netchan-fragmentation, zlib, sub-sub-version
2004-08-23 00:15:46 +00:00
2007-08-30 02:15:25 +00:00
Q_strncatz ( data , " \n " , sizeof ( data ) ) ;
2004-08-23 00:15:46 +00:00
2019-03-23 07:06:37 +00:00
if ( ftepext1 )
2019-05-10 09:31:21 +00:00
Q_strncatz ( data , va ( " 0x%x 0x%x \n " , PROTOCOL_VERSION_FTE1 , fteprotextsupported1 ) , sizeof ( data ) ) ;
2009-11-04 21:16:50 +00:00
if ( ftepext2 )
Q_strncatz ( data , va ( " 0x%x 0x%x \n " , PROTOCOL_VERSION_FTE2 , fteprotextsupported2 ) , sizeof ( data ) ) ;
2019-03-23 07:06:37 +00:00
if ( ezpext1 )
Q_strncatz ( data , va ( " 0x%x 0x%x \n " , PROTOCOL_VERSION_EZQUAKE1 , ezprotextsupported1 ) , sizeof ( data ) ) ;
2004-08-23 00:15:46 +00:00
2012-02-12 05:18:31 +00:00
{
2017-03-04 19:36:06 +00:00
int ourmtu ;
2014-03-30 08:55:06 +00:00
if ( to - > type = = NA_LOOPBACK )
2017-03-04 19:36:06 +00:00
ourmtu = MAX_UDP_PACKET ;
else if ( * net_mtu . string )
ourmtu = net_mtu . ival ;
else
ourmtu = 1440 ; //a safe bet. servers have an unsafe bet by default
if ( ourmtu < 0 )
ourmtu = 0 ;
if ( mtu > ourmtu )
mtu = ourmtu ;
connectinfo . mtu = mtu & ~ 7 ;
if ( connectinfo . mtu > 0 )
Q_strncatz ( data , va ( " 0x%x %i \n " , PROTOCOL_VERSION_FRAGMENT , connectinfo . mtu ) , sizeof ( data ) ) ;
2012-02-12 05:18:31 +00:00
}
2004-08-23 00:15:46 +00:00
# ifdef HUFFNETWORK
2014-04-27 23:16:07 +00:00
if ( compressioncrc & & net_compress . ival & & Huff_CompressionCRC ( compressioncrc ) )
2004-08-23 00:15:46 +00:00
{
2007-08-30 02:15:25 +00:00
Q_strncatz ( data , va ( " 0x%x 0x%x \n " , PROTOCOL_VERSION_HUFFMAN , LittleLong ( compressioncrc ) ) , sizeof ( data ) ) ;
2014-05-10 13:42:13 +00:00
connectinfo . compresscrc = compressioncrc ;
2004-08-23 00:15:46 +00:00
}
else
# endif
2014-05-10 13:42:13 +00:00
connectinfo . compresscrc = 0 ;
2005-05-26 12:55:34 +00:00
2017-09-20 11:27:13 +00:00
info = CL_GUIDString ( to , guidhash ) ;
2011-07-30 14:14:56 +00:00
if ( info )
Q_strncatz ( data , va ( " 0x%x \" %s \" \n " , PROTOCOL_INFO_GUID , info ) , sizeof ( data ) ) ;
2018-12-28 00:04:36 +00:00
NET_SendPacket ( cls . sockets , strlen ( data ) , data , to ) ;
2004-08-23 00:15:46 +00:00
}
2009-04-06 00:34:32 +00:00
char * CL_TryingToConnect ( void )
{
2014-03-30 08:55:06 +00:00
if ( ! connectinfo . trying )
2009-04-06 00:34:32 +00:00
return NULL ;
return cls . servername ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = =
CL_CheckForResend
Resend a connect message if the last one has timed out
= = = = = = = = = = = = = = = = =
*/
void CL_CheckForResend ( void )
{
char data [ 2048 ] ;
double t1 , t2 ;
2011-12-23 03:12:29 +00:00
int contype = 0 ;
2013-12-08 20:06:55 +00:00
qboolean keeptrying = true ;
2015-07-07 02:03:31 +00:00
char * host ;
2017-01-24 10:27:39 +00:00
extern int r_blockvidrestart ;
2004-08-23 00:15:46 +00:00
2018-12-28 00:04:36 +00:00
# ifdef HAVE_SERVER
2014-03-30 08:55:06 +00:00
if ( ! cls . state & & ( ! connectinfo . trying | | sv . state ! = ss_clustermode ) & & sv . state )
2004-08-23 00:15:46 +00:00
{
2017-09-20 11:27:13 +00:00
const char * lbp ;
2016-10-22 07:06:51 +00:00
# ifdef NQPROT
2016-07-12 00:40:13 +00:00
qboolean proquakeangles = false ;
2016-10-22 07:06:51 +00:00
# endif
# ifdef NETPREPARSE
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
extern cvar_t dpcompat_nopreparse ;
2016-10-22 07:06:51 +00:00
# endif
2017-09-20 11:27:13 +00:00
extern cvar_t sv_guidhash ;
2019-07-02 04:12:20 +00:00
if ( connectinfo . time & & realtime - connectinfo . time < 1.0 )
return ;
2015-12-28 17:41:39 +00:00
memset ( & connectinfo , 0 , sizeof ( connectinfo ) ) ;
2019-07-02 04:12:20 +00:00
connectinfo . time = realtime ;
2016-02-15 06:01:17 +00:00
Q_strncpyz ( cls . servername , " internalserver " , sizeof ( cls . servername ) ) ;
Cvar_ForceSet ( & cl_servername , cls . servername ) ;
if ( ! NET_StringToAdr ( cls . servername , 0 , & connectinfo . adr ) )
return ; //erk?
2019-07-02 04:12:20 +00:00
2018-12-06 04:55:35 +00:00
if ( * cl_disconnectreason . string )
Cvar_Set ( & cl_disconnectreason , " " ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = true ;
connectinfo . istransfer = false ;
2017-05-18 10:24:09 +00:00
connectinfo . adr . prot = NP_DGRAM ;
2015-06-05 03:45:01 +00:00
2019-08-16 06:58:37 +00:00
NET_InitClient ( sv . state ! = ss_clustermode ) ;
2015-06-05 03:45:01 +00:00
2004-08-23 00:15:46 +00:00
cls . state = ca_disconnected ;
2005-03-12 23:40:42 +00:00
switch ( svs . gametype )
{
# ifdef Q3CLIENT
case GT_QUAKE3 :
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_QUAKE3 ;
2005-03-12 23:40:42 +00:00
break ;
# endif
2004-08-23 00:15:46 +00:00
# ifdef Q2CLIENT
2005-03-12 23:40:42 +00:00
case GT_QUAKE2 :
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_QUAKE2 ;
connectinfo . subprotocol = PROTOCOL_VERSION_Q2 ;
2016-01-18 05:22:07 +00:00
connectinfo . fteext1 = PEXT_MODELDBL | PEXT_SOUNDDBL | PEXT_SPLITSCREEN ;
connectinfo . fteext2 = 0 ;
2019-03-23 07:06:37 +00:00
connectinfo . ezext1 = 0 ;
2005-03-12 23:40:42 +00:00
break ;
2004-08-23 00:15:46 +00:00
# endif
2005-03-12 23:40:42 +00:00
default :
2013-03-12 22:53:23 +00:00
cl . movesequence = 0 ;
2017-08-29 02:29:06 +00:00
lbp = cl_loopbackprotocol . string ;
if ( ! strcmp ( lbp , " " ) | | ! strcmp ( lbp , " qw " ) | | progstype = = PROG_H2 )
2014-01-13 02:42:25 +00:00
{ //qw with all supported extensions -default
2017-08-29 02:29:06 +00:00
//for hexen2 we always force fte's native qw protocol. other protocols won't cut it.
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_QUAKEWORLD ;
connectinfo . subprotocol = PROTOCOL_VERSION_QW ;
2019-05-10 09:31:21 +00:00
connectinfo . fteext1 = Net_PextMask ( PROTOCOL_VERSION_FTE1 , false ) ;
connectinfo . fteext2 = Net_PextMask ( PROTOCOL_VERSION_FTE2 , false ) ;
connectinfo . ezext1 = Net_PextMask ( PROTOCOL_VERSION_EZQUAKE1 , false ) & EZPEXT1_CLIENTADVERTISE ;
2013-07-26 17:19:06 +00:00
}
2018-09-29 17:31:58 +00:00
else if ( ! strcmp ( lbp , " qwid " ) | | ! strcmp ( lbp , " idqw " ) )
2017-08-29 02:29:06 +00:00
{ //for recording .qwd files in any client
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_QUAKEWORLD ;
connectinfo . subprotocol = PROTOCOL_VERSION_QW ;
2017-08-29 02:29:06 +00:00
connectinfo . fteext1 = 0 ;
connectinfo . fteext2 = 0 ;
2019-03-23 07:06:37 +00:00
connectinfo . ezext1 = 0 ;
2015-12-28 17:41:39 +00:00
}
2015-09-01 04:45:15 +00:00
# ifdef Q3CLIENT
2017-08-29 02:29:06 +00:00
else if ( ! strcmp ( lbp , " q3 " ) )
2015-09-01 04:45:15 +00:00
cls . protocol = CP_QUAKE3 ;
# endif
# ifdef NQPROT
2017-08-29 02:29:06 +00:00
else if ( ! strcmp ( lbp , " random " ) )
2015-11-18 07:37:39 +00:00
{ //for debugging.
if ( rand ( ) & 1 )
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_NETQUAKE ;
connectinfo . subprotocol = CPNQ_FITZ666 ;
2015-11-18 07:37:39 +00:00
}
else
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_QUAKEWORLD ;
connectinfo . subprotocol = PROTOCOL_VERSION_QW ;
2019-05-10 09:31:21 +00:00
connectinfo . fteext1 = Net_PextMask ( PROTOCOL_VERSION_FTE1 , false ) ;
connectinfo . fteext2 = Net_PextMask ( PROTOCOL_VERSION_FTE2 , false ) ;
connectinfo . ezext1 = Net_PextMask ( PROTOCOL_VERSION_EZQUAKE1 , false ) & EZPEXT1_CLIENTADVERTISE ;
2015-11-18 07:37:39 +00:00
}
}
2018-09-29 17:31:58 +00:00
else if ( ! strcmp ( lbp , " fitz " ) | | ! strcmp ( lbp , " rmqe " ) | |
! strcmp ( lbp , " qs " ) | |
! strcmp ( lbp , " 666 " ) | | ! strcmp ( lbp , " 999 " ) )
2017-08-29 02:29:06 +00:00
{ //we don't really distinguish between fitz and rmq protocols. we just use 999 with bigcoords and 666 othewise.
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_NETQUAKE ;
connectinfo . subprotocol = CPNQ_FITZ666 ;
------------------------------------------------------------------------
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
}
2018-09-29 17:31:58 +00:00
else if ( ! strcmp ( lbp , " bjp1 " ) | | ! strcmp ( lbp , " bjp2 " ) | | //placeholders only
! strcmp ( lbp , " bjp3 " ) | | ! strcmp ( lbp , " bjp " ) )
2016-07-12 00:40:13 +00:00
{
connectinfo . protocol = CP_NETQUAKE ;
connectinfo . subprotocol = CPNQ_BJP3 ;
}
2017-08-29 02:29:06 +00:00
else if ( ! strcmp ( lbp , " nq " ) )
2012-10-01 14:29:44 +00:00
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_NETQUAKE ;
2016-07-12 00:40:13 +00:00
connectinfo . subprotocol = CPNQ_ID ;
proquakeangles = true ;
2012-10-01 14:29:44 +00:00
}
2017-08-29 02:29:06 +00:00
else if ( ! strcmp ( lbp , " nqid " ) | | ! strcmp ( lbp , " idnq " ) )
2011-10-27 15:46:36 +00:00
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_NETQUAKE ;
connectinfo . subprotocol = CPNQ_ID ;
2011-10-27 15:46:36 +00:00
}
2018-09-29 17:31:58 +00:00
else if ( ! strcmp ( lbp , " dp1 " ) | | ! strcmp ( lbp , " dpp1 " ) | | //most of these are not supported, but parsed as placeholders on the slim chance that we ever do support them
! strcmp ( lbp , " dp2 " ) | | ! strcmp ( lbp , " dpp2 " ) | |
! strcmp ( lbp , " dp3 " ) | | ! strcmp ( lbp , " dpp3 " ) | |
! strcmp ( lbp , " dp4 " ) | | ! strcmp ( lbp , " dpp4 " ) | |
! strcmp ( lbp , " dp5 " ) | | ! strcmp ( lbp , " dpp5 " ) | | //we support this serverside, but not clientside.
! strcmp ( lbp , " dp6 " ) | | ! strcmp ( lbp , " dpp6 " ) ) //this one is supported.
2011-10-27 15:46:36 +00:00
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_NETQUAKE ;
connectinfo . subprotocol = CPNQ_DP6 ;
2011-10-27 15:46:36 +00:00
}
2018-09-29 17:31:58 +00:00
else if ( ! strcmp ( lbp , " dp7 " ) | | ! strcmp ( lbp , " dpp7 " ) | |
! strcmp ( lbp , " dp " ) | | ! strcmp ( lbp , " xonotic " ) ) //family name, common usage.
2011-10-27 15:46:36 +00:00
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_NETQUAKE ;
connectinfo . subprotocol = CPNQ_DP7 ;
2011-10-27 15:46:36 +00:00
}
2018-09-29 17:31:58 +00:00
else if ( ! strcmp ( lbp , " qss " ) | |
( progstype ! = PROG_QW & & progstype ! = PROG_H2 ) ) //h2 depends on various extensions and doesn't really match either protocol, but we go for qw because that gives us all sorts of extensions.
2014-01-13 02:42:25 +00:00
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_NETQUAKE ;
connectinfo . subprotocol = CPNQ_FITZ666 ;
2019-05-10 09:31:21 +00:00
connectinfo . fteext1 = Net_PextMask ( PROTOCOL_VERSION_FTE1 , true ) ;
connectinfo . fteext2 = Net_PextMask ( PROTOCOL_VERSION_FTE2 , true ) ;
connectinfo . ezext1 = Net_PextMask ( PROTOCOL_VERSION_EZQUAKE1 , false ) & EZPEXT1_CLIENTADVERTISE ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
2015-09-01 04:45:15 +00:00
# endif
else
2015-11-18 07:37:39 +00:00
{ //protocol wasn't recognised, and we didn't take the nq fallback, so that must mean we're going for qw.
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_QUAKEWORLD ;
connectinfo . subprotocol = PROTOCOL_VERSION_QW ;
2019-05-10 09:31:21 +00:00
connectinfo . fteext1 = Net_PextMask ( PROTOCOL_VERSION_FTE1 , false ) ;
connectinfo . fteext2 = Net_PextMask ( PROTOCOL_VERSION_FTE2 , false ) ;
connectinfo . ezext1 = Net_PextMask ( PROTOCOL_VERSION_EZQUAKE1 , false ) & EZPEXT1_CLIENTADVERTISE ;
2015-09-01 04:45:15 +00:00
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2015-09-01 04:45:15 +00:00
# ifdef NETPREPARSE
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
if ( dpcompat_nopreparse . ival )
2015-09-01 04:45:15 +00:00
# endif
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{
2015-11-18 07:37:39 +00:00
//disabling preparsing with hexen2 is unsupported.
if ( progstype = = PROG_H2 )
Con_Printf ( " dpcompat_nopreparse is unsupported with hexen2 \n " ) ;
else if ( progstype = = PROG_QW & & cls . protocol ! = CP_QUAKEWORLD )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_QUAKEWORLD ;
connectinfo . subprotocol = PROTOCOL_VERSION_QW ;
2019-05-10 09:31:21 +00:00
connectinfo . fteext1 = Net_PextMask ( PROTOCOL_VERSION_FTE1 , false ) ;
connectinfo . fteext2 = Net_PextMask ( PROTOCOL_VERSION_FTE2 , false ) ;
connectinfo . ezext1 = Net_PextMask ( PROTOCOL_VERSION_EZQUAKE1 , false ) & EZPEXT1_CLIENTADVERTISE ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
else if ( progstype ! = PROG_QW & & cls . protocol = = CP_QUAKEWORLD )
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_NETQUAKE ;
connectinfo . subprotocol = CPNQ_DP7 ; //dpcompat_nopreparse is only really needed for DP mods that send unknowable svc_tempentity messages to the client.
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
2014-01-13 02:42:25 +00:00
}
2013-07-26 17:19:06 +00:00
//make sure the protocol within demos is actually correct/sane
2016-01-18 05:22:07 +00:00
if ( cls . demorecording = = DPB_QUAKEWORLD & & cls . protocol ! = CP_QUAKEWORLD )
2013-07-26 17:19:06 +00:00
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_QUAKEWORLD ;
connectinfo . subprotocol = PROTOCOL_VERSION_QW ;
2019-05-10 09:31:21 +00:00
connectinfo . fteext1 = Net_PextMask ( PROTOCOL_VERSION_FTE1 , false ) ;
connectinfo . fteext2 = Net_PextMask ( PROTOCOL_VERSION_FTE2 , false ) ;
connectinfo . ezext1 = Net_PextMask ( PROTOCOL_VERSION_EZQUAKE1 , false ) & EZPEXT1_CLIENTADVERTISE ;
2013-07-26 17:19:06 +00:00
}
2016-02-10 23:23:43 +00:00
# ifdef NQPROT
2016-01-18 05:22:07 +00:00
else if ( cls . demorecording = = DPB_NETQUAKE & & cls . protocol ! = CP_NETQUAKE )
2013-07-26 17:19:06 +00:00
{
2015-12-28 17:41:39 +00:00
connectinfo . protocol = CP_NETQUAKE ;
connectinfo . subprotocol = CPNQ_FITZ666 ;
2014-01-13 02:42:25 +00:00
//FIXME: use pext.
2013-07-26 17:19:06 +00:00
}
2016-02-10 23:23:43 +00:00
# endif
# ifdef Q2CLIENT
else if ( cls . demorecording = = DPB_QUAKE2 & & cls . protocol ! = CP_QUAKE2 )
2016-01-18 05:22:07 +00:00
{
connectinfo . protocol = CP_QUAKE2 ;
connectinfo . subprotocol = PROTOCOL_VERSION_Q2 ;
connectinfo . fteext1 = PEXT_MODELDBL | PEXT_SOUNDDBL | PEXT_SPLITSCREEN ;
//FIXME: use pext.
}
2016-02-10 23:23:43 +00:00
# endif
2005-03-12 23:40:42 +00:00
break ;
}
2005-05-26 12:55:34 +00:00
2005-10-16 03:50:39 +00:00
CL_FlushClientCommands ( ) ; //clear away all client->server clientcommands.
2015-09-01 04:45:15 +00:00
# ifdef NQPROT
2014-03-30 08:55:06 +00:00
if ( connectinfo . protocol = = CP_NETQUAKE )
2009-02-08 04:39:46 +00:00
{
2014-03-30 08:55:06 +00:00
if ( ! NET_StringToAdr ( cls . servername , connectinfo . defaultport , & connectinfo . adr ) )
2009-02-08 04:39:46 +00:00
{
2017-12-02 22:11:20 +00:00
Con_TPrintf ( " CL_CheckForResend: Bad server address \" %s \" \n " , cls . servername ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = false ;
2013-03-12 22:35:33 +00:00
SCR_EndLoadingPlaque ( ) ;
2009-02-08 04:39:46 +00:00
return ;
}
2014-03-30 08:55:06 +00:00
NET_AdrToString ( data , sizeof ( data ) , & connectinfo . adr ) ;
2009-02-08 04:39:46 +00:00
2013-07-26 17:19:06 +00:00
/*eat up the server's packets, to clear any lingering loopback packets (like disconnect commands... yes this might cause packetloss for other clients)*/
2018-12-28 00:04:36 +00:00
while ( NET_GetPacket ( svs . sockets , 0 ) > = 0 )
2011-12-05 15:23:40 +00:00
{
}
------------------------------------------------------------------------
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
net_message . packing = SZ_RAWBYTES ;
net_message . cursize = 0 ;
2016-10-22 07:06:51 +00:00
MSG_BeginReading ( net_message . prim ) ;
2011-12-05 15:23:40 +00:00
2016-10-22 07:06:51 +00:00
if ( connectinfo . subprotocol = = CPNQ_ID & & ! proquakeangles )
2011-10-27 15:46:36 +00:00
{
2014-03-30 08:55:06 +00:00
net_from = connectinfo . adr ;
2014-12-23 15:26:42 +00:00
Cmd_TokenizeString ( va ( " connect %i %i %i \" \\ name \\ unconnected \" " , NQ_NETCHAN_VERSION , 0 , SV_NewChallenge ( ) ) , false , false ) ;
2011-10-27 15:46:36 +00:00
2019-07-02 04:12:20 +00:00
SVC_DirectConnect ( 0 ) ;
2011-10-27 15:46:36 +00:00
}
2016-07-12 00:40:13 +00:00
else if ( connectinfo . subprotocol = = CPNQ_BJP3 )
{
net_from = connectinfo . adr ;
Cmd_TokenizeString ( va ( " connect %i %i %i \" \\ name \\ unconnected \\ mod \\ %i \" " , NQ_NETCHAN_VERSION , 0 , SV_NewChallenge ( ) , PROTOCOL_VERSION_BJP3 ) , false , false ) ;
2019-07-02 04:12:20 +00:00
SVC_DirectConnect ( 0 ) ;
2016-07-12 00:40:13 +00:00
}
2015-12-28 17:41:39 +00:00
else if ( connectinfo . subprotocol = = CPNQ_FITZ666 )
------------------------------------------------------------------------
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
{
2014-03-30 08:55:06 +00:00
net_from = connectinfo . adr ;
2016-07-12 00:40:13 +00:00
Cmd_TokenizeString ( va ( " connect %i %i %i \" \\ name \\ unconnected \\ mod \\ %i \" " , NQ_NETCHAN_VERSION , 0 , SV_NewChallenge ( ) , PROTOCOL_VERSION_FITZ ) , false , false ) ;
------------------------------------------------------------------------
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
2019-07-02 04:12:20 +00:00
SVC_DirectConnect ( 0 ) ;
------------------------------------------------------------------------
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
}
2016-07-12 00:40:13 +00:00
else if ( proquakeangles )
2012-10-01 14:29:44 +00:00
{
2014-03-30 08:55:06 +00:00
net_from = connectinfo . adr ;
2014-12-23 15:26:42 +00:00
Cmd_TokenizeString ( va ( " connect %i %i %i \" \\ name \\ unconnected \\ mod \\ 1 \" " , NQ_NETCHAN_VERSION , 0 , SV_NewChallenge ( ) ) , false , false ) ;
2012-10-01 14:29:44 +00:00
2019-07-02 04:12:20 +00:00
SVC_DirectConnect ( 0 ) ;
2012-10-01 14:29:44 +00:00
}
2017-12-14 21:12:11 +00:00
else if ( 1 )
{
net_from = connectinfo . adr ;
Q_snprintfz ( net_message . data , net_message . maxsize , " xxxxconnect \\ protocol \\ darkplaces 3 \\ protocols \\ DP7 DP6 DP5 RMQ FITZ NEHAHRABJP2 NEHAHRABJP NEHAHRABJP3 QUAKE \\ challenge \\ 0x%x \\ name \\ %s " , SV_NewChallenge ( ) , name . string ) ;
Cmd_TokenizeString ( net_message . data + 4 , false , false ) ;
2019-07-02 04:12:20 +00:00
SVC_DirectConnect ( 0 ) ;
2017-12-14 21:12:11 +00:00
}
2011-10-27 15:46:36 +00:00
else
2014-03-30 08:55:06 +00:00
CL_ConnectToDarkPlaces ( " " , & connectinfo . adr ) ;
2017-08-29 02:29:06 +00:00
// connectinfo.trying = false;
2009-02-08 04:39:46 +00:00
}
else
2015-09-01 04:45:15 +00:00
# endif
2014-05-10 13:42:13 +00:00
{
if ( ! connectinfo . challenge )
connectinfo . challenge = rand ( ) ;
2019-03-23 07:06:37 +00:00
CL_SendConnectPacket ( NULL , 8192 - 16 , connectinfo . fteext1 , connectinfo . fteext2 , connectinfo . ezext1 , 0 , sv_guidhash . string ) ;
2014-05-10 13:42:13 +00:00
}
2016-07-12 00:40:13 +00:00
2004-08-23 00:15:46 +00:00
return ;
}
# endif
2014-03-30 08:55:06 +00:00
if ( ! connectinfo . trying )
2004-08-23 00:15:46 +00:00
return ;
2017-01-24 10:27:39 +00:00
if ( startuppending | | r_blockvidrestart )
return ; //don't send connect requests until we've actually initialised fully. this isn't a huge issue, but makes the startup prints a little more sane.
2014-03-30 08:55:06 +00:00
2005-05-26 12:55:34 +00:00
/*
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
if ( connect_type )
{
if ( ! connect_time | | ! ( realtime - connect_time < 5.0 ) )
{
connect_time = realtime ;
NQ_BeginConnect ( cls . servername ) ;
NQ_ContinueConnect ( cls . servername ) ;
}
else
NQ_ContinueConnect ( cls . servername ) ;
return ;
}
# endif
2005-05-26 12:55:34 +00:00
*/
2014-03-30 08:55:06 +00:00
if ( connectinfo . time & & realtime - connectinfo . time < 5.0 )
2004-08-23 00:15:46 +00:00
return ;
2017-09-20 11:27:13 +00:00
# ifdef HAVE_DTLS
if ( connectinfo . dtlsupgrade ! = DTLS_ACTIVE )
# endif
2019-02-01 08:29:14 +00:00
{
if ( ! cls . sockets ) //only if its needed... we don't want to keep using a new port unless we have to
NET_InitClient ( false ) ;
}
2015-06-05 03:45:01 +00:00
2004-08-23 00:15:46 +00:00
t1 = Sys_DoubleTime ( ) ;
2014-03-30 08:55:06 +00:00
if ( ! connectinfo . istransfer )
2004-08-23 00:15:46 +00:00
{
2018-09-23 19:35:24 +00:00
host = strrchr ( cls . servername + 1 , ' @ ' ) ;
2015-07-07 02:03:31 +00:00
if ( host )
host + + ;
else
host = cls . servername ;
if ( ! NET_StringToAdr ( host , connectinfo . defaultport , & connectinfo . adr ) )
2014-03-30 08:55:06 +00:00
{
2019-01-29 07:18:07 +00:00
Cvar_Set ( & cl_disconnectreason , va ( " Bad server address \" %s \" " , host ) ) ;
2017-12-02 22:11:20 +00:00
Con_TPrintf ( " Bad server address \" %s \" \n " , host ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = false ;
SCR_EndLoadingPlaque ( ) ;
return ;
}
2017-05-18 10:24:09 +00:00
# ifdef HAVE_DTLS
if ( connectinfo . dtlsupgrade = = DTLS_ACTIVE )
{ //if we've already established a dtls connection, stick with it
if ( connectinfo . adr . prot = = NP_DGRAM )
connectinfo . adr . prot = NP_DTLS ;
}
else if ( connectinfo . adr . prot = = NP_DTLS )
{ //dtls connections start out with regular udp, and upgrade to dtls once its established that the server supports it.
connectinfo . dtlsupgrade = DTLS_REQUIRE ;
connectinfo . adr . prot = NP_DGRAM ;
}
else
{
//hostname didn't specify dtls. upgrade if we're allowed, but don't mandate it.
//connectinfo.dtlsupgrade = DTLS_TRY;
}
# endif
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
if ( ! NET_IsClientLegal ( & connectinfo . adr ) )
2004-08-23 00:15:46 +00:00
{
2019-01-29 07:18:07 +00:00
Cvar_Set ( & cl_disconnectreason , va ( " Illegal server address " ) ) ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Illegal server address \n " ) ;
2013-03-12 22:35:33 +00:00
SCR_EndLoadingPlaque ( ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = false ;
2004-08-23 00:15:46 +00:00
return ;
}
2013-06-23 02:17:02 +00:00
CL_FlushClientCommands ( ) ;
2004-08-23 00:15:46 +00:00
t2 = Sys_DoubleTime ( ) ;
2014-03-30 08:55:06 +00:00
connectinfo . time = realtime + t2 - t1 ; // for retransmit requests
2004-08-23 00:15:46 +00:00
2007-02-23 00:21:33 +00:00
Cvar_ForceSet ( & cl_servername , cls . servername ) ;
2005-08-26 22:56:51 +00:00
# ifdef Q3CLIENT
2007-10-05 17:43:26 +00:00
//Q3 clients send their cdkey to the q3 authorize server.
2005-08-26 22:56:51 +00:00
//they send this packet with the challenge.
//and the server will refuse the client if it hasn't sent it.
2014-03-30 08:55:06 +00:00
CLQ3_SendAuthPacket ( & connectinfo . adr ) ;
2005-08-26 22:56:51 +00:00
# endif
2014-03-30 08:55:06 +00:00
if ( connectinfo . istransfer )
Con_TPrintf ( " Connecting to %s(%s)... \n " , cls . servername , NET_AdrToString ( data , sizeof ( data ) , & connectinfo . adr ) ) ;
else
Con_TPrintf ( " Connecting to %s... \n " , cls . servername ) ;
2011-06-16 02:03:57 +00:00
2014-03-30 08:55:06 +00:00
if ( connectinfo . tries = = 0 )
2018-09-23 19:35:24 +00:00
if ( ! NET_EnsureRoute ( cls . sockets , " conn " , cls . servername , & connectinfo . adr ) )
2012-01-17 07:57:46 +00:00
{
2019-01-29 07:18:07 +00:00
Cvar_Set ( & cl_disconnectreason , va ( " Unable to establish connection to %s \n " , cls . servername ) ) ;
2012-01-17 07:57:46 +00:00
Con_Printf ( " Unable to establish connection to %s \n " , cls . servername ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = false ;
2013-12-08 20:06:55 +00:00
SCR_EndLoadingPlaque ( ) ;
2012-01-17 07:57:46 +00:00
return ;
}
2011-12-23 03:12:29 +00:00
contype | = 1 ; /*always try qw type connections*/
// if ((connect_tries&3)==3) || (connect_defaultport==26000))
2019-02-01 08:29:14 +00:00
# ifdef VM_UI
if ( ! UI_IsRunning ( ) ) //don't try to connect to nq servers when running a q3ui. I was getting annoying error messages from q3 servers due to this.
# endif
2011-12-23 03:12:29 +00:00
contype | = 2 ; /*try nq connections periodically (or if its the default nq port)*/
/*DP, QW, Q2, Q3*/
2019-02-01 08:29:14 +00:00
/*NOTE: ioq3 has <challenge> <gamename> args. yes, a challenge to get a challenge.*/
2011-12-23 03:12:29 +00:00
if ( contype & 1 )
{
Q_snprintfz ( data , sizeof ( data ) , " %c%c%c%cgetchallenge \n " , 255 , 255 , 255 , 255 ) ;
2018-12-28 00:04:36 +00:00
switch ( NET_SendPacket ( cls . sockets , strlen ( data ) , data , & connectinfo . adr ) )
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 NETERR_CLOGGED : //temporary failure
case NETERR_SENT : //yay, works!
break ;
default :
keeptrying = false ;
break ;
}
2011-12-23 03:12:29 +00:00
}
/*NQ*/
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
2011-12-23 03:12:29 +00:00
if ( contype & 2 )
2004-08-23 00:15:46 +00:00
{
2005-05-26 12:55:34 +00:00
sizebuf_t sb ;
memset ( & sb , 0 , sizeof ( sb ) ) ;
sb . data = data ;
sb . maxsize = sizeof ( data ) ;
2014-12-23 15:26:42 +00:00
MSG_WriteLong ( & sb , LongSwap ( NETFLAG_CTL | ( strlen ( NQ_NETCHAN_GAMENAME ) + 7 ) ) ) ;
2005-05-26 12:55:34 +00:00
MSG_WriteByte ( & sb , CCREQ_CONNECT ) ;
2014-12-23 15:26:42 +00:00
MSG_WriteString ( & sb , NQ_NETCHAN_GAMENAME ) ;
MSG_WriteByte ( & sb , NQ_NETCHAN_VERSION ) ;
2011-06-16 02:03:57 +00:00
/*NQ engines have a few extra bits on the end*/
/*proquake servers wait for us to send them a packet before anything happens,
which means it corrects for our public port if our nat uses different public ports for different remote ports
thus all nq engines claim to be proquake
*/
MSG_WriteByte ( & sb , 1 ) ; /*'mod'*/
MSG_WriteByte ( & sb , 34 ) ; /*'mod' version*/
MSG_WriteByte ( & sb , 0 ) ; /*flags*/
MSG_WriteLong ( & sb , strtoul ( password . string , NULL , 0 ) ) ; /*password*/
2011-12-23 03:12:29 +00:00
/*FTE servers will detect this string and treat it as a qw challenge instead (if it allows qw clients), so protocol choice is deterministic*/
2013-09-06 22:57:44 +00:00
if ( contype & 1 )
MSG_WriteString ( & sb , " getchallenge " ) ;
2011-06-16 02:03:57 +00:00
* ( int * ) sb . data = LongSwap ( NETFLAG_CTL | sb . cursize ) ;
2018-12-28 00:04:36 +00:00
switch ( NET_SendPacket ( cls . sockets , sb . cursize , sb . data , & connectinfo . adr ) )
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 NETERR_CLOGGED : //temporary failure
case NETERR_SENT : //yay, works!
break ;
default :
keeptrying = false ;
break ;
}
2004-08-23 00:15:46 +00:00
}
# endif
2005-05-26 12:55:34 +00:00
2014-03-30 08:55:06 +00:00
connectinfo . tries + + ;
2013-12-08 20:06:55 +00:00
if ( ! keeptrying )
{
2019-01-29 07:18:07 +00:00
Cvar_Set ( & cl_disconnectreason , va ( " No route to \" %s \" , giving up \n " , cls . servername ) ) ;
2013-12-08 20:06:55 +00:00
Con_TPrintf ( " No route to host, giving up \n " ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = false ;
2013-12-08 20:06:55 +00:00
SCR_EndLoadingPlaque ( ) ;
}
2005-05-26 12:55:34 +00:00
}
2015-07-07 02:03:31 +00:00
void CL_BeginServerConnect ( const char * host , int port , qboolean noproxy )
2004-08-23 00:15:46 +00:00
{
2015-07-07 02:03:31 +00:00
if ( strstr ( host , " :// " ) | | ! * cl_proxyaddr . string | | noproxy )
Q_strncpyz ( cls . servername , host , sizeof ( cls . servername ) ) ;
else
Q_snprintfz ( cls . servername , sizeof ( cls . servername ) , " %s@%s " , host , cl_proxyaddr . string ) ;
2011-06-16 02:03:57 +00:00
if ( ! port )
port = cl_defaultport . value ;
2017-05-18 10:24:09 +00:00
# ifdef HAVE_DTLS
NET_DTLS_Disconnect ( cls . sockets , & connectinfo . adr ) ;
# endif
2014-03-30 08:55:06 +00:00
memset ( & connectinfo , 0 , sizeof ( connectinfo ) ) ;
2018-12-06 04:55:35 +00:00
if ( * cl_disconnectreason . string )
Cvar_Set ( & cl_disconnectreason , " " ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = true ;
connectinfo . defaultport = port ;
connectinfo . protocol = CP_UNKNOWN ;
2009-04-06 00:34:32 +00:00
SCR_SetLoadingStage ( LS_CONNECTION ) ;
2004-08-23 00:15:46 +00:00
CL_CheckForResend ( ) ;
}
2011-06-16 02:03:57 +00:00
2004-08-23 00:15:46 +00:00
void CL_BeginServerReconnect ( void )
{
2004-11-29 01:21:00 +00:00
# ifndef CLIENTONLY
2004-08-23 00:15:46 +00:00
if ( isDedicated )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Connect ignored - dedicated. set a renderer first \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2017-05-18 10:24:09 +00:00
# endif
# ifdef HAVE_DTLS
NET_DTLS_Disconnect ( cls . sockets , & connectinfo . adr ) ;
connectinfo . dtlsupgrade = 0 ;
2005-06-04 04:20:20 +00:00
# endif
2018-12-06 04:55:35 +00:00
if ( * cl_disconnectreason . string )
Cvar_Set ( & cl_disconnectreason , " " ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = true ;
connectinfo . istransfer = false ;
connectinfo . time = 0 ;
2019-02-01 08:29:14 +00:00
NET_InitClient ( false ) ;
2014-03-30 08:55:06 +00:00
}
void CL_Transfer_f ( void )
{
char oldguid [ 64 ] ;
char * server ;
if ( Cmd_Argc ( ) ! = 2 )
{
Con_TPrintf ( " usage: cl_transfer <server> \n " ) ;
return ;
}
server = Cmd_Argv ( 1 ) ;
if ( ! * server )
{
//if they didn't specify a server, abort any active transfer/connection.
connectinfo . trying = false ;
return ;
}
Q_strncpyz ( oldguid , connectinfo . guid , sizeof ( oldguid ) ) ;
memset ( & connectinfo , 0 , sizeof ( connectinfo ) ) ;
if ( NET_StringToAdr ( server , 0 , & connectinfo . adr ) )
{
if ( cls . state )
{
connectinfo . istransfer = true ;
Q_strncpyz ( connectinfo . guid , oldguid , sizeof ( oldguid ) ) ; //retain the same guid on transfers
}
2018-12-06 04:55:35 +00:00
Cvar_Set ( & cl_disconnectreason , " Transferring.... " ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = true ;
connectinfo . defaultport = cl_defaultport . value ;
connectinfo . protocol = CP_UNKNOWN ;
SCR_SetLoadingStage ( LS_CONNECTION ) ;
CL_CheckForResend ( ) ;
}
else
{
Con_Printf ( " cl_transfer: bad address \n " ) ;
}
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = =
CL_Connect_f
= = = = = = = = = = = = = = = =
*/
2018-04-15 02:48:23 +00:00
void CL_Connect_c ( int argn , const char * partial , struct xcommandargcompletioncb_s * ctx ) ;
2004-08-23 00:15:46 +00:00
void CL_Connect_f ( void )
{
char * server ;
if ( Cmd_Argc ( ) ! = 2 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " usage: connect <server> \n " ) ;
2005-06-15 04:45:26 +00:00
return ;
2004-08-23 00:15:46 +00:00
}
2005-06-15 04:45:26 +00:00
2004-08-23 00:15:46 +00:00
server = Cmd_Argv ( 1 ) ;
2017-12-09 21:22:46 +00:00
server = strcpy ( alloca ( strlen ( server ) + 1 ) , server ) ;
2004-08-23 00:15:46 +00:00
2014-03-30 08:55:06 +00:00
# ifndef CLIENTONLY
if ( sv . state = = ss_clustermode )
2018-12-06 04:55:35 +00:00
CL_Disconnect ( NULL ) ;
2014-03-30 08:55:06 +00:00
else
# endif
CL_Disconnect_f ( ) ;
2004-08-23 00:15:46 +00:00
2015-07-07 02:03:31 +00:00
CL_BeginServerConnect ( server , 0 , false ) ;
}
2015-07-27 08:21:34 +00:00
# if defined(CL_MASTER)
2015-07-07 02:03:31 +00:00
static void CL_ConnectBestRoute_f ( void )
{
char server [ 1024 ] ;
int proxies ;
int directcost , chainedcost ;
if ( Cmd_Argc ( ) ! = 2 )
{
Con_TPrintf ( " usage: connectbr <server> \n " ) ;
return ;
}
proxies = Master_FindBestRoute ( Cmd_Argv ( 1 ) , server , sizeof ( server ) , & directcost , & chainedcost ) ;
if ( ! * server )
{
Con_TPrintf ( " Unable to route to server \n " ) ;
return ;
}
else if ( proxies < 0 )
Con_TPrintf ( " Routing database is not initialised, connecting directly \n " ) ;
else if ( ! proxies )
Con_TPrintf ( " Routing table favours a direct connection \n " ) ;
else if ( proxies = = 1 )
Con_TPrintf ( " Routing table favours a single proxy (%ims vs %ims) \n " , chainedcost , directcost ) ;
else
Con_TPrintf ( " Routing table favours chaining through %i proxies (%ims vs %ims) \n " , proxies , chainedcost , directcost ) ;
# ifndef CLIENTONLY
if ( sv . state = = ss_clustermode )
2018-12-06 04:55:35 +00:00
CL_Disconnect ( NULL ) ;
2015-07-07 02:03:31 +00:00
else
# endif
CL_Disconnect_f ( ) ;
CL_BeginServerConnect ( server , 0 , true ) ;
2004-08-23 00:15:46 +00:00
}
2015-07-27 08:21:34 +00:00
# endif
2004-08-23 00:15:46 +00:00
2015-07-07 02:03:31 +00:00
static void CL_Join_f ( void )
2005-01-13 23:33:00 +00:00
{
char * server ;
if ( Cmd_Argc ( ) ! = 2 )
{
if ( cls . state )
{ //Hmm. This server sucks.
2013-09-06 22:57:44 +00:00
if ( ( cls . z_ext & Z_EXT_JOIN_OBSERVE ) | | cls . protocol ! = CP_QUAKEWORLD )
2005-01-13 23:33:00 +00:00
Cmd_ForwardToServer ( ) ;
else
Cbuf_AddText ( " \n spectator 0;reconnect \n " , RESTRICT_LOCAL ) ;
return ;
}
Con_Printf ( " join requires a connection or servername/ip \n " ) ;
2005-06-15 04:45:26 +00:00
return ;
2005-01-13 23:33:00 +00:00
}
2005-06-15 04:45:26 +00:00
2005-01-13 23:33:00 +00:00
server = Cmd_Argv ( 1 ) ;
2017-12-09 21:22:46 +00:00
server = strcpy ( alloca ( strlen ( server ) + 1 ) , server ) ;
2005-01-13 23:33:00 +00:00
CL_Disconnect_f ( ) ;
Cvar_Set ( & spectator , " 0 " ) ;
2015-07-07 02:03:31 +00:00
CL_BeginServerConnect ( server , 0 , false ) ;
2005-01-13 23:33:00 +00:00
}
void CL_Observe_f ( void )
{
char * server ;
if ( Cmd_Argc ( ) ! = 2 )
{
if ( cls . state )
2013-09-06 22:57:44 +00:00
{
if ( ( cls . z_ext & Z_EXT_JOIN_OBSERVE ) | | cls . protocol ! = CP_QUAKEWORLD )
2005-01-13 23:33:00 +00:00
Cmd_ForwardToServer ( ) ;
2013-09-06 22:57:44 +00:00
else //Hmm. This server sucks.
2005-01-13 23:33:00 +00:00
Cbuf_AddText ( " \n spectator 1;reconnect \n " , RESTRICT_LOCAL ) ;
return ;
}
Con_Printf ( " observe requires a connection or servername/ip \n " ) ;
2005-06-15 04:45:26 +00:00
return ;
2005-01-13 23:33:00 +00:00
}
2005-06-15 04:45:26 +00:00
2005-01-13 23:33:00 +00:00
server = Cmd_Argv ( 1 ) ;
2017-12-09 21:22:46 +00:00
server = strcpy ( alloca ( strlen ( server ) + 1 ) , server ) ;
2005-01-13 23:33:00 +00:00
CL_Disconnect_f ( ) ;
Cvar_Set ( & spectator , " 1 " ) ;
2015-07-07 02:03:31 +00:00
CL_BeginServerConnect ( server , 0 , false ) ;
2005-01-13 23:33:00 +00:00
}
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
void CLNQ_Connect_f ( void )
{
char * server ;
if ( Cmd_Argc ( ) ! = 2 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " usage: connect <server> \n " ) ;
2005-06-15 04:45:26 +00:00
return ;
2004-08-23 00:15:46 +00:00
}
2005-06-15 04:45:26 +00:00
2004-08-23 00:15:46 +00:00
server = Cmd_Argv ( 1 ) ;
2017-12-09 21:22:46 +00:00
server = strcpy ( alloca ( strlen ( server ) + 1 ) , server ) ;
2004-08-23 00:15:46 +00:00
CL_Disconnect_f ( ) ;
2015-07-07 02:03:31 +00:00
CL_BeginServerConnect ( server , 26000 , true ) ;
2004-08-23 00:15:46 +00:00
}
# endif
2013-03-31 04:21:08 +00:00
2008-11-09 22:29:28 +00:00
# ifdef IRCCONNECT
void CL_IRCConnect_f ( void )
2005-11-30 01:20:53 +00:00
{
CL_Disconnect_f ( ) ;
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 ( FTENET_AddToCollection ( cls . sockets , " TCP " , Cmd_Argv ( 2 ) , NA_IP , NP_IRC , false ) )
2005-11-30 01:20:53 +00:00
{
2008-11-09 22:29:28 +00:00
char * server ;
server = Cmd_Argv ( 1 ) ;
2005-11-30 01:20:53 +00:00
2015-07-07 02:03:31 +00:00
CL_BeginServerConnect ( va ( " irc://%s " , server ) , 0 , true ) ;
2005-11-30 01:20:53 +00:00
}
2008-11-09 22:29:28 +00:00
}
# endif
2005-11-30 01:20:53 +00:00
2008-11-09 22:29:28 +00:00
# ifdef TCPCONNECT
void CL_TCPConnect_f ( void )
{
2014-03-30 08:55:06 +00:00
if ( ! Q_strcasecmp ( Cmd_Argv ( 0 ) , " tlsconnect " ) )
Cbuf_InsertText ( va ( " connect tls://%s " , Cmd_Argv ( 1 ) ) , Cmd_ExecLevel , true ) ;
else
Cbuf_InsertText ( va ( " connect tcp://%s " , Cmd_Argv ( 1 ) ) , Cmd_ExecLevel , true ) ;
2005-11-30 01:20:53 +00:00
}
# endif
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = = =
CL_Rcon_f
Send the rest of the command line over as
an unconnected command .
= = = = = = = = = = = = = = = = = = = = =
*/
void CL_Rcon_f ( void )
{
char message [ 1024 ] ;
2007-08-22 16:52:13 +00:00
char * password ;
2004-08-23 00:15:46 +00:00
int i ;
netadr_t to ;
2007-08-22 16:52:13 +00:00
i = 1 ;
password = rcon_password . string ;
if ( ! * password ) //FIXME: this is strange...
2004-08-23 00:15:46 +00:00
{
2007-08-21 17:16:52 +00:00
if ( Cmd_Argc ( ) < 3 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " 'rcon_password' is not set. \n " ) ;
Con_TPrintf ( " usage: rcon (password) <command> \n " ) ;
2007-08-21 17:16:52 +00:00
return ;
}
2007-08-22 16:52:13 +00:00
password = Cmd_Argv ( 1 ) ;
2007-08-21 17:16:52 +00:00
i = 2 ;
}
else
{
if ( Cmd_Argc ( ) < 2 )
{
2007-08-22 16:52:13 +00:00
Con_Printf ( " usage: rcon <command> \n " ) ;
2007-08-21 17:16:52 +00:00
return ;
}
2004-08-23 00:15:46 +00:00
}
2017-12-09 22:10:51 +00:00
message [ 0 ] = ( char ) 255 ;
message [ 1 ] = ( char ) 255 ;
message [ 2 ] = ( char ) 255 ;
message [ 3 ] = ( char ) 255 ;
2004-08-23 00:15:46 +00:00
message [ 4 ] = 0 ;
2007-08-21 17:16:52 +00:00
Q_strncatz ( message , " rcon " , sizeof ( message ) ) ;
2018-08-21 18:52:25 +00:00
if ( cl_crypt_rcon . ival )
{
char cryptpass [ 1024 ] , crypttime [ 64 ] ;
const char * hex = " 0123456789ABCDEF " ; //must be upper-case for compat with mvdsv.
2018-09-01 04:18:08 +00:00
time_t clienttime = time ( NULL ) ;
2018-08-21 18:52:25 +00:00
size_t digestsize ;
unsigned char digest [ 64 ] ;
const unsigned char * * tokens = alloca ( sizeof ( * tokens ) * ( 4 + Cmd_Argc ( ) * 2 ) ) ;
size_t * tokensizes = alloca ( sizeof ( * tokensizes ) * ( 4 + Cmd_Argc ( ) * 2 ) ) ;
int j , k ;
for ( j = 0 ; j < sizeof ( time_t ) ; j + + )
{ //little-endian byte order, but big-endian nibble order. just screwed. for compat with ezquake.
crypttime [ j * 2 + 0 ] = hex [ ( clienttime > > ( j * 8 + 4 ) ) & 0xf ] ;
crypttime [ j * 2 + 1 ] = hex [ ( clienttime > > ( j * 8 ) ) & 0xf ] ;
}
crypttime [ j * 2 ] = 0 ;
tokens [ 0 ] = " rcon " ;
tokens [ 1 ] = password ;
tokens [ 2 ] = crypttime ;
tokens [ 3 ] = " " ;
for ( j = 0 ; j < Cmd_Argc ( ) - i ; j + + )
{
tokens [ 4 + j * 2 + 0 ] = Cmd_Argv ( i + j ) ;
tokens [ 4 + j * 2 + 1 ] = " " ;
}
for ( k = 0 ; k < 4 + j * 2 ; k + + )
tokensizes [ k ] = strlen ( tokens [ k ] ) ;
digestsize = SHA1_m ( digest , sizeof ( digest ) , k , tokens , tokensizes ) ;
for ( j = 0 ; j < digestsize ; j + + )
{
cryptpass [ j * 2 + 0 ] = hex [ digest [ j ] > > 4 ] ;
cryptpass [ j * 2 + 1 ] = hex [ digest [ j ] & 0xf ] ;
}
cryptpass [ j * 2 ] = 0 ;
Q_strncatz ( message , cryptpass , sizeof ( message ) ) ;
Q_strncatz ( message , crypttime , sizeof ( message ) ) ;
}
else
Q_strncatz ( message , password , sizeof ( message ) ) ;
2007-08-21 17:16:52 +00:00
Q_strncatz ( message , " " , sizeof ( message ) ) ;
2004-08-23 00:15:46 +00:00
2007-08-21 17:16:52 +00:00
for ( ; i < Cmd_Argc ( ) ; i + + )
2004-08-23 00:15:46 +00:00
{
2007-08-21 17:16:52 +00:00
Q_strncatz ( message , Cmd_Argv ( i ) , sizeof ( message ) ) ;
Q_strncatz ( message , " " , sizeof ( message ) ) ;
2004-08-23 00:15:46 +00:00
}
if ( cls . state > = ca_connected )
to = cls . netchan . remote_address ;
else
{
if ( ! strlen ( rcon_address . string ) )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " You must either be connected, \n or set the 'rcon_address' cvar \n to issue rcon commands \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2016-02-15 06:01:17 +00:00
if ( ! NET_StringToAdr ( rcon_address . string , PORT_QWSERVER , & to ) )
{
Con_Printf ( " Unable to resolve target address \n " ) ;
return ;
}
2004-08-23 00:15:46 +00:00
}
2005-06-15 04:45:26 +00:00
2018-12-28 00:04:36 +00:00
NET_SendPacket ( cls . sockets , strlen ( message ) + 1 , message , & to ) ;
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
void CL_BlendFog ( fogstate_t * result , fogstate_t * oldf , float time , fogstate_t * newf )
{
2014-08-15 02:20:41 +00:00
float nfrac ;
2014-03-30 08:55:06 +00:00
if ( time > = newf - > time )
nfrac = 1 ;
else if ( time < oldf - > time )
nfrac = 0 ;
else
nfrac = ( time - oldf - > time ) / ( newf - > time - oldf - > time ) ;
FloatInterpolate ( oldf - > alpha , nfrac , newf - > alpha , result - > alpha ) ;
FloatInterpolate ( oldf - > depthbias , nfrac , newf - > depthbias , result - > depthbias ) ;
FloatInterpolate ( oldf - > density , nfrac , newf - > density , result - > density ) ; //this should be non-linear, but that sort of maths is annoying.
VectorInterpolate ( oldf - > colour , nfrac , newf - > colour , result - > colour ) ;
result - > time = time ;
}
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
void CL_ResetFog ( int ftype )
2014-03-30 08:55:06 +00:00
{
//blend from the current state, not the old state. this means things work properly if we've not reached the new state yet.
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
CL_BlendFog ( & cl . oldfog [ ftype ] , & cl . oldfog [ ftype ] , realtime , & cl . fog [ ftype ] ) ;
2014-03-30 08:55:06 +00:00
//reset the new state to defaults, to be filled in by the caller.
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
memset ( & cl . fog [ ftype ] , 0 , sizeof ( cl . fog [ ftype ] ) ) ;
cl . fog [ ftype ] . time = realtime ;
cl . fog [ ftype ] . density = 0 ;
2018-04-15 02:48:23 +00:00
cl . fog [ ftype ] . colour [ 0 ] = //SRGBf(0.3);
cl . fog [ ftype ] . colour [ 1 ] = //SRGBf(0.3);
cl . fog [ ftype ] . colour [ 2 ] = SRGBf ( 0.3 ) ;
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
cl . fog [ ftype ] . alpha = 1 ;
cl . fog [ ftype ] . depthbias = 0 ;
2014-03-30 08:55:06 +00:00
/*
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
cl . fog [ ftype ] . end = 16384 ;
cl . fog [ ftype ] . height = 1 < < 30 ;
cl . fog [ ftype ] . fadedepth = 128 ;
2014-03-30 08:55:06 +00:00
*/
}
2004-08-23 00:15:46 +00:00
2019-08-19 16:15:31 +00:00
static void CL_ReconfigureCommands ( int newgame )
{
static int oldgame ;
extern void SCR_SizeUp_f ( void ) ; //cl_screen
extern void SCR_SizeDown_f ( void ) ; //cl_screen
2019-08-20 11:46:53 +00:00
# ifdef QUAKESTATS
2019-08-19 16:15:31 +00:00
extern void IN_Weapon ( void ) ; //cl_input
extern void IN_FireDown ( void ) ; //cl_input
extern void IN_FireUp ( void ) ; //cl_input
2019-08-20 11:46:53 +00:00
# endif
2019-08-19 16:15:31 +00:00
extern void CL_Say_f ( void ) ;
extern void CL_SayTeam_f ( void ) ;
static const struct
{
const char * name ;
void ( * func ) ( void ) ;
const char * description ;
unsigned int problemgames ; //1<<CP_*
} problemcmds [ ] =
# define Q1 ((1u<<CP_QUAKEWORLD)|(1u<<CP_NETQUAKE))
# define Q2 (1u<<CP_QUAKE2)
# define Q3 (1u<<CP_QUAKE3)
{
{ " sizeup " , SCR_SizeUp_f , " Increase viewsize " , Q3 } ,
{ " sizedown " , SCR_SizeDown_f , " Decrease viewsize " , Q3 } ,
2019-08-20 11:46:53 +00:00
# ifdef QUAKESTATS
2019-08-19 16:15:31 +00:00
{ " weapon " , IN_Weapon , " Configures weapon priorities for the next +attack as an alternative for the impulse command " , ~ Q1 } ,
{ " +fire " , IN_FireDown , " '+fire 8 7' will fire lg if you have it and fall back on rl if you don't, and just fire your current weapon if neither are held. Releasing fire will then switch away to exploit a bug in most mods to deny your weapon upgrades to your killer. " , ~ Q1 } ,
{ " -fire " , IN_FireUp , NULL , ~ Q1 } ,
2019-08-20 11:46:53 +00:00
# endif
2019-08-19 16:15:31 +00:00
{ " say " , CL_Say_f , NULL , Q3 } ,
{ " say_team " , CL_SayTeam_f , NULL , Q3 } ,
} ;
# undef Q1
# undef Q2
# undef Q3
size_t i ;
newgame = 1 < < newgame ;
for ( i = 0 ; i < countof ( problemcmds ) ; i + + )
{
if ( ( problemcmds [ i ] . problemgames & newgame ) & & ! ( problemcmds [ i ] . problemgames & oldgame ) )
Cmd_RemoveCommand ( problemcmds [ i ] . name ) ;
if ( ! ( problemcmds [ i ] . problemgames & newgame ) & & ( problemcmds [ i ] . problemgames & oldgame ) )
Cmd_AddCommandD ( problemcmds [ i ] . name , problemcmds [ i ] . func , problemcmds [ i ] . description ) ;
}
oldgame = newgame ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = = =
CL_ClearState
2018-09-23 19:35:24 +00:00
gamestart = = true says that we ' re changing map , as opposed to servers .
2004-08-23 00:15:46 +00:00
= = = = = = = = = = = = = = = = = = = = =
*/
2018-09-23 19:35:24 +00:00
void CL_ClearState ( qboolean gamestart )
2004-08-23 00:15:46 +00:00
{
2015-08-28 03:13:45 +00:00
extern cvar_t cfg_save_auto ;
2015-02-02 08:01:53 +00:00
int i , j ;
2018-09-23 19:35:24 +00:00
downloadlist_t * pendingdownloads , * faileddownloads ;
2004-08-23 00:15:46 +00:00
# ifndef CLIENTONLY
# define serverrunning (sv.state != ss_dead)
2013-05-03 04:28:08 +00:00
# define tolocalserver NET_IsLoopBackAddress(&cls.netchan.remote_address)
2004-08-23 00:15:46 +00:00
# else
# define serverrunning false
# define tolocalserver false
# define SV_UnspawnServer()
# endif
2019-08-19 16:15:31 +00:00
CL_ReconfigureCommands ( cls . protocol ) ;
2012-09-30 05:52:03 +00:00
CL_UpdateWindowTitle ( ) ;
2005-02-28 07:16:19 +00:00
CL_AllowIndependantSendCmd ( false ) ; //model stuff could be a problem.
2004-08-23 00:15:46 +00:00
S_StopAllSounds ( true ) ;
2012-02-27 12:23:15 +00:00
S_UntouchAll ( ) ;
2006-10-05 22:11:17 +00:00
S_ResetFailedLoad ( ) ;
2004-08-23 00:15:46 +00:00
Cvar_ApplyLatches ( CVAR_SERVEROVERRIDE ) ;
2005-06-15 04:45:26 +00:00
Con_DPrintf ( " Clearing memory \n " ) ;
2004-08-23 00:15:46 +00:00
if ( ! serverrunning | | ! tolocalserver )
{
2014-03-30 08:55:06 +00:00
# ifndef CLIENTONLY
if ( serverrunning & & sv . state ! = ss_clustermode )
2004-08-23 00:15:46 +00:00
SV_UnspawnServer ( ) ;
2014-03-30 08:55:06 +00:00
# endif
2004-08-23 00:15:46 +00:00
Mod_ClearAll ( ) ;
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
r_regsequence + + ;
2005-06-15 04:45:26 +00:00
2004-08-23 00:15:46 +00:00
Cvar_ApplyLatches ( CVAR_LATCH ) ;
}
2009-04-06 00:34:32 +00:00
CL_ClearParseState ( ) ;
CL_ClearTEnts ( ) ;
2004-08-23 00:15:46 +00:00
CL_ClearCustomTEnts ( ) ;
2012-11-27 03:23:19 +00:00
Surf_ClearLightmaps ( ) ;
2014-09-17 03:04:08 +00:00
# ifdef HEXEN2
2010-08-16 02:03:02 +00:00
T_FreeInfoStrings ( ) ;
2014-09-17 03:04:08 +00:00
# endif
2016-10-22 07:06:51 +00:00
SCR_ShowPic_ClearAll ( false ) ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
if ( cl . playerview [ 0 ] . playernum = = - 1 )
2004-08-23 00:15:46 +00:00
{ //left over from q2 connect.
2013-05-03 04:28:08 +00:00
Media_StopFilm ( true ) ;
2004-08-23 00:15:46 +00:00
}
2005-10-01 03:09:17 +00:00
for ( i = 0 ; i < UPDATE_BACKUP ; i + + )
{
2013-03-12 22:53:23 +00:00
if ( cl . inframes [ i ] . packet_entities . entities )
2008-11-09 22:29:28 +00:00
{
2013-03-12 22:53:23 +00:00
Z_Free ( cl . inframes [ i ] . packet_entities . entities ) ;
cl . inframes [ i ] . packet_entities . entities = NULL ;
2008-11-09 22:29:28 +00:00
}
2005-10-01 03:09:17 +00:00
}
2005-08-26 22:56:51 +00:00
if ( cl . lerpents )
BZ_Free ( cl . lerpents ) ;
2014-06-30 21:57:35 +00:00
if ( cl . particle_ssprecaches )
{
for ( i = 0 ; i < MAX_SSPARTICLESPRE ; i + + )
if ( cl . particle_ssname [ i ] )
free ( cl . particle_ssname [ i ] ) ;
}
2015-02-02 08:01:53 +00:00
if ( cl . particle_csprecaches )
{
for ( i = 0 ; i < MAX_CSPARTICLESPRE ; i + + )
if ( cl . particle_csname [ i ] )
free ( cl . particle_csname [ i ] ) ;
}
2015-03-03 00:14:43 +00:00
# ifdef Q2CLIENT
for ( i = 0 ; i < Q2MAX_IMAGES ; i + + )
if ( cl . image_name [ i ] )
BZ_Free ( cl . image_name [ i ] ) ;
for ( i = 0 ; i < Q2MAX_ITEMS ; i + + )
if ( cl . item_name [ i ] )
BZ_Free ( cl . item_name [ i ] ) ;
# endif
2005-08-26 22:56:51 +00:00
2017-05-18 10:24:09 +00:00
while ( cl . itemtimers )
{
struct itemtimer_s * t = cl . itemtimers ;
cl . itemtimers = t - > next ;
Z_Free ( t ) ;
}
2018-09-23 19:35:24 +00:00
if ( ! gamestart )
2006-01-13 06:27:18 +00:00
{
downloadlist_t * next ;
while ( cl . downloadlist )
{
next = cl . downloadlist - > next ;
Z_Free ( cl . downloadlist ) ;
cl . downloadlist = next ;
}
while ( cl . faileddownloads )
{
next = cl . faileddownloads - > next ;
Z_Free ( cl . faileddownloads ) ;
cl . faileddownloads = next ;
}
}
2018-09-23 19:35:24 +00:00
pendingdownloads = cl . downloadlist ;
faileddownloads = cl . faileddownloads ;
2006-01-13 06:27:18 +00:00
2016-01-18 05:22:07 +00:00
# ifdef Q2CLIENT
for ( i = 0 ; i < countof ( cl . configstring_general ) ; i + + )
{
2018-06-18 16:44:29 +00:00
if ( cl . configstring_general [ i ] )
2016-01-18 05:22:07 +00:00
Z_Free ( cl . configstring_general [ i ] ) ;
}
# endif
2015-02-02 08:01:53 +00:00
for ( i = 0 ; i < MAX_SPLITS ; i + + )
{
for ( j = 0 ; j < MAX_CL_STATS ; j + + )
if ( cl . playerview [ i ] . statsstr [ j ] )
Z_Free ( cl . playerview [ i ] . statsstr [ j ] ) ;
}
2016-07-12 00:40:13 +00:00
Z_Free ( cl . windowtitle ) ;
2018-07-05 16:21:44 +00:00
InfoBuf_Clear ( & cl . serverinfo , true ) ;
2018-07-22 11:49:37 +00:00
for ( i = 0 ; i < MAX_CLIENTS ; i + + )
InfoBuf_Clear ( & cl . players [ i ] . userinfo , true ) ;
2004-08-23 00:15:46 +00:00
// wipe the entire cl structure
memset ( & cl , 0 , sizeof ( cl ) ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
CL_ResetFog ( 0 ) ;
CL_ResetFog ( 1 ) ;
2011-03-31 02:32:32 +00:00
2017-10-12 12:02:25 +00:00
cl . protocol_qw = PROTOCOL_VERSION_QW ; //until we get an svc_serverdata
2012-02-12 05:18:31 +00:00
cl . allocated_client_slots = QWMAX_CLIENTS ;
2011-04-30 17:21:10 +00:00
# ifndef CLIENTONLY
2012-11-27 03:23:19 +00:00
//FIXME: we should just set it to 0 to make sure its set up properly elsewhere.
2011-04-30 17:21:10 +00:00
if ( sv . state )
cl . allocated_client_slots = sv . allocated_client_slots ;
# endif
2018-07-05 16:21:44 +00:00
// SZ_Clear (&cls.netchan.message);
2004-08-23 00:15:46 +00:00
2006-01-28 19:04:13 +00:00
r_worldentity . model = NULL ;
2005-06-15 04:45:26 +00:00
// clear other arrays
2006-05-11 03:14:41 +00:00
// memset (cl_dlights, 0, sizeof(cl_dlights));
2019-09-10 15:40:04 +00:00
Z_Free ( cl_lightstyle ) ;
cl_lightstyle = NULL ;
cl_max_lightstyles = 0 ;
2004-08-23 00:15:46 +00:00
2009-11-04 21:16:50 +00:00
rtlights_first = rtlights_max = RTL_FIRST ;
2006-05-11 03:14:41 +00:00
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < MAX_SPLITS ; i + + )
2012-07-05 19:42:36 +00:00
{
VectorSet ( cl . playerview [ i ] . gravitydir , 0 , 0 , - 1 ) ;
2013-06-23 02:17:02 +00:00
cl . playerview [ i ] . viewheight = DEFAULT_VIEWHEIGHT ;
2014-10-05 20:04:11 +00:00
cl . playerview [ i ] . maxspeed = 320 ;
cl . playerview [ i ] . entgravity = 1 ;
2016-02-10 23:23:43 +00:00
2018-07-05 16:21:44 +00:00
cl . playerview [ i ] . chatstate = atoi ( InfoBuf_ValueForKey ( & cls . userinfo [ i ] , " chat " ) ) ;
2012-07-05 19:42:36 +00:00
}
2015-09-01 04:45:15 +00:00
# ifdef QUAKESTATS
for ( i = 0 ; i < MAX_CLIENTS ; i + + ) //in case some server doesn't support it
2014-11-01 09:09:58 +00:00
cl . players [ i ] . stats [ STAT_VIEWHEIGHT ] = cl . players [ i ] . statsf [ STAT_VIEWHEIGHT ] = DEFAULT_VIEWHEIGHT ;
2015-09-01 04:45:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
cl . minpitch = - 70 ;
cl . maxpitch = 80 ;
2005-05-26 12:55:34 +00:00
cl . oldgametime = 0 ;
cl . gametime = 0 ;
cl . gametimemark = 0 ;
2014-05-10 13:42:13 +00:00
cl . splitclients = 1 ;
2015-06-14 01:28:01 +00:00
cl . autotrack_hint = - 1 ;
cl . autotrack_killer = - 1 ;
2018-09-23 19:35:24 +00:00
cl . downloadlist = pendingdownloads ;
cl . faileddownloads = faileddownloads ;
2015-08-28 03:13:45 +00:00
if ( cfg_save_auto . ival & & Cvar_UnsavedArchive ( ) )
Cmd_ExecuteString ( " cfg_save \n " , RESTRICT_LOCAL ) ;
2019-01-29 20:38:12 +00:00
# ifdef CL_MASTER
2017-12-09 21:22:46 +00:00
MasterInfo_WriteServers ( ) ;
2019-01-29 20:38:12 +00:00
# endif
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = = =
CL_Disconnect
Sends a disconnect message to the server
This is also called on Host_Error , so it shouldn ' t cause any errors
= = = = = = = = = = = = = = = = = = = = =
*/
2018-12-06 04:55:35 +00:00
void CL_Disconnect ( const char * reason )
2004-08-23 00:15:46 +00:00
{
2006-03-12 04:33:22 +00:00
qbyte final [ 12 ] ;
2017-05-28 15:42:32 +00:00
int i ;
2004-08-23 00:15:46 +00:00
2018-12-06 04:55:35 +00:00
if ( reason )
Cvar_Set ( & cl_disconnectreason , reason ) ;
2014-03-30 08:55:06 +00:00
connectinfo . trying = false ;
2004-08-23 00:15:46 +00:00
2009-04-06 00:34:32 +00:00
SCR_SetLoadingStage ( 0 ) ;
2004-08-23 00:15:46 +00:00
Cvar_ApplyLatches ( CVAR_SERVEROVERRIDE ) ;
// stop sounds (especially looping!)
S_StopAllSounds ( true ) ;
2004-12-29 03:24:21 +00:00
# ifdef VM_CG
2004-12-24 08:45:56 +00:00
CG_Stop ( ) ;
# endif
2005-02-09 19:32:09 +00:00
# ifdef CSQC_DAT
CSQC_Shutdown ( ) ;
# endif
// if running a local server, shut it down
2004-08-23 00:15:46 +00:00
if ( cls . demoplayback ! = DPB_NONE )
CL_StopPlayback ( ) ;
else if ( cls . state ! = ca_disconnected )
{
if ( cls . demorecording )
CL_Stop_f ( ) ;
2005-05-26 12:55:34 +00:00
switch ( cls . protocol )
2004-08-23 00:15:46 +00:00
{
2005-05-26 12:55:34 +00:00
case CP_NETQUAKE :
2007-08-07 19:16:32 +00:00
# ifdef NQPROT
2005-06-15 04:45:26 +00:00
final [ 0 ] = clc_disconnect ;
2006-02-22 23:36:03 +00:00
final [ 1 ] = clc_stringcmd ;
strcpy ( final + 2 , " drop " ) ;
Netchan_Transmit ( & cls . netchan , strlen ( final ) + 1 , final , 250000 ) ;
Netchan_Transmit ( & cls . netchan , strlen ( final ) + 1 , final , 250000 ) ;
Netchan_Transmit ( & cls . netchan , strlen ( final ) + 1 , final , 250000 ) ;
2004-08-23 00:15:46 +00:00
# endif
2007-08-07 19:16:32 +00:00
break ;
case CP_PLUGIN :
break ;
2005-05-26 12:55:34 +00:00
case CP_QUAKE2 :
2007-08-07 19:16:32 +00:00
# ifdef Q2CLIENT
2005-05-26 12:55:34 +00:00
final [ 0 ] = clcq2_stringcmd ;
strcpy ( final + 1 , " disconnect " ) ;
Netchan_Transmit ( & cls . netchan , strlen ( final ) + 1 , final , 2500 ) ;
Netchan_Transmit ( & cls . netchan , strlen ( final ) + 1 , final , 2500 ) ;
Netchan_Transmit ( & cls . netchan , strlen ( final ) + 1 , final , 2500 ) ;
2004-08-23 00:15:46 +00:00
# endif
2007-08-07 19:16:32 +00:00
break ;
case CP_QUAKE3 :
break ;
2005-05-26 12:55:34 +00:00
case CP_QUAKEWORLD :
final [ 0 ] = clc_stringcmd ;
strcpy ( final + 1 , " drop " ) ;
2004-10-19 16:10:14 +00:00
Netchan_Transmit ( & cls . netchan , strlen ( final ) + 1 , final , 2500 ) ;
Netchan_Transmit ( & cls . netchan , strlen ( final ) + 1 , final , 2500 ) ;
Netchan_Transmit ( & cls . netchan , strlen ( final ) + 1 , final , 2500 ) ;
2005-05-26 12:55:34 +00:00
break ;
2007-08-07 19:16:32 +00:00
case CP_UNKNOWN :
break ;
2004-08-23 00:15:46 +00:00
}
cls . state = ca_disconnected ;
2008-11-09 22:29:28 +00:00
cls . protocol = CP_UNKNOWN ;
2004-08-23 00:15:46 +00:00
cls . demoplayback = DPB_NONE ;
cls . demorecording = cls . timedemo = false ;
# ifndef CLIENTONLY
//running a server, and it's our own
2014-03-30 08:55:06 +00:00
if ( serverrunning & & ! tolocalserver & & sv . state ! = ss_clustermode )
2006-01-02 23:01:54 +00:00
SV_UnspawnServer ( ) ;
2004-08-23 00:15:46 +00:00
# endif
}
Cam_Reset ( ) ;
if ( cl . worldmodel )
2005-06-15 04:45:26 +00:00
{
2010-07-12 22:46:37 +00:00
Mod_ClearAll ( ) ;
cl . worldmodel = NULL ;
2004-08-23 00:15:46 +00:00
}
2012-07-05 19:42:36 +00:00
CL_Parse_Disconnected ( ) ;
2004-08-23 00:15:46 +00:00
COM_FlushTempoaryPacks ( ) ;
2006-01-28 19:04:13 +00:00
r_worldentity . model = NULL ;
2017-05-28 15:42:32 +00:00
for ( i = 0 ; i < cl . splitclients ; i + + )
cl . playerview [ i ] . spectator = 0 ;
2006-01-10 18:50:23 +00:00
cl . sendprespawn = false ;
2015-09-01 04:45:15 +00:00
cl . intermissionmode = IM_NONE ;
2010-11-28 19:19:06 +00:00
cl . oldgametime = 0 ;
2005-04-16 16:21:27 +00:00
2016-02-10 23:23:43 +00:00
memset ( & r_refdef , 0 , sizeof ( r_refdef ) ) ;
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
cls . signon = 0 ;
# endif
CL_StopUpload ( ) ;
2011-12-05 15:23:40 +00:00
CL_FlushClientCommands ( ) ;
2004-11-29 01:21:00 +00:00
# ifndef CLIENTONLY
2004-08-23 00:15:46 +00:00
if ( ! isDedicated )
2004-11-29 01:21:00 +00:00
# endif
2008-06-12 23:19:47 +00:00
{
2004-08-23 00:15:46 +00:00
SCR_EndLoadingPlaque ( ) ;
2008-06-12 23:19:47 +00:00
V_ClearCShifts ( ) ;
}
2004-12-24 08:45:56 +00:00
2005-06-04 04:20:20 +00:00
cl . servercount = 0 ;
2005-11-30 01:20:53 +00:00
cls . findtrack = false ;
2008-06-01 22:06:22 +00:00
cls . realserverip . type = NA_INVALID ;
2005-11-30 01:20:53 +00:00
2007-09-17 20:35:39 +00:00
Validation_DelatchRulesets ( ) ;
2005-11-30 01:20:53 +00:00
# ifdef TCPCONNECT
2008-11-09 22:29:28 +00:00
//disconnects it, without disconnecting the others.
2017-06-21 01:24:25 +00:00
FTENET_AddToCollection ( cls . sockets , " conn " , NULL , NA_INVALID , NP_DGRAM ) ;
2005-11-30 01:20:53 +00:00
# endif
2005-12-06 02:24:36 +00:00
2007-02-23 00:21:33 +00:00
Cvar_ForceSet ( & cl_servername , " none " ) ;
2012-07-05 19:42:36 +00:00
2018-09-23 19:35:24 +00:00
CL_ClearState ( false ) ;
2013-03-12 22:53:23 +00:00
2014-06-12 23:08:42 +00:00
FS_PureMode ( 0 , NULL , NULL , NULL , NULL , 0 ) ;
2013-06-23 02:17:02 +00:00
2013-08-27 13:18:09 +00:00
Alias_WipeStuffedAliases ( ) ;
2013-03-12 22:53:23 +00:00
//now start up the csqc/menu module again.
2016-02-15 06:01:17 +00:00
// (void)CSQC_UnconnectedInit();
2004-08-23 00:15:46 +00:00
}
# undef serverrunning
# undef tolocalserver
void CL_Disconnect_f ( void )
{
# ifndef CLIENTONLY
if ( sv . state )
SV_UnspawnServer ( ) ;
# endif
2018-12-06 04:55:35 +00:00
CL_Disconnect ( NULL ) ;
2014-05-10 13:42:13 +00:00
connectinfo . trying = false ;
2014-08-03 14:47:47 +00:00
2017-05-18 10:24:09 +00:00
NET_CloseClient ( ) ;
2016-02-15 06:01:17 +00:00
( void ) CSQC_UnconnectedInit ( ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = =
CL_User_f
user < name or userid >
Dump userdata / masterdata for a user
= = = = = = = = = = = = = = = = = = = =
*/
void CL_User_f ( void )
{
int uid ;
int i ;
2010-08-12 09:04:05 +00:00
qboolean found = false ;
2004-08-23 00:15:46 +00:00
# ifndef CLIENTONLY
2005-06-14 04:52:10 +00:00
if ( sv . state )
2004-08-23 00:15:46 +00:00
{
SV_User_f ( ) ;
return ;
}
# endif
if ( Cmd_Argc ( ) ! = 2 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Usage: user <username / userid> \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
uid = atoi ( Cmd_Argv ( 1 ) ) ;
for ( i = 0 ; i < MAX_CLIENTS ; i + + )
{
if ( ! cl . players [ i ] . name [ 0 ] )
continue ;
if ( cl . players [ i ] . userid = = uid
| | ! strcmp ( cl . players [ i ] . name , Cmd_Argv ( 1 ) ) )
{
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 ( ! cl . players [ i ] . userinfovalid )
2009-02-08 04:39:46 +00:00
Con_Printf ( " name: %s \n colour %i %i \n ping: %i \n " , cl . players [ i ] . name , cl . players [ i ] . rbottomcolor , cl . players [ i ] . rtopcolor , cl . players [ i ] . ping ) ;
else
2018-07-05 16:21:44 +00:00
InfoBuf_Print ( & cl . players [ i ] . userinfo , " " ) ;
2010-08-12 09:04:05 +00:00
found = true ;
2004-08-23 00:15:46 +00:00
}
}
2010-08-12 09:04:05 +00:00
if ( ! found )
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " User not in server. \n " ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = =
CL_Users_f
Dump userids for all current players
= = = = = = = = = = = = = = = = = = = =
*/
void CL_Users_f ( void )
{
int i ;
int c ;
c = 0 ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " userid frags name \n " ) ;
Con_TPrintf ( " ------ ----- ---- \n " ) ;
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < MAX_CLIENTS ; i + + )
{
if ( cl . players [ i ] . name [ 0 ] )
{
2016-01-18 05:22:07 +00:00
Con_TPrintf ( " %6i %4i ^[%s \\ player \\ %i^] \n " , cl . players [ i ] . userid , cl . players [ i ] . frags , cl . players [ i ] . name , i ) ;
2004-08-23 00:15:46 +00:00
c + + ;
}
}
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " %i total users \n " , c ) ;
2004-08-23 00:15:46 +00:00
}
2012-12-12 22:16:08 +00:00
int CL_ParseColour ( char * colt )
{
int col ;
if ( ! strncmp ( colt , " 0x " , 2 ) )
col = 0xff000000 | strtoul ( colt + 2 , NULL , 16 ) ;
else
{
col = atoi ( colt ) ;
col & = 15 ;
if ( col > 13 )
col = 13 ;
}
return col ;
}
2004-08-23 00:15:46 +00:00
void CL_Color_f ( void )
{
// just for quake compatability...
int top , bottom ;
char num [ 16 ] ;
2010-08-14 03:17:33 +00:00
int pnum = CL_TargettedSplit ( true ) ;
2004-08-23 00:15:46 +00:00
qboolean server_owns_colour ;
2017-08-29 02:29:06 +00:00
char * t ;
char * b ;
2004-08-23 00:15:46 +00:00
if ( Cmd_Argc ( ) = = 1 )
{
2018-07-05 16:21:44 +00:00
char * t = InfoBuf_ValueForKey ( & cls . userinfo [ pnum ] , " topcolor " ) ;
char * b = InfoBuf_ValueForKey ( & cls . userinfo [ pnum ] , " bottomcolor " ) ;
2014-10-11 19:39:45 +00:00
if ( ! * t )
t = " 0 " ;
if ( ! * b )
b = " 0 " ;
Con_TPrintf ( " \" color \" is \" %s %s \" \n " , t , b ) ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " usage: color <0xRRGGBB> [0xRRGGBB] \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2005-04-16 16:21:27 +00:00
if ( Cmd_FromGamecode ( ) )
2004-08-23 00:15:46 +00:00
server_owns_colour = true ;
else
server_owns_colour = false ;
2017-08-29 02:29:06 +00:00
t = Cmd_Argv ( 1 ) ;
b = ( Cmd_Argc ( ) = = 2 ) ? t : Cmd_Argv ( 2 ) ;
if ( ! strcmp ( t , " -1 " ) )
2018-07-05 16:21:44 +00:00
t = InfoBuf_ValueForKey ( & cls . userinfo [ pnum ] , " topcolor " ) ;
2017-08-29 02:29:06 +00:00
top = CL_ParseColour ( t ) ;
if ( ! strcmp ( b , " -1 " ) )
2018-07-05 16:21:44 +00:00
b = InfoBuf_ValueForKey ( & cls . userinfo [ pnum ] , " bottomcolor " ) ;
2017-08-29 02:29:06 +00:00
bottom = CL_ParseColour ( b ) ;
2005-06-15 04:45:26 +00:00
2013-06-23 02:17:02 +00:00
Q_snprintfz ( num , sizeof ( num ) , ( top & 0xff000000 ) ? " 0x%06x " : " %i " , top & 0xffffff ) ;
2004-08-23 00:15:46 +00:00
if ( top = = 0 )
* num = ' \0 ' ;
if ( Cmd_ExecLevel > RESTRICT_SERVER ) //colour command came from server for a split client
2016-07-12 00:40:13 +00:00
Cbuf_AddText ( va ( " p%i cmd setinfo topcolor \" %s \" \n " , Cmd_ExecLevel - RESTRICT_SERVER - 1 , num ) , Cmd_ExecLevel ) ;
2004-08-23 00:15:46 +00:00
// else if (server_owns_colour)
// Cvar_LockFromServer(&topcolor, num);
else
2016-01-18 05:22:07 +00:00
CL_SetInfo ( pnum , " topcolor " , num ) ;
2013-06-23 02:17:02 +00:00
Q_snprintfz ( num , sizeof ( num ) , ( bottom & 0xff000000 ) ? " 0x%06x " : " %i " , bottom & 0xffffff ) ;
2004-08-23 00:15:46 +00:00
if ( bottom = = 0 )
* num = ' \0 ' ;
if ( Cmd_ExecLevel > RESTRICT_SERVER ) //colour command came from server for a split client
2016-07-12 00:40:13 +00:00
Cbuf_AddText ( va ( " p%i cmd setinfo bottomcolor \" %s \" \n " , Cmd_ExecLevel - RESTRICT_SERVER - 1 , num ) , Cmd_ExecLevel ) ;
2004-08-23 00:15:46 +00:00
else if ( server_owns_colour )
Cvar_LockFromServer ( & bottomcolor , num ) ;
else
2016-01-18 05:22:07 +00:00
CL_SetInfo ( pnum , " bottomcolor " , num ) ;
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
2005-05-26 12:55:34 +00:00
if ( cls . protocol = = CP_NETQUAKE )
2004-08-23 00:15:46 +00:00
Cmd_ForwardToServer ( ) ;
# endif
}
2011-10-27 15:46:36 +00:00
void CL_PakDownloads ( int mode )
{
/*
mode = 0 no downloads ( forced to 1 for pure )
mode = 1 archived names so local stuff is not poluted
mode = 2 downloaded packages will always be present . Use With Caution .
2014-06-12 23:08:42 +00:00
mode & 4 download even packages that are not referenced .
2011-10-27 15:46:36 +00:00
*/
char local [ 256 ] ;
char * pname ;
char * s = cl . serverpakcrcs ;
int i ;
if ( ! cl . serverpakschanged | | ! mode )
return ;
Cmd_TokenizeString ( cl . serverpaknames , false , false ) ;
for ( i = 0 ; i < Cmd_Argc ( ) ; i + + )
{
s = COM_Parse ( s ) ;
pname = Cmd_Argv ( i ) ;
2011-12-05 15:23:40 +00:00
//'*' prefix means 'referenced'. so if the server isn't using any files from it, don't bother downloading it.
if ( * pname = = ' * ' )
pname + + ;
2014-06-12 23:08:42 +00:00
else if ( ! ( mode & 4 ) )
2011-12-05 15:23:40 +00:00
continue ;
2014-06-12 23:08:42 +00:00
if ( ( mode & 3 ) ! = 2 )
2011-10-27 15:46:36 +00:00
{
/*if we already have such a file, this is a no-op*/
if ( CL_CheckDLFile ( va ( " package/%s " , pname ) ) )
continue ;
2013-06-23 02:17:02 +00:00
if ( ! FS_GenCachedPakName ( pname , com_token , local , sizeof ( local ) ) )
continue ;
2011-10-27 15:46:36 +00:00
}
else
Q_strncpyz ( local , pname , sizeof ( local ) ) ;
CL_CheckOrEnqueDownloadFile ( pname , local , DLLF_NONGAME ) ;
}
}
2004-08-23 00:15:46 +00:00
2011-12-05 15:23:40 +00:00
void CL_CheckServerPacks ( void )
{
2013-06-23 02:17:02 +00:00
static int oldpure ;
2018-07-05 16:21:44 +00:00
int pure = atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " sv_pure " ) ) ;
2013-06-23 02:17:02 +00:00
if ( pure < cl_pure . ival )
pure = cl_pure . ival ;
pure = bound ( 0 , pure , 2 ) ;
if ( ! * cl . serverpakcrcs | | cls . demoplayback )
pure = 0 ;
2011-12-05 15:23:40 +00:00
if ( pure ! = oldpure | | cl . serverpakschanged )
{
2013-06-23 02:17:02 +00:00
CL_PakDownloads ( ( pure & & ! cl_download_packages . ival ) ? 1 : cl_download_packages . ival ) ;
2014-06-12 23:08:42 +00:00
FS_PureMode ( pure , cl . serverpaknames , cl . serverpakcrcs , NULL , NULL , cls . challenge ) ;
2013-06-23 02:17:02 +00:00
2011-12-05 15:23:40 +00:00
if ( pure )
{
/*when enabling pure, kill cached models/sounds/etc*/
Cache_Flush ( ) ;
/*make sure cheating lamas can't use old shaders from a different srver*/
Shader_NeedReload ( true ) ;
}
}
oldpure = pure ;
cl . serverpakschanged = false ;
}
2004-08-23 00:15:46 +00:00
void CL_CheckServerInfo ( void )
{
char * s ;
unsigned int allowed ;
2016-07-15 12:26:24 +00:00
# ifdef QUAKESTATS
2006-03-06 01:41:09 +00:00
int oldstate ;
2017-05-28 15:42:32 +00:00
# endif
# ifndef CLIENTONLY
extern cvar_t sv_cheats ;
2016-07-15 12:26:24 +00:00
# endif
2008-01-23 21:04:16 +00:00
int oldteamplay ;
2017-05-28 15:42:32 +00:00
qboolean spectating = true ;
int i ;
//spectator 2 = spectator-with-scores, considered to be players. this means we don't want to allow spec cheats while they're inactive, because that would be weird.
for ( i = 0 ; i < cl . splitclients ; i + + )
if ( cl . playerview [ i ] . spectator ! = 1 )
spectating = false ;
2004-08-23 00:15:46 +00:00
2008-01-23 21:04:16 +00:00
oldteamplay = cl . teamplay ;
2018-07-05 16:21:44 +00:00
cl . teamplay = atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " teamplay " ) ) ;
cls . deathmatch = cl . deathmatch = atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " deathmatch " ) ) ;
2004-08-23 00:15:46 +00:00
cls . allow_cheats = false ;
cls . allow_semicheats = true ;
cls . allow_watervis = false ;
cls . allow_skyboxes = false ;
2006-05-11 02:30:13 +00:00
cls . allow_fbskins = 1 ;
2005-01-05 08:01:19 +00:00
// cls.allow_fbskins = 0;
2004-08-23 00:15:46 +00:00
// cls.allow_overbrightlight;
2016-07-12 00:40:13 +00:00
2018-07-05 16:21:44 +00:00
cls . allow_csqc = atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " anycsqc " ) ) | | * InfoBuf_ValueForKey ( & cl . serverinfo , " *csprogs " ) ;
cl . csqcdebug = atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " *csqcdebug " ) ) ;
2004-08-23 00:15:46 +00:00
2018-07-05 16:21:44 +00:00
if ( spectating | | cls . demoplayback | | atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " watervis " ) ) )
2004-08-23 00:15:46 +00:00
cls . allow_watervis = true ;
2018-07-05 16:21:44 +00:00
if ( spectating | | cls . demoplayback | | atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " allow_skybox " ) ) | | atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " allow_skyboxes " ) ) )
2016-07-12 00:40:13 +00:00
cls . allow_skyboxes = true ; //mostly obsolete.
2004-08-23 00:15:46 +00:00
2018-07-05 16:21:44 +00:00
s = InfoBuf_ValueForKey ( & cl . serverinfo , " fbskins " ) ;
2006-05-11 02:30:13 +00:00
if ( * s )
2004-08-23 00:15:46 +00:00
cls . allow_fbskins = atof ( s ) ;
2006-05-11 02:30:13 +00:00
else if ( cl . teamfortress )
cls . allow_fbskins = 0 ;
2015-04-14 23:12:17 +00:00
else
cls . allow_fbskins = 1 ;
2004-08-23 00:15:46 +00:00
2018-07-05 16:21:44 +00:00
s = InfoBuf_ValueForKey ( & cl . serverinfo , " *cheats " ) ;
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 ( spectating | | cls . demoplayback | | ! stricmp ( s , " on " ) )
2004-08-23 00:15:46 +00:00
cls . allow_cheats = true ;
2013-12-17 22:45:37 +00:00
# ifndef CLIENTONLY
//allow cheats in single player regardless of sv_cheats.
2017-05-28 15:42:32 +00:00
//(also directly read the sv_cheats cvar to avoid issues with nq protocols that don't support serverinfo.
if ( ( sv . state = = ss_active & & sv . allocated_client_slots = = 1 ) | | sv_cheats . ival )
2013-12-17 22:45:37 +00:00
cls . allow_cheats = true ;
# endif
2018-07-05 16:21:44 +00:00
s = InfoBuf_ValueForKey ( & cl . serverinfo , " strict " ) ;
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 ( ( ! spectating & & ! cls . demoplayback & & * s & & strcmp ( s , " 0 " ) ) | | ! ruleset_allow_semicheats . ival )
2004-08-23 00:15:46 +00:00
{
cls . allow_semicheats = false ;
cls . allow_cheats = false ;
}
2019-03-01 22:53:51 +00:00
cls . z_ext = atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " *z_ext " ) ) & CLIENT_SUPPORTED_Z_EXTENSIONS ;
2004-08-23 00:15:46 +00:00
2017-08-16 02:14:07 +00:00
# ifdef NQPROT
if ( cls . protocol = = CP_NETQUAKE & & CPNQ_IS_DP )
{
//movevars come from stats.
}
else
# endif
{
2018-07-05 16:21:44 +00:00
cls . maxfps = atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " maxfps " ) ) ;
2017-08-16 02:14:07 +00:00
if ( cls . maxfps < 20 )
cls . maxfps = 72 ;
// movement vars for prediction
2018-07-05 16:21:44 +00:00
cl . bunnyspeedcap = Q_atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " pm_bunnyspeedcap " ) ) ;
movevars . slidefix = ( Q_atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " pm_slidefix " ) ) ! = 0 ) ;
movevars . airstep = ( Q_atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " pm_airstep " ) ) ! = 0 ) ;
2019-03-01 22:39:30 +00:00
movevars . pground = ( Q_atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " pm_pground " ) ) ! = 0 ) ;
2018-07-05 16:21:44 +00:00
movevars . stepdown = ( Q_atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " pm_stepdown " ) ) ! = 0 ) ;
movevars . walljump = ( Q_atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " pm_walljump " ) ) ) ;
movevars . ktjump = Q_atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " pm_ktjump " ) ) ;
s = InfoBuf_ValueForKey ( & cl . serverinfo , " pm_stepheight " ) ;
2017-08-16 02:14:07 +00:00
movevars . stepheight = * s ? Q_atof ( s ) : PM_DEFAULTSTEPHEIGHT ;
2018-07-05 16:21:44 +00:00
s = InfoBuf_ValueForKey ( & cl . serverinfo , " pm_watersinkspeed " ) ;
2017-08-16 02:14:07 +00:00
movevars . watersinkspeed = * s ? Q_atof ( s ) : 60 ;
2018-07-05 16:21:44 +00:00
s = InfoBuf_ValueForKey ( & cl . serverinfo , " pm_flyfriction " ) ;
2017-08-16 02:14:07 +00:00
movevars . flyfriction = * s ? Q_atof ( s ) : 4 ;
2018-12-11 00:20:59 +00:00
s = InfoBuf_ValueForKey ( & cl . serverinfo , " pm_edgefriction " ) ;
movevars . edgefriction = * s ? Q_atof ( s ) : 2 ;
2019-03-23 07:06:37 +00:00
if ( ! ( movevars . flags & MOVEFLAG_VALID ) )
movevars . flags = ( movevars . flags & ~ MOVEFLAG_QWEDGEBOX ) | ( * s ? 0 : MOVEFLAG_QWEDGEBOX ) ;
2017-08-16 02:14:07 +00:00
}
2018-04-27 16:40:50 +00:00
movevars . coordsize = cls . netchan . netprim . coordsize ;
2004-08-23 00:15:46 +00:00
// Initialize cl.maxpitch & cl.minpitch
2009-11-04 21:16:50 +00:00
if ( cls . protocol = = CP_QUAKEWORLD | | cls . protocol = = CP_NETQUAKE )
{
2018-07-05 16:21:44 +00:00
s = InfoBuf_ValueForKey ( & cl . serverinfo , " maxpitch " ) ;
2017-12-28 16:24:50 +00:00
cl . maxpitch = * s ? Q_atof ( s ) : ( ( cl_fullpitch_nq . ival & & ! cl . haveserverinfo ) ? 90.0f : 80.0f ) ;
2018-07-05 16:21:44 +00:00
s = InfoBuf_ValueForKey ( & cl . serverinfo , " minpitch " ) ;
2017-12-28 16:24:50 +00:00
cl . minpitch = * s ? Q_atof ( s ) : ( ( cl_fullpitch_nq . ival & & ! cl . haveserverinfo ) ? - 90.0f : - 70.0f ) ;
2016-08-25 00:12:14 +00:00
if ( cls . protocol = = CP_NETQUAKE )
{ //proquake likes spamming us with fixangles
2016-09-01 14:31:24 +00:00
//should be about 0.5/65536, but there's some precision issues with such small numbers around 80, so we need to bias it more than we ought
2016-08-25 00:12:14 +00:00
cl . maxpitch - = 1.0 / 2048 ;
}
2009-11-04 21:16:50 +00:00
}
else
{
2015-07-03 02:07:41 +00:00
cl . maxpitch = 90 ;
cl . minpitch = - 90 ;
2009-11-04 21:16:50 +00:00
}
2015-07-03 02:07:41 +00:00
//bound it, such that we never end up looking slightly more back than forwards
//FIXME: we should probably tweak our movement code instead.
cl . maxpitch = bound ( - 89.9 , cl . maxpitch , 89.9 ) ;
cl . minpitch = bound ( - 89.9 , cl . minpitch , 89.9 ) ;
2004-08-23 00:15:46 +00:00
2018-07-05 16:21:44 +00:00
cl . hexen2pickups = atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " sv_pupglow " ) ) ;
2010-08-17 02:44:21 +00:00
2018-07-05 16:21:44 +00:00
allowed = atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " allow " ) ) ;
2004-08-23 00:15:46 +00:00
if ( allowed & 1 )
cls . allow_watervis = true ;
2016-07-12 00:40:13 +00:00
// if (allowed & 2)
// cls.allow_rearview = true;
2004-08-23 00:15:46 +00:00
if ( allowed & 4 )
cls . allow_skyboxes = true ;
2016-07-12 00:40:13 +00:00
// if (allowed & 8)
// cls.allow_mirrors = true;
2009-11-04 21:16:50 +00:00
//16
2013-06-26 03:40:39 +00:00
//32
2016-07-12 00:40:13 +00:00
// if (allowed & 128)
// cls.allow_postproc = true;
// if (allowed & 256)
// cls.allow_lightmapgamma = true;
2004-08-23 00:15:46 +00:00
if ( allowed & 512 )
cls . allow_cheats = true ;
if ( cls . allow_semicheats )
cls . allow_anyparticles = true ;
else
cls . allow_anyparticles = false ;
2006-03-06 01:41:09 +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 ( spectating | | cls . demoplayback )
2007-07-23 12:03:33 +00:00
cl . fpd = 0 ;
else
2018-07-05 16:21:44 +00:00
cl . fpd = atoi ( InfoBuf_ValueForKey ( & cl . serverinfo , " fpd " ) ) ;
2007-07-23 12:03:33 +00:00
2018-07-05 16:21:44 +00:00
cl . gamespeed = atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " *gamespeed " ) ) / 100.f ;
2012-02-27 12:23:15 +00:00
if ( cl . gamespeed < 0.1 )
cl . gamespeed = 1 ;
2007-07-23 12:03:33 +00:00
2015-09-01 04:45:15 +00:00
# ifdef QUAKESTATS
2018-07-05 16:21:44 +00:00
s = InfoBuf_ValueForKey ( & cl . serverinfo , " status " ) ;
2010-11-21 03:39:12 +00:00
oldstate = cl . matchstate ;
2006-03-06 01:41:09 +00:00
if ( ! stricmp ( s , " standby " ) )
2010-11-21 03:39:12 +00:00
cl . matchstate = MATCH_STANDBY ;
2006-03-06 01:41:09 +00:00
else if ( ! stricmp ( s , " countdown " ) )
2010-11-21 03:39:12 +00:00
cl . matchstate = MATCH_COUNTDOWN ;
2006-03-06 01:41:09 +00:00
else
2015-06-23 17:29:12 +00:00
{
float time = strtod ( s , & s ) ;
if ( ! strcmp ( s , " min left " ) | | ! strcmp ( s , " mins left " ) )
time * = 60 ;
else if ( ! strcmp ( s , " sec left " ) | | ! strcmp ( s , " secs left " ) )
time * = 1 ;
else if ( ! strcmp ( s , " hour left " ) | | ! strcmp ( s , " hours left " ) )
time * = 60 * 60 ;
else
time = - 1 ;
if ( time > = 0 )
{
//always update it. this is to try to cope with overtime.
oldstate = cl . matchstate = MATCH_INPROGRESS ;
2018-07-05 16:21:44 +00:00
cl . matchgametimestart = cl . gametime + time - 60 * atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " timelimit " ) ) ;
2015-06-23 17:29:12 +00:00
}
else
{
if ( * s & & cl . matchstate = = MATCH_INPROGRESS )
Con_DPrintf ( " Match state changed to unknown meaning: %s \n " , s ) ;
else
cl . matchstate = MATCH_DONTKNOW ; //don't revert from inprogress to don't know
}
}
2010-11-21 03:39:12 +00:00
if ( oldstate ! = cl . matchstate )
2015-06-14 01:28:01 +00:00
cl . matchgametimestart = cl . gametime ;
2015-09-01 04:45:15 +00:00
# endif
2006-03-06 01:41:09 +00:00
2011-12-05 15:23:40 +00:00
CL_CheckServerPacks ( ) ;
2011-10-27 15:46:36 +00:00
2004-08-23 00:15:46 +00:00
Cvar_ForceCheatVars ( cls . allow_semicheats , cls . allow_cheats ) ;
2009-04-01 22:03:56 +00:00
Validation_Apply_Ruleset ( ) ;
2006-03-11 03:12:10 +00:00
2008-01-23 21:04:16 +00:00
if ( oldteamplay ! = cl . teamplay )
Skin_FlushPlayers ( ) ;
2019-06-17 04:21:41 +00:00
CSQC_ServerInfoChanged ( ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
CL_FullInfo_f
Allow clients to change userinfo
= = = = = = = = = = = = = = = = = =
*/
void CL_FullInfo_f ( void )
{
char key [ 512 ] ;
char value [ 512 ] ;
char * o ;
char * s ;
2010-08-14 03:17:33 +00:00
int pnum = CL_TargettedSplit ( true ) ;
2004-08-23 00:15:46 +00:00
if ( Cmd_Argc ( ) ! = 2 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " fullinfo <complete info string> \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
s = Cmd_Argv ( 1 ) ;
if ( * s = = ' \\ ' )
s + + ;
while ( * s )
{
o = key ;
2016-01-18 05:22:07 +00:00
while ( * s & & * s ! = ' \\ ' & & o < key + sizeof ( key ) )
2004-08-23 00:15:46 +00:00
* o + + = * s + + ;
2016-01-18 05:22:07 +00:00
if ( o = = key + sizeof ( key ) )
{
Con_Printf ( " key length too long \n " ) ;
return ;
}
2004-08-23 00:15:46 +00:00
* o = 0 ;
if ( ! * s )
{
2013-11-21 23:02:28 +00:00
Con_Printf ( " key %s has no value \n " , key ) ;
2004-08-23 00:15:46 +00:00
return ;
}
o = value ;
s + + ;
2016-01-18 05:22:07 +00:00
while ( * s & & * s ! = ' \\ ' & & o < value + sizeof ( value ) )
2004-08-23 00:15:46 +00:00
* o + + = * s + + ;
2016-01-18 05:22:07 +00:00
if ( o = = value + sizeof ( value ) )
{
Con_Printf ( " value length too long \n " ) ;
return ;
}
2004-08-23 00:15:46 +00:00
* o = 0 ;
if ( * s )
s + + ;
if ( ! stricmp ( key , pmodel_name ) | | ! stricmp ( key , emodel_name ) )
continue ;
2018-07-05 16:21:44 +00:00
InfoBuf_SetKey ( & cls . userinfo [ pnum ] , key , value ) ;
2004-08-23 00:15:46 +00:00
}
}
2018-07-05 16:21:44 +00:00
void CL_SetInfoBlob ( int pnum , const char * key , const char * value , size_t valuesize )
2007-02-23 00:21:33 +00:00
{
cvar_t * var ;
2010-08-14 03:17:33 +00:00
if ( ! pnum )
{
var = Cvar_FindVar ( key ) ;
if ( var & & ( var - > flags & CVAR_USERINFO ) )
{ //get the cvar code to set it. the server might have locked it.
Cvar_Set ( var , value ) ;
return ;
}
2007-02-23 00:21:33 +00:00
}
2018-07-05 16:21:44 +00:00
InfoBuf_SetStarBlobKey ( & cls . userinfo [ pnum ] , key , value , valuesize ) ;
}
void CL_SetInfo ( int pnum , const char * key , const char * value )
{
CL_SetInfoBlob ( pnum , key , value , strlen ( value ) ) ;
2007-02-23 00:21:33 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = =
CL_SetInfo_f
Allow clients to change userinfo
= = = = = = = = = = = = = = = = = =
*/
void CL_SetInfo_f ( void )
{
2019-06-18 13:03:37 +00:00
char * key , * val ;
size_t keysize , valsize ;
2004-08-23 00:15:46 +00:00
cvar_t * var ;
2010-08-14 03:17:33 +00:00
int pnum = CL_TargettedSplit ( true ) ;
2004-08-23 00:15:46 +00:00
if ( Cmd_Argc ( ) = = 1 )
{
2018-07-05 16:21:44 +00:00
InfoBuf_Print ( & cls . userinfo [ pnum ] , " " ) ;
2018-11-19 06:37:25 +00:00
Con_Printf ( " [%u] \n " , ( unsigned int ) cls . userinfo [ pnum ] . totalsize ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( Cmd_Argc ( ) ! = 3 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " usage: setinfo [ <key> <value> ] \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( ! stricmp ( Cmd_Argv ( 1 ) , pmodel_name ) | | ! strcmp ( Cmd_Argv ( 1 ) , emodel_name ) )
return ;
2005-11-30 01:20:53 +00:00
if ( Cmd_Argv ( 1 ) [ 0 ] = = ' * ' )
{
int i ;
if ( ! strcmp ( Cmd_Argv ( 1 ) , " * " ) )
if ( ! strcmp ( Cmd_Argv ( 2 ) , " " ) )
{ //clear it out
2018-07-05 16:21:44 +00:00
const char * k ;
2005-11-30 01:20:53 +00:00
for ( i = 0 ; ; )
{
2018-07-05 16:21:44 +00:00
k = InfoBuf_KeyForNumber ( & cls . userinfo [ pnum ] , i ) ;
if ( ! k )
2005-11-30 01:20:53 +00:00
break ; //no more.
else if ( * k = = ' * ' )
i + + ; //can't remove * keys
2018-07-05 16:21:44 +00:00
else if ( ( var = Cvar_FindVar ( k ) ) & & ( var - > flags & CVAR_USERINFO ) )
2005-11-30 01:20:53 +00:00
i + + ; //this one is a cvar.
else
2018-07-05 16:21:44 +00:00
InfoBuf_RemoveKey ( & cls . userinfo [ pnum ] , k ) ; //we can remove this one though, so yay.
2005-11-30 01:20:53 +00:00
}
return ;
}
2013-11-21 23:02:28 +00:00
Con_Printf ( " Can't set * keys \n " ) ;
2005-11-30 01:20:53 +00:00
return ;
}
2019-06-18 13:03:37 +00:00
key = Cmd_Argv ( 1 ) ;
val = Cmd_Argv ( 2 ) ;
key = InfoBuf_DecodeString ( key , key + strlen ( key ) , & keysize ) ;
val = InfoBuf_DecodeString ( val , val + strlen ( val ) , & valsize ) ;
if ( keysize ! = strlen ( key ) )
Con_Printf ( " setinfo: ignoring key name with embedded null \n " ) ;
else
CL_SetInfoBlob ( pnum , key , val , valsize ) ;
Z_Free ( key ) ;
Z_Free ( val ) ;
2004-08-23 00:15:46 +00:00
}
2019-01-13 16:51:50 +00:00
# if 1 //def _DEBUG
2018-07-05 16:21:44 +00:00
void CL_SetInfoBlob_f ( void )
{
qofs_t fsize ;
void * data ;
int pnum = CL_TargettedSplit ( true ) ;
if ( Cmd_Argc ( ) = = 1 )
{
InfoBuf_Print ( & cls . userinfo [ pnum ] , " " ) ;
return ;
}
if ( Cmd_Argc ( ) ! = 3 )
{
Con_TPrintf ( " usage: setinfo [ <key> <filename> ] \n " ) ;
return ;
}
//user isn't allowed to set pmodel, emodel, *foo as these could break stuff.
if ( ! stricmp ( Cmd_Argv ( 1 ) , pmodel_name ) | | ! strcmp ( Cmd_Argv ( 1 ) , emodel_name ) )
return ;
if ( Cmd_Argv ( 1 ) [ 0 ] = = ' * ' )
{
Con_Printf ( " Can't set * keys \n " ) ;
return ;
}
data = FS_MallocFile ( Cmd_Argv ( 2 ) , FS_GAME , & fsize ) ;
if ( ! data )
{
Con_Printf ( " Unable to read %s \n " , Cmd_Argv ( 2 ) ) ;
return ;
}
if ( fsize > 64 * 1024 * 1024 )
Con_Printf ( " File is over 64mb \n " ) ;
else
CL_SetInfoBlob ( pnum , Cmd_Argv ( 1 ) , data , fsize ) ;
FS_FreeFile ( data ) ;
}
# endif
2005-12-21 03:07:33 +00:00
void CL_SaveInfo ( vfsfile_t * f )
2005-11-30 01:20:53 +00:00
{
2010-08-14 03:17:33 +00:00
int i ;
for ( i = 0 ; i < MAX_SPLITS ; i + + )
{
2014-12-23 15:26:42 +00:00
VFS_WRITE ( f , " \n " , 1 ) ;
2010-08-14 03:17:33 +00:00
if ( i )
2014-12-23 15:26:42 +00:00
{
2010-08-14 03:17:33 +00:00
VFS_WRITE ( f , va ( " p%i setinfo * \" \" \n " , i + 1 ) , 16 ) ;
2018-07-05 16:21:44 +00:00
InfoBuf_WriteToFile ( f , & cls . userinfo [ i ] , va ( " p%i setinfo " , i + 1 ) , 0 ) ;
2014-12-23 15:26:42 +00:00
}
2010-08-14 03:17:33 +00:00
else
2014-12-23 15:26:42 +00:00
{
2010-08-14 03:17:33 +00:00
VFS_WRITE ( f , " setinfo * \" \" \n " , 13 ) ;
2018-07-05 16:21:44 +00:00
InfoBuf_WriteToFile ( f , & cls . userinfo [ i ] , " setinfo " , CVAR_USERINFO ) ;
2014-12-23 15:26:42 +00:00
}
2010-08-14 03:17:33 +00:00
}
2005-11-30 01:20:53 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = =
CL_Packet_f
packet < destination > < contents >
Contents allows \ n escape character
= = = = = = = = = = = = = = = = = = = =
*/
void CL_Packet_f ( void )
{
char send [ 2048 ] ;
int i , l ;
char * in , * out ;
netadr_t adr ;
2005-06-15 04:45:26 +00:00
2004-08-23 00:15:46 +00:00
if ( Cmd_Argc ( ) ! = 3 )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " usage: packet <destination> <contents> \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2018-04-07 12:33:06 +00:00
if ( ! NET_StringToAdr ( Cmd_Argv ( 1 ) , PORT_DEFAULTSERVER , & adr ) )
2004-08-23 00:15:46 +00:00
{
2010-07-11 02:22:39 +00:00
Con_Printf ( " Bad address: %s \n " , Cmd_Argv ( 1 ) ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2006-09-17 00:59:22 +00:00
2019-08-24 16:09:08 +00:00
if ( Cmd_FromGamecode ( ) ) //some mvdsv servers stuffcmd a packet command which lets them know which ip the client is from.
{ //unfortunatly, 50% of servers are badly configured resulting in them poking local services that THEY MUST NOT HAVE ACCESS TO.
char * addrdesc ;
char * realdesc ;
2015-07-09 18:02:49 +00:00
if ( cls . demoplayback )
{
Con_DPrintf ( " Not sending realip packet from demo \n " ) ;
return ;
}
2019-08-24 16:09:08 +00:00
if ( ! NET_CompareAdr ( & adr , & cls . netchan . remote_address ) )
{
if ( NET_ClassifyAddress ( & adr , & addrdesc ) < ASCOPE_LAN )
2004-09-14 21:39:18 +00:00
{
2019-08-24 16:09:08 +00:00
if ( NET_ClassifyAddress ( & cls . netchan . remote_address , & realdesc ) < ASCOPE_LAN )
{ //this isn't necessarily buggy... but its still a potential exploit so we need to block it regardless.
Con_Printf ( CON_WARNING " Ignoring buggy %s realip request for %s server. \n " , addrdesc , realdesc ) ;
}
else
{
adr = cls . netchan . remote_address ;
Con_Printf ( CON_WARNING " Ignoring buggy %s realip request, sending to %s server instead. \n " , addrdesc , realdesc ) ;
}
2004-09-14 21:39:18 +00:00
}
2019-08-24 16:09:08 +00:00
}
2004-12-08 04:14:52 +00:00
2008-06-01 22:06:22 +00:00
cls . realserverip = adr ;
2005-01-29 02:22:43 +00:00
Con_DPrintf ( " Sending realip packet \n " ) ;
2004-09-14 21:39:18 +00:00
}
2009-11-04 21:16:50 +00:00
else if ( ! ruleset_allow_packet . ival )
2007-08-23 21:25:18 +00:00
{
Con_Printf ( " Sorry, the %s command is disallowed \n " , Cmd_Argv ( 0 ) ) ;
return ;
}
2004-12-15 19:54:09 +00:00
cls . lastarbiatarypackettime = Sys_DoubleTime ( ) ; //prevent the packet command from causing a reconnect on badly configured mvdsv servers.
2004-09-14 21:39:18 +00:00
2004-08-23 00:15:46 +00:00
in = Cmd_Argv ( 2 ) ;
out = send + 4 ;
send [ 0 ] = send [ 1 ] = send [ 2 ] = send [ 3 ] = 0xff ;
l = strlen ( in ) ;
for ( i = 0 ; i < l ; i + + )
{
if ( in [ i ] = = ' \\ ' & & in [ i + 1 ] = = ' n ' )
{
* out + + = ' \n ' ;
i + + ;
}
2010-07-11 02:22:39 +00:00
else if ( in [ i ] = = ' \\ ' & & in [ i + 1 ] = = ' \\ ' )
{
* out + + = ' \\ ' ;
i + + ;
}
else if ( in [ i ] = = ' \\ ' & & in [ i + 1 ] = = ' r ' )
{
* out + + = ' \r ' ;
i + + ;
}
else if ( in [ i ] = = ' \\ ' & & in [ i + 1 ] = = ' \" ' )
{
* out + + = ' \" ' ;
i + + ;
}
else if ( in [ i ] = = ' \\ ' & & in [ i + 1 ] = = ' 0 ' )
{
* out + + = ' \0 ' ;
i + + ;
}
2004-08-23 00:15:46 +00:00
else
* out + + = in [ i ] ;
}
* out = 0 ;
2019-02-01 08:29:14 +00:00
if ( ! cls . sockets )
NET_InitClient ( false ) ;
if ( ! NET_EnsureRoute ( cls . sockets , " packet " , Cmd_Argv ( 1 ) , & adr ) )
return ;
2018-12-28 00:04:36 +00:00
NET_SendPacket ( cls . sockets , out - send , send , & adr ) ;
2006-09-17 00:59:22 +00:00
if ( Cmd_FromGamecode ( ) )
{
//realip
2007-09-27 10:48:16 +00:00
char * temp = Z_Malloc ( strlen ( in ) + 1 ) ;
strcpy ( temp , in ) ;
Cmd_TokenizeString ( temp , false , false ) ;
2006-09-17 00:59:22 +00:00
cls . realip_ident = atoi ( Cmd_Argv ( 2 ) ) ;
2007-09-27 10:48:16 +00:00
Z_Free ( temp ) ;
2006-09-17 00:59:22 +00:00
}
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = = =
CL_NextDemo
Called to play the next demo in the demo loop
= = = = = = = = = = = = = = = = = = = = =
*/
void CL_NextDemo ( void )
{
char str [ 1024 ] ;
2014-08-15 02:20:41 +00:00
if ( cls . demonum < 0 )
2004-08-23 00:15:46 +00:00
return ; // don't play demos
2014-08-15 02:20:41 +00:00
if ( ! cls . demos [ cls . demonum ] [ 0 ] | | cls . demonum > = MAX_DEMOS )
2004-08-23 00:15:46 +00:00
{
cls . demonum = 0 ;
if ( ! cls . demos [ cls . demonum ] [ 0 ] )
{
// Con_Printf ("No demos listed with startdemos\n");
cls . demonum = - 1 ;
return ;
}
}
2009-11-04 21:16:50 +00:00
if ( ! strcmp ( cls . demos [ cls . demonum ] , " quit " ) )
2011-07-22 15:11:35 +00:00
Q_snprintfz ( str , sizeof ( str ) , " quit \n " ) ;
2009-11-04 21:16:50 +00:00
else
2011-07-22 15:11:35 +00:00
Q_snprintfz ( str , sizeof ( str ) , " playdemo %s \n " , cls . demos [ cls . demonum ] ) ;
2006-02-06 01:06:17 +00:00
Cbuf_InsertText ( str , RESTRICT_LOCAL , false ) ;
2004-08-23 00:15:46 +00:00
cls . demonum + + ;
2014-08-15 02:20:41 +00:00
if ( ! cls . state )
cls . state = ca_demostart ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
DEMO LOOP CONTROL
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
/*
= = = = = = = = = = = = = = = = = =
CL_Startdemos_f
= = = = = = = = = = = = = = = = = =
*/
void CL_Startdemos_f ( void )
{
int i , c ;
c = Cmd_Argc ( ) - 1 ;
if ( c > MAX_DEMOS )
{
Con_Printf ( " Max %i demos in demoloop \n " , MAX_DEMOS ) ;
c = MAX_DEMOS ;
}
2012-04-24 07:59:11 +00:00
Con_DPrintf ( " %i demo(s) in loop \n " , c ) ;
2004-08-23 00:15:46 +00:00
for ( i = 1 ; i < c + 1 ; i + + )
Q_strncpyz ( cls . demos [ i - 1 ] , Cmd_Argv ( i ) , sizeof ( cls . demos [ 0 ] ) ) ;
2017-07-12 08:15:27 +00:00
cls . demonum = - 1 ;
2014-08-15 02:20:41 +00:00
//don't start it here - we might have been given a +connect or whatever argument.
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
CL_Demos_f
Return to looping demos
= = = = = = = = = = = = = = = = = =
*/
void CL_Demos_f ( void )
{
if ( cls . demonum = = - 1 )
cls . demonum = 1 ;
CL_Disconnect_f ( ) ;
CL_NextDemo ( ) ;
}
/*
= = = = = = = = = = = = = = = = = =
CL_Stopdemo_f
stop demo
= = = = = = = = = = = = = = = = = =
*/
void CL_Stopdemo_f ( void )
{
if ( cls . demoplayback = = DPB_NONE )
return ;
CL_StopPlayback ( ) ;
2018-12-06 04:55:35 +00:00
CL_Disconnect ( NULL ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = =
CL_Changing_f
Just sent as a hint to the client that they should
drop to full console
= = = = = = = = = = = = = = = = =
*/
void CL_Changing_f ( void )
{
2006-09-17 00:59:22 +00:00
char * mapname = Cmd_Argv ( 1 ) ;
2015-04-14 23:12:17 +00:00
if ( cls . download & & cls . download - > method < = DL_QWPENDING ) // don't change when downloading
2004-08-23 00:15:46 +00:00
return ;
2014-08-25 07:35:41 +00:00
cls . demoseeking = false ; //don't seek over it
2006-09-17 00:59:22 +00:00
if ( * mapname )
SCR_ImageName ( mapname ) ;
else
SCR_BeginLoadingPlaque ( ) ;
2004-08-23 00:15:46 +00:00
S_StopAllSounds ( true ) ;
2015-09-01 04:45:15 +00:00
cl . intermissionmode = IM_NONE ;
2008-11-09 22:29:28 +00:00
if ( cls . state )
{
cls . state = ca_connected ; // not active anymore, but not disconnected
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " \n Changing map... \n " ) ;
2008-11-09 22:29:28 +00:00
}
else
Con_Printf ( " Changing while not connected \n " ) ;
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
cls . signon = 0 ;
# endif
}
/*
= = = = = = = = = = = = = = = = =
CL_Reconnect_f
2018-12-06 04:55:35 +00:00
User command , or NQ protocol command ( messy ) .
2004-08-23 00:15:46 +00:00
= = = = = = = = = = = = = = = = =
*/
void CL_Reconnect_f ( void )
{
2015-04-14 23:12:17 +00:00
if ( cls . download & & cls . download - > method < = DL_QWPENDING ) // don't change when downloading
2004-08-23 00:15:46 +00:00
return ;
# ifdef NQPROT
2017-08-14 16:38:44 +00:00
if ( cls . protocol = = CP_NETQUAKE & & Cmd_IsInsecure ( ) )
2004-08-23 00:15:46 +00:00
{
CL_Changing_f ( ) ;
return ;
}
# endif
S_StopAllSounds ( true ) ;
if ( cls . state = = ca_connected )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " reconnecting... \n " ) ;
2005-03-23 22:14:08 +00:00
CL_SendClientCommand ( true , " new " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( ! * cls . servername )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " No server to reconnect to... \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2018-12-06 04:55:35 +00:00
CL_Disconnect ( NULL ) ;
2004-08-23 00:15:46 +00:00
CL_BeginServerReconnect ( ) ;
}
/*
= = = = = = = = = = = = = = = = =
CL_ConnectionlessPacket
Responses to broadcasts , etc
= = = = = = = = = = = = = = = = =
*/
void CL_ConnectionlessPacket ( void )
{
char * s ;
int c ;
2008-06-08 14:37:57 +00:00
char adr [ MAX_ADR_SIZE ] ;
2015-12-12 19:25:15 +00:00
MSG_BeginReading ( msg_nullnetprim ) ;
MSG_ReadLong ( ) ; // skip the -1
2004-08-23 00:15:46 +00:00
2005-08-03 23:14:59 +00:00
Cmd_TokenizeString ( net_message . data + 4 , false , false ) ;
if ( net_message . cursize = = sizeof ( net_message_buffer ) )
net_message . data [ sizeof ( net_message_buffer ) - 1 ] = ' \0 ' ;
else
net_message . data [ net_message . cursize ] = ' \0 ' ;
2005-08-06 07:18:29 +00:00
# ifdef PLUGINS
2005-08-03 23:14:59 +00:00
if ( Plug_ConnectionlessClientPacket ( net_message . data + 4 , net_message . cursize - 4 ) )
return ;
2005-08-06 07:18:29 +00:00
# endif
2005-08-03 23:14:59 +00:00
2004-08-23 00:15:46 +00:00
c = MSG_ReadByte ( ) ;
2006-09-17 00:59:22 +00:00
// ping from somewhere
if ( c = = A2A_PING )
{
char data [ 256 ] ;
2008-05-26 21:04:42 +00:00
int len ;
2006-09-17 00:59:22 +00:00
2008-06-01 22:06:22 +00:00
if ( cls . realserverip . type = = NA_INVALID )
return ; //not done a realip yet
2013-05-03 04:28:08 +00:00
if ( NET_CompareBaseAdr ( & cls . realserverip , & net_from ) = = false )
2008-06-01 22:06:22 +00:00
return ; //only reply if it came from the real server's ip.
2006-09-17 00:59:22 +00:00
data [ 0 ] = 0xff ;
data [ 1 ] = 0xff ;
data [ 2 ] = 0xff ;
data [ 3 ] = 0xff ;
data [ 4 ] = A2A_ACK ;
data [ 5 ] = 0 ;
2008-06-01 22:06:22 +00:00
//ack needs two parameters to work with realip properly.
//firstly it needs an auth message, so it can't be spoofed.
//secondly, it needs a copy of the realip ident, so you can't report a different player's client (you would need access to their ip).
data [ 5 ] = ' ' ;
2011-07-22 15:11:35 +00:00
Q_snprintfz ( data + 6 , sizeof ( data ) - 6 , " %i %i " , atoi ( MSG_ReadString ( ) ) , cls . realip_ident ) ;
2008-06-01 22:06:22 +00:00
len = strlen ( data ) ;
2006-09-17 00:59:22 +00:00
2018-12-28 00:04:36 +00:00
NET_SendPacket ( cls . sockets , len , & data , & net_from ) ;
2006-09-17 00:59:22 +00:00
return ;
}
2008-11-09 22:29:28 +00:00
if ( c = = A2C_PRINT )
{
if ( ! strncmp ( net_message . data + msg_readcount , " \\ chunk " , 6 ) )
{
2013-05-03 04:28:08 +00:00
if ( NET_CompareBaseAdr ( & cls . netchan . remote_address , & net_from ) = = false )
if ( cls . realserverip . type = = NA_INVALID | | NET_CompareBaseAdr ( & cls . realserverip , & net_from ) = = false )
2008-11-09 22:29:28 +00:00
return ; //only use it if it came from the real server's ip (this breaks on proxies).
MSG_ReadLong ( ) ;
MSG_ReadChar ( ) ;
MSG_ReadChar ( ) ;
if ( CL_ParseOOBDownload ( ) )
{
if ( msg_readcount ! = net_message . cursize )
{
Con_Printf ( " junk on the end of the packet \n " ) ;
CL_Disconnect_f ( ) ;
}
2014-06-12 23:08:42 +00:00
cls . netchan . last_received = realtime ; //in case there's some virus scanner running on the server making it stall... for instance...
2008-11-09 22:29:28 +00:00
}
return ;
}
}
2012-01-17 07:57:46 +00:00
if ( cls . demoplayback = = DPB_NONE & & net_from . type ! = NA_LOOPBACK )
2013-11-29 14:36:47 +00:00
Con_Printf ( " %s: " , NET_AdrToString ( adr , sizeof ( adr ) , & net_from ) ) ;
2004-12-24 08:45:56 +00:00
// Con_DPrintf ("%s", net_message.data + 4);
2004-08-23 00:15:46 +00:00
2014-03-30 08:55:06 +00:00
if ( c = = ' f ' ) //using 'f' as a prefix so that I don't need lots of hacks
{
s = MSG_ReadStringLine ( ) ;
if ( ! strcmp ( s , " redir " ) )
{
netadr_t adr ;
char * data = MSG_ReadStringLine ( ) ;
Con_TPrintf ( " redirect to %s \n " , data ) ;
2018-04-07 12:33:06 +00:00
if ( NET_StringToAdr ( data , PORT_DEFAULTSERVER , & adr ) )
2015-07-09 18:02:49 +00:00
{
2016-02-15 06:01:17 +00:00
if ( NET_CompareAdr ( & connectinfo . adr , & net_from ) )
{
2019-09-04 08:32:22 +00:00
if ( ! NET_EnsureRoute ( cls . sockets , " redir " , cls . servername , & connectinfo . adr ) )
Con_Printf ( " Unable to redirect to %s \n " , data ) ;
else
{
connectinfo . istransfer = true ;
connectinfo . adr = adr ;
data = " \xff \xff \xff \xff getchallenge \n " ;
NET_SendPacket ( cls . sockets , strlen ( data ) , data , & adr ) ;
}
2016-02-15 06:01:17 +00:00
}
2015-07-09 18:02:49 +00:00
}
2014-03-30 08:55:06 +00:00
return ;
}
else if ( ! strcmp ( s , " reject " ) )
{ //generic rejection. stop trying.
char * data = MSG_ReadStringLine ( ) ;
2014-08-15 02:20:41 +00:00
Con_Printf ( " reject \n %s \n " , data ) ;
2015-07-09 18:02:49 +00:00
if ( NET_CompareAdr ( & connectinfo . adr , & net_from ) )
2019-01-29 07:18:07 +00:00
{
Cvar_Set ( & cl_disconnectreason , va ( " %s \n " , data ) ) ;
2015-07-09 18:02:49 +00:00
connectinfo . trying = false ;
2019-01-29 07:18:07 +00:00
}
2014-03-30 08:55:06 +00:00
return ;
}
else if ( ! strcmp ( s , " badname " ) )
{ //rejected purely because of player name
2015-07-09 18:02:49 +00:00
if ( NET_CompareAdr ( & connectinfo . adr , & net_from ) )
2019-01-29 07:18:07 +00:00
{
Cvar_Set ( & cl_disconnectreason , va ( " bad player name \n " ) ) ;
2015-07-09 18:02:49 +00:00
connectinfo . trying = false ;
2019-01-29 07:18:07 +00:00
}
2014-03-30 08:55:06 +00:00
}
else if ( ! strcmp ( s , " badaccount " ) )
{ //rejected because username or password is wrong
2015-07-09 18:02:49 +00:00
if ( NET_CompareAdr ( & connectinfo . adr , & net_from ) )
2019-01-29 07:18:07 +00:00
{
Cvar_Set ( & cl_disconnectreason , va ( " invalid username or password \n " ) ) ;
2015-07-09 18:02:49 +00:00
connectinfo . trying = false ;
2019-01-29 07:18:07 +00:00
}
2014-03-30 08:55:06 +00:00
}
2015-07-09 18:02:49 +00:00
Con_Printf ( " f%s \n " , s ) ;
return ;
2014-03-30 08:55:06 +00:00
}
2004-12-24 08:45:56 +00:00
if ( c = = S2C_CHALLENGE )
{
2011-12-23 03:12:29 +00:00
static unsigned int lasttime = 0xdeadbeef ;
2015-04-14 23:12:17 +00:00
static netadr_t lastadr ;
2011-12-23 03:12:29 +00:00
unsigned int curtime = Sys_Milliseconds ( ) ;
2019-03-23 07:06:37 +00:00
unsigned long ftepext1 = 0 , ftepext2 = 0 , ezpext1 = 0 , huffcrc = 0 , mtu = 0 ;
2017-05-18 10:24:09 +00:00
# ifdef HAVE_DTLS
2018-10-23 07:09:06 +00:00
int candtls = 0 ; //0=no,1=optional,2=mandatory
2017-05-18 10:24:09 +00:00
# endif
2017-09-20 11:27:13 +00:00
char guidhash [ 256 ] ;
2019-07-29 05:28:20 +00:00
* guidhash = 0 ;
2004-08-23 00:15:46 +00:00
s = MSG_ReadString ( ) ;
COM_Parse ( s ) ;
2015-12-12 19:25:15 +00:00
# ifdef Q3CLIENT
if ( ! strcmp ( com_token , " onnectResponse " ) )
{
connectinfo . protocol = CP_QUAKE3 ;
goto client_connect ;
}
# endif
# ifdef Q2CLIENT
if ( ! strcmp ( com_token , " lient_connect " ) )
{
connectinfo . protocol = CP_QUAKE2 ;
goto client_connect ;
}
# endif
Con_TPrintf ( " challenge \n " ) ;
2004-12-24 08:45:56 +00:00
if ( ! strcmp ( com_token , " hallengeResponse " ) )
{
2011-12-23 03:12:29 +00:00
/*Quake3*/
2004-12-24 08:45:56 +00:00
# ifdef Q3CLIENT
2014-03-30 08:55:06 +00:00
if ( connectinfo . protocol = = CP_QUAKE3 | | connectinfo . protocol = = CP_UNKNOWN )
2006-07-29 21:38:05 +00:00
{
2011-12-23 03:12:29 +00:00
/*throttle*/
if ( curtime - lasttime < 500 )
return ;
lasttime = curtime ;
2014-03-30 08:55:06 +00:00
connectinfo . protocol = CP_QUAKE3 ;
connectinfo . challenge = atoi ( s + 17 ) ;
2019-03-23 07:06:37 +00:00
CL_SendConnectPacket ( & net_from , 0 , 0 , 0 , 0 , 0 /*, ...*/ , NULL ) ;
2006-07-29 21:38:05 +00:00
}
else
{
2014-03-30 08:55:06 +00:00
Con_Printf ( " \n Challenge from another protocol, ignoring Q3 challenge \n " ) ;
return ;
2006-07-29 21:38:05 +00:00
}
2004-12-24 08:45:56 +00:00
return ;
# else
Con_Printf ( " \n Unable to connect to Quake3 \n " ) ;
return ;
# endif
}
else if ( ! strcmp ( com_token , " hallenge " ) )
2004-08-23 00:15:46 +00:00
{
2011-12-23 03:12:29 +00:00
/*Quake2 or Darkplaces*/
2004-11-20 01:12:02 +00:00
char * s2 ;
2011-12-23 03:12:29 +00:00
2004-12-24 08:45:56 +00:00
for ( s2 = s + 9 ; * s2 ; s2 + + )
2004-11-20 01:12:02 +00:00
{
2004-12-24 08:45:56 +00:00
if ( ( * s2 < ' 0 ' | | * s2 > ' 9 ' ) & & * s2 ! = ' - ' )
2004-11-20 01:12:02 +00:00
break ;
}
2016-07-12 00:40:13 +00:00
if ( ! strncmp ( s2 , " FTE " , 3 ) | | ! strncmp ( s2 , " QW " , 2 ) )
{ //hack to work around NQ+QW+DP servers that reply with both qw and dp challenge requests.
//we DON'T want to treat it as a dp server. because then we end up with nq-based protocols.
return ;
}
else if ( * s2 & & * s2 ! = ' ' )
2007-10-05 18:08:47 +00:00
{ //and if it's not, we're unlikly to be compatible with whatever it is that's talking at us.
2004-11-20 01:12:02 +00:00
# ifdef NQPROT
2014-03-30 08:55:06 +00:00
if ( connectinfo . protocol = = CP_NETQUAKE | | connectinfo . protocol = = CP_UNKNOWN )
2006-07-29 21:38:05 +00:00
{
2012-02-15 13:35:37 +00:00
/*throttle*/
if ( curtime - lasttime < 500 )
return ;
lasttime = curtime ;
2014-03-30 08:55:06 +00:00
connectinfo . protocol = CP_NETQUAKE ;
2013-05-03 04:28:08 +00:00
CL_ConnectToDarkPlaces ( s + 9 , & net_from ) ;
2006-07-29 21:38:05 +00:00
}
else
2007-10-15 01:49:28 +00:00
Con_Printf ( " \n Challenge from another protocol, ignoring DP challenge \n " ) ;
2004-11-20 01:12:02 +00:00
# else
2004-12-24 08:45:56 +00:00
Con_Printf ( " \n Unable connect to DarkPlaces \n " ) ;
2004-11-20 01:12:02 +00:00
# endif
return ;
}
# ifdef Q2CLIENT
2014-03-30 08:55:06 +00:00
if ( connectinfo . protocol = = CP_QUAKE2 | | connectinfo . protocol = = CP_UNKNOWN )
2015-12-28 17:41:39 +00:00
{
2014-03-30 08:55:06 +00:00
connectinfo . protocol = CP_QUAKE2 ;
2015-12-28 17:41:39 +00:00
connectinfo . subprotocol = PROTOCOL_VERSION_Q2 ;
}
2006-07-29 21:38:05 +00:00
else
{
2007-10-15 01:49:28 +00:00
Con_Printf ( " \n Challenge from another protocol, ignoring Q2 challenge \n " ) ;
2006-07-29 21:38:05 +00:00
return ;
}
2004-12-24 08:45:56 +00:00
# else
Con_Printf ( " \n Unable to connect to Quake2 \n " ) ;
2017-05-18 10:24:09 +00:00
return ;
2004-11-20 01:12:02 +00:00
# endif
2004-08-23 00:15:46 +00:00
s + = 9 ;
}
2011-12-23 03:12:29 +00:00
/*no idea, assume a QuakeWorld challenge response ('c' packet)*/
2014-03-30 08:55:06 +00:00
else if ( connectinfo . protocol = = CP_QUAKEWORLD | | connectinfo . protocol = = CP_UNKNOWN )
2015-12-28 17:41:39 +00:00
{
2014-03-30 08:55:06 +00:00
connectinfo . protocol = CP_QUAKEWORLD ;
2015-12-28 17:41:39 +00:00
connectinfo . subprotocol = PROTOCOL_VERSION_QW ;
}
2006-07-29 21:38:05 +00:00
else
{
2007-10-02 15:56:16 +00:00
Con_Printf ( " \n Challenge from another protocol, ignoring QW challenge \n " ) ;
2006-07-29 21:38:05 +00:00
return ;
}
2011-12-23 03:12:29 +00:00
2014-03-30 08:55:06 +00:00
/*throttle connect requests*/
if ( curtime - lasttime < 500 & & NET_CompareAdr ( & net_from , & lastadr ) )
2011-12-23 03:12:29 +00:00
return ;
lasttime = curtime ;
2014-03-30 08:55:06 +00:00
lastadr = net_from ;
2011-12-23 03:12:29 +00:00
2015-12-28 17:41:39 +00:00
s = COM_Parse ( s ) ;
connectinfo . challenge = atoi ( com_token ) ;
while ( ( s = COM_Parse ( s ) ) )
{
if ( connectinfo . protocol = = CP_QUAKE2 & & ! strncmp ( com_token , " p= " , 2 ) )
{
char * p = com_token + 2 ;
do
{
switch ( strtoul ( p , & p , 0 ) )
{
case PROTOCOL_VERSION_R1Q2 :
2016-10-22 07:06:51 +00:00
# ifdef AVAIL_ZLIB //r1q2 will typically send us compressed data, which is a problem if we can't handle that (q2pro has a way to disable it).
2015-12-28 17:41:39 +00:00
if ( connectinfo . subprotocol < PROTOCOL_VERSION_R1Q2 )
connectinfo . subprotocol = PROTOCOL_VERSION_R1Q2 ;
2016-10-22 07:06:51 +00:00
# endif
2015-12-28 17:41:39 +00:00
break ;
case PROTOCOL_VERSION_Q2PRO :
if ( connectinfo . subprotocol < PROTOCOL_VERSION_Q2PRO )
connectinfo . subprotocol = PROTOCOL_VERSION_Q2PRO ;
break ;
}
} while ( * p + + = = ' , ' ) ;
}
}
2004-08-23 00:15:46 +00:00
for ( ; ; )
{
2017-05-18 10:24:09 +00:00
int cmd = MSG_ReadLong ( ) ;
2004-08-23 00:15:46 +00:00
if ( msg_badread )
break ;
2017-05-18 10:24:09 +00:00
if ( cmd = = PROTOCOL_VERSION_VARLENGTH )
2010-07-18 08:42:59 +00:00
{
int len = MSG_ReadLong ( ) ;
if ( len < 0 | | len > 8192 )
break ;
c = MSG_ReadLong ( ) ; /*ident*/
2017-05-18 10:24:09 +00:00
switch ( c )
{
2017-09-20 11:27:13 +00:00
case PROTOCOL_INFO_GUID :
if ( len > sizeof ( guidhash ) - 1 )
{
MSG_ReadData ( guidhash , sizeof ( guidhash ) ) ;
MSG_ReadSkip ( len - sizeof ( guidhash ) ) ;
len = sizeof ( guidhash ) - 1 ;
}
else
MSG_ReadData ( guidhash , len ) ;
guidhash [ len ] = 0 ;
break ;
2017-05-18 10:24:09 +00:00
default :
MSG_ReadSkip ( len ) ; /*payload*/
break ;
}
2010-07-18 08:42:59 +00:00
}
2017-05-18 10:24:09 +00:00
else
{
unsigned int l = MSG_ReadLong ( ) ;
switch ( cmd )
{
2019-05-10 09:31:21 +00:00
case PROTOCOL_VERSION_FTE1 : ftepext1 = l ; break ;
2019-03-23 07:06:37 +00:00
case PROTOCOL_VERSION_FTE2 : ftepext2 = l ; break ;
case PROTOCOL_VERSION_EZQUAKE1 : ezpext1 = l ; break ;
2017-05-18 10:24:09 +00:00
case PROTOCOL_VERSION_FRAGMENT : mtu = l ; break ;
# ifdef HAVE_DTLS
2017-09-20 11:27:13 +00:00
case PROTOCOL_VERSION_DTLSUPGRADE : candtls = l ; break ; //0:not enabled. 1:explicit use allowed. 2:favour it. 3: require it
2017-05-18 10:24:09 +00:00
# endif
2004-08-23 00:15:46 +00:00
# ifdef HUFFNETWORK
2017-05-18 10:24:09 +00:00
case PROTOCOL_VERSION_HUFFMAN : huffcrc = l ; break ;
2004-08-23 00:15:46 +00:00
# endif
2017-09-20 11:27:13 +00:00
case PROTOCOL_INFO_GUID : Q_snprintfz ( guidhash , sizeof ( guidhash ) , " 0x%x " , l ) ; break ;
2017-05-18 10:24:09 +00:00
default :
break ;
}
}
}
# ifdef HAVE_DTLS
if ( candtls & & connectinfo . adr . prot = = NP_DGRAM & & ( connectinfo . dtlsupgrade | | candtls > 1 ) )
{
//c2s getchallenge
//s2c c%u\0DTLS=0
//c2s dtlsconnect %u
//s2c dtlsopened
//c2s DTLS(getchallenge)
//DTLS(etc)
2018-10-23 07:09:06 +00:00
//getchallenge has to be done twice, with the outer one only reporting whether dtls can/should be used.
//this means the actual connect packet is already over dtls, which protects the user's userinfo.
//FIXME: do rcon via dtls too, but requires tracking pending rcon packets until the handshake completes.
2017-05-18 10:24:09 +00:00
//server says it can do tls.
char * pkt = va ( " %c%c%c%cdtlsconnect %i " , 255 , 255 , 255 , 255 , connectinfo . challenge ) ;
2018-12-28 00:04:36 +00:00
NET_SendPacket ( cls . sockets , strlen ( pkt ) , pkt , & net_from ) ;
2017-05-18 10:24:09 +00:00
return ;
2004-08-23 00:15:46 +00:00
}
2017-05-18 10:24:09 +00:00
if ( connectinfo . dtlsupgrade = = DTLS_REQUIRE )
{
2019-01-29 07:18:07 +00:00
Cvar_Set ( & cl_disconnectreason , va ( " Server does not support/allow dtls. not connecting \n " ) ) ;
2017-05-18 10:24:09 +00:00
connectinfo . trying = false ;
Con_Printf ( " Server does not support/allow dtls. not connecting. \n " ) ;
return ;
}
# endif
2019-03-23 07:06:37 +00:00
CL_SendConnectPacket ( & net_from , mtu , ftepext1 , ftepext2 , ezpext1 , huffcrc /*, ...*/ , guidhash ) ;
2004-08-23 00:15:46 +00:00
return ;
}
# ifdef Q2CLIENT
2014-03-30 08:55:06 +00:00
if ( connectinfo . protocol = = CP_QUAKE2 )
2004-08-23 00:15:46 +00:00
{
char * nl ;
msg_readcount - - ;
c = msg_readcount ;
s = MSG_ReadString ( ) ;
nl = strchr ( s , ' \n ' ) ;
if ( nl )
{
msg_readcount = c + nl - s + 1 ;
2008-05-25 01:17:16 +00:00
msg_badread = false ;
2004-08-23 00:15:46 +00:00
* nl = ' \0 ' ;
}
if ( ! strcmp ( s , " print " ) )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " print \n " ) ;
2004-08-23 00:15:46 +00:00
s = MSG_ReadString ( ) ;
2018-12-06 04:55:35 +00:00
if ( connectinfo . trying & & NET_CompareBaseAdr ( & connectinfo . adr , & net_from ) = = false )
Cvar_Set ( & cl_disconnectreason , s ) ;
2005-09-26 08:07:26 +00:00
Con_Printf ( " %s " , s ) ;
2004-08-23 00:15:46 +00:00
return ;
}
else if ( ! strcmp ( s , " client_connect " ) )
{
2014-03-30 08:55:06 +00:00
connectinfo . protocol = CP_QUAKE2 ;
2004-08-23 00:15:46 +00:00
goto client_connect ;
}
2004-12-24 08:45:56 +00:00
else if ( ! strcmp ( s , " disconnect " ) )
{
2013-05-03 04:28:08 +00:00
if ( NET_CompareAdr ( & net_from , & cls . netchan . remote_address ) )
2004-12-24 08:45:56 +00:00
{
2019-02-01 08:29:14 +00:00
Cvar_Set ( & cl_disconnectreason , " Disconnect request from server " ) ;
2004-12-24 08:45:56 +00:00
Con_Printf ( " disconnect \n " ) ;
CL_Disconnect_f ( ) ;
return ;
}
else
{
Con_Printf ( " Ignoring random disconnect command \n " ) ;
return ;
}
}
2004-08-23 00:15:46 +00:00
else
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " unknown connectionless packet for q2: %s \n " , s ) ;
2004-08-23 00:15:46 +00:00
msg_readcount = c ;
c = MSG_ReadByte ( ) ;
}
}
# endif
2005-06-15 04:45:26 +00:00
2004-11-20 01:12:02 +00:00
# ifdef NQPROT
if ( c = = ' a ' )
{
s = MSG_ReadString ( ) ;
COM_Parse ( s ) ;
if ( ! strcmp ( com_token , " ccept " ) )
{
2017-05-28 15:42:32 +00:00
/*this is a DP server... but we don't know which version nor nq protocol*/
2006-02-22 23:36:03 +00:00
Con_Printf ( " accept \n " ) ;
2016-07-12 00:40:13 +00:00
if ( cls . state = = ca_connected )
return ; //we're already connected. don't do it again!
if ( ! NET_CompareAdr ( & connectinfo . adr , & net_from ) )
{
//if (net_from.type != NA_LOOPBACK)
Con_TPrintf ( " ignoring connection \n " ) ;
return ;
}
2007-09-17 20:35:39 +00:00
Validation_Apply_Ruleset ( ) ;
2015-12-28 17:41:39 +00:00
Netchan_Setup ( NS_CLIENT , & cls . netchan , & net_from , connectinfo . qport ) ;
2008-12-03 02:42:05 +00:00
CL_ParseEstablished ( ) ;
2004-11-20 01:12:02 +00:00
Con_DPrintf ( " CL_EstablishConnection: connected to %s \n " , cls . servername ) ;
2005-06-15 04:45:26 +00:00
2004-11-20 01:12:02 +00:00
cls . netchan . isnqprotocol = true ;
2005-05-26 12:55:34 +00:00
cls . protocol = CP_NETQUAKE ;
2017-05-28 15:42:32 +00:00
cls . protocol_nq = CPNQ_ID ; //assume vanilla protocol until we know better.
2016-07-12 00:40:13 +00:00
cls . proquake_angles_hack = false ;
2014-03-30 08:55:06 +00:00
cls . challenge = connectinfo . challenge ;
connectinfo . trying = false ;
2005-06-15 04:45:26 +00:00
2004-11-20 01:12:02 +00:00
cls . demonum = - 1 ; // not in the demo loop now
cls . state = ca_connected ;
SCR_BeginLoadingPlaque ( ) ;
return ;
}
}
2014-12-23 15:26:42 +00:00
if ( c = = ' i ' )
{
if ( ! strncmp ( net_message . data + 4 , " infoResponse \n " , 13 ) )
{
Con_TPrintf ( " infoResponse \n " ) ;
Info_Print ( net_message . data + 17 , " " ) ;
return ;
}
}
if ( c = = ' g ' )
{
if ( ! strncmp ( net_message . data + 4 , " getserversResponse " , 18 ) )
{
qbyte * b = net_message . data + 4 + 18 ;
Con_TPrintf ( " getserversResponse \n " ) ;
while ( b + 7 < = net_message . data + net_message . cursize )
{
if ( * b = = ' \\ ' )
{
b + = 1 ;
Con_Printf ( " %u.%u.%u.%u:%u \n " , b [ 0 ] , b [ 1 ] , b [ 2 ] , b [ 3 ] , b [ 5 ] | ( b [ 4 ] < < 8 ) ) ;
b + = 6 ;
}
else if ( * b = = ' / ' )
{
b + = 1 ;
Con_Printf ( " [%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]:%u \n " , ( b [ 0 ] < < 8 ) | b [ 1 ] , ( b [ 2 ] < < 8 ) | b [ 3 ] , ( b [ 4 ] < < 8 ) | b [ 5 ] , ( b [ 6 ] < < 8 ) | b [ 7 ] , ( b [ 8 ] < < 8 ) | b [ 9 ] , ( b [ 10 ] < < 8 ) | b [ 11 ] , ( b [ 12 ] < < 8 ) | b [ 13 ] , ( b [ 14 ] < < 8 ) | b [ 15 ] , b [ 17 ] | ( b [ 16 ] < < 8 ) ) ;
b + = 18 ;
}
}
return ;
}
}
2004-11-20 01:12:02 +00:00
# endif
2017-05-18 10:24:09 +00:00
if ( c = = ' d ' /*M2C_MASTER_REPLY*/ )
2004-12-24 08:45:56 +00:00
{
2017-05-18 10:24:09 +00:00
s = MSG_ReadString ( ) ;
COM_Parse ( s ) ;
2019-02-01 08:29:14 +00:00
if ( ! strcmp ( com_token , " isconnect " ) )
{
Con_Printf ( " Disconnect \n " ) ;
if ( NET_CompareAdr ( & connectinfo . adr , & net_from ) )
{
Cvar_Set ( & cl_disconnectreason , " Disconnect request from server " ) ;
CL_Disconnect_f ( ) ;
}
}
else if ( ! strcmp ( com_token , " tlsopened " ) )
2017-05-18 10:24:09 +00:00
{ //server is letting us know that its now listening for a dtls handshake.
# ifdef HAVE_DTLS
Con_Printf ( " dtlsopened \n " ) ;
if ( ! NET_CompareAdr ( & connectinfo . adr , & net_from ) )
return ;
2017-06-21 01:24:25 +00:00
if ( NET_DTLS_Create ( cls . sockets , & net_from ) )
{
connectinfo . dtlsupgrade = DTLS_ACTIVE ;
connectinfo . adr . prot = NP_DTLS ;
}
else
{
if ( connectinfo . dtlsupgrade = = DTLS_TRY )
connectinfo . dtlsupgrade = DTLS_DISABLE ;
2017-05-18 10:24:09 +00:00
Con_Printf ( " unable to establish dtls route \n " ) ;
2017-06-21 01:24:25 +00:00
}
2017-05-18 10:24:09 +00:00
# else
Con_Printf ( " dtlsopened (unsupported) \n " ) ;
# endif
}
else if ( * s ! = ' \n ' )
{ //qw master server list response
Con_Printf ( " server ip list \n " ) ;
}
else
2005-06-04 04:20:20 +00:00
{
2017-05-18 10:24:09 +00:00
Con_Printf ( " d \n " ) ;
if ( cls . demoplayback ! = DPB_NONE )
{
Con_Printf ( " Disconnect \n " ) ;
CL_Disconnect_f ( ) ;
}
2005-06-04 04:20:20 +00:00
}
2004-12-24 08:45:56 +00:00
return ;
}
2004-08-23 00:15:46 +00:00
if ( c = = S2C_CONNECTION )
{
2014-03-30 08:55:06 +00:00
connectinfo . protocol = CP_QUAKEWORLD ;
2015-12-28 17:41:39 +00:00
connectinfo . subprotocol = PROTOCOL_VERSION_QW ;
2015-12-12 19:25:15 +00:00
# if defined(Q2CLIENT) || defined(Q3CLIENT)
2004-08-23 00:15:46 +00:00
client_connect : //fixme: make function
# endif
2015-07-09 18:02:49 +00:00
if ( net_from . type = = NA_INVALID )
return ; //I've found a qizmo demo that contains one of these. its best left ignored.
2014-03-30 08:55:06 +00:00
if ( ! NET_CompareAdr ( & connectinfo . adr , & net_from ) )
{
if ( net_from . type ! = NA_LOOPBACK )
Con_TPrintf ( " ignoring connection \n " ) ;
return ;
}
2012-01-17 07:57:46 +00:00
if ( net_from . type ! = NA_LOOPBACK )
2017-05-23 07:03:07 +00:00
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " connection \n " ) ;
2014-03-30 08:55:06 +00:00
2017-05-23 07:03:07 +00:00
# ifndef CLIENTONLY
if ( sv . state )
SV_UnspawnServer ( ) ;
# endif
}
2004-08-23 00:15:46 +00:00
if ( cls . state > = ca_connected )
{
2014-03-30 08:55:06 +00:00
if ( ! NET_CompareAdr ( & cls . netchan . remote_address , & net_from ) )
{
# ifndef CLIENTONLY
if ( sv . state ! = ss_clustermode )
# endif
2018-12-06 04:55:35 +00:00
CL_Disconnect ( NULL ) ;
2014-03-30 08:55:06 +00:00
}
else
{
if ( cls . demoplayback = = DPB_NONE )
Con_TPrintf ( " Dup connect received. Ignored. \n " ) ;
return ;
}
2004-08-23 00:15:46 +00:00
}
2014-03-30 08:55:06 +00:00
connectinfo . trying = false ;
2015-12-28 17:41:39 +00:00
cl . splitclients = 0 ;
2014-03-30 08:55:06 +00:00
cls . protocol = connectinfo . protocol ;
2016-07-12 00:40:13 +00:00
cls . proquake_angles_hack = false ;
2015-12-28 17:41:39 +00:00
cls . fteprotocolextensions = connectinfo . fteext1 ;
cls . fteprotocolextensions2 = connectinfo . fteext2 ;
2019-03-23 07:06:37 +00:00
cls . ezprotocolextensions1 = connectinfo . ezext1 ;
2014-03-30 08:55:06 +00:00
cls . challenge = connectinfo . challenge ;
2015-12-28 17:41:39 +00:00
Netchan_Setup ( NS_CLIENT , & cls . netchan , & net_from , connectinfo . qport ) ;
if ( cls . protocol = = CP_QUAKE2 )
{
cls . protocol_q2 = connectinfo . subprotocol ;
if ( cls . protocol_q2 = = PROTOCOL_VERSION_R1Q2 | | cls . protocol_q2 = = PROTOCOL_VERSION_Q2PRO )
cls . netchan . qportsize = 1 ;
}
2019-05-23 15:11:32 +00:00
cls . netchan . pext_fragmentation = connectinfo . mtu ? true : false ;
2015-04-14 23:12:17 +00:00
if ( connectinfo . mtu > = 64 )
2019-05-23 15:11:32 +00:00
{
cls . netchan . mtu = connectinfo . mtu ;
2015-04-14 23:12:17 +00:00
cls . netchan . message . maxsize = sizeof ( cls . netchan . message_buf ) ;
2019-05-23 15:11:32 +00:00
}
else
cls . netchan . mtu = MAX_QWMSGLEN ;
2014-05-10 13:42:13 +00:00
# ifdef HUFFNETWORK
cls . netchan . compresstable = Huff_CompressionCRC ( connectinfo . compresscrc ) ;
# else
cls . netchan . compresstable = NULL ;
# endif
2012-02-12 05:18:31 +00:00
CL_ParseEstablished ( ) ;
2005-04-16 16:21:27 +00:00
# ifdef Q3CLIENT
2005-06-04 04:20:20 +00:00
if ( cls . protocol ! = CP_QUAKE3 )
2005-04-16 16:21:27 +00:00
# endif
2005-03-23 22:14:08 +00:00
CL_SendClientCommand ( true , " new " ) ;
2004-08-23 00:15:46 +00:00
cls . state = ca_connected ;
2012-01-17 07:57:46 +00:00
if ( cls . netchan . remote_address . type ! = NA_LOOPBACK )
2017-05-18 10:24:09 +00:00
{
2019-02-24 08:32:45 +00:00
switch ( cls . protocol )
{
case CP_QUAKEWORLD : Con_DPrintf ( " QW " ) ; break ;
case CP_NETQUAKE : Con_Printf ( " NQ " ) ; break ;
case CP_QUAKE2 : Con_Printf ( " Q2 " ) ; break ;
case CP_QUAKE3 : Con_Printf ( " Q3 " ) ; break ;
default : break ;
}
2017-05-18 10:24:09 +00:00
if ( cls . netchan . remote_address . prot = = NP_DTLS | | cls . netchan . remote_address . prot = = NP_TLS | | cls . netchan . remote_address . prot = = NP_WSS )
2019-02-24 08:32:45 +00:00
Con_TPrintf ( " Connected (^[^2encrypted \\ tip \\ Any passwords will be sent securely, but may still be logged^]). \n " ) ;
2017-05-18 10:24:09 +00:00
else
2019-02-24 08:32:45 +00:00
Con_TPrintf ( " Connected (^[^1plain-text \\ tip \\ " CON_WARNING " Do not type passwords as they can potentially be seen by network sniffers^]). \n " ) ;
2017-05-18 10:24:09 +00:00
}
2014-06-02 16:50:40 +00:00
# ifdef QUAKESPYAPI
2004-08-23 00:15:46 +00:00
allowremotecmd = false ; // localid required now for remote cmds
2014-06-02 16:50:40 +00:00
# endif
2006-05-07 20:57:30 +00:00
total_loading_size = 100 ;
current_loading_size = 0 ;
2009-04-06 00:34:32 +00:00
SCR_SetLoadingStage ( LS_CLIENT ) ;
2006-05-07 20:57:30 +00:00
2007-09-17 20:35:39 +00:00
Validation_Apply_Ruleset ( ) ;
2016-07-12 00:40:13 +00:00
CL_WriteSetDemoMessage ( ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-06-02 16:50:40 +00:00
# ifdef QUAKESPYAPI
2004-08-23 00:15:46 +00:00
// remote command from gui front end
2004-12-25 02:06:27 +00:00
if ( c = = A2C_CLIENT_COMMAND ) //man I hate this.
2004-08-23 00:15:46 +00:00
{
char cmdtext [ 2048 ] ;
2015-07-09 18:02:49 +00:00
if ( net_from . type = = NA_INVALID | | net_from . type ! = net_local_cl_ipadr . type | | net_from . type ! = NA_IP
2006-02-17 02:51:59 +00:00
| | ( ( * ( unsigned * ) net_from . address . ip ! = * ( unsigned * ) net_local_cl_ipadr . address . ip ) & & ( * ( unsigned * ) net_from . address . ip ! = htonl ( INADDR_LOOPBACK ) ) ) )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Command packet from remote host. Ignored. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-03-30 08:55:06 +00:00
# if defined(_WIN32) && !defined(WINRT)
2004-08-23 00:15:46 +00:00
ShowWindow ( mainwindow , SW_RESTORE ) ;
SetForegroundWindow ( mainwindow ) ;
# endif
s = MSG_ReadString ( ) ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " client command: %s \n " , s ) ;
2004-08-23 00:15:46 +00:00
Q_strncpyz ( cmdtext , s , sizeof ( cmdtext ) ) ;
s = MSG_ReadString ( ) ;
while ( * s & & isspace ( * s ) )
s + + ;
while ( * s & & isspace ( s [ strlen ( s ) - 1 ] ) )
s [ strlen ( s ) - 1 ] = 0 ;
2013-11-29 14:36:47 +00:00
if ( ! allowremotecmd & & ( ! * localid . string | | strcmp ( localid . string , s ) ) )
{
if ( ! * localid . string )
{
Con_TPrintf ( " ^&C0Command packet received from local host, but no localid has been set. You may need to upgrade your server browser. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2016-07-12 00:40:13 +00:00
Con_TPrintf ( " ^&C0Invalid localid on command packet received from local host. \n |%s| != |%s| \n You may need to reload your server browser and game. \n " ,
2004-08-23 00:15:46 +00:00
s , localid . string ) ;
Cvar_Set ( & localid , " " ) ;
return ;
}
2004-12-25 02:06:27 +00:00
Cbuf_AddText ( cmdtext , RESTRICT_SERVER ) ;
2004-08-23 00:15:46 +00:00
allowremotecmd = false ;
return ;
}
2014-06-02 16:50:40 +00:00
# endif
2004-08-23 00:15:46 +00:00
// print command from somewhere
2004-12-24 08:45:56 +00:00
if ( c = = ' p ' )
{
if ( ! strncmp ( net_message . data + 4 , " print \n " , 6 ) )
2018-12-06 04:55:35 +00:00
{ //quake2+quake3 send rejects this way
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " print \n " ) ;
2005-09-26 08:07:26 +00:00
Con_Printf ( " %s " , net_message . data + 10 ) ;
2018-12-06 04:55:35 +00:00
if ( connectinfo . trying & & NET_CompareBaseAdr ( & connectinfo . adr , & net_from ) = = false )
Cvar_Set ( & cl_disconnectreason , net_message . data + 10 ) ;
2004-12-24 08:45:56 +00:00
return ;
}
}
2004-08-23 00:15:46 +00:00
if ( c = = A2C_PRINT )
2018-12-06 04:55:35 +00:00
{ //closest quakeworld has to a reject message
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " print \n " ) ;
2004-08-23 00:15:46 +00:00
s = MSG_ReadString ( ) ;
2005-09-26 08:07:26 +00:00
Con_Printf ( " %s " , s ) ;
2018-12-06 04:55:35 +00:00
if ( connectinfo . trying & & NET_CompareBaseAdr ( & connectinfo . adr , & net_from ) = = false )
Cvar_Set ( & cl_disconnectreason , s ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2018-12-06 04:55:35 +00:00
if ( c = = ' r ' )
{ //darkplaces-style rejects
2005-06-04 04:20:20 +00:00
s = MSG_ReadString ( ) ;
Con_Printf ( " r%s \n " , s ) ;
2018-12-06 04:55:35 +00:00
if ( connectinfo . trying & & NET_CompareBaseAdr ( & connectinfo . adr , & net_from ) = = false )
Cvar_Set ( & cl_disconnectreason , s ) ;
2005-06-04 04:20:20 +00:00
return ;
}
2004-08-23 00:15:46 +00:00
//happens in demos
2015-07-09 18:02:49 +00:00
if ( c = = svc_disconnect & & cls . demoplayback ! = DPB_NONE & & net_from . type = = NA_INVALID )
2004-08-23 00:15:46 +00:00
{
Host_EndGame ( " End of Demo " ) ;
return ;
}
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " unknown connectionless packet: %c \n " , c ) ;
2004-08-23 00:15:46 +00:00
}
2005-05-26 12:55:34 +00:00
# ifdef NQPROT
void CLNQ_ConnectionlessPacket ( void )
{
char * s ;
int length ;
2011-10-27 15:46:36 +00:00
unsigned short port ;
2005-05-26 12:55:34 +00:00
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
MSG_BeginReading ( msg_nullnetprim ) ;
2005-07-29 22:26:43 +00:00
length = LongSwap ( MSG_ReadLong ( ) ) ;
2005-05-26 12:55:34 +00:00
if ( ! ( length & NETFLAG_CTL ) )
return ; //not an nq control packet.
length & = NETFLAG_LENGTH_MASK ;
if ( length ! = net_message . cursize )
return ; //not an nq packet.
switch ( MSG_ReadByte ( ) )
{
case CCREP_ACCEPT :
2014-09-16 00:40:30 +00:00
connectinfo . trying = false ;
2005-05-26 12:55:34 +00:00
if ( cls . state > = ca_connected )
{
if ( cls . demoplayback = = DPB_NONE )
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Dup connect received. Ignored. \n " ) ;
2005-05-26 12:55:34 +00:00
return ;
}
2011-10-27 15:46:36 +00:00
port = htons ( ( unsigned short ) MSG_ReadLong ( ) ) ;
2008-12-03 02:42:05 +00:00
//this is the port that we're meant to respond to.
2011-10-27 15:46:36 +00:00
if ( port )
2015-09-10 10:16:26 +00:00
{
char buf [ 256 ] ;
2011-10-27 15:46:36 +00:00
net_from . port = port ;
2015-09-10 10:16:26 +00:00
Con_DPrintf ( " redirecting to port %s \n " , NET_AdrToString ( buf , sizeof ( buf ) , & net_from ) ) ;
}
2005-10-16 03:50:39 +00:00
2016-07-12 00:40:13 +00:00
cls . proquake_angles_hack = false ;
2011-06-16 02:03:57 +00:00
cls . protocol_nq = CPNQ_ID ;
2005-10-16 03:50:39 +00:00
if ( MSG_ReadByte ( ) = = 1 ) //a proquake server adds a little extra info
{
int ver = MSG_ReadByte ( ) ;
2012-10-01 14:29:44 +00:00
Con_DPrintf ( " ProQuake server %i.%i \n " , ver / 10 , ver % 10 ) ;
2005-10-16 03:50:39 +00:00
2011-12-05 15:23:40 +00:00
// if (ver >= 34)
2016-07-12 00:40:13 +00:00
cls . proquake_angles_hack = true ;
2005-10-16 03:50:39 +00:00
if ( MSG_ReadByte ( ) = = 1 )
{
2008-12-03 02:42:05 +00:00
//its a 'pure' server.
2011-06-16 02:03:57 +00:00
Con_Printf ( " pure ProQuake server \n " ) ;
2005-10-16 03:50:39 +00:00
return ;
}
}
2007-09-17 20:35:39 +00:00
Validation_Apply_Ruleset ( ) ;
2015-12-28 17:41:39 +00:00
cls . fteprotocolextensions = connectinfo . fteext1 ;
cls . fteprotocolextensions2 = connectinfo . fteext2 ;
2019-03-23 07:06:37 +00:00
cls . ezprotocolextensions1 = connectinfo . ezext1 ;
2015-12-28 17:41:39 +00:00
Netchan_Setup ( NS_CLIENT , & cls . netchan , & net_from , connectinfo . qport ) ;
2008-12-03 02:42:05 +00:00
CL_ParseEstablished ( ) ;
2005-05-26 12:55:34 +00:00
cls . netchan . isnqprotocol = true ;
2014-05-10 13:42:13 +00:00
cls . netchan . compresstable = NULL ;
2005-05-26 12:55:34 +00:00
cls . protocol = CP_NETQUAKE ;
cls . state = ca_connected ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Connected. \n " ) ;
2006-05-07 20:57:30 +00:00
total_loading_size = 100 ;
current_loading_size = 0 ;
2009-04-06 00:34:32 +00:00
SCR_SetLoadingStage ( LS_CLIENT ) ;
2006-05-07 20:57:30 +00:00
2014-06-02 16:50:40 +00:00
# ifdef QUAKESPYAPI
2005-05-26 12:55:34 +00:00
allowremotecmd = false ; // localid required now for remote cmds
2014-06-02 16:50:40 +00:00
# endif
2005-08-03 23:14:59 +00:00
//send a dummy packet.
2016-07-12 00:40:13 +00:00
//this makes our local nat think we initialised the conversation, so that we can receive the.
2011-06-16 02:03:57 +00:00
Netchan_Transmit ( & cls . netchan , 1 , " \x01 " , 2500 ) ;
2005-05-26 12:55:34 +00:00
return ;
case CCREP_REJECT :
s = MSG_ReadString ( ) ;
2005-06-04 04:20:20 +00:00
Con_Printf ( " Connect failed \n %s \n " , s ) ;
2018-12-06 04:55:35 +00:00
if ( connectinfo . trying & & NET_CompareBaseAdr ( & connectinfo . adr , & net_from ) = = false )
Cvar_Set ( & cl_disconnectreason , s ) ;
2005-05-26 12:55:34 +00:00
return ;
}
}
# endif
2004-08-23 00:15:46 +00:00
2012-01-24 04:24:14 +00:00
void CL_MVDUpdateSpectator ( void ) ;
2013-07-26 17:19:06 +00:00
void CL_WriteDemoMessage ( sizebuf_t * msg , int payloadoffset ) ;
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = =
CL_ReadPackets
= = = = = = = = = = = = = = = = =
*/
void CL_ReadPackets ( void )
{
2008-06-08 14:37:57 +00:00
char adr [ MAX_ADR_SIZE ] ;
2012-04-24 07:59:11 +00:00
if ( ! qrenderer )
return ;
2004-08-23 00:15:46 +00:00
// while (NET_GetPacket ())
2005-10-01 03:09:17 +00:00
for ( ; ; )
2004-08-23 00:15:46 +00:00
{
2005-10-01 03:09:17 +00:00
if ( ! CL_GetMessage ( ) )
2017-05-18 10:24:09 +00:00
# ifndef HAVE_DTLS
2005-10-01 03:09:17 +00:00
break ;
2017-05-18 10:24:09 +00:00
# else
{
NET_DTLS_Timeouts ( cls . sockets ) ;
break ;
}
if ( * ( int * ) net_message . data ! = - 1 )
if ( NET_DTLS_Decode ( cls . sockets ) )
if ( ! net_message . cursize )
continue ;
# endif
2005-10-01 03:09:17 +00:00
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
if ( cls . demoplayback = = DPB_NETQUAKE )
{
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
MSG_BeginReading ( cls . netchan . netprim ) ;
2004-08-23 00:15:46 +00:00
cls . netchan . last_received = realtime ;
CLNQ_ParseServerMessage ( ) ;
2005-10-01 03:09:17 +00:00
if ( ! cls . demoplayback )
CL_NextDemo ( ) ;
2004-08-23 00:15:46 +00:00
continue ;
}
# endif
# ifdef Q2CLIENT
if ( cls . demoplayback = = DPB_QUAKE2 )
{
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
MSG_BeginReading ( cls . netchan . netprim ) ;
2004-08-23 00:15:46 +00:00
cls . netchan . last_received = realtime ;
CLQ2_ParseServerMessage ( ) ;
continue ;
}
# endif
//
// remote command packet
//
if ( * ( int * ) net_message . data = = - 1 )
{
CL_ConnectionlessPacket ( ) ;
continue ;
}
2008-01-09 00:52:31 +00:00
if ( net_message . cursize < 6 & & ( cls . demoplayback ! = DPB_MVD & & cls . demoplayback ! = DPB_EZTV ) ) //MVDs don't have the whole sequence header thing going on
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " %s: Runt packet \n " , NET_AdrToString ( adr , sizeof ( adr ) , & net_from ) ) ;
2004-08-23 00:15:46 +00:00
continue ;
}
2005-05-26 12:55:34 +00:00
if ( cls . state = = ca_disconnected )
{ //connect to nq servers, but don't get confused with sequenced packets.
2018-12-28 00:04:36 +00:00
if ( NET_WasSpecialPacket ( cls . sockets ) )
2013-06-23 02:17:02 +00:00
continue ;
2005-05-26 12:55:34 +00:00
# ifdef NQPROT
CLNQ_ConnectionlessPacket ( ) ;
# endif
continue ; //ignore it. We arn't connected.
}
2004-08-23 00:15:46 +00:00
//
// packet from server
//
2005-06-15 04:45:26 +00:00
if ( ! cls . demoplayback & &
2013-05-03 04:28:08 +00:00
! NET_CompareAdr ( & net_from , & cls . netchan . remote_address ) )
2004-08-23 00:15:46 +00:00
{
2018-12-28 00:04:36 +00:00
if ( NET_WasSpecialPacket ( cls . sockets ) )
2013-06-26 03:40:39 +00:00
continue ;
2005-05-26 12:55:34 +00:00
Con_DPrintf ( " %s:sequenced packet from wrong server \n "
2013-05-03 04:28:08 +00:00
, NET_AdrToString ( adr , sizeof ( adr ) , & net_from ) ) ;
2004-08-23 00:15:46 +00:00
continue ;
}
2005-05-26 12:55:34 +00:00
switch ( cls . protocol )
2004-12-24 08:45:56 +00:00
{
2005-05-26 12:55:34 +00:00
case CP_NETQUAKE :
2007-08-07 19:16:32 +00:00
# ifdef NQPROT
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 ( NQNetChan_Process ( & cls . netchan ) )
2005-05-26 12:55:34 +00:00
{
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
MSG_ChangePrimitives ( cls . netchan . netprim ) ;
2013-07-26 17:19:06 +00:00
CL_WriteDemoMessage ( & net_message , msg_readcount ) ;
2005-05-26 12:55:34 +00:00
CLNQ_ParseServerMessage ( ) ;
}
2004-12-24 08:45:56 +00:00
# endif
2007-08-07 19:16:32 +00:00
break ;
case CP_PLUGIN :
break ;
2005-05-26 12:55:34 +00:00
case CP_QUAKE2 :
2007-08-07 19:16:32 +00:00
# ifdef Q2CLIENT
2005-05-26 12:55:34 +00:00
if ( ! Netchan_Process ( & cls . netchan ) )
continue ; // wasn't accepted for some reason
2004-08-23 00:15:46 +00:00
CLQ2_ParseServerMessage ( ) ;
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
break ;
2004-08-23 00:15:46 +00:00
# endif
2007-08-07 19:16:32 +00:00
case CP_QUAKE3 :
# ifdef Q3CLIENT
CLQ3_ParseServerMessage ( ) ;
# endif
break ;
2005-05-26 12:55:34 +00:00
case CP_QUAKEWORLD :
2008-01-09 00:52:31 +00:00
if ( cls . demoplayback = = DPB_MVD | | cls . demoplayback = = DPB_EZTV )
2005-12-21 03:07:33 +00:00
{
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
MSG_BeginReading ( cls . netchan . netprim ) ;
2005-12-21 03:07:33 +00:00
cls . netchan . last_received = realtime ;
2007-12-01 05:55:44 +00:00
cls . netchan . outgoing_sequence = cls . netchan . incoming_sequence ;
2005-12-21 03:07:33 +00:00
}
2005-05-26 12:55:34 +00:00
else if ( ! Netchan_Process ( & cls . netchan ) )
continue ; // wasn't accepted for some reason
2007-02-23 00:21:33 +00:00
2013-07-26 17:19:06 +00:00
CL_WriteDemoMessage ( & net_message , msg_readcount ) ;
2013-06-23 02:17:02 +00:00
2007-07-23 12:03:33 +00:00
if ( cls . netchan . incoming_sequence > cls . netchan . outgoing_sequence )
{ //server should not be responding to packets we have not sent yet
2011-12-23 03:12:29 +00:00
Con_DPrintf ( " Server is from the future! (%i packets) \n " , cls . netchan . incoming_sequence - cls . netchan . outgoing_sequence ) ;
2007-07-23 12:03:33 +00:00
cls . netchan . outgoing_sequence = cls . netchan . incoming_sequence ;
2007-02-23 00:21:33 +00:00
}
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
MSG_ChangePrimitives ( cls . netchan . netprim ) ;
2011-09-03 03:49:43 +00:00
CLQW_ParseServerMessage ( ) ;
2005-05-26 12:55:34 +00:00
break ;
2007-08-07 19:16:32 +00:00
case CP_UNKNOWN :
break ;
2005-05-26 12:55:34 +00:00
}
2004-08-23 00:15:46 +00:00
// if (cls.demoplayback && cls.state >= ca_active && !CL_DemoBehind())
// return;
}
//
// check timeout
//
if ( cls . state > = ca_connected
2012-02-14 15:50:34 +00:00
& & realtime - cls . netchan . last_received > cl_timeout . value & & ! cls . demoplayback )
2004-08-23 00:15:46 +00:00
{
2011-05-20 04:10:46 +00:00
# ifndef CLIENTONLY
/*don't timeout when we're the actual server*/
if ( ! sv . state )
# endif
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " \n Server connection timed out. \n " ) ;
2018-12-06 04:55:35 +00:00
CL_Disconnect ( " Connection Timed Out " ) ;
2011-05-20 04:10:46 +00:00
return ;
}
2004-08-23 00:15:46 +00:00
}
2005-06-15 04:45:26 +00:00
2008-01-09 00:52:31 +00:00
if ( cls . demoplayback = = DPB_MVD | | cls . demoplayback = = DPB_EZTV )
2012-01-24 04:24:14 +00:00
{
CL_MVDUpdateSpectator ( ) ;
}
2004-08-23 00:15:46 +00:00
}
//=============================================================================
2018-09-23 19:35:24 +00:00
qboolean CL_AllowArbitaryDownload ( const char * oldname , const char * localfile )
2013-03-12 23:24:15 +00:00
{
2013-05-11 05:03:07 +00:00
int allow ;
2013-03-12 23:24:15 +00:00
//never allow certain (native code) arbitary downloads.
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 ( ! Q_strncasecmp ( localfile , " game " , 4 ) | | //q2-ey things
! Q_strcasecmp ( localfile , " progs.dat " ) | | ! Q_strcasecmp ( localfile , " menu.dat " ) | | ! Q_strcasecmp ( localfile , " csprogs.dat " ) | | ! Q_strcasecmp ( localfile , " qwprogs.dat " ) | | //overriding gamecode is bad (csqc should be dlcached)
strstr ( localfile , " \\ " ) | | strstr ( localfile , " .. " ) | | strstr ( localfile , " ./ " ) | | strstr ( localfile , " : " ) | | strstr ( localfile , " // " ) | | //certain path patterns are just bad
2017-04-18 11:12:17 +00:00
Q_strcasestr ( localfile , " .qvm " ) | | Q_strcasestr ( localfile , " .dll " ) | | Q_strcasestr ( localfile , " .so " ) | | Q_strcasestr ( localfile , " .dylib " ) ) //disallow any native code
2013-03-12 23:24:15 +00:00
{ //yes, I know the user can use a different progs from the one that is specified. If you leave it blank there will be no problem. (server isn't allowed to stuff progs cvar)
Con_Printf ( " Ignoring arbitary download to \" %s \" due to possible security risk \n " , localfile ) ;
return false ;
}
allow = cl_download_redirection . ival ;
if ( allow = = 2 )
{
2014-10-05 20:04:11 +00:00
char ext [ 8 ] ;
COM_FileExtension ( localfile , ext , sizeof ( ext ) ) ;
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 ( ! strncmp ( localfile , " demos/ " , 6 ) & & ( ! Q_strcasecmp ( ext , " mvd " ) | | ! Q_strcasecmp ( ext , " gz " ) ) )
return true ; //mvdsv popularised the server sending 'download demo/foobar.mvd' in response to 'download demonum/5' aka 'cmd dl #'
else if ( ! strncmp ( localfile , " package/ " , 8 ) & & ( ! Q_strcasecmp ( ext , " pak " ) | | ! Q_strcasecmp ( ext , " pk3 " ) | | ! Q_strcasecmp ( ext , " pk4 " ) ) )
return true ; //packages, woo.
//fixme: we should probably try using package/$gamedir/foo.pak if we get redirected to that.
2013-03-12 23:24:15 +00:00
else
2013-03-31 04:21:08 +00:00
{
Con_Printf ( " Ignoring non-package download redirection to \" %s \" \n " , localfile ) ;
return false ;
}
2013-03-12 23:24:15 +00:00
}
2013-03-31 04:21:08 +00:00
if ( allow )
return true ;
Con_Printf ( " Ignoring download redirection to \" %s \" . This server may require you to set cl_download_redirection to 2. \n " , localfile ) ;
return false ;
2013-03-12 23:24:15 +00:00
}
2019-04-16 22:40:05 +00:00
# if defined(NQPROT) && defined(HAVE_LEGACY)
2018-09-23 19:35:24 +00:00
//this is for DP compat.
static void CL_Curl_f ( void )
{
//curl --args url
int i , argc = Cmd_Argc ( ) ;
const char * arg , * gamedir , * localterse /*no dlcache*/ = NULL ;
char localname [ MAX_QPATH ] ;
int usage = 0 ;
qboolean alreadyhave = false ;
extern char cl_dp_packagenames [ 4096 ] ;
unsigned int dlflags = DLLF_VERBOSE ;
if ( argc < 2 )
{
Con_Printf ( " %s: No args \n " , Cmd_Argv ( 0 ) ) ;
return ;
}
// Con_Printf("%s %s\n", Cmd_Argv(0), Cmd_Args());
for ( i = 1 ; i < argc ; i + + )
{
arg = Cmd_Argv ( i ) ;
if ( ! strcmp ( arg , " --info " ) )
{
Con_Printf ( " %s %s: not implemented \n " , Cmd_Argv ( 0 ) , arg ) ;
return ;
}
else if ( ! strcmp ( arg , " --cancel " ) )
{
Con_Printf ( " %s %s: not implemented \n " , Cmd_Argv ( 0 ) , arg ) ;
return ;
}
else if ( ! strcmp ( arg , " --pak " ) )
usage | = 1 ;
else if ( ! strcmp ( arg , " --cachepic " ) )
usage | = 2 ;
else if ( ! strcmp ( arg , " --skinframe " ) )
usage | = 4 ;
else if ( ! strcmp ( arg , " --for " ) )
{
alreadyhave = true ; //assume we have it.
for ( i + + ; i < argc - 1 ; i + + )
{
arg = Cmd_Argv ( i ) ;
if ( ! CL_CheckDLFile ( arg ) )
{
alreadyhave = false ;
break ;
}
}
}
else if ( ! strcmp ( arg , " --forthismap " ) )
{
//'don't reconnect on failure'
//though I'm guessing its better expressed as just flagging it as mandatory.
dlflags | = DLLF_REQUIRED ;
}
else if ( ! strcmp ( arg , " --as " ) )
{
//explicit local filename
localterse = Cmd_Argv ( + + i ) ;
}
else if ( ! strcmp ( arg , " --clear_autodownload " ) )
{
* cl_dp_packagenames = 0 ;
return ;
}
else if ( ! strcmp ( arg , " --finish_autodownload " ) )
{
//not really sure why this is needed
// Con_Printf("%s %s: not implemented\n", Cmd_Argv(0), arg);
return ;
}
else if ( ! strcmp ( arg , " --maxspeed= " ) )
;
else if ( * arg = = ' - ' )
Con_Printf ( " %s: Unknown option %s \n " , Cmd_Argv ( 0 ) , arg ) ;
else
; //usually just the last arg, but may also be some parameter for an unknown arg.
}
arg = Cmd_Argv ( argc - 1 ) ;
if ( ! localterse )
{
//for compat, we should look for the last / and truncate on a ?.
Con_Printf ( " %s: skipping download of %s, as the local name was not explicitly given \n " , Cmd_Argv ( 0 ) , arg ) ;
return ;
}
if ( usage = = 1 )
{
dlflags | = DLLF_NONGAME ;
gamedir = FS_GetGamedir ( true ) ;
FS_GenCachedPakName ( va ( " %s/%s " , gamedir , localterse ) , NULL , localname , sizeof ( localname ) ) ;
if ( ! alreadyhave )
if ( ! CL_CheckOrEnqueDownloadFile ( arg , localname , dlflags ) )
Con_Printf ( " Downloading %s to %s \n " , arg , localname ) ;
if ( * cl_dp_packagenames )
Q_strncatz ( cl_dp_packagenames , " " , sizeof ( cl_dp_packagenames ) ) ;
Q_strncatz ( cl_dp_packagenames , va ( " %s/%s " , gamedir , localterse ) , sizeof ( cl_dp_packagenames ) ) ;
}
else
{
Con_Printf ( " %s: %s: non-package downloads are not supported \n " , Cmd_Argv ( 0 ) , arg ) ;
return ;
}
}
# endif
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = = =
CL_Download_f
= = = = = = = = = = = = = = = = = = = = =
*/
void CL_Download_f ( void )
{
2005-01-17 17:40:37 +00:00
// char *p, *q;
2014-12-25 20:10:05 +00:00
char * url = Cmd_Argv ( 1 ) ;
char * localname = Cmd_Argv ( 2 ) ;
2004-08-23 00:15:46 +00:00
# ifdef WEBCLIENT
2014-12-25 20:10:05 +00:00
if ( ! strnicmp ( url , " http:// " , 7 ) | | ! strnicmp ( url , " https:// " , 8 ) | | ! strnicmp ( url , " ftp:// " , 6 ) )
2004-08-23 00:15:46 +00:00
{
2005-04-16 16:21:27 +00:00
if ( Cmd_IsInsecure ( ) )
2004-08-23 00:15:46 +00:00
return ;
2014-12-25 20:10:05 +00:00
if ( ! * localname )
{
localname = strrchr ( url , ' / ' ) ;
if ( localname )
localname + + ;
else
{
Con_TPrintf ( " no local name specified \n " ) ;
return ;
}
}
HTTP_CL_Get ( url , localname , NULL ) ; //"test.txt");
2004-08-23 00:15:46 +00:00
return ;
}
# endif
if ( ! strnicmp ( url , " qw:// " , 5 ) | | ! strnicmp ( url , " q2:// " , 5 ) )
{
url + = 5 ;
2019-07-29 05:28:20 +00:00
if ( * url = = ' / ' ) //a conforming url should always have a host section, an empty one is simply three slashes.
url + + ;
2004-08-23 00:15:46 +00:00
}
2014-12-25 20:10:05 +00:00
if ( ! * localname )
localname = url ;
2008-01-30 02:32:00 +00:00
if ( ( cls . state = = ca_disconnected | | cls . demoplayback ) & & cls . demoplayback ! = DPB_EZTV )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Must be connected. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( cls . netchan . remote_address . type = = NA_LOOPBACK )
{
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Must be connected. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-12-25 20:10:05 +00:00
if ( Cmd_Argc ( ) ! = 2 & & Cmd_Argc ( ) ! = 3 )
2004-08-23 00:15:46 +00:00
{
2014-12-25 20:10:05 +00:00
Con_TPrintf ( " Usage: download <datafile> <localname> \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2005-04-16 16:21:27 +00:00
if ( Cmd_IsInsecure ( ) ) //mark server specified downloads.
2004-08-23 00:15:46 +00:00
{
2016-01-18 05:22:07 +00:00
if ( cls . download & & cls . download - > method = = DL_QWPENDING )
DL_Abort ( cls . download , QDL_FAILED ) ;
2014-06-12 23:08:42 +00:00
//don't let gamecode order us to download random junk
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 ( ! CL_AllowArbitaryDownload ( NULL , localname ) )
2004-08-23 00:15:46 +00:00
return ;
2014-12-25 20:10:05 +00:00
CL_CheckOrEnqueDownloadFile ( url , localname , DLLF_REQUIRED | DLLF_VERBOSE ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-12-25 20:10:05 +00:00
CL_EnqueDownload ( url , localname , DLLF_USEREXPLICIT | DLLF_IGNOREFAILED | DLLF_REQUIRED | DLLF_OVERWRITE | DLLF_VERBOSE ) ;
2008-11-09 22:29:28 +00:00
}
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
void CL_DownloadSize_f ( void )
{
downloadlist_t * dl ;
2009-05-24 10:11:17 +00:00
char * rname ;
2008-11-09 22:29:28 +00:00
char * size ;
char * redirection ;
//if this is a demo.. urm?
//ignore it. This saves any spam.
if ( cls . demoplayback )
return ;
2004-08-23 00:15:46 +00:00
2009-05-24 10:11:17 +00:00
rname = Cmd_Argv ( 1 ) ;
2008-11-09 22:29:28 +00:00
size = Cmd_Argv ( 2 ) ;
if ( ! strcmp ( size , " e " ) )
2004-08-23 00:15:46 +00:00
{
2009-05-24 10:11:17 +00:00
Con_Printf ( " Download of \" %s \" failed. Not found. \n " , rname ) ;
2019-07-29 05:28:20 +00:00
CL_DownloadFailed ( rname , NULL , DLFAIL_SERVERFILE ) ;
2004-08-23 00:15:46 +00:00
}
2008-11-09 22:29:28 +00:00
else if ( ! strcmp ( size , " p " ) )
{
2014-06-12 23:08:42 +00:00
if ( cls . download & & stricmp ( cls . download - > remotename , rname ) )
2010-11-02 23:17:25 +00:00
{
Con_Printf ( " Download of \" %s \" failed. Not allowed. \n " , rname ) ;
2019-07-29 05:28:20 +00:00
CL_DownloadFailed ( rname , NULL , DLFAIL_SERVERCVAR ) ;
2010-11-02 23:17:25 +00:00
}
2008-11-09 22:29:28 +00:00
}
else if ( ! strcmp ( size , " r " ) )
2013-03-12 22:44:00 +00:00
{ //'download this file instead'
2008-11-09 22:29:28 +00:00
redirection = Cmd_Argv ( 3 ) ;
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 ( ! CL_AllowArbitaryDownload ( rname , redirection ) )
2013-03-12 23:24:15 +00:00
return ;
2019-07-29 05:28:20 +00:00
dl = CL_DownloadFailed ( rname , NULL , DLFAIL_REDIRECTED ) ;
2013-03-12 23:24:15 +00:00
Con_DPrintf ( " Download of \" %s \" redirected to \" %s \" . \n " , rname , redirection ) ;
CL_CheckOrEnqueDownloadFile ( redirection , NULL , dl - > flags ) ;
2008-11-09 22:29:28 +00:00
}
else
{
for ( dl = cl . downloadlist ; dl ; dl = dl - > next )
{
2009-05-24 10:11:17 +00:00
if ( ! strcmp ( dl - > rname , rname ) )
2008-11-09 22:29:28 +00:00
{
dl - > size = strtoul ( size , NULL , 0 ) ;
2010-11-02 23:17:25 +00:00
dl - > flags & = ~ DLLF_SIZEUNKNOWN ;
2008-11-09 22:29:28 +00:00
return ;
}
}
}
2004-08-23 00:15:46 +00:00
}
2006-08-02 21:48:07 +00:00
void CL_FinishDownload ( char * filename , char * tempname ) ;
2017-01-13 00:39:50 +00:00
static void CL_ForceStopDownload ( qboolean finish )
2006-08-02 21:48:07 +00:00
{
2017-01-13 00:39:50 +00:00
qdownload_t * dl = cls . download ;
2006-08-02 21:48:07 +00:00
if ( Cmd_IsInsecure ( ) )
{
2007-09-23 15:28:06 +00:00
Con_Printf ( CON_WARNING " Execution from server rejected for %s \n " , Cmd_Argv ( 0 ) ) ;
2006-08-02 21:48:07 +00:00
return ;
}
2014-06-12 23:08:42 +00:00
if ( ! dl )
return ;
2006-08-02 21:48:07 +00:00
2014-06-12 23:08:42 +00:00
if ( ! dl - > file )
2006-08-02 21:48:07 +00:00
{
2016-01-18 05:22:07 +00:00
if ( dl - > method = = DL_QWPENDING )
finish = false ;
else
{
Con_Printf ( " No files downloading by QW protocol \n " ) ;
return ;
}
2006-08-02 21:48:07 +00:00
}
if ( finish )
2014-06-12 23:08:42 +00:00
DL_Abort ( dl , QDL_COMPLETED ) ;
2006-08-02 21:48:07 +00:00
else
2014-06-12 23:08:42 +00:00
DL_Abort ( dl , QDL_FAILED ) ;
2006-08-02 21:48:07 +00:00
// get another file if needed
CL_RequestNextDownload ( ) ;
}
void CL_SkipDownload_f ( void )
{
2017-01-13 00:39:50 +00:00
CL_ForceStopDownload ( false ) ;
2006-08-02 21:48:07 +00:00
}
void CL_FinishDownload_f ( void )
{
2017-01-13 00:39:50 +00:00
CL_ForceStopDownload ( true ) ;
2006-08-02 21:48:07 +00:00
}
2017-03-26 17:23:53 +00:00
# if defined(_WIN32) && !defined(WINRT) && !defined(_XBOX)
2014-03-30 08:55:06 +00:00
# include "winquake.h"
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = =
CL_Minimize_f
= = = = = = = = = = = = = = = = =
*/
2004-12-09 23:31:48 +00:00
void CL_Windows_f ( void )
{
if ( ! mainwindow )
{
Con_Printf ( " Cannot comply \n " ) ;
return ;
}
2004-08-23 00:15:46 +00:00
// if (modestate == MS_WINDOWED)
// ShowWindow(mainwindow, SW_MINIMIZE);
// else
SendMessage ( mainwindow , WM_SYSKEYUP , VK_TAB , 1 | ( 0x0F < < 16 ) | ( 1 < < 29 ) ) ;
}
# endif
# ifndef CLIENTONLY
void CL_ServerInfo_f ( void )
{
2012-11-29 13:37:48 +00:00
if ( ! sv . state & & cls . state & & Cmd_Argc ( ) < 2 )
2006-02-11 02:09:43 +00:00
{
2018-07-05 16:21:44 +00:00
if ( cl . haveserverinfo )
2019-07-16 02:59:12 +00:00
{
2018-07-05 16:21:44 +00:00
InfoBuf_Print ( & cl . serverinfo , " " ) ;
2019-07-16 02:59:12 +00:00
Con_Printf ( " [%u, %s] \n " , ( unsigned int ) cl . serverinfo . totalsize , cls . servername ) ;
}
2006-02-11 02:09:43 +00:00
else
Cmd_ForwardToServer ( ) ;
}
2004-08-23 00:15:46 +00:00
else
{
SV_Serverinfo_f ( ) ; //allow it to be set... (whoops)
}
}
# endif
2017-05-28 15:42:32 +00:00
# ifdef FTPCLIENT
2004-08-23 00:15:46 +00:00
void CL_FTP_f ( void )
2005-06-15 04:45:26 +00:00
{
FTP_Client_Command ( Cmd_Args ( ) , NULL ) ;
2004-08-23 00:15:46 +00:00
}
2004-09-24 02:45:41 +00:00
# endif
2004-08-23 00:15:46 +00:00
2014-08-25 07:35:41 +00:00
//fixme: make a cvar
2011-03-31 02:32:32 +00:00
void CL_Fog_f ( void )
{
2019-04-17 19:57:26 +00:00
int ftype ;
if ( ! Q_strcasecmp ( Cmd_Argv ( 0 ) , " waterfog " ) )
ftype = 1 ;
else //fog
ftype = 0 ;
2018-12-28 00:04:36 +00:00
if ( ( cl . fog_locked & & ! Cmd_FromGamecode ( ) & & ! cls . allow_cheats ) | | Cmd_Argc ( ) < = 1 )
2016-07-12 00:40:13 +00:00
{
2019-04-17 19:57:26 +00:00
static const char * fognames [ ] = { " fog " , " waterfog " } ;
2016-07-12 00:40:13 +00:00
if ( Cmd_ExecLevel ! = RESTRICT_INSECURE )
2019-04-17 19:57:26 +00:00
Con_Printf ( " Current %s %f (r:%f g:%f b:%f, a:%f bias:%f) \n " , fognames [ ftype ] , cl . fog [ ftype ] . density , cl . fog [ ftype ] . colour [ 0 ] , cl . fog [ ftype ] . colour [ 1 ] , cl . fog [ ftype ] . colour [ 2 ] , cl . fog [ ftype ] . alpha , cl . fog [ ftype ] . depthbias ) ;
2016-07-12 00:40:13 +00:00
}
2011-03-31 02:32:32 +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
CL_ResetFog ( ftype ) ;
2014-03-30 08:55:06 +00:00
switch ( Cmd_Argc ( ) )
2011-03-31 02:32:32 +00:00
{
2014-03-30 08:55:06 +00:00
case 1 :
break ;
case 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
cl . fog [ ftype ] . density = atof ( Cmd_Argv ( 1 ) ) ;
2014-03-30 08:55:06 +00:00
break ;
case 3 :
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
cl . fog [ ftype ] . density = atof ( Cmd_Argv ( 1 ) ) ;
2018-04-15 02:48:23 +00:00
cl . fog [ ftype ] . colour [ 0 ] = cl . fog [ ftype ] . colour [ 1 ] = cl . fog [ ftype ] . colour [ 2 ] = SRGBf ( atof ( Cmd_Argv ( 2 ) ) ) ;
2014-03-30 08:55:06 +00:00
break ;
case 4 :
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
cl . fog [ ftype ] . density = 0.05 ; //make something up for vauge compat with fitzquake, so it doesn't get the default of 0
2018-04-15 02:48:23 +00:00
cl . fog [ ftype ] . colour [ 0 ] = SRGBf ( atof ( Cmd_Argv ( 1 ) ) ) ;
cl . fog [ ftype ] . colour [ 1 ] = SRGBf ( atof ( Cmd_Argv ( 2 ) ) ) ;
cl . fog [ ftype ] . colour [ 2 ] = SRGBf ( atof ( Cmd_Argv ( 3 ) ) ) ;
2014-03-30 08:55:06 +00:00
break ;
case 5 :
default :
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
cl . fog [ ftype ] . density = atof ( Cmd_Argv ( 1 ) ) ;
2018-04-15 02:48:23 +00:00
cl . fog [ ftype ] . colour [ 0 ] = SRGBf ( atof ( Cmd_Argv ( 2 ) ) ) ;
cl . fog [ ftype ] . colour [ 1 ] = SRGBf ( atof ( Cmd_Argv ( 3 ) ) ) ;
cl . fog [ ftype ] . colour [ 2 ] = SRGBf ( atof ( Cmd_Argv ( 4 ) ) ) ;
2014-03-30 08:55:06 +00:00
break ;
2011-03-31 02:32:32 +00:00
}
2012-12-04 19:37:57 +00:00
2014-03-30 08:55:06 +00:00
if ( cls . state = = ca_active )
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
cl . fog [ ftype ] . time + = 1 ;
2014-03-30 08:55:06 +00:00
//fitz:
2014-08-25 07:35:41 +00:00
//if (Cmd_Argc() >= 6) cl.fog_time += atof(Cmd_Argv(5));
2014-03-30 08:55:06 +00:00
//dp:
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
if ( Cmd_Argc ( ) > = 6 ) cl . fog [ ftype ] . alpha = atof ( Cmd_Argv ( 5 ) ) ;
if ( Cmd_Argc ( ) > = 7 ) cl . fog [ ftype ] . depthbias = atof ( Cmd_Argv ( 6 ) ) ;
2014-08-25 07:35:41 +00:00
//if (Cmd_Argc() >= 8) cl.fog.end = atof(Cmd_Argv(7));
//if (Cmd_Argc() >= 9) cl.fog.height = atof(Cmd_Argv(8));
//if (Cmd_Argc() >= 10) cl.fog.fadedepth = atof(Cmd_Argv(9));
2014-03-30 08:55:06 +00:00
2012-12-04 19:37:57 +00:00
if ( Cmd_FromGamecode ( ) )
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
cl . fog_locked = ! ! cl . fog [ ftype ] . density ;
2011-03-31 02:32:32 +00:00
}
}
2019-04-17 19:57:26 +00:00
# ifdef _DEBUG
void CL_FreeSpace_f ( void )
{
quint64_t freespace ;
const char * freepath = Cmd_Argv ( 1 ) ;
if ( Sys_GetFreeDiskSpace ( freepath , & freespace ) )
{
if ( freespace > 512.0 * 1024 * 1024 * 1024 )
Con_Printf ( " %s: %g tb available \n " , freepath , freespace / ( 1024.0 * 1024 * 1024 * 1024 ) ) ;
else if ( freespace > 512.0 * 1024 * 1024 )
Con_Printf ( " %s: %g gb available \n " , freepath , freespace / ( 1024.0 * 1024 * 1024 ) ) ;
else if ( freespace > 512.0 * 1024 )
Con_Printf ( " %s: %g mb available \n " , freepath , freespace / ( 1024.0 * 1024 ) ) ;
else if ( freespace > 512.0 )
Con_Printf ( " %s: %g kb available \n " , freepath , freespace / 1024.0 ) ;
else
Con_Printf ( " %s: % " PRIu64 " bytes available \n " , freepath , freespace ) ;
}
else
Con_Printf ( " %s: disk free not queryable \n " , freepath ) ;
}
# endif
2013-08-21 07:41:33 +00:00
void CL_CrashMeEndgame_f ( void )
{
2019-04-15 18:43:42 +00:00
Host_EndGame ( " crashme! %s " , Cmd_Args ( ) ) ;
}
void CL_CrashMeError_f ( void )
{
Sys_Error ( " crashme! %s " , Cmd_Args ( ) ) ;
2013-08-21 07:41:33 +00:00
}
2014-07-02 03:20:40 +00:00
void CL_Status_f ( void )
{
2017-05-23 07:03:07 +00:00
char adr [ 128 ] ;
2014-07-02 03:20:40 +00:00
float pi , po , bi , bo ;
NET_PrintAddresses ( cls . sockets ) ;
if ( NET_GetRates ( cls . sockets , & pi , & po , & bi , & bo ) )
Con_Printf ( " packets,bytes/sec: in: %g %g out: %g %g \n " , pi , bi , po , bo ) ; //not relevent as a limit.
2017-05-23 07:03:07 +00:00
if ( cls . state )
{
Con_Printf ( " Server address: %s \n " , NET_AdrToString ( adr , sizeof ( adr ) , & cls . netchan . remote_address ) ) ; //not relevent as a limit.
switch ( cls . protocol )
{
2017-05-28 15:42:32 +00:00
default :
2017-05-23 07:03:07 +00:00
case CP_UNKNOWN :
Con_Printf ( " Unknown protocol \n " ) ;
break ;
case CP_QUAKEWORLD :
Con_Printf ( " QuakeWorld-based protocol \n " ) ;
break ;
# ifdef NQPROT
case CP_NETQUAKE :
switch ( cls . protocol_nq )
{
case CPNQ_ID :
Con_Printf ( " NetQuake-based protocol \n " ) ;
if ( cls . proquake_angles_hack )
Con_Printf ( " With ProQuake's extended angles \n " ) ;
break ;
2017-07-12 08:15:27 +00:00
case CPNQ_NEHAHRA :
Con_Printf ( " Nehahra protocol \n " ) ;
break ;
2017-05-23 07:03:07 +00:00
case CPNQ_BJP1 :
Con_Printf ( " BJP1 protocol \n " ) ;
break ;
case CPNQ_BJP2 :
Con_Printf ( " BJP2 protocol \n " ) ;
break ;
case CPNQ_BJP3 :
Con_Printf ( " BJP3 protocol \n " ) ;
break ;
case CPNQ_FITZ666 :
Con_Printf ( " FitzQuake-based protocol \n " ) ;
break ;
case CPNQ_DP5 :
Con_Printf ( " DPP5 protocol \n " ) ;
break ;
case CPNQ_DP6 :
Con_Printf ( " DPP6 protocol \n " ) ;
break ;
case CPNQ_DP7 :
Con_Printf ( " DPP7 protocol \n " ) ;
break ;
}
break ;
# endif
# ifdef Q2CLIENT
case CP_QUAKE2 :
Con_Printf ( " Quake2-based protocol \n " ) ;
if ( cls . protocol_q2 & & cls . protocol_q2 < PROTOCOL_VERSION_Q2 )
Con_Printf ( " \t outdated protocol version \n " ) ;
else switch ( cls . protocol_q2 )
{
case PROTOCOL_VERSION_Q2 :
Con_Printf ( " \t Standard Quake2 \n " ) ;
break ;
case PROTOCOL_VERSION_R1Q2 :
Con_Printf ( " \t R1Q2 \n " ) ;
break ;
case PROTOCOL_VERSION_Q2PRO :
Con_Printf ( " \t Q2Pro \n " ) ;
break ;
}
break ;
# endif
# ifdef Q3CLIENT
case CP_QUAKE3 :
Con_Printf ( " Quake3-based protocol \n " ) ;
break ;
# endif
# ifdef PLUGINS
case CP_PLUGIN :
Con_Printf ( " external protocol \n " ) ;
break ;
# endif
}
//just show the more interesting extensions.
if ( cls . fteprotocolextensions & PEXT_FLOATCOORDS )
Con_Printf ( " \t extended coords \n " ) ;
if ( cls . fteprotocolextensions & PEXT_SPLITSCREEN )
Con_Printf ( " \t split screen \n " ) ;
if ( cls . fteprotocolextensions & PEXT_CSQC )
Con_Printf ( " \t csqc info \n " ) ;
if ( cls . fteprotocolextensions2 & PEXT2_VOICECHAT )
Con_Printf ( " \t voice chat \n " ) ;
if ( cls . fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
Con_Printf ( " \t replacement deltas \n " ) ;
}
2014-07-02 03:20:40 +00:00
}
2015-06-16 23:53:58 +00:00
void CL_Demo_SetSpeed_f ( void )
{
char * s = Cmd_Argv ( 1 ) ;
if ( s )
{
float f = atof ( s ) / 100 ;
Cvar_SetValue ( & cl_demospeed , f ) ;
}
else
Con_Printf ( " demo playback speed %g%% \n " , cl_demospeed . value * 100 ) ;
}
2018-07-05 16:21:44 +00:00
static void CL_UserinfoChanged ( void * ctx , const char * keyname )
{
InfoSync_Add ( & cls . userinfosync , ctx , keyname ) ;
}
2009-07-19 20:43:07 +00:00
void CL_Skygroup_f ( void ) ;
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = =
CL_Init
= = = = = = = = = = = = = = = = =
*/
void CL_Init ( void )
{
extern void CL_Say_f ( void ) ;
2004-11-17 17:56:27 +00:00
extern void CL_SayMe_f ( void ) ;
2004-11-13 17:27:34 +00:00
extern void CL_SayTeam_f ( void ) ;
2018-03-04 14:41:16 +00:00
# ifdef QWSKINS
2004-08-23 00:15:46 +00:00
extern cvar_t baseskin ;
extern cvar_t noskins ;
2018-03-04 14:41:16 +00:00
# endif
2013-03-12 22:44:00 +00:00
char * ver ;
2018-07-05 16:21:44 +00:00
size_t seat ;
2004-08-23 00:15:46 +00:00
cls . state = ca_disconnected ;
2013-03-12 22:44:00 +00:00
# ifdef SVNREVISION
2013-03-12 22:47:42 +00:00
if ( strcmp ( STRINGIFY ( SVNREVISION ) , " - " ) )
ver = va ( " %s v%i.%02i %s " , DISTRIBUTION , FTE_VER_MAJOR , FTE_VER_MINOR , STRINGIFY ( SVNREVISION ) ) ;
2013-03-12 22:44:00 +00:00
else
# endif
ver = va ( " %s v%i.%02i " , DISTRIBUTION , FTE_VER_MAJOR , FTE_VER_MINOR ) ;
2018-07-05 16:21:44 +00:00
for ( seat = 0 ; seat < MAX_SPLITS ; seat + + )
{
cls . userinfo [ seat ] . ChangeCTX = & cls . userinfo [ seat ] ;
cls . userinfo [ seat ] . ChangeCB = CL_UserinfoChanged ;
InfoBuf_SetStarKey ( & cls . userinfo [ seat ] , " *ver " , ver ) ;
}
2004-08-23 00:15:46 +00:00
InitValidation ( ) ;
CL_InitInput ( ) ;
CL_InitTEnts ( ) ;
CL_InitPrediction ( ) ;
CL_InitCam ( ) ;
2009-11-04 21:16:50 +00:00
CL_InitDlights ( ) ;
2004-08-23 00:15:46 +00:00
PM_Init ( ) ;
TP_Init ( ) ;
2005-06-15 04:45:26 +00:00
2004-08-23 00:15:46 +00:00
//
// register our commands
//
2005-01-23 17:49:42 +00:00
CLSCR_Init ( ) ;
2005-08-16 18:35:43 +00:00
# ifdef MENU_DAT
MP_RegisterCvarsAndCmds ( ) ;
# endif
2005-03-20 02:57:11 +00:00
# ifdef CSQC_DAT
CSQC_RegisterCvarsAndThings ( ) ;
# endif
2004-08-23 00:15:46 +00:00
Cvar_Register ( & host_speeds , cl_controlgroup ) ;
2004-09-22 15:25:58 +00:00
Cvar_Register ( & cfg_save_name , cl_controlgroup ) ;
2018-12-06 04:55:35 +00:00
Cvar_Register ( & cl_disconnectreason , cl_controlgroup ) ;
2015-07-07 02:03:31 +00:00
Cvar_Register ( & cl_proxyaddr , cl_controlgroup ) ;
2014-05-10 13:42:13 +00:00
Cvar_Register ( & cl_sendguid , cl_controlgroup ) ;
2011-06-16 02:03:57 +00:00
Cvar_Register ( & cl_defaultport , cl_controlgroup ) ;
2007-02-23 00:21:33 +00:00
Cvar_Register ( & cl_servername , cl_controlgroup ) ;
2009-01-14 16:07:07 +00:00
Cvar_Register ( & cl_serveraddress , cl_controlgroup ) ;
2004-12-24 08:45:56 +00:00
Cvar_Register ( & cl_demospeed , " Demo playback " ) ;
2015-06-16 23:53:58 +00:00
Cmd_AddCommand ( " demo_setspeed " , CL_Demo_SetSpeed_f ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & cl_upspeed , cl_inputgroup ) ;
Cvar_Register ( & cl_forwardspeed , cl_inputgroup ) ;
Cvar_Register ( & cl_backspeed , cl_inputgroup ) ;
Cvar_Register ( & cl_sidespeed , cl_inputgroup ) ;
Cvar_Register ( & cl_movespeedkey , cl_inputgroup ) ;
Cvar_Register ( & cl_yawspeed , cl_inputgroup ) ;
Cvar_Register ( & cl_pitchspeed , cl_inputgroup ) ;
Cvar_Register ( & cl_anglespeedkey , cl_inputgroup ) ;
Cvar_Register ( & cl_shownet , cl_screengroup ) ;
Cvar_Register ( & cl_sbar , cl_screengroup ) ;
2013-03-12 22:44:00 +00:00
Cvar_Register ( & cl_pure , cl_screengroup ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & cl_hudswap , cl_screengroup ) ;
Cvar_Register ( & cl_maxfps , cl_screengroup ) ;
2011-07-06 01:01:13 +00:00
Cvar_Register ( & cl_idlefps , cl_screengroup ) ;
2011-07-13 05:48:09 +00:00
Cvar_Register ( & cl_yieldcpu , cl_screengroup ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & cl_timeout , cl_controlgroup ) ;
Cvar_Register ( & lookspring , cl_inputgroup ) ;
Cvar_Register ( & lookstrafe , cl_inputgroup ) ;
Cvar_Register ( & sensitivity , cl_inputgroup ) ;
Cvar_Register ( & m_pitch , cl_inputgroup ) ;
Cvar_Register ( & m_yaw , cl_inputgroup ) ;
Cvar_Register ( & m_forward , cl_inputgroup ) ;
Cvar_Register ( & m_side , cl_inputgroup ) ;
2018-08-21 18:52:25 +00:00
Cvar_Register ( & cl_crypt_rcon , cl_controlgroup ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & rcon_password , cl_controlgroup ) ;
Cvar_Register ( & rcon_address , cl_controlgroup ) ;
2019-01-20 01:00:18 +00:00
Cvar_Register ( & cl_lerp_maxinterval , cl_controlgroup ) ;
2011-12-05 15:23:40 +00:00
Cvar_Register ( & cl_lerp_players , cl_controlgroup ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & cl_predict_players , cl_predictiongroup ) ;
2012-04-24 07:59:11 +00:00
Cvar_Register ( & cl_predict_players_frac , cl_predictiongroup ) ;
2015-06-28 03:43:10 +00:00
Cvar_Register ( & cl_predict_players_latency , cl_predictiongroup ) ;
Cvar_Register ( & cl_predict_players_nudge , cl_predictiongroup ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & cl_solid_players , cl_predictiongroup ) ;
2014-06-02 16:50:40 +00:00
# ifdef QUAKESPYAPI
2004-08-23 00:15:46 +00:00
Cvar_Register ( & localid , cl_controlgroup ) ;
2014-06-02 16:50:40 +00:00
# endif
2004-08-23 00:15:46 +00:00
2005-01-13 16:29:20 +00:00
Cvar_Register ( & cl_muzzleflash , cl_controlgroup ) ;
2018-03-04 14:41:16 +00:00
# ifdef QWSKINS
2004-08-23 00:15:46 +00:00
Cvar_Register ( & baseskin , " Teamplay " ) ;
Cvar_Register ( & noskins , " Teamplay " ) ;
2018-03-04 14:41:16 +00:00
# endif
2005-10-30 23:54:29 +00:00
Cvar_Register ( & cl_noblink , " Console controls " ) ; //for lack of a better group
2004-08-23 00:15:46 +00:00
Cvar_Register ( & cl_item_bobbing , " Item effects " ) ;
2015-08-10 18:28:23 +00:00
Cvar_Register ( & gl_simpleitems , " Item effects " ) ;
2004-08-23 00:15:46 +00:00
2005-01-13 16:29:20 +00:00
Cvar_Register ( & cl_staticsounds , " Item effects " ) ;
2009-11-04 21:16:50 +00:00
Cvar_Register ( & r_torch , " Item effects " ) ;
2005-01-17 17:40:37 +00:00
Cvar_Register ( & r_rocketlight , " Item effects " ) ;
Cvar_Register ( & r_lightflicker , " Item effects " ) ;
Cvar_Register ( & cl_r2g , " Item effects " ) ;
Cvar_Register ( & r_powerupglow , " Item effects " ) ;
2005-04-26 16:04:12 +00:00
Cvar_Register ( & v_powerupshell , " Item effects " ) ;
2005-01-17 17:40:37 +00:00
2005-01-18 20:15:20 +00:00
Cvar_Register ( & cl_gibfilter , " Item effects " ) ;
Cvar_Register ( & cl_deadbodyfilter , " Item effects " ) ;
2005-04-26 16:04:12 +00:00
Cvar_Register ( & cl_nolerp , " Item effects " ) ;
2008-12-03 02:42:05 +00:00
Cvar_Register ( & cl_nolerp_netquake , " Item effects " ) ;
2017-12-28 16:24:50 +00:00
# ifdef NQPROT
Cvar_Register ( & cl_fullpitch_nq , " Cheats " ) ;
# endif
2005-04-26 16:04:12 +00:00
2006-03-05 04:46:10 +00:00
Cvar_Register ( & r_drawflame , " Item effects " ) ;
2014-09-02 02:44:43 +00:00
Cvar_Register ( & cl_downloads , cl_controlgroup ) ;
2011-10-27 15:46:36 +00:00
Cvar_Register ( & cl_download_csprogs , cl_controlgroup ) ;
Cvar_Register ( & cl_download_redirection , cl_controlgroup ) ;
2011-12-05 15:23:40 +00:00
Cvar_Register ( & cl_download_packages , cl_controlgroup ) ;
2005-08-11 04:14:33 +00:00
2004-08-23 00:15:46 +00:00
//
// info mirrors
//
2008-02-01 15:21:14 +00:00
Cvar_Register ( & name , cl_controlgroup ) ;
Cvar_Register ( & password , cl_controlgroup ) ;
Cvar_Register ( & spectator , cl_controlgroup ) ;
Cvar_Register ( & skin , cl_controlgroup ) ;
Cvar_Register ( & model , cl_controlgroup ) ;
Cvar_Register ( & team , cl_controlgroup ) ;
Cvar_Register ( & topcolor , cl_controlgroup ) ;
2011-10-27 15:46:36 +00:00
Cvar_Register ( & bottomcolor , cl_controlgroup ) ;
2008-02-01 15:21:14 +00:00
Cvar_Register ( & rate , cl_controlgroup ) ;
Cvar_Register ( & drate , cl_controlgroup ) ;
Cvar_Register ( & msg , cl_controlgroup ) ;
Cvar_Register ( & noaim , cl_controlgroup ) ;
Cvar_Register ( & b_switch , cl_controlgroup ) ;
Cvar_Register ( & w_switch , cl_controlgroup ) ;
2018-08-21 18:52:25 +00:00
# ifdef HEXEN2
Cvar_Register ( & cl_playerclass , cl_controlgroup ) ;
# endif
2008-02-01 15:21:14 +00:00
2014-08-15 02:20:41 +00:00
Cvar_Register ( & cl_demoreel , cl_controlgroup ) ;
2015-07-07 02:44:27 +00:00
Cvar_Register ( & record_flush , cl_controlgroup ) ;
2014-08-15 02:20:41 +00:00
2008-02-01 15:21:14 +00:00
Cvar_Register ( & cl_nofake , cl_controlgroup ) ;
Cvar_Register ( & cl_chatsound , cl_controlgroup ) ;
Cvar_Register ( & cl_enemychatsound , cl_controlgroup ) ;
Cvar_Register ( & cl_teamchatsound , cl_controlgroup ) ;
Cvar_Register ( & requiredownloads , cl_controlgroup ) ;
Cvar_Register ( & cl_standardchat , cl_controlgroup ) ;
2015-04-14 23:12:17 +00:00
Cvar_Register ( & msg_filter , cl_controlgroup ) ;
Cvar_Register ( & msg_filter_frags , cl_controlgroup ) ;
2008-02-01 15:21:14 +00:00
Cvar_Register ( & cl_standardmsg , cl_controlgroup ) ;
Cvar_Register ( & cl_parsewhitetext , cl_controlgroup ) ;
2015-04-14 23:12:17 +00:00
Cvar_Register ( & cl_nopext , cl_controlgroup ) ;
2008-11-28 20:34:51 +00:00
Cvar_Register ( & cl_pext_mask , cl_controlgroup ) ;
2008-02-01 15:21:14 +00:00
Cvar_Register ( & cl_splitscreen , cl_controlgroup ) ;
Cvar_Register ( & host_mapname , " Scripting " ) ;
2009-02-08 04:39:46 +00:00
# ifndef SERVERONLY
Cvar_Register ( & cl_loopbackprotocol , cl_controlgroup ) ;
# endif
2008-02-01 15:21:14 +00:00
Cvar_Register ( & cl_countpendingpl , cl_controlgroup ) ;
2011-06-18 05:41:10 +00:00
Cvar_Register ( & cl_threadedphysics , cl_controlgroup ) ;
2015-04-21 04:12:00 +00:00
hud_tracking_show = Cvar_Get ( " hud_tracking_show " , " 1 " , 0 , " statusbar " ) ;
2015-11-18 07:37:39 +00:00
hud_miniscores_show = Cvar_Get ( " hud_miniscores_show " , " 1 " , 0 , " statusbar " ) ;
2010-03-25 22:56:11 +00:00
Cvar_Register ( & cl_download_mapsrc , cl_controlgroup ) ;
2007-09-21 11:15:12 +00:00
Cvar_Register ( & cl_dlemptyterminate , cl_controlgroup ) ;
2008-02-01 15:21:14 +00:00
Cvar_Register ( & cl_gunx , cl_controlgroup ) ;
Cvar_Register ( & cl_guny , cl_controlgroup ) ;
Cvar_Register ( & cl_gunz , cl_controlgroup ) ;
2007-09-21 11:15:12 +00:00
2008-02-01 15:21:14 +00:00
Cvar_Register ( & cl_gunanglex , cl_controlgroup ) ;
Cvar_Register ( & cl_gunangley , cl_controlgroup ) ;
Cvar_Register ( & cl_gunanglez , cl_controlgroup ) ;
2007-09-21 11:15:12 +00:00
Cvar_Register ( & ruleset_allow_playercount , cl_controlgroup ) ;
2008-02-01 15:21:14 +00:00
Cvar_Register ( & ruleset_allow_frj , cl_controlgroup ) ;
2007-09-21 11:15:12 +00:00
Cvar_Register ( & ruleset_allow_semicheats , cl_controlgroup ) ;
Cvar_Register ( & ruleset_allow_packet , cl_controlgroup ) ;
2008-02-01 15:21:14 +00:00
Cvar_Register ( & ruleset_allow_particle_lightning , cl_controlgroup ) ;
Cvar_Register ( & ruleset_allow_overlongsounds , cl_controlgroup ) ;
Cvar_Register ( & ruleset_allow_larger_models , cl_controlgroup ) ;
Cvar_Register ( & ruleset_allow_modified_eyes , cl_controlgroup ) ;
2014-03-30 08:55:06 +00:00
Cvar_Register ( & ruleset_allow_sensitive_texture_replacements , cl_controlgroup ) ;
2008-06-08 14:37:57 +00:00
Cvar_Register ( & ruleset_allow_localvolume , cl_controlgroup ) ;
2009-11-04 21:16:50 +00:00
Cvar_Register ( & ruleset_allow_shaders , cl_controlgroup ) ;
2016-07-12 00:40:13 +00:00
Cvar_Register ( & ruleset_allow_watervis , cl_controlgroup ) ;
2012-01-24 04:24:14 +00:00
Cvar_Register ( & ruleset_allow_fbmodels , cl_controlgroup ) ;
2008-02-01 15:21:14 +00:00
Cvar_Register ( & qtvcl_forceversion1 , cl_controlgroup ) ;
Cvar_Register ( & qtvcl_eztvextensions , cl_controlgroup ) ;
2017-05-28 15:42:32 +00:00
# ifdef FTPCLIENT
Cmd_AddCommand ( " ftp " , CL_FTP_f ) ;
# endif
2004-08-23 00:15:46 +00:00
2014-03-30 08:55:06 +00:00
Cmd_AddCommandD ( " changing " , CL_Changing_f , " Part of network protocols. This command should not be used manually. " ) ;
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " disconnect " , CL_Disconnect_f ) ;
2017-07-04 05:07:51 +00:00
Cmd_AddCommandAD ( " record " , CL_Record_f , CL_DemoList_c , NULL ) ;
Cmd_AddCommandAD ( " rerecord " , CL_ReRecord_f , CL_DemoList_c , " Reconnects to the previous/current server, but starts recording a clean demo. " ) ;
Cmd_AddCommandD ( " stop " , CL_Stop_f , " Stop demo recording. " ) ;
Cmd_AddCommandAD ( " playdemo " , CL_PlayDemo_f , CL_DemoList_c , NULL ) ;
2006-09-17 00:59:22 +00:00
Cmd_AddCommand ( " qtvplay " , CL_QTVPlay_f ) ;
Cmd_AddCommand ( " qtvlist " , CL_QTVList_f ) ;
2007-05-25 22:16:29 +00:00
Cmd_AddCommand ( " qtvdemos " , CL_QTVDemos_f ) ;
2014-12-02 02:00:41 +00:00
Cmd_AddCommandD ( " demo_jump " , CL_DemoJump_f , " Jump to a specified time in a demo. Prefix with a + or - for a relative offset. Seeking backwards will restart the demo and the fast forward, which can take some time in long demos. " ) ;
2018-05-06 16:09:07 +00:00
Cmd_AddCommandD ( " demo_nudge " , CL_DemoNudge_f , " Nudge the demo by one frame. Argument should be +1 or -1. Nudging backwards is limited. " ) ;
2017-07-04 05:07:51 +00:00
Cmd_AddCommandAD ( " timedemo " , CL_TimeDemo_f , CL_DemoList_c , NULL ) ;
2019-04-17 19:57:26 +00:00
# ifdef _DEBUG
Cmd_AddCommand ( " freespace " , CL_FreeSpace_f ) ;
# endif
2013-08-21 07:41:33 +00:00
Cmd_AddCommand ( " crashme_endgame " , CL_CrashMeEndgame_f ) ;
2019-04-15 18:43:42 +00:00
Cmd_AddCommand ( " crashme_error " , CL_CrashMeError_f ) ;
2004-08-23 00:15:46 +00:00
2015-06-14 09:34:55 +00:00
Cmd_AddCommandD ( " showpic " , SCR_ShowPic_Script_f , " showpic <imagename> <placename> <x> <y> <zone> [width] [height] [touchcommand] \n Displays an image onscreen, that potentially has a key binding attached to it when clicked/touched. \n zone should be one of: TL, TR, BL, BR, MM, TM, BM, ML, MR. This serves as an extra offset to move the image around the screen without any foreknowledge of the screen resolution. " ) ;
Cmd_AddCommandD ( " showpic_removeall " , SCR_ShowPic_Remove_f , " removes any pictures inserted with the showpic command. " ) ;
2005-01-13 16:29:20 +00:00
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " startdemos " , CL_Startdemos_f ) ;
Cmd_AddCommand ( " demos " , CL_Demos_f ) ;
Cmd_AddCommand ( " stopdemo " , CL_Stopdemo_f ) ;
Cmd_AddCommand ( " skins " , Skin_Skins_f ) ;
2018-03-04 14:41:16 +00:00
# ifdef QWSKINS
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " allskins " , Skin_AllSkins_f ) ;
2018-03-04 14:41:16 +00:00
# endif
2004-08-23 00:15:46 +00:00
2014-07-02 03:20:40 +00:00
Cmd_AddCommand ( " cl_status " , CL_Status_f ) ;
2014-12-02 02:00:41 +00:00
Cmd_AddCommandD ( " quit " , CL_Quit_f , " Use this command when you get angry. Does not save any cvars. Use cfg_save to save settings, or use the menu for a prompt. " ) ;
2004-08-23 00:15:46 +00:00
2015-07-27 08:21:34 +00:00
# if defined(CL_MASTER)
2018-04-15 02:48:23 +00:00
Cmd_AddCommandAD ( " connectbr " , CL_ConnectBestRoute_f , CL_Connect_c , " connect address:port \n Connect to a qw server using the best route we can detect. " ) ;
2015-07-27 08:21:34 +00:00
# endif
2018-04-15 02:48:23 +00:00
Cmd_AddCommandAD ( " connect " , CL_Connect_f , CL_Connect_c , " connect scheme://address:port \n Connect to a server. "
2015-07-07 02:03:31 +00:00
# if defined(FTE_TARGET_WEB)
2018-04-15 02:48:23 +00:00
" Use a scheme of rtc[s]://broker/gamename to connect via a webrtc broker. "
" Use a scheme of ws[s]://server to connect via websockets. "
# elif defined(TCPCONNECT)
2015-07-07 02:03:31 +00:00
" Use a scheme of tcp:// or tls:// to connect via non-udp protocols. "
2018-04-15 02:48:23 +00:00
// "Use a scheme of ws[s]://server to connect via websockets."
# endif
# ifdef HAVE_DTLS
" Use a scheme of dtls://server to connect securely. "
# endif
# if defined(IRCCONNECT)
" Use irc://network:6667/user[@channel] to connect via an irc server. Not recommended. "
2015-07-07 02:03:31 +00:00
# endif
2014-03-30 08:55:06 +00:00
# if defined(NQPROT) || defined(Q2CLIENT) || defined(Q3CLIENT)
2018-04-07 12:33:06 +00:00
" \n Default port is port " STRINGIFY ( PORT_DEFAULTSERVER ) " . "
# ifndef GAME_DEFAULTPORT
# ifdef NQPROT
" NQ: " STRINGIFY ( PORT_NQSERVER ) " . "
# endif
" QW: " STRINGIFY ( PORT_QWSERVER ) " . "
# ifdef Q2CLIENT
" Q2: " STRINGIFY ( PORT_Q2SERVER ) " . "
# endif
# ifdef Q3CLIENT
" Q3: " STRINGIFY ( PORT_Q3SERVER ) " . "
# endif
# endif
2014-03-30 08:55:06 +00:00
# endif
) ;
Cmd_AddCommandD ( " cl_transfer " , CL_Transfer_f , " Connect to a different server, disconnecting from the current server only when the new server replies. " ) ;
2005-11-30 01:20:53 +00:00
# ifdef TCPCONNECT
2018-04-15 02:48:23 +00:00
Cmd_AddCommandAD ( " tcpconnect " , CL_TCPConnect_f , CL_Connect_c , " Connect to a server using the tcp:// prefix " ) ;
2005-11-30 01:20:53 +00:00
# endif
2008-11-09 22:29:28 +00:00
# ifdef IRCCONNECT
Cmd_AddCommand ( " ircconnect " , CL_IRCConnect_f ) ;
# endif
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
2018-04-15 02:48:23 +00:00
Cmd_AddCommandD ( " nqconnect " , CLNQ_Connect_f , " Connects to the specified server, defaulting to port " STRINGIFY ( PORT_NQSERVER ) " . Otherwise identical to the connect command. " ) ;
2004-08-23 00:15:46 +00:00
# endif
Cmd_AddCommand ( " reconnect " , CL_Reconnect_f ) ;
2018-04-15 02:48:23 +00:00
Cmd_AddCommandAD ( " join " , CL_Join_f , CL_Connect_c , " Switches away from spectator mode, optionally connecting to a different server. " ) ;
Cmd_AddCommandAD ( " observe " , CL_Observe_f , CL_Connect_c , " Switches to spectator mode, optionally connecting to a different server. " ) ;
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " rcon " , CL_Rcon_f ) ;
Cmd_AddCommand ( " packet " , CL_Packet_f ) ;
Cmd_AddCommand ( " user " , CL_User_f ) ;
Cmd_AddCommand ( " users " , CL_Users_f ) ;
2019-01-13 16:51:50 +00:00
# if 1 //def _DEBUG
2018-07-05 16:21:44 +00:00
Cmd_AddCommand ( " setinfoblob " , CL_SetInfoBlob_f ) ;
# endif
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " setinfo " , CL_SetInfo_f ) ;
Cmd_AddCommand ( " fullinfo " , CL_FullInfo_f ) ;
Cmd_AddCommand ( " color " , CL_Color_f ) ;
2019-04-16 22:40:05 +00:00
# if defined(NQPROT) && defined(HAVE_LEGACY)
2018-09-23 19:35:24 +00:00
Cmd_AddCommand ( " curl " , CL_Curl_f ) ;
# endif
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " download " , CL_Download_f ) ;
2018-04-15 02:48:23 +00:00
Cmd_AddCommandD ( " dlsize " , CL_DownloadSize_f , " For internal use " ) ;
Cmd_AddCommandD ( " nextul " , CL_NextUpload , " For internal use " ) ;
Cmd_AddCommandD ( " stopul " , CL_StopUpload , " For internal use " ) ;
2004-08-23 00:15:46 +00:00
2006-08-02 21:48:07 +00:00
Cmd_AddCommand ( " skipdl " , CL_SkipDownload_f ) ;
Cmd_AddCommand ( " finishdl " , CL_FinishDownload_f ) ;
2004-08-23 00:15:46 +00:00
//
// forward to server commands
//
Cmd_AddCommand ( " god " , NULL ) ; //cheats
Cmd_AddCommand ( " give " , NULL ) ;
Cmd_AddCommand ( " noclip " , NULL ) ;
2014-06-21 17:58:17 +00:00
Cmd_AddCommand ( " 6dof " , NULL ) ;
Cmd_AddCommand ( " spiderpig " , NULL ) ;
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " fly " , NULL ) ;
Cmd_AddCommand ( " setpos " , NULL ) ;
2014-06-21 17:58:17 +00:00
Cmd_AddCommand ( " notarget " , NULL ) ;
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " topten " , NULL ) ;
Cmd_AddCommand ( " kill " , NULL ) ;
Cmd_AddCommand ( " pause " , NULL ) ;
Cmd_AddCommand ( " say " , CL_Say_f ) ;
2004-11-17 17:56:27 +00:00
Cmd_AddCommand ( " me " , CL_SayMe_f ) ;
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " sayone " , CL_Say_f ) ;
2004-11-13 17:27:34 +00:00
Cmd_AddCommand ( " say_team " , CL_SayTeam_f ) ;
2004-08-23 00:15:46 +00:00
# ifdef CLIENTONLY
Cmd_AddCommand ( " serverinfo " , NULL ) ;
# else
Cmd_AddCommand ( " serverinfo " , CL_ServerInfo_f ) ;
# endif
2018-04-15 02:48:23 +00:00
Cmd_AddCommandD ( " fog " , CL_Fog_f , " fog <density> <red> <green> <blue> <alpha> <depthbias> " ) ;
Cmd_AddCommandD ( " waterfog " , CL_Fog_f , " waterfog <density> <red> <green> <blue> <alpha> <depthbias> " ) ;
2009-07-19 20:43:07 +00:00
Cmd_AddCommand ( " skygroup " , CL_Skygroup_f ) ;
2004-08-23 00:15:46 +00:00
//
// Windows commands
//
2017-03-26 17:23:53 +00:00
# if defined(_WIN32) && !defined(WINRT) && !defined(_XBOX)
2004-08-23 00:15:46 +00:00
Cmd_AddCommand ( " windows " , CL_Windows_f ) ;
# endif
2005-11-30 01:20:53 +00:00
Ignore_Init ( ) ;
2017-07-10 15:40:42 +00:00
# ifdef QUAKEHUD
2015-06-12 14:44:50 +00:00
Stats_Init ( ) ;
2017-07-10 15:40:42 +00:00
# endif
2018-09-23 19:35:24 +00:00
CL_ClearState ( false ) ; //make sure the cl.* fields are set properly if there's no ssqc or whatever.
2005-06-15 04:45:26 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = =
Host_EndGame
Call this to drop to a console without exiting the qwcl
= = = = = = = = = = = = = = = =
*/
2018-05-21 13:47:53 +00:00
NORETURN void VARGS Host_EndGame ( const char * message , . . . )
2004-08-23 00:15:46 +00:00
{
va_list argptr ;
char string [ 1024 ] ;
va_start ( argptr , message ) ;
2006-03-06 01:41:09 +00:00
vsnprintf ( string , sizeof ( string ) - 1 , message , argptr ) ;
2004-08-23 00:15:46 +00:00
va_end ( argptr ) ;
2014-10-05 20:04:11 +00:00
COM_AssertMainThread ( string ) ;
SCR_EndLoadingPlaque ( ) ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " ^&C0Host_EndGame: %s \n " , string ) ;
2013-11-21 23:02:28 +00:00
Con_Printf ( " \n " ) ;
2004-08-23 00:15:46 +00:00
SCR_EndLoadingPlaque ( ) ;
2005-06-15 04:45:26 +00:00
2018-12-06 04:55:35 +00:00
CL_Disconnect ( string ) ;
2004-08-23 00:15:46 +00:00
2006-01-02 23:01:54 +00:00
SV_UnspawnServer ( ) ;
2014-05-10 13:42:13 +00:00
connectinfo . trying = false ;
2006-01-02 23:01:54 +00:00
2004-08-23 00:15:46 +00:00
Cvar_Set ( & cl_shownet , " 0 " ) ;
longjmp ( host_abort , 1 ) ;
}
/*
= = = = = = = = = = = = = = = =
Host_Error
This shuts down the client and exits qwcl
= = = = = = = = = = = = = = = =
*/
2018-05-21 13:47:53 +00:00
void VARGS Host_Error ( const char * error , . . . )
2004-08-23 00:15:46 +00:00
{
va_list argptr ;
char string [ 1024 ] ;
static qboolean inerror = false ;
2005-06-15 04:45:26 +00:00
2004-08-23 00:15:46 +00:00
if ( inerror )
Sys_Error ( " Host_Error: recursively entered " ) ;
inerror = true ;
2005-06-15 04:45:26 +00:00
2004-08-23 00:15:46 +00:00
va_start ( argptr , error ) ;
2006-03-06 01:41:09 +00:00
vsnprintf ( string , sizeof ( string ) - 1 , error , argptr ) ;
2004-08-23 00:15:46 +00:00
va_end ( argptr ) ;
2015-03-03 00:14:43 +00:00
COM_AssertMainThread ( string ) ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Host_Error: %s \n " , string ) ;
2005-06-15 04:45:26 +00:00
2018-12-06 04:55:35 +00:00
CL_Disconnect ( string ) ;
2004-08-23 00:15:46 +00:00
cls . demonum = - 1 ;
inerror = false ;
// FIXME
Sys_Error ( " Host_Error: %s \n " , string ) ;
}
/*
= = = = = = = = = = = = = = =
Host_WriteConfiguration
Writes key bindings and archived cvars to config . cfg
= = = = = = = = = = = = = = =
*/
void Host_WriteConfiguration ( void )
{
2005-12-21 03:07:33 +00:00
vfsfile_t * f ;
2012-11-27 03:23:19 +00:00
char savename [ MAX_OSPATH ] ;
char sysname [ MAX_OSPATH ] ;
2004-08-23 00:15:46 +00:00
if ( host_initialized & & cfg_save_name . string & & * cfg_save_name . string )
{
if ( strchr ( cfg_save_name . string , ' . ' ) )
{
2016-08-25 00:12:14 +00:00
Con_TPrintf ( CON_ERROR " Couldn't write config.cfg. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2012-11-27 03:23:19 +00:00
Q_snprintfz ( savename , sizeof ( savename ) , " %s.cfg " , cfg_save_name . string ) ;
f = FS_OpenVFS ( savename , " wb " , FS_GAMEONLY ) ;
2004-08-23 00:15:46 +00:00
if ( ! f )
{
2019-06-17 04:21:41 +00:00
FS_NativePath ( savename , FS_GAMEONLY , sysname , sizeof ( sysname ) ) ;
Con_TPrintf ( CON_ERROR " Couldn't write %s. \n " , sysname ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2005-06-15 04:45:26 +00:00
2004-08-23 00:15:46 +00:00
Key_WriteBindings ( f ) ;
Cvar_WriteVariables ( f , false ) ;
2005-12-21 03:07:33 +00:00
VFS_CLOSE ( f ) ;
2012-11-27 03:23:19 +00:00
FS_NativePath ( savename , FS_GAMEONLY , sysname , sizeof ( sysname ) ) ;
Con_Printf ( " Wrote %s \n " , savename ) ;
2004-08-23 00:15:46 +00:00
}
}
//============================================================================
#if 0
/*
= = = = = = = = = = = = = = = = = =
Host_SimulationTime
This determines if enough time has passed to run a simulation frame
= = = = = = = = = = = = = = = = = =
*/
qboolean Host_SimulationTime ( float time )
{
float fps ;
if ( oldrealtime > realtime )
oldrealtime = 0 ;
if ( cl_maxfps . value )
fps = max ( 30.0 , min ( cl_maxfps . value , 72.0 ) ) ;
else
fps = max ( 30.0 , min ( rate . value / 80.0 , 72.0 ) ) ;
if ( ! cls . timedemo & & ( realtime + time ) - oldrealtime < 1.0 / fps )
return false ; // framerate is too high
return true ;
}
# endif
2013-06-23 02:17:02 +00:00
void Host_RunFileNotify ( struct dl_download * dl )
{
if ( dl - > file )
{
Host_RunFile ( dl - > url , strlen ( dl - > url ) , dl - > file ) ;
dl - > file = NULL ;
}
}
# include "fs.h"
2013-08-21 07:14:39 +00:00
# define HRF_OVERWRITE (1<<0)
# define HRF_NOOVERWRITE (1<<1)
2014-08-25 07:35:41 +00:00
// (1<<2)
2013-08-21 07:14:39 +00:00
# define HRF_ABORT (1<<3)
2014-08-25 07:35:41 +00:00
2013-08-21 07:14:39 +00:00
# define HRF_OPENED (1<<4)
2014-08-27 08:41:31 +00:00
# define HRF_DOWNLOADED (1<<5) //file was actually downloaded, and not from the local system
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
# define HRF_WAITING (1<<6) //file looks important enough that we should wait for it to start to download or something before we try doing other stuff.
2014-08-25 07:35:41 +00:00
// (1<<7)
2013-11-28 00:45:22 +00:00
# define HRF_DEMO_MVD (1<<8)
# define HRF_DEMO_QWD (1<<9)
# define HRF_DEMO_DM2 (1<<10)
# define HRF_DEMO_DEM (1<<11)
# define HRF_QTVINFO (1<<12)
# define HRF_MANIFEST (1<<13)
# define HRF_BSP (1<<14)
2015-05-14 03:06:58 +00:00
# define HRF_PACKAGE (1<<15) //pak or pk3 that should be installed.
# define HRF_ARCHIVE (1<<16) //zip - treated as a multiple-file 'installer'
# define HRF_MODEL (1<<17)
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
# define HRF_CONFIG (1<<18) //exec it on the console...
2013-06-23 02:17:02 +00:00
# define HRF_ACTION (HRF_OVERWRITE|HRF_NOOVERWRITE|HRF_ABORT)
2013-11-28 00:45:22 +00:00
# define HRF_DEMO (HRF_DEMO_MVD|HRF_DEMO_QWD|HRF_DEMO_DM2|HRF_DEMO_DEM)
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
# define HRF_FILETYPES (HRF_DEMO|HRF_QTVINFO|HRF_MANIFEST|HRF_BSP|HRF_PACKAGE|HRF_ARCHIVE|HRF_MODEL|HRF_CONFIG)
2013-06-23 02:17:02 +00:00
typedef struct {
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
struct dl_download * dl ;
2013-06-23 02:17:02 +00:00
vfsfile_t * srcfile ;
vfsfile_t * dstfile ;
2018-11-19 06:37:25 +00:00
unsigned int flags ;
2013-06-23 02:17:02 +00:00
char fname [ 1 ] ; //system path or url.
} hrf_t ;
2015-05-16 15:51:39 +00:00
extern int waitingformanifest ;
2013-06-23 02:17:02 +00:00
void Host_DoRunFile ( hrf_t * f ) ;
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 CL_PlayDemoStream ( vfsfile_t * file , char * filename , qboolean issyspath , int demotype , float bufferdelay ) ;
2013-11-28 00:45:22 +00:00
void CL_ParseQTVDescriptor ( vfsfile_t * f , const char * name ) ;
2015-05-14 03:06:58 +00:00
qboolean FS_PathURLCache ( char * url , char * path , size_t pathsize ) ;
2013-06-23 02:17:02 +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
//guesses the file type based upon its file extension. mdl/md3/iqm distinctions are not important, so we can usually get away with this in the context of quake.
unsigned int Host_GuessFileType ( const char * mimetype , const char * filename )
{
if ( mimetype )
{
if ( ! strcmp ( mimetype , " application/x-qtv " ) ) //what uses this?
return HRF_QTVINFO ;
else if ( ! strcmp ( mimetype , " text/x-quaketvident " ) )
return HRF_QTVINFO ;
else if ( ! strcmp ( mimetype , " application/x-fteplugin " ) )
return HRF_MANIFEST ;
else if ( ! strcmp ( mimetype , " application/x-ftemanifest " ) )
return HRF_MANIFEST ;
else if ( ! strcmp ( mimetype , " application/x-multiviewdemo " ) )
return HRF_DEMO_MVD ;
else if ( ! strcmp ( mimetype , " application/zip " ) )
return HRF_ARCHIVE ;
// else if (!strcmp(mimetype, "application/x-ftebsp"))
// return HRF_BSP;
// else if (!strcmp(mimetype, "application/x-ftepackage"))
// return HRF_PACKAGE;
}
if ( filename )
{ //find the query or location part of the url, so we can ignore extra stuff.
struct
{
unsigned int type ;
const char * ext ;
} exts [ ] =
{
//demo formats
{ HRF_DEMO_QWD , " qwd " } ,
{ HRF_DEMO_QWD , " qwd.gz " } ,
{ HRF_DEMO_MVD , " mvd " } ,
{ HRF_DEMO_MVD , " mvd.gz " } ,
{ HRF_DEMO_DM2 , " dm2 " } ,
{ HRF_DEMO_DM2 , " dm2.gz " } ,
{ HRF_DEMO_DEM , " dem " } ,
{ HRF_DEMO_DEM , " dem.gz " } ,
{ HRF_QTVINFO , " qtv " } ,
//other stuff
{ HRF_MANIFEST , " fmf " } ,
{ HRF_BSP , " bsp " } ,
{ HRF_BSP , " map " } ,
{ HRF_CONFIG , " cfg " } ,
{ HRF_CONFIG , " rc " } ,
{ HRF_PACKAGE , " pak " } ,
{ HRF_PACKAGE , " pk3 " } ,
{ HRF_PACKAGE , " pk4 " } ,
{ HRF_PACKAGE , " wad " } ,
{ HRF_ARCHIVE , " zip " } ,
//model formats
{ HRF_MODEL , " mdl " } ,
{ HRF_MODEL , " md2 " } ,
{ HRF_MODEL , " md3 " } ,
{ HRF_MODEL , " iqm " } ,
2017-08-07 19:46:29 +00:00
{ HRF_MODEL , " vvm " } ,
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
{ HRF_MODEL , " psk " } ,
{ HRF_MODEL , " zym " } ,
{ HRF_MODEL , " dpm " } ,
2018-06-02 08:55:57 +00:00
{ HRF_MODEL , " gltf " } ,
{ HRF_MODEL , " glb " } ,
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
//sprites
{ HRF_MODEL , " spr " } ,
{ HRF_MODEL , " spr2 " } ,
//static stuff
{ HRF_MODEL , " obj " } ,
{ HRF_MODEL , " lwo " } ,
{ HRF_MODEL , " ase " } ,
} ;
size_t i ;
const char * ext ;
const char * stop = filename + strlen ( filename ) ;
const char * tag = strchr ( filename , ' ? ' ) ;
if ( tag & & tag < stop )
stop = tag ;
tag = strchr ( filename , ' # ' ) ;
if ( tag & & tag < stop )
stop = tag ;
ext = COM_GetFileExtension ( filename , stop ) ;
if ( ! Q_strstopcasecmp ( ext , stop , " .php " ) ) //deal with extra extensions the easy way
ext = COM_GetFileExtension ( filename , stop = ext ) ;
if ( ! Q_strstopcasecmp ( ext , stop , " .gz " ) ) //deal with extra extensions the easy way
ext = COM_GetFileExtension ( filename , ext ) ;
if ( * ext = = ' . ' )
ext + + ;
for ( i = 0 ; i < countof ( exts ) ; i + + )
if ( ! Q_strstopcasecmp ( ext , stop , exts [ i ] . ext ) )
return exts [ i ] . type ;
}
return 0 ;
}
2013-06-23 02:17:02 +00:00
void Host_RunFileDownloaded ( struct dl_download * dl )
{
hrf_t * f = dl - > user_ctx ;
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 ) //download was previously cancelled.
return ;
2015-05-14 03:06:58 +00:00
if ( dl - > status = = DL_FAILED )
{
f - > flags | = HRF_ABORT ;
f - > srcfile = NULL ;
}
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
if ( f - > srcfile ) //erk?
VFS_CLOSE ( f - > srcfile ) ;
f - > flags | = HRF_OPENED ;
2015-05-14 03:06:58 +00:00
f - > srcfile = dl - > file ;
dl - > file = NULL ;
}
2013-06-23 02:17:02 +00:00
Host_DoRunFile ( f ) ;
}
2015-05-14 03:06:58 +00:00
qboolean Host_BeginFileDownload ( struct dl_download * dl , char * mimetype )
2013-11-28 00:45:22 +00:00
{
2015-05-14 03:06:58 +00:00
qboolean result = false ;
2013-11-28 00:45:22 +00:00
//at this point the file is still downloading, so don't copy it out just yet.
hrf_t * f = dl - > user_ctx ;
2014-08-27 08:41:31 +00:00
if ( f - > flags & HRF_WAITING )
{
f - > flags & = ~ HRF_WAITING ;
waitingformanifest - - ;
}
2013-11-28 00:45:22 +00:00
if ( ! ( f - > flags & HRF_FILETYPES ) )
{
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
f - > flags | = Host_GuessFileType ( mimetype , f - > fname ) ;
if ( ! ( f - > flags & HRF_FILETYPES ) )
2013-11-28 00:45:22 +00:00
{
2015-05-14 03:06:58 +00:00
if ( mimetype )
2018-03-25 09:36:14 +00:00
Con_Printf ( " mime type \" %s \" nor file extension of \" %s \" not known \n " , mimetype , f - > fname ) ;
2015-05-14 03:06:58 +00:00
else
2018-03-25 09:36:14 +00:00
Con_Printf ( " file extension of \" %s \" not known \n " , f - > fname ) ;
2013-11-28 01:08:12 +00:00
//file type not guessable from extension either.
2013-11-28 00:45:22 +00:00
f - > flags | = HRF_ABORT ;
Host_DoRunFile ( f ) ;
2015-05-14 03:06:58 +00:00
return false ;
2013-11-28 00:45: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 ( ( f - > flags & HRF_MANIFEST ) & & ! ( f - > flags & HRF_WAITING ) )
{
f - > flags | = HRF_WAITING ;
2013-11-28 00:45:22 +00:00
waitingformanifest + + ;
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
}
2013-11-28 00:45: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
//seeking means we can rewind
2013-11-28 00:45:22 +00:00
if ( f - > flags & HRF_DEMO_QWD )
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
CL_PlayDemoStream ( ( dl - > file = VFSPIPE_Open ( 2 , true ) ) , f - > fname , true , DPB_QUAKEWORLD , 0 ) ;
2013-11-28 00:45:22 +00:00
else if ( f - > flags & HRF_DEMO_MVD )
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
CL_PlayDemoStream ( ( dl - > file = VFSPIPE_Open ( 2 , true ) ) , f - > fname , true , DPB_MVD , 0 ) ;
2013-11-28 01:08:12 +00:00
# ifdef Q2CLIENT
2013-11-28 00:45:22 +00:00
else if ( f - > flags & HRF_DEMO_DM2 )
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
CL_PlayDemoStream ( ( dl - > file = VFSPIPE_Open ( 2 , true ) ) , f - > fname , true , DPB_QUAKE2 , 0 ) ;
2013-11-28 01:08:12 +00:00
# endif
# ifdef NQPROT
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 ( f - > flags & HRF_DEMO_DEM )
{ //fixme: the demo code can't handle the cd track with streamed/missing-so-far writes.
dl - > file = VFSPIPE_Open ( 1 , true ) ; //make sure the reader will be seekable, so we can rewind.
// CL_PlayDemoStream((dl->file = VFSPIPE_Open(2, true)), f->fname, DPB_NETQUAKE, 0);
}
2013-11-28 01:08:12 +00:00
# endif
2013-12-03 15:15:50 +00:00
else if ( f - > flags & ( HRF_MANIFEST | HRF_QTVINFO ) )
{
//just use a pipe instead of a temp file, working around an issue with temp files on android
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
dl - > file = VFSPIPE_Open ( 1 , false ) ;
2015-05-14 03:06:58 +00:00
return true ;
}
else if ( f - > flags & HRF_ARCHIVE )
{
char cachename [ MAX_QPATH ] ;
if ( ! FS_PathURLCache ( f - > fname , cachename , sizeof ( cachename ) ) )
return false ;
f - > srcfile = FS_OpenVFS ( cachename , " rb " , FS_ROOT ) ;
if ( f - > srcfile )
{
f - > flags | = HRF_OPENED ;
Host_DoRunFile ( f ) ;
return false ;
}
FS_CreatePath ( cachename , FS_ROOT ) ;
dl - > file = FS_OpenVFS ( cachename , " wb " , FS_ROOT ) ;
if ( dl - > file )
return true ; //okay, continue downloading.
2013-12-03 15:15:50 +00:00
}
2013-11-28 01:08:12 +00:00
else if ( f - > flags & HRF_DEMO )
Con_Printf ( " %s: format not supported \n " , f - > fname ) ; //demos that are not supported in this build for one reason or another
2013-11-28 00:45:22 +00:00
else
2015-05-14 03:06:58 +00:00
return true ;
//demos stream, so we want to continue the http download, but we don't want to do anything with the result.
if ( f - > flags & HRF_DEMO )
result = true ;
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
{
f - > flags | = HRF_ABORT ;
Host_DoRunFile ( f ) ;
}
2015-05-14 03:06:58 +00:00
return result ;
2013-11-28 00:45:22 +00:00
}
2013-06-23 02:17:02 +00:00
void Host_RunFilePrompted ( void * ctx , int button )
{
hrf_t * f = ctx ;
switch ( button )
{
case 0 :
f - > flags | = HRF_OVERWRITE ;
break ;
case 1 :
f - > flags | = HRF_NOOVERWRITE ;
break ;
default :
f - > flags | = HRF_ABORT ;
break ;
}
Host_DoRunFile ( f ) ;
}
2016-02-15 06:01:17 +00:00
# ifdef WEBCLIENT
2014-08-27 08:41:31 +00:00
static qboolean isurl ( char * url )
{
# ifdef FTE_TARGET_WEB
return true ; //assume EVERYTHING is a url, because the local filesystem is pointless.
# endif
2014-09-08 23:47:19 +00:00
return /*!strncmp(url, "data:", 5) || */ ! strncmp ( url , " http:// " , 7 ) | | ! strncmp ( url , " https:// " , 8 ) ;
2014-08-27 08:41:31 +00:00
}
2016-02-15 06:01:17 +00:00
# endif
2014-08-27 08:41:31 +00:00
2014-10-11 19:39:45 +00:00
qboolean FS_FixupGamedirForExternalFile ( char * input , char * filename , size_t fnamelen ) ;
2013-06-23 02:17:02 +00:00
void Host_DoRunFile ( hrf_t * f )
{
char qname [ MAX_QPATH ] ;
char displayname [ MAX_QPATH ] ;
char loadcommand [ MAX_OSPATH ] ;
qboolean isnew = false ;
qboolean haschanged = false ;
2014-08-27 08:41:31 +00:00
if ( f - > flags & HRF_WAITING )
{
f - > flags & = ~ HRF_WAITING ;
waitingformanifest - - ;
}
2013-06-23 02:17:02 +00:00
if ( f - > flags & HRF_ABORT )
{
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
done :
if ( f - > flags & HRF_WAITING )
2013-08-21 07:14:39 +00:00
waitingformanifest - - ;
2013-06-23 02:17:02 +00:00
if ( f - > srcfile )
VFS_CLOSE ( f - > srcfile ) ;
if ( f - > dstfile )
VFS_CLOSE ( f - > dstfile ) ;
Z_Free ( f ) ;
return ;
}
2013-11-28 00:45:22 +00:00
# ifdef WEBCLIENT
2018-03-25 09:36:14 +00:00
if ( isurl ( f - > fname ) & & ! f - > srcfile )
{
if ( ! ( f - > flags & HRF_OPENED ) )
2013-11-28 00:45:22 +00:00
{
2018-03-25 09:36:14 +00:00
struct dl_download * dl ;
f - > flags | = HRF_OPENED ;
dl = HTTP_CL_Get ( f - > fname , NULL , Host_RunFileDownloaded ) ;
if ( dl )
2013-11-28 00:45:22 +00:00
{
2018-03-25 09:36:14 +00:00
f - > flags | = HRF_DOWNLOADED ;
dl - > notifystarted = Host_BeginFileDownload ;
dl - > user_ctx = f ;
2014-08-27 08:41:31 +00:00
2018-03-25 09:36:14 +00:00
if ( ! ( f - > flags & HRF_WAITING ) )
{
f - > flags | = HRF_WAITING ;
waitingformanifest + + ;
2014-09-08 23:47:19 +00:00
}
2018-03-25 09:36:14 +00:00
return ;
2013-11-28 00:45:22 +00:00
}
}
2018-03-25 09:36:14 +00:00
}
2013-11-28 00:45:22 +00:00
# endif
2018-03-25 09:36:14 +00:00
if ( ! ( f - > flags & HRF_FILETYPES ) )
{
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
f - > flags | = Host_GuessFileType ( NULL , f - > fname ) ;
2013-11-28 00:45:22 +00:00
//if we still don't know what it is, give up.
if ( ! ( f - > flags & HRF_FILETYPES ) )
{
2014-08-25 07:35:41 +00:00
Con_Printf ( " Host_DoRunFile: unknown filetype \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
goto done ;
2013-11-28 00:45:22 +00:00
}
if ( f - > flags & HRF_MANIFEST )
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 - > flags & HRF_WAITING ) )
{
f - > flags | = HRF_WAITING ;
waitingformanifest + + ;
}
}
2013-11-28 00:45:22 +00:00
}
2013-08-21 07:14:39 +00:00
if ( f - > flags & HRF_DEMO )
2013-06-23 02:17:02 +00:00
{
2018-03-25 09:36:14 +00:00
if ( f - > srcfile )
{
VFS_SEEK ( f - > srcfile , 0 ) ;
if ( f - > flags & HRF_DEMO_QWD )
CL_PlayDemoStream ( f - > srcfile , f - > fname , true , DPB_QUAKEWORLD , 0 ) ;
# ifdef Q2CLIENT
else if ( f - > flags & HRF_DEMO_DM2 )
CL_PlayDemoStream ( f - > srcfile , f - > fname , true , DPB_QUAKE2 , 0 ) ;
# endif
# ifdef NQPROT
else if ( f - > flags & HRF_DEMO_DEM )
CL_PlayDemoStream ( f - > srcfile , f - > fname , true , DPB_NETQUAKE , 0 ) ;
# endif
else //if (f->flags & HRF_DEMO_MVD)
CL_PlayDemoStream ( f - > srcfile , f - > fname , true , DPB_MVD , 0 ) ;
f - > srcfile = NULL ;
}
else
{
//play directly via system path, no prompts needed
FS_FixupGamedirForExternalFile ( f - > fname , loadcommand , sizeof ( loadcommand ) ) ;
Cbuf_AddText ( va ( " playdemo \" %s \" \n " , loadcommand ) , RESTRICT_LOCAL ) ;
}
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
goto done ;
2013-06-23 02:17:02 +00:00
}
2013-08-21 07:14:39 +00:00
else if ( f - > flags & HRF_BSP )
2013-06-23 02:17:02 +00:00
{
char shortname [ MAX_QPATH ] ;
COM_StripExtension ( COM_SkipPath ( f - > fname ) , shortname , sizeof ( shortname ) ) ;
2014-10-11 19:39:45 +00:00
if ( FS_FixupGamedirForExternalFile ( f - > fname , qname , sizeof ( qname ) ) & & ! Q_strncasecmp ( qname , " maps/ " , 5 ) )
{
COM_StripExtension ( qname + 5 , loadcommand , sizeof ( loadcommand ) ) ;
Cbuf_AddText ( va ( " map \" %s \" \n " , loadcommand ) , RESTRICT_LOCAL ) ;
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
goto done ;
2014-10-11 19:39:45 +00:00
}
2018-08-04 19:00:19 +00:00
Q_snprintfz ( loadcommand , sizeof ( loadcommand ) , " map \" %s \" \n " , shortname ) ;
Q_snprintfz ( displayname , sizeof ( displayname ) , " map: %s " , shortname ) ;
Q_snprintfz ( qname , sizeof ( qname ) , " maps/%s.bsp " , shortname ) ;
2013-06-23 02:17:02 +00:00
}
2013-08-21 07:14:39 +00:00
else if ( f - > flags & HRF_PACKAGE )
2013-06-23 02:17:02 +00:00
{
char * shortname ;
shortname = COM_SkipPath ( f - > fname ) ;
2018-08-04 19:00:19 +00:00
Q_snprintfz ( qname , sizeof ( qname ) , " %s " , shortname ) ;
Q_snprintfz ( loadcommand , sizeof ( loadcommand ) , " fs_restart \n " ) ;
Q_snprintfz ( displayname , sizeof ( displayname ) , " package: %s " , shortname ) ;
2013-06-23 02:17:02 +00:00
}
2013-08-21 07:14:39 +00:00
else if ( f - > flags & HRF_MANIFEST )
2013-06-23 02:17:02 +00:00
{
if ( f - > flags & HRF_OPENED )
{
if ( f - > srcfile )
{
ftemanifest_t * man ;
int len = VFS_GETLEN ( f - > srcfile ) ;
2014-08-25 07:35:41 +00:00
int foo ;
2013-06-23 02:17:02 +00:00
char * fdata = BZ_Malloc ( len + 1 ) ;
2014-08-25 07:35:41 +00:00
foo = VFS_READ ( f - > srcfile , fdata , len ) ;
2013-06-23 02:17:02 +00:00
fdata [ len ] = 0 ;
2017-01-24 20:15:14 +00:00
if ( foo ! = len | | ! len )
2014-08-25 07:35:41 +00:00
{
Con_Printf ( " Host_DoRunFile: unable to read file properly \n " ) ;
BZ_Free ( fdata ) ;
}
else
{
2017-01-24 20:15:14 +00:00
host_parms . manifest = Z_StrDup ( fdata ) ;
2014-08-25 07:35:41 +00:00
man = FS_Manifest_Parse ( NULL , fdata ) ;
2014-08-27 08:41:31 +00:00
if ( man )
{
if ( ! man - > updateurl )
man - > updateurl = Z_StrDup ( f - > fname ) ;
// if (f->flags & HRF_DOWNLOADED)
man - > blockupdate = true ;
BZ_Free ( fdata ) ;
2018-12-28 00:04:36 +00:00
# ifdef PACKAGEMANAGER
2016-11-20 20:52:41 +00:00
PM_Shutdown ( ) ;
2018-12-28 00:04:36 +00:00
# endif
2015-04-14 23:12:17 +00:00
FS_ChangeGame ( man , true , true ) ;
2014-08-27 08:41:31 +00:00
}
else
{
Con_Printf ( " Manifest file %s does not appear valid \n " , f - > fname ) ;
BZ_Free ( fdata ) ;
}
2014-08-25 07:35:41 +00:00
}
2013-08-06 02:19:06 +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
goto done ;
2013-06-23 02:17:02 +00:00
}
}
}
2014-10-11 19:39:45 +00:00
else if ( f - > flags & HRF_MODEL )
{
2014-12-29 02:35:10 +00:00
if ( ! FS_FixupGamedirForExternalFile ( f - > fname , loadcommand , sizeof ( loadcommand ) ) )
Con_Printf ( " %s is not within the current gamedir \n " , f - > fname ) ;
else
Cbuf_AddText ( va ( " modelviewer \" %s \" \n " , loadcommand ) , RESTRICT_LOCAL ) ;
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
goto done ;
2015-05-14 03:06:58 +00:00
}
else if ( f - > flags & HRF_ARCHIVE )
{
2016-07-12 00:40:13 +00:00
char cachename [ MAX_QPATH ] ;
2015-05-14 03:06:58 +00:00
struct gamepacks packagespaths [ 2 ] ;
if ( f - > srcfile )
VFS_CLOSE ( f - > srcfile ) ;
f - > srcfile = NULL ;
memset ( packagespaths , 0 , sizeof ( packagespaths ) ) ;
packagespaths [ 0 ] . url = f - > fname ;
2016-07-12 00:40:13 +00:00
packagespaths [ 0 ] . path = cachename ;
if ( FS_PathURLCache ( f - > fname , cachename , sizeof ( cachename ) ) )
{
COM_Gamedir ( " " , packagespaths ) ;
}
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
goto done ;
}
else if ( f - > flags & HRF_CONFIG )
{
if ( ! ( f - > flags & HRF_ACTION ) )
{
Key_Dest_Remove ( kdm_console ) ;
2019-09-04 07:59:40 +00:00
Menu_Prompt ( Host_RunFilePrompted , f , va ( " Exec %s? \n " , COM_SkipPath ( f - > fname ) ) , " Yes " , NULL , " Cancel " ) ;
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 ;
}
if ( f - > flags & HRF_OPENED )
{
size_t len = VFS_GETLEN ( f - > srcfile ) ;
char * fdata = BZ_Malloc ( len + 2 ) ;
if ( fdata )
{
VFS_READ ( f - > srcfile , fdata , len ) ;
fdata [ len + + ] = ' \n ' ;
fdata [ len ] = 0 ;
Cbuf_AddText ( fdata , RESTRICT_INSECURE ) ;
BZ_Free ( fdata ) ;
}
goto done ;
}
2014-10-11 19:39:45 +00:00
}
2013-11-28 00:45:22 +00:00
else if ( ! ( f - > flags & HRF_QTVINFO ) )
2013-06-23 02:17:02 +00:00
{
2014-08-25 07:35:41 +00:00
Con_Printf ( " Host_DoRunFile: filetype not handled \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
goto done ;
2013-06-23 02:17:02 +00:00
}
2013-11-28 00:45:22 +00:00
//at this point we need the file to have been opened.
2013-06-23 02:17:02 +00:00
if ( ! ( f - > flags & HRF_OPENED ) )
{
f - > flags | = HRF_OPENED ;
if ( ! f - > srcfile )
{
# ifdef WEBCLIENT
2014-08-27 08:41:31 +00:00
if ( isurl ( f - > fname ) )
2013-06-23 02:17:02 +00:00
{
struct dl_download * dl = HTTP_CL_Get ( f - > fname , NULL , Host_RunFileDownloaded ) ;
2014-09-08 23:47:19 +00:00
if ( dl )
{
dl - > notifystarted = Host_BeginFileDownload ;
dl - > user_ctx = f ;
return ;
}
2013-06-23 02:17:02 +00:00
}
# endif
f - > srcfile = VFSOS_Open ( f - > fname , " rb " ) ; //input file is a system path, or something.
}
}
if ( ! f - > srcfile )
{
2013-12-07 00:30:48 +00:00
Con_Printf ( " Unable to open %s \n " , f - > fname ) ;
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
goto done ;
2013-06-23 02:17:02 +00:00
}
2013-10-29 17:38:22 +00:00
if ( f - > flags & HRF_MANIFEST )
{
Host_DoRunFile ( f ) ;
return ;
}
2013-11-28 00:45:22 +00:00
if ( f - > flags & HRF_QTVINFO )
{
//pass the file object to the qtv code instead of trying to install it.
CL_ParseQTVDescriptor ( f - > srcfile , f - > fname ) ;
f - > srcfile = NULL ;
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
goto done ;
2013-11-28 00:45:22 +00:00
}
2013-06-23 02:17:02 +00:00
VFS_SEEK ( f - > srcfile , 0 ) ;
f - > dstfile = FS_OpenVFS ( qname , " rb " , FS_GAME ) ;
if ( f - > dstfile )
{
//do a real diff.
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 - > srcfile - > seekstyle = = SS_UNSEEKABLE | | VFS_GETLEN ( f - > srcfile ) ! = VFS_GETLEN ( f - > dstfile ) )
2013-12-07 00:30:48 +00:00
{
//if we can't seek, or the sizes differ, just assume that the file is modified.
2013-06-23 02:17:02 +00:00
haschanged = true ;
2013-12-07 00:30:48 +00:00
}
2013-06-23 02:17:02 +00:00
else
{
int len = VFS_GETLEN ( f - > srcfile ) ;
char sbuf [ 8192 ] , dbuf [ 8192 ] ;
if ( len > sizeof ( sbuf ) )
len = sizeof ( sbuf ) ;
VFS_READ ( f - > srcfile , sbuf , len ) ;
VFS_READ ( f - > dstfile , dbuf , len ) ;
haschanged = memcmp ( sbuf , dbuf , len ) ;
2013-12-07 00:30:48 +00:00
VFS_SEEK ( f - > srcfile , 0 ) ;
2013-06-23 02:17:02 +00:00
}
VFS_CLOSE ( f - > dstfile ) ;
f - > dstfile = NULL ;
}
else
isnew = true ;
if ( haschanged )
{
if ( ! ( f - > flags & HRF_ACTION ) )
{
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
Key_Dest_Remove ( kdm_console ) ;
2019-09-04 07:59:40 +00:00
Menu_Prompt ( Host_RunFilePrompted , f , va ( " File already exists. \n What would you like to do? \n %s \n " , displayname ) , " Overwrite " , " Run old " , " Cancel " ) ;
2013-06-23 02:17:02 +00:00
return ;
}
}
else if ( isnew )
{
if ( ! ( f - > flags & HRF_ACTION ) )
{
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
Key_Dest_Remove ( kdm_console ) ;
2019-09-04 07:59:40 +00:00
Menu_Prompt ( Host_RunFilePrompted , f , va ( " File appears new. \n Would you like to install \n %s \n " , displayname ) , " Install! " , " " , " Cancel " ) ;
2013-06-23 02:17:02 +00:00
return ;
}
}
if ( f - > flags & HRF_OVERWRITE )
{
char buffer [ 8192 ] ;
int len ;
f - > dstfile = FS_OpenVFS ( qname , " wb " , FS_GAMEONLY ) ;
if ( f - > dstfile )
{
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
# ifdef FTE_TARGET_WEB
VFS_SEEK ( f - > dstfile , VFS_GETLEN ( f - > srcfile ) ) ;
VFS_WRITE ( f - > dstfile , " zomg " , 0 ) ; //hack to ensure the file is there, avoiding excessive copies.
VFS_SEEK ( f - > dstfile , 0 ) ;
# endif
2013-06-23 02:17:02 +00:00
while ( 1 )
{
len = VFS_READ ( f - > srcfile , buffer , sizeof ( buffer ) ) ;
if ( len < = 0 )
break ;
VFS_WRITE ( f - > dstfile , buffer , len ) ;
}
VFS_CLOSE ( f - > dstfile ) ;
f - > dstfile = NULL ;
}
}
Cbuf_AddText ( loadcommand , RESTRICT_LOCAL ) ;
f - > flags | = HRF_ABORT ;
Host_DoRunFile ( f ) ;
return ;
}
//only valid once the host has been initialised, as it needs a working filesystem.
//if file is specified, takes full ownership of said file, including destruction.
qboolean Host_RunFile ( const char * fname , int nlen , vfsfile_t * file )
{
2013-12-07 00:30:48 +00:00
hrf_t * f ;
2017-03-26 23:03:02 +00:00
# if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT) && !defined(_XBOX)
2013-12-07 00:30:48 +00:00
//win32 file urls are basically fucked, so defer to the windows api.
char utf8 [ MAX_OSPATH * 3 ] ;
if ( nlen > = 7 & & ! strncmp ( fname , " file:// " , 7 ) )
{
qboolean Sys_ResolveFileURL ( const char * inurl , int inlen , char * out , int outlen ) ;
if ( ! Sys_ResolveFileURL ( fname , nlen , utf8 , sizeof ( utf8 ) ) )
{
Con_Printf ( " Cannot resolve file url \n " ) ;
return false ;
}
fname = utf8 ;
nlen = strlen ( fname ) ;
}
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
2014-08-25 07:35:41 +00:00
# elif !defined(FTE_TARGET_WEB)
2018-03-25 09:36:14 +00:00
//unix file urls are fairly consistant - must be an absolute path.
2013-12-07 00:30:48 +00:00
if ( nlen > = 8 & & ! strncmp ( fname , " file:/// " , 8 ) )
{
fname + = 7 ;
nlen - = 7 ;
}
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
2013-12-07 00:30:48 +00:00
# endif
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 ( nlen > = 5 & & ! strncmp ( fname , " qw:// " , 5 ) )
{ //this is also implemented by ezquake, so be careful here...
//"qw://[stream@]host[:port]/COMMAND" join, spectate, qtvplay
char * t , * cmd ;
const char * url ;
char buffer [ 8192 ] ;
t = Z_Malloc ( nlen + 1 ) ;
memcpy ( t , fname , nlen ) ;
t [ nlen ] = 0 ;
url = t + 5 ;
for ( cmd = t + 5 ; * cmd ; cmd + + )
{
if ( * cmd = = ' / ' )
{
* cmd + + = 0 ;
break ;
}
}
//quote the url safely.
url = COM_QuotedString ( url , buffer , sizeof ( buffer ) , false ) ;
//now figure out what the command actually was
if ( ! Q_strcasecmp ( cmd , " join " ) )
Cbuf_AddText ( va ( " join %s \n " , url ) , RESTRICT_LOCAL ) ;
else if ( ! Q_strcasecmp ( cmd , " spectate " ) | | ! strcmp ( cmd , " observe " ) )
Cbuf_AddText ( va ( " observe %s \n " , url ) , RESTRICT_LOCAL ) ;
else if ( ! Q_strcasecmp ( cmd , " qtvplay " ) )
Cbuf_AddText ( va ( " qtvplay %s \n " , url ) , RESTRICT_LOCAL ) ;
else if ( ! * cmd | | ! Q_strcasecmp ( cmd , " connect " ) )
Cbuf_AddText ( va ( " connect %s \n " , url ) , RESTRICT_LOCAL ) ;
else
Con_Printf ( " Unknown url command: %s \n " , cmd ) ;
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 ( file )
VFS_CLOSE ( file ) ;
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
Z_Free ( t ) ;
return true ;
}
2013-12-07 00:30:48 +00:00
f = Z_Malloc ( sizeof ( * f ) + nlen ) ;
2013-06-23 02:17:02 +00:00
memcpy ( f - > fname , fname , nlen ) ;
f - > fname [ nlen ] = 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
f - > srcfile = file ;
if ( file )
f - > flags | = HRF_OPENED ;
2013-08-21 07:14:39 +00:00
2013-12-07 00:30:48 +00:00
Con_Printf ( " Opening external file: %s \n " , f - > fname ) ;
2013-06-23 02:17:02 +00:00
Host_DoRunFile ( f ) ;
return true ;
}
2016-02-10 23:23:43 +00:00
void CL_UpdateHeadAngles ( void )
{
/*FIXME: no idea what I'm doing with this. lets just not break anything for now
//identity, for now
vec3_t headchange [ 3 ] =
{
{ 1 , 0 , 0 } ,
{ 0 , 1 , 0 } ,
{ 0 , 0 , 1 }
} ;
vec3_t tmp [ 3 ] , tmp2 [ 3 ] ;
playerview_t * pv = & cl . playerview [ 0 ] ;
tmp2 [ 0 ] [ 0 ] = 0 ;
tmp2 [ 0 ] [ 1 ] = host_frametime * 90 ;
tmp2 [ 0 ] [ 2 ] = 0 ;
AngleVectorsFLU ( tmp2 [ 0 ] , headchange [ 0 ] , headchange [ 1 ] , headchange [ 2 ] ) ;
switch ( cl_headmode . ival )
{
case 3 : //head angles change both
R_ConcatRotations ( headchange , r_refdef . headaxis , tmp ) ;
break ;
case 2 : //head changes are entirely relative to the 'view' angle
R_ConcatRotations ( headchange , r_refdef . headaxis , tmp ) ;
memcpy ( r_refdef . headaxis , tmp , sizeof ( r_refdef . headaxis ) ) ;
break ;
case 1 : //head changes change the view angle directly.
AngleVectorsFLU ( pv - > viewangles , tmp [ 0 ] , tmp [ 1 ] , tmp [ 2 ] ) ;
R_ConcatRotations ( headchange , tmp , tmp2 ) ;
VectorAngles ( tmp2 [ 0 ] , tmp2 [ 2 ] , pv - > viewangles ) ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
pv - > viewangles [ 0 ] * = r_meshpitch . value ;
2016-02-10 23:23:43 +00:00
//fall through
default :
case 0 : //off
VectorSet ( r_refdef . headaxis [ 0 ] , 1 , 0 , 0 ) ;
VectorSet ( r_refdef . headaxis [ 1 ] , 0 , 1 , 0 ) ;
VectorSet ( r_refdef . headaxis [ 2 ] , 0 , 0 , 1 ) ;
break ;
}
*/
VectorSet ( r_refdef . headaxis [ 0 ] , 1 , 0 , 0 ) ;
VectorSet ( r_refdef . headaxis [ 1 ] , 0 , 1 , 0 ) ;
VectorSet ( r_refdef . headaxis [ 2 ] , 0 , 0 , 1 ) ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = =
Host_Frame
Runs all active servers
= = = = = = = = = = = = = = = = = =
*/
2005-02-28 07:16:19 +00:00
extern cvar_t cl_netfps ;
2008-06-12 20:47:13 +00:00
extern cvar_t cl_sparemsec ;
2014-08-27 08:41:31 +00:00
void CL_StartCinematicOrMenu ( void ) ;
2004-08-23 00:15:46 +00:00
int nopacketcount ;
void SNDDMA_SetUnderWater ( qboolean underwater ) ;
2011-07-06 01:01:13 +00:00
double Host_Frame ( double time )
2004-08-23 00:15:46 +00:00
{
2013-10-08 14:28:11 +00:00
static double time0 = 0 ;
2004-08-23 00:15:46 +00:00
static double time1 = 0 ;
static double time2 = 0 ;
static double time3 = 0 ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
int pass0 , pass1 , pass2 , pass3 , i ;
2004-08-23 00:15:46 +00:00
// float fps;
2013-05-11 05:03:07 +00:00
double newrealtime ;
2005-08-07 18:08:13 +00:00
static double spare ;
2011-01-04 02:56:16 +00:00
float maxfps ;
qboolean maxfpsignoreserver ;
2011-07-06 01:01:13 +00:00
qboolean idle ;
2016-07-12 00:40:13 +00:00
extern int r_blockvidrestart ;
2015-07-03 02:07:41 +00:00
static qboolean hadwork ;
2004-12-15 19:54:09 +00:00
RSpeedLocals ( ) ;
2004-08-23 00:15:46 +00:00
if ( setjmp ( host_abort ) )
2011-12-23 03:12:29 +00:00
{
2010-11-22 02:03:28 +00:00
return 0 ; // something bad happened, or the server disconnected
2011-12-23 03:12:29 +00:00
}
2004-08-23 00:15:46 +00:00
2012-11-27 03:23:19 +00:00
newrealtime = Media_TweekCaptureFrameTime ( realtime , time ) ;
2013-05-11 05:03:07 +00:00
time = newrealtime - realtime ;
2012-11-27 03:23:19 +00:00
realtime = newrealtime ;
if ( oldrealtime > realtime )
2015-09-18 20:30:10 +00:00
oldrealtime = realtime ;
2004-08-23 00:15:46 +00:00
2005-03-20 02:57:11 +00:00
if ( cl . gamespeed < 0.1 )
cl . gamespeed = 1 ;
time * = cl . gamespeed ;
2004-08-23 00:15:46 +00:00
# ifdef WEBCLIENT
2010-03-14 14:35:56 +00:00
// FTP_ClientThink();
2019-03-23 07:06:37 +00:00
HTTP_CL_Think ( NULL , NULL ) ;
2004-08-23 00:15:46 +00:00
# endif
2013-06-23 02:17:02 +00:00
if ( r_blockvidrestart )
{
if ( waitingformanifest )
2016-01-18 05:22:07 +00:00
{
COM_MainThreadWork ( ) ;
2013-06-23 02:17:02 +00:00
return 0.1 ;
2016-01-18 05:22:07 +00:00
}
2013-06-23 02:17:02 +00:00
Host_FinishLoading ( ) ;
return 0 ;
}
2014-08-27 08:41:31 +00:00
if ( startuppending )
CL_StartCinematicOrMenu ( ) ;
2013-06-23 02:17:02 +00:00
2004-10-03 10:16:15 +00:00
if ( cl . paused )
cl . gametimemark + = time ;
2018-10-27 04:32:18 +00:00
//if we're at a menu/console/thing
2019-09-04 07:59:40 +00:00
idle = ! Key_Dest_Has_Higher ( kdm_menu ) ;
idle = ( ( cls . state = = ca_disconnected ) | | cl . paused ) & & idle ; //idle if we're disconnected/paused and not at a menu
2018-10-27 04:32:18 +00:00
idle | = ! vid . activeapp ; //always idle when tabbed out
2011-07-06 01:01:13 +00:00
2014-06-12 23:08:42 +00:00
//read packets early and always, so we don't have stuff waiting for reception quite so often.
//should smooth out a few things, and increase download speeds.
2015-03-03 00:14:43 +00:00
if ( ! cls . timedemo )
CL_ReadPackets ( ) ;
2014-06-12 23:08:42 +00:00
2011-07-06 01:01:13 +00:00
if ( idle & & cl_idlefps . value > 0 )
{
double idlesec = 1.0 / cl_idlefps . value ;
if ( idlesec > 0.1 )
idlesec = 0.1 ; // limit to at least 10 fps
2017-02-21 20:22:07 +00:00
# ifdef HAVE_MEDIA_ENCODER
2016-01-18 05:22:07 +00:00
if ( Media_Capturing ( ) )
idlesec = 0 ;
# endif
2011-07-06 01:01:13 +00:00
if ( ( realtime - oldrealtime ) < idlesec )
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
{
# ifndef CLIENTONLY
if ( sv . state )
{
RSpeedRemark ( ) ;
SV_Frame ( ) ;
RSpeedEnd ( RSPEED_SERVER ) ;
}
# endif
2014-10-05 20:04:11 +00:00
while ( COM_DoWork ( 0 , false ) )
;
2011-07-06 01:01:13 +00:00
return idlesec - ( realtime - oldrealtime ) ;
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
}
2011-07-06 01:01:13 +00:00
}
2019-09-04 07:59:40 +00:00
# ifdef PLUGINS
Plug_Tick ( ) ;
# endif
NET_Tick ( ) ;
2004-08-23 00:15:46 +00:00
/*
if ( cl_maxfps . value )
fps = cl_maxfps . value ; //max(30.0, min(cl_maxfps.value, 72.0));
else
fps = max ( 30.0 , min ( rate . value / 80.0 , 72.0 ) ) ;
if ( ! cls . timedemo & & realtime - oldrealtime < 1.0 / fps )
return ; // framerate is too high
*/
2004-12-29 03:24:21 +00:00
Mod_Think ( ) ; //think even on idle (which means small walls and a fast cpu can get more surfaces done.
2011-01-04 02:56:16 +00:00
2015-08-11 09:14:33 +00:00
# ifndef CLIENTONLY
2015-08-10 18:28:23 +00:00
if ( sv . state & & cls . state ! = ca_active )
2015-09-18 20:30:10 +00:00
{
maxfpsignoreserver = false ;
2018-10-27 08:20:44 +00:00
maxfps = 0 ; //cl_maxfps.ival;
2015-09-18 20:30:10 +00:00
}
2015-08-11 09:14:33 +00:00
else
# endif
2017-10-31 22:52:58 +00:00
if ( ( cl_netfps . value > 0 | | cls . demoplayback | | runningindepphys ) )
2005-02-28 07:16:19 +00:00
{ //limit the fps freely, and expect the netfps to cope.
2011-01-04 02:56:16 +00:00
maxfpsignoreserver = true ;
maxfps = cl_maxfps . ival ;
2005-02-28 07:16:19 +00:00
}
else
{
2011-01-04 02:56:16 +00:00
maxfpsignoreserver = false ;
2011-06-05 23:53:33 +00:00
maxfps = ( cl_maxfps . ival > 0 | | cls . protocol ! = CP_QUAKEWORLD ) ? cl_maxfps . value : ( ( cl_netfps . value > 0 ) ? cl_netfps . value : cls . maxfps ) ;
2011-01-04 02:56:16 +00:00
/*gets buggy at times longer than 250ms (and 0/negative, obviously)*/
if ( maxfps < 4 )
maxfps = 4 ;
}
2013-07-27 12:21:35 +00:00
if ( vid . isminimized & & ( maxfps < = 0 | | maxfps > 10 ) )
2013-07-13 12:14:32 +00:00
maxfps = 10 ;
2012-11-27 06:06:25 +00:00
if ( maxfps > 0
2017-02-21 20:22:07 +00:00
# ifdef HAVE_MEDIA_ENCODER
2012-11-27 06:06:25 +00:00
& & Media_Capturing ( ) ! = 2
# endif
)
2011-01-04 02:56:16 +00:00
{
2013-09-06 22:57:44 +00:00
// realtime += spare/1000; //don't use it all!
2017-08-29 02:29:06 +00:00
double newspare = CL_FilterTime ( ( spare / 1000 + realtime - oldrealtime ) * 1000 , maxfps , 1.5 , maxfpsignoreserver ) ;
2015-10-11 11:34:58 +00:00
if ( ! newspare )
2014-10-05 20:04:11 +00:00
{
while ( COM_DoWork ( 0 , false ) )
;
2018-07-22 11:49:37 +00:00
return ( cl_yieldcpu . ival | | vid . isminimized | | idle ) ? ( 1.0 / maxfps - ( realtime - oldrealtime ) ) : 0 ;
2014-10-05 20:04:11 +00:00
}
2005-04-16 16:21:27 +00:00
if ( spare < 0 | | cls . state < ca_onserver )
spare = 0 ; //uncapped.
2009-11-04 21:16:50 +00:00
if ( spare > cl_sparemsec . ival )
spare = cl_sparemsec . ival ;
2015-10-11 11:34:58 +00:00
spare = newspare ;
2005-04-16 16:21:27 +00:00
2013-09-06 22:57:44 +00:00
// realtime -= spare/1000; //don't use it all!
2005-02-28 07:16:19 +00:00
}
2011-01-04 02:56:16 +00:00
else
spare = 0 ;
2004-08-23 00:15:46 +00:00
2005-03-22 02:08:01 +00:00
host_frametime = ( realtime - oldrealtime ) * cl . gamespeed ;
2004-08-23 00:15:46 +00:00
oldrealtime = realtime ;
2005-04-16 16:21:27 +00:00
2015-07-03 02:07:41 +00:00
if ( cls . demoplayback & & ! cl . stillloading )
{
qboolean haswork = cl . sendprespawn | | COM_HasWork ( ) ;
if ( ! hadwork & & ! haswork )
CL_ProgressDemoTime ( ) ;
hadwork = haswork ;
}
2015-10-27 15:20:15 +00:00
cl . stillloading = cl . sendprespawn
# ifdef LOADERTHREAD
| | ( cls . state < ca_active & & worker_flush . ival & & COM_HasWork ( ) )
# endif
;
2015-07-03 02:07:41 +00:00
COM_MainThreadWork ( ) ;
2005-12-21 03:07:33 +00:00
2005-04-16 16:21:27 +00:00
2005-05-26 12:55:34 +00:00
# if defined(Q2CLIENT)
if ( cls . protocol = = CP_QUAKE2 )
2005-04-16 16:21:27 +00:00
cl . time + = host_frametime ;
# endif
2004-08-23 00:15:46 +00:00
// if (host_frametime > 0.2)
// host_frametime = 0.2;
2005-06-15 04:45:26 +00:00
2004-08-23 00:15:46 +00:00
// get new key events
2018-03-04 14:41:16 +00:00
Sys_SendKeyEvents ( ) ; //from windowing system
INS_Move ( ) ; //from things that need special polling
2004-08-23 00:15:46 +00:00
2018-03-04 14:41:16 +00:00
// check what we got, and handle any click/button events
2004-08-23 00:15:46 +00:00
IN_Commands ( ) ;
2018-03-04 14:41:16 +00:00
// process console commands from said click/button events
2004-08-23 00:15:46 +00:00
Cbuf_Execute ( ) ;
2004-11-29 01:21:00 +00:00
# ifndef CLIENTONLY
2004-08-23 00:15:46 +00:00
if ( isDedicated ) //someone changed it.
2019-07-02 04:12:20 +00:00
{
if ( sv . state )
{
float ohft = host_frametime ;
RSpeedRemark ( ) ;
SV_Frame ( ) ;
RSpeedEnd ( RSPEED_SERVER ) ;
host_frametime = ohft ;
}
2011-07-06 01:01:13 +00:00
return 0 ;
2019-07-02 04:12:20 +00:00
}
2004-11-29 01:21:00 +00:00
# endif
2004-08-23 00:15:46 +00:00
2004-12-29 03:24:21 +00:00
cls . framecount + + ;
2005-05-08 05:56:03 +00:00
RSpeedRemark ( ) ;
2017-10-31 22:52:58 +00:00
CL_UseIndepPhysics ( cls . state ! = ca_disconnected & & ! ! cl_threadedphysics . ival ) ; //starts/stops the input frame thread.
2005-03-12 23:40:42 +00:00
2014-10-22 19:41:20 +00:00
cl . do_lerp_players = cl_lerp_players . ival | | ( cls . demoplayback = = DPB_MVD | | cls . demoplayback = = DPB_EZTV ) | | ( cls . demoplayback & & ! cl_nolerp . ival & & ! cls . timedemo ) ;
2005-02-28 07:16:19 +00:00
CL_AllowIndependantSendCmd ( false ) ;
2004-08-23 00:15:46 +00:00
// fetch results from server
CL_ReadPackets ( ) ;
2018-03-04 14:41:16 +00:00
CL_RequestNextDownload ( ) ;
2004-08-23 00:15:46 +00:00
// send intentions now
// resend a connection request if necessary
if ( cls . state = = ca_disconnected )
{
2014-05-10 13:42:13 +00:00
CL_SendCmd ( host_frametime , true ) ;
// IN_Move(NULL, 0, time);
2004-08-23 00:15:46 +00:00
CL_CheckForResend ( ) ;
2013-06-23 02:17:02 +00:00
# ifdef VOICECHAT
S_Voip_Transmit ( 0 , NULL ) ;
# endif
2004-08-23 00:15:46 +00:00
}
else
{
2014-03-30 08:55:06 +00:00
if ( connectinfo . trying )
CL_CheckForResend ( ) ;
2009-11-04 21:16:50 +00:00
CL_SendCmd ( cl . gamespeed ? host_frametime / cl . gamespeed : host_frametime , true ) ;
2004-08-23 00:15:46 +00:00
2005-02-12 18:56:04 +00:00
if ( cls . state = = ca_onserver & & cl . validsequence & & cl . worldmodel )
{ // first update is the final signon stage
2013-10-29 17:38:22 +00:00
if ( cls . protocol = = CP_NETQUAKE )
{
//nq can send 'frames' without any entities before we're on the server, leading to short periods where the local player's position is not known. this is bad. so be more cautious with nq. this might break csqc.
CL_TransitionEntities ( ) ;
2017-08-14 16:38:44 +00:00
if ( cl . currentpackentities - > num_entities | | cl . currentpackentities - > servertime
2016-10-22 07:06:51 +00:00
# ifdef CSQC_DAT
| | ( cls . fteprotocolextensions & PEXT_CSQC )
# endif
)
2013-10-29 17:38:22 +00:00
CL_MakeActive ( " Quake " ) ;
}
else
CL_MakeActive ( " QuakeWorld " ) ;
2004-08-23 00:15:46 +00:00
}
}
2009-05-24 10:11:17 +00:00
CL_AllowIndependantSendCmd ( true ) ;
2004-08-23 00:15:46 +00:00
2005-04-16 16:21:27 +00:00
RSpeedEnd ( RSPEED_PROTOCOL ) ;
2004-12-15 19:54:09 +00:00
2013-10-08 14:28:11 +00:00
if ( host_speeds . ival )
time0 = Sys_DoubleTime ( ) ;
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
# ifndef CLIENTONLY
if ( sv . state )
{
float ohft = host_frametime ;
RSpeedRemark ( ) ;
SV_Frame ( ) ;
RSpeedEnd ( RSPEED_SERVER ) ;
host_frametime = ohft ;
------------------------------------------------------------------------
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
// if (cls.protocol != CP_QUAKE3 && cls.protocol != CP_QUAKE2)
// CL_ReadPackets (); //q3's cgame cannot cope with input commands with the same time as the most recent snapshot value
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
}
# endif
CL_CalcClientTime ( ) ;
2004-08-23 00:15:46 +00:00
// update video
2009-11-04 21:16:50 +00:00
if ( host_speeds . ival )
2004-08-23 00:15:46 +00:00
time1 = Sys_DoubleTime ( ) ;
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
for ( i = 0 ; i < MAX_SPLITS ; i + + )
{
cl . playerview [ i ] . audio . defaulted = true ;
2016-07-12 00:40:13 +00:00
cl . playerview [ i ] . audio . entnum = cl . playerview [ i ] . viewentity ;
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
VectorClear ( cl . playerview [ i ] . audio . origin ) ;
VectorSet ( cl . playerview [ i ] . audio . forward , 1 , 0 , 0 ) ;
VectorSet ( cl . playerview [ i ] . audio . right , 0 , 1 , 0 ) ;
VectorSet ( cl . playerview [ i ] . audio . up , 0 , 0 , 1 ) ;
2016-07-12 00:40:13 +00:00
cl . playerview [ i ] . audio . reverbtype = 0 ;
VectorClear ( cl . playerview [ i ] . audio . velocity ) ;
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
}
2013-10-29 17:38:22 +00:00
2019-01-13 16:51:50 +00:00
if ( R2D_Flush )
{
R2D_Flush ( ) ;
Con_Printf ( " R2D_Flush was set outside of SCR_UpdateScreen \n " ) ;
}
2013-07-13 12:14:32 +00:00
if ( SCR_UpdateScreen & & ! vid . isminimized )
2004-08-23 00:15:46 +00:00
{
2018-03-25 09:36:14 +00:00
extern cvar_t r_stereo_method ;
2019-01-13 16:51:50 +00:00
r_refdef . warndraw = false ;
2016-02-10 23:23:43 +00:00
r_refdef . stereomethod = r_stereo_method . ival ;
2016-12-19 13:31:05 +00:00
# ifdef FTE_TARGET_WEB
if ( emscriptenfte_getvrframedata ( ) )
r_refdef . stereomethod = STEREO_WEBVR ;
# endif
2016-02-10 23:23:43 +00:00
CL_UpdateHeadAngles ( ) ;
2016-07-12 00:40:13 +00:00
{
RSpeedMark ( ) ;
2018-11-27 16:48:19 +00:00
vid . ime_allow = false ;
2016-07-12 00:40:13 +00:00
if ( SCR_UpdateScreen ( ) )
fps_count + + ;
if ( R2D_Flush )
Sys_Error ( " update didn't flush 2d cache \n " ) ;
RSpeedEnd ( RSPEED_TOTALREFRESH ) ;
}
2019-01-13 16:51:50 +00:00
r_refdef . warndraw = true ;
2004-08-23 00:15:46 +00:00
}
2016-07-12 00:40:13 +00:00
else
fps_count + + ;
2004-08-23 00:15:46 +00:00
2009-11-04 21:16:50 +00:00
if ( host_speeds . ival )
2004-08-23 00:15:46 +00:00
time2 = Sys_DoubleTime ( ) ;
2005-06-15 04:45:26 +00:00
2004-08-23 00:15:46 +00:00
// update audio
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
for ( i = 0 ; i < MAX_SPLITS ; i + + )
{
playerview_t * pv = & cl . playerview [ cl . splitclients ? i % cl . splitclients : 0 ] ;
2016-07-12 00:40:13 +00:00
S_UpdateListener ( i , pv - > audio . entnum , pv - > audio . origin , pv - > audio . forward , pv - > audio . right , pv - > audio . up , pv - > audio . reverbtype , pv - > audio . velocity ) ;
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
}
2009-04-06 00:34:32 +00:00
2013-10-29 17:38:22 +00:00
S_Update ( ) ;
2004-08-23 00:15:46 +00:00
CDAudio_Update ( ) ;
2009-11-04 21:16:50 +00:00
if ( host_speeds . ival )
2004-08-23 00:15:46 +00:00
{
2013-10-08 14:28:11 +00:00
pass0 = ( time0 - time3 ) * 1000000 ;
2004-08-23 00:15:46 +00:00
time3 = Sys_DoubleTime ( ) ;
2013-10-08 14:28:11 +00:00
pass1 = ( time1 - time0 ) * 1000000 ;
pass2 = ( time2 - time1 ) * 1000000 ;
pass3 = ( time3 - time2 ) * 1000000 ;
Con_Printf ( " %4i tot %4i idle %4i server %4i gfx %4i snd \n " ,
pass0 + pass1 + pass2 + pass3 , pass0 , pass1 , pass2 , pass3 ) ;
2004-08-23 00:15:46 +00:00
}
2018-03-04 14:41:16 +00:00
// IN_Commands ();
2004-08-23 00:15:46 +00:00
// process console commands
2018-03-04 14:41:16 +00:00
// Cbuf_Execute ();
2006-09-17 00:59:22 +00:00
CL_QTVPoll ( ) ;
2008-11-09 22:29:28 +00:00
TP_UpdateAutoStatus ( ) ;
2010-11-22 02:03:28 +00:00
2012-04-24 12:22:50 +00:00
host_framecount + + ;
2018-05-28 10:12:10 +00:00
cl . lasttime = cl . time ;
2010-11-22 02:03:28 +00:00
return 0 ;
2004-08-23 00:15:46 +00:00
}
static void simple_crypt ( char * buf , int len )
{
2009-04-01 22:03:56 +00:00
if ( ! ( * buf & 128 ) )
return ;
2004-08-23 00:15:46 +00:00
while ( len - - )
* buf + + ^ = 0xff ;
}
void Host_FixupModelNames ( void )
{
simple_crypt ( emodel_name , sizeof ( emodel_name ) - 1 ) ;
simple_crypt ( pmodel_name , sizeof ( pmodel_name ) - 1 ) ;
simple_crypt ( prespawn_name , sizeof ( prespawn_name ) - 1 ) ;
simple_crypt ( modellist_name , sizeof ( modellist_name ) - 1 ) ;
simple_crypt ( soundlist_name , sizeof ( soundlist_name ) - 1 ) ;
}
2005-11-30 01:20:53 +00:00
# ifdef Q3CLIENT
void CL_ReadCDKey ( void )
{ //q3 cdkey
//you don't need one, just use a server without sv_strictauth set to 0.
char * buffer ;
2018-07-05 16:21:44 +00:00
buffer = COM_LoadTempFile ( " q3key " , FSLF_IGNOREPURE , NULL ) ;
2005-11-30 01:20:53 +00:00
if ( buffer ) //a cdkey is meant to be 16 chars
{
char * chr ;
for ( chr = buffer ; * chr ; chr + + )
{
if ( * ( unsigned char * ) chr < ' ' )
{
* chr = ' \0 ' ; //don't get more than one line.
break ;
}
}
2013-05-11 05:03:07 +00:00
Cvar_Get ( " cl_cdkey " , buffer , CVAR_LATCH | CVAR_NOUNSAFEEXPAND , " Q3 compatability " ) ;
2005-11-30 01:20:53 +00:00
}
}
# endif
2004-08-23 00:15:46 +00:00
//============================================================================
2012-11-27 03:23:19 +00:00
void CL_StartCinematicOrMenu ( void )
{
2014-12-29 02:35:10 +00:00
COM_MainThreadWork ( ) ;
2017-01-24 10:27:39 +00:00
if ( com_installer & & FS_DownloadingPackage ( ) )
2015-04-14 23:12:17 +00:00
{
startuppending = true ;
return ;
}
2014-08-27 08:41:31 +00:00
if ( cls . download )
{
startuppending = true ;
return ;
}
if ( startuppending )
{
2016-02-10 23:23:43 +00:00
if ( startuppending = = 2 ) //installer finished.
2015-04-14 23:12:17 +00:00
Cbuf_AddText ( " \n fs_restart \n vid_restart \n " , RESTRICT_LOCAL ) ;
2014-08-27 08:41:31 +00:00
startuppending = false ;
Key_Dest_Remove ( kdm_console ) ; //make sure console doesn't stay up weirdly.
}
2012-11-27 03:23:19 +00:00
//start up the ui now we have a renderer
# ifdef VM_UI
UI_Start ( ) ;
# endif
2015-04-14 23:12:17 +00:00
Cbuf_AddText ( " menu_restart \n " , RESTRICT_LOCAL ) ;
Con_TPrintf ( " ^Ue080^Ue081^Ue081^Ue081^Ue081^Ue081^Ue081 %s %sInitialized ^Ue081^Ue081^Ue081^Ue081^Ue081^Ue081^Ue082 \n " , * fs_gamename . string ? fs_gamename . string : " Nothing " , com_installer ? " Installer " : " " ) ;
2012-11-27 03:23:19 +00:00
//there might be some console command or somesuch waiting for the renderer to begin (demos or map command or whatever all need model support).
realtime + = 1 ;
Cbuf_Execute ( ) ; //server may have been waiting for the renderer
2014-12-23 15:26:42 +00:00
Con_ClearNotify ( ) ;
2015-04-14 23:12:17 +00:00
if ( com_installer )
{
com_installer = false ;
#if 0
Key_Dest_Remove ( kdm_console ) ; //make sure console doesn't stay up weirdly.
M_Menu_Installer ( ) ;
return ;
# endif
}
2019-09-04 07:59:40 +00:00
if ( ! sv_state & & ! cls . demoinfile & & ! cls . state & & ! * cls . servername )
2018-10-23 07:09:06 +00:00
{
TP_ExecTrigger ( " f_startup " , true ) ;
Cbuf_Execute ( ) ;
}
2012-11-27 03:23:19 +00:00
//and any startup cinematics
2017-02-21 20:22:07 +00:00
# ifdef HAVE_MEDIA_DECODER
2019-09-04 07:59:40 +00:00
if ( ! sv_state & & ! cls . demoinfile & & ! cls . state & & ! * cls . servername )
2012-11-27 03:23:19 +00:00
{
int ol_depth ;
int idcin_depth ;
int idroq_depth ;
idcin_depth = COM_FDepthFile ( " video/idlog.cin " , true ) ; //q2
2014-03-30 08:55:06 +00:00
idroq_depth = COM_FDepthFile ( " video/idlogo.roq " , true ) ; //q3
2012-11-27 03:23:19 +00:00
ol_depth = COM_FDepthFile ( " video/openinglogos.roq " , true ) ; //jk2
2017-11-23 07:46:39 +00:00
if ( ol_depth ! = FDEPTH_MISSING & & ( ol_depth < = idroq_depth | | ol_depth < = idcin_depth ) )
2013-05-03 04:28:08 +00:00
Media_PlayFilm ( " video/openinglogos.roq " , true ) ;
2017-11-23 07:46:39 +00:00
else if ( idroq_depth ! = FDEPTH_MISSING & & idroq_depth < = idcin_depth )
2013-05-03 04:28:08 +00:00
Media_PlayFilm ( " video/idlogo.roq " , true ) ;
2017-11-23 07:46:39 +00:00
else if ( idcin_depth ! = FDEPTH_MISSING )
2013-05-03 04:28:08 +00:00
Media_PlayFilm ( " video/idlog.cin " , true ) ;
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2017-02-21 20:22:07 +00:00
//and for fun (blame spirit):
2013-05-03 04:28:08 +00:00
if ( COM_FCheckExists ( " data/local/video/New_Bliz640x480.bik " ) )
Media_PlayFilm ( " av:data/local/video/New_Bliz640x480.bik " , true ) ;
if ( COM_FCheckExists ( " data/local/video/BlizNorth640x480.bik " ) )
Media_PlayFilm ( " av:data/local/video/BlizNorth640x480.bik " , true ) ;
if ( COM_FCheckExists ( " data/local/video/eng/d2intro640x292.bik " ) )
Media_PlayFilm ( " av:data/local/video/eng/d2intro640x292.bik " , true ) ;
if ( COM_FCheckExists ( " Data/Local/Video/ENG/D2x_Intro_640x292.bik " ) )
Media_PlayFilm ( " av:Data/Local/Video/ENG/D2x_Intro_640x292.bik " , true ) ;
2015-09-07 14:34:39 +00:00
# endif
2012-11-27 03:23:19 +00:00
}
# endif
2019-09-04 07:59:40 +00:00
if ( ! sv_state & & ! cls . demoinfile & & ! cls . state & & ! * cls . servername )
2012-11-27 03:23:19 +00:00
{
2019-09-04 07:59:40 +00:00
if ( qrenderer > QR_NONE & & ! Key_Dest_Has ( kdm_menu ) )
2012-11-27 03:23:19 +00:00
{
2014-09-08 23:47:19 +00:00
# ifndef NOBUILTINMENUS
2019-09-04 07:59:40 +00:00
if ( ! cls . state & & ! Key_Dest_Has ( kdm_menu ) & & ! * FS_GetGamedir ( false ) )
2018-10-23 07:09:06 +00:00
M_Menu_Mods_f ( ) ;
2014-09-02 02:44:43 +00:00
# endif
2019-09-04 07:59:40 +00:00
if ( ! cls . state & & ! Key_Dest_Has ( kdm_menu ) & & cl_demoreel . ival )
2018-10-23 07:09:06 +00:00
{
cls . demonum = 0 ;
CL_NextDemo ( ) ;
2014-08-15 02:20:41 +00:00
}
2019-09-04 07:59:40 +00:00
if ( ! cls . state & & ! Key_Dest_Has ( kdm_menu ) )
2018-10-23 07:09:06 +00:00
//if we're (now) meant to be using csqc for menus, make sure that its running.
if ( ! CSQC_UnconnectedInit ( ) )
M_ToggleMenu_f ( ) ;
2012-11-27 03:23:19 +00:00
}
2018-10-23 07:09:06 +00:00
//Con_ForceActiveNow();
2012-11-27 03:23:19 +00:00
}
}
2013-06-23 02:17:02 +00:00
void CL_ArgumentOverrides ( void )
{
int i ;
if ( COM_CheckParm ( " -window " ) | | COM_CheckParm ( " -startwindowed " ) )
Cvar_Set ( Cvar_FindVar ( " vid_fullscreen " ) , " 0 " ) ;
if ( COM_CheckParm ( " -fullscreen " ) )
Cvar_Set ( Cvar_FindVar ( " vid_fullscreen " ) , " 1 " ) ;
if ( ( i = COM_CheckParm ( " -width " ) ) ) //width on it's own also sets height
{
Cvar_Set ( Cvar_FindVar ( " vid_width " ) , com_argv [ i + 1 ] ) ;
Cvar_SetValue ( Cvar_FindVar ( " vid_height " ) , ( atoi ( com_argv [ i + 1 ] ) / 4 ) * 3 ) ;
}
if ( ( i = COM_CheckParm ( " -height " ) ) )
Cvar_Set ( Cvar_FindVar ( " vid_height " ) , com_argv [ i + 1 ] ) ;
if ( ( i = COM_CheckParm ( " -conwidth " ) ) ) //width on it's own also sets height
{
Cvar_Set ( Cvar_FindVar ( " vid_conwidth " ) , com_argv [ i + 1 ] ) ;
Cvar_SetValue ( Cvar_FindVar ( " vid_conheight " ) , ( atoi ( com_argv [ i + 1 ] ) / 4 ) * 3 ) ;
}
if ( ( i = COM_CheckParm ( " -conheight " ) ) )
Cvar_Set ( Cvar_FindVar ( " vid_conheight " ) , com_argv [ i + 1 ] ) ;
if ( ( i = COM_CheckParm ( " -bpp " ) ) )
Cvar_Set ( Cvar_FindVar ( " vid_bpp " ) , com_argv [ i + 1 ] ) ;
if ( COM_CheckParm ( " -current " ) )
Cvar_Set ( Cvar_FindVar ( " vid_desktopsettings " ) , " 1 " ) ;
2013-08-21 07:14:39 +00:00
if ( COM_CheckParm ( " -condebug " ) )
Cvar_Set ( Cvar_FindVar ( " log_enable " ) , " 1 " ) ;
2016-07-12 00:40:13 +00:00
if ( ( i = COM_CheckParm ( " -particles " ) ) )
Cvar_Set ( Cvar_FindVar ( " r_part_maxparticles " ) , com_argv [ i + 1 ] ) ;
2013-06-23 02:17:02 +00:00
}
2012-11-27 03:23:19 +00:00
//note that this does NOT include commandline.
2013-06-23 02:17:02 +00:00
void CL_ExecInitialConfigs ( char * resetcommand )
2012-11-27 03:23:19 +00:00
{
2016-07-15 12:26:24 +00:00
# ifdef QUAKESTATS
int qrc , hrc ;
# endif
int def ;
2012-11-27 03:23:19 +00:00
2014-03-30 08:55:06 +00:00
Cbuf_Execute ( ) ; //make sure any pending console commands are done with. mostly, anyway...
2017-06-22 10:29:06 +00:00
Cbuf_AddText ( " unbindall \n showpic_removeall \n " , RESTRICT_LOCAL ) ;
2014-09-12 13:14:51 +00:00
Cbuf_AddText ( " bind volup \" inc volume 0.1 \" \n " , RESTRICT_LOCAL ) ;
Cbuf_AddText ( " bind voldown \" inc volume -0.1 \" \n " , RESTRICT_LOCAL ) ;
2015-12-12 19:25:15 +00:00
Cbuf_AddText ( " alias restart_ents \" changelevel . . \" \n " , RESTRICT_LOCAL ) ;
2018-10-11 10:31:23 +00:00
Cbuf_AddText ( " alias restart map_restart \n " , RESTRICT_LOCAL ) ;
2015-12-12 19:25:15 +00:00
Cbuf_AddText ( " alias startmap_sp \" map start \" \n " , RESTRICT_LOCAL ) ;
2018-12-06 04:55:35 +00:00
# ifdef QUAKESTATS
Cbuf_AddText ( " alias +attack2 +button3 \n " , RESTRICT_LOCAL ) ;
Cbuf_AddText ( " alias -attack2 -button3 \n " , RESTRICT_LOCAL ) ;
# endif
2014-03-30 08:55:06 +00:00
Cbuf_AddText ( " cl_warncmd 0 \n " , RESTRICT_LOCAL ) ;
2013-10-29 17:38:22 +00:00
Cbuf_AddText ( " cvar_purgedefaults \n " , RESTRICT_LOCAL ) ; //reset cvar defaults to their engine-specified values. the tail end of 'exec default.cfg' will update non-cheat defaults to mod-specified values.
Cbuf_AddText ( " cvarreset * \n " , RESTRICT_LOCAL ) ; //reset all cvars to their current (engine) defaults
2016-08-25 00:12:14 +00:00
# ifndef CLIENTONLY
Cbuf_AddText ( va ( " sv_gamedir \" %s \" \n " , FS_GetGamedir ( true ) ) , RESTRICT_LOCAL ) ;
# endif
2013-08-06 02:19:06 +00:00
Cbuf_AddText ( resetcommand , RESTRICT_LOCAL ) ;
2013-10-29 17:38:22 +00:00
Cbuf_AddText ( " \n " , RESTRICT_LOCAL ) ;
2014-10-05 20:04:11 +00:00
COM_ParsePlusSets ( true ) ;
2013-06-23 02:17:02 +00:00
2016-01-18 05:22:07 +00:00
def = COM_FDepthFile ( " default.cfg " , true ) ; //q2/q3/tc
2015-09-01 04:45:15 +00:00
# ifdef QUAKETC
2015-09-06 03:30:28 +00:00
Cbuf_AddText ( " exec default.cfg \n " , RESTRICT_LOCAL ) ;
2016-01-18 05:22:07 +00:00
if ( COM_FDepthFile ( " config.cfg " , true ) < = def )
2015-09-01 04:45:15 +00:00
Cbuf_AddText ( " exec config.cfg \n " , RESTRICT_LOCAL ) ;
if ( COM_FCheckExists ( " autoexec.cfg " ) )
Cbuf_AddText ( " exec autoexec.cfg \n " , RESTRICT_LOCAL ) ;
# else
2012-11-27 03:23:19 +00:00
//who should we imitate?
qrc = COM_FDepthFile ( " quake.rc " , true ) ; //q1
hrc = COM_FDepthFile ( " hexen.rc " , true ) ; //h2
2017-11-23 07:46:39 +00:00
if ( qrc < = def & & qrc < = hrc & & qrc ! = FDEPTH_MISSING )
2016-01-18 05:22:07 +00:00
{
2012-11-27 03:23:19 +00:00
Cbuf_AddText ( " exec quake.rc \n " , RESTRICT_LOCAL ) ;
2016-01-18 05:22:07 +00:00
def = qrc ;
}
2017-11-23 07:46:39 +00:00
else if ( hrc < = def & & hrc ! = FDEPTH_MISSING )
2016-01-18 05:22:07 +00:00
{
2012-11-27 03:23:19 +00:00
Cbuf_AddText ( " exec hexen.rc \n " , RESTRICT_LOCAL ) ;
2016-01-18 05:22:07 +00:00
def = hrc ;
}
2012-11-27 03:23:19 +00:00
else
{ //they didn't give us an rc file!
2017-11-24 18:40:17 +00:00
// int cfg = COM_FDepthFile ("config.cfg", true);
2016-07-12 00:40:13 +00:00
int q3cfg = COM_FDepthFile ( " q3config.cfg " , true ) ;
2014-09-12 13:14:51 +00:00
// Cbuf_AddText ("bind ` toggleconsole\n", RESTRICT_LOCAL); //in case default.cfg does not exist. :(
2017-11-23 07:46:39 +00:00
if ( def ! = FDEPTH_MISSING )
2016-07-12 00:40:13 +00:00
Cbuf_AddText ( " exec default.cfg \n " , RESTRICT_LOCAL ) ;
2017-11-23 07:46:39 +00:00
if ( q3cfg < = def & & q3cfg ! = FDEPTH_MISSING )
2012-11-27 03:23:19 +00:00
Cbuf_AddText ( " exec q3config.cfg \n " , RESTRICT_LOCAL ) ;
2017-11-23 07:46:39 +00:00
else //if (cfg <= def && cfg!=0x7fffffff)
Cbuf_AddText ( " exec config.cfg \n " , RESTRICT_LOCAL ) ;
// else
// Cbuf_AddText ("exec fte.cfg\n", RESTRICT_LOCAL);
if ( def ! = FDEPTH_MISSING )
2016-07-12 00:40:13 +00:00
Cbuf_AddText ( " exec autoexec.cfg \n " , RESTRICT_LOCAL ) ;
2012-11-27 03:23:19 +00:00
}
2014-10-05 20:04:11 +00:00
# endif
2014-06-02 16:50:40 +00:00
# ifdef QUAKESPYAPI
2012-11-27 03:23:19 +00:00
if ( COM_FCheckExists ( " frontend.cfg " ) )
Cbuf_AddText ( " exec frontend.cfg \n " , RESTRICT_LOCAL ) ;
2014-06-02 16:50:40 +00:00
# endif
2012-11-27 03:23:19 +00:00
Cbuf_AddText ( " cl_warncmd 1 \n " , RESTRICT_LOCAL ) ; //and then it's allowed to start moaning.
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_ParsePlusSets ( true ) ;
2012-11-27 03:23:19 +00:00
2013-05-11 14:02:55 +00:00
com_parseutf8 . ival = com_parseutf8 . value ;
2012-11-27 03:23:19 +00:00
2013-08-06 02:19:06 +00:00
//if the renderer is already up and running, be prepared to reload content to match the new conback/font/etc
if ( qrenderer ! = QR_NONE )
Cbuf_AddText ( " vid_reload \n " , RESTRICT_LOCAL ) ;
2014-04-13 04:23:13 +00:00
// if (Key_Dest_Has(kdm_menu))
// Cbuf_AddText ("closemenu\ntogglemenu\n", RESTRICT_LOCAL); //make sure the menu has the right content loaded.
2013-08-06 02:19:06 +00:00
2012-12-12 22:16:08 +00:00
Cbuf_Execute ( ) ; //if the server initialisation causes a problem, give it a place to abort to
2012-11-27 03:23:19 +00:00
//assuming they didn't use any waits in their config (fools)
//the configs should be fully loaded.
//so convert the backwards compable commandline parameters in cvar sets.
2013-06-23 02:17:02 +00:00
CL_ArgumentOverrides ( ) ;
2016-01-18 05:22:07 +00:00
# ifndef CLIENTONLY
SV_ArgumentOverrides ( ) ;
# endif
2014-03-30 08:55:06 +00:00
//and disable the 'you have unsaved stuff' prompt.
Cvar_Saved ( ) ;
2013-06-23 02:17:02 +00:00
}
2012-11-27 03:23:19 +00:00
2013-06-23 02:17:02 +00:00
void Host_FinishLoading ( void )
{
2017-10-12 12:02:25 +00:00
extern qboolean r_forceheadless ;
2016-07-12 00:40:13 +00:00
extern int r_blockvidrestart ;
2016-02-10 23:23:43 +00:00
if ( r_blockvidrestart = = true )
{
//1 means we need to init the filesystem
2012-11-27 03:23:19 +00:00
2016-02-10 23:23:43 +00:00
//the filesystem has retrieved its manifest, but might still be waiting for paks to finish downloading.
2015-04-14 23:12:17 +00:00
2016-02-10 23:23:43 +00:00
//make sure the filesystem has some default if no manifest was loaded.
FS_ChangeGame ( NULL , true , true ) ;
2012-11-27 03:23:19 +00:00
2016-02-10 23:23:43 +00:00
if ( waitingformanifest )
2019-05-23 15:11:32 +00:00
{
# ifdef MULTITHREAD
Sys_Sleep ( 0.1 ) ;
# endif
2016-02-10 23:23:43 +00:00
return ;
2019-05-23 15:11:32 +00:00
}
2012-11-27 03:23:19 +00:00
2016-02-10 23:23:43 +00:00
Con_History_Load ( ) ;
2012-11-27 03:23:19 +00:00
2016-02-10 23:23:43 +00:00
Cmd_StuffCmds ( ) ;
Cbuf_Execute ( ) ;
2013-06-23 02:17:02 +00:00
2016-02-10 23:23:43 +00:00
CL_ArgumentOverrides ( ) ;
# ifndef CLIENTONLY
SV_ArgumentOverrides ( ) ;
# endif
2013-06-23 02:17:02 +00:00
2016-02-10 23:23:43 +00:00
Con_Printf ( " \n %s \n " , version_string ( ) ) ;
2012-11-27 03:23:19 +00:00
2016-02-10 23:23:43 +00:00
Con_DPrintf ( " 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. "
" \n "
" This program is distributed in the hope that it will be useful, "
" but WITHOUT ANY WARRANTY; without even the implied warranty of "
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
" \n "
" See the GNU General Public License for more details. \n " ) ;
2015-04-14 23:12:17 +00:00
2017-03-26 23:03:02 +00:00
# if defined(_WIN32) && !defined(FTE_SDL) && !defined(_XBOX) && defined(WEBCLIENT)
2016-02-10 23:23:43 +00:00
if ( Sys_RunInstaller ( ) )
Sys_Quit ( ) ;
# endif
2012-11-27 03:23:19 +00:00
2016-02-10 23:23:43 +00:00
r_blockvidrestart = 2 ;
2016-08-25 00:12:14 +00:00
Menu_Download_Update ( ) ;
2017-02-11 17:16:51 +00:00
2018-11-19 06:37:25 +00:00
# ifdef IPLOG
2017-02-11 17:16:51 +00:00
IPLog_Merge_File ( " iplog.txt " ) ;
IPLog_Merge_File ( " iplog.dat " ) ; //legacy crap, for compat with proquake
2018-11-19 06:37:25 +00:00
# endif
2016-02-10 23:23:43 +00:00
}
2017-03-04 19:36:06 +00:00
if ( PM_IsApplying ( true ) )
2019-05-23 15:11:32 +00:00
{
# ifdef MULTITHREAD
Sys_Sleep ( 0.1 ) ;
# endif
2017-03-04 19:36:06 +00:00
return ;
2019-05-23 15:11:32 +00:00
}
2017-03-04 19:36:06 +00:00
2017-10-12 12:02:25 +00:00
//android may find that it has no renderer at various points.
if ( r_forceheadless )
2016-02-10 23:23:43 +00:00
return ;
if ( r_blockvidrestart = = 2 )
{ //2 is part of the initial startup
Renderer_Start ( ) ;
CL_StartCinematicOrMenu ( ) ;
}
else //3 flags for a renderer restart
Renderer_Start ( ) ;
2013-06-23 02:17:02 +00:00
}
2012-11-27 03:23:19 +00:00
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = =
Host_Init
= = = = = = = = = = = = = = = = = = = =
*/
void Host_Init ( quakeparms_t * parms )
{
2018-12-28 00:04:36 +00:00
# ifdef PACKAGEMANAGER
2017-01-24 10:27:39 +00:00
char engineupdated [ MAX_OSPATH ] ;
2018-12-28 00:04:36 +00:00
# endif
2013-06-23 02:17:02 +00:00
int man ;
2012-11-27 03:23:19 +00:00
com_parseutf8 . ival = 1 ; //enable utf8 parsing even before cvars are registered.
2005-01-05 08:01:19 +00:00
2004-08-23 00:15:46 +00:00
COM_InitArgv ( parms - > argc , parms - > argv ) ;
2004-11-23 01:10:10 +00:00
if ( setjmp ( host_abort ) )
Sys_Error ( " Host_Init: An error occured. Try the -condebug commandline parameter \n " ) ;
2004-08-23 00:15:46 +00:00
host_parms = * parms ;
2010-07-11 02:22:39 +00:00
Cvar_Init ( ) ;
2013-07-14 12:22:51 +00:00
Memory_Init ( ) ;
2005-01-07 02:44:12 +00:00
2011-04-30 17:21:10 +00:00
/*memory is working, its safe to printf*/
Con_Init ( ) ;
2007-06-20 00:02:54 +00:00
Sys_Init ( ) ;
2014-10-05 20:04:11 +00:00
COM_ParsePlusSets ( false ) ;
2004-08-23 00:15:46 +00:00
Cbuf_Init ( ) ;
Cmd_Init ( ) ;
2017-01-24 10:27:39 +00:00
COM_Init ( ) ;
2018-12-28 00:04:36 +00:00
# ifdef PACKAGEMANAGER
2017-01-24 10:27:39 +00:00
//we have enough of the filesystem inited now that we can read the package list and figure out which engine was last installed.
if ( PM_FindUpdatedEngine ( engineupdated , sizeof ( engineupdated ) ) )
{
PM_Shutdown ( ) ; //will restart later as needed, but we need to be sure that no files are open or anything.
if ( Sys_EngineWasUpdated ( engineupdated ) )
{
COM_Shutdown ( ) ;
Cmd_Shutdown ( ) ;
Sys_Shutdown ( ) ;
Con_Shutdown ( ) ;
Memory_DeInit ( ) ;
Cvar_Shutdown ( ) ;
Sys_Quit ( ) ;
return ;
}
2018-10-23 07:09:06 +00:00
PM_Shutdown ( ) ; //will restart later as needed, but we need to be sure that no files are open or anything.
2017-01-24 10:27:39 +00:00
}
2018-12-28 00:04:36 +00:00
# endif
2004-08-23 00:15:46 +00:00
V_Init ( ) ;
2013-06-23 02:17:02 +00:00
NET_Init ( ) ;
2017-01-24 10:27:39 +00:00
# ifdef PLUGINS
Plug_Initialise ( false ) ;
# endif
2018-04-08 14:24:50 +00:00
# if defined(Q2BSPS) || defined(Q3BSPS)
2004-08-23 00:15:46 +00:00
CM_Init ( ) ;
------------------------------------------------------------------------
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
# endif
# ifdef TERRAIN
Terr_Init ( ) ;
2004-08-23 00:15:46 +00:00
# endif
Host_FixupModelNames ( ) ;
Netchan_Init ( ) ;
Renderer_Init ( ) ;
2013-10-29 17:38:22 +00:00
Mod_Init ( true ) ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
# if defined(CSQC_DAT) || defined(MENU_DAT)
PF_Common_RegisterCvars ( ) ;
# endif
# ifndef CLIENTONLY
SV_Init ( parms ) ;
# endif
2004-08-23 00:15:46 +00:00
// W_LoadWadFile ("gfx.wad");
Key_Init ( ) ;
2005-06-15 04:45:26 +00:00
M_Init ( ) ;
2004-08-23 00:15:46 +00:00
IN_Init ( ) ;
S_Init ( ) ;
cls . state = ca_disconnected ;
CDAudio_Init ( ) ;
Sbar_Init ( ) ;
CL_Init ( ) ;
2009-07-05 18:45:53 +00:00
2004-08-23 00:15:46 +00:00
# ifdef TEXTEDITOR
Editor_Init ( ) ;
# endif
2005-01-15 17:37:11 +00:00
# ifdef PLUGINS
2013-05-03 04:28:08 +00:00
Plug_Initialise ( true ) ;
2005-01-15 17:37:11 +00:00
# endif
2011-01-30 01:32:30 +00:00
# ifdef VM_UI
UI_Init ( ) ;
# endif
2005-01-15 17:37:11 +00:00
2005-11-03 23:49:49 +00:00
# ifdef CL_MASTER
2005-10-07 16:27:20 +00:00
Master_SetupSockets ( ) ;
2005-11-03 23:49:49 +00:00
# endif
2005-09-08 02:05:36 +00:00
2005-11-30 01:20:53 +00:00
# ifdef Q3CLIENT
CL_ReadCDKey ( ) ;
# endif
2004-08-23 00:15:46 +00:00
// Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
2013-11-29 14:36:47 +00:00
//Con_Printf ("%4.1f megs RAM available.\n", parms->memsize/ (1024*1024.0));
2004-08-23 00:15:46 +00:00
2010-02-06 01:25:04 +00:00
R_SetRenderer ( NULL ) ; //set the renderer stuff to unset...
2009-04-07 01:26:47 +00:00
2016-08-25 00:12:14 +00:00
Cvar_ParseWatches ( ) ;
2009-04-07 01:26:47 +00:00
host_initialized = true ;
2013-03-12 22:40:16 +00:00
forcesaveprompt = false ;
2009-04-07 01:26:47 +00:00
2012-11-27 03:23:19 +00:00
Sys_SendKeyEvents ( ) ;
2005-02-06 02:47:36 +00:00
2013-06-23 02:17:02 +00:00
//the engine is fully running, except the file system may be nulled out waiting for a manifest to download.
2006-04-15 03:31:23 +00:00
2013-06-23 02:17:02 +00:00
man = COM_CheckParm ( " -manifest " ) ;
if ( man & & man < com_argc - 1 & & com_argv [ man + 1 ] )
Host_RunFile ( com_argv [ man + 1 ] , strlen ( com_argv [ man + 1 ] ) , NULL ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = =
Host_Shutdown
FIXME : this is a callback from Sys_Quit and Sys_Error . It would be better
to run quit through here before the final handoff to the sys code .
= = = = = = = = = = = = = = =
*/
void Host_Shutdown ( void )
{
2018-07-05 16:21:44 +00:00
size_t i ;
2009-04-01 22:03:56 +00:00
if ( ! host_initialized )
2004-08-23 00:15:46 +00:00
return ;
2009-04-01 22:03:56 +00:00
host_initialized = false ;
2004-08-23 00:15:46 +00:00
2017-10-31 22:52:58 +00:00
CL_UseIndepPhysics ( false ) ;
2015-06-04 06:22:50 +00:00
# ifdef WEBCLIENT
2015-06-04 06:15:14 +00:00
HTTP_CL_Terminate ( ) ;
2015-06-04 06:22:50 +00:00
# endif
2015-06-04 06:15:14 +00:00
2017-01-13 00:39:50 +00:00
//disconnect server/client/etc
CL_Disconnect_f ( ) ;
M_Shutdown ( true ) ;
2013-08-27 13:18:09 +00:00
# ifdef CSQC_DAT
CSQC_Shutdown ( ) ;
# endif
2005-09-09 23:40:55 +00:00
# ifdef VM_UI
2004-08-23 00:15:46 +00:00
UI_Stop ( ) ;
2005-09-09 23:40:55 +00:00
# endif
2004-08-23 00:15:46 +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
S_Shutdown ( true ) ;
2004-08-23 00:15:46 +00:00
CDAudio_Shutdown ( ) ;
IN_Shutdown ( ) ;
2014-03-30 08:55:06 +00:00
R_ShutdownRenderer ( true ) ;
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
# ifdef PLUGINS
Plug_Shutdown ( false ) ;
# endif
// Host_WriteConfiguration ();
2012-11-27 03:23:19 +00:00
# ifdef CL_MASTER
MasterInfo_Shutdown ( ) ;
# endif
2010-07-12 22:46:37 +00:00
CL_FreeDlights ( ) ;
------------------------------------------------------------------------
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
CL_FreeVisEdicts ( ) ;
2013-10-29 17:38:22 +00:00
Mod_Shutdown ( true ) ;
2015-04-14 23:12:17 +00:00
Wads_Flush ( ) ;
2015-06-14 09:34:55 +00:00
Con_History_Save ( ) ; //do this outside of the console code so that the filesystem is still running at this point but still allowing the filesystem to make console prints (you might not see them, but they should be visible to sys_printf still, for debugging).
2004-11-29 01:21:00 +00:00
# ifndef CLIENTONLY
2004-08-23 00:15:46 +00:00
SV_Shutdown ( ) ;
# else
2017-02-11 16:14:06 +00:00
Log_ShutDown ( ) ;
2004-08-23 00:15:46 +00:00
NET_Shutdown ( ) ;
2015-06-14 09:34:55 +00:00
FS_Shutdown ( ) ;
2004-08-23 00:15:46 +00:00
# endif
2017-07-10 15:40:42 +00:00
# ifdef QUAKEHUD
2014-10-05 20:04:11 +00:00
Stats_Clear ( ) ;
2017-07-10 15:40:42 +00:00
# endif
2013-06-23 02:17:02 +00:00
# ifdef Q3CLIENT
VMQ3_FlushStringHandles ( ) ;
# endif
2014-10-05 20:04:11 +00:00
COM_DestroyWorkerThread ( ) ;
2016-09-08 19:04:35 +00:00
P_ShutdownParticleSystem ( ) ;
2004-08-23 00:15:46 +00:00
Cvar_Shutdown ( ) ;
Validation_FlushFileList ( ) ;
2008-05-09 14:22:37 +00:00
2009-04-01 22:03:56 +00:00
Cmd_Shutdown ( ) ;
2018-12-28 00:04:36 +00:00
# ifdef PACKAGEMANAGER
2016-08-25 00:12:14 +00:00
PM_Shutdown ( ) ;
2018-12-28 00:04:36 +00:00
# endif
2012-07-05 19:42:36 +00:00
Key_Unbindall_f ( ) ;
2013-05-11 14:02:55 +00:00
2013-07-31 00:20:16 +00:00
# ifdef PLUGINS
2013-05-11 14:02:55 +00:00
Plug_Shutdown ( true ) ;
2013-07-31 00:20:16 +00:00
# endif
2013-05-11 14:02:55 +00:00
2018-07-05 16:21:44 +00:00
for ( i = 0 ; i < MAX_SPLITS ; i + + )
InfoBuf_Clear ( & cls . userinfo [ i ] , true ) ;
InfoSync_Clear ( & cls . userinfosync ) ;
2011-04-30 17:21:10 +00:00
Con_Shutdown ( ) ;
2014-08-15 02:20:41 +00:00
COM_BiDi_Shutdown ( ) ;
2008-05-09 14:22:37 +00:00
Memory_DeInit ( ) ;
2009-04-01 22:03:56 +00:00
2009-04-02 22:25:54 +00:00
# ifndef CLIENTONLY
2016-01-18 05:22:07 +00:00
SV_WipeServerState ( ) ;
2009-04-01 22:03:56 +00:00
memset ( & svs , 0 , sizeof ( svs ) ) ;
2009-04-02 22:25:54 +00:00
# endif
2011-04-30 17:21:10 +00:00
Sys_Shutdown ( ) ;
2004-08-23 00:15:46 +00:00
}
2004-11-29 01:21:00 +00:00
# ifdef CLIENTONLY
void SV_EndRedirect ( void )
{
}
2004-12-09 23:31:48 +00:00
# endif