2004-08-23 00:15:46 +00:00
/*
Copyright ( C ) 1996 - 1997 Id Software , Inc .
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
2005-07-03 15:16:20 +00:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE .
2004-08-23 00:15:46 +00:00
See the GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
// sv_user.c -- server code for moving users
2013-03-31 04:21:08 +00:00
# include "quakedef.h"
2014-10-11 19:39:45 +00:00
# include "fs.h"
2004-11-29 01:21:00 +00:00
# ifndef CLIENTONLY
2009-11-04 21:16:50 +00:00
# include "pr_common.h"
2004-11-29 01:21:00 +00:00
2004-08-23 00:15:46 +00:00
# include <ctype.h>
# define Q2EDICT_NUM(i) (q2edict_t*)((char *)ge->edicts+i*ge->edict_size)
# define Q2NUM_FOR_EDICT(ent) (((char *)ent - (char *)ge->edicts) / ge->edict_size)
hull_t * SV_HullForEntity ( edict_t * ent , int hullnum , vec3_t mins , vec3_t maxs , vec3_t offset ) ;
edict_t * sv_player ;
2021-07-06 00:12:12 +00:00
static usercmd_t cmd ;
2004-08-23 00:15:46 +00:00
2018-06-02 08:55:57 +00:00
void QDECL SV_NQPhysicsUpdate ( cvar_t * var , char * oldvalue )
{
2019-07-16 02:59:12 +00:00
if ( ! strcmp ( var - > string , " auto " ) | | ! strcmp ( var - > string , " " ) )
2018-06-02 08:55:57 +00:00
{ //prediction requires nq physics, so use it by default in multiplayer.
2020-10-06 03:17:28 +00:00
if ( progstype < = PROG_QW | | //none or qw use qw physics by default
( ! isDedicated & & sv . allocated_client_slots > 1 ) | | //multiplayer dedicated servers use qw physics for nq mods too. server admins are expected to be able to spend a little more time to configure things properly.
( svprogfuncs & & PR_FindFunction ( svprogfuncs , " SV_RunClientCommand " , PR_ANY ) ) ) //mods that use explicit custom player physics/pred ALWAYS want qw physics (just hope noone forces it off)
2018-06-02 08:55:57 +00:00
var - > ival = 0 ;
2019-07-16 02:59:12 +00:00
else
var - > ival = 1 ;
2018-06-02 08:55:57 +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
extern cvar_t dpcompat_nopreparse ;
2004-08-23 00:15:46 +00:00
# ifdef SERVERONLY
2016-09-08 19:14:29 +00:00
cvar_t cl_rollspeed = CVAR ( " cl_rollspeed " , " 200 " ) ;
cvar_t cl_rollangle = CVAR ( " cl_rollangle " , " 2.0 " ) ;
2004-08-23 00:15:46 +00:00
# else
extern cvar_t cl_rollspeed ;
extern cvar_t cl_rollangle ;
# endif
2016-09-08 19:04:35 +00:00
cvar_t sv_spectalk = CVAR ( " sv_spectalk " , " 1 " ) ;
2004-08-23 00:15:46 +00:00
2020-04-30 14:33:58 +00:00
# define nqcompat_spawnbeforeready 1
2016-09-08 19:04:35 +00:00
cvar_t sv_mapcheck = CVAR ( " sv_mapcheck " , " 1 " ) ;
2004-08-23 00:15:46 +00:00
2011-09-06 20:53:38 +00:00
cvar_t sv_fullredirect = CVARD ( " sv_fullredirect " , " " , " This is the ip:port to redirect players to when the server is full " ) ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
cvar_t sv_antilag = CVARFD ( " sv_antilag " , " " , CVAR_SERVERINFO , " Attempt to backdate impacts to compensate for lag via the MOVE_ANTILAG feature. \n 0=completely off. \n 1=mod-controlled (default). \n 2=forced, which might break certain uses of traceline. \n 3=Also attempt to recalculate trace start positions to avoid lagged knockbacks. " ) ;
2015-10-11 11:34:58 +00:00
cvar_t sv_antilag_frac = CVARF ( " sv_antilag_frac " , " " , CVAR_SERVERINFO ) ;
2021-04-14 05:21:04 +00:00
cvar_t sv_showpredloss = CVARD ( " sv_showpredloss " , " 0 " , " Print messages whenever input frames are ignored or forced serverside, to prevent speedcheats or hover cheats. Any such prints will be accompanied by prediction misses in the named client. " ) ;
2015-01-21 18:18:37 +00:00
# ifndef NEWSPEEDCHEATPROT
2015-01-07 13:34:05 +00:00
cvar_t sv_cheatpc = CVARD ( " sv_cheatpc " , " 125 " , " If the client tried to claim more than this percentage of time within any speed-cheat period, the client will be deemed to have cheated. " ) ;
cvar_t sv_cheatspeedchecktime = CVARD ( " sv_cheatspeedchecktime " , " 30 " , " The interval between each speed-cheat check. " ) ;
2015-01-21 18:18:37 +00:00
# endif
2011-10-27 16:16:29 +00:00
cvar_t sv_playermodelchecks = CVAR ( " sv_playermodelchecks " , " 0 " ) ;
2012-02-12 05:18:31 +00:00
cvar_t sv_ping_ignorepl = CVARD ( " sv_ping_ignorepl " , " 0 " , " If 1, ping times reported for players will ignore the effects of packetloss on ping times. 0 is slightly more honest, but less useful for connection diagnosis. " ) ;
2020-10-06 03:17:28 +00:00
cvar_t sv_protocol_nq = CVARD ( " sv_protocol_nq " , " " , " Specifies the default protocol to use for new NQ clients. This is only relevent for clients that do not report their supported protocols. Supported values are \n 0 = autodetect \n 15 = vanilla \n 666 = fitzquake \n 999 = rmq protocol \n The sv_bigcoords cvar forces upgrades as required. " ) ;
2004-08-23 00:15:46 +00:00
2015-10-11 11:34:58 +00:00
cvar_t sv_minpitch = CVARAFD ( " minpitch " , " " , " sv_minpitch " , CVAR_SERVERINFO , " Assumed to be -70 " ) ;
cvar_t sv_maxpitch = CVARAFD ( " maxpitch " , " " , " sv_maxpitch " , CVAR_SERVERINFO , " Assumed to be 80 " ) ;
2016-09-08 19:04:35 +00:00
cvar_t sv_cmdlikercon = CVAR ( " sv_cmdlikercon " , " 0 " ) ; //set to 1 to allow a password of username:password instead of the correct rcon password.
cvar_t cmd_allowaccess = CVAR ( " cmd_allowaccess " , " 0 " ) ; //set to 1 to allow cmd to execute console commands on the server.
2019-08-01 02:13:44 +00:00
cvar_t cmd_gamecodelevel = CVARF ( " cmd_gamecodelevel " , STRINGIFY ( RESTRICT_LOCAL ) , CVAR_NOTFROMSERVER ) ; //execution level which gamecode is told about (for unrecognised commands)
2004-08-23 00:15:46 +00:00
2013-07-13 12:14:32 +00:00
cvar_t sv_pure = CVARFD ( " sv_pure " , " " , CVAR_SERVERINFO , " The most evil cvar in the world, many clients will ignore this. \n 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 only works in total conversions. " ) ;
2021-04-14 06:10:37 +00:00
cvar_t sv_nqplayerphysics = CVARAFCD ( " sv_nqplayerphysics " , " auto " , " sv_nomsec " , CVAR_ARCHIVE , SV_NQPhysicsUpdate , " Disable player prediction and run NQ-style player physics instead. This can be used for compatibility with mods that expect exact behaviour. " ) ;
2004-08-23 00:15:46 +00:00
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2019-08-01 02:13:44 +00:00
static cvar_t sv_brokenmovetypes = CVARD ( " sv_brokenmovetypes " , " 0 " , " Emulate vanilla quakeworld by forcing MOVETYPE_WALK on all players. Shouldn't be used for any games other than QuakeWorld. " ) ;
2019-10-30 14:03:59 +00:00
cvar_t pext_ezquake_nochunks = CVARD ( " pext_ezquake_nochunks " , " 0 " , " Prevents ezquake clients from being able to use the chunked download extension. This sidesteps numerous ezquake issues, and will make downloads slower but more robust. " ) ;
2021-06-21 13:46:44 +00:00
cvar_t pext_ezquake_verfortrans = CVARD ( " pext_ezquake_verfortrans " , " 7088 " /*Reki's revision at least*/ , " ezQuake does not implement PEXT_TRANS properly. This is the version of ezquake required for PEXT_TRANS to be allowed. This was still broken when I wrote this description, hence the large value. " ) ;
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
# endif
2004-08-23 00:15:46 +00:00
2010-07-11 02:22:39 +00:00
cvar_t sv_chatfilter = CVAR ( " sv_chatfilter " , " 0 " ) ;
2004-08-23 00:15:46 +00:00
2010-07-11 02:22:39 +00:00
cvar_t sv_floodprotect = CVAR ( " sv_floodprotect " , " 1 " ) ;
cvar_t sv_floodprotect_messages = CVAR ( " sv_floodprotect_messages " , " 4 " ) ;
cvar_t sv_floodprotect_interval = CVAR ( " sv_floodprotect_interval " , " 4 " ) ;
cvar_t sv_floodprotect_silencetime = CVAR ( " sv_floodprotect_silencetime " , " 10 " ) ;
cvar_t sv_floodprotect_suicide = CVAR ( " sv_floodprotect_suicide " , " 1 " ) ;
cvar_t sv_floodprotect_sendmessage = CVARAF ( " sv_floodprotect_sendmessage " , " " ,
" floodprotmsg " , 0 ) ;
2006-05-29 05:35:07 +00:00
2015-12-28 17:41:39 +00:00
cvar_t votelevel = CVARD ( " votelevel " , " 0 " , " This is the restriction level of commands that players may vote for. You can reconfigure commands, cvars, or aliases individually. Additionally, aliases can be configured via aliaslevel to be executed at a different level from their restriction level. This can be used to indirectly allow voting for 'map dm4' for instance, without allowing people to vote for every map. " ) ;
cvar_t voteminimum = CVARD ( " voteminimum " , " 4 " , " At least this many players must vote the same way for the vote to pass. " ) ;
cvar_t votepercent = CVARD ( " votepercent " , " -1 " , " At least this percentage of players must vote the same way for the vote to pass. " ) ;
cvar_t votetime = CVARD ( " votetime " , " 10 " , " Votes will be discarded after this many minutes " ) ;
2004-08-23 00:15:46 +00:00
2021-04-14 05:21:04 +00:00
cvar_t pr_allowbutton1 = CVARFD ( " pr_allowbutton1 " , " 1 " , CVAR_MAPLATCH , " The button1 field is believed to have been intended to work with the +use command, but it was never hooked up. In NetQuake, this field was often repurposed for other things as it was not otherwise used (and cannot be removed without breaking the crc), while third-party QuakeWorld engines did decide to implement it as believed was intended. As a result, this cvar only applies to QuakeWorld mods and a value of 1 is only likely to cause issues with NQ mods that were ported to QW. " ) ;
2007-08-30 20:45:01 +00:00
extern cvar_t sv_minping ;
2004-08-23 00:15:46 +00:00
2004-08-31 23:58:18 +00:00
2004-08-23 00:15:46 +00:00
extern cvar_t pm_bunnyspeedcap ;
extern cvar_t pm_ktjump ;
extern cvar_t pm_slidefix ;
2005-05-17 02:36:54 +00:00
extern cvar_t pm_slidyslopes ;
2021-05-09 13:00:30 +00:00
extern cvar_t pm_autobunny ;
2004-08-23 00:15:46 +00:00
extern cvar_t pm_airstep ;
2019-03-01 22:39:30 +00:00
extern cvar_t pm_pground ;
2018-01-22 19:18:04 +00:00
extern cvar_t pm_stepdown ;
2005-01-04 08:04:42 +00:00
extern cvar_t pm_walljump ;
2014-04-06 15:16:39 +00:00
extern cvar_t pm_watersinkspeed ;
2014-06-21 17:58:17 +00:00
extern cvar_t pm_flyfriction ;
2018-12-11 00:20:59 +00:00
extern cvar_t pm_edgefriction ;
2016-09-08 19:04:35 +00:00
cvar_t sv_pushplayers = CVAR ( " sv_pushplayers " , " 0 " ) ;
2004-08-23 00:15:46 +00:00
2008-05-25 22:23:43 +00:00
//yes, realip cvars need to be fully initialised or realip will be disabled
2017-12-28 16:24:50 +00:00
cvar_t sv_getrealip = CVARD ( " sv_getrealip " , " 0 " , " Attempt to obtain a more reliable IP for clients, rather than just their proxy. \n 0: Don't attempt. \n 1: Unreliable checks. \n 2: Validate if possible. \n 3: Mandatory validation. " ) ;
cvar_t sv_realip_kick = CVARD ( " sv_realip_kick " , " 0 " , " Kicks clients if their realip could not be validated to the level specified by sv_getrealip. " ) ;
2011-09-03 03:49:43 +00:00
cvar_t sv_realiphostname_ipv4 = CVARD ( " sv_realiphostname_ipv4 " , " " , " This is the server's public ip:port. This is needed for realip to work when the autodetected/local ip is not globally routable " ) ;
cvar_t sv_realiphostname_ipv6 = CVARD ( " sv_realiphostname_ipv6 " , " " , " This is the server's public ip:port. This is needed for realip to work when the autodetected/local ip is not globally routable " ) ;
2016-09-08 19:04:35 +00:00
cvar_t sv_realip_timeout = CVAR ( " sv_realip_timeout " , " 10 " ) ;
2008-05-25 22:23:43 +00:00
2018-07-05 16:21:44 +00:00
cvar_t sv_userinfo_keylimit = CVARD ( " sv_userinfo_keylimit " , " 128 " , " This is the maximum number of userinfo keys each user may create. " ) ;
cvar_t sv_userinfo_bytelimit = CVARD ( " sv_userinfo_bytelimit " , " 8192 " , " This is the maximum number of bytes that may be stored into each user's userinfo. Note that this includes key names too. " ) ;
2010-11-15 03:37:29 +00:00
# ifdef VOICECHAT
2010-11-16 02:03:47 +00:00
cvar_t sv_voip = CVARD ( " sv_voip " , " 1 " , " Enable reception of voice packets. " ) ;
2010-12-18 17:02:47 +00:00
cvar_t sv_voip_record = CVARD ( " sv_voip_record " , " 0 " , " Record voicechat into mvds. Requires player support. 0=noone, 1=everyone, 2=spectators only " ) ;
2010-11-16 02:03:47 +00:00
cvar_t sv_voip_echo = CVARD ( " sv_voip_echo " , " 0 " , " Echo voice packets back to their sender, a debug/test setting. " ) ;
2010-11-15 03:37:29 +00:00
# endif
2004-08-23 00:15:46 +00:00
char sv_votinggroup [ ] = " server voting " ;
extern char cvargroup_serverpermissions [ ] ;
extern char cvargroup_serverinfo [ ] ;
extern char cvargroup_serverphysics [ ] ;
extern char cvargroup_servercontrol [ ] ;
extern cvar_t pausable ;
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
USER STRINGCMD EXECUTION
host_client and sv_player will be valid .
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
2008-05-25 22:23:43 +00:00
qboolean SV_CheckRealIP ( client_t * client , qboolean force )
2006-09-17 00:59:22 +00:00
{
//returns true if they have a real ip
char * serverip ;
char * msg ;
2008-05-30 21:38:02 +00:00
if ( sv_getrealip . value < = client - > realip_status | | sv_getrealip . value > 3 )
2006-09-17 00:59:22 +00:00
return true ;
if ( client - > netchan . remote_address . type = = NA_LOOPBACK )
return true ; //the loopback client doesn't have to pass realip checks
if ( client - > realip_status = = 3 )
return true ; //we know that the ip is authentic
if ( client - > realip_status = = 2 )
{
2022-01-16 18:41:44 +00:00
SV_PrintToClient ( client , PRINT_HIGH , " Couldn't verify your real ip \n " ) ;
2006-09-17 00:59:22 +00:00
return true ; //client doesn't support certainty.
}
if ( client - > realip_status = = - 1 )
2008-05-27 18:59:07 +00:00
return true ; //this client timed out.
2006-09-17 00:59:22 +00:00
2008-05-27 18:59:07 +00:00
if ( realtime - client - > connection_started > sv_realip_timeout . value )
2006-09-17 00:59:22 +00:00
{
2008-05-27 18:59:07 +00:00
if ( client - > realip_status > 0 )
2022-01-16 18:41:44 +00:00
SV_PrintToClient ( client , PRINT_HIGH , " Couldn't verify your real ip \n " ) ;
2008-05-27 18:59:07 +00:00
else
2022-01-16 18:41:44 +00:00
SV_PrintToClient ( client , PRINT_HIGH , " Couldn't determine your real ip \n " ) ;
2008-05-27 18:59:07 +00:00
if ( sv_realip_kick . value > host_client - > realip_status )
2008-05-25 22:23:43 +00:00
{
2013-03-31 01:50:34 +00:00
client - > drop = true ;
2008-05-25 22:23:43 +00:00
return false ;
}
2008-05-27 20:08:21 +00:00
if ( ! client - > realip_status )
client - > realip_status = - 1 ;
2006-09-17 00:59:22 +00:00
return true ;
}
if ( client - > realip_status = = 1 )
{
msg = va ( " \xff \xff \xff \xff %c %i " , A2A_PING , client - > realip_ping ) ;
2018-12-28 00:04:36 +00:00
NET_SendPacket ( svs . sockets , strlen ( msg ) , msg , & client - > realip ) ;
2006-09-17 00:59:22 +00:00
}
else
{
2008-05-25 22:23:43 +00:00
if ( client - > netchan . remote_address . type = = NA_IPV6 )
{
serverip = sv_realiphostname_ipv6 . string ;
// serverip = NET_AdrToString (net_local_sv_ip6adr);
}
else
{
serverip = sv_realiphostname_ipv4 . string ;
// serverip = NET_AdrToString (net_local_sv_ipadr);
}
if ( ! * serverip )
{
Con_Printf ( " realip not fully configured \n " ) ;
2008-05-27 18:59:07 +00:00
client - > realip_status = - 1 ;
2008-05-25 22:23:43 +00:00
return true ;
}
2006-09-17 00:59:22 +00:00
2008-05-25 22:23:43 +00:00
ClientReliableWrite_Begin ( client , svc_stufftext , 256 ) ;
2010-07-11 10:53:13 +00:00
ClientReliableWrite_String ( client , va ( " packet %s \" realip %i %i \" \n " , serverip , ( int ) ( client - svs . clients ) , client - > realip_num ) ) ;
2006-09-17 00:59:22 +00:00
}
return false ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = =
SV_New_f
Sends the first message from the server to a connected client .
This will be sent on the initial connection and upon each server load .
= = = = = = = = = = = = = = = =
*/
void SV_New_f ( void )
{
char * gamedir ;
int playernum ;
2004-12-08 04:14:52 +00:00
int splitnum ;
2004-08-23 00:15:46 +00:00
client_t * split ;
2021-08-04 21:16:57 +00:00
unsigned int fteext1 , fteext2 , ezext1 ; //reported to client
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
host_client - > prespawn_stage = PRESPAWN_INVALID ;
host_client - > prespawn_idx = 0 ;
2016-07-12 00:40:13 +00:00
host_client - > isindependant = false ;
2004-08-23 00:15:46 +00:00
if ( host_client - > state = = cs_spawned )
return ;
2005-05-26 12:55:34 +00:00
2011-09-06 20:53:38 +00:00
if ( host_client - > redirect )
{
2014-03-30 08:55:06 +00:00
if ( host_client - > redirect = = 1 )
{
char * msg = va ( " connect \" %s \" \n " , sv_fullredirect . string ) ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( msg ) ) ;
ClientReliableWrite_String ( host_client , msg ) ;
}
2011-09-06 20:53:38 +00:00
return ;
}
2014-03-30 08:55:06 +00:00
else
{
2018-07-05 16:21:44 +00:00
const char * srv = InfoBuf_ValueForKey ( & host_client - > userinfo , " *redirect " ) ;
2014-03-30 08:55:06 +00:00
if ( * srv )
{
char * msg = va ( " connect \" %s \" \n " , srv ) ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( msg ) ) ;
ClientReliableWrite_String ( host_client , msg ) ;
return ;
}
}
2011-09-06 20:53:38 +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
if ( dpcompat_nopreparse . ival & & progstype ! = PROG_QW )
{
2020-09-08 05:11:09 +00:00
SV_PrintToClient ( host_client , PRINT_HIGH , " This server has network preparsing disabled, and thus only supports NetQuake clients \n " ) ;
2015-08-04 15:16:24 +00:00
Con_Printf ( " %s was not using NQ protocols \n " , host_client - > name ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
host_client - > drop = true ;
return ;
}
2019-03-23 07:06:37 +00:00
if ( ! host_client - > pextknown & & host_client - > zquake_extensions & & host_client - > netchan . remote_address . type ! = NA_LOOPBACK )
{
char * msg = " cmd pext \n " ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( msg ) ) ;
ClientReliableWrite_String ( host_client , msg ) ;
return ;
}
host_client - > pextknown = true ;
2004-08-23 00:15:46 +00:00
2018-07-05 16:21:44 +00:00
gamedir = InfoBuf_ValueForKey ( & svs . info , " *gamedir " ) ;
2014-03-30 08:55:06 +00:00
if ( ! gamedir [ 0 ] )
2011-04-20 23:34:13 +00:00
{
2015-03-03 00:14:43 +00:00
if ( ISQWCLIENT ( host_client ) | | ISQ2CLIENT ( host_client ) )
2014-03-30 08:55:06 +00:00
gamedir = FS_GetGamedir ( true ) ;
2011-04-20 23:34:13 +00:00
else
gamedir = " " ;
}
2004-08-23 00:15:46 +00:00
2019-10-14 02:36:57 +00:00
fteext1 = host_client - > fteprotocolextensions ;
2020-02-11 18:06:10 +00:00
fteext2 = host_client - > fteprotocolextensions2 ;
2021-08-04 21:16:57 +00:00
ezext1 = host_client - > ezprotocolextensions1 ;
2019-10-14 02:36:57 +00:00
switch ( svs . netprim . coordtype )
2004-11-17 17:38:49 +00:00
{
2019-10-14 02:36:57 +00:00
case COORDTYPE_FLOAT_32 :
fteext1 | = PEXT_FLOATCOORDS ;
2021-08-04 21:16:57 +00:00
ezext1 & = ~ EZPEXT1_FLOATENTCOORDS ; //redundant.
2019-10-14 02:36:57 +00:00
if ( ! ( host_client - > fteprotocolextensions & PEXT_FLOATCOORDS ) )
{
2021-08-04 21:16:57 +00:00
SV_ClientPrintf ( host_client , 2 , " \n Forcing bigcoords. \n If this doesn't work, please update your engine \n " ) ;
host_client - > fteprotocolextensions | = PEXT_FLOATCOORDS ;
// Con_Printf("%s does not support bigcoords\n", host_client->name);
// host_client->drop = true;
// return;
2019-10-14 02:36:57 +00:00
}
break ;
case COORDTYPE_FIXED_13_3 :
fteext1 & = ~ PEXT_FLOATCOORDS ;
break ;
default :
SV_ClientPrintf ( host_client , 2 , " Unsupported coord type \n " ) ;
Con_Printf ( " %s unsupported coord type \n " , host_client - > name ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
host_client - > drop = true ;
2004-11-17 17:38:49 +00:00
return ;
}
2020-02-11 18:06:10 +00:00
fteext2 & = ~ PEXT2_STUNAWARE ; //don't complicate demos.
2004-11-17 17:38:49 +00:00
2005-06-22 17:10:13 +00:00
ClientReliableCheckBlock ( host_client , 800 ) ; //okay, so it might be longer, but I'm too lazy to work out the real size.
2004-11-17 17:38:49 +00:00
2004-08-23 00:15:46 +00:00
// send the serverdata
2005-06-22 17:10:13 +00:00
ClientReliableWrite_Byte ( host_client , ISQ2CLIENT ( host_client ) ? svcq2_serverdata : svc_serverdata ) ;
2019-10-14 02:36:57 +00:00
if ( fteext1 ) //let the client know
2004-08-23 00:15:46 +00:00
{
2019-05-10 09:31:21 +00:00
ClientReliableWrite_Long ( host_client , PROTOCOL_VERSION_FTE1 ) ;
2019-10-14 02:36:57 +00:00
ClientReliableWrite_Long ( host_client , fteext1 ) ;
2004-08-23 00:15:46 +00:00
}
2020-02-11 18:06:10 +00:00
if ( fteext2 ) //let the client know
2009-11-04 21:16:50 +00:00
{
ClientReliableWrite_Long ( host_client , PROTOCOL_VERSION_FTE2 ) ;
2020-02-11 18:06:10 +00:00
ClientReliableWrite_Long ( host_client , fteext2 ) ;
2009-11-04 21:16:50 +00:00
}
2021-08-04 21:16:57 +00:00
if ( ezext1 ) //let the client know
{
ClientReliableWrite_Long ( host_client , PROTOCOL_VERSION_EZQUAKE1 ) ;
ClientReliableWrite_Long ( host_client , ezext1 ) ;
}
2008-04-12 23:24:19 +00:00
ClientReliableWrite_Long ( host_client , ISQ2CLIENT ( host_client ) ? PROTOCOL_VERSION_Q2 : PROTOCOL_VERSION_QW ) ;
2005-06-22 17:10:13 +00:00
ClientReliableWrite_Long ( host_client , svs . spawncount ) ;
2005-05-26 12:55:34 +00:00
if ( ISQ2CLIENT ( host_client ) )
2005-06-22 17:10:13 +00:00
ClientReliableWrite_Byte ( host_client , 0 ) ;
ClientReliableWrite_String ( host_client , gamedir ) ;
2004-08-23 00:15:46 +00:00
2020-02-11 18:06:10 +00:00
if ( fteext2 & PEXT2_MAXPLAYERS )
2004-08-23 00:15:46 +00:00
{
2012-02-12 05:18:31 +00:00
/*is this a sane way to do it? or should we split the spectator thing off entirely?*/
ClientReliableWrite_Byte ( host_client , sv . allocated_client_slots ) ;
splitnum = 0 ;
for ( split = host_client , splitnum = 0 ; split ; split = split - > controlled )
splitnum + + ;
2021-08-04 21:18:20 +00:00
if ( fteext2 & PEXT2_VRINPUTS )
ClientReliableWrite_Byte ( host_client , splitnum ) ;
else
ClientReliableWrite_Byte ( host_client , ( host_client - > spectator ? 128 : 0 ) | splitnum ) ; //read each player's userinfo to see if its a spectator or not. this hint is merely a cheat.
2012-02-12 05:18:31 +00:00
for ( split = host_client ; split ; split = split - > controlled )
2009-03-03 01:52:30 +00:00
{
2013-12-17 22:45:37 +00:00
playernum = split - svs . clients ; // NUM_FOR_EDICT(svprogfuncs, split->edict)-1;
2018-11-19 06:37:25 +00:00
if ( ISQ2CLIENT ( host_client ) & & sv . state = = ss_cinematic )
2012-02-12 05:18:31 +00:00
playernum = - 1 ;
ClientReliableWrite_Byte ( host_client , playernum ) ;
split - > state = cs_connected ;
split - > connection_started = realtime ;
# ifdef SVRANKING
split - > stats_started = realtime ;
2012-02-12 05:33:16 +00:00
# endif
2009-03-03 01:52:30 +00:00
}
2012-02-12 05:18:31 +00:00
}
else
{
splitnum = 0 ;
for ( split = host_client ; split ; split = split - > controlled )
2004-12-08 04:14:52 +00:00
{
2012-02-12 05:18:31 +00:00
switch ( svs . gametype )
{
# ifdef HLSERVER
case GT_HALFLIFE :
playernum = split - svs . clients ;
break ;
# endif
# ifdef Q2SERVER
case GT_QUAKE2 :
playernum = Q2NUM_FOR_EDICT ( split - > q2edict ) - 1 ;
break ;
# endif
default :
playernum = NUM_FOR_EDICT ( svprogfuncs , split - > edict ) - 1 ;
}
# ifdef SERVER_DEMO_PLAYBACK
if ( sv . demostate )
{
playernum = ( MAX_CLIENTS - 1 - splitnum ) | 128 ;
}
else
# endif
if ( split - > spectator )
playernum | = 128 ;
2004-08-23 00:15:46 +00:00
2012-02-12 05:18:31 +00:00
split - > state = cs_connected ;
split - > connection_started = realtime ;
# ifdef SVRANKING
split - > stats_started = realtime ;
# endif
splitnum + + ;
2016-01-18 05:22:07 +00:00
if ( ISQ2CLIENT ( host_client ) )
{
2018-11-19 06:37:25 +00:00
if ( sv . state = = ss_cinematic )
playernum = - 1 ;
2016-01-18 05:22:07 +00:00
ClientReliableWrite_Short ( host_client , playernum ) ;
break ;
}
else
ClientReliableWrite_Byte ( host_client , playernum ) ;
2012-02-12 05:18:31 +00:00
}
2004-08-23 00:15:46 +00:00
2016-01-18 05:22:07 +00:00
if ( ! ISQ2CLIENT ( host_client ) )
{
if ( host_client - > fteprotocolextensions & PEXT_SPLITSCREEN )
ClientReliableWrite_Byte ( host_client , 128 ) ;
}
2004-08-23 00:15:46 +00:00
}
2008-05-25 22:23:43 +00:00
2004-08-23 00:15:46 +00:00
// send full levelname
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-12-10 03:04:42 +00:00
if ( sv . demostatevalid )
2005-06-22 17:10:13 +00:00
ClientReliableWrite_String ( host_client , sv . demfullmapname ) ;
2004-12-10 03:04:42 +00:00
else
2009-11-07 13:29:15 +00:00
# endif
2005-06-22 17:10:13 +00:00
ClientReliableWrite_String ( host_client , sv . mapname ) ;
2004-08-23 00:15:46 +00:00
//
// game server
2005-07-03 15:16:20 +00:00
//
2004-08-23 00:15:46 +00:00
# ifdef Q2SERVER
2005-05-26 12:55:34 +00:00
if ( ISQ2CLIENT ( host_client ) )
2004-08-23 00:15:46 +00:00
{
if ( sv . state ! = ss_cinematic )
{
// host_client->q2edict = Q2NUM_FOR_EDICT(split->q2edict)-1;
memset ( & host_client - > lastcmd , 0 , sizeof ( host_client - > lastcmd ) ) ;
// begin fetching configstrings
2005-06-22 17:10:13 +00:00
ClientReliableWrite_Byte ( host_client , svcq2_stufftext ) ;
ClientReliableWrite_String ( host_client , va ( " cmd configstrings %i 0 \n " , svs . spawncount ) ) ;
2004-08-23 00:15:46 +00:00
}
return ;
}
# endif
// send the movevars
2005-06-22 17:10:13 +00:00
ClientReliableWrite_Float ( host_client , movevars . gravity ) ;
ClientReliableWrite_Float ( host_client , movevars . stopspeed ) ;
ClientReliableWrite_Float ( host_client , movevars . maxspeed ) ;
ClientReliableWrite_Float ( host_client , movevars . spectatormaxspeed ) ;
ClientReliableWrite_Float ( host_client , movevars . accelerate ) ;
ClientReliableWrite_Float ( host_client , movevars . airaccelerate ) ;
ClientReliableWrite_Float ( host_client , movevars . wateraccelerate ) ;
ClientReliableWrite_Float ( host_client , movevars . friction ) ;
ClientReliableWrite_Float ( host_client , movevars . waterfriction ) ;
ClientReliableWrite_Float ( host_client , movevars . entgravity ) ;
2004-08-23 00:15:46 +00:00
2005-03-10 03:55:18 +00:00
host_client - > csqcactive = false ;
2008-05-25 22:23:43 +00:00
host_client - > realip_num = rand ( ) + ( host_client - > challenge < < 16 ) ;
SV_CheckRealIP ( host_client , false ) ;
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " new (QW) " ) ;
2011-10-27 16:16:29 +00:00
2018-11-19 06:37:25 +00:00
if ( sv . state = = ss_cinematic )
{
char tmp [ 1024 ] ;
MSG_WriteByte ( & host_client - > netchan . message , svc_stufftext ) ;
MSG_WriteString ( & host_client - > netchan . message , va ( " \n playfilm %s \n " , COM_QuotedString ( svs . name , tmp , sizeof ( tmp ) , false ) ) ) ;
host_client - > prespawn_stage = PRESPAWN_INVALID ;
host_client - > prespawn_idx = 0 ;
return ;
}
------------------------------------------------------------------------
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
host_client - > prespawn_stage = PRESPAWN_SERVERINFO ;
host_client - > prespawn_idx = 0 ;
2004-08-23 00:15:46 +00:00
}
2011-10-27 16:16:29 +00:00
2015-09-01 04:45:15 +00:00
# ifdef NQPROT
2004-08-23 00:15:46 +00:00
void SVNQ_New_f ( void )
{
extern cvar_t coop ;
2015-12-28 17:41:39 +00:00
char message [ 2048 ] ;
char build [ 256 ] , mapname [ 128 ] ;
int i ;
int op ;
2013-03-12 22:35:33 +00:00
unsigned int protext1 = 0 , protext2 = 0 , protmain = 0 , protfl = 0 ;
2013-08-21 07:14:39 +00:00
char * protoname ;
2013-12-09 01:18:27 +00:00
extern cvar_t sv_listen_nq ;
2015-12-28 17:41:39 +00:00
const char * gamedir ;
2016-07-12 00:40:13 +00:00
unsigned int modelcount , soundcount ;
2017-08-29 02:29:06 +00:00
extern cvar_t allow_download ;
2013-08-21 07:14:39 +00:00
host_client - > prespawn_stage = PRESPAWN_INVALID ;
host_client - > prespawn_idx = 0 ;
2005-05-26 12:55:34 +00:00
2016-07-12 00:40:13 +00:00
host_client - > isindependant = false ;
2013-03-12 22:35:33 +00:00
host_client - > send_message = true ;
2011-09-06 20:53:38 +00:00
if ( host_client - > redirect )
{
2014-03-30 08:55:06 +00:00
if ( host_client - > redirect = = 1 )
{
char * msg = va ( " connect \" %s \" \n " , sv_fullredirect . string ) ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( msg ) ) ;
ClientReliableWrite_String ( host_client , msg ) ;
}
2011-09-06 20:53:38 +00:00
return ;
}
2018-03-05 11:06:12 +00:00
if ( host_client - > drop )
return ;
2011-09-06 20:53:38 +00:00
2022-01-16 18:41:44 +00:00
if ( ! host_client - > pextknown & & sv_listen_nq . ival ! = 1 & & ! host_client - > qex ) //1 acts as a legacy mode, used for clients that can't cope with cmd before serverdata (either because they crash out or because they refuse to send reliables until after they got the first serverdata)
2011-05-20 04:10:46 +00:00
{
2016-10-22 07:06:51 +00:00
if ( ! host_client - > supportedprotocols & & host_client - > netchan . remote_address . type ! = NA_LOOPBACK )
{ //don't override cl_loopbackprotocol's choice
2016-07-12 00:40:13 +00:00
char * msg = " cmd protocols \n " ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( msg ) ) ;
ClientReliableWrite_String ( host_client , msg ) ;
}
{
char * msg = " cmd pext \n " ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( msg ) ) ;
ClientReliableWrite_String ( host_client , msg ) ;
}
2011-05-20 04:10:46 +00:00
return ;
}
2022-01-16 18:41:44 +00:00
else
host_client - > pextknown = true ; //just in case.
2011-05-20 04:10:46 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( dpcompat_nopreparse . ival & & progstype = = PROG_QW )
{
2020-09-08 05:11:09 +00:00
SV_PrintToClient ( host_client , PRINT_HIGH , " This server has network preparsing disabled, and thus only supports QuakeWorld clients \n " ) ;
2015-08-04 15:16:24 +00:00
Con_Printf ( " %s was not using QW protocols \n " , host_client - > name ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
host_client - > drop = true ;
return ;
}
------------------------------------------------------------------------
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
host_client - > csqcactive = false ;
2007-06-10 05:14:38 +00:00
2013-03-12 22:35:33 +00:00
protext1 = host_client - > fteprotocolextensions ;
protext2 = host_client - > fteprotocolextensions2 ;
2016-02-15 06:01:17 +00:00
protmain = PROTOCOL_VERSION_NQ ;
2013-03-12 22:35:33 +00:00
protfl = 0 ;
//force floatcoords as required.
2019-10-14 02:36:57 +00:00
if ( sv . nqdatagram . prim . coordtype = = COORDTYPE_FLOAT_32 )
2013-03-12 22:35:33 +00:00
protext1 | = PEXT_FLOATCOORDS ;
else
protext1 & = ~ PEXT_FLOATCOORDS ;
2020-02-11 18:06:10 +00:00
protext2 & = ~ PEXT2_STUNAWARE ; //always clear this, don't confuse demos.
2011-05-20 04:10:46 +00:00
2013-03-12 22:35:33 +00:00
op = host_client - > protocol ;
2016-07-12 00:40:13 +00:00
if ( host_client - > supportedprotocols )
{
int i ;
static const struct
{
int id ;
qboolean big ; //used as a filter to exclude protocols that don't match our coord+angles mode
2020-09-08 05:11:09 +00:00
qboolean pextonly ;
2016-07-12 00:40:13 +00:00
} preferedprot [ ] =
{
2020-09-08 05:11:09 +00:00
//favour fitz over dp's. this is on the assumption that we can use pext stuff when both are available.
{ SCP_FITZ666 , true , true } , //actually fte+999... shh...
{ SCP_FITZ666 , false , true } , //actually fte+666.
//next best is probably dp's stuff
2017-05-28 15:42:32 +00:00
{ SCP_DARKPLACES7 , true } ,
{ SCP_DARKPLACES6 , true } ,
2020-09-08 05:11:09 +00:00
//unextended fitz is kinda lame, but has some bells on it.
2016-07-12 00:40:13 +00:00
{ SCP_FITZ666 , true } , //actually 999... shh...
{ SCP_FITZ666 , false } ,
2020-09-08 05:11:09 +00:00
//well, we can still get bigger model/soundindexes out of this
2017-07-12 08:15:27 +00:00
{ SCP_BJP3 , false } //should we only use this when we have >255 models/sounds?
2016-07-12 00:40:13 +00:00
} ;
for ( i = 0 ; i < countof ( preferedprot ) ; i + + )
{
if ( preferedprot [ i ] . big = = ! ! ( protext1 & PEXT_FLOATCOORDS ) )
2020-09-08 05:11:09 +00:00
if ( ! preferedprot [ i ] . pextonly | | ( protext2 & PEXT2_REPLACEMENTDELTAS ) )
2016-07-12 00:40:13 +00:00
{
if ( host_client - > supportedprotocols & ( 1u < < preferedprot [ i ] . id ) )
{
host_client - > protocol = preferedprot [ i ] . id ;
break ;
}
}
}
}
2005-05-27 05:41:07 +00:00
switch ( host_client - > protocol )
{
case SCP_NETQUAKE :
2016-07-12 00:40:13 +00:00
case SCP_BJP3 :
2011-10-27 16:16:29 +00:00
case SCP_FITZ666 :
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " new (NQ) " ) ;
2016-07-12 00:40:13 +00:00
if ( host_client - > protocol = = SCP_FITZ666 | |
2019-10-14 02:36:57 +00:00
sv . nqdatagram . prim . anglesize ! = 1 | | sv . nqdatagram . prim . coordtype ! = COORDTYPE_FIXED_13_3 )
2011-10-27 16:16:29 +00:00
{
2019-10-14 02:36:57 +00:00
protfl = ( ( sv . nqdatagram . prim . anglesize = = 2 ) ? RMQFL_SHORTANGLE : 0 ) ;
switch ( sv . nqdatagram . prim . coordtype )
{
case COORDTYPE_FLOAT_32 : protfl | = RMQFL_FLOATCOORD ; break ;
case COORDTYPE_FIXED_28_4 : protfl | = RMQFL_INT32COORD ; break ;
case COORDTYPE_FIXED_16_8 : protfl | = RMQFL_24BITCOORD ; break ;
case COORDTYPE_FIXED_13_3 : protfl | = 0 ; break ;
default :
host_client - > drop = true ;
break ;
}
2011-10-27 16:16:29 +00:00
host_client - > protocol = SCP_FITZ666 ; /*mneh, close enough, the rmq stuff is just modifiers*/
2013-03-12 22:35:33 +00:00
if ( protfl )
2011-10-27 16:16:29 +00:00
{
2013-03-12 22:35:33 +00:00
protext1 & = ~ PEXT_FLOATCOORDS ; //never report floatcoords when using rmq protocol, as the base protocol allows us to be more specific anyway.
2016-02-15 06:01:17 +00:00
protmain = PROTOCOL_VERSION_RMQ ;
2022-01-16 18:41:44 +00:00
protoname = host_client - > qex ? " QE999 " : " RMQ " ;
2011-10-27 16:16:29 +00:00
}
else
2013-08-21 07:14:39 +00:00
{
2016-02-15 06:01:17 +00:00
protmain = PROTOCOL_VERSION_FITZ ;
2022-01-16 18:41:44 +00:00
protoname = host_client - > qex ? " QE666 " : " 666 " ;
2013-08-21 07:14:39 +00:00
}
2011-10-27 16:16:29 +00:00
}
2016-07-12 00:40:13 +00:00
else if ( host_client - > protocol = = SCP_BJP3 )
{
protmain = PROTOCOL_VERSION_BJP3 ;
protoname = " BJP3 " ;
}
2011-10-27 16:16:29 +00:00
else
{
2016-07-12 00:40:13 +00:00
if ( ! host_client - > supportedprotocols & & ! host_client - > fteprotocolextensions & & ! host_client - > fteprotocolextensions2 )
{
for ( modelcount = 1 ; modelcount < MAX_PRECACHE_MODELS & & sv . strings . model_precache [ modelcount ] ; modelcount + + )
;
for ( soundcount = 1 ; soundcount < MAX_PRECACHE_SOUNDS & & sv . strings . sound_precache [ soundcount ] ; soundcount + + )
;
if ( modelcount > 255 | | soundcount > 255 | | sv . world . num_edicts > 600 )
{
Q_snprintfz ( message , sizeof ( message ) , " \x02 \n "
" !!! THIS MAP REQUIRES AN IMPROVED PROTOCOL, \n "
2017-01-15 13:13:09 +00:00
" !!! BUT YOUR CLIENT DOESN'T APPEAR TO SUPPORT ANY. \n "
2016-07-12 00:40:13 +00:00
" !!! EXPECT MISSING MODELS, SOUNDS, OR ENTITIES \n " ) ;
//if you're reading this message to try to avoid your client being described as shitty, implement support for 'cmd protocol' and maybe 'cmd pext' stuffcmds.
//simply put, I can't use 666 if I don't know that its safe to do so.
2022-01-16 18:41:44 +00:00
SV_PrintToClient ( host_client , PRINT_HIGH , message ) ;
2016-07-12 00:40:13 +00:00
}
}
host_client - > protocol = SCP_NETQUAKE ; //identical other than the client->server angles
2016-02-15 06:01:17 +00:00
protmain = PROTOCOL_VERSION_NQ ;
2022-01-16 18:41:44 +00:00
protoname = host_client - > qex ? " QE15 " : " NQ " ;
2011-10-27 16:16:29 +00:00
}
2005-05-27 05:41:07 +00:00
break ;
2017-05-28 15:42:32 +00:00
case SCP_DARKPLACES6 :
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " new (DP6) " ) ;
2016-02-15 06:01:17 +00:00
protmain = PROTOCOL_VERSION_DP6 ;
2013-08-21 07:14:39 +00:00
protext1 & = ~ PEXT_FLOATCOORDS ; //always enabled, try not to break things
2017-08-29 02:29:06 +00:00
protext2 = host_client - > fteprotocolextensions2 = host_client - > fteprotocolextensions2 & ~ ( PEXT2_PREDINFO | PEXT2_REPLACEMENTDELTAS ) ; //always disabled. kinda interferes with expectations.
2013-08-21 07:14:39 +00:00
protoname = " DPP6 " ;
2005-05-27 05:41:07 +00:00
break ;
case SCP_DARKPLACES7 :
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " new (DP7) " ) ;
2016-02-15 06:01:17 +00:00
protmain = PROTOCOL_VERSION_DP7 ;
2013-08-21 07:14:39 +00:00
protext1 & = ~ PEXT_FLOATCOORDS ; //always enabled, try not to break things
2017-08-29 02:29:06 +00:00
protext2 = host_client - > fteprotocolextensions2 = host_client - > fteprotocolextensions2 & ~ ( PEXT2_PREDINFO | PEXT2_REPLACEMENTDELTAS ) ; //always disabled. kinda interferes with expectations.
2013-08-21 07:14:39 +00:00
protoname = " DPP7 " ;
2017-05-28 15:42:32 +00:00
break ;
2005-05-27 05:41:07 +00:00
default :
host_client - > drop = true ;
2017-08-29 02:29:06 +00:00
protoname = " Unknown " ;
2005-05-27 05:41:07 +00:00
break ;
}
2004-08-23 00:15:46 +00:00
2015-12-28 17:41:39 +00:00
# ifdef OFFICIAL_RELEASE
Q_snprintfz ( build , sizeof ( build ) , " v%i.%02i " , FTE_VER_MAJOR , FTE_VER_MINOR ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# elif defined(SVNREVISION)
Q_snprintfz ( build , sizeof ( build ) , " SVN %s " , STRINGIFY ( SVNREVISION ) ) ;
2015-12-28 17:41:39 +00:00
# else
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
Q_snprintfz ( build , sizeof ( build ) , " %s " , __DATE__ ) ;
2015-12-28 17:41:39 +00:00
# endif
2018-07-05 16:21:44 +00:00
gamedir = InfoBuf_ValueForKey ( & svs . info , " *gamedir " ) ;
2015-12-28 17:41:39 +00:00
if ( ! gamedir [ 0 ] )
{
gamedir = FS_GetGamedir ( true ) ;
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2017-01-24 10:27:39 +00:00
if ( ! strcmp ( gamedir , " qw " ) ) //hack: hide the qw dir from nq clients.
gamedir = " " ;
# endif
2015-12-28 17:41:39 +00:00
}
COM_FileBase ( sv . modelname , mapname , sizeof ( mapname ) ) ;
2016-07-12 00:40:13 +00:00
if ( op ! = host_client - > protocol )
SV_ClientProtocolExtensionsChanged ( host_client ) ;
2016-02-15 06:01:17 +00:00
// if (host_client->netchan.remote_address.type != NA_LOOPBACK) //don't display this to localhost, because its just spam at the end of the day. you don't want to see it in single player.
{
//note that certain clients glitch out if this does not have a trailing new line.
//note that those clients will also glitch out from vanilla servers too.
//vanilla prints something like: VERSION 1.08 SERVER (%i CRC)
//which isn't all that useful. so lets customise it to advertise properly, as well as provide gamedir and map (file)name info
2017-08-29 02:29:06 +00:00
if ( protext2 & PEXT2_REPLACEMENTDELTAS )
{
2020-04-29 10:43:22 +00:00
Q_snprintfz ( message , sizeof ( message ) , " %c \n " DISTRIBUTION " %s - %s - %s " , 2 ,
build , gamedir , mapname ) ;
2017-08-29 02:29:06 +00:00
}
else
{
2020-04-29 10:43:22 +00:00
Q_snprintfz ( message , sizeof ( message ) , " %c \n " DISTRIBUTION " (%s%s%s, %s) - %s - %s " , 2 ,
2017-08-29 02:29:06 +00:00
protoname , ( protext1 | | ( protext2 & ~ PEXT2_VOICECHAT ) ) ? " + " : " " , ( protext2 & PEXT2_VOICECHAT ) ? " Voip " : " " ,
2020-04-29 10:43:22 +00:00
build , gamedir , mapname ) ;
2017-08-29 02:29:06 +00:00
}
2022-01-16 18:41:44 +00:00
SV_PrintToClient ( host_client , PRINT_HIGH , message ) ;
2016-02-15 06:01:17 +00:00
}
2013-08-21 07:14:39 +00:00
if ( host_client - > protocol = = SCP_DARKPLACES6 | | host_client - > protocol = = SCP_DARKPLACES7 )
{
2020-05-14 15:50:26 +00:00
char buf [ 1024 ] ;
size_t sz = 0 ;
2013-08-21 07:14:39 +00:00
char * f ;
2020-05-14 15:50:26 +00:00
char * csprogsname = InfoBuf_ValueForKey ( & svs . info , " *csprogsname " ) ;
if ( ! * csprogsname & & * InfoBuf_ValueForKey ( & svs . info , " *csprogs " ) )
csprogsname = " csprogs.dat " ;
2013-08-21 07:14:39 +00:00
2020-05-14 15:50:26 +00:00
f = * csprogsname ? COM_LoadTempFile ( csprogsname , 0 , & sz ) : NULL ;
2013-08-21 07:14:39 +00:00
if ( f )
{
MSG_WriteByte ( & host_client - > netchan . message , svc_stufftext ) ;
2020-05-14 15:50:26 +00:00
MSG_WriteString ( & host_client - > netchan . message , va ( " csqc_progname %s \n " , COM_QuotedString ( csprogsname , buf , sizeof ( buf ) , false ) ) ) ;
2013-08-21 07:14:39 +00:00
MSG_WriteByte ( & host_client - > netchan . message , svc_stufftext ) ;
2015-04-14 23:12:17 +00:00
MSG_WriteString ( & host_client - > netchan . message , va ( " csqc_progsize %u \n " , ( unsigned int ) sz ) ) ;
2013-08-21 07:14:39 +00:00
MSG_WriteByte ( & host_client - > netchan . message , svc_stufftext ) ;
2021-04-14 05:21:04 +00:00
MSG_WriteString ( & host_client - > netchan . message , va ( " csqc_progcrc %i \n " , CalcHashInt ( & hash_crc16 , f , sz ) ) ) ;
2013-08-21 07:14:39 +00:00
MSG_WriteByte ( & host_client - > netchan . message , svc_stufftext ) ;
MSG_WriteString ( & host_client - > netchan . message , " cmd enablecsqc \n " ) ;
}
2020-05-14 15:50:26 +00:00
else
{
2021-10-05 05:05:56 +00:00
// MSG_WriteByte (&host_client->netchan.message, svc_stufftext);
// MSG_WriteString (&host_client->netchan.message, "csqc_progcrc \"\"\n");
2020-05-14 15:50:26 +00:00
}
2013-08-21 07:14:39 +00:00
}
2018-11-19 06:37:25 +00:00
if ( sv . state = = ss_cinematic )
{
MSG_WriteByte ( & host_client - > netchan . message , svc_stufftext ) ;
MSG_WriteString ( & host_client - > netchan . message , va ( " \n playfilm %s \n " , COM_QuotedString ( svs . name , message , sizeof ( message ) , false ) ) ) ;
host_client - > prespawn_stage = PRESPAWN_INVALID ;
host_client - > prespawn_idx = 0 ;
host_client - > netchan . nqunreliableonly = 2 ;
return ;
}
2013-03-12 22:35:33 +00:00
MSG_WriteByte ( & host_client - > netchan . message , svc_serverdata ) ;
if ( protext1 )
{
2019-05-10 09:31:21 +00:00
MSG_WriteLong ( & host_client - > netchan . message , PROTOCOL_VERSION_FTE1 ) ;
2013-03-12 22:35:33 +00:00
MSG_WriteLong ( & host_client - > netchan . message , protext1 ) ;
}
if ( protext2 )
{
MSG_WriteLong ( & host_client - > netchan . message , PROTOCOL_VERSION_FTE2 ) ;
MSG_WriteLong ( & host_client - > netchan . message , protext2 ) ;
}
MSG_WriteLong ( & host_client - > netchan . message , protmain ) ;
2016-02-15 06:01:17 +00:00
if ( protmain = = PROTOCOL_VERSION_RMQ )
2013-03-12 22:35:33 +00:00
MSG_WriteLong ( & host_client - > netchan . message , protfl ) ;
2016-10-22 07:06:51 +00:00
if ( protext2 & PEXT2_PREDINFO )
MSG_WriteString ( & host_client - > netchan . message , gamedir ) ;
2016-07-12 00:40:13 +00:00
MSG_WriteByte ( & host_client - > netchan . message , ( sv . allocated_client_slots > host_client - > max_net_clients ) ? host_client - > max_net_clients : sv . allocated_client_slots ) ;
2022-01-16 18:41:44 +00:00
if ( host_client - > qex )
MSG_WriteString ( & host_client - > netchan . message , gamedir ) ;
------------------------------------------------------------------------
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
2004-08-23 00:15:46 +00:00
if ( ! coop . value & & deathmatch . value )
MSG_WriteByte ( & host_client - > netchan . message , GAME_DEATHMATCH ) ;
else
MSG_WriteByte ( & host_client - > netchan . message , GAME_COOP ) ;
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
MSG_WriteString ( & host_client - > netchan . message , sv . mapname ) ;
2004-08-23 00:15:46 +00:00
2014-12-02 02:00:41 +00:00
2021-06-21 13:44:34 +00:00
if ( host_client - > fteprotocolextensions2 )
{ //don't bother sending much. we'll spew late precaches later.
if ( sv . strings . model_precache [ 1 ] )
MSG_WriteString ( & host_client - > netchan . message , sv . strings . model_precache [ 1 ] ) ;
MSG_WriteByte ( & host_client - > netchan . message , 0 ) ; //models. worldmodel only.
MSG_WriteByte ( & host_client - > netchan . message , 0 ) ; //sounds. none at all.
}
else
{
//fixme: don't send too many models.
for ( i = 1 ; sv . strings . model_precache [ i ] ; i + + )
MSG_WriteString ( & host_client - > netchan . message , sv . strings . model_precache [ i ] ) ;
MSG_WriteByte ( & host_client - > netchan . message , 0 ) ;
//fixme: don't send too many sounds.
for ( i = 1 ; sv . strings . sound_precache [ i ] ; i + + )
MSG_WriteString ( & host_client - > netchan . message , sv . strings . sound_precache [ i ] ) ;
MSG_WriteByte ( & host_client - > netchan . message , 0 ) ;
}
2004-08-23 00:15:46 +00:00
2022-03-01 02:51:55 +00:00
if ( allow_download . value & & ( protext1 | | protext2 | | ISDPCLIENT ( host_client ) ) )
{ //technically this is a DP extension, but is separate from actual protocols and shouldn't harm anything.
//it is annoying to have prints about unknown commands however, hence the above pext checks (which are unfortunate).
MSG_WriteByte ( & host_client - > netchan . message , svc_stufftext ) ;
MSG_WriteString ( & host_client - > netchan . message , " cl_serverextension_download 1 \n " ) ;
}
2022-01-16 18:41:44 +00:00
if ( host_client - > qex )
{ //FIXME: these may change mid-map.
2022-01-08 10:01:15 +00:00
extern cvar_t sv_friction , sv_stopspeed , sv_maxvelocity , sv_accelerate , sv_gravity ;
2022-01-16 18:41:44 +00:00
unsigned int bits = QEX_GV_ALL ;
2022-01-08 10:01:15 +00:00
MSG_WriteByte ( & host_client - > netchan . message , svcqex_servervars ) ;
MSG_WriteULEB128 ( & host_client - > netchan . message , bits ) ;
if ( bits & QEX_GV_DEATHMATCH )
MSG_WriteByte ( & host_client - > netchan . message , deathmatch . ival ) ;
if ( bits & QEX_GV_IDEALPITCHSCALE )
MSG_WriteFloat ( & host_client - > netchan . message , 0 ) ;
if ( bits & QEX_GV_FRICTION )
MSG_WriteFloat ( & host_client - > netchan . message , sv_friction . value ) ;
if ( bits & QEX_GV_EDGEFRICTION )
MSG_WriteFloat ( & host_client - > netchan . message , * pm_edgefriction . string ? pm_edgefriction . value : 2 ) ;
if ( bits & QEX_GV_STOPSPEED )
MSG_WriteFloat ( & host_client - > netchan . message , sv_stopspeed . value ) ;
if ( bits & QEX_GV_MAXVELOCITY )
MSG_WriteFloat ( & host_client - > netchan . message , sv_maxvelocity . value ) ;
if ( bits & QEX_GV_GRAVITY )
MSG_WriteFloat ( & host_client - > netchan . message , sv_gravity . value ) ;
if ( bits & QEX_GV_NOSTEP )
MSG_WriteByte ( & host_client - > netchan . message , false ) ;
if ( bits & QEX_GV_MAXSPEED )
MSG_WriteFloat ( & host_client - > netchan . message , sv_maxspeed . value ) ;
if ( bits & QEX_GV_ACCELERATE )
MSG_WriteFloat ( & host_client - > netchan . message , sv_accelerate . value ) ;
if ( bits & QEX_GV_CONTROLLERONLY )
MSG_WriteByte ( & host_client - > netchan . message , 0 ) ;
if ( bits & QEX_GV_TIMELIMIT )
MSG_WriteFloat ( & host_client - > netchan . message , timelimit . value ) ;
if ( bits & QEX_GV_FRAGLIMIT )
MSG_WriteFloat ( & host_client - > netchan . message , fraglimit . value ) ;
}
2005-07-03 15:16:20 +00:00
// set view
2004-08-23 00:15:46 +00:00
MSG_WriteByte ( & host_client - > netchan . message , svc_setview ) ;
2014-06-12 23:08:42 +00:00
MSG_WriteEntity ( & host_client - > netchan . message , ( host_client - svs . clients ) + 1 ) ; //NUM_FOR_EDICT(svprogfuncs, host_client->edict));
2004-08-23 00:15:46 +00:00
2018-01-22 19:18:04 +00:00
if ( ! ( host_client - > fteprotocolextensions2 & PEXT2_PREDINFO ) )
{ //old clients can't cope with reliables until they finish loading the models specified above.
//we need to wait before sending any more
//updated clients can wait a bit, and use signonnum 1 to tell them when to start loading stuff.
2018-03-25 09:36:14 +00:00
MSG_WriteByte ( & host_client - > netchan . message , svcnq_signonnum ) ;
2018-01-22 19:18:04 +00:00
MSG_WriteByte ( & host_client - > netchan . message , 1 ) ;
host_client - > netchan . nqunreliableonly = 2 ;
}
2004-08-23 00:15:46 +00:00
// host_client->sendsignon = true;
// host_client->spawned = false; // need prespawn, spawn, etc
------------------------------------------------------------------------
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
if ( op ! = host_client - > protocol )
host_client - > prespawn_stage = PRESPAWN_PROTOCOLSWITCH ;
else
host_client - > prespawn_stage = PRESPAWN_SERVERINFO ;
------------------------------------------------------------------------
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
host_client - > prespawn_idx = 0 ;
2004-08-23 00:15:46 +00:00
}
2015-09-01 04:45:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
# ifdef Q2SERVER
void SVQ2_ConfigStrings_f ( void )
{
2016-01-18 05:22:07 +00:00
unsigned int start ;
const char * str ;
2004-08-23 00:15:46 +00:00
Con_DPrintf ( " Configstrings() from %s \n " , host_client - > name ) ;
if ( host_client - > state ! = cs_connected )
{
Con_DPrintf ( " configstrings not valid -- already spawned \n " ) ;
return ;
}
// handle the case of a level changing while a client was connecting
if ( atoi ( Cmd_Argv ( 1 ) ) ! = svs . spawncount )
{
Con_DPrintf ( " SV_Configstrings_f from different level \n " ) ;
SV_New_f ( ) ;
return ;
}
2018-06-18 16:44:29 +00:00
start = strtoul ( Cmd_Argv ( 2 ) , NULL , 0 ) ;
2004-10-28 21:13:52 +00:00
2004-08-23 00:15:46 +00:00
// write a packet full of data
2012-04-24 07:59:11 +00:00
while ( host_client - > netchan . message . cursize < host_client - > netchan . message . maxsize / 2
2004-08-23 00:15:46 +00:00
& & start < Q2MAX_CONFIGSTRINGS )
{
2006-02-17 02:51:59 +00:00
str = sv . strings . configstring [ start ] ;
2016-01-18 05:22:07 +00:00
if ( str & & * str )
2005-03-20 02:57:11 +00:00
{
MSG_WriteByte ( & host_client - > netchan . message , svcq2_configstring ) ;
2018-06-18 16:44:29 +00:00
MSG_WriteShort ( & host_client - > netchan . message , ( unsigned short ) start ) ;
2005-03-20 02:57:11 +00:00
MSG_WriteString ( & host_client - > netchan . message , str ) ;
}
2016-01-18 05:22:07 +00:00
start + + ;
}
//model overflows
if ( start = = Q2MAX_CONFIGSTRINGS )
start = 0x8000 ;
while ( host_client - > netchan . message . cursize < host_client - > netchan . message . maxsize / 2
& & start < 0x8000 + MAX_PRECACHE_MODELS )
{
str = sv . strings . q2_extramodels [ start - 0x8000 ] ;
if ( str & & * str )
2004-08-23 00:15:46 +00:00
{
MSG_WriteByte ( & host_client - > netchan . message , svcq2_configstring ) ;
MSG_WriteShort ( & host_client - > netchan . message , start ) ;
2016-01-18 05:22:07 +00:00
MSG_WriteString ( & host_client - > netchan . message , str ) ;
2004-08-23 00:15:46 +00:00
}
2016-01-18 05:22:07 +00:00
start + + ;
}
//sound overflows
if ( start = = 0x8000 + MAX_PRECACHE_MODELS )
start = 0xc000 ;
while ( host_client - > netchan . message . cursize < host_client - > netchan . message . maxsize / 2
& & start < 0xc000 + MAX_PRECACHE_SOUNDS )
{
str = sv . strings . q2_extrasounds [ start - 0xc000 ] ;
if ( str & & * str )
2004-08-23 00:15:46 +00:00
{
MSG_WriteByte ( & host_client - > netchan . message , svcq2_configstring ) ;
MSG_WriteShort ( & host_client - > netchan . message , start ) ;
2016-01-18 05:22:07 +00:00
MSG_WriteString ( & host_client - > netchan . message , str ) ;
2004-08-23 00:15:46 +00:00
}
start + + ;
}
// send next command
2016-01-18 05:22:07 +00:00
if ( start = = 0xc000 + MAX_PRECACHE_SOUNDS )
2004-08-23 00:15:46 +00:00
{
MSG_WriteByte ( & host_client - > netchan . message , svcq2_stufftext ) ;
MSG_WriteString ( & host_client - > netchan . message , va ( " cmd baselines %i 0 \n " , svs . spawncount ) ) ;
}
else
{
MSG_WriteByte ( & host_client - > netchan . message , svcq2_stufftext ) ;
MSG_WriteString ( & host_client - > netchan . message , va ( " cmd configstrings %i %i \n " , svs . spawncount , start ) ) ;
}
}
# endif
# ifdef Q2SERVER
void SVQ2_BaseLines_f ( void )
{
int start ;
q2entity_state_t nullstate ;
q2entity_state_t * base ;
extern q2entity_state_t sv_baselines [ Q2MAX_EDICTS ] ;
Con_DPrintf ( " Baselines() from %s \n " , host_client - > name ) ;
if ( host_client - > state ! = cs_connected )
{
Con_Printf ( " baselines not valid -- already spawned \n " ) ;
return ;
}
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
// handle the case of a level changing while a client was connecting
if ( atoi ( Cmd_Argv ( 1 ) ) ! = svs . spawncount )
{
Con_Printf ( " SV_Baselines_f from different level \n " ) ;
SV_New_f ( ) ;
return ;
}
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
start = atoi ( Cmd_Argv ( 2 ) ) ;
memset ( & nullstate , 0 , sizeof ( nullstate ) ) ;
// write a packet full of data
2012-04-24 07:59:11 +00:00
while ( host_client - > netchan . message . cursize < host_client - > netchan . message . maxsize / 2
2004-08-23 00:15:46 +00:00
& & start < Q2MAX_EDICTS )
{
base = & sv_baselines [ start ] ;
if ( base - > modelindex | | base - > sound | | base - > effects )
{
MSG_WriteByte ( & host_client - > netchan . message , svcq2_spawnbaseline ) ;
MSGQ2_WriteDeltaEntity ( & nullstate , base , & host_client - > netchan . message , true , true ) ;
}
start + + ;
}
// send next command
if ( start = = Q2MAX_EDICTS )
{
MSG_WriteByte ( & host_client - > netchan . message , svcq2_stufftext ) ;
MSG_WriteString ( & host_client - > netchan . message , va ( " precache %i \n " , svs . spawncount ) ) ;
}
else
{
MSG_WriteByte ( & host_client - > netchan . message , svcq2_stufftext ) ;
MSG_WriteString ( & host_client - > netchan . message , va ( " cmd baselines %i %i \n " , svs . spawncount , start ) ) ;
}
}
2004-08-27 00:45:34 +00:00
void SVQ2_NextServer_f ( void )
{
if ( ! * sv . modelname & & atoi ( Cmd_Argv ( 1 ) ) = = svs . spawncount )
{
cvar_t * nsv = Cvar_FindVar ( " nextserver " ) ;
if ( ! nsv | | ! * nsv - > string )
return ;
svs . spawncount + + ; // make sure another doesn't sneak in
Cbuf_AddText ( nsv - > string , RESTRICT_LOCAL ) ;
Cbuf_AddText ( " \n " , RESTRICT_LOCAL ) ;
Cvar_Set ( nsv , " " ) ;
}
}
2004-08-23 00:15:46 +00:00
# endif
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
/*
= = = = = = = = = = = = = = = = = =
SV_Soundlist_f
= = = = = = = = = = = = = = = = = =
*/
void SVQW_Soundlist_f ( void )
2004-11-17 17:38:49 +00:00
{
2015-04-14 23:12:17 +00:00
host_client - > prespawn_allow_soundlist = true ;
2004-11-17 17:38:49 +00:00
}
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
SV_Modellist_f
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
void SVQW_Modellist_f ( void )
2004-08-23 00:15:46 +00:00
{
2015-04-14 23:12:17 +00:00
host_client - > prespawn_allow_modellist = true ;
------------------------------------------------------------------------
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
}
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
void SV_SendClientPrespawnInfo ( client_t * client )
{
qboolean started ;
int i ;
entity_state_t * state ;
2015-04-14 23:12:17 +00:00
staticsound_state_t * sound ;
------------------------------------------------------------------------
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
edict_t * ent ;
svcustomtents_t * ctent ;
2016-07-12 00:40:13 +00:00
int maxsize ;
------------------------------------------------------------------------
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
//much of this function is written to fill packets enough to overflow them (assuming max packet sizes are large enough), but some bits are lazy and just backbuffer as needed.
2013-09-12 06:41:29 +00:00
//FIXME: have per-stage indicies, to allow returning to a previous stage when new precaches or whatever get added
2004-08-23 00:15:46 +00:00
2016-07-15 12:26:24 +00:00
if ( client - > num_backbuf | | client - > prespawn_stage = = PRESPAWN_COMPLETED )
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
//don't spam too much.
2004-08-23 00:15:46 +00:00
return ;
}
2019-05-23 15:11:32 +00:00
//just because we CAN generate huge messages doesn't mean that we should.
2016-07-12 00:40:13 +00:00
//try to keep packets within reasonable sizes so that we don't trigger insane burst+packetloss on map changes.
maxsize = client - > netchan . message . maxsize / 2 ;
2019-05-23 15:11:32 +00:00
if ( client - > netchan . mtu & & maxsize > client - > netchan . mtu - 200 )
2016-07-12 00:40:13 +00:00
{
2019-05-23 15:11:32 +00:00
maxsize = client - > netchan . mtu - 200 ;
2016-07-12 00:40:13 +00:00
if ( maxsize < 500 )
maxsize = 500 ;
}
if ( client - > prespawn_stage = = PRESPAWN_PROTOCOLSWITCH )
{
if ( client - > prespawn_idx + + > 10 )
{
client - > prespawn_idx = 0 ;
client - > prespawn_stage + + ;
}
else
return ;
}
------------------------------------------------------------------------
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 ( client - > prespawn_stage = = PRESPAWN_SERVERINFO )
2008-11-09 22:29:28 +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
char buffer [ 1024 ] ;
2004-08-23 00:15:46 +00:00
2020-05-14 15:50:26 +00:00
# ifdef PEXT_CSQC
if ( sv . csqcchecksum & & ! ( client - > fteprotocolextensions & PEXT_CSQC ) & & ! ISDPCLIENT ( client ) )
SV_PrintToClient ( client , PRINT_HIGH , " This server is using CSQC - you are missing out due to your choice of outdated client / protocol! \n " ) ;
# endif
2016-07-12 00:40:13 +00:00
while ( client - > netchan . message . cursize < maxsize )
------------------------------------------------------------------------
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 ( client - > prespawn_idx = = 0 )
2018-01-22 19:18:04 +00:00
{
FS_GetPackNames ( buffer , sizeof ( buffer ) , 2 , true ) ; /*retain extensions, or we'd have to assume pk3*/
ClientReliableWrite_Begin ( client , svc_stufftext , 1 + 11 + strlen ( buffer ) + 1 + 1 ) ;
ClientReliableWrite_SZ ( client , " //paknames " , 11 ) ;
ClientReliableWrite_SZ ( client , buffer , strlen ( buffer ) ) ;
ClientReliableWrite_String ( client , " \n " ) ;
}
2018-10-13 12:19:58 +00:00
else if ( client - > prespawn_idx = = 1 )
2018-01-22 19:18:04 +00:00
{
FS_GetPackHashes ( buffer , sizeof ( buffer ) , false ) ;
ClientReliableWrite_Begin ( client , svc_stufftext , 1 + 7 + strlen ( buffer ) + 1 + 1 ) ;
ClientReliableWrite_SZ ( client , " //paks " , 7 ) ;
ClientReliableWrite_SZ ( client , buffer , strlen ( buffer ) ) ;
ClientReliableWrite_String ( client , " \n " ) ;
}
2018-10-13 12:19:58 +00:00
else if ( client - > prespawn_idx = = 2 )
{
2020-06-12 23:29:58 +00:00
static const char * prioritykeys [ ] = { " * " , " fpd " , " teamplay " , " deathmatch " , " maxfps " , NULL } ; //make sure these are in there.
static const char * ignorekeys [ ] = { " mapname " /*here for q3, useless for qw*/ , NULL } ;
2020-09-08 05:11:09 +00:00
if ( ! ISNQCLIENT ( client ) | | ( client - > fteprotocolextensions & PEXT_CSQC ) | | ( client - > fteprotocolextensions2 & PEXT2_PREDINFO ) )
2018-10-13 12:19:58 +00:00
{ //nq does not normally get serverinfo sent to it.
2020-06-12 23:29:58 +00:00
i = InfoBuf_ToString ( & svs . info , buffer , sizeof ( buffer ) , prioritykeys , ignorekeys , NULL , & client - > infosync , & svs . info ) ;
2019-10-30 14:03:59 +00:00
Info_SetValueForStarKey ( buffer , " *z_ext " , va ( " %i " , client - > zquake_extensions ) , sizeof ( buffer ) ) ; //should already be in there, so this should only ever make it shorter.
2018-10-13 12:19:58 +00:00
ClientReliableWrite_Begin ( client , svc_stufftext , 20 + i ) ;
ClientReliableWrite_String ( client , va ( " fullserverinfo \" %s \" \n " , buffer ) ) ;
}
}
2018-01-22 19:18:04 +00:00
else if ( client - > prespawn_idx = = 3 )
{
if ( ISNQCLIENT ( client ) & & ( client - > fteprotocolextensions2 & PEXT2_PREDINFO ) )
{
2018-03-25 09:36:14 +00:00
ClientReliableWrite_Begin ( client , svcnq_signonnum , 2 ) ;
2018-01-22 19:18:04 +00:00
ClientReliableWrite_Byte ( client , 1 ) ;
}
}
else if ( client - > prespawn_idx = = 4 )
------------------------------------------------------------------------
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
{
2013-09-06 22:57:44 +00:00
int track = 0 ;
2018-09-01 04:18:08 +00:00
const char * noise = " " ;
2013-09-06 22:57:44 +00:00
2018-09-01 06:05:51 +00:00
# ifdef HEXEN2
------------------------------------------------------------------------
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 ( progstype = = PROG_H2 )
2018-09-01 04:18:08 +00:00
{
2013-09-06 22:57:44 +00:00
track = sv . h2cdtrack ; //hexen2 has a special hack
2018-09-01 06:05:51 +00:00
} else
# endif
if ( svprogfuncs )
2018-09-01 04:18:08 +00:00
{
2013-09-06 22:57:44 +00:00
track = ( ( edict_t * ) sv . world . edicts ) - > v - > sounds ;
2018-09-01 04:18:08 +00:00
noise = PR_GetString ( svprogfuncs , ( ( edict_t * ) sv . world . edicts ) - > v - > noise ) ;
}
2013-09-06 22:57:44 +00:00
2018-09-01 04:18:08 +00:00
if ( track = = - 1 & & * noise )
SV_StuffcmdToClient ( client , va ( " cd loop \" %s \" \n " , noise ) ) ;
else
{
ClientReliableWrite_Begin ( client , svc_cdtrack , 2 ) ;
2013-09-06 22:57:44 +00:00
ClientReliableWrite_Byte ( client , track ) ;
2018-09-01 04:18:08 +00:00
if ( ISNQCLIENT ( client ) )
ClientReliableWrite_Byte ( client , track ) ;
2018-09-01 06:05:51 +00:00
# ifdef HEXEN2
2018-09-01 04:18:08 +00:00
if ( ! track & & * sv . h2miditrack )
SV_StuffcmdToClient ( client , va ( " music \" %s \" \n " , sv . h2miditrack ) ) ;
2018-09-01 06:05:51 +00:00
# endif
2018-09-01 04:18:08 +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
}
2018-01-22 19:18:04 +00:00
else if ( client - > prespawn_idx = = 5 )
2013-09-06 22:57:44 +00:00
{
ClientReliableWrite_Begin ( client , svc_setpause , 2 ) ;
2018-10-23 07:09:06 +00:00
ClientReliableWrite_Byte ( client , sv . oldpaused ! = 0 ) ;
if ( sv . oldpaused & & sv . oldpaused & ~ PAUSE_AUTO )
SV_PrintToClient ( client , PRINT_HIGH , " server is paused \n " ) ;
2013-09-06 22:57:44 +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
else
{
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
2016-07-16 13:21:23 +00:00
client - > prespawn_idx2 = 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
break ;
}
client - > prespawn_idx + + ;
}
2004-11-17 17:38:49 +00:00
}
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2017-11-16 22:20:40 +00:00
if ( client - > prespawn_stage = = PRESPAWN_CSPROGS )
{
extern cvar_t sv_demo_write_csqc ;
if ( client = = & demo . recorder & & sv_demo_write_csqc . ival ) //we only really want to do this for demos. actual clients can make the request themselves.
if ( client - > fteprotocolextensions & PEXT_CHUNKEDDOWNLOADS ) //there's many different download mechanisms...
{
if ( ! client - > prespawn_idx & & ! client - > download )
{
extern cvar_t sv_csqc_progname ;
Q_strncpyz ( client - > downloadfn , sv_csqc_progname . string , sizeof ( client - > downloadfn ) ) ;
client - > download = FS_OpenVFS ( sv_csqc_progname . string , " rb " , FS_GAME ) ;
client - > downloadcount = 0 ;
client - > prespawn_idx = 1 ;
if ( client - > download )
{
client - > downloadsize = VFS_GETLEN ( client - > download ) ;
//send the size+filename
ClientReliableWrite_Begin ( client , svc_download , 18 + strlen ( client - > downloadfn ) ) ;
ClientReliableWrite_Long ( client , - 1 ) ; //offset
if ( client - > downloadsize > = 0x7fffffff )
{ //avoid unsigned values.
ClientReliableWrite_Long ( client , 0x80000000 ) ; //signal that its 64bit
ClientReliableWrite_Long ( client , qofs_Low ( client - > downloadsize ) ) ;
ClientReliableWrite_Long ( client , qofs_High ( client - > downloadsize ) ) ;
}
else
ClientReliableWrite_Long ( client , client - > downloadsize ) ;
ClientReliableWrite_String ( client , client - > downloadfn ) ;
}
}
//send the data while possible+needed
if ( client - > prespawn_idx & & client - > download )
{
while ( client - > downloadcount < client - > downloadsize )
{
qbyte chunk [ DLBLOCKSIZE ] ;
int sz ;
if ( client - > netchan . message . maxsize - client - > netchan . message . cursize < 1100 )
return ; //don't flood...
sz = VFS_READ ( client - > download , chunk , DLBLOCKSIZE ) ;
if ( sz < = 0 )
break ;
if ( sz < DLBLOCKSIZE )
{
memset ( chunk + sz , 0 , DLBLOCKSIZE - sz ) ; //zero-fill if the chunk is at the end.
sz = DLBLOCKSIZE ;
}
ClientReliableWrite_Begin ( client , svc_download , 5 + sz ) ;
ClientReliableWrite_Long ( client , client - > downloadcount / DLBLOCKSIZE ) ;
ClientReliableWrite_SZ ( client , chunk , sz ) ;
client - > downloadcount + = sz ;
}
//don't need to write completion. the client should be tracking that itself with chunks.
VFS_CLOSE ( client - > download ) ;
client - > download = NULL ;
}
}
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
}
2018-09-01 04:18:08 +00:00
# endif
2017-11-16 22:20: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
if ( client - > prespawn_stage = = PRESPAWN_SOUNDLIST )
2008-11-28 20:34:51 +00:00
{
2021-06-21 13:44:34 +00:00
if ( ISQWCLIENT ( client ) )
2013-09-06 22:57:44 +00:00
{
int maxclientsupportedsounds = 256 ;
2017-03-26 01:46:08 +00:00
# ifdef PEXT_SOUNDDBL
2013-09-06 22:57:44 +00:00
if ( client - > fteprotocolextensions & PEXT_SOUNDDBL )
2014-09-17 03:04:08 +00:00
maxclientsupportedsounds = MAX_PRECACHE_SOUNDS ;
2017-03-26 01:46:08 +00:00
# endif
2020-10-06 03:17:28 +00:00
# ifdef PEXT2_REPLACEMENTDELTAS
2017-03-26 01:46:08 +00:00
if ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
maxclientsupportedsounds = MAX_PRECACHE_SOUNDS ;
# endif
2013-09-06 22:57:44 +00:00
started = false ;
2008-11-28 20:34:51 +00:00
2013-09-06 22:57:44 +00:00
//allows stalling for the soundlist command, for compat.
2015-04-14 23:12:17 +00:00
if ( ! client - > prespawn_allow_soundlist )
if ( ! ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) )
return ;
------------------------------------------------------------------------
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
while ( client - > netchan . message . cursize < maxsize )
------------------------------------------------------------------------
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
{
2013-09-06 22:57:44 +00:00
if ( ! started )
------------------------------------------------------------------------
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
{
2013-09-06 22:57:44 +00:00
started = true ;
2015-04-14 23:12:17 +00:00
client - > prespawn_allow_soundlist = false ;
2017-03-26 01:46:08 +00:00
# if defined(PEXT_SOUNDDBL) || defined(PEXT2_REPLACEMENTDELTAS)
2013-09-06 22:57:44 +00:00
if ( client - > prespawn_idx > 255 )
{
MSG_WriteByte ( & client - > netchan . message , svcfte_soundlistshort ) ;
MSG_WriteShort ( & client - > netchan . message , client - > prespawn_idx ) ;
}
else
# endif
{
MSG_WriteByte ( & client - > netchan . message , svc_soundlist ) ;
MSG_WriteByte ( & client - > netchan . message , client - > prespawn_idx ) ;
}
------------------------------------------------------------------------
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
}
2013-09-06 22:57:44 +00:00
client - > prespawn_idx + + ;
2016-01-18 05:22:07 +00:00
if ( client - > prespawn_idx > = maxclientsupportedsounds | | ! sv . strings . sound_precache [ client - > prespawn_idx ] )
------------------------------------------------------------------------
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-08-25 00:12:14 +00:00
//write final-end-of-list
MSG_WriteByte ( & client - > netchan . message , 0 ) ;
MSG_WriteByte ( & client - > netchan . message , 0 ) ;
started = 0 ;
2016-01-18 05:22:07 +00:00
if ( sv . strings . sound_precache [ client - > prespawn_idx ] & & ! ( client - > plimitwarned & PLIMIT_SOUNDS ) )
2014-12-02 02:00:41 +00:00
{
client - > plimitwarned | = PLIMIT_SOUNDS ;
SV_ClientPrintf ( client , PRINT_HIGH , " WARNING: Your client's network protocol only supports %i sounds. Please upgrade or enable extensions. \n " , client - > prespawn_idx ) ;
}
2016-08-25 00:12:14 +00:00
2013-09-06 22:57:44 +00:00
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
break ;
------------------------------------------------------------------------
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
}
2013-09-06 22:57:44 +00:00
else
MSG_WriteString ( & client - > netchan . message , sv . strings . sound_precache [ client - > prespawn_idx ] ) ;
------------------------------------------------------------------------
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
}
2013-09-06 22:57:44 +00:00
if ( started )
------------------------------------------------------------------------
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
{
2013-09-06 22:57:44 +00:00
//write end-of-packet
------------------------------------------------------------------------
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
MSG_WriteByte ( & client - > netchan . message , 0 ) ;
2016-07-12 00:40:13 +00:00
MSG_WriteByte ( & client - > netchan . message , ( client - > prespawn_idx & 0xff ) ? client - > prespawn_idx & 0xff : 0xff ) ;
2005-07-03 15:16:20 +00:00
2013-09-06 22:57:44 +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
}
2021-06-21 13:44:34 +00:00
else if ( ISNQCLIENT ( client ) & & client - > fteprotocolextensions2 )
{
if ( client - > prespawn_idx < 1 )
client - > prespawn_idx = 1 ;
while ( client - > netchan . message . cursize < maxsize )
{
if ( client - > prespawn_idx > = MAX_PRECACHE_SOUNDS | | ! sv . strings . sound_precache [ client - > prespawn_idx ] )
{
if ( sv . strings . sound_precache [ client - > prespawn_idx ] & & ! ( client - > plimitwarned & PLIMIT_SOUNDS ) )
{
client - > plimitwarned | = PLIMIT_SOUNDS ;
SV_ClientPrintf ( client , PRINT_HIGH , " WARNING: Your client's network protocol only supports %i sounds. Please upgrade or enable extensions. \n " , client - > prespawn_idx ) ;
}
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
break ;
}
MSG_WriteByte ( & client - > netchan . message , svcdp_precache ) ;
MSG_WriteShort ( & client - > netchan . message , 0x8000 | client - > prespawn_idx ) ;
MSG_WriteString ( & client - > netchan . message , sv . strings . sound_precache [ client - > prespawn_idx ] ) ;
client - > prespawn_idx + + ;
}
}
else
client - > prespawn_stage + + ;
2004-08-23 00:15:46 +00:00
}
2013-03-12 22:53:23 +00:00
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2013-09-12 06:41:29 +00:00
if ( client - > prespawn_stage = = PRESPAWN_VWEPMODELLIST )
{
//no indicies. the protocol can't cope with them.
if ( client - > zquake_extensions & Z_EXT_VWEP )
{
char mname [ MAX_QPATH ] ;
2014-10-05 20:04:11 +00:00
char ext [ 8 ] ;
2014-03-30 08:55:06 +00:00
char vweaplist [ 2048 ] = " //vwep " ;
2013-09-12 06:41:29 +00:00
for ( i = 0 ; sv . strings . vw_model_precache [ i ] ; i + + )
{
//grab the model name... without a progs/ prefix if it has one
if ( ! strncmp ( sv . strings . vw_model_precache [ i ] , " progs/ " , 6 ) )
2018-08-04 19:00:19 +00:00
Q_strncpyz ( mname , sv . strings . vw_model_precache [ i ] + 6 , sizeof ( mname ) ) ;
2013-09-12 06:41:29 +00:00
else
2018-08-04 19:00:19 +00:00
Q_strncpyz ( mname , sv . strings . vw_model_precache [ i ] , sizeof ( mname ) ) ;
2013-09-12 06:41:29 +00:00
//strip .mdl extensions, for compat with ezquake
2014-10-05 20:04:11 +00:00
COM_FileExtension ( mname , ext , sizeof ( ext ) ) ;
if ( ! strcmp ( ext , " mdl " ) )
2013-09-12 06:41:29 +00:00
COM_StripExtension ( mname , mname , sizeof ( mname ) ) ;
//add it to the vweap command, taking care of any remaining spaces in names.
if ( strchr ( mname , ' ' ) | | ! * mname )
Q_strncatz ( vweaplist , va ( " \" %s \" " , mname ) , sizeof ( vweaplist ) ) ;
else
Q_strncatz ( vweaplist , va ( " %s " , mname ) , sizeof ( vweaplist ) ) ;
}
if ( strlen ( vweaplist ) < = sizeof ( vweaplist ) - 2 )
{
Q_strncatz ( vweaplist , " \n " , sizeof ( vweaplist ) ) ;
ClientReliableWrite_Begin ( client , svc_stufftext , 2 + strlen ( vweaplist ) ) ;
ClientReliableWrite_String ( client , vweaplist ) ;
}
}
client - > prespawn_stage + + ;
}
2018-09-01 04:18:08 +00:00
# endif
2013-09-12 06:41:29 +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
if ( client - > prespawn_stage = = PRESPAWN_MODELLIST )
2004-08-23 00:15:46 +00:00
{
2021-06-21 13:44:34 +00:00
if ( ISQWCLIENT ( client ) )
2013-09-06 22:57:44 +00:00
{
started = 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
2015-04-14 23:12:17 +00:00
//allows stalling for the modellist command, for compat.
if ( ! client - > prespawn_allow_modellist )
if ( ! ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) )
return ;
------------------------------------------------------------------------
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
while ( client - > netchan . message . cursize < maxsize )
------------------------------------------------------------------------
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
{
2013-09-06 22:57:44 +00:00
if ( ! started )
------------------------------------------------------------------------
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
{
2013-09-06 22:57:44 +00:00
started = true ;
2015-04-14 23:12:17 +00:00
client - > prespawn_allow_modellist = false ;
2017-03-26 01:46:08 +00:00
# if defined(PEXT_SOUNDDBL) || defined(PEXT2_REPLACEMENTDELTAS)
2013-09-06 22:57:44 +00:00
if ( client - > prespawn_idx > 255 )
{
MSG_WriteByte ( & client - > netchan . message , svcfte_modellistshort ) ;
MSG_WriteShort ( & client - > netchan . message , client - > prespawn_idx ) ;
}
else
# endif
{
MSG_WriteByte ( & client - > netchan . message , svc_modellist ) ;
MSG_WriteByte ( & client - > netchan . message , client - > prespawn_idx ) ;
}
------------------------------------------------------------------------
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
}
2013-09-06 22:57:44 +00:00
client - > prespawn_idx + + ;
2004-08-23 00:15:46 +00:00
2013-09-06 22:57:44 +00:00
if ( client - > prespawn_idx > = client - > maxmodels | | ! sv . strings . model_precache [ client - > prespawn_idx ] )
------------------------------------------------------------------------
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-08-25 00:12:14 +00:00
//write final-end-of-list
MSG_WriteByte ( & client - > netchan . message , 0 ) ;
MSG_WriteByte ( & client - > netchan . message , 0 ) ;
started = 0 ;
2014-12-08 21:18:32 +00:00
if ( sv . strings . model_precache [ client - > prespawn_idx ] & & ! ( client - > plimitwarned & PLIMIT_MODELS ) )
2014-12-02 02:00:41 +00:00
{
client - > plimitwarned | = PLIMIT_MODELS ;
SV_ClientPrintf ( client , PRINT_HIGH , " WARNING: Your client's network protocol only supports %i models. Please upgrade or enable extensions. \n " , client - > prespawn_idx ) ;
}
2004-08-23 00:15:46 +00:00
2013-09-06 22:57:44 +00:00
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
break ;
}
else
MSG_WriteString ( & client - > netchan . message , sv . strings . model_precache [ client - > prespawn_idx ] ) ;
------------------------------------------------------------------------
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
}
2013-09-06 22:57:44 +00:00
if ( started )
{
//write end-of-packet
MSG_WriteByte ( & client - > netchan . message , 0 ) ;
2016-07-12 00:40:13 +00:00
MSG_WriteByte ( & client - > netchan . message , ( client - > prespawn_idx & 0xff ) ? client - > prespawn_idx & 0xff : 0xff ) ;
2013-09-06 22:57:44 +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
}
2021-06-21 13:44:34 +00:00
else if ( ISNQCLIENT ( client ) & & client - > fteprotocolextensions2 )
{
if ( client - > prespawn_idx < 1 )
client - > prespawn_idx = 1 ;
while ( client - > netchan . message . cursize < maxsize )
{
if ( client - > prespawn_idx > = client - > maxmodels | | ! sv . strings . model_precache [ client - > prespawn_idx ] )
{
if ( sv . strings . model_precache [ client - > prespawn_idx ] & & ! ( client - > plimitwarned & PLIMIT_MODELS ) )
{
client - > plimitwarned | = PLIMIT_MODELS ;
SV_ClientPrintf ( client , PRINT_HIGH , " WARNING: Your client's network protocol only supports %i models. Please upgrade or enable extensions. \n " , client - > prespawn_idx ) ;
}
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
break ;
}
MSG_WriteByte ( & client - > netchan . message , svcdp_precache ) ;
MSG_WriteShort ( & client - > netchan . message , client - > prespawn_idx ) ;
MSG_WriteString ( & client - > netchan . message , sv . strings . model_precache [ client - > prespawn_idx ] ) ;
client - > prespawn_idx + + ;
}
}
else
client - > prespawn_stage + + ;
2009-06-21 17:45:33 +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
if ( client - > prespawn_stage = = PRESPAWN_MAPCHECK )
2008-11-09 22:29:28 +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
//can't progress beyond this as we're waiting for the client.
2013-09-12 06:41:29 +00:00
// host_client->prespawn_idx = client->prespawn_idx;
2008-11-09 22:29:28 +00:00
return ;
2004-08-23 00:15:46 +00:00
}
2013-03-12 22:44:00 +00:00
if ( client - > prespawn_stage = = PRESPAWN_PARTICLES )
{
2013-09-12 06:41:29 +00:00
if ( ! ( client - > fteprotocolextensions & PEXT_CSQC ) )
client - > prespawn_idx = MAX_SSPARTICLESPRE ;
2016-07-12 00:40:13 +00:00
while ( client - > netchan . message . cursize < maxsize )
2013-03-12 22:44:00 +00:00
{
if ( client - > prespawn_idx > = MAX_SSPARTICLESPRE )
{
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
break ;
}
2016-01-18 05:22:07 +00:00
if ( sv . strings . particle_precache [ client - > prespawn_idx ] )
2013-03-12 22:44:00 +00:00
{
ClientReliableWrite_Begin ( client , ISNQCLIENT ( client ) ? svcdp_precache : svcfte_precache , 4 + strlen ( sv . strings . particle_precache [ client - > prespawn_idx ] ) ) ;
ClientReliableWrite_Short ( client , client - > prespawn_idx | PC_PARTICLE ) ;
ClientReliableWrite_String ( client , sv . strings . particle_precache [ client - > prespawn_idx ] ) ;
}
client - > prespawn_idx + + ;
}
}
------------------------------------------------------------------------
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 ( client - > prespawn_stage = = PRESPAWN_CUSTOMTENTS )
2004-08-23 00:15:46 +00:00
{
2016-07-12 00:40:13 +00:00
while ( client - > netchan . message . cursize < maxsize )
------------------------------------------------------------------------
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 ( client - > prespawn_idx > = 255 )
{
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
break ;
}
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
ctent = & sv . customtents [ client - > prespawn_idx ] ;
2004-12-05 15:19:11 +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
if ( * ctent - > particleeffecttype )
{
if ( client - > fteprotocolextensions & PEXT_CUSTOMTEMPEFFECTS )
{
MSG_WriteByte ( & client - > netchan . message , svcfte_customtempent ) ;
MSG_WriteByte ( & client - > netchan . message , 255 ) ;
MSG_WriteByte ( & client - > netchan . message , client - > prespawn_idx ) ;
MSG_WriteByte ( & client - > netchan . message , ctent - > netstyle ) ;
MSG_WriteString ( & client - > netchan . message , ctent - > particleeffecttype ) ;
if ( ctent - > netstyle & CTE_STAINS )
{
MSG_WriteChar ( & client - > netchan . message , ctent - > stain [ 0 ] ) ;
MSG_WriteChar ( & client - > netchan . message , ctent - > stain [ 0 ] ) ;
MSG_WriteChar ( & client - > netchan . message , ctent - > stain [ 0 ] ) ;
MSG_WriteByte ( & client - > netchan . message , ctent - > radius ) ;
}
if ( ctent - > netstyle & CTE_GLOWS )
{
MSG_WriteByte ( & client - > netchan . message , ctent - > dlightrgb [ 0 ] ) ;
MSG_WriteByte ( & client - > netchan . message , ctent - > dlightrgb [ 1 ] ) ;
MSG_WriteByte ( & client - > netchan . message , ctent - > dlightrgb [ 2 ] ) ;
MSG_WriteByte ( & client - > netchan . message , ctent - > dlightradius ) ;
MSG_WriteByte ( & client - > netchan . message , ctent - > dlighttime ) ;
}
}
}
client - > prespawn_idx + + ;
}
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
if ( client - > prespawn_stage = = PRESPAWN_SIGNON_BUF )
2004-08-23 00:15:46 +00:00
{
2019-09-17 19:49:39 +00:00
int nextsize ;
2016-07-12 00:40:13 +00:00
while ( client - > netchan . message . cursize < maxsize )
2005-10-19 19:37:16 +00:00
{
2019-09-17 19:49:39 +00:00
if ( client - > prespawn_idx > = sv . used_signon_space )
------------------------------------------------------------------------
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
{
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
break ;
}
2004-12-05 15:19:11 +00:00
2019-09-17 19:49:39 +00:00
nextsize = sv . signon_buffer [ client - > prespawn_idx ] | ( sv . signon_buffer [ client - > prespawn_idx + 1 ] < < 8 ) ;
if ( client - > netchan . message . cursize + nextsize + 30 < = client - > netchan . message . maxsize )
------------------------------------------------------------------------
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-09-17 19:49:39 +00:00
SZ_Write ( & client - > netchan . message , sv . signon_buffer + client - > prespawn_idx + 2 , nextsize ) ;
client - > prespawn_idx + = 2 + nextsize ;
}
else if ( ! client - > netchan . message . cursize & & nextsize + 30 > client - > netchan . message . maxsize )
{ //signon data is meant to be split up into smallish chunks to avoid network fragmentation.
//but sometimes a single blob is too large (eg: gamecode not using MSG_MULTICAST and just writing 16k in one splurge)
//fteqw and nq protocols can cope, vanilla qw cannot, so we do need to warn. the alternative is to kick.
SV_PrintToClient ( client , PRINT_HIGH , va ( " \x01 " " Dropping %i bytes of signon data \n " , nextsize ) ) ;
client - > prespawn_idx + = 2 + nextsize ;
break ;
------------------------------------------------------------------------
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
}
else
break ;
}
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
if ( client - > prespawn_stage = = PRESPAWN_SPAWNSTATIC )
{
2017-07-04 05:07:51 +00:00
int maxstatics = sv . num_static_entities ;
if ( maxstatics > 1024 & & ISDPCLIENT ( client ) )
maxstatics = 1024 ;
2016-07-12 00:40:13 +00:00
while ( client - > netchan . message . cursize < maxsize ) //static entities
------------------------------------------------------------------------
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
{
2017-07-04 05:07:51 +00:00
if ( client - > prespawn_idx > = maxstatics )
------------------------------------------------------------------------
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
{
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
break ;
}
2005-10-19 19:37:16 +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
state = & sv_staticentities [ client - > prespawn_idx ] ;
client - > prespawn_idx + + ;
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
if ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
{
2013-03-12 22:35:33 +00:00
MSG_WriteByte ( & client - > netchan . message , svcfte_spawnstatic2 ) ;
2021-08-04 21:16:57 +00:00
SVFTE_EmitBaseline ( state , false , & client - > netchan . message , client - > fteprotocolextensions2 , client - > ezprotocolextensions1 ) ;
------------------------------------------------------------------------
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
continue ;
}
if ( client - > fteprotocolextensions & PEXT_SPAWNSTATIC2 )
{
/*if it uses some new feature, use the updated spawnstatic*/
if ( state - > hexen2flags | | state - > trans | | state - > modelindex > = 256 | | state - > frame > 255 | | state - > scale | | state - > abslight )
{
2013-03-12 22:35:33 +00:00
MSG_WriteByte ( & client - > netchan . message , svcfte_spawnstatic2 ) ;
2021-08-04 21:16:57 +00:00
SVQW_WriteDelta ( & nullentitystate , state , & client - > netchan . message , true , client - > fteprotocolextensions , client - > ezprotocolextensions1 ) ;
------------------------------------------------------------------------
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
continue ;
}
}
2016-07-12 00:40:13 +00:00
if ( client - > protocol = = SCP_BJP3 )
{
MSG_WriteByte ( & client - > netchan . message , svc_spawnstatic ) ;
MSG_WriteShort ( & client - > netchan . message , state - > modelindex ) ;
MSG_WriteByte ( & client - > netchan . message , state - > frame ) ;
MSG_WriteByte ( & client - > netchan . message , ( int ) state - > colormap ) ;
MSG_WriteByte ( & client - > netchan . message , ( int ) state - > skinnum ) ;
for ( i = 0 ; i < 3 ; i + + )
{
MSG_WriteCoord ( & client - > netchan . message , state - > origin [ i ] ) ;
MSG_WriteAngle ( & client - > netchan . message , state - > angles [ i ] ) ;
}
continue ;
}
------------------------------------------------------------------------
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
/*couldn't use protocol extensions?
use the fallback , unless the model is invalid as that ' s silly */
if ( state - > modelindex < 256 )
{
MSG_WriteByte ( & client - > netchan . message , svc_spawnstatic ) ;
2011-10-27 16:16:29 +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
MSG_WriteByte ( & client - > netchan . message , state - > modelindex ) ;
2011-10-27 16:16:29 +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
MSG_WriteByte ( & client - > netchan . message , state - > frame ) ;
MSG_WriteByte ( & client - > netchan . message , ( int ) state - > colormap ) ;
MSG_WriteByte ( & client - > netchan . message , ( int ) state - > skinnum ) ;
for ( i = 0 ; i < 3 ; i + + )
{
MSG_WriteCoord ( & client - > netchan . message , state - > origin [ i ] ) ;
MSG_WriteAngle ( & client - > netchan . message , state - > angles [ i ] ) ;
}
continue ;
}
}
}
2015-04-14 23:12:17 +00:00
if ( client - > prespawn_stage = = PRESPAWN_AMBIENTSOUND )
{
2016-07-12 00:40:13 +00:00
while ( client - > netchan . message . cursize < maxsize ) //static entities
2015-04-14 23:12:17 +00:00
{
qboolean large = false ;
if ( client - > prespawn_idx > = sv . num_static_sounds )
{
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
2016-07-15 12:26:24 +00:00
client - > prespawn_idx2 = 0 ;
2015-04-14 23:12:17 +00:00
break ;
}
sound = & sv_staticsounds [ client - > prespawn_idx ] ;
client - > prespawn_idx + + ;
2016-07-12 00:40:13 +00:00
/*if (client->protocol == SCP_BJP2)
2015-04-14 23:12:17 +00:00
{
large = true ;
2016-07-12 00:40:13 +00:00
MSG_WriteByte ( & client - > netchan . message , svc_spawnstaticsound ) ;
}
else */ if ( sound - > soundnum > 0xff )
{
large = true ;
if ( client - > protocol = = SCP_BJP3 )
continue ; //not supported
else if ( ISDPCLIENT ( client ) )
2015-04-14 23:12:17 +00:00
MSG_WriteByte ( & client - > netchan . message , svcdp_spawnstaticsound2 ) ;
else if ( ISNQCLIENT ( client ) )
MSG_WriteByte ( & client - > netchan . message , svcfitz_spawnstaticsound2 ) ;
else
continue ; //not supported
}
else
MSG_WriteByte ( & client - > netchan . message , svc_spawnstaticsound ) ;
for ( i = 0 ; i < 3 ; i + + )
MSG_WriteCoord ( & client - > netchan . message , sound - > position [ i ] ) ;
if ( large )
MSG_WriteShort ( & client - > netchan . message , sound - > soundnum ) ;
else
MSG_WriteByte ( & client - > netchan . message , sound - > soundnum ) ;
MSG_WriteByte ( & client - > netchan . message , sound - > volume ) ;
MSG_WriteByte ( & client - > netchan . message , sound - > attenuation ) ;
}
}
2011-10-27 16:16:29 +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
if ( client - > prespawn_stage = = PRESPAWN_BASELINES )
{
2016-07-12 00:40:13 +00:00
while ( client - > netchan . message . cursize < maxsize ) //baselines
2011-10-27 16:16:29 +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
if ( client - > prespawn_idx > = sv . world . num_edicts )
{
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
break ;
}
2011-10-27 16:16:29 +00:00
2018-04-06 17:21:15 +00:00
ent = EDICT_NUM_PB ( svprogfuncs , client - > prespawn_idx ) ;
2011-10-27 16:16:29 +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
if ( ! ent )
state = & nullentitystate ;
2011-10-27 16:16:29 +00:00
else
------------------------------------------------------------------------
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
state = & ent - > baseline ;
2011-10-27 16:16:29 +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
if ( ! state - > number | | ! state - > modelindex )
{ //ent doesn't have a baseline
client - > prespawn_idx + + ;
continue ;
}
if ( state - > number > = client - > max_net_ents | | state - > modelindex > = client - > maxmodels )
{
/*can't send this ent*/
}
else if ( client - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS )
{
MSG_WriteByte ( & client - > netchan . message , svcfte_spawnbaseline2 ) ;
2021-08-04 21:16:57 +00:00
SVFTE_EmitBaseline ( state , true , & client - > netchan . message , client - > fteprotocolextensions2 , client - > ezprotocolextensions1 ) ;
------------------------------------------------------------------------
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
}
else if ( client - > fteprotocolextensions & PEXT_SPAWNSTATIC2 )
{
MSG_WriteByte ( & client - > netchan . message , svcfte_spawnbaseline2 ) ;
2021-08-04 21:16:57 +00:00
SVQW_WriteDelta ( & nullentitystate , state , & client - > netchan . message , true , client - > fteprotocolextensions , client - > ezprotocolextensions1 ) ;
------------------------------------------------------------------------
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
}
else if ( ISDPCLIENT ( client ) & & ( state - > modelindex > 255 | | state - > frame > 255 ) )
{
MSG_WriteByte ( & client - > netchan . message , svcdp_spawnbaseline2 ) ;
MSG_WriteEntity ( & client - > netchan . message , state - > number ) ;
MSG_WriteShort ( & client - > netchan . message , state - > modelindex ) ;
MSG_WriteShort ( & client - > netchan . message , state - > frame ) ;
MSG_WriteByte ( & client - > netchan . message , ( int ) state - > colormap ) ;
MSG_WriteByte ( & client - > netchan . message , ( int ) state - > skinnum ) ;
for ( i = 0 ; i < 3 ; i + + )
{
MSG_WriteCoord ( & client - > netchan . message , state - > origin [ i ] ) ;
MSG_WriteAngle ( & client - > netchan . message , state - > angles [ i ] ) ;
}
}
else if ( client - > protocol = = SCP_FITZ666 & & ( state - > modelindex > 255 | | state - > frame > 255 | | state - > trans ! = 255 | | state - > scale ! = 16 ) )
{
int fl = 0 ;
if ( state - > modelindex > 255 ) fl | = FITZ_B_LARGEMODEL ;
if ( state - > frame > 255 ) fl | = FITZ_B_LARGEFRAME ;
if ( state - > trans ! = 255 ) fl | = FITZ_B_ALPHA ;
if ( state - > scale ! = 16 ) fl | = RMQFITZ_B_SCALE ;
MSG_WriteByte ( & client - > netchan . message , svcfitz_spawnbaseline2 ) ;
MSG_WriteEntity ( & client - > netchan . message , state - > number ) ;
MSG_WriteByte ( & client - > netchan . message , fl ) ;
if ( fl & FITZ_B_LARGEMODEL )
MSG_WriteShort ( & client - > netchan . message , state - > modelindex ) ;
else
MSG_WriteByte ( & client - > netchan . message , state - > modelindex ) ;
if ( fl & FITZ_B_LARGEFRAME )
MSG_WriteShort ( & client - > netchan . message , state - > frame ) ;
else
MSG_WriteByte ( & client - > netchan . message , state - > frame ) ;
MSG_WriteByte ( & client - > netchan . message , state - > colormap ) ;
MSG_WriteByte ( & client - > netchan . message , state - > skinnum ) ;
for ( i = 0 ; i < 3 ; i + + )
{
MSG_WriteCoord ( & client - > netchan . message , state - > origin [ i ] ) ;
MSG_WriteAngle ( & client - > netchan . message , state - > angles [ i ] ) ;
}
if ( fl & FITZ_B_ALPHA )
MSG_WriteByte ( & client - > netchan . message , state - > trans ) ;
if ( fl & RMQFITZ_B_SCALE )
MSG_WriteByte ( & client - > netchan . message , state - > scale ) ;
}
else if ( state - > modelindex )
{
MSG_WriteByte ( & client - > netchan . message , svc_spawnbaseline ) ;
MSG_WriteEntity ( & client - > netchan . message , state - > number ) ;
2016-07-12 00:40:13 +00:00
if ( client - > protocol = = SCP_BJP3 )
MSG_WriteShort ( & client - > netchan . message , state - > modelindex & 0xffff ) ;
else if ( state - > modelindex > 255 )
------------------------------------------------------------------------
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
MSG_WriteByte ( & client - > netchan . message , 0 ) ; //invalid modelindex. at least try to give something
else
2016-07-12 00:40:13 +00:00
MSG_WriteByte ( & client - > netchan . message , state - > modelindex & 0xff ) ;
2015-02-02 08:01:53 +00:00
MSG_WriteByte ( & client - > netchan . message , state - > frame & 0xff ) ;
MSG_WriteByte ( & client - > netchan . message , state - > colormap & 0xff ) ;
MSG_WriteByte ( & client - > netchan . message , state - > skinnum & 0xff ) ;
------------------------------------------------------------------------
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
for ( i = 0 ; i < 3 ; i + + )
{
MSG_WriteCoord ( & client - > netchan . message , state - > origin [ i ] ) ;
MSG_WriteAngle ( & client - > netchan . message , state - > angles [ i ] ) ;
}
}
2011-10-27 16:16:29 +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
client - > prespawn_idx + + ;
}
}
2016-07-15 12:26:24 +00:00
if ( client - > prespawn_stage = = PRESPAWN_SPAWN )
------------------------------------------------------------------------
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-15 12:26:24 +00:00
//we'll spawn the client and then send all the updating stuff only when we know the channel is clear, by pinging the client for it.
if ( ISNQCLIENT ( client ) )
------------------------------------------------------------------------
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-15 12:26:24 +00:00
//effectively a cmd spawn... but also causes the client to actually send the player's name too.
2018-03-25 09:36:14 +00:00
ClientReliableWrite_Begin ( client , svcnq_signonnum , 2 ) ;
2016-07-15 12:26:24 +00:00
ClientReliableWrite_Byte ( client , 2 ) ;
}
else
{
char * cmd = va ( " cmd spawn %i \n " , svs . spawncount ) ;
ClientReliableWrite_Begin ( client , svc_stufftext , 2 + strlen ( cmd ) ) ;
ClientReliableWrite_String ( client , cmd ) ;
}
client - > prespawn_stage + + ;
2016-07-16 13:21:23 +00:00
client - > prespawn_idx = 0 ;
client - > prespawn_idx2 = 0 ;
2016-07-15 12:26:24 +00:00
}
//this is extra stuff that will happen after we're on the server
if ( client - > prespawn_stage = = PRESPAWN_BRUSHES )
{ //when brush editing, connecting clients need a copy of all the brushes.
while ( client - > netchan . message . cursize < maxsize )
{
2016-07-16 13:21:23 +00:00
# ifdef TERRAIN
2016-07-15 12:26:24 +00:00
if ( ! SV_Prespawn_Brushes ( & client - > netchan . message , & client - > prespawn_idx , & client - > prespawn_idx2 ) )
2016-07-16 13:21:23 +00:00
# endif
2013-03-12 22:35:33 +00:00
{
2016-07-15 12:26:24 +00:00
client - > prespawn_stage + + ;
client - > prespawn_idx = 0 ;
client - > prespawn_idx2 = 0 ;
break ;
2013-03-12 22:35:33 +00:00
}
2011-10-27 16:16:29 +00:00
}
}
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
SV_PreSpawn_f
= = = = = = = = = = = = = = = = = =
*/
2011-10-27 16:16:29 +00:00
void SVQW_PreSpawn_f ( void )
2004-08-23 00:15:46 +00:00
{
unsigned check ;
if ( host_client - > state ! = cs_connected )
{
2005-07-28 15:22:15 +00:00
Con_Printf ( " prespawn not valid -- already spawned \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
------------------------------------------------------------------------
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 ( host_client - > prespawn_stage ! = PRESPAWN_MAPCHECK )
{
Con_Printf ( " Wrong stage for prespawn command \n " ) ;
return ;
}
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
// handle the case of a level changing while a client was connecting
2018-09-01 04:18:08 +00:00
if ( atoi ( Cmd_Argv ( 1 ) ) ! = svs . spawncount )
2004-08-23 00:15:46 +00:00
{
Con_Printf ( " SV_PreSpawn_f from different level \n " ) ;
------------------------------------------------------------------------
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
//FIXME: we shouldn't need the following line.
2004-08-23 00:15:46 +00:00
SV_New_f ( ) ;
return ;
}
------------------------------------------------------------------------
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 ( host_client - > prespawn_stage = = PRESPAWN_MAPCHECK )
2004-08-23 00:15:46 +00:00
{
2017-06-21 01:24:25 +00:00
check = atoi ( Cmd_Argv ( 3 ) ) ;
2004-08-23 00:15:46 +00:00
// Con_DPrintf("Client check = %d\n", check);
2009-11-04 21:16:50 +00:00
if ( sv_mapcheck . value & & check ! = sv . world . worldmodel - > checksum & &
2017-06-21 01:24:25 +00:00
COM_RemapMapChecksum ( sv . world . worldmodel , check ) ! = COM_RemapMapChecksum ( sv . world . worldmodel , LittleLong ( sv . world . worldmodel - > checksum2 ) ) )
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-08-23 00:15:46 +00:00
if ( ! sv . demofile | | ( sv . demofile & & ! sv . democausesreconnect ) ) //demo playing causes no check. If it's the return level, check anyway to avoid that loophole.
2009-11-07 13:29:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
{
2011-05-20 04:10:46 +00:00
char * msg ;
2005-07-03 15:16:20 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH ,
2022-01-08 10:01:15 +00:00
" Map model file does not match (%s), %#X != %#X/%#X. \n You may need a new version of the map, or the proper install files. \n " ,
2009-11-04 21:16:50 +00:00
sv . modelname , check , sv . world . worldmodel - > checksum , sv . world . worldmodel - > checksum2 ) ;
2011-05-20 04:10:46 +00:00
msg = va ( " \n //kickfile \" %s \" \n " , sv . modelname ) ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 3 + strlen ( msg ) ) ;
ClientReliableWrite_String ( host_client , msg ) ;
2005-07-03 15:16:20 +00:00
SV_DropClient ( host_client ) ;
2004-08-23 00:15:46 +00:00
return ;
}
host_client - > checksum = check ;
------------------------------------------------------------------------
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
host_client - > prespawn_stage = PRESPAWN_MAPCHECK + 1 ;
host_client - > prespawn_idx = 0 ;
2012-04-09 19:12:12 +00:00
return ;
2004-08-23 00:15:46 +00:00
}
}
/*
= = = = = = = = = = = = = = = = = =
SV_Spawn_f
= = = = = = = = = = = = = = = = = =
*/
2012-09-30 05:52:03 +00:00
void SVQW_Spawn_f ( void )
2004-08-23 00:15:46 +00:00
{
int i ;
client_t * client , * split ;
edict_t * ent ;
2015-09-01 04:45:15 +00:00
# ifdef QUAKESTATS
2009-03-03 01:52:30 +00:00
int secret_total , secret_found , monsters_total , monsters_found ;
2015-09-01 04:45:15 +00:00
# endif
2009-03-03 01:52:30 +00:00
2004-08-23 00:15:46 +00:00
if ( host_client - > state ! = cs_connected )
{
2005-07-28 15:22:15 +00:00
Con_Printf ( " Spawn not valid -- already spawned \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2016-07-15 12:26:24 +00:00
if ( host_client - > prespawn_stage < = PRESPAWN_SPAWN )
------------------------------------------------------------------------
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
{
2015-04-27 06:19:33 +00:00
Con_Printf ( " %s sent spawn without prespawn! \n " , host_client - > name ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
SV_New_f ( ) ;
return ;
}
2004-08-23 00:15:46 +00:00
// handle the case of a level changing while a client was connecting
2018-09-01 04:18:08 +00:00
if ( atoi ( Cmd_Argv ( 1 ) ) ! = svs . spawncount )
2004-08-23 00:15:46 +00:00
{
Con_Printf ( " SV_Spawn_f from different level \n " ) ;
SV_New_f ( ) ;
return ;
}
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
// send all current names, colors, and frag counts
// FIXME: is this a good thing?
2018-10-23 07:09:06 +00:00
// SZ_Clear (&host_client->netchan.message);
2004-08-23 00:15:46 +00:00
// send current status of all other players
// normally this could overflow, but no need to check due to backbuf
2013-10-29 17:38:22 +00:00
for ( i = 0 , client = svs . clients ; i < svs . allocated_client_slots ; i + + , client + + )
2013-03-31 04:21:08 +00:00
SV_FullClientUpdate ( client , host_client ) ;
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2011-06-05 01:36:14 +00:00
SV_MVD_FullClientUpdate ( NULL , host_client ) ;
2018-09-01 04:18:08 +00:00
# endif
2004-08-23 00:15:46 +00:00
// send all current light styles
2019-09-10 15:40:04 +00:00
for ( i = 0 ; i < sv . maxlightstyles ; i + + )
2004-08-23 00:15:46 +00:00
{
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-08-23 00:15:46 +00:00
if ( sv . democausesreconnect )
{
2005-10-01 03:09:17 +00:00
if ( i > = MAX_STANDARDLIGHTSTYLES )
continue ;
2005-07-03 15:16:20 +00:00
ClientReliableWrite_Begin ( host_client , svc_lightstyle ,
2004-08-23 00:15:46 +00:00
3 + ( sv . demolightstyles [ i ] ? strlen ( sv . demolightstyles [ i ] ) : 1 ) ) ;
ClientReliableWrite_Byte ( host_client , ( char ) i ) ;
ClientReliableWrite_String ( host_client , sv . demolightstyles [ i ] ) ;
}
else
2009-11-07 13:29:15 +00:00
# endif
2019-09-10 15:40:04 +00:00
SV_SendLightstyle ( host_client , NULL , i , true ) ;
2004-08-23 00:15:46 +00:00
}
2009-03-03 01:52:30 +00:00
# ifdef HLSERVER
if ( svs . gametype = = GT_HALFLIFE )
2004-08-23 00:15:46 +00:00
{
2009-03-03 01:52:30 +00:00
for ( split = host_client ; split ; split = split - > controlled )
2004-08-23 00:15:46 +00:00
{
2009-03-03 01:52:30 +00:00
split - > entgravity = 1 ;
split - > maxspeed = 320 ;
2009-04-01 22:03:56 +00:00
SVHL_PutClientInServer ( split ) ;
2004-08-23 00:15:46 +00:00
}
2009-03-03 01:52:30 +00:00
secret_total = 0 ;
secret_found = 0 ;
monsters_total = 0 ;
monsters_found = 0 ;
}
else
# endif
{
// set up the edict
for ( split = host_client ; split ; split = split - > controlled )
2004-08-23 00:15:46 +00:00
{
2009-03-03 01:52:30 +00:00
ent = split - > edict ;
2020-04-19 01:23:32 +00:00
if ( split - > spawned ) //minimal setup
2009-03-03 01:52:30 +00:00
{
split - > entgravity = ent - > xv - > gravity ;
split - > maxspeed = ent - > xv - > maxspeed ;
2016-07-12 00:40:13 +00:00
# ifdef HEXEN2
2012-01-24 04:24:14 +00:00
split - > playerclass = ent - > xv - > playerclass ;
2016-07-12 00:40:13 +00:00
# endif
2009-03-03 01:52:30 +00:00
}
else
{
SV_SetUpClientEdict ( split , ent ) ;
}
//
// force stats to be updated
//
2010-08-16 02:03:02 +00:00
memset ( split - > statsi , 0 , sizeof ( split - > statsi ) ) ;
memset ( split - > statsf , 0 , sizeof ( split - > statsf ) ) ;
memset ( split - > statss , 0 , sizeof ( split - > statss ) ) ;
2004-08-23 00:15:46 +00:00
}
2015-09-01 04:45:15 +00:00
# ifdef QUAKESTATS
2009-03-03 01:52:30 +00:00
secret_total = pr_global_struct - > total_secrets ;
secret_found = pr_global_struct - > found_secrets ;
monsters_total = pr_global_struct - > total_monsters ;
monsters_found = pr_global_struct - > killed_monsters ;
2015-09-01 04:45:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
}
2015-09-01 04:45:15 +00:00
# ifdef QUAKESTATS
2012-09-30 05:52:03 +00:00
ClientReliableWrite_Begin ( host_client , svcqw_updatestatlong , 6 ) ;
2004-08-23 00:15:46 +00:00
ClientReliableWrite_Byte ( host_client , STAT_TOTALSECRETS ) ;
2009-03-03 01:52:30 +00:00
ClientReliableWrite_Long ( host_client , secret_total ) ;
2004-08-23 00:15:46 +00:00
2012-09-30 05:52:03 +00:00
ClientReliableWrite_Begin ( host_client , svcqw_updatestatlong , 6 ) ;
2004-08-23 00:15:46 +00:00
ClientReliableWrite_Byte ( host_client , STAT_TOTALMONSTERS ) ;
2009-03-03 01:52:30 +00:00
ClientReliableWrite_Long ( host_client , monsters_total ) ;
2004-08-23 00:15:46 +00:00
2012-09-30 05:52:03 +00:00
ClientReliableWrite_Begin ( host_client , svcqw_updatestatlong , 6 ) ;
2004-08-23 00:15:46 +00:00
ClientReliableWrite_Byte ( host_client , STAT_SECRETS ) ;
2009-03-03 01:52:30 +00:00
ClientReliableWrite_Long ( host_client , secret_found ) ;
2004-08-23 00:15:46 +00:00
2012-09-30 05:52:03 +00:00
ClientReliableWrite_Begin ( host_client , svcqw_updatestatlong , 6 ) ;
2004-08-23 00:15:46 +00:00
ClientReliableWrite_Byte ( host_client , STAT_MONSTERS ) ;
2009-03-03 01:52:30 +00:00
ClientReliableWrite_Long ( host_client , monsters_found ) ;
2015-09-01 04:45:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
// get the client to check and download skins
// when that is completed, a begin command will be issued
ClientReliableWrite_Begin ( host_client , svc_stufftext , 8 ) ;
ClientReliableWrite_String ( host_client , " skins \n " ) ;
2020-03-07 09:00:40 +00:00
if ( sv . allocated_client_slots > 1 )
{ //okay, so nq player physics don't suppot prediction.
//if we use qw physics in nq mods then we risk breaking things.
//the only progs many players will have is the vanilla nq one.
//so prediction is broken on most people's quicky servers.
//which really sucks.
//so let multiplayer people know what's going on so that they don't think its an actual bug, and can harass the admin to get it fixed in mods that allow for it.
if ( ! strcmp ( sv_nqplayerphysics . string , " auto " ) | | ! strcmp ( sv_nqplayerphysics . string , " " ) )
if ( sv_nqplayerphysics . ival )
SV_PrintToClient ( host_client , PRINT_HIGH , CON_WARNING " Movement prediction is disabled in favour of non-quakeworld mod compatibilty \n " ) ;
}
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
SV_SpawnSpectator
= = = = = = = = = = = = = = = = = =
*/
void SV_SpawnSpectator ( void )
{
int i ;
edict_t * e ;
2006-05-29 04:50:24 +00:00
VectorClear ( sv_player - > v - > origin ) ;
VectorClear ( sv_player - > v - > view_ofs ) ;
2005-03-28 00:11:59 +00:00
sv_player - > v - > view_ofs [ 2 ] = DEFAULT_VIEWHEIGHT ;
sv_player - > v - > movetype = MOVETYPE_NOCLIP ;
2004-08-23 00:15:46 +00:00
// search for an info_playerstart to spawn the spectator at
2005-01-17 17:48:13 +00:00
//this is only useful when a mod doesn't nativly support spectators. old qw on nq mods.
2013-12-02 14:30:30 +00:00
for ( i = svs . allocated_client_slots + 1 ; i < sv . world . num_edicts ; i + + )
2004-08-23 00:15:46 +00:00
{
2018-04-06 17:21:15 +00:00
e = EDICT_NUM_PB ( svprogfuncs , i ) ;
2005-03-28 00:11:59 +00:00
if ( ! strcmp ( PR_GetString ( svprogfuncs , e - > v - > classname ) , " info_player_start " ) )
2004-08-23 00:15:46 +00:00
{
2005-03-28 00:11:59 +00:00
VectorCopy ( e - > v - > origin , sv_player - > v - > origin ) ;
2004-08-23 00:15:46 +00:00
return ;
}
}
}
2020-04-19 01:23:32 +00:00
void SV_DespawnClient ( client_t * cl )
{ //this disconnects the client from its entity state
if ( ! cl - > spawned )
return ; //nothing to do.
cl - > spawned = false ;
# ifdef Q2SERVER
if ( ge )
{
ge - > ClientDisconnect ( cl - > q2edict ) ;
return ;
}
# endif
if ( svprogfuncs )
{
if ( host_initialized )
{
# ifdef VM_Q1
if ( svs . gametype = = GT_Q1QVM )
{
Q1QVM_DropClient ( cl ) ;
}
else
# endif
{
if ( ! cl - > spectator )
{
// call the prog function for removing a client
// this will set the body to a dead frame, among other things
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , cl - > edict ) ;
if ( pr_global_ptrs - > ClientDisconnect )
PR_ExecuteProgram ( svprogfuncs , pr_global_struct - > ClientDisconnect ) ;
sv . spawned_client_slots - - ;
}
else
{
// call the prog function for removing a client
// this will set the body to a dead frame, among other things
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , cl - > edict ) ;
if ( SpectatorDisconnect )
PR_ExecuteProgram ( svprogfuncs , SpectatorDisconnect ) ;
sv . spawned_observer_slots - - ;
}
}
if ( progstype = = PROG_NQ )
ED_Clear ( svprogfuncs , cl - > edict ) ;
}
if ( svprogfuncs & & cl - > edict & & cl - > edict - > v )
cl - > edict - > v - > frags = 0 ;
}
}
2008-11-09 22:29:28 +00:00
void SV_Begin_Core ( client_t * split )
{ //this is the client-protocol-independant core, for q1/q2 gamecode
client_t * oh ;
2016-07-12 00:40:13 +00:00
# ifdef HEXEN2
2009-04-19 00:50:42 +00:00
if ( progstype = = PROG_H2 & & split - > playerclass )
2010-08-12 09:04:05 +00:00
split - > edict - > xv - > playerclass = split - > playerclass ; //make sure it's set the same as the userinfo
2016-07-12 00:40:13 +00:00
# endif
2009-03-03 01:52:30 +00:00
2017-08-14 16:38:44 +00:00
if ( split - > spawned )
2020-04-19 01:23:32 +00:00
{
2020-05-16 13:12:58 +00:00
if ( svprogfuncs )
2020-04-19 01:23:32 +00:00
{
2020-05-16 13:12:58 +00:00
//NEH_RESTOREGAME
//officially RestoreGame tells the mod when the game has been loaded.
//this allows mods to send any stuffcmds the client will have forgotten.
//the original intention would not have been client-specific (and indeed nehahra only saves in singleplayer)
//doing it elsewhere unfortunately results in race conditions.
func_t f = PR_FindFunction ( svprogfuncs , " RestoreGame " , PR_ANY ) ;
if ( f )
{
pr_global_struct - > time = sv . world . physicstime ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , split - > edict ) ;
PR_ExecuteProgram ( svprogfuncs , f ) ;
}
2020-04-19 01:23:32 +00:00
2020-05-16 13:12:58 +00:00
SV_SendFixAngle ( split , NULL , FIXANGLE_FIXED , false ) ;
split - > edict - > v - > fixangle = FIXANGLE_NO ; //no point doing it again
}
2017-08-14 16:38:44 +00:00
return ;
2020-04-19 01:23:32 +00:00
}
2017-08-14 16:38:44 +00:00
split - > spawned = true ;
2005-03-18 06:13:11 +00:00
# ifdef Q2SERVER
2009-03-03 01:52:30 +00:00
if ( ge )
{
2018-07-05 16:21:44 +00:00
char userinfo [ 8192 ] ;
InfoBuf_ToString ( & split - > userinfo , userinfo , sizeof ( userinfo ) , NULL , NULL , NULL , NULL , NULL ) ;
ge - > ClientUserinfoChanged ( split - > q2edict , userinfo ) ; //tell the gamecode
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
SV_ExtractFromUserinfo ( split , true ) ; //let the server routines know
2009-04-01 22:03:56 +00:00
2009-03-03 01:52:30 +00:00
ge - > ClientBegin ( split - > q2edict ) ;
split - > istobeloaded = false ;
2012-02-12 05:18:31 +00:00
sv . spawned_client_slots + + ;
2009-03-03 01:52:30 +00:00
}
else
# endif
{
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2018-03-25 09:36:14 +00:00
split - > edict - > xv - > clientcolors = split - > playercolor ;
2017-08-29 02:29:06 +00:00
if ( progstype ! = PROG_QW )
{ //some redundant things, purely for dp compat
eval_t * eval ;
edict_t * ent = split - > edict ;
2018-03-25 09:36:14 +00:00
ent - > v - > team = split - > playercolor & 15 ;
2017-08-29 02:29:06 +00:00
eval = svprogfuncs - > GetEdictFieldValue ( svprogfuncs , ent , " playermodel " , ev_string , NULL ) ;
if ( eval )
2018-07-05 16:21:44 +00:00
svprogfuncs - > SetStringField ( svprogfuncs , ent , & eval - > string , InfoBuf_ValueForKey ( & split - > userinfo , " model " ) , false ) ;
2017-08-29 02:29:06 +00:00
eval = svprogfuncs - > GetEdictFieldValue ( svprogfuncs , ent , " playerskin " , ev_string , NULL ) ;
if ( eval )
2018-07-05 16:21:44 +00:00
svprogfuncs - > SetStringField ( svprogfuncs , ent , & eval - > string , InfoBuf_ValueForKey ( & split - > userinfo , " skin " ) , false ) ;
2017-08-29 02:29:06 +00:00
eval = svprogfuncs - > GetEdictFieldValue ( svprogfuncs , ent , " netaddress " , ev_string , NULL ) ;
if ( eval )
{
char buf [ 256 ] ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( split - > netchan . remote_address . type = = NA_LOOPBACK )
svprogfuncs - > SetStringField ( svprogfuncs , ent , & eval - > string , " local " , false ) ; //sigh...
else
svprogfuncs - > SetStringField ( svprogfuncs , ent , & eval - > string , NET_AdrToString ( buf , sizeof ( buf ) , & split - > netchan . remote_address ) , false ) ;
2017-08-29 02:29:06 +00:00
}
}
# endif
2009-03-03 01:52:30 +00:00
if ( split - > spectator )
2004-08-23 00:15:46 +00:00
{
2009-03-03 01:52:30 +00:00
SV_SpawnSpectator ( ) ;
2006-01-21 00:06:49 +00:00
2009-03-03 01:52:30 +00:00
if ( SpectatorConnect )
2006-01-21 00:06:49 +00:00
{
2009-03-03 01:52:30 +00:00
//keep the spectator tracking the player from the previous map
if ( split - > spec_track > 0 )
2018-04-06 17:21:15 +00:00
split - > edict - > v - > goalentity = EDICT_TO_PROG ( svprogfuncs , EDICT_NUM_UB ( svprogfuncs , split - > spec_track ) ) ;
2009-03-03 01:52:30 +00:00
else
split - > edict - > v - > goalentity = 0 ;
// copy spawn parms out of the client_t
2017-05-28 15:42:32 +00:00
SV_SpawnParmsToQC ( split ) ;
2009-03-03 01:52:30 +00:00
// call the spawn function
2018-09-01 04:18:08 +00:00
{
globalvars_t * pr_globals = PR_globals ( svprogfuncs , PR_CURRENT ) ;
pr_global_struct - > time = sv . world . physicstime ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , split - > edict ) ;
if ( pr_globals )
G_FLOAT ( OFS_PARM0 ) = split - > csqcactive ; //this arg is part of EXT_CSQC_1, but doesn't have to be supported by the mod
PR_ExecuteProgram ( svprogfuncs , SpectatorConnect ) ;
}
2006-01-21 00:06:49 +00:00
}
2013-03-12 22:35:33 +00:00
sv . spawned_observer_slots + + ;
2004-08-23 00:15:46 +00:00
}
else
{
2012-01-17 07:57:46 +00:00
sv . spawned_client_slots + + ;
2009-03-03 01:52:30 +00:00
if ( svprogfuncs )
{
eval_t * eval , * eval2 ;
2011-05-20 04:10:46 +00:00
eval = PR_FindGlobal ( svprogfuncs , " ClientReEnter " , 0 , NULL ) ;
2014-05-10 16:37:53 +00:00
if ( eval & & eval - > function & & split - > spawninfo )
2009-03-03 01:52:30 +00:00
{
globalvars_t * pr_globals = PR_globals ( svprogfuncs , PR_CURRENT ) ;
2015-11-18 07:37:39 +00:00
size_t j ;
2009-03-03 01:52:30 +00:00
edict_t * ent ;
ent = split - > edict ;
j = strlen ( split - > spawninfo ) ;
2009-11-04 21:16:50 +00:00
World_UnlinkEdict ( ( wedict_t * ) ent ) ;
2009-03-03 01:52:30 +00:00
svprogfuncs - > restoreent ( svprogfuncs , split - > spawninfo , & j , ent ) ;
2016-07-12 00:40:13 +00:00
eval2 = svprogfuncs - > GetEdictFieldValue ( svprogfuncs , ent , " stats_restored " , ev_float , NULL ) ;
2009-03-03 01:52:30 +00:00
if ( eval2 )
eval2 - > _float = 1 ;
2017-05-28 15:42:32 +00:00
SV_SpawnParmsToQC ( split ) ;
2009-11-04 21:16:50 +00:00
pr_global_struct - > time = sv . world . physicstime ;
2009-03-03 01:52:30 +00:00
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , ent ) ;
G_FLOAT ( OFS_PARM0 ) = sv . time - split - > spawninfotime ;
PR_ExecuteProgram ( svprogfuncs , eval - > function ) ;
}
else
2004-08-23 00:15:46 +00:00
{
// copy spawn parms out of the client_t
2017-05-28 15:42:32 +00:00
SV_SpawnParmsToQC ( split ) ;
2004-08-23 00:15:46 +00:00
// call the spawn function
2007-09-02 19:55:17 +00:00
# ifdef VM_Q1
2009-03-03 01:52:30 +00:00
if ( svs . gametype = = GT_Q1QVM )
Q1QVM_ClientConnect ( split ) ;
else
2007-09-02 19:55:17 +00:00
# endif
2009-03-03 01:52:30 +00:00
{
2009-04-19 00:50:42 +00:00
globalvars_t * pr_globals = PR_globals ( svprogfuncs , PR_CURRENT ) ;
2009-11-04 21:16:50 +00:00
pr_global_struct - > time = sv . world . physicstime ;
2009-03-03 01:52:30 +00:00
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , split - > edict ) ;
2011-12-05 15:23:40 +00:00
if ( pr_globals )
G_FLOAT ( OFS_PARM0 ) = split - > csqcactive ; //this arg is part of EXT_CSQC_1, but doesn't have to be supported by the mod
2014-03-30 08:55:06 +00:00
sv . skipbprintclient = host_client ;
2011-12-05 15:23:40 +00:00
if ( pr_global_ptrs - > ClientConnect )
PR_ExecuteProgram ( svprogfuncs , * pr_global_ptrs - > ClientConnect ) ;
2014-03-30 08:55:06 +00:00
sv . skipbprintclient = NULL ;
2011-05-15 13:23:13 +00:00
2009-03-03 01:52:30 +00:00
// actually spawn the player
2009-11-04 21:16:50 +00:00
pr_global_struct - > time = sv . world . physicstime ;
2009-03-03 01:52:30 +00:00
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , split - > edict ) ;
2011-12-05 15:23:40 +00:00
if ( pr_global_ptrs - > PutClientInServer )
PR_ExecuteProgram ( svprogfuncs , * pr_global_ptrs - > PutClientInServer ) ;
else
{
split - > edict - > v - > health = 100 ;
split - > edict - > v - > mins [ 0 ] = - 16 ;
split - > edict - > v - > mins [ 1 ] = - 16 ;
split - > edict - > v - > mins [ 2 ] = - 24 ;
split - > edict - > v - > maxs [ 0 ] = 16 ;
split - > edict - > v - > maxs [ 1 ] = 16 ;
split - > edict - > v - > maxs [ 2 ] = 32 ;
2021-11-03 20:30:40 +00:00
split - > edict - > v - > view_ofs [ 2 ] = DEFAULT_VIEWHEIGHT ;
if ( sv . world . worldmodel - > fromgame = = fg_quake3 )
split - > edict - > v - > view_ofs [ 2 ] = 26 ; //q3 defaults to slightly higher view heights (though same player size as quake).
if ( sv . world . worldmodel - > hulls [ 1 ] . clip_maxs [ 2 ] - sv . world . worldmodel - > hulls [ 1 ] . clip_mins [ 2 ] > 0 )
{
VectorCopy ( sv . world . worldmodel - > hulls [ 1 ] . clip_mins , split - > edict - > v - > mins ) ;
VectorCopy ( sv . world . worldmodel - > hulls [ 1 ] . clip_maxs , split - > edict - > v - > maxs ) ;
}
2012-02-15 13:53:30 +00:00
split - > edict - > v - > movetype = MOVETYPE_NOCLIP ;
2011-12-05 15:23:40 +00:00
}
2016-01-18 05:22:07 +00:00
VectorCopy ( split - > edict - > v - > origin , split - > edict - > v - > oldorigin ) ; //make sure oldorigin isn't 0 0 0 or anything too clumsy like that. stuck somewhere killable is better than stuck outside the map.
2009-03-03 01:52:30 +00:00
}
2004-08-23 00:15:46 +00:00
2009-03-03 01:52:30 +00:00
oh = host_client ;
2010-08-11 23:55:35 +00:00
host_client = split ;
sv_player = host_client - > edict ;
2009-03-03 01:52:30 +00:00
SV_PreRunCmd ( ) ;
{
usercmd_t cmd ;
memset ( & cmd , 0 , sizeof ( cmd ) ) ;
cmd . msec = 0 ;
2004-08-23 00:15:46 +00:00
# define ANGLE2SHORT(x) (x) * (65536 / 360.0)
2009-03-03 01:52:30 +00:00
cmd . angles [ 0 ] = ANGLE2SHORT ( split - > edict - > v - > v_angle [ 0 ] ) ;
cmd . angles [ 1 ] = ANGLE2SHORT ( split - > edict - > v - > v_angle [ 1 ] ) ;
cmd . angles [ 2 ] = ANGLE2SHORT ( split - > edict - > v - > v_angle [ 2 ] ) ;
SV_RunCmd ( & cmd , false ) ;
2004-08-23 00:15:46 +00:00
}
2009-03-03 01:52:30 +00:00
SV_PostRunCmd ( ) ;
2018-10-27 04:32:18 +00:00
split - > lastruncmd = sv . time * 1000 ;
2009-03-03 01:52:30 +00:00
host_client = oh ;
2018-03-25 09:36:14 +00:00
sv_player = oh ? oh - > edict : NULL ;
2004-08-23 00:15:46 +00:00
}
}
}
2020-05-16 13:12:58 +00:00
SV_SendFixAngle ( split , NULL , FIXANGLE_FIXED , false ) ;
split - > edict - > v - > fixangle = FIXANGLE_NO ; //no point doing it again
2017-08-29 02:29:06 +00:00
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2020-05-16 13:12:58 +00:00
split - > dp_ping = NULL ;
split - > dp_pl = NULL ;
if ( progstype = = PROG_NQ )
{
split - > dp_ping = ( float * ) sv . world . progs - > GetEdictFieldValue ( sv . world . progs , split - > edict , " ping " , ev_float , NULL ) ;
split - > dp_pl = ( float * ) sv . world . progs - > GetEdictFieldValue ( sv . world . progs , split - > edict , " ping_packetloss " , ev_float , NULL ) ;
}
2017-09-20 11:27:13 +00:00
# endif
2020-05-16 13:12:58 +00:00
}
2009-03-03 01:52:30 +00:00
}
2004-08-23 00:15:46 +00:00
2008-11-09 22:29:28 +00:00
/*
= = = = = = = = = = = = = = = = = =
SV_Begin_f
= = = = = = = = = = = = = = = = = =
*/
void SV_Begin_f ( void )
{
client_t * split ;
unsigned pmodel = 0 , emodel = 0 ;
if ( ! SV_CheckRealIP ( host_client , true ) )
{
if ( host_client - > protocol = = SCP_QUAKE2 )
ClientReliableWrite_Begin ( host_client , svcq2_stufftext , 13 + strlen ( Cmd_Args ( ) ) ) ;
else
ClientReliableWrite_Begin ( host_client , svc_stufftext , 13 + strlen ( Cmd_Args ( ) ) ) ;
ClientReliableWrite_String ( host_client , va ( " cmd begin %s \n " , Cmd_Args ( ) ) ) ;
return ;
}
if ( host_client - > state = = cs_spawned )
return ; // don't begin again
for ( split = host_client ; split ; split = split - > controlled )
split - > state = cs_spawned ;
// handle the case of a level changing while a client was connecting
2018-09-01 04:18:08 +00:00
if ( atoi ( Cmd_Argv ( 1 ) ) ! = svs . spawncount )
2008-11-09 22:29:28 +00:00
{
Con_Printf ( " SV_Begin_f from different level \n " ) ;
SV_New_f ( ) ;
return ;
}
for ( split = host_client ; split ; split = split - > controlled )
{ //tell the gamecode they're ready
SV_Begin_Core ( split ) ;
}
2004-08-23 00:15:46 +00:00
// clear the net statistics, because connecting gives a bogus picture
host_client - > netchan . frame_latency = 0 ;
host_client - > netchan . frame_rate = 0 ;
host_client - > netchan . drop_count = 0 ;
host_client - > netchan . good_count = 0 ;
//check he's not cheating
if ( progstype = = PROG_QW )
{
2018-07-05 16:21:44 +00:00
pmodel = atoi ( InfoBuf_ValueForKey ( & host_client - > userinfo , " pmodel " ) ) ;
emodel = atoi ( InfoBuf_ValueForKey ( & host_client - > userinfo , " emodel " ) ) ;
2004-08-23 00:15:46 +00:00
if ( pmodel ! = sv . model_player_checksum | |
emodel ! = sv . eyes_player_checksum )
2013-11-29 14:36:47 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH , " warning: %s eyes or player model does not match \n " , host_client - > name ) ;
2004-08-23 00:15:46 +00:00
}
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
SV_MVD_AutoRecord ( ) ;
# endif
2004-08-23 00:15:46 +00:00
}
//=============================================================================
2018-11-19 06:37:25 +00:00
# ifdef NQPROT
2007-06-20 00:02:54 +00:00
//dp downloads are a 2-stream system
//the server->client stream is as you'd expect. except that its unreliable rather than reliable
//the client->server stream contains no actual data.
//when c2s has a hole, the s2c stream is reset to the last-known 'good' position.
//eventually the client is left acking packets with no data in them, the server then tells the client that the download is complete.
//the client does no checks to see if there's a hole, other than the crc
//so any single lost packet (even client->server) means that the entire stream will be set back by your ping time
void SV_DarkPlacesDownloadChunk ( client_t * cl , sizebuf_t * msg )
2007-06-10 21:33:24 +00:00
{
# define MAXDPDOWNLOADCHUNK 1024
char buffer [ MAXDPDOWNLOADCHUNK ] ;
int size , start ;
2007-06-20 00:02:54 +00:00
if ( ! ISNQCLIENT ( cl ) )
return ;
if ( ! cl - > download )
return ;
if ( ! cl - > downloadstarted )
return ;
2007-06-10 21:33:24 +00:00
if ( cl - > num_backbuf )
2007-06-20 00:02:54 +00:00
return ;
2011-05-15 13:23:13 +00:00
2007-06-20 00:02:54 +00:00
size = 1024 ; //fixme
2015-10-27 15:20:15 +00:00
if ( size > msg - > maxsize - msg - > cursize )
2017-06-21 01:24:25 +00:00
size = msg - > maxsize - msg - > cursize ;
if ( size < = 7 )
return ; //no space.
size - = 7 ;
2011-05-15 13:23:13 +00:00
2007-06-10 21:33:24 +00:00
if ( size > MAXDPDOWNLOADCHUNK ) //don't clog it too much
size = MAXDPDOWNLOADCHUNK ;
start = VFS_TELL ( cl - > download ) ;
if ( start + size > cl - > downloadsize ) //clamp to the size of the file.
size = cl - > downloadsize - start ;
2007-06-20 00:02:54 +00:00
size = VFS_READ ( cl - > download , buffer , size ) ;
if ( size < 0 )
size = 0 ;
2007-06-10 21:33:24 +00:00
2007-06-20 00:02:54 +00:00
MSG_WriteByte ( msg , svcdp_downloaddata ) ;
MSG_WriteLong ( msg , start ) ;
MSG_WriteShort ( msg , size ) ;
SZ_Write ( msg , buffer , size ) ;
2007-06-10 21:33:24 +00:00
}
2007-06-20 00:02:54 +00:00
void SVDP_StartDownload_f ( void )
2007-06-10 21:33:24 +00:00
{
2021-10-05 05:05:56 +00:00
// if (host_client->protocol != SCP_DARKPLACES7)
// return;
2007-06-20 00:02:54 +00:00
if ( ! host_client - > download )
return ;
host_client - > downloadstarted = true ;
2021-10-05 05:05:56 +00:00
host_client - > downloadacked = 0 ;
2007-06-10 21:33:24 +00:00
}
void SV_DarkPlacesDownloadAck ( client_t * cl )
{
int start = MSG_ReadLong ( ) ;
int size = ( unsigned short ) MSG_ReadShort ( ) ;
2007-06-20 00:02:54 +00:00
if ( ! cl - > download )
return ;
2022-03-01 02:51:55 +00:00
if ( start = = cl - > downloadsize & & ! size )
2007-06-10 21:33:24 +00:00
{
char * s ;
2021-04-14 05:21:04 +00:00
const hashfunc_t * hfunc = & hash_crc16 ;
void * hctx = alloca ( hfunc - > contextsize ) ;
2007-06-10 21:33:24 +00:00
int pos = 0 , csize ;
2021-04-14 05:21:04 +00:00
qbyte chunk [ 65536 ] ;
hfunc - > init ( hctx ) ;
2007-06-10 21:33:24 +00:00
VFS_SEEK ( host_client - > download , 0 ) ;
while ( pos < host_client - > downloadsize )
{
csize = sizeof ( chunk ) ;
if ( pos + csize > host_client - > downloadsize )
csize = host_client - > downloadsize - pos ;
2022-03-01 02:51:55 +00:00
if ( csize ! = VFS_READ ( host_client - > download , chunk , csize ) )
break ;
2021-04-14 05:21:04 +00:00
hfunc - > process ( hctx , chunk , csize ) ;
2007-06-10 21:33:24 +00:00
pos + = csize ;
}
2021-10-05 05:05:56 +00:00
s = va ( " \n cl_downloadfinished %u %i \" %s \" \n " , ( unsigned int ) host_client - > downloadsize , hashfunc_terminate_uint ( hfunc , hctx ) , host_client - > downloadfn ) ;
2007-06-10 21:33:24 +00:00
ClientReliableWrite_Begin ( cl , svc_stufftext , 2 + strlen ( s ) ) ;
ClientReliableWrite_String ( cl , s ) ;
2007-06-20 00:02:54 +00:00
VFS_CLOSE ( host_client - > download ) ;
2013-08-21 07:14:39 +00:00
host_client - > send_message = true ;
2007-06-20 00:02:54 +00:00
host_client - > download = NULL ;
host_client - > downloadsize = 0 ;
2007-06-10 21:33:24 +00:00
}
2022-03-01 02:51:55 +00:00
else if ( start ! = cl - > downloadacked | | ! size )
{
//packetloss
VFS_SEEK ( cl - > download , cl - > downloadacked ) ;
cl - > downloadcount = cl - > downloadacked ;
}
else
cl - > downloadacked = start + size ; //successful packet
2007-06-10 21:33:24 +00:00
}
2018-11-19 06:37:25 +00:00
# endif
2007-06-10 21:33:24 +00:00
2014-06-24 03:02:32 +00:00
static void SV_NextChunkedDownload ( unsigned int chunknum , int ezpercent , int ezfilenum , int chunks )
2005-01-16 02:24:05 +00:00
{
2017-11-16 22:20:40 +00:00
char buffer [ DLBLOCKSIZE ] ;
qbyte oobdata [ 1 + ( sizeof ( " \\ chunk " ) - 1 ) + 4 + 1 + 4 + DLBLOCKSIZE ] ;
2008-11-09 22:29:28 +00:00
sizebuf_t * msg , msg_oob ;
2006-10-15 19:31:24 +00:00
int i ;
2011-08-16 04:12:15 +00:00
int error = false ;
2014-06-24 03:02:32 +00:00
//can't support this yet. at least forcing to 1 avoids too bad infinite loops. this can be a nasty dos attack on a server. if (chunks < 1)
chunks = 1 ;
2008-11-09 22:29:28 +00:00
msg = & host_client - > datagram ;
2014-06-24 03:02:32 +00:00
if ( chunknum = = - 1 )
error = 2 ; //silent, don't report it
2017-11-16 22:20:40 +00:00
else if ( chunknum * DLBLOCKSIZE > host_client - > downloadsize )
2008-11-09 22:29:28 +00:00
{
2017-11-16 22:20:40 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Warning: Invalid file chunk requested %u to %u of %u. \n " , chunknum * DLBLOCKSIZE , ( chunknum + 1 ) * DLBLOCKSIZE , host_client - > downloadsize ) ;
2011-08-16 04:12:15 +00:00
error = 2 ;
2008-11-09 22:29:28 +00:00
}
2017-11-16 22:20:40 +00:00
if ( ! error & & VFS_SEEK ( host_client - > download , ( qofs_t ) chunknum * DLBLOCKSIZE ) = = false )
2008-11-09 22:29:28 +00:00
error = true ;
else
{
2017-11-16 22:20:40 +00:00
if ( host_client - > downloadcount < chunknum * DLBLOCKSIZE )
host_client - > downloadcount = chunknum * DLBLOCKSIZE ;
2008-11-09 22:29:28 +00:00
}
2006-10-15 19:31:24 +00:00
2014-06-24 03:02:32 +00:00
while ( ! error & & chunks > 0 )
2008-11-09 22:29:28 +00:00
{
2017-11-16 22:20:40 +00:00
if ( ( host_client - > datagram . cursize + DLBLOCKSIZE + 5 + 50 > host_client - > datagram . maxsize ) | | ( host_client - > datagram . cursize + DLBLOCKSIZE + 5 > 1400 ) )
2014-06-24 03:02:32 +00:00
{
//would overflow the packet, or result in (ethernet) fragmentation and high packet loss.
msg = & msg_oob ;
2006-10-15 19:45:33 +00:00
2014-06-24 03:02:32 +00:00
if ( ! ezfilenum ) //can't oob it
return ;
2008-11-09 22:29:28 +00:00
2014-06-24 03:02:32 +00:00
if ( host_client - > waschoked )
return ; //don't let chunked downloads flood out the standard packets.
2009-05-24 10:11:17 +00:00
2014-06-24 03:02:32 +00:00
if ( ! Netchan_CanPacket ( & host_client - > netchan , SV_RateForClient ( host_client ) ) )
return ;
}
2006-10-15 19:45:33 +00:00
2017-11-16 22:20:40 +00:00
i = VFS_READ ( host_client - > download , buffer , DLBLOCKSIZE ) ;
2005-01-16 02:24:05 +00:00
2014-06-24 03:02:32 +00:00
if ( i > 0 )
2008-11-09 22:29:28 +00:00
{
2014-06-24 03:02:32 +00:00
if ( msg = = & msg_oob )
{
msg = & msg_oob ;
msg - > cursize = 0 ;
msg - > maxsize = sizeof ( oobdata ) ;
msg - > currentbit = 0 ;
msg - > packing = SZ_RAWBYTES ;
msg - > allowoverflow = 0 ;
msg - > overflowed = 0 ;
msg - > data = oobdata ;
MSG_WriteByte ( msg , A2C_PRINT ) ;
SZ_Write ( msg , " \\ chunk " , 6 ) ;
MSG_WriteLong ( msg , ezfilenum ) ; //echoing the file num is used so the packets don't go out of sync.
}
2008-11-09 22:29:28 +00:00
2017-11-16 22:20:40 +00:00
if ( i ! = DLBLOCKSIZE )
memset ( buffer + i , 0 , DLBLOCKSIZE - i ) ;
2006-10-15 19:31:24 +00:00
2014-06-24 03:02:32 +00:00
MSG_WriteByte ( msg , svc_download ) ;
MSG_WriteLong ( msg , chunknum ) ;
2017-11-16 22:20:40 +00:00
SZ_Write ( msg , buffer , DLBLOCKSIZE ) ;
2008-11-09 22:29:28 +00:00
2014-06-24 03:02:32 +00:00
if ( msg = = & msg_oob )
{
Netchan_OutOfBand ( NS_SERVER , & host_client - > netchan . remote_address , msg_oob . cursize , msg_oob . data ) ;
Netchan_Block ( & host_client - > netchan , msg_oob . cursize , SV_RateForClient ( host_client ) ) ;
host_client - > netchan . bytesout + = msg_oob . cursize ;
}
2008-11-09 22:29:28 +00:00
}
2014-06-24 03:02:32 +00:00
else if ( i < 0 )
error = true ;
chunks - - ;
chunknum + + ;
2008-11-09 22:29:28 +00:00
}
if ( error )
{
VFS_CLOSE ( host_client - > download ) ;
host_client - > download = NULL ;
2011-08-16 04:12:15 +00:00
if ( error ! = 2 )
{ /*work around for ezquake*/
ClientReliableWrite_Begin ( host_client , svc_download , 10 + strlen ( host_client - > downloadfn ) ) ;
ClientReliableWrite_Long ( host_client , - 1 ) ;
ClientReliableWrite_Long ( host_client , - 3 ) ;
ClientReliableWrite_String ( host_client , host_client - > downloadfn ) ;
}
2008-11-09 22:29:28 +00:00
2019-06-06 18:07:12 +00:00
# ifdef NQPROT
2008-11-09 22:29:28 +00:00
host_client - > downloadstarted = false ;
2019-06-06 18:07:12 +00:00
# endif
2019-03-12 05:04:27 +00:00
2019-05-10 09:31:21 +00:00
# if defined(HAVE_LEGACY) && defined(MVD_RECORDING)
2019-03-12 05:04:27 +00:00
SV_DownloadQueueNext ( host_client ) ;
# endif
2006-10-15 19:31:24 +00:00
}
2005-01-16 02:24:05 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = =
SV_NextDownload_f
= = = = = = = = = = = = = = = = = =
*/
void SV_NextDownload_f ( void )
{
qbyte buffer [ 1024 ] ;
int r ;
int percent ;
int size ;
if ( ! host_client - > download )
return ;
2005-01-16 19:55:35 +00:00
# ifdef PEXT_CHUNKEDDOWNLOADS
2005-01-16 02:24:05 +00:00
if ( host_client - > fteprotocolextensions & PEXT_CHUNKEDDOWNLOADS )
{
2009-04-06 00:34:32 +00:00
if ( Cmd_Argc ( ) < 2 )
2014-06-24 03:02:32 +00:00
SV_NextChunkedDownload ( atoi ( Cmd_Argv ( 1 ) ) , atoi ( Cmd_Argv ( 2 ) ) , atoi ( Cmd_Argv ( 3 ) ) , atoi ( Cmd_Argv ( 4 ) ) ) ;
2009-04-06 00:34:32 +00:00
else
2014-06-24 03:02:32 +00:00
SV_NextChunkedDownload ( atoi ( Cmd_Argv ( 1 ) ) , atoi ( Cmd_Argv ( 2 ) ) , atoi ( Cmd_Argv ( 3 ) ) , atoi ( Cmd_Argv ( 4 ) ) ) ;
2005-01-16 02:24:05 +00:00
return ;
}
2005-01-16 19:55:35 +00:00
# endif
2005-01-16 02:24:05 +00:00
2004-08-23 00:15:46 +00:00
r = host_client - > downloadsize - host_client - > downloadcount ;
/*
# ifdef PEXT_ZLIBDL
if ( host_client - > protocolextensions & PEXT_ZLIBDL )
{
if ( r > 1024 ) //expect a little more.
r = 1024 ;
}
else
# endif
*/
if ( r > 768 )
r = 768 ;
2005-12-21 03:07:33 +00:00
r = VFS_READ ( host_client - > download , buffer , r ) ;
2005-05-26 12:55:34 +00:00
ClientReliableWrite_Begin ( host_client , ISQ2CLIENT ( host_client ) ? svcq2_download : svc_download , 6 + r ) ;
2004-08-23 00:15:46 +00:00
ClientReliableWrite_Short ( host_client , r ) ;
host_client - > downloadcount + = r ;
size = host_client - > downloadsize ;
2006-08-02 05:34:17 +00:00
if ( host_client - > downloadcount < size )
{
if ( ! size )
size = 1 ;
percent = ( double ) host_client - > downloadcount * 100.0 / size ;
percent = bound ( 0 , percent , 99 ) ;
}
else
percent = 100 ;
2004-08-23 00:15:46 +00:00
# ifdef PEXT_ZLIBDL
if ( host_client - > fteprotocolextensions & PEXT_ZLIBDL )
{
ClientReliableWrite_Byte ( host_client , percent + 101 ) ;
ClientReliableWrite_ZLib ( host_client , buffer , r ) ;
}
else
# endif
{
ClientReliableWrite_Byte ( host_client , percent ) ;
ClientReliableWrite_SZ ( host_client , buffer , r ) ;
}
2006-08-02 05:34:17 +00:00
if ( host_client - > downloadcount < host_client - > downloadsize )
2004-08-23 00:15:46 +00:00
return ;
2005-12-21 03:07:33 +00:00
VFS_CLOSE ( host_client - > download ) ;
2004-08-23 00:15:46 +00:00
host_client - > download = NULL ;
2019-05-10 09:31:21 +00:00
# if defined(HAVE_LEGACY) && defined(MVD_RECORDING)
2019-03-12 05:04:27 +00:00
SV_DownloadQueueNext ( host_client ) ;
# endif
2004-08-23 00:15:46 +00:00
}
2013-05-03 04:28:08 +00:00
void VARGS OutofBandPrintf ( netadr_t * where , char * fmt , . . . )
2004-08-23 00:15:46 +00:00
{
va_list argptr ;
char send [ 1024 ] ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
send [ 0 ] = 0xff ;
send [ 1 ] = 0xff ;
send [ 2 ] = 0xff ;
send [ 3 ] = 0xff ;
send [ 4 ] = A2C_PRINT ;
va_start ( argptr , fmt ) ;
2011-07-22 15:11:35 +00:00
vsnprintf ( send + 5 , sizeof ( send ) - 5 , fmt , argptr ) ;
2004-08-23 00:15:46 +00:00
va_end ( argptr ) ;
2018-12-28 00:04:36 +00:00
NET_SendPacket ( svs . sockets , strlen ( send ) + 1 , send , where ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
SV_NextUpload
= = = = = = = = = = = = = = = = = =
*/
void SV_NextUpload ( void )
{
int percent ;
int size ;
if ( ! * host_client - > uploadfn )
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Upload denied \n " ) ;
2004-08-23 00:15:46 +00:00
ClientReliableWrite_Begin ( host_client , svc_stufftext , 8 ) ;
2013-03-12 23:24:15 +00:00
ClientReliableWrite_String ( host_client , " stopul \n " ) ;
2004-08-23 00:15:46 +00:00
// suck out rest of packet
size = MSG_ReadShort ( ) ; MSG_ReadByte ( ) ;
2022-03-08 05:34:26 +00:00
MSG_ReadSkip ( size ) ;
2004-08-23 00:15:46 +00:00
return ;
}
size = MSG_ReadShort ( ) ;
percent = MSG_ReadByte ( ) ;
if ( ! host_client - > upload )
{
2013-03-12 23:24:15 +00:00
FS_CreatePath ( host_client - > uploadfn , FS_GAMEONLY ) ;
2009-11-04 21:16:50 +00:00
host_client - > upload = FS_OpenVFS ( host_client - > uploadfn , " wb " , FS_GAMEONLY ) ;
2004-08-23 00:15:46 +00:00
if ( ! host_client - > upload )
{
Sys_Printf ( " Can't create %s \n " , host_client - > uploadfn ) ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 8 ) ;
2013-03-12 23:24:15 +00:00
ClientReliableWrite_String ( host_client , " stopul \n " ) ;
2004-08-23 00:15:46 +00:00
* host_client - > uploadfn = 0 ;
return ;
}
Con_Printf ( " Receiving %s from %d... \n " , host_client - > uploadfn , host_client - > userid ) ;
if ( host_client - > remote_snap )
2013-05-03 04:28:08 +00:00
OutofBandPrintf ( & host_client - > snap_from , " Server receiving %s from %d... \n " , host_client - > uploadfn , host_client - > userid ) ;
2004-08-23 00:15:46 +00:00
}
2022-03-08 05:34:26 +00:00
VFS_WRITE ( host_client - > upload , net_message . data + MSG_GetReadCount ( ) , size ) ;
MSG_ReadSkip ( size ) ;
2004-08-23 00:15:46 +00:00
if ( percent ! = 100 )
{
ClientReliableWrite_Begin ( host_client , svc_stufftext , 8 ) ;
ClientReliableWrite_String ( host_client , " nextul \n " ) ;
}
else
{
2005-12-21 03:07:33 +00:00
VFS_CLOSE ( host_client - > upload ) ;
2004-08-23 00:15:46 +00:00
host_client - > upload = NULL ;
Con_Printf ( " %s upload completed. \n " , host_client - > uploadfn ) ;
if ( host_client - > remote_snap )
{
char * p ;
if ( ( p = strchr ( host_client - > uploadfn , ' / ' ) ) ! = NULL )
p + + ;
else
p = host_client - > uploadfn ;
2013-05-03 04:28:08 +00:00
OutofBandPrintf ( & host_client - > snap_from , " %s upload completed. \n To download, enter: \n download %s \n " ,
2004-08-23 00:15:46 +00:00
host_client - > uploadfn , p ) ;
}
2013-03-12 23:24:15 +00:00
* host_client - > uploadfn = 0 ; //don't let it get overwritten again
2004-08-23 00:15:46 +00:00
}
2010-11-15 02:40:31 +00:00
}
# ifdef VOICECHAT
2010-12-18 17:02:47 +00:00
/*
Pivicy issues :
By sending voice chat to a server , you are unsure who might be listening .
Voice can be recorded to an mvd , potentially including voice .
Spectators tracvking you are able to hear team chat of your team .
You ' re never quite sure if anyone might join the server and your team before you finish saying a sentance .
You run the risk of sounds around you being recorded by quake , including but not limited to : TV channels , loved ones , phones , YouTube videos featuring certain moans .
Default on non - team games is to broadcast .
*/
2010-12-05 02:46:07 +00:00
# define VOICE_RING_SIZE 512 /*POT*/
2010-11-15 02:40:31 +00:00
struct
{
struct voice_ring_s
{
unsigned int sender ;
2013-06-23 02:17:02 +00:00
unsigned char receiver [ ( MAX_CLIENTS + 7 ) / 8 ] ;
2010-11-20 22:01:16 +00:00
unsigned char gen ;
2010-11-15 02:40:31 +00:00
unsigned char seq ;
unsigned int datalen ;
unsigned char data [ 1024 ] ;
} ring [ VOICE_RING_SIZE ] ;
unsigned int write ;
} voice ;
void SV_VoiceReadPacket ( void )
{
2010-12-05 02:46:07 +00:00
unsigned int vt = host_client - > voice_target ;
2011-01-04 02:56:16 +00:00
unsigned int j ;
2010-11-15 02:40:31 +00:00
struct voice_ring_s * ring ;
unsigned short bytes ;
client_t * cl ;
2010-11-20 22:01:16 +00:00
unsigned char gen = MSG_ReadByte ( ) ;
2010-11-15 02:40:31 +00:00
unsigned char seq = MSG_ReadByte ( ) ;
/*read the data from the client*/
bytes = MSG_ReadShort ( ) ;
ring = & voice . ring [ voice . write & ( VOICE_RING_SIZE - 1 ) ] ;
2014-03-30 08:55:06 +00:00
//voice data does not get echoed to the sender unless sv_voip_echo is on too, which is rarely the case, so no worries about leaking the mute+deaf talking-to-yourself thing
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( bytes > sizeof ( ring - > data ) | | ( host_client - > penalties & ( BAN_MUTE | BAN_VMUTE ) ) | | ! sv_voip . ival )
2010-11-15 02:40:31 +00:00
{
MSG_ReadSkip ( bytes ) ;
return ;
}
else
{
voice . write + + ;
MSG_ReadData ( ring - > data , bytes ) ;
}
2010-11-20 22:01:16 +00:00
2010-11-15 02:40:31 +00:00
ring - > datalen = bytes ;
ring - > sender = host_client - svs . clients ;
2010-11-20 22:01:16 +00:00
ring - > gen = gen ;
2010-11-15 02:40:31 +00:00
ring - > seq = seq ;
2010-12-05 02:46:07 +00:00
/*broadcast it its to their team, and its not teamplay*/
2016-07-12 00:40:13 +00:00
if ( vt = = VT_TEAM & & ( ! teamplay . ival | | coop . ival ) )
2010-12-05 02:46:07 +00:00
vt = VT_ALL ;
2010-11-15 02:40:31 +00:00
/*figure out which team members are meant to receive it*/
2013-06-23 02:17:02 +00:00
for ( j = 0 ; j < ( MAX_CLIENTS + 7 ) / 8 ; j + + )
2010-11-15 02:40:31 +00:00
ring - > receiver [ j ] = 0 ;
2013-12-02 14:30:30 +00:00
for ( j = 0 , cl = svs . clients ; j < svs . allocated_client_slots ; j + + , cl + + )
2010-11-15 02:40:31 +00:00
{
if ( cl - > state ! = cs_spawned & & cl - > state ! = cs_connected )
continue ;
2010-12-05 02:46:07 +00:00
/*spectators may only talk to spectators*/
2010-11-15 02:40:31 +00:00
if ( host_client - > spectator & & ! sv_spectalk . ival )
if ( ! cl - > spectator )
continue ;
2004-08-23 00:15:46 +00:00
2014-06-25 03:53:11 +00:00
if ( cl - > penalties & BAN_DEAF )
2014-03-30 08:55:06 +00:00
continue ;
2010-12-05 02:46:07 +00:00
if ( vt = = VT_TEAM )
2010-11-15 02:40:31 +00:00
{
// the spectator team
if ( host_client - > spectator )
{
if ( ! cl - > spectator )
continue ;
}
else
{
if ( strcmp ( cl - > team , host_client - > team ) | | cl - > spectator )
continue ; // on different teams
}
}
2010-12-05 02:46:07 +00:00
else if ( vt = = VT_NONMUTED )
{
if ( host_client - > voice_mute [ j > > 3 ] & ( 1 < < ( j & 3 ) ) )
continue ;
}
2014-04-27 23:16:07 +00:00
else if ( vt = = VT_SPECSELF )
{
//spectators spectating self hear it.
//self hears it (for demos, voip_echo stops it from actually being echoed)
if ( ! host_client - > spectator | | host_client - > spec_track ! = host_client - svs . clients )
if ( j ! = host_client - svs . clients )
continue ;
}
2010-12-05 02:46:07 +00:00
else if ( vt > = VT_PLAYERSLOT0 )
{
if ( j ! = vt - VT_PLAYERSLOT0 )
continue ;
}
2010-11-15 02:40:31 +00:00
2010-12-23 03:55:10 +00:00
ring - > receiver [ j > > 3 ] | = 1 < < ( j & 3 ) ;
2010-11-15 02:40:31 +00:00
}
2010-11-20 22:01:16 +00:00
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2010-12-18 17:02:47 +00:00
if ( sv . mvdrecording & & sv_voip_record . ival & & ! ( sv_voip_record . ival = = 2 & & ! host_client - > spectator ) )
2010-11-20 22:01:16 +00:00
{
2012-08-04 01:35:52 +00:00
sizebuf_t * msg ;
2010-11-20 22:01:16 +00:00
// non-team messages should be seen always, even if not tracking any player
2010-12-05 02:46:07 +00:00
if ( vt = = VT_ALL & & ( ! host_client - > spectator | | sv_spectalk . ival ) )
2010-11-20 22:01:16 +00:00
{
2012-08-04 01:35:52 +00:00
msg = MVDWrite_Begin ( dem_all , 0 , ring - > datalen + 6 ) ;
2010-11-20 22:01:16 +00:00
}
else
{
unsigned int cls ;
cls = ring - > receiver [ 0 ] |
( ring - > receiver [ 1 ] < < 8 ) |
( ring - > receiver [ 2 ] < < 16 ) |
( ring - > receiver [ 3 ] < < 24 ) ;
2012-08-04 01:35:52 +00:00
msg = MVDWrite_Begin ( dem_multiple , cls , ring - > datalen + 6 ) ;
2010-11-20 22:01:16 +00:00
}
2012-08-04 01:35:52 +00:00
MSG_WriteByte ( msg , svcfte_voicechat ) ;
MSG_WriteByte ( msg , ring - > sender ) ;
MSG_WriteByte ( msg , ring - > gen ) ;
MSG_WriteByte ( msg , ring - > seq ) ;
MSG_WriteShort ( msg , ring - > datalen ) ;
SZ_Write ( msg , ring - > data , ring - > datalen ) ;
2010-11-20 22:01:16 +00:00
}
2018-09-01 04:18:08 +00:00
# endif
2004-08-23 00:15:46 +00:00
}
2010-11-15 02:40:31 +00:00
void SV_VoiceInitClient ( client_t * client )
{
2010-12-05 02:46:07 +00:00
client - > voice_target = VT_TEAM ;
client - > voice_active = false ;
2010-11-15 02:40:31 +00:00
client - > voice_read = voice . write ;
memset ( client - > voice_mute , 0 , sizeof ( client - > voice_mute ) ) ;
}
void SV_VoiceSendPacket ( client_t * client , sizebuf_t * buf )
{
2010-12-23 03:55:10 +00:00
unsigned int clno ;
2010-11-15 02:40:31 +00:00
qboolean send ;
struct voice_ring_s * ring ;
2010-12-23 03:55:10 +00:00
if ( client - > controller )
client = client - > controller ;
clno = client - svs . clients ;
2010-11-15 02:40:31 +00:00
if ( ! ( client - > fteprotocolextensions2 & PEXT2_VOICECHAT ) )
return ;
if ( ! client - > voice_active | | client - > num_backbuf )
{
client - > voice_read = voice . write ;
return ;
}
while ( client - > voice_read < voice . write )
{
/*they might be too far behind*/
if ( client - > voice_read + VOICE_RING_SIZE < voice . write )
client - > voice_read = voice . write - VOICE_RING_SIZE ;
ring = & voice . ring [ ( client - > voice_read ) & ( VOICE_RING_SIZE - 1 ) ] ;
/*figure out if it was for us*/
2010-12-18 17:02:47 +00:00
send = false ;
2010-11-15 02:40:31 +00:00
if ( ring - > receiver [ clno > > 3 ] & ( 1 < < ( clno & 3 ) ) )
send = true ;
2011-05-15 13:23:13 +00:00
2010-12-23 03:55:10 +00:00
/*if you're spectating, you can hear whatever your tracked player can hear*/
2013-05-09 02:18:15 +00:00
if ( host_client - > spectator & & host_client - > spec_track & & host_client - > spec_track < = sv . allocated_client_slots )
2010-12-23 03:55:10 +00:00
if ( ring - > receiver [ ( host_client - > spec_track - 1 ) > > 3 ] & ( 1 < < ( ( host_client - > spec_track - 1 ) & 3 ) ) )
send = true ;
2010-11-15 02:40:31 +00:00
if ( client - > voice_mute [ ring - > sender > > 3 ] & ( 1 < < ( ring - > sender & 3 ) ) )
send = false ;
2010-12-18 17:02:47 +00:00
if ( ring - > sender = = clno & & ! sv_voip_echo . ival )
send = false ;
2010-12-05 02:46:07 +00:00
/*additional ways to block voice*/
2010-11-15 02:40:31 +00:00
if ( client - > download )
send = false ;
if ( send )
{
2010-11-16 02:03:47 +00:00
if ( buf - > maxsize - buf - > cursize < ring - > datalen + 5 )
break ;
2010-11-15 02:40:31 +00:00
MSG_WriteByte ( buf , svcfte_voicechat ) ;
MSG_WriteByte ( buf , ring - > sender ) ;
2010-11-20 22:01:16 +00:00
MSG_WriteByte ( buf , ring - > gen ) ;
2010-11-15 02:40:31 +00:00
MSG_WriteByte ( buf , ring - > seq ) ;
MSG_WriteShort ( buf , ring - > datalen ) ;
SZ_Write ( buf , ring - > data , ring - > datalen ) ;
}
2010-11-16 02:03:47 +00:00
client - > voice_read + + ;
2010-11-15 02:40:31 +00:00
}
}
2010-12-05 02:46:07 +00:00
void SV_Voice_Ignore_f ( void )
{
unsigned int other ;
int type = 0 ;
if ( Cmd_Argc ( ) < 2 )
{
/*only a name = toggle*/
type = 0 ;
}
else
{
/*mute if 1, unmute if 0*/
if ( atoi ( Cmd_Argv ( 2 ) ) )
type = 1 ;
else
type = - 1 ;
}
other = atoi ( Cmd_Argv ( 1 ) ) ;
2013-12-02 14:30:30 +00:00
if ( other > = svs . allocated_client_slots )
2010-12-05 02:46:07 +00:00
return ;
switch ( type )
{
case - 1 :
host_client - > voice_mute [ other > > 3 ] & = ~ ( 1 < < ( other & 3 ) ) ;
break ;
2011-05-15 13:23:13 +00:00
case 0 :
2010-12-05 02:46:07 +00:00
host_client - > voice_mute [ other > > 3 ] ^ = ( 1 < < ( other & 3 ) ) ;
break ;
case 1 :
host_client - > voice_mute [ other > > 3 ] | = ( 1 < < ( other & 3 ) ) ;
}
}
void SV_Voice_Target_f ( void )
{
unsigned int other ;
char * t = Cmd_Argv ( 1 ) ;
2014-03-30 08:55:06 +00:00
char * v = Cmd_Argv ( 2 ) ;
qboolean verbose = * v ? atoi ( v ) : host_client - > voice_active ;
2010-12-05 02:46:07 +00:00
if ( ! strcmp ( t , " team " ) )
2014-03-30 08:55:06 +00:00
{
2010-12-05 02:46:07 +00:00
host_client - > voice_target = VT_TEAM ;
2014-03-30 08:55:06 +00:00
if ( verbose )
{
if ( teamplay . ival )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Now sending voice to team \n " ) ;
else
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Now sending voice to all (no teamplay) \n " ) ;
}
}
2010-12-05 02:46:07 +00:00
else if ( ! strcmp ( t , " all " ) )
2014-03-30 08:55:06 +00:00
{
2010-12-05 02:46:07 +00:00
host_client - > voice_target = VT_ALL ;
2014-03-30 08:55:06 +00:00
if ( verbose )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Now sending voice to all \n " ) ;
}
2014-04-27 23:16:07 +00:00
else if ( ! strcmp ( t , " specself " ) )
{
host_client - > voice_target = VT_SPECSELF ;
if ( verbose )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Now sending voice to your personal admirers \n " ) ;
}
2010-12-05 02:46:07 +00:00
else if ( ! strcmp ( t , " nonmuted " ) )
2014-03-30 08:55:06 +00:00
{
2010-12-05 02:46:07 +00:00
host_client - > voice_target = VT_NONMUTED ;
2014-03-30 08:55:06 +00:00
if ( verbose )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Now sending voice to all people you've not ignored \n " ) ;
}
2010-12-05 02:46:07 +00:00
else if ( * t > = ' 0 ' & & * t < = ' 9 ' )
{
other = atoi ( t ) ;
2013-12-02 14:30:30 +00:00
if ( other > = svs . allocated_client_slots )
2014-04-29 02:29:04 +00:00
{
2014-03-30 08:55:06 +00:00
if ( verbose )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Invalid client \n " ) ;
2010-12-05 02:46:07 +00:00
return ;
2014-04-29 02:29:04 +00:00
}
2010-12-05 02:46:07 +00:00
host_client - > voice_target = VT_PLAYERSLOT0 + other ;
2014-03-30 08:55:06 +00:00
if ( verbose )
{
if ( host_client - > state > = cs_connected )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Now sending voice only to %s \n " , host_client - > name ) ;
else
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Now sending voice only to player slot %i, if someone occupies it \n " , other ) ;
}
2010-12-05 02:46:07 +00:00
}
else
{
/*don't know who you mean, futureproofing*/
host_client - > voice_target = VT_TEAM ;
2014-03-30 08:55:06 +00:00
if ( verbose )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Now sending voice to team \n " ) ;
2010-12-05 02:46:07 +00:00
}
}
void SV_Voice_MuteAll_f ( void )
2010-11-15 02:40:31 +00:00
{
host_client - > voice_active = false ;
}
2010-12-05 02:46:07 +00:00
void SV_Voice_UnmuteAll_f ( void )
2010-11-15 02:40:31 +00:00
{
host_client - > voice_active = true ;
}
2022-01-28 10:48:01 +00:00
# else
void SV_Voice_UnmuteAll_f ( void )
{ //no-op
}
2010-11-15 02:40:31 +00:00
# endif
2004-08-23 00:15:46 +00:00
2020-05-14 15:50:26 +00:00
qboolean SV_FindRemotePackage ( const char * package , char * url , size_t urlsize )
{
//FIXME: interrogate the package manager first? it probably doesn't have source urls though. I guess that should be done clientside.
//basedir/gamedir/curl_urls.txt contains something like:
//maps_*.pk3 https://host/maps/
//* https://host/gamedir/
//or something.
extern cvar_t sv_dlURL ;
vfsfile_t * f ;
char line [ 512 ] ;
//filter out the gamedir, so different gamedirs can have different sets of urls.
//(useful for eg pakN.pak, if it were not blocked elsewhere)
char * sep = strchr ( package , ' / ' ) ;
2022-03-01 02:51:55 +00:00
if ( ! sep | | sep - package > = sizeof ( line ) )
2020-05-14 15:50:26 +00:00
return false ;
memcpy ( line , package , sep - package + 1 ) ;
line [ sep - package + 1 ] = 0 ;
package = sep + 1 ;
2021-08-19 06:02:18 +00:00
/*compat with xonotic*/
2020-05-14 15:50:26 +00:00
Q_strncatz ( line , " curl_urls.txt " , sizeof ( line ) ) ;
f = FS_OpenVFS ( line , " rb " , FS_ROOT ) ; //this is for server admins to deal with. urls are too unreliable for paks.
if ( f )
{
char pattern [ 256 ] ;
char * e ;
while ( VFS_GETS ( f , line , sizeof ( line ) ) )
{
e = COM_ParseOut ( line , pattern , sizeof ( pattern ) ) ;
if ( * pattern & & wildcmp ( pattern , package ) )
{
COM_ParseOut ( e , url , urlsize ) ;
Q_strncatz ( url , package , urlsize ) ;
VFS_CLOSE ( f ) ;
return true ;
}
}
VFS_CLOSE ( f ) ;
}
if ( * sv_dlURL . string )
{ //a fallback, though the above mechanism allows for a wildcard for all.
Q_strncatz ( sv_dlURL . string , package , urlsize ) ;
Q_strncatz ( url , package , urlsize ) ;
return true ;
}
return false ;
}
2004-09-20 23:25:38 +00:00
//Use of this function is on name only.
//Be aware that the maps directory should be restricted based on weather the file was from a pack file
//this is to preserve copyright - please do not breach due to a bug.
2009-04-01 22:03:56 +00:00
qboolean SV_AllowDownload ( const char * name )
2004-08-23 00:15:46 +00:00
{
extern cvar_t allow_download ;
extern cvar_t allow_download_skins ;
extern cvar_t allow_download_models ;
extern cvar_t allow_download_sounds ;
2016-11-20 20:52:41 +00:00
extern cvar_t allow_download_particles ;
2004-08-23 00:15:46 +00:00
extern cvar_t allow_download_demos ;
2004-09-20 23:25:38 +00:00
extern cvar_t allow_download_maps ;
extern cvar_t allow_download_textures ;
2011-10-27 16:16:29 +00:00
extern cvar_t allow_download_packages ;
2004-09-20 23:25:38 +00:00
extern cvar_t allow_download_wads ;
2004-08-23 00:15:46 +00:00
extern cvar_t allow_download_root ;
2015-06-12 14:44:50 +00:00
extern cvar_t allow_download_logs ;
2005-12-21 03:07:33 +00:00
extern cvar_t allow_download_configs ;
2016-02-10 23:23:43 +00:00
extern cvar_t allow_download_locs ;
2012-01-17 07:57:46 +00:00
extern cvar_t allow_download_copyrighted ;
2014-06-24 03:02:32 +00:00
extern cvar_t allow_download_other ;
2012-01-17 07:57:46 +00:00
char cleanname [ MAX_QPATH ] ;
2014-10-05 20:04:11 +00:00
char ext [ 8 ] ;
2012-01-17 07:57:46 +00:00
int i = 0 ;
if ( strlen ( name ) > = MAX_QPATH )
return false ;
do
{
cleanname [ i + + ] = * name ;
} while ( * name + + ) ;
name = cleanname ;
2004-09-20 23:25:38 +00:00
//allowed at all?
2013-03-12 22:44:00 +00:00
if ( ! allow_download . ival )
2004-09-20 23:25:38 +00:00
return false ;
2004-08-23 00:15:46 +00:00
2004-09-20 23:25:38 +00:00
//no subdirs?
if ( strstr ( name , " .. " ) ) //no under paths.
return false ;
if ( * name = = ' . ' ) //relative is pointless
return false ;
if ( * name = = ' / ' ) //no absolute.
2004-08-23 00:15:46 +00:00
return false ;
2019-03-12 05:04:27 +00:00
if ( strchr ( name , ' : ' ) ) //no drives, alternative resources, etc. the filesystem should refuse such a file so this should just be paranoia.
return false ;
2016-11-20 20:52:41 +00:00
if ( strchr ( name , ' \\ ' ) ) //no windows paths - grow up you lame windows users.
2004-09-20 23:25:38 +00:00
return false ;
2014-10-05 20:04:11 +00:00
COM_FileExtension ( name , ext , sizeof ( ext ) ) ;
//block attempts to download logs
if ( ! Q_strcasecmp ( " log " , ext ) )
2015-06-12 14:44:50 +00:00
return ! ! allow_download_logs . value ;
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 ( name , " logs/ " , 5 ) = = 0 )
2015-06-12 14:44:50 +00:00
return ! ! allow_download_logs . value ;
2014-06-24 03:02:32 +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 ( ! Q_strncasecmp ( name , " package/ " , 8 ) )
2011-10-27 16:16:29 +00:00
{
2016-11-20 20:52:41 +00:00
//eg: package/id1/foobar.pk3
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_strcasecmp ( " pk4 " , ext ) | | ! Q_strcasecmp ( " pk3 " , ext ) | | ! Q_strcasecmp ( " pak " , ext ) | | ( ! Q_strncasecmp ( name , " package/downloads/ " , 18 ) & & ! Q_strcasecmp ( " zip " , ext ) ) )
2011-10-27 16:16:29 +00:00
{
2013-03-12 22:44:00 +00:00
if ( ! allow_download_packages . ival )
return false ;
2011-10-27 16:16:29 +00:00
/*do not permit 'id1/pak1.pak' or 'baseq3/pak0.pk3' or any similarly named packages. such packages would violate copyright, and must be obtained through other means (like buying the damn game)*/
2013-03-12 23:24:15 +00:00
if ( ! allow_download_copyrighted . ival & & ! FS_GetPackageDownloadable ( name + 8 ) )
return false ;
return true ;
2011-10-27 16:16:29 +00:00
}
return false ;
}
2019-03-23 07:06:37 +00:00
if ( ( Q_strncasecmp ( name , " maps/ " , 5 ) = = 0 ) | |
( Q_strncasecmp ( name , " levelshots/ " , 11 ) = = 0 ) | |
( Q_strncasecmp ( name , " overviews/ " , 10 ) = = 0 ) )
2005-10-19 19:37:16 +00:00
return ! ! allow_download_maps . value ;
2004-09-20 23:25:38 +00:00
//skins?
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 ( name , " skins/ " , 6 ) = = 0 )
2005-10-19 19:37:16 +00:00
return ! ! allow_download_skins . value ;
2004-09-20 23:25:38 +00:00
//models
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 ( name , " progs/ " , 6 ) = = 0 ) | |
2019-03-23 07:06:37 +00:00
( Q_strncasecmp ( name , " models/ " , 7 ) = = 0 ) | |
( Q_strncasecmp ( name , " sprites/ " , 8 ) = = 0 ) )
2005-10-19 19:37:16 +00:00
return ! ! allow_download_models . value ;
2004-09-20 23:25:38 +00:00
//sound
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 ( name , " sound/ " , 6 ) = = 0 )
2005-10-19 19:37:16 +00:00
return ! ! allow_download_sounds . value ;
2016-11-20 20:52:41 +00:00
//particles
2019-03-12 05:04:27 +00:00
if ( Q_strncasecmp ( name , " particles/ " , 10 ) = = 0 )
2016-11-20 20:52:41 +00:00
return ! ! allow_download_particles . value ;
2004-09-20 23:25:38 +00:00
//demos
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 ( name , " demos/ " , 6 ) = = 0 )
2005-10-19 19:37:16 +00:00
return ! ! allow_download_demos . value ;
2004-09-20 23:25:38 +00:00
//textures
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 ( name , " textures/ " , 9 ) = = 0 )
2005-10-19 19:37:16 +00:00
return ! ! allow_download_textures . value ;
2004-09-20 23:25:38 +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 ( Q_strncasecmp ( name , " locs/ " , 5 ) = = 0 )
2016-02-10 23:23:43 +00:00
return ! ! allow_download_locs . value ;
2004-09-20 23:25:38 +00:00
//wads
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 ( name , " wads/ " , 5 ) = = 0 )
2005-10-19 19:37:16 +00:00
return ! ! allow_download_wads . value ;
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 ( ! strchr ( name , ' / ' ) & & ! Q_strcasecmp ( " wad " , ext ) )
2005-10-19 19:37:16 +00:00
return ! ! allow_download_wads . value ;
2004-09-20 23:25:38 +00:00
2016-11-20 20:52:41 +00:00
//configs
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 ( name , " config/ " , 7 ) = = 0 )
2016-11-20 20:52:41 +00:00
return ! ! allow_download_configs . value ;
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_strcasecmp ( " cfg " , ext ) )
2016-11-20 20:52:41 +00:00
return ! ! allow_download_configs . value ;
2011-10-27 16:16:29 +00:00
//pak/pk3s.
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 ( ! strchr ( name , ' / ' ) & & ( ! Q_strcasecmp ( " pk4 " , ext ) | | ! Q_strcasecmp ( " pk3 " , ext ) | | ! Q_strcasecmp ( " pak " , ext ) ) )
2012-01-17 07:57: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 ( Q_strncasecmp ( name , " pak " , 3 ) ) //don't give out core pak/pk3 files. This matches q3 logic.
2011-10-27 16:16:29 +00:00
return ! ! allow_download_packages . value ;
2012-01-17 07:57:46 +00:00
else
2015-06-12 14:44:50 +00:00
return ! ! allow_download_packages . value & & ! ! allow_download_copyrighted . value ;
2012-01-17 07:57:46 +00:00
}
2004-09-20 23:25:38 +00:00
//root of gamedir
2004-12-05 08:22:06 +00:00
if ( ! strchr ( name , ' / ' ) & & ! allow_download_root . value )
2005-08-11 04:14:33 +00:00
{
2014-06-24 03:02:32 +00:00
if ( ! strcmp ( name , " csprogs.dat " ) ) //we always allow csprogs.dat to be downloaded (if downloads are permitted).
return true ;
return false ;
2005-08-11 04:14:33 +00:00
}
2004-09-20 23:25:38 +00:00
//any other subdirs are allowed
2015-06-12 14:44:50 +00:00
return ! ! allow_download_other . value ;
2004-08-23 00:15:46 +00:00
}
2008-11-09 22:29:28 +00:00
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
static int SV_LocateDownload ( const char * name , flocation_t * loc , char * * replacementname , qboolean redirectpaks )
2004-08-23 00:15:46 +00:00
{
2022-03-01 02:51:55 +00:00
extern cvar_t allow_download_anymap , allow_download_pakcontents , allow_download_copyrighted , allow_download_packages ;
qboolean copyprotected ;
2008-11-09 22:29:28 +00:00
qboolean found ;
2016-02-10 23:23:43 +00:00
static char tmpname [ MAX_QPATH ] ;
2005-03-07 08:58:26 +00:00
2008-11-09 22:29:28 +00:00
if ( replacementname )
* replacementname = NULL ;
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2008-11-09 22:29:28 +00:00
//mvdsv demo downloading support demonum/ -> demos/XXXX (sets up the client paths)
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 ( name , " demonum/ " , 8 ) )
2007-06-10 21:33:24 +00:00
{
2008-11-09 22:29:28 +00:00
if ( replacementname )
2007-09-10 18:22:33 +00:00
{
2008-11-09 22:29:28 +00:00
char mvdnamebuffer [ MAX_QPATH ] ;
char * mvdname = SV_MVDNum ( mvdnamebuffer , sizeof ( mvdnamebuffer ) , atoi ( name + 8 ) ) ;
if ( ! mvdname )
{
SV_ClientPrintf ( host_client , PRINT_HIGH , " %s is an invalid MVD demonum. \n " , name + 8 ) ;
Sys_Printf ( " %s requested invalid demonum %s \n " , host_client - > name , name + 8 ) ;
return - 1 ; //not found
}
2016-01-18 05:22:07 +00:00
name = * replacementname = va ( " demos/%s " , mvdname ) ;
2016-02-10 23:23:43 +00:00
return DLERR_REDIRECTFILE ;
2007-09-01 04:36:17 +00:00
}
2008-11-09 22:29:28 +00:00
}
2018-09-01 04:18:08 +00:00
# endif
2007-09-01 04:36:17 +00:00
2016-01-18 05:22:07 +00:00
if ( ! SV_AllowDownload ( name ) )
{
Sys_Printf ( " %s denied download of %s due to path/name rules \n " , host_client - > name , name ) ;
2016-02-10 23:23:43 +00:00
return DLERR_PERMISSIONS ; //not permitted (even if it exists).
2016-01-18 05:22:07 +00:00
}
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2008-11-09 22:29:28 +00:00
//mvdsv demo downloading support. demos/ -> demodir (sets up the server paths)
2019-03-23 07:06:37 +00:00
if ( ! Q_strncasecmp ( name , " demos/ " , 6 ) & & * sv_demoDir . string )
2016-02-10 23:23:43 +00:00
{
2019-03-23 07:06:37 +00:00
Q_snprintfz ( tmpname , sizeof ( tmpname ) , " %s/%s " , sv_demoDir . string , name + 6 ) ;
found = FS_FLocateFile ( name , FSLF_IFFOUND , loc ) ;
if ( ! found & & * sv_demoDirAlt . string )
{
Q_snprintfz ( tmpname , sizeof ( tmpname ) , " %s/%s " , sv_demoDirAlt . string , name + 6 ) ;
found = FS_FLocateFile ( name , FSLF_IFFOUND , loc ) ;
}
if ( found )
name = tmpname ;
2016-02-10 23:23:43 +00:00
}
2019-03-23 07:06:37 +00:00
else
2018-09-01 04:18:08 +00:00
# endif
2008-11-09 22:29:28 +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 ( ! Q_strncasecmp ( name , " package/ " , 8 ) )
2011-10-27 16:16:29 +00:00
{
2020-05-14 15:50:26 +00:00
vfsfile_t * f ;
if ( redirectpaks & & SV_FindRemotePackage ( name + 8 , tmpname , sizeof ( tmpname ) ) )
{
* replacementname = tmpname ;
return DLERR_REDIRECTFILE ;
}
f = FS_OpenVFS ( name + 8 , " rb " , FS_ROOT ) ;
2012-01-17 07:57:46 +00:00
if ( f )
2011-10-27 16:16:29 +00:00
{
2015-10-27 15:20:15 +00:00
loc - > len = VFS_GETLEN ( f ) ;
2012-01-17 07:57:46 +00:00
VFS_CLOSE ( f ) ;
2016-02-10 23:23:43 +00:00
return DLERR_PACKAGE ; //found package
2011-10-27 16:16:29 +00:00
}
2012-01-17 07:57:46 +00:00
else
2016-02-10 23:23:43 +00:00
return DLERR_FILENOTFOUND ; //not found/unable to open
2011-10-27 16:16:29 +00:00
}
2014-10-05 20:04:11 +00:00
# ifdef TERRAIN
2012-11-27 03:23:19 +00:00
else if ( Terrain_LocateSection ( name , loc ) )
{
found = true ;
}
2014-10-05 20:04:11 +00:00
# endif
2011-10-27 16:16:29 +00:00
else
2015-10-11 11:34:58 +00:00
found = FS_FLocateFile ( name , FSLF_IFFOUND , loc ) ;
2008-11-09 22:29:28 +00:00
if ( ! found & & replacementname )
{
2016-02-10 23:23:43 +00:00
size_t alt ;
static const char * alternatives [ ] [ 4 ] = {
2019-03-23 07:06:37 +00:00
//orig-path, new-path, orig-ext, new-ext
2016-02-10 23:23:43 +00:00
//nexuiz qc names [sound/]sound/foo.wav but expects sound/foo.ogg and variations of that (the [sound/] is implied, but ignored)
2016-11-20 20:52:41 +00:00
{ " " , " " , " .wav " , " .ogg " } , //nexuiz qc names .wav, but the paks use .ogg
2016-02-10 23:23:43 +00:00
{ " sound/ " , " " , " .wav " , " .wav " } , //nexuiz qc names sound/ but that's normally implied, resulting in doubles that don't exist in the filesystem
2019-03-23 07:06:37 +00:00
{ " sound/ " , " " , " .wav " , " .ogg " } , //both of nexuiz's issues at the same time
//we request wads from textures/*.wad but they could also be simply *.wad
{ " textures/ " , " " , " .wad " , " .wad " }
2016-02-10 23:23:43 +00:00
} ;
2008-11-09 22:29:28 +00:00
2016-02-10 23:23:43 +00:00
for ( alt = 0 ; alt < countof ( alternatives ) ; alt + + )
2007-09-01 04:36:17 +00:00
{
2016-02-10 23:23:43 +00:00
char tryalt [ MAX_QPATH ] ;
char ext [ 8 ] ;
2019-03-23 07:06:37 +00:00
if ( ! Q_strncasecmp ( name , alternatives [ alt ] [ 0 ] , strlen ( alternatives [ alt ] [ 0 ] ) ) )
2016-02-10 23:23:43 +00:00
{
if ( * alternatives [ alt ] [ 2 ] )
{
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_strcasecmp ( COM_FileExtension ( name , ext , sizeof ( ext ) ) , alternatives [ alt ] [ 2 ] + 1 ) )
2016-02-10 23:23:43 +00:00
continue ;
memcpy ( tryalt , alternatives [ alt ] [ 1 ] , strlen ( alternatives [ alt ] [ 1 ] ) ) ;
COM_StripExtension ( name + strlen ( alternatives [ alt ] [ 0 ] ) , tryalt + strlen ( alternatives [ alt ] [ 1 ] ) , sizeof ( tryalt ) - strlen ( alternatives [ alt ] [ 1 ] ) ) ;
COM_DefaultExtension ( tryalt , alternatives [ alt ] [ 3 ] , sizeof ( tryalt ) ) ;
}
else
{
memcpy ( tryalt , alternatives [ alt ] [ 1 ] , strlen ( alternatives [ alt ] [ 1 ] ) ) ;
Q_strncpyz ( tryalt + strlen ( alternatives [ alt ] [ 1 ] ) , name + strlen ( alternatives [ alt ] [ 0 ] ) , sizeof ( tryalt ) - strlen ( alternatives [ alt ] [ 1 ] ) ) ;
}
found = FS_FLocateFile ( tryalt , FSLF_IFFOUND , loc ) ;
if ( found )
{
Q_snprintfz ( tmpname , sizeof ( tmpname ) , " %s " , tryalt ) ;
name = * replacementname = tmpname ;
break ;
}
2008-11-09 22:29:28 +00:00
}
2007-09-01 04:36:17 +00:00
}
2008-11-09 22:29:28 +00:00
}
if ( found )
{
2022-03-01 02:51:55 +00:00
const char * pakname = FS_GetPackageDownloadFilename ( loc ) ;
qboolean ispak = loc - > search & & ! ( loc - > search - > flags & SPF_ISDIR ) ;
copyprotected = loc - > search & & ( loc - > search - > flags & SPF_COPYPROTECTED ) ;
2007-09-01 01:38:18 +00:00
2008-11-09 22:29:28 +00:00
if ( replacementname )
2022-03-01 02:51:55 +00:00
{ //if we're able to redirect it then do so.
if ( ispak & & pakname & & strchr ( pakname , ' / ' ) )
2016-07-12 00:40:13 +00:00
{
2022-03-01 02:51:55 +00:00
if ( allow_download_packages . ival & & ! ( loc - > search & & ( loc - > search - > flags & SPF_TEMPORARY ) ) )
2016-07-12 00:40:13 +00:00
{
2022-03-01 02:51:55 +00:00
if ( allow_download_copyrighted . ival | | ! copyprotected )
{ //this path is non authoritive, but we shouldn't be pushing people to download files they're not going to be allowed to download.
2016-07-12 00:40:13 +00:00
Q_snprintfz ( tmpname , sizeof ( tmpname ) , " package/%s " , pakname ) ;
* replacementname = tmpname ;
return DLERR_REDIRECTPACK ; //redirect
}
}
}
2007-09-01 04:36:17 +00:00
}
2011-05-15 13:23:13 +00:00
2022-03-01 02:51:55 +00:00
if ( ispak )
{
int pakcontents = ( ! Q_strncasecmp ( name , " maps/ " , 5 ) ? allow_download_anymap . ival : allow_download_pakcontents . ival ) ;
if ( pakcontents = = 2 )
{ //qw-like allow-and-ignore-copyrights, skip the following cases...
}
else if ( copyprotected )
2013-03-12 22:44:00 +00:00
{
2022-03-01 02:51:55 +00:00
Sys_Printf ( " %s denied download of %s - it is in a copyrighted pak \n " , host_client - > name , name ) ;
return DLERR_PERMISSIONS ;
}
else if ( ! pakcontents )
{ //block it if its entirely disabllowed
2018-12-06 04:55:35 +00:00
Sys_Printf ( " %s denied download of %s - it is in a pak \n " , host_client - > name , name ) ;
2016-02-10 23:23:43 +00:00
return DLERR_PERMISSIONS ;
2013-03-12 22:44:00 +00:00
}
2008-11-09 22:29:28 +00:00
}
2022-03-01 02:51:55 +00:00
else if ( copyprotected )
{ //not really sure how we can get here, but oh well.
Sys_Printf ( " %s denied download of %s - it is copyrighted \n " , host_client - > name , name ) ;
return DLERR_PERMISSIONS ;
}
2008-11-09 22:29:28 +00:00
if ( replacementname & & * replacementname )
2016-02-10 23:23:43 +00:00
return DLERR_REDIRECTPACK ;
2008-11-09 22:29:28 +00:00
return 0 ;
2007-06-10 21:33:24 +00:00
}
2008-11-09 22:29:28 +00:00
return - 1 ; //not found
}
2007-06-10 21:33:24 +00:00
2008-11-09 22:29:28 +00:00
//this function is only meaningful for nq/qw
void SV_DownloadSize_f ( void )
{
flocation_t loc ;
char * name = Cmd_Argv ( 1 ) ;
char * redirected = " " ;
2007-06-20 00:02:54 +00:00
2008-11-09 22:29:28 +00:00
switch ( SV_LocateDownload ( name , & loc , & redirected , true ) )
{
2016-07-12 00:40:13 +00:00
case DLERR_REDIRECTFILE : /*redirect (extension difference or so)*/
case DLERR_REDIRECTPACK : /*redirect (the containing package)*/
2008-11-09 22:29:28 +00:00
name = va ( " dlsize \" %s \" r \" %s \" \n " , name , redirected ) ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( name ) ) ;
ClientReliableWrite_String ( host_client , name ) ;
break ;
default :
2016-07-12 00:40:13 +00:00
case DLERR_FILENOTFOUND : /*not found*/
2008-11-09 22:29:28 +00:00
name = va ( " dlsize \" %s \" e \n " , name ) ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( name ) ) ;
ClientReliableWrite_String ( host_client , name ) ;
break ;
2016-07-12 00:40:13 +00:00
case DLERR_PERMISSIONS : /*permission*/
2008-11-09 22:29:28 +00:00
name = va ( " dlsize \" %s \" p \n " , name ) ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( name ) ) ;
ClientReliableWrite_String ( host_client , name ) ;
break ;
2016-07-12 00:40:13 +00:00
case DLERR_PACKAGE : /*requested file is a package*/
case 0 : /*file exists*/
2014-03-30 00:39:37 +00:00
name = va ( " dlsize \" %s \" %u \n " , name , ( unsigned int ) loc . len ) ;
2008-11-09 22:29:28 +00:00
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( name ) ) ;
ClientReliableWrite_String ( host_client , name ) ;
break ;
}
}
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2019-03-12 05:04:27 +00:00
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2019-03-12 05:04:27 +00:00
void SV_DownloadQueueAdd ( client_t * client , const char * name )
{
if ( ! client - > dlqueue )
{
client - > dlqueue = Z_StrDup ( name ) ;
SV_ClientPrintf ( client , PRINT_HIGH , " Using legacy serverside download queue. This is subject to race conditions, be careful. \n " ) ;
}
else
{
Z_StrCat ( & client - > dlqueue , " \\ " ) ;
Z_StrCat ( & client - > dlqueue , name ) ;
}
}
void SV_DownloadQueueNext ( client_t * client )
{
char buf [ MAX_QPATH * 2 ] ;
char * name = client - > dlqueue ;
char * next ;
if ( ! name )
return ;
next = strchr ( name , ' \\ ' ) ;
if ( next )
{
host_client - > dlqueue = Z_StrDup ( next + 1 ) ;
* next = 0 ;
}
else
client - > dlqueue = NULL ;
next = va ( " download \" %s \" \n " , COM_QuotedString ( name , buf , sizeof ( buf ) , true ) ) ;
ClientReliableWrite_Begin ( client , svc_stufftext , 2 + strlen ( next ) ) ;
ClientReliableWrite_String ( client , next ) ;
Z_Free ( name ) ;
}
void SV_DownloadQueueClear ( client_t * client )
{
if ( client - > dlqueue )
Z_Free ( client - > dlqueue ) ;
client - > dlqueue = NULL ;
}
# 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
void SV_DemoDownload_f ( void )
{
int arg ;
unsigned long num ;
const char * name , * mvdname ;
char mvdnamebuffer [ MAX_QPATH ] ;
if ( Cmd_Argc ( ) < 2 )
{
//fixme: help text, or possibly just display links to the last 10 demos?
return ;
}
if ( Cmd_Argc ( ) = = 2 )
{
name = Cmd_Argv ( 1 ) ;
if ( ! strcmp ( name , " \\ " ) | | ! Q_strcasecmp ( name , " stop " ) | | ! Q_strcasecmp ( name , " cancel " ) )
{
2019-03-12 05:04:27 +00:00
if ( strcmp ( name , " \\ " ) )
{ //cancel/stop kill any current download too. which is annoying
if ( host_client - > download )
VFS_CLOSE ( host_client - > download ) ;
host_client - > download = NULL ;
2019-06-27 14:38:51 +00:00
# ifdef NQPROT
2019-03-12 05:04:27 +00:00
host_client - > downloadstarted = false ;
2019-06-27 14:38:51 +00:00
# endif
2019-03-12 05:04:27 +00:00
}
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2019-03-12 05:04:27 +00:00
SV_DownloadQueueClear ( host_client ) ;
# 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
return ;
}
}
for ( arg = 1 ; arg < Cmd_Argc ( ) ; arg + + )
{
name = Cmd_Argv ( arg ) ;
if ( * name = = ' . ' )
{ //just count the dots
for ( num = 0 , mvdname = name ; * mvdname = = ' . ' ; mvdname + + )
num + + ;
if ( * mvdname )
{
SV_ClientPrintf ( host_client , PRINT_HIGH , " invalid demo id %s \n " , name ) ;
continue ;
}
mvdname = SV_MVDLastNum ( num ) ;
}
else
{
char * e ;
num = strtoul ( name , & e , 10 ) ;
if ( ! num | | * e )
{
SV_ClientPrintf ( host_client , PRINT_HIGH , " invalid demo id %s \n " , name ) ;
continue ;
}
mvdname = SV_MVDNum ( mvdnamebuffer , sizeof ( mvdnamebuffer ) , num ) ;
}
if ( ! mvdname )
SV_ClientPrintf ( host_client , PRINT_HIGH , " %s is an invalid MVD demonum. \n " , name ) ;
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2019-03-12 05:04:27 +00:00
else if ( ! ( host_client - > protocol & PEXT_CHUNKEDDOWNLOADS ) | | ! strncmp ( InfoBuf_ValueForKey ( & host_client - > userinfo , " *client " ) , " ezQuake " , 7 ) )
{ //chunked downloads was built around the client being in control (because only it knows which files are needed)
//but ezquake never implemented that part
SV_DownloadQueueAdd ( host_client , va ( " demos/%s " , mvdname ) ) ;
continue ;
}
# 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
else
{
const char * s = va ( " download \" demos/%s \" \n " , mvdname ) ;
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( s ) ) ;
ClientReliableWrite_String ( host_client , s ) ;
}
}
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2019-03-12 05:04:27 +00:00
if ( ! host_client - > download )
SV_DownloadQueueNext ( host_client ) ;
# 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
}
2018-09-01 04:18:08 +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
2008-11-09 22:29:28 +00:00
/*
= = = = = = = = = = = = = = = = = =
SV_BeginDownload_f
= = = = = = = = = = = = = = = = = =
*/
void SV_BeginDownload_f ( void )
{
char * name = Cmd_Argv ( 1 ) ;
char * redirection = NULL ;
extern cvar_t allow_download_anymap , allow_download_pakcontents ;
flocation_t loc ;
int result ;
2021-10-05 05:05:56 +00:00
/*if (ISNQCLIENT(host_client) && host_client->protocol != SCP_DARKPLACES7)
2008-11-09 22:29:28 +00:00
{
SV_PrintToClient ( host_client , PRINT_HIGH , " Your client isn't meant to support downloads \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
2021-10-05 05:05:56 +00:00
} */
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
/*
if ( ISQWCLIENT ( host_client ) & & ! strcmp ( name , " ezquake-security.dll " ) )
{
vfsfile_t * f = FS_OpenVFS ( " evil.dll " , " rb " , FS_GAME ) ;
if ( f )
{
int chunk , o = 0 ;
int l = VFS_GETLEN ( f ) ;
char * data = malloc ( l ) ;
VFS_READ ( f , data , l ) ;
VFS_CLOSE ( f ) ;
while ( o < l )
{
chunk = 768 ;
if ( o + chunk > l )
chunk = l - o ;
ClientReliableWrite_Begin ( host_client , ISQ2CLIENT ( host_client ) ? svcq2_download : svc_download , 6 + chunk ) ;
ClientReliableWrite_Short ( host_client , chunk ) ;
ClientReliableWrite_Byte ( host_client , ( o + chunk = = l ) ? 100 : 0 ) ; //lame, whatever.
ClientReliableWrite_SZ ( host_client , data + o , chunk ) ;
o + = chunk ;
}
}
ClientReliableWrite_Begin ( host_client , svc_stufftext , 128 ) ;
ClientReliableWrite_String ( host_client , " cmd new \n " ) ;
return ;
}
*/
2008-11-09 22:29:28 +00:00
* host_client - > downloadfn = 0 ;
2011-10-27 16:16:29 +00:00
2004-08-23 00:15:46 +00:00
if ( host_client - > download )
{
2005-12-21 03:07:33 +00:00
VFS_CLOSE ( host_client - > download ) ;
2004-08-23 00:15:46 +00:00
host_client - > download = NULL ;
}
2011-10-27 16:16:29 +00:00
result = SV_LocateDownload ( name , & loc , & redirection , false ) ;
2016-02-10 23:23:43 +00:00
if ( result = = DLERR_PACKAGE )
2004-08-23 00:15:46 +00:00
{
2013-03-31 04:21:08 +00:00
//package download
2011-10-27 16:16:29 +00:00
result = 0 ;
host_client - > download = FS_OpenVFS ( name + 8 , " rb " , FS_ROOT ) ;
2004-08-23 00:15:46 +00:00
}
2011-10-27 16:16:29 +00:00
else
{
//redirection protocol-specific code goes here.
2016-02-10 23:23:43 +00:00
if ( result = = DLERR_REDIRECTPACK | | result = = DLERR_REDIRECTFILE )
2011-10-27 16:16:29 +00:00
{
2013-03-31 04:21:08 +00:00
# ifdef PEXT_CHUNKEDDOWNLOADS
2016-02-10 23:23:43 +00:00
//ezquake etc cannot cope with proper redirects
if ( ( host_client - > fteprotocolextensions & PEXT_CHUNKEDDOWNLOADS ) & & ( host_client - > fteprotocolextensions & PEXT_CSQC ) )
2013-03-31 04:21:08 +00:00
{
//redirect the client (before the message saying download failed)
2016-01-18 05:22:07 +00:00
// char *s = va("dlsize \"%s\" r \"%s\"\n", name, redirection);
// ClientReliableWrite_Begin (host_client, svc_stufftext, 2+strlen(s));
// ClientReliableWrite_String (host_client, s);
ClientReliableWrite_Begin ( host_client , svc_download , 10 + strlen ( name ) ) ;
ClientReliableWrite_Long ( host_client , - 1 ) ;
2016-02-10 23:23:43 +00:00
ClientReliableWrite_Long ( host_client , DLERR_REDIRECTFILE ) ;
2016-01-18 05:22:07 +00:00
ClientReliableWrite_String ( host_client , redirection ) ;
2017-06-21 01:24:25 +00:00
if ( ISNQCLIENT ( host_client ) )
host_client - > send_message = true ;
2016-01-18 05:22:07 +00:00
return ;
}
2016-02-10 23:23:43 +00:00
else if ( result = = DLERR_REDIRECTFILE & & host_client - > protocol = = SCP_QUAKEWORLD )
2016-01-18 05:22:07 +00:00
{ //crappy hack for crappy clients. tell them to download the new file instead without telling them about any failure.
//this will seriously mess with any download queues or anything like that
2016-02-10 23:23:43 +00:00
//this doesn't apply to packages, because these shitty clients won't know to actually load said packages before attempting to request more files, meaning the same package gets downloaded 80 times and then only actually used AFTER they restart the client.
2016-01-18 05:22:07 +00:00
char * s = va ( " download \" %s \" \n " , redirection ) ;
2013-03-31 04:21:08 +00:00
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( s ) ) ;
ClientReliableWrite_String ( host_client , s ) ;
2017-06-21 01:24:25 +00:00
if ( ISNQCLIENT ( host_client ) )
host_client - > send_message = true ;
2016-01-18 05:22:07 +00:00
return ;
2013-03-31 04:21:08 +00:00
}
# endif
2011-10-27 16:16:29 +00:00
}
2004-08-23 00:15:46 +00:00
2011-10-27 16:16:29 +00:00
if ( result = = 0 )
{ //if we are allowed and could find it
2021-06-02 15:29:44 +00:00
host_client - > download = FS_OpenReadLocation ( NULL , & loc ) ;
2011-10-27 16:16:29 +00:00
}
2008-11-09 22:29:28 +00:00
}
2004-08-23 00:15:46 +00:00
2019-03-12 05:04:27 +00:00
if ( ! host_client - > download & & ! result )
2011-10-27 16:16:29 +00:00
result = - 1 ; //this isn't likely, but hey.
2008-11-09 22:29:28 +00:00
//handle errors
if ( result ! = 0 )
{ // don't allow anything with .. path
char * error ;
switch ( result )
2004-08-23 00:15:46 +00:00
{
2016-02-10 23:23:43 +00:00
case DLERR_FILENOTFOUND :
2008-11-09 22:29:28 +00:00
default :
2016-02-10 23:23:43 +00:00
result = DLERR_FILENOTFOUND ;
2021-10-05 05:05:56 +00:00
error = " Download %s could not be found \n " ;
2008-11-09 22:29:28 +00:00
break ;
2016-02-10 23:23:43 +00:00
case DLERR_UNKNOWN :
2021-10-05 05:05:56 +00:00
error = " Download %s: Filesystem error \n " ;
2016-02-10 23:23:43 +00:00
break ;
case DLERR_PERMISSIONS :
2021-10-05 05:05:56 +00:00
error = " Download %s: Permission denied \n " ;
2008-11-09 22:29:28 +00:00
break ;
2016-02-10 23:23:43 +00:00
case DLERR_REDIRECTFILE :
result = DLERR_PERMISSIONS ;
2021-10-05 05:05:56 +00:00
error = " Client doesn't support file redirection for %s \n " ;
2016-02-10 23:23:43 +00:00
break ;
case DLERR_REDIRECTPACK :
result = DLERR_PERMISSIONS ;
2013-03-31 04:21:08 +00:00
error = " Package contents not available individually \n " ;
2008-11-09 22:29:28 +00:00
break ;
2004-08-23 00:15:46 +00:00
}
2005-01-16 19:55:35 +00:00
# ifdef PEXT_CHUNKEDDOWNLOADS
2013-03-31 04:21:08 +00:00
if ( host_client - > fteprotocolextensions & PEXT_CHUNKEDDOWNLOADS )
2005-01-16 02:24:05 +00:00
{
ClientReliableWrite_Begin ( host_client , svc_download , 10 + strlen ( name ) ) ;
ClientReliableWrite_Long ( host_client , - 1 ) ;
2008-11-09 22:29:28 +00:00
ClientReliableWrite_Long ( host_client , result ) ;
2005-01-16 02:24:05 +00:00
ClientReliableWrite_String ( host_client , name ) ;
}
else
2005-01-16 19:55:35 +00:00
# endif
2013-03-31 04:21:08 +00:00
if ( ISNQCLIENT ( host_client ) )
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
{ //dp's download protocol
2021-10-05 05:05:56 +00:00
SV_PrintToClient ( host_client , PRINT_HIGH , va ( error , name ) ) ;
2013-03-31 04:21:08 +00:00
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + 12 ) ;
ClientReliableWrite_String ( host_client , " \n stopdownload \n " ) ;
}
else
2005-01-16 02:24:05 +00:00
{
2021-10-05 05:05:56 +00:00
SV_PrintToClient ( host_client , PRINT_HIGH , va ( error , name ) ) ;
2008-11-09 22:29:28 +00:00
2005-05-26 12:55:34 +00:00
ClientReliableWrite_Begin ( host_client , ISQ2CLIENT ( host_client ) ? svcq2_download : svc_download , 4 ) ;
2005-01-16 02:24:05 +00:00
ClientReliableWrite_Short ( host_client , - 1 ) ;
ClientReliableWrite_Byte ( host_client , 0 ) ;
}
2017-06-21 01:24:25 +00:00
if ( ISNQCLIENT ( host_client ) )
host_client - > send_message = true ;
2019-05-10 09:31:21 +00:00
# if defined(HAVE_LEGACY) && defined(MVD_RECORDING)
2019-03-12 05:04:27 +00:00
SV_DownloadQueueNext ( host_client ) ;
2019-03-12 08:28:19 +00:00
# endif
2004-08-23 00:15:46 +00:00
return ;
}
2008-11-09 22:29:28 +00:00
Q_strncpyz ( host_client - > downloadfn , name , sizeof ( host_client - > downloadfn ) ) ;
host_client - > downloadcount = 0 ;
2019-06-06 18:07:12 +00:00
# ifdef NQPROT
2019-06-06 18:03:01 +00:00
host_client - > downloadstarted = false ;
2019-06-06 18:07:12 +00:00
# endif
2008-11-09 22:29:28 +00:00
2005-12-21 03:07:33 +00:00
host_client - > downloadsize = VFS_GETLEN ( host_client - > download ) ;
2005-01-16 19:55:35 +00:00
# ifdef PEXT_CHUNKEDDOWNLOADS
2005-01-16 02:24:05 +00:00
if ( host_client - > fteprotocolextensions & PEXT_CHUNKEDDOWNLOADS )
{
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 ( host_client - > download - > seekstyle ! = SS_SEEKABLE )
2006-02-11 02:09:43 +00:00
{ //if seeking is a bad plan (for whatever reason - usually because of zip files)
//create a temp file instead
int i , len ;
char buffer [ 8192 ] ;
vfsfile_t * tmp ;
tmp = FS_OpenTemp ( ) ;
for ( i = 0 ; ; i + = len )
{
len = sizeof ( buffer ) ;
if ( len > host_client - > downloadsize - i )
len = host_client - > downloadsize - i ;
if ( len = = 0 )
break ;
VFS_READ ( host_client - > download , buffer , len ) ;
VFS_WRITE ( tmp , buffer , len ) ;
}
VFS_CLOSE ( host_client - > download ) ;
host_client - > download = tmp ;
}
2014-06-24 03:02:32 +00:00
ClientReliableWrite_Begin ( host_client , svc_download , 18 + strlen ( host_client - > downloadfn ) ) ;
2005-01-16 02:24:05 +00:00
ClientReliableWrite_Long ( host_client , - 1 ) ;
2014-06-24 03:02:32 +00:00
if ( host_client - > downloadsize > = 0x7fffffff )
{ //avoid unsigned values.
ClientReliableWrite_Long ( host_client , 0x80000000 ) ; //signal that its 64bit
ClientReliableWrite_Long ( host_client , qofs_Low ( host_client - > downloadsize ) ) ;
ClientReliableWrite_Long ( host_client , qofs_High ( host_client - > downloadsize ) ) ;
}
else
ClientReliableWrite_Long ( host_client , host_client - > downloadsize ) ;
2008-11-09 22:29:28 +00:00
ClientReliableWrite_String ( host_client , host_client - > downloadfn ) ;
2005-01-16 02:24:05 +00:00
}
2008-11-09 22:29:28 +00:00
else
2005-01-16 19:55:35 +00:00
# endif
2017-11-16 22:20:40 +00:00
if ( ISNQCLIENT ( host_client ) )
2007-06-10 21:33:24 +00:00
{
2014-08-03 14:47:47 +00:00
//FIXME support 64bit files
char * s = va ( " \n cl_downloadbegin %u %s \n " , ( unsigned int ) host_client - > downloadsize , host_client - > downloadfn ) ;
2007-06-10 21:33:24 +00:00
ClientReliableWrite_Begin ( host_client , svc_stufftext , 2 + strlen ( s ) ) ;
ClientReliableWrite_String ( host_client , s ) ;
2013-08-21 07:14:39 +00:00
host_client - > send_message = true ;
2007-06-10 21:33:24 +00:00
}
else
SV_NextDownload_f ( ) ;
2004-08-23 00:15:46 +00:00
SV_EndRedirect ( ) ;
2008-11-09 22:29:28 +00:00
Con_Printf ( " Downloading %s to %s \n " , host_client - > downloadfn , host_client - > name ) ;
2004-08-23 00:15:46 +00:00
}
2007-06-20 00:02:54 +00:00
void SV_StopDownload_f ( void )
{
//this doesn't mean the download failed or was canceled.
if ( host_client - > download )
{
VFS_CLOSE ( host_client - > download ) ;
host_client - > download = NULL ;
}
else
2014-06-12 23:08:42 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " Can't stop download - not downloading anything \n " ) ;
2007-06-20 00:02:54 +00:00
2019-06-06 18:07:12 +00:00
# ifdef NQPROT
2007-06-20 00:02:54 +00:00
host_client - > downloadstarted = false ;
2019-06-06 18:07:12 +00:00
# endif
2019-03-12 05:04:27 +00:00
2019-05-10 09:31:21 +00:00
# if defined(HAVE_LEGACY) && defined(MVD_RECORDING)
2019-03-12 05:04:27 +00:00
SV_DownloadQueueNext ( host_client ) ;
// SV_DownloadQueueClear(host_client);
# endif
2007-06-20 00:02:54 +00:00
}
2004-08-23 00:15:46 +00:00
//=============================================================================
/*
= = = = = = = = = = = = = = = = = =
SV_SayOne_f
= = = = = = = = = = = = = = = = = =
*/
void SV_SayOne_f ( void )
{
char text [ 1024 ] ;
client_t * to ;
int i ;
char * s , * s2 ;
int clnum = - 1 ;
if ( Cmd_Argc ( ) < 3 )
return ;
2015-09-01 04:45:15 +00:00
if ( ( host_client - > penalties & BAN_MUTE ) & & ! ( host_client - > penalties & ( BAN_DEAF | BAN_STEALTH ) ) )
2014-03-30 08:55:06 +00:00
{
SV_ClientTPrintf ( host_client , PRINT_CHAT , " You are muted \n " ) ;
return ;
}
2004-08-23 00:15:46 +00:00
while ( ( to = SV_GetClientForString ( Cmd_Argv ( 1 ) , & clnum ) ) )
{
2015-09-01 04:45:15 +00:00
if ( ( host_client - > penalties & BAN_MUTE ) & & to ! = host_client )
2014-03-30 08:55:06 +00:00
continue ;
2004-08-23 00:15:46 +00:00
if ( host_client - > spectator )
{
if ( ! sv_spectalk . value | | to - > spectator )
2011-07-22 15:11:35 +00:00
Q_snprintfz ( text , sizeof ( text ) , " [SPEC] {%s}: " , host_client - > name ) ;
2004-08-23 00:15:46 +00:00
else
continue ;
}
else
2011-07-22 15:11:35 +00:00
Q_snprintfz ( text , sizeof ( text ) , " {%s}: " , host_client - > name ) ;
2004-08-23 00:15:46 +00:00
2014-06-25 03:53:11 +00:00
if ( to - > penalties & BAN_DEAF )
2014-03-30 08:55:06 +00:00
continue ;
2004-08-23 00:15:46 +00:00
for ( i = 2 ; ; i + + )
{
s = Cmd_Argv ( i ) ;
if ( ! * s )
break ;
if ( strlen ( text ) + strlen ( s ) + 2 > = sizeof ( text ) - 1 )
break ;
strcat ( text , " " ) ;
strcat ( text , s ) ;
}
//filter out '\n' and '\r'
s = text ;
s2 = text ;
while ( * s2 )
{
if ( * s2 = = ' \r ' | | * s2 = = ' \n ' )
{
s2 + + ;
continue ;
}
* s = * s2 ;
s + + ;
s2 + + ;
}
* s = ' \0 ' ;
strcat ( text , " \n " ) ;
SV_ClientPrintf ( to , PRINT_CHAT , " %s " , text ) ;
}
if ( clnum = = - 1 ) //none found
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_CHAT , " client does not exist \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
}
2005-12-16 17:14:06 +00:00
float SV_CheckFloodProt ( client_t * client )
{
2006-05-29 05:35:07 +00:00
if ( ! sv_floodprotect . value )
return 0 ;
2006-05-30 04:00:24 +00:00
if ( sv_floodprotect_messages . value < = 0 | | sv_floodprotect_interval . value < = 0 )
2006-05-29 06:12:12 +00:00
return 0 ;
if ( sv . paused )
return 0 ;
if ( realtime < client - > lockedtill )
return client - > lockedtill - realtime ;
if ( client - > floodprotmessage > sv_floodprotect_messages . value )
2005-12-16 17:14:06 +00:00
{
2006-05-29 06:12:12 +00:00
client - > lockedtill = realtime + sv_floodprotect_silencetime . value ;
client - > floodprotmessage = 0.0 ;
client - > lastspoke = 0.0 ;
2006-05-30 04:00:24 +00:00
if ( sv_floodprotect_sendmessage . string [ 0 ] )
SV_ClientPrintf ( client , PRINT_CHAT , " FloodProt: %s \n " , sv_floodprotect_sendmessage . string ) ;
2006-05-29 06:12:12 +00:00
return sv_floodprotect_silencetime . value ;
2005-12-16 17:14:06 +00:00
}
2006-05-29 06:12:12 +00:00
2005-12-16 17:14:06 +00:00
return 0 ;
}
void SV_PushFloodProt ( client_t * client )
{
2006-05-29 06:12:12 +00:00
if ( ! sv_floodprotect . value )
return ;
2006-05-30 04:00:24 +00:00
if ( sv_floodprotect_messages . value < = 0 | | sv_floodprotect_interval . value < = 0 )
2006-05-29 06:12:12 +00:00
return ;
if ( sv . paused )
return ;
if ( client - > lastspoke )
2005-12-16 17:14:06 +00:00
{
2011-05-15 13:23:13 +00:00
client - > floodprotmessage - = ( realtime - client - > lastspoke )
2006-05-29 06:12:12 +00:00
* sv_floodprotect_messages . value
/ sv_floodprotect_interval . value ;
client - > floodprotmessage = max ( 0 , client - > floodprotmessage ) ;
client - > floodprotmessage + + ;
2005-12-16 17:14:06 +00:00
}
2006-05-29 06:12:12 +00:00
else
client - > floodprotmessage = 1.0 ;
client - > lastspoke = realtime ;
2005-12-16 17:14:06 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = =
SV_Say
= = = = = = = = = = = = = = = = = =
*/
void SV_Say ( qboolean team )
{
client_t * client ;
2006-01-27 08:06:48 +00:00
int j ;
2004-08-23 00:15:46 +00:00
char * p ;
char text [ 1024 ] ;
char t1 [ 32 ] , * t2 ;
int cls = 0 ;
2005-12-16 17:14:06 +00:00
float floodtime ;
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2012-08-04 01:35:52 +00:00
sizebuf_t * msg ;
2018-09-01 04:18:08 +00:00
qboolean mvdrecording ;
# endif
2004-08-23 00:15:46 +00:00
qboolean sent [ MAX_CLIENTS ] ; //so we don't send to the same splitscreen connection twice. (it's ugly)
int cln ;
char * s , * s2 ;
if ( Cmd_Argc ( ) < 2 )
return ;
2014-06-25 03:53:11 +00:00
if ( ! ( host_client - > penalties & BAN_MUTE ) )
2014-03-30 08:55:06 +00:00
Sys_ServerActivity ( ) ;
2004-08-23 00:15:46 +00:00
memset ( sent , 0 , sizeof ( sent ) ) ;
if ( team )
{
2018-07-05 16:21:44 +00:00
Q_strncpyz ( t1 , InfoBuf_ValueForKey ( & host_client - > userinfo , " team " ) , sizeof ( t1 ) ) ;
2004-08-23 00:15:46 +00:00
}
if ( host_client - > spectator & & ( ! sv_spectalk . value | | team ) )
2011-07-22 15:11:35 +00:00
Q_snprintfz ( text , sizeof ( text ) , " [SPEC] %s: " , host_client - > name ) ;
2004-08-23 00:15:46 +00:00
else if ( team )
2011-07-22 15:11:35 +00:00
Q_snprintfz ( text , sizeof ( text ) , " (%s): " , host_client - > name ) ;
2004-08-23 00:15:46 +00:00
else
2011-07-22 15:11:35 +00:00
Q_snprintfz ( text , sizeof ( text ) , " %s: " , host_client - > name ) ;
2004-08-23 00:15:46 +00:00
2015-09-01 04:45:15 +00:00
if ( ( host_client - > penalties & BAN_MUTE ) & & ! ( host_client - > penalties & ( BAN_DEAF | BAN_STEALTH ) ) )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_CHAT , " You cannot chat while muted \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2007-09-03 22:37:13 +00:00
# ifdef VM_Q1
if ( Q1QVM_ClientSay ( sv_player , team ) )
return ;
# endif
2005-12-16 17:14:06 +00:00
if ( ( floodtime = SV_CheckFloodProt ( host_client ) ) )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_CHAT , " You can't talk for %i more seconds \n " , ( int ) ( floodtime ) ) ;
2005-12-16 17:14:06 +00:00
return ;
2004-08-23 00:15:46 +00:00
}
2005-12-16 17:14:06 +00:00
SV_PushFloodProt ( host_client ) ;
2004-08-23 00:15:46 +00:00
p = Cmd_Args ( ) ;
if ( * p = = ' " ' )
{
2016-07-15 12:26:24 +00:00
char * e = p + strlen ( p ) - 1 ;
* p + + = 0 ;
if ( * e = = ' \" ' )
* e = 0 ;
2004-08-23 00:15:46 +00:00
}
if ( strlen ( text ) + strlen ( p ) + 2 > = sizeof ( text ) - 10 )
{
2020-02-11 18:06:10 +00:00
SV_ClientTPrintf ( host_client , PRINT_CHAT , " buffer overflow protection: failure \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( svprogfuncs )
if ( PR_QCChat ( p , team ) ) //true if handled.
return ;
Q_strcat ( text , p ) ;
//filter out '\n' and '\r'
if ( sv_chatfilter . value )
{
s = text ;
s2 = text ;
while ( * s2 )
{
if ( * s2 = = ' \r ' | | * s2 = = ' \n ' )
{
s2 + + ;
continue ;
}
* s = * s2 ;
s + + ;
s2 + + ;
}
* s = ' \0 ' ;
}
Q_strcat ( text , " \n " ) ;
2014-06-25 03:53:11 +00:00
if ( ! ( host_client - > penalties & BAN_MUTE ) )
2014-03-30 08:55:06 +00:00
Sys_Printf ( " %s " , text ) ;
2004-08-23 00:15:46 +00:00
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2005-09-08 01:43:29 +00:00
mvdrecording = sv . mvdrecording ;
sv . mvdrecording = false ; //so that the SV_ClientPrintf doesn't send to all players.
2018-09-01 04:18:08 +00:00
# endif
2013-10-29 17:38:22 +00:00
for ( j = 0 , client = svs . clients ; j < svs . allocated_client_slots ; j + + , client + + )
2004-08-23 00:15:46 +00:00
{
if ( client - > state ! = cs_spawned & & client - > state ! = cs_connected )
continue ;
if ( host_client - > spectator & & ! sv_spectalk . value )
if ( ! client - > spectator )
continue ;
if ( team )
{
// the spectator team
if ( host_client - > spectator ) {
if ( ! client - > spectator )
continue ;
} else {
2018-07-05 16:21:44 +00:00
t2 = InfoBuf_ValueForKey ( & client - > userinfo , " team " ) ;
2004-08-23 00:15:46 +00:00
if ( strcmp ( t1 , t2 ) | | client - > spectator )
continue ; // on different teams
}
}
2014-06-25 03:53:11 +00:00
if ( host_client - > penalties & BAN_MUTE )
2014-03-30 08:55:06 +00:00
{
if ( client ! = host_client )
continue ;
}
2014-06-25 03:53:11 +00:00
else if ( client - > penalties & BAN_DEAF )
2015-09-01 04:45:15 +00:00
{
if ( client ! = host_client | | ! ( host_client - > penalties & BAN_STEALTH ) )
continue ;
}
2014-03-30 08:55:06 +00:00
2004-08-23 00:15:46 +00:00
cls | = 1 < < j ;
//make sure we don't send the say to the same client 20 times due to splitscreen
if ( client - > controller )
cln = client - > controller - svs . clients ;
else
cln = client - svs . clients ;
if ( sent [ cln ] )
continue ;
else
sent [ cln ] = true ;
SV_ClientPrintf ( client , PRINT_CHAT , " %s " , text ) ;
}
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2005-09-08 01:43:29 +00:00
sv . mvdrecording = mvdrecording ;
2004-08-23 00:15:46 +00:00
2020-02-11 18:06:10 +00:00
if ( strstr ( p , " password " ) ) //just a friendly reminder.
SV_ClientPrintf ( host_client , PRINT_HIGH , " DON'T SHARE PASSWORDS HERE, YOU MUPPET! \r " ) ;
2004-08-23 00:15:46 +00:00
if ( ! sv . mvdrecording | | ! cls )
return ;
2005-07-28 15:33:27 +00:00
// non-team messages should be seen always, even if not tracking any player
2004-08-23 00:15:46 +00:00
if ( ! team & & ( ( host_client - > spectator & & sv_spectalk . value ) | | ! host_client - > spectator ) )
2012-08-04 01:35:52 +00:00
msg = MVDWrite_Begin ( dem_all , 0 , strlen ( text ) + 3 ) ;
2005-07-03 15:16:20 +00:00
else
2012-08-04 01:35:52 +00:00
msg = MVDWrite_Begin ( dem_multiple , cls , strlen ( text ) + 3 ) ;
2004-08-23 00:15:46 +00:00
2012-08-04 01:35:52 +00:00
MSG_WriteByte ( msg , svc_print ) ;
MSG_WriteByte ( msg , PRINT_CHAT ) ;
MSG_WriteString ( msg , text ) ;
2018-09-01 04:18:08 +00:00
# endif
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
SV_Say_f
= = = = = = = = = = = = = = = = = =
*/
void SV_Say_f ( void )
{
SV_Say ( false ) ;
}
/*
= = = = = = = = = = = = = = = = = =
SV_Say_Team_f
= = = = = = = = = = = = = = = = = =
*/
void SV_Say_Team_f ( void )
{
SV_Say ( true ) ;
}
//============================================================================
/*
= = = = = = = = = = = = = = = = =
SV_Pings_f
The client is showing the scoreboard , so send new ping times for all
clients
= = = = = = = = = = = = = = = = =
*/
void SV_Pings_f ( void )
{
client_t * client ;
int j ;
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-08-23 00:15:46 +00:00
if ( sv . demofile )
{
2013-10-29 17:38:22 +00:00
for ( j = 0 , client = svs . clients ; j < svs . allocated_client_slots ; j + + , client + + )
2004-08-23 00:15:46 +00:00
{
if ( ! * sv . recordedplayer [ j ] . userinfo )
continue ;
ClientReliableWrite_Begin ( host_client , svc_updateping , 4 ) ;
ClientReliableWrite_Byte ( host_client , j ) ;
ClientReliableWrite_Short ( host_client , sv . recordedplayer [ j ] . ping ) ;
ClientReliableWrite_Begin ( host_client , svc_updatepl , 4 ) ;
ClientReliableWrite_Byte ( host_client , j ) ;
ClientReliableWrite_Byte ( host_client , sv . recordedplayer [ j ] . pl ) ;
}
return ;
}
2009-11-07 13:29:15 +00:00
# endif
2007-06-20 00:02:54 +00:00
if ( ISNQCLIENT ( host_client ) )
2004-08-23 00:15:46 +00:00
{
2007-06-20 00:02:54 +00:00
char * s ;
2013-12-02 14:30:30 +00:00
ClientReliableWrite_Begin ( host_client , svc_stufftext , 15 + 10 * sv . allocated_client_slots ) ;
2007-06-20 00:02:54 +00:00
ClientReliableWrite_SZ ( host_client , " pingplreport " , 12 ) ;
2013-10-29 17:38:22 +00:00
for ( j = 0 , client = svs . clients ; j < sv . allocated_client_slots & & j < host_client - > max_net_clients ; j + + , client + + )
2007-06-20 00:02:54 +00:00
{
2010-02-06 01:25:04 +00:00
s = va ( " %i %i " , SV_CalcPing ( client , false ) , client - > lossage ) ;
2007-06-20 00:02:54 +00:00
ClientReliableWrite_SZ ( host_client , s , strlen ( s ) ) ;
}
ClientReliableWrite_Byte ( host_client , ' \n ' ) ;
ClientReliableWrite_Byte ( host_client , ' \0 ' ) ;
2004-08-23 00:15:46 +00:00
2007-06-20 00:02:54 +00:00
}
else
{
2013-10-29 17:38:22 +00:00
for ( j = 0 , client = svs . clients ; j < sv . allocated_client_slots & & j < host_client - > max_net_clients ; j + + , client + + )
2007-06-20 00:02:54 +00:00
{
if ( client - > state ! = cs_spawned )
continue ;
ClientReliableWrite_Begin ( host_client , svc_updateping , 4 ) ;
ClientReliableWrite_Byte ( host_client , j ) ;
2010-02-06 01:25:04 +00:00
ClientReliableWrite_Short ( host_client , SV_CalcPing ( client , false ) ) ;
2007-06-20 00:02:54 +00:00
ClientReliableWrite_Begin ( host_client , svc_updatepl , 4 ) ;
ClientReliableWrite_Byte ( host_client , j ) ;
ClientReliableWrite_Byte ( host_client , client - > lossage ) ;
}
2004-08-23 00:15:46 +00:00
}
}
/*
= = = = = = = = = = = = = = = = = =
SV_Kill_f
= = = = = = = = = = = = = = = = = =
*/
void SV_Kill_f ( void )
{
2005-12-16 17:14:06 +00:00
float floodtime ;
2011-05-15 13:23:13 +00:00
2009-03-03 01:52:30 +00:00
# ifdef HLSERVER
if ( svs . gametype = = GT_HALFLIFE )
{
HLSV_ClientCommand ( host_client ) ;
return ;
}
# endif
2007-09-02 19:55:17 +00:00
2014-03-30 08:55:06 +00:00
switch ( svs . gametype )
2007-09-02 19:55:17 +00:00
{
2014-03-30 08:55:06 +00:00
# ifdef VM_Q1
case GT_Q1QVM :
2009-11-04 21:16:50 +00:00
pr_global_struct - > time = sv . world . physicstime ;
2007-09-02 19:55:17 +00:00
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
Q1QVM_ClientCommand ( ) ;
return ;
# endif
2014-03-30 08:55:06 +00:00
# ifdef VM_LUA
case GT_LUA :
# endif
case GT_PROGS :
break ;
default :
return ; //should have its own parsing.
}
2007-09-02 19:55:17 +00:00
2005-03-28 00:11:59 +00:00
if ( sv_player - > v - > health < = 0 )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Can't suicide -- Already dead \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2005-07-03 15:16:20 +00:00
2006-05-30 04:00:24 +00:00
if ( sv_floodprotect_suicide . value )
2005-12-16 17:14:06 +00:00
{
2006-05-30 04:00:24 +00:00
if ( ( floodtime = SV_CheckFloodProt ( host_client ) ) )
{
SV_ClientPrintf ( host_client , PRINT_HIGH , " You can't suicide for %i seconds \n " , ( int ) floodtime ) ;
return ;
}
SV_PushFloodProt ( host_client ) ;
2005-12-16 17:14:06 +00:00
}
2009-11-04 21:16:50 +00:00
pr_global_struct - > time = sv . world . physicstime ;
2004-08-23 00:15:46 +00:00
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
2014-09-14 01:45:11 +00:00
if ( pr_global_ptrs - > ClientKill )
PR_ExecuteProgram ( svprogfuncs , pr_global_struct - > ClientKill ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
SV_TogglePause
= = = = = = = = = = = = = = = = = =
*/
2006-01-21 00:06:49 +00:00
qboolean SV_TogglePause ( client_t * initiator )
2004-08-23 00:15:46 +00:00
{
2006-01-21 00:06:49 +00:00
int newv ;
2016-08-25 00:12:14 +00:00
newv = sv . paused ^ PAUSE_EXPLICIT ;
2006-01-21 00:06:49 +00:00
if ( ! PR_ShouldTogglePause ( initiator , newv ) )
return false ;
sv . paused = newv ;
2004-08-23 00:15:46 +00:00
2006-01-21 00:06:49 +00:00
sv . pausedstart = Sys_DoubleTime ( ) ;
2004-08-23 00:15:46 +00:00
2006-01-21 00:06:49 +00:00
return true ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
SV_Pause_f
= = = = = = = = = = = = = = = = = =
*/
void SV_Pause_f ( void )
{
2018-04-15 02:48:23 +00:00
int maypause ;
if ( ! * pausable . string )
maypause = ! deathmatch . ival ;
else
maypause = pausable . ival ;
if ( ! maypause )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Can't pause. Not allowed \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2018-09-01 04:18:08 +00:00
if ( host_client - > spectator )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Spectators may not pause the game \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2006-01-21 00:06:49 +00:00
if ( SV_TogglePause ( host_client ) )
{
2016-08-25 00:12:14 +00:00
if ( sv . paused & PAUSE_EXPLICIT )
2013-11-29 14:36:47 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH , " %s paused the game \n " , host_client - > name ) ;
2006-01-21 00:06:49 +00:00
else
2013-11-29 14:36:47 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH , " %s unpaused the game \n " , host_client - > name ) ;
2006-01-21 00:06:49 +00:00
}
2004-08-23 00:15:46 +00:00
}
2015-06-24 17:59:57 +00:00
static void SV_UpdateSeats ( client_t * controller )
{
2016-02-15 06:01:17 +00:00
client_t * cl ;
2015-06-24 17:59:57 +00:00
int curclients ;
2016-01-18 05:22:07 +00:00
if ( controller - > protocol = = SCP_QUAKE2 )
return ; //wait for the clientinfo stuff instead.
2016-02-15 06:01:17 +00:00
for ( curclients = 0 , cl = controller ; cl ; cl = cl - > controlled )
2021-06-25 18:50:42 +00:00
cl - > seat = curclients + + ;
2016-02-15 06:01:17 +00:00
2018-03-25 09:36:14 +00:00
ClientReliableWrite_Begin ( controller , svcfte_splitscreenconfig , 2 + curclients ) ;
2015-06-24 17:59:57 +00:00
ClientReliableWrite_Byte ( controller , curclients ) ;
for ( curclients = 0 , cl = controller ; cl ; cl = cl - > controlled , curclients + + )
{
ClientReliableWrite_Byte ( controller , cl - svs . clients ) ;
}
2021-06-25 18:50:42 +00:00
/*for (curclients = 0, cl = controller; cl; cl = cl->controlled, curclients++)
2015-06-24 17:59:57 +00:00
{
2020-04-30 14:33:58 +00:00
SV_SendFixAngle ( cl , NULL , FIXANGLE_FIXED , false ) ;
cl - > edict - > v - > fixangle = FIXANGLE_NO ; //no point doing it again
2021-06-25 18:50:42 +00:00
} */
2015-06-24 17:59:57 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = =
SV_Drop_f
The client is going to disconnect , so remove the connection immediately
= = = = = = = = = = = = = = = = =
*/
void SV_Drop_f ( void )
{
2011-09-06 20:53:38 +00:00
extern cvar_t sv_fullredirect ;
2015-06-24 17:59:57 +00:00
client_t * prev ;
2011-09-06 20:53:38 +00:00
2004-08-23 00:15:46 +00:00
SV_EndRedirect ( ) ;
2013-03-31 01:50:34 +00:00
if ( ! host_client - > drop )
2011-09-06 20:53:38 +00:00
{
2014-03-30 08:55:06 +00:00
if ( host_client - > redirect = = 2 )
2015-11-18 07:37:39 +00:00
SV_BroadcastPrintf ( PRINT_HIGH , " %s transfered to %s \n " , host_client - > name , host_client - > transfer ) ;
2014-03-30 08:55:06 +00:00
else if ( host_client - > redirect )
2013-03-31 01:50:34 +00:00
SV_BroadcastPrintf ( PRINT_HIGH , " %s redirected to %s \n " , host_client - > name , sv_fullredirect . string ) ;
else
{
if ( ! host_client - > spectator )
2013-11-29 14:36:47 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH , " %s dropped \n " , host_client - > name ) ;
2013-03-31 01:50:34 +00:00
}
host_client - > drop = true ;
2011-09-06 20:53:38 +00:00
}
2015-06-24 17:59:57 +00:00
//if splitscreen, orphan the dropper
if ( host_client - > controller )
{
for ( prev = host_client - > controller ; prev ; prev = prev - > controlled )
{
if ( prev - > controlled = = host_client )
{
prev - > controlled = host_client - > controlled ;
host_client - > netchan . remote_address . type = NA_INVALID ; //so the remaining client doesn't get the kick too.
host_client - > protocol = SCP_BAD ; //make it a bit like a bot, so we don't try sending any datagrams/reliables at someone that isn't able to receive anything.
SV_UpdateSeats ( host_client - > controller ) ;
host_client - > controller - > joinobservelockeduntil = realtime + 3 ;
host_client - > controlled = NULL ;
host_client - > controller = NULL ;
break ;
}
}
}
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = =
SV_PTrack_f
Change the bandwidth estimate for a client
= = = = = = = = = = = = = = = = =
*/
void SV_PTrack_f ( void )
{
int i ;
edict_t * ent , * tent ;
2005-07-03 15:16:20 +00:00
2009-11-07 13:29:15 +00:00
if ( ! host_client - > spectator
# ifdef SERVER_DEMO_PLAYBACK
& & ! sv . demofile
# endif
)
2004-08-23 00:15:46 +00:00
return ;
if ( Cmd_Argc ( ) ! = 2 )
{
// turn off tracking
host_client - > spec_track = 0 ;
2018-04-06 17:21:15 +00:00
ent = EDICT_NUM_PB ( svprogfuncs , host_client - svs . clients + 1 ) ;
tent = EDICT_NUM_PB ( svprogfuncs , 0 ) ;
2005-03-28 00:11:59 +00:00
ent - > v - > goalentity = EDICT_TO_PROG ( svprogfuncs , tent ) ;
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
if ( ISNQCLIENT ( host_client ) )
{
ClientReliableWrite_Begin ( host_client , svc_setview , 4 ) ;
ClientReliableWrite_Entity ( host_client , host_client - svs . clients + 1 ) ;
}
2004-08-23 00:15:46 +00:00
return ;
}
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
i = atoi ( Cmd_Argv ( 1 ) ) ;
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-08-23 00:15:46 +00:00
if ( * sv . recordedplayer [ i ] . userinfo )
{
host_client - > spec_track = i + 1 ;
return ;
}
2009-11-07 13:29:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
2013-05-09 02:18:15 +00:00
if ( ! SV_CanTrack ( host_client , i + 1 ) )
2004-08-23 00:15:46 +00:00
{
2018-09-23 19:35:24 +00:00
if ( i < 0 | | i > = sv . allocated_client_slots )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " invalid player to track \n " ) ;
else if ( svs . clients [ i ] . spectator )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " cannot track other spectators \n " ) ;
else if ( svs . clients [ i ] . state ! = cs_spawned )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " cannot track - player not spawned yet \n " ) ;
else
SV_ClientTPrintf ( host_client , PRINT_HIGH , " invalid player to track \n " ) ;
2004-08-23 00:15:46 +00:00
host_client - > spec_track = 0 ;
2018-04-06 17:21:15 +00:00
ent = EDICT_NUM_PB ( svprogfuncs , host_client - svs . clients + 1 ) ;
tent = EDICT_NUM_PB ( svprogfuncs , 0 ) ;
2005-03-28 00:11:59 +00:00
ent - > v - > goalentity = EDICT_TO_PROG ( svprogfuncs , tent ) ;
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
if ( ISNQCLIENT ( host_client ) )
{
ClientReliableWrite_Begin ( host_client , svc_setview , 4 ) ;
ClientReliableWrite_Entity ( host_client , host_client - svs . clients + 1 ) ;
}
2004-08-23 00:15:46 +00:00
return ;
}
host_client - > spec_track = i + 1 ; // now tracking
2018-04-06 17:21:15 +00:00
ent = EDICT_NUM_PB ( svprogfuncs , host_client - svs . clients + 1 ) ;
tent = EDICT_NUM_PB ( svprogfuncs , i + 1 ) ;
2005-03-28 00:11:59 +00:00
ent - > v - > goalentity = EDICT_TO_PROG ( svprogfuncs , tent ) ;
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
if ( ISNQCLIENT ( host_client ) )
{
ClientReliableWrite_Begin ( host_client , svc_setview , 4 ) ;
ClientReliableWrite_Entity ( host_client , i + 1 ) ;
}
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = =
SV_Rate_f
Change the bandwidth estimate for a client
= = = = = = = = = = = = = = = = =
*/
void SV_Rate_f ( void )
2005-07-03 15:16:20 +00:00
{
2004-08-23 00:15:46 +00:00
if ( Cmd_Argc ( ) ! = 2 )
{
2012-02-27 12:23:15 +00:00
int rate = SV_RateForClient ( host_client ) ;
if ( ! rate )
2013-03-12 22:47:42 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " Effective rate is unlimited \n " ) ;
2012-02-27 12:23:15 +00:00
else
SV_ClientPrintf ( host_client , PRINT_HIGH , " Effective rate %i \n " , rate ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2005-03-20 02:57:11 +00:00
2018-07-05 16:21:44 +00:00
InfoBuf_SetKey ( & host_client - > userinfo , " rate " , Cmd_Argv ( 1 ) ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
SV_ExtractFromUserinfo ( host_client , true ) ;
2005-03-20 02:57:11 +00:00
2015-04-14 23:12:17 +00:00
if ( host_client - > state > cs_connected )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " rate is changed to %i \n " , SV_RateForClient ( host_client ) ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = =
SV_Msg_f
Change the message level for a client
= = = = = = = = = = = = = = = = =
*/
void SV_Msg_f ( void )
2005-07-03 15:16:20 +00:00
{
2004-08-23 00:15:46 +00:00
if ( Cmd_Argc ( ) ! = 2 )
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " current msg level is %i \n " ,
2004-08-23 00:15:46 +00:00
host_client - > messagelevel ) ;
return ;
}
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
host_client - > messagelevel = atoi ( Cmd_Argv ( 1 ) ) ;
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " new msg level set to %i \n " , host_client - > messagelevel ) ;
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
qboolean SV_UserInfoIsBasic ( const char * infoname )
2005-12-15 19:15:39 +00:00
{
int i ;
2018-07-05 16:21:44 +00:00
for ( i = 1 ; basicuserinfos [ i ] ; i + + )
2005-12-15 19:15:39 +00:00
{
2018-07-05 16:21:44 +00:00
if ( * infoname = = ' * ' | | ! strcmp ( infoname , basicuserinfos [ i ] ) )
2005-12-15 19:15:39 +00:00
return true ;
}
return false ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = =
SV_SetInfo_f
Allow clients to change userinfo
= = = = = = = = = = = = = = = = = =
*/
void SV_SetInfo_f ( void )
{
2013-07-13 12:14:32 +00:00
char oldval [ MAX_INFO_KEY ] ;
2018-07-05 16:21:44 +00:00
char * key , * val , * t ;
2019-03-23 07:06:37 +00:00
size_t offset , keysize , valsize , cursize , k ;
2018-07-05 16:21:44 +00:00
qboolean final ;
2004-08-23 00:15:46 +00:00
if ( Cmd_Argc ( ) = = 1 )
{
2009-04-06 00:34:32 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " User info settings: \n " ) ;
2019-03-23 07:06:37 +00:00
for ( k = 0 ; k < host_client - > userinfo . numkeys ; k + + )
{
char * partial = key = host_client - > userinfo . keys [ k ] . partial ? " <PARTIAL> " : " " ;
if ( host_client - > num_backbuf > MAX_BACK_BUFFERS / 2 )
break ; //stop printing if there's too many...
key = host_client - > userinfo . keys [ k ] . name ;
val = host_client - > userinfo . keys [ k ] . value ;
if ( host_client - > userinfo . keys [ k ] . size ! = strlen ( host_client - > userinfo . keys [ k ] . value ) )
SV_ClientPrintf ( host_client , PRINT_HIGH , " \t %-20s%s<BINARY %u BYTES> \n " , key , partial , ( unsigned int ) host_client - > userinfo . keys [ k ] . size ) ;
else if ( host_client - > userinfo . keys [ k ] . size > 64 | | strchr ( val , ' \n ' ) | | strchr ( val , ' \r ' ) | | strchr ( val , ' \t ' ) )
SV_ClientPrintf ( host_client , PRINT_HIGH , " \t %-20s%s<%u BYTES> \n " , key , partial , ( unsigned int ) host_client - > userinfo . keys [ k ] . size ) ;
else
SV_ClientPrintf ( host_client , PRINT_HIGH , " \t %-20s%s%s \n " , key , partial , val ) ;
}
2018-07-05 16:21:44 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " [%u/%i, %u/%i] \n " , ( unsigned int ) host_client - > userinfo . numkeys , sv_userinfo_keylimit . ival , ( unsigned int ) host_client - > userinfo . totalsize , sv_userinfo_bytelimit . ival ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2018-08-09 06:21:39 +00:00
if ( Cmd_Argc ( ) = = 4 & & ( host_client - > fteprotocolextensions2 & PEXT2_INFOBLOBS ) )
2018-07-05 16:21:44 +00:00
{
offset = strtoul ( Cmd_Argv ( 3 ) , & t , 0 ) ;
final = ( * t ! = ' + ' ) ;
}
else if ( Cmd_Argc ( ) = = 3 )
{
offset = 0 ;
final = true ;
}
else
2004-08-23 00:15:46 +00:00
{
2009-04-06 00:34:32 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " usage: setinfo [ <key> <value> ] \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2007-09-03 22:37:13 +00:00
# ifdef VM_Q1
2021-12-20 10:07:55 +00:00
if ( Q1QVM_UserInfoChanged ( sv_player , false ) )
2007-09-03 22:37:13 +00:00
return ;
# endif
2004-08-23 00:15:46 +00:00
2018-07-05 16:21:44 +00:00
key = Cmd_Argv ( 1 ) ;
val = Cmd_Argv ( 2 ) ;
if ( strstr ( key , " \\ " ) | | strstr ( val , " \\ " ) )
return ; // illegal char, at least at this point.
2018-08-09 06:21:39 +00:00
if ( host_client - > fteprotocolextensions2 & PEXT2_INFOBLOBS )
{
key = InfoBuf_DecodeString ( key , key + strlen ( key ) , & keysize ) ;
val = InfoBuf_DecodeString ( val , val + strlen ( val ) , & valsize ) ;
}
else
{
keysize = strlen ( key ) ;
key = Z_StrDup ( key ) ;
valsize = strlen ( val ) ;
val = Z_StrDup ( val ) ;
}
2004-08-23 00:15:46 +00:00
2019-03-23 07:06:37 +00:00
if ( InfoBuf_FindKey ( & host_client - > userinfo , key , & k ) )
cursize = strlen ( host_client - > userinfo . keys [ k ] . name ) + 2 + host_client - > userinfo . keys [ k ] . size ;
else
cursize = 0 ;
2018-10-11 10:31:23 +00:00
if ( key [ 0 ] = = ' * ' & & ! ( ISNQCLIENT ( host_client ) & & ! host_client - > spawned & & ! strcmp ( key , " *ver " ) ) ) //nq clients are allowed to set some * keys if ClientConnect wasn't called yet. FIXME: saved games may still be an issue.
2018-07-05 16:21:44 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " setinfo: %s may not be changed mid-game \n " , key ) ;
else if ( sv_userinfo_keylimit . ival > = 0 & & host_client - > userinfo . numkeys > = sv_userinfo_keylimit . ival & & ! offset & & * val & & ! InfoBuf_FindKey ( & host_client - > userinfo , key , & k ) ) //when the limit is hit, allow people to freely change existing keys, but not new ones. they can also silently remove any that don't exist yet, too.
SV_ClientPrintf ( host_client , PRINT_MEDIUM , " setinfo: userinfo is limited to %i keys. Ignoring setting %s \n " , sv_userinfo_keylimit . ival , key ) ;
2019-06-18 13:03:37 +00:00
else if ( offset + valsize > cursize & & sv_userinfo_bytelimit . ival > = 0 & & host_client - > userinfo . totalsize + ( keysize + 2 + valsize ) > = sv_userinfo_bytelimit . ival )
2016-01-18 05:22:07 +00:00
{
2018-07-05 16:21:44 +00:00
SV_ClientPrintf ( host_client , PRINT_MEDIUM , " setinfo: userinfo is limited to %i bytes. Ignoring setting %s \n " , sv_userinfo_bytelimit . ival , key ) ;
if ( offset ) //kill it if they're part way through sending one, so that they're not penalised by the presence of partials that will never complete.
InfoBuf_RemoveKey ( & host_client - > userinfo , key ) ;
2016-01-18 05:22:07 +00:00
}
2018-07-05 16:21:44 +00:00
else if ( InfoBuf_SyncReceive ( & host_client - > userinfo , key , keysize , val , valsize , offset , final ) )
{
# ifdef Q2SERVER
if ( svs . gametype = = GT_QUAKE2 )
{
char tempbuffer [ 32768 ] ;
InfoBuf_ToString ( & host_client - > userinfo , tempbuffer , sizeof ( tempbuffer ) , NULL , NULL , NULL , NULL , NULL ) ;
ge - > ClientUserinfoChanged ( host_client - > q2edict , tempbuffer ) ; //tell the gamecode
SV_ExtractFromUserinfo ( host_client , true ) ; //let the server routines know
}
else
2016-02-10 23:23:43 +00:00
# endif
2018-07-05 16:21:44 +00:00
{
2016-01-18 05:22:07 +00:00
2018-07-05 16:21:44 +00:00
if ( progstype ! = PROG_QW & & ! strcmp ( key , " bottomcolor " ) )
{ //team fortress has a nasty habit of booting people without this
sv_player - > v - > team = atoi ( Cmd_Argv ( 2 ) ) + 1 ;
}
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2018-07-05 16:21:44 +00:00
if ( progstype ! = PROG_QW & & ! strcmp ( key , " model " ) )
{
eval_t * eval = svprogfuncs - > GetEdictFieldValue ( svprogfuncs , sv_player , " playermodel " , ev_string , NULL ) ;
if ( eval )
svprogfuncs - > SetStringField ( svprogfuncs , sv_player , & eval - > string , Cmd_Argv ( 2 ) , false ) ;
}
if ( progstype ! = PROG_QW & & ! strcmp ( key , " skin " ) )
{
eval_t * eval = svprogfuncs - > GetEdictFieldValue ( svprogfuncs , sv_player , " playerskin " , ev_string , NULL ) ;
if ( eval )
svprogfuncs - > SetStringField ( svprogfuncs , sv_player , & eval - > string , Cmd_Argv ( 2 ) , false ) ;
}
2017-08-29 02:29:06 +00:00
# endif
2018-07-05 16:21:44 +00:00
// process any changed values
// chat happens far too often and makes debugging annoying, as well as making logs spammy
if ( strcmp ( key , " chat " ) )
{
SV_ExtractFromUserinfo ( host_client , true ) ;
SV_LogPlayer ( host_client , " userinfo changed " ) ;
}
2005-12-15 19:15:39 +00:00
2018-07-05 16:21:44 +00:00
PR_ClientUserInfoChanged ( key , oldval , InfoBuf_ValueForKey ( & host_client - > userinfo , key ) ) ;
}
2005-07-01 19:23:00 +00:00
}
2021-12-20 10:07:55 +00:00
# ifdef VM_Q1
Q1QVM_UserInfoChanged ( sv_player , true ) ;
# endif
2018-07-05 16:21:44 +00:00
Z_Free ( key ) ;
Z_Free ( val ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
SV_ShowServerinfo_f
Dumps the serverinfo info string
= = = = = = = = = = = = = = = = = =
*/
void SV_ShowServerinfo_f ( void )
{
2009-04-06 00:34:32 +00:00
SV_BeginRedirect ( RD_CLIENT , host_client - > language ) ;
2018-07-05 16:21:44 +00:00
InfoBuf_Print ( & svs . info , " " ) ;
2009-04-06 00:34:32 +00:00
SV_EndRedirect ( ) ;
2004-08-23 00:15:46 +00:00
}
void SV_NoSnap_f ( void )
{
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " refused snap " ) ;
2013-03-12 23:24:15 +00:00
if ( * host_client - > uploadfn )
{
2004-08-23 00:15:46 +00:00
* host_client - > uploadfn = 0 ;
2013-11-29 14:36:47 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH , " %s refused remote screenshot \n " , host_client - > name ) ;
2004-08-23 00:15:46 +00:00
}
}
//3 votes per player.
typedef struct voteinfo_s {
struct voteinfo_s * next ;
float timeout ;
int clientid ;
char command [ 1 ] ;
} voteinfo_t ;
voteinfo_t * voteinfo ;
void VoteAdd ( char * cmd , int id )
{
voteinfo_t * vote ;
vote = Z_Malloc ( sizeof ( voteinfo_t ) + strlen ( cmd ) ) ; //null term is part of voteinfo_t
strcpy ( vote - > command , cmd ) ;
vote - > clientid = id ;
vote - > timeout = realtime + votetime . value * 60 ;
vote - > next = voteinfo ;
voteinfo = vote ;
}
void VoteRemoveCommands ( char * command , int id ) //all of one command
{
voteinfo_t * vote , * prev ;
prev = NULL ;
for ( vote = voteinfo ; vote ; vote = vote - > next )
{
if ( ( ! command | | ! strcmp ( vote - > command , command ) ) & & ( vote - > clientid = = id | | id = = - 1 ) )
{
if ( prev )
prev - > next = vote - > next ;
else
voteinfo = vote - > next ;
Z_Free ( vote ) ;
VoteRemoveCommands ( command , id ) ;
return ;
}
else
prev = vote ;
}
}
void VoteFlushAll ( void )
{
VoteRemoveCommands ( NULL , - 1 ) ;
}
int VoteCount ( char * command , int id ) //all of one command
{
voteinfo_t * vote ;
int num = 0 ;
for ( vote = voteinfo ; vote ; vote = vote - > next )
{
if ( ! command | | ! strcmp ( vote - > command , command ) )
{
if ( vote - > clientid = = id | | id = = - 1 )
num + + ;
}
}
return num ;
}
void VoteCheckTimes ( void )
{
voteinfo_t * vote , * prev ;
prev = NULL ;
2008-05-26 21:50:11 +00:00
for ( vote = voteinfo ; vote ; )
2004-08-23 00:15:46 +00:00
{
if ( vote - > timeout < realtime )
{
if ( prev )
prev - > next = vote - > next ;
else
voteinfo = vote - > next ;
Z_Free ( vote ) ;
2008-05-26 21:50:11 +00:00
if ( prev )
vote = prev ;
else
vote = voteinfo ;
2004-08-23 00:15:46 +00:00
}
else
prev = vote ;
2008-05-26 21:50:11 +00:00
vote = vote - > next ;
2004-08-23 00:15:46 +00:00
}
}
void SV_Vote_f ( void )
{
char * command = Cmd_Args ( ) ;
char * base ;
int id = host_client - > userid ;
int num ;
int totalusers = 0 ;
qboolean passes ;
2014-06-25 03:53:11 +00:00
if ( ! votelevel . value | | ( ( host_client - > penalties & ( BAN_MUTE | BAN_DEAF ) ) = = ( BAN_MUTE | BAN_DEAF ) ) )
2004-08-23 00:15:46 +00:00
{
2015-12-28 17:41:39 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Voting is dissallowed on this server \n " ) ;
return ;
}
if ( ! * command )
{
char cmds [ 900 ] ;
Cmd_EnumerateLevel ( votelevel . value , cmds , sizeof ( cmds ) ) ;
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Allowed commands: \n %s \n " , cmds ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-06-25 03:53:11 +00:00
if ( host_client - > penalties & BAN_MUTE )
2004-08-23 00:15:46 +00:00
{
2015-12-28 17:41:39 +00:00
//pretend to vote for it
if ( host_client - > penalties & BAN_STEALTH )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " %s casts a vote for '%s' \n " , host_client - > name , command ) ;
else
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Sorry, you cannot vote when muted as it may allow you to send a message. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
Cmd_ExecLevel = votelevel . value ;
base = command ;
while ( * base > ' ' )
base + + ;
2005-07-03 15:16:20 +00:00
if ( * base )
2004-08-23 00:15:46 +00:00
* base = ' \0 ' ;
else
base = NULL ;
if ( strchr ( command , ' ; ' ) | | ! strcmp ( command , " if " ) )
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " You arn't allowed to vote for that \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
num = Cmd_Level ( command ) ;
if ( base )
* base = ' ' ;
if ( num ! = Cmd_ExecLevel )
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " You arn't allowed to vote for that \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2005-07-03 15:16:20 +00:00
VoteCheckTimes ( ) ;
2004-08-23 00:15:46 +00:00
for ( num = 0 ; num < sv . allocated_client_slots ; num + + )
if ( svs . clients [ num ] . state = = cs_spawned )
totalusers + + ;
if ( VoteCount ( command , id ) )
{
VoteRemoveCommands ( command , id ) ;
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Old vote removed. \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
if ( VoteCount ( NULL , id ) > = 3 )
{
VoteRemoveCommands ( NULL , id ) ;
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " All votes removed. \n " ) ;
2004-08-23 00:15:46 +00:00
}
num = VoteCount ( command , - 1 ) + 1 ;
passes = true ;
if ( votepercent . value < 0 & & ( float ) ( totalusers - num ) > = 0.5 * totalusers )
passes = false ;
if ( votepercent . value > = 0 & & num < = totalusers * votepercent . value / 100 )
passes = false ;
if ( num < voteminimum . value )
passes = false ;
if ( passes ) //>min number of votes, and meets the percent required
{
2013-11-29 14:36:47 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH , " %s casts final vote for '%s' \n " , host_client - > name , command ) ;
2004-08-23 00:15:46 +00:00
VoteRemoveCommands ( command , - 1 ) ;
Cbuf_AddText ( command , votelevel . value ) ;
2005-09-07 14:55:25 +00:00
Cbuf_AddText ( " \n " , votelevel . value ) ;
2004-08-23 00:15:46 +00:00
//Cmd_ExecuteString (command, votelevel.value);
return ;
}
else //otherwise, try later.
{
2013-11-29 14:36:47 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH , " %s casts a vote for '%s' \n " , host_client - > name , command ) ;
2004-08-23 00:15:46 +00:00
VoteAdd ( command , id ) ;
}
}
2005-01-07 02:36:13 +00:00
void Cmd_Notarget_f ( void )
2004-08-23 00:15:46 +00:00
{
2010-08-14 03:17:33 +00:00
if ( ! SV_MayCheat ( ) )
2005-01-07 02:36:13 +00:00
{
2009-04-06 00:34:32 +00:00
SV_PrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
2005-01-07 02:36:13 +00:00
return ;
}
2013-12-17 22:45:37 +00:00
if ( svs . gametype ! = GT_PROGS )
return ;
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " notarget cheat " ) ;
2005-03-28 00:11:59 +00:00
if ( ( int ) ( sv_player - > v - > flags = ( int ) sv_player - > v - > flags ^ FL_NOTARGET ) & FL_NOTARGET )
2004-08-23 00:15:46 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " notarget ON \n " ) ;
else
SV_ClientPrintf ( host_client , PRINT_HIGH , " notarget OFF \n " ) ;
2005-01-07 02:36:13 +00:00
}
2004-08-23 00:15:46 +00:00
2005-01-07 02:36:13 +00:00
//Sets client to godmode
void Cmd_God_f ( void )
{
2010-08-14 03:17:33 +00:00
if ( ! SV_MayCheat ( ) )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2013-12-17 22:45:37 +00:00
if ( svs . gametype ! = GT_PROGS )
return ;
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " god cheat " ) ;
2005-03-28 00:11:59 +00:00
if ( ( int ) ( sv_player - > v - > flags = ( int ) sv_player - > v - > flags ^ FL_GODMODE ) & FL_GODMODE )
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " godmode ON \n " ) ;
2004-08-23 00:15:46 +00:00
else
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " godmode OFF \n " ) ;
2004-08-23 00:15:46 +00:00
}
void Cmd_Give_f ( void )
{
2009-04-01 22:03:56 +00:00
# ifdef HLSERVER
if ( svs . gametype = = GT_HALFLIFE )
{
HLSV_ClientCommand ( host_client ) ;
return ;
}
# endif
2010-08-14 03:17:33 +00:00
if ( ! SV_MayCheat ( ) )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-03-30 08:55:06 +00:00
if ( ! svprogfuncs )
2013-12-17 22:45:37 +00:00
return ;
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " give cheat " ) ;
2015-09-01 04:45:15 +00:00
# ifdef QUAKESTATS
2016-10-22 07:06:51 +00:00
{
char * t = Cmd_Argv ( 1 ) ;
if ( strlen ( t ) = = 1 & & ( Cmd_Argc ( ) = = 3 | | ( * t > = ' 0 ' & & * t < = ' 9 ' ) ) )
{
int v = atoi ( Cmd_Argv ( 2 ) ) ;
switch ( t [ 0 ] )
{
case ' 2 ' :
case ' 3 ' :
case ' 4 ' :
case ' 5 ' :
case ' 6 ' :
case ' 7 ' :
case ' 8 ' :
case ' 9 ' :
sv_player - > v - > items = ( int ) sv_player - > v - > items | IT_SHOTGUN < < ( t [ 0 ] - ' 2 ' ) ;
break ;
2004-08-23 00:15:46 +00:00
2016-10-22 07:06:51 +00:00
case ' s ' :
sv_player - > v - > ammo_shells = v ;
break ;
case ' n ' :
sv_player - > v - > ammo_nails = v ;
break ;
case ' r ' :
sv_player - > v - > ammo_rockets = v ;
break ;
case ' h ' :
sv_player - > v - > health = v ;
break ;
case ' c ' :
sv_player - > v - > ammo_cells = v ;
break ;
default :
SV_TPrintToClient ( host_client , PRINT_HIGH , " give: unknown item \n " ) ;
}
return ;
2004-08-23 00:15:46 +00:00
}
}
2015-09-01 04:45:15 +00:00
# endif
2016-10-22 07:06:51 +00:00
if ( svprogfuncs - > EvaluateDebugString )
2004-08-23 00:15:46 +00:00
{
2012-01-17 07:57:46 +00:00
if ( developer . value < 2 & & host_client - > netchan . remote_address . type ! = NA_LOOPBACK ) //we don't want clients doing nasty things... like setting movetype 3123
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " 'give' debugging command requires developer 2 set on the server before you may use it \n " ) ;
2012-01-17 07:57:46 +00:00
}
else
{
int oldself ;
oldself = pr_global_struct - > self ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Result: %s \n " , svprogfuncs - > EvaluateDebugString ( svprogfuncs , Cmd_Args ( ) ) ) ;
2012-01-17 07:57:46 +00:00
pr_global_struct - > self = oldself ;
}
2004-08-23 00:15:46 +00:00
}
}
2014-06-21 17:58:17 +00:00
void Cmd_Spiderpig_f ( void )
{
if ( ! SV_MayCheat ( ) )
{
SV_TPrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
return ;
}
if ( ! svprogfuncs )
return ;
SV_LogPlayer ( host_client , " spiderpig cheat " ) ;
if ( sv_player - > v - > movetype ! = MOVETYPE_WALLWALK )
{
sv_player - > v - > movetype = MOVETYPE_WALLWALK ;
sv_player - > v - > solid = SOLID_TRIGGER ;
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Spider-Pig, Spider-Pig, does whatever a Spider-Pig does... \n " ) ;
}
else
{
sv_player - > v - > movetype = MOVETYPE_WALK ;
if ( sv_player - > v - > health > 0 )
sv_player - > v - > solid = SOLID_SLIDEBOX ;
else
sv_player - > v - > solid = SOLID_NOT ;
SV_ClientTPrintf ( host_client , PRINT_HIGH , " Spider-Pig, Spider-Pig! \n " ) ;
}
}
2004-08-23 00:15:46 +00:00
void Cmd_Noclip_f ( void )
{
2015-10-11 11:34:58 +00:00
# ifdef HLSERVER
if ( svs . gametype = = GT_HALFLIFE )
{
HLSV_ClientCommand ( host_client ) ;
return ;
}
# endif
2010-08-14 03:17:33 +00:00
if ( ! SV_MayCheat ( ) )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-03-30 08:55:06 +00:00
if ( ! svprogfuncs )
2013-12-17 22:45:37 +00:00
return ;
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " noclip cheat " ) ;
2005-03-28 00:11:59 +00:00
if ( sv_player - > v - > movetype ! = MOVETYPE_NOCLIP )
2004-08-23 00:15:46 +00:00
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > movetype = MOVETYPE_NOCLIP ;
sv_player - > v - > solid = SOLID_TRIGGER ;
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " noclip ON \n " ) ;
2004-08-23 00:15:46 +00:00
}
else
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > movetype = MOVETYPE_WALK ;
if ( sv_player - > v - > health > 0 )
sv_player - > v - > solid = SOLID_SLIDEBOX ;
2004-08-23 00:15:46 +00:00
else
2005-03-28 00:11:59 +00:00
sv_player - > v - > solid = SOLID_NOT ;
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " noclip OFF \n " ) ;
2004-08-23 00:15:46 +00:00
}
}
2014-06-21 17:58:17 +00:00
void Cmd_6dof_f ( void )
{
if ( ! SV_MayCheat ( ) )
{
SV_TPrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
return ;
}
if ( ! svprogfuncs )
return ;
SV_LogPlayer ( host_client , " 6dof cheat " ) ;
if ( sv_player - > v - > movetype ! = MOVETYPE_6DOF )
{
sv_player - > v - > movetype = MOVETYPE_6DOF ;
SV_ClientTPrintf ( host_client , PRINT_HIGH , " 6dof mode ON \n " ) ;
}
else
{
sv_player - > v - > movetype = MOVETYPE_WALK ;
if ( sv_player - > v - > health > 0 )
sv_player - > v - > solid = SOLID_SLIDEBOX ;
else
sv_player - > v - > solid = SOLID_NOT ;
SV_ClientTPrintf ( host_client , PRINT_HIGH , " 6dof mode OFF \n " ) ;
}
}
2005-01-07 02:36:13 +00:00
void Cmd_Fly_f ( void )
{
2010-08-14 03:17:33 +00:00
if ( ! SV_MayCheat ( ) )
2005-01-07 02:36:13 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
2005-01-07 02:36:13 +00:00
return ;
}
2014-03-30 08:55:06 +00:00
if ( ! svprogfuncs )
2013-12-17 22:45:37 +00:00
return ;
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " fly cheat " ) ;
2005-03-28 00:11:59 +00:00
if ( sv_player - > v - > movetype ! = MOVETYPE_FLY )
2005-01-07 02:36:13 +00:00
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > movetype = MOVETYPE_FLY ;
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " flymode ON \n " ) ;
2005-01-07 02:36:13 +00:00
}
else
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > movetype = MOVETYPE_WALK ;
if ( sv_player - > v - > health > 0 )
sv_player - > v - > solid = SOLID_SLIDEBOX ;
2005-01-07 02:36:13 +00:00
else
2005-03-28 00:11:59 +00:00
sv_player - > v - > solid = SOLID_NOT ;
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " flymode OFF \n " ) ;
2005-01-07 02:36:13 +00:00
}
}
2020-06-12 23:29:58 +00:00
# if defined(_DEBUG) && defined(SUBSERVERS)
2015-06-04 06:15:14 +00:00
void Cmd_SSV_Transfer_f ( void )
2014-09-02 02:44:43 +00:00
{
char * dest = Cmd_Argv ( 1 ) ;
if ( ! SV_MayCheat ( ) )
{
SV_TPrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
return ;
}
SSV_InitiatePlayerTransfer ( host_client , dest ) ;
}
2015-06-04 06:15:14 +00:00
void Cmd_SSV_AllSay_f ( void )
{
char * text = Cmd_Args ( ) ;
if ( ! SV_MayCheat ( ) )
{
SV_TPrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
return ;
}
SSV_Send ( " " , host_client - > name , " say " , text ) ;
}
void Cmd_SSV_Join_f ( void )
{
int i ;
char * who = Cmd_Argv ( 1 ) ;
if ( ! SV_MayCheat ( ) )
{
SV_TPrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
return ;
}
for ( i = 0 ; i < sv . allocated_client_slots ; i + + )
{
if ( ! strcmp ( who , svs . clients [ i ] . name ) )
{
// VectorCopy(svs.clients[i].edict->v->origin, sv_player->v->oldorigin);
VectorCopy ( svs . clients [ i ] . edict - > v - > origin , sv_player - > v - > origin ) ;
World_LinkEdict ( & sv . world , ( wedict_t * ) sv_player , false ) ;
sv_player - > xv - > dimension_hit = ( int ) sv_player - > xv - > dimension_hit & ~ 128 ;
sv_player - > xv - > dimension_solid = ( int ) sv_player - > xv - > dimension_solid & 128 ;
svs . clients [ i ] . edict - > xv - > dimension_hit = ( int ) svs . clients [ i ] . edict - > xv - > dimension_hit & ~ 128 ;
svs . clients [ i ] . edict - > xv - > dimension_solid = ( int ) svs . clients [ i ] . edict - > xv - > dimension_solid & 128 ;
return ;
}
}
SSV_Send ( who , host_client - > name , " join " , " " ) ;
}
2014-09-02 02:44:43 +00:00
# endif
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = =
Host_SetPos_f UDC
2005-07-01 19:23:00 +00:00
By Alex Shadowalker ( and added to fte because he kept winging )
2004-08-23 00:15:46 +00:00
= = = = = = = = = = = = = = = = = = = =
*/
void Cmd_SetPos_f ( void )
2005-07-03 15:16:20 +00:00
{
2010-08-14 03:17:33 +00:00
if ( ! SV_MayCheat ( ) )
2004-08-23 00:15:46 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Cheats are not allowed on this server \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-03-30 08:55:06 +00:00
if ( ! svprogfuncs )
2013-12-17 22:45:37 +00:00
return ;
2018-12-28 00:04:36 +00:00
if ( Cmd_Argc ( ) ! = 4 & & Cmd_Argc ( ) ! = 7 )
2004-08-23 00:15:46 +00:00
{
2018-12-28 00:04:36 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " setpos %f %f %f %f %f %f \n " , sv_player - > v - > origin [ 0 ] , sv_player - > v - > origin [ 1 ] , sv_player - > v - > origin [ 2 ] , sv_player - > v - > v_angle [ 0 ] , sv_player - > v - > v_angle [ 1 ] , sv_player - > v - > v_angle [ 2 ] ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2007-07-27 21:24:31 +00:00
SV_LogPlayer ( host_client , " setpos cheat " ) ;
2005-03-28 00:11:59 +00:00
if ( sv_player - > v - > movetype ! = MOVETYPE_NOCLIP )
2004-08-23 00:15:46 +00:00
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > movetype = MOVETYPE_NOCLIP ;
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " noclip on \n " ) ;
2004-08-23 00:15:46 +00:00
}
2014-09-14 01:45:11 +00:00
//make sure they're not going to whizz away from it
VectorClear ( sv_player - > v - > velocity ) ;
2005-03-28 00:11:59 +00:00
sv_player - > v - > origin [ 0 ] = atof ( Cmd_Argv ( 1 ) ) ;
sv_player - > v - > origin [ 1 ] = atof ( Cmd_Argv ( 2 ) ) ;
sv_player - > v - > origin [ 2 ] = atof ( Cmd_Argv ( 3 ) ) ;
2009-11-04 21:16:50 +00:00
World_LinkEdict ( & sv . world , ( wedict_t * ) sv_player , false ) ;
2018-12-28 00:04:36 +00:00
if ( Cmd_Argc ( ) > 4 )
{
sv_player - > v - > angles [ 0 ] = atof ( Cmd_Argv ( 4 ) ) ;
sv_player - > v - > angles [ 1 ] = atof ( Cmd_Argv ( 5 ) ) ;
sv_player - > v - > angles [ 2 ] = atof ( Cmd_Argv ( 6 ) ) ;
2020-04-30 14:33:58 +00:00
sv_player - > v - > fixangle = FIXANGLE_FIXED ;
2018-12-28 00:04:36 +00:00
}
2004-08-23 00:15:46 +00:00
}
2005-10-07 16:27:20 +00:00
void SV_SetUpClientEdict ( client_t * cl , edict_t * ent )
2004-08-23 00:15:46 +00:00
{
2007-09-02 19:55:17 +00:00
# ifdef VM_Q1
if ( svs . gametype = = GT_Q1QVM )
{
string_t preserve ;
preserve = ent - > v - > netname ;
2015-06-20 14:22:06 +00:00
if ( progstype ! = PROG_NQ ) //allow frikbots to work in NQ mods (but not qw!)
ED_Clear ( svprogfuncs , ent ) ;
2007-09-02 19:55:17 +00:00
ent - > v - > netname = preserve ;
}
else
# endif
{
if ( progstype ! = PROG_NQ ) //allow frikbots to work in NQ mods (but not qw!)
2009-11-04 21:16:50 +00:00
ED_Clear ( svprogfuncs , ent ) ;
2014-03-30 08:55:06 +00:00
svprogfuncs - > SetStringField ( svprogfuncs , ent , & ent - > v - > netname , cl - > name , true ) ;
2007-09-02 19:55:17 +00:00
}
2008-06-01 22:06:22 +00:00
ED_Spawned ( ent , false ) ;
2016-07-12 00:40:13 +00:00
ent - > ereftype = ER_ENTITY ;
2005-07-03 15:16:20 +00:00
2005-03-28 00:11:59 +00:00
ent - > v - > colormap = NUM_FOR_EDICT ( svprogfuncs , ent ) ;
2004-08-23 00:15:46 +00:00
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2016-07-12 00:40:13 +00:00
{
if ( pr_teamfield )
( ( string_t * ) ent - > v ) [ pr_teamfield ] = ( string_t ) ( cl - > team - svprogfuncs - > stringtable ) ;
}
2004-10-29 06:11:33 +00:00
2005-10-12 23:04:25 +00:00
{
2018-07-05 16:21:44 +00:00
int tc = atoi ( InfoBuf_ValueForKey ( & cl - > userinfo , " topcolor " ) ) ;
int bc = atoi ( InfoBuf_ValueForKey ( & cl - > userinfo , " bottomcolor " ) ) ;
2005-10-12 23:04:25 +00:00
if ( tc < 0 | | tc > 13 )
tc = 0 ;
if ( bc < 0 | | bc > 13 )
bc = 0 ;
2007-09-02 19:55:17 +00:00
ent - > xv - > clientcolors = 16 * tc + bc ;
2005-10-12 23:04:25 +00:00
}
2017-08-29 02:29:06 +00:00
cl - > dp_ping = NULL ;
cl - > dp_pl = NULL ;
if ( progstype = = PROG_NQ )
{
cl - > dp_ping = ( float * ) sv . world . progs - > GetEdictFieldValue ( sv . world . progs , ent , " ping " , ev_float , NULL ) ;
cl - > dp_pl = ( float * ) sv . world . progs - > GetEdictFieldValue ( sv . world . progs , ent , " ping_packetloss " , ev_float , NULL ) ;
}
2016-07-12 00:40:13 +00:00
# endif
2005-10-12 23:04:25 +00:00
2004-10-29 06:11:33 +00:00
2007-09-02 19:55:17 +00:00
ent - > xv - > gravity = cl - > entgravity = 1.0 ;
ent - > xv - > maxspeed = cl - > maxspeed = sv_maxspeed . value ;
2005-03-28 00:11:59 +00:00
ent - > v - > movetype = MOVETYPE_NOCLIP ;
2010-11-14 14:35:26 +00:00
2010-11-15 02:40:31 +00:00
ent - > v - > frags = 0 ;
2010-11-14 14:35:26 +00:00
cl - > connection_started = realtime ;
2004-08-23 00:15:46 +00:00
}
2015-06-24 17:59:57 +00:00
//dynamically add/remove a splitscreen client
static void Cmd_AddSeat_f ( void )
{
client_t * cl , * prev ;
qboolean changed = false ;
2018-03-25 09:36:14 +00:00
//don't allow an altseat to add or remove. that's not how this works.
2015-06-24 17:59:57 +00:00
if ( host_client - > controller )
return ;
if ( host_client - > state ! = cs_spawned )
return ;
if ( ! ( host_client - > fteprotocolextensions & PEXT_SPLITSCREEN ) )
return ;
if ( Cmd_Argc ( ) > 1 )
{
int num = atoi ( Cmd_Argv ( 1 ) ) ;
int count ;
2021-08-04 21:16:57 +00:00
if ( num < = 0 | | host_client - > joinobservelockeduntil > realtime )
2015-06-24 17:59:57 +00:00
return ;
2021-06-25 18:50:42 +00:00
if ( host_client - > netchan . remote_address . type ! = NA_LOOPBACK )
host_client - > joinobservelockeduntil = realtime + 2 ;
2015-06-24 17:59:57 +00:00
for ( count = 1 , prev = host_client , cl = host_client - > controlled ; cl ; cl = cl - > controlled )
{
2021-08-04 21:16:57 +00:00
if ( count > = num )
2015-06-24 17:59:57 +00:00
{
for ( ; cl ; cl = prev - > controlled )
{
//unlink it
prev - > controlled = cl - > controlled ;
cl - > controller = NULL ;
cl - > controlled = NULL ;
//make it into a pseudo-bot
cl - > netchan . remote_address . type = NA_INVALID ; //so the remaining client doesn't get the kick too.
cl - > protocol = SCP_BAD ; //make it a bit like a bot, so we don't try sending any datagrams/reliables at someone that isn't able to receive anything.
//okay, it can get lost now.
cl - > drop = true ;
}
2018-03-25 09:36:14 +00:00
host_client - > joinobservelockeduntil = realtime + 3 ;
2015-06-24 17:59:57 +00:00
changed = true ;
break ;
}
prev = cl ;
count + + ;
}
2017-08-14 16:38:44 +00:00
2021-08-04 21:16:57 +00:00
if ( ! changed & & count + 1 = = num & & Cmd_Argc ( ) > 2 )
changed = ! ! SV_AddSplit ( host_client , Cmd_Argv ( 2 ) , num - 1 ) ;
2015-06-24 17:59:57 +00:00
}
else
{
cl = NULL ;
/* if (host_client->joinobservelockeduntil > realtime)
{
SV_TPrintToClient ( host_client , PRINT_HIGH , va ( " Please wait %.1g more seconds \n " , host_client - > joinobservelockeduntil - realtime ) ) ;
return ;
}
host_client - > joinobservelockeduntil = realtime + 2 ;
cl = SV_AddSplit ( host_client , host_client - > userinfo , 0 ) ;
*/
}
if ( cl | | changed )
SV_UpdateSeats ( host_client ) ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = =
Cmd_Join_f
Set client to player mode without reconnecting
= = = = = = = = = = = = = = = = = =
*/
void Cmd_Join_f ( void )
{
int i ;
client_t * cl ;
int numclients ;
extern cvar_t maxclients ;
2013-06-23 02:17:02 +00:00
int seats ;
if ( host_client - > controller )
{
host_client = host_client - > controller ;
sv_player = host_client - > edict ;
}
2004-08-23 00:15:46 +00:00
if ( host_client - > state ! = cs_spawned )
return ;
2015-07-01 23:15:25 +00:00
if ( svs . gametype ! = GT_PROGS & & svs . gametype ! = GT_Q1QVM )
2007-09-03 22:37:13 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Sorry, not implemented in this gamecode type. Try moaning at the dev team \n " ) ;
2007-09-03 22:37:13 +00:00
return ;
}
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
if ( ! ISNQCLIENT ( host_client ) & & ! ( host_client - > zquake_extensions & Z_EXT_JOIN_OBSERVE ) )
2005-01-04 08:04:42 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Your game client doesn't support this command \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-08-24 17:16:12 +00:00
if ( ! host_client - > spectator )
{
SV_ClientTPrintf ( host_client , PRINT_HIGH , " You are not currently spectating. \n " ) ;
return ;
}
if ( host_client - > joinobservelockeduntil > realtime )
{
SV_TPrintToClient ( host_client , PRINT_HIGH , va ( " Please wait %.1g more seconds \n " , host_client - > joinobservelockeduntil - realtime ) ) ;
return ;
}
host_client - > joinobservelockeduntil = realtime + 2 ;
2005-01-04 08:04:42 +00:00
if ( password . string [ 0 ] & & stricmp ( password . string , " none " ) )
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " This server requires a %s password. Please disconnect, set the password and reconnect as %s. \n " , " player " , " player " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-06-30 21:57:35 +00:00
if ( host_client - > penalties & BAN_SPECONLY )
{
SV_ClientTPrintf ( host_client , PRINT_HIGH , " You are banned from joining the game. \n " ) ;
return ;
}
2004-08-23 00:15:46 +00:00
// count players already on server
numclients = 0 ;
2013-06-23 02:17:02 +00:00
seats = 0 ;
2005-01-04 08:04:42 +00:00
for ( i = 0 , cl = svs . clients ; i < sv . allocated_client_slots ; i + + , cl + + )
{
2004-08-23 00:15:46 +00:00
if ( cl - > state ! = cs_free & & ! cl - > spectator )
numclients + + ;
2013-06-23 02:17:02 +00:00
if ( ( cl = = host_client | | cl - > controller = = host_client ) & & cl - > spectator )
seats + + ;
2004-08-23 00:15:46 +00:00
}
2013-06-23 02:17:02 +00:00
if ( numclients + seats > maxclients . value )
2005-01-04 08:04:42 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Can't join, all player slots full \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
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
if ( ISNQCLIENT ( host_client ) )
{ //make sure the nq client is viewing from its own player entity again
ClientReliableWrite_Begin ( host_client , svc_setview , 4 ) ;
ClientReliableWrite_Entity ( host_client , host_client - svs . clients + 1 ) ;
}
2013-06-23 02:17:02 +00:00
for ( ; host_client ; host_client = host_client - > controlled )
{
sv_player = host_client - > edict ;
if ( ! host_client - > spectator )
continue ;
2004-08-23 00:15:46 +00:00
2020-04-19 01:23:32 +00:00
SV_DespawnClient ( host_client ) ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
SV_SetUpClientEdict ( host_client , host_client - > edict ) ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
// turn the spectator into a player
host_client - > spectator = false ;
2018-07-05 16:21:44 +00:00
InfoBuf_RemoveKey ( & host_client - > userinfo , " *spectator " ) ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
// FIXME, bump the client's userid?
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
// call the progs to get default spawn parms for the new client
2015-08-02 11:36:46 +00:00
# ifdef VM_Q1
2015-07-01 23:15:25 +00:00
if ( svs . gametype = = GT_Q1QVM )
Q1QVM_SetNewParms ( ) ;
2015-08-02 11:36:46 +00:00
else
# endif
if ( pr_global_ptrs - > SetNewParms )
2013-06-23 02:17:02 +00:00
PR_ExecuteProgram ( svprogfuncs , pr_global_struct - > SetNewParms ) ;
2017-05-28 15:42:32 +00:00
SV_SpawnParmsToClient ( host_client ) ;
2005-07-03 15:16:20 +00:00
2015-08-02 11:36:46 +00:00
# ifdef VM_Q1
2015-07-01 23:15:25 +00:00
if ( svs . gametype = = GT_Q1QVM )
Q1QVM_ClientConnect ( host_client ) ;
else
2015-08-02 11:36:46 +00:00
# endif
2015-07-01 23:15:25 +00:00
{
// call the spawn function
pr_global_struct - > time = sv . world . physicstime ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
PR_ExecuteProgram ( svprogfuncs , pr_global_struct - > ClientConnect ) ;
2004-08-23 00:15:46 +00:00
2015-07-01 23:15:25 +00:00
// actually spawn the player
pr_global_struct - > time = sv . world . physicstime ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
PR_ExecuteProgram ( svprogfuncs , pr_global_struct - > PutClientInServer ) ;
}
2013-06-23 02:17:02 +00:00
sv . spawned_client_slots + + ;
// send notification to all clients
host_client - > old_frags = host_client - > edict - > v - > frags ;
host_client - > sendinfo = true ;
2007-07-27 21:24:31 +00:00
2013-06-23 02:17:02 +00:00
SV_LogPlayer ( host_client , " joined " ) ;
}
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = =
Cmd_Observe_f
Set client to spectator mode without reconnecting
= = = = = = = = = = = = = = = = = =
*/
void Cmd_Observe_f ( void )
{
int i ;
client_t * cl ;
int numspectators ;
extern cvar_t maxspectators , spectator_password ;
2013-06-23 02:17:02 +00:00
int seats ;
if ( host_client - > controller )
{
host_client = host_client - > controller ;
sv_player = host_client - > edict ;
}
2004-08-23 00:15:46 +00:00
if ( host_client - > state ! = cs_spawned )
return ;
2011-05-15 13:23:13 +00:00
2015-07-01 23:15:25 +00:00
if ( svs . gametype ! = GT_PROGS & & svs . gametype ! = GT_Q1QVM )
2007-09-03 22:37:13 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Sorry, not implemented in this gamecode type. Try moaning at the dev team \n " ) ;
2007-09-03 22:37:13 +00:00
return ;
}
2004-08-23 00:15:46 +00:00
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
if ( ! ISNQCLIENT ( host_client ) & & ! ( host_client - > zquake_extensions & Z_EXT_JOIN_OBSERVE ) )
2005-01-17 17:48:13 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Your game client doesn't support this command \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2014-08-24 17:16:12 +00:00
if ( host_client - > spectator )
{
SV_ClientTPrintf ( host_client , PRINT_HIGH , " You are already spectating. \n " ) ;
return ;
}
if ( host_client - > joinobservelockeduntil > realtime )
{
SV_TPrintToClient ( host_client , PRINT_HIGH , va ( " Please wait %.1g more seconds \n " , host_client - > joinobservelockeduntil - realtime ) ) ;
return ;
}
host_client - > joinobservelockeduntil = realtime + 2 ;
2005-01-17 17:48:13 +00:00
if ( spectator_password . string [ 0 ] & & stricmp ( spectator_password . string , " none " ) )
{
2013-11-29 14:36:47 +00:00
SV_ClientTPrintf ( host_client , PRINT_HIGH , " This server requires a %s password. Please disconnect, set the password and reconnect as %s. \n " , " spectator " , " spectator " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
// count spectators already on server
numspectators = 0 ;
2013-06-23 02:17:02 +00:00
seats = 0 ;
for ( i = 0 , cl = svs . clients ; i < sv . allocated_client_slots ; i + + , cl + + )
{
2004-08-23 00:15:46 +00:00
if ( cl - > state ! = cs_free & & cl - > spectator )
numspectators + + ;
2013-06-23 02:17:02 +00:00
if ( ( cl = = host_client | | cl - > controller = = host_client ) & & ! cl - > spectator )
seats + + ;
2004-08-23 00:15:46 +00:00
}
2013-06-23 02:17:02 +00:00
if ( numspectators + seats > maxspectators . value )
2005-01-17 17:48:13 +00:00
{
2013-11-29 14:36:47 +00:00
SV_TPrintToClient ( host_client , PRINT_HIGH , " Can't join, all spectator slots full \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
2013-06-23 02:17:02 +00:00
for ( ; host_client ; host_client = host_client - > controlled )
{
sv_player = host_client - > edict ;
if ( host_client - > spectator )
continue ;
2004-08-23 00:15:46 +00:00
2020-04-19 01:23:32 +00:00
SV_DespawnClient ( host_client ) ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
SV_SetUpClientEdict ( host_client , host_client - > edict ) ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
// turn the player into a spectator
host_client - > spectator = true ;
2018-07-05 16:21:44 +00:00
InfoBuf_SetValueForStarKey ( & host_client - > userinfo , " *spectator " , " 1 " ) ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
// FIXME, bump the client's userid?
// call the progs to get default spawn parms for the new client
2015-08-02 11:36:46 +00:00
# ifdef VM_Q1
2015-07-01 23:15:25 +00:00
if ( svs . gametype = = GT_Q1QVM )
Q1QVM_SetNewParms ( ) ;
2015-08-02 11:36:46 +00:00
else
# endif
if ( pr_global_ptrs - > SetNewParms )
2013-06-23 02:17:02 +00:00
PR_ExecuteProgram ( svprogfuncs , pr_global_struct - > SetNewParms ) ;
2017-05-28 15:42:32 +00:00
SV_SpawnParmsToClient ( host_client ) ;
2013-06-23 02:17:02 +00:00
SV_SpawnSpectator ( ) ;
// call the spawn function
2015-08-02 11:36:46 +00:00
# ifdef VM_Q1
2015-07-01 23:15:25 +00:00
if ( svs . gametype = = GT_Q1QVM )
Q1QVM_ClientConnect ( host_client ) ;
2005-06-22 17:10:13 +00:00
else
2015-08-02 11:36:46 +00:00
# endif
2015-02-07 22:34:22 +00:00
{
2015-07-01 23:15:25 +00:00
if ( SpectatorConnect )
{
pr_global_struct - > time = sv . world . physicstime ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
PR_ExecuteProgram ( svprogfuncs , SpectatorConnect ) ;
}
else
{
sv_player - > v - > movetype = MOVETYPE_NOCLIP ;
sv_player - > v - > model = 0 ;
sv_player - > v - > modelindex = 0 ;
}
2015-02-07 22:34:22 +00:00
}
2013-06-23 02:17:02 +00:00
sv . spawned_observer_slots + + ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
// send notification to all clients
host_client - > old_frags = host_client - > edict - > v - > frags ;
host_client - > sendinfo = true ;
2005-07-03 15:16:20 +00:00
2013-06-23 02:17:02 +00:00
SV_LogPlayer ( host_client , " observing " ) ;
2004-08-23 00:15:46 +00:00
}
2013-06-23 02:17:02 +00:00
}
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
void SV_CalcNetRates ( client_t * cl , double * ftime , int * frames , double * minf , double * maxf )
{
int f ;
int fmsec ;
* minf = 1000 ;
* maxf = 0 ;
* ftime = 0 ;
* frames = 0 ;
2007-07-27 21:24:31 +00:00
2013-06-23 02:17:02 +00:00
if ( ISQWCLIENT ( cl ) | | ISNQCLIENT ( cl ) )
{
if ( cl - > frameunion . frames )
{
for ( f = 0 ; f < UPDATE_BACKUP ; f + + )
{
if ( cl - > frameunion . frames [ f ] . move_msecs > = 0 )
{
if ( ! cl - > frameunion . frames [ f ] . move_msecs )
{
fmsec = 1001 ;
}
else
{
fmsec = 1000.0f / cl - > frameunion . frames [ f ] . move_msecs ;
}
* ftime + = fmsec ;
if ( * minf > fmsec )
* minf = fmsec ;
if ( * maxf < fmsec )
* maxf = fmsec ;
* frames + = 1 ;
}
}
}
}
2004-08-23 00:15:46 +00:00
}
2017-01-24 10:27:39 +00:00
static void Cmd_FPSList_f ( void )
2007-07-23 11:44:45 +00:00
{
client_t * cl ;
int c ;
2013-06-23 02:17:02 +00:00
double minf , maxf ;
2007-07-23 11:44:45 +00:00
double ftime ;
int frames ;
2013-09-06 22:57:44 +00:00
char * protoname ;
2007-07-23 11:44:45 +00:00
for ( c = 0 ; c < sv . allocated_client_slots ; c + + )
{
cl = & svs . clients [ c ] ;
if ( ! cl - > state )
continue ;
2013-06-23 02:17:02 +00:00
SV_CalcNetRates ( cl , & ftime , & frames , & minf , & maxf ) ;
2007-07-23 11:44:45 +00:00
2013-09-06 22:57:44 +00:00
switch ( cl - > protocol )
{
case SCP_QUAKEWORLD : protoname = ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ? " fteqw " : ( cl - > fteprotocolextensions | | cl - > fteprotocolextensions2 ? " qw " : " qwid " ) ; break ;
case SCP_QUAKE2 : protoname = " q2 " ; break ;
case SCP_QUAKE3 : protoname = " q3 " ; break ;
2016-07-12 00:40:13 +00:00
case SCP_NETQUAKE : protoname = ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ? " ftenq " : " nq " ; break ;
case SCP_BJP3 : protoname = ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ? " ftenq " : " bjp3 " ; break ;
2013-09-06 22:57:44 +00:00
case SCP_FITZ666 : protoname = ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) ? " ftenq " : " fitz " ; break ;
case SCP_DARKPLACES6 : protoname = " dpp6 " ; break ;
case SCP_DARKPLACES7 : protoname = " dpp7 " ; break ;
default : protoname = " ? " ; break ;
}
2007-07-23 11:44:45 +00:00
if ( frames )
2013-09-06 22:57:44 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " %s: %gfps (%g - %g), c2s: %ibps, s2c: %ibps, ping %ims(-%i), pl %i%% %s \n " , cl - > name , ftime / frames , minf , maxf , ( int ) cl - > inrate , ( int ) cl - > outrate , SV_CalcPing ( cl , false ) , ( int ) ( 1000 * cl - > delay ) , cl - > lossage , protoname ) ;
2007-07-23 11:44:45 +00:00
else
2013-09-06 22:57:44 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " %s: unknown framerate, c2s: %ibps, s2c: %ibps, ping %ims(-%i), pl %i%% %s \n " , cl - > name , ( int ) cl - > inrate , ( int ) cl - > outrate , SV_CalcPing ( cl , false ) , ( int ) ( 1000 * cl - > delay ) , cl - > lossage , protoname ) ;
2007-07-23 11:44:45 +00:00
}
}
2005-03-10 03:55:18 +00:00
void SV_EnableClientsCSQC ( void )
{
2020-03-25 20:56:01 +00:00
size_t e ;
2015-06-24 17:59:57 +00:00
if ( host_client - > controller )
return ;
2016-07-12 00:40:13 +00:00
host_client - > csqcactive = true ;
2020-03-25 20:56:01 +00:00
//if the csqc has just restarted, its probably going to want us to resend all csqc ents from scratch because of all the setup it might do.
2020-04-19 01:23:32 +00:00
if ( host_client - > pendingcsqcbits )
for ( e = 1 ; e < host_client - > max_net_ents ; e + + )
if ( host_client - > pendingcsqcbits [ e ] & SENDFLAGS_PRESENT )
host_client - > pendingcsqcbits [ e ] | = SENDFLAGS_USABLE ;
2005-03-10 03:55:18 +00:00
}
2006-01-11 22:21:35 +00:00
void SV_DisableClientsCSQC ( void )
{
# ifdef PEXT_CSQC
2007-06-20 00:02:54 +00:00
host_client - > csqcactive = false ;
2006-01-11 22:21:35 +00:00
# endif
}
2005-03-10 03:55:18 +00:00
2010-01-11 17:39:56 +00:00
void SV_UserCmdMVDList_f ( void ) ;
2009-11-04 21:16:50 +00:00
2004-08-23 00:15:46 +00:00
# ifdef NQPROT
2017-01-24 10:27:39 +00:00
static void SVNQ_Spawn_f ( void )
2004-08-23 00:15:46 +00:00
{
2005-02-12 18:56:04 +00:00
extern cvar_t sv_gravity ;
2004-08-23 00:15:46 +00:00
int i ;
client_t * client ;
edict_t * ent ;
if ( host_client - > state ! = cs_connected )
{
2005-07-28 15:22:15 +00:00
Con_Printf ( " spawn not valid -- already spawned \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
// send all current names, colors, and frag counts
// FIXME: is this a good thing?
2018-10-23 07:09:06 +00:00
// SZ_Clear (&host_client->netchan.message);
2004-08-23 00:15:46 +00:00
// send current status of all other players
// normally this could overflow, but no need to check due to backbuf
for ( i = 0 , client = svs . clients ; i < sv . allocated_client_slots ; i + + , client + + )
2013-03-31 04:21:08 +00:00
SV_FullClientUpdate ( client , host_client ) ;
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2011-06-05 01:36:14 +00:00
SV_MVD_FullClientUpdate ( NULL , host_client ) ;
2018-09-01 04:18:08 +00:00
# endif
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
// send all current light styles
2019-09-10 15:40:04 +00:00
for ( i = 0 ; i < sv . maxlightstyles ; i + + )
SV_SendLightstyle ( host_client , NULL , i , true ) ;
2004-08-23 00:15:46 +00:00
// set up the edict
ent = host_client - > edict ;
2014-05-10 13:42:13 +00:00
if ( ! ent )
{
}
else if ( host_client - > istobeloaded ) //minimal setup
2004-08-23 00:15:46 +00:00
{
2007-09-02 19:55:17 +00:00
host_client - > entgravity = ent - > xv - > gravity * sv_gravity . value ;
host_client - > maxspeed = ent - > xv - > maxspeed ;
2004-08-23 00:15:46 +00:00
}
else
{
2010-07-11 02:22:39 +00:00
ED_Clear ( svprogfuncs , ent ) ;
2008-06-01 22:06:22 +00:00
ED_Spawned ( ent , false ) ;
2004-08-23 00:15:46 +00:00
2005-03-28 00:11:59 +00:00
ent - > v - > colormap = NUM_FOR_EDICT ( svprogfuncs , ent ) ;
ent - > v - > team = 0 ; // FIXME
2017-10-12 12:02:25 +00:00
svprogfuncs - > SetStringField ( svprogfuncs , ent , & ent - > v - > netname , host_client - > name , true ) ;
2004-08-23 00:15:46 +00:00
2007-09-02 19:55:17 +00:00
host_client - > entgravity = ent - > xv - > gravity = 1.0 ;
2005-02-12 18:56:04 +00:00
host_client - > entgravity * = sv_gravity . value ;
2007-09-02 19:55:17 +00:00
host_client - > maxspeed = ent - > xv - > maxspeed = sv_maxspeed . value ;
2004-08-23 00:15:46 +00:00
}
//
// force stats to be updated
//
2008-05-25 22:23:43 +00:00
memset ( host_client - > statsi , 0 , sizeof ( host_client - > statsi ) ) ;
memset ( host_client - > statsf , 0 , sizeof ( host_client - > statsf ) ) ;
memset ( host_client - > statss , 0 , sizeof ( host_client - > statss ) ) ;
2004-08-23 00:15:46 +00:00
2014-05-10 13:42:13 +00:00
if ( pr_global_ptrs - > total_secrets )
{
ClientReliableWrite_Begin ( host_client , svcnq_updatestatlong , 6 ) ;
ClientReliableWrite_Byte ( host_client , STAT_TOTALSECRETS ) ;
ClientReliableWrite_Long ( host_client , pr_global_struct - > total_secrets ) ;
}
if ( pr_global_ptrs - > total_monsters )
{
ClientReliableWrite_Begin ( host_client , svcnq_updatestatlong , 6 ) ;
ClientReliableWrite_Byte ( host_client , STAT_TOTALMONSTERS ) ;
ClientReliableWrite_Long ( host_client , pr_global_struct - > total_monsters ) ;
}
if ( pr_global_ptrs - > found_secrets )
{
ClientReliableWrite_Begin ( host_client , svcnq_updatestatlong , 6 ) ;
ClientReliableWrite_Byte ( host_client , STAT_SECRETS ) ;
ClientReliableWrite_Long ( host_client , pr_global_struct - > found_secrets ) ;
}
if ( pr_global_ptrs - > killed_monsters )
{
ClientReliableWrite_Begin ( host_client , svcnq_updatestatlong , 6 ) ;
ClientReliableWrite_Byte ( host_client , STAT_MONSTERS ) ;
ClientReliableWrite_Long ( host_client , pr_global_struct - > killed_monsters ) ;
}
2004-08-23 00:15:46 +00:00
2018-09-29 17:31:58 +00:00
//nq servers call ClientConnect early.
//qw servers hold off until the last possible moment.
//so qw servers prevent the player from getting shot too early.
//while nq ensures that reliables sent in ClientConnect are actually flushed before unreliables/entities start to arrive.
2020-04-30 14:33:58 +00:00
SV_Begin_Core ( host_client ) ;
2017-08-14 16:38:44 +00:00
2018-03-25 09:36:14 +00:00
ClientReliableWrite_Begin ( host_client , svcnq_signonnum , 2 ) ;
2015-02-07 22:34:22 +00:00
ClientReliableWrite_Byte ( host_client , 3 ) ;
2004-08-23 00:15:46 +00:00
host_client - > send_message = true ;
}
2017-01-24 10:27:39 +00:00
static void SVNQ_Begin_f ( void )
2004-08-23 00:15:46 +00:00
{
unsigned pmodel = 0 , emodel = 0 ;
if ( host_client - > state = = cs_spawned )
return ; // don't begin again
host_client - > state = cs_spawned ;
2020-04-30 14:33:58 +00:00
//while qw spawns player entity in the 'begin' stage, nq spawns in the 'spawn' stage rather than here.
// SV_Begin_Core(host_client);
2004-08-23 00:15:46 +00:00
// clear the net statistics, because connecting gives a bogus picture
host_client - > netchan . frame_latency = 0 ;
host_client - > netchan . frame_rate = 0 ;
host_client - > netchan . drop_count = 0 ;
host_client - > netchan . good_count = 0 ;
//check he's not cheating
if ( sv_playermodelchecks . value )
{
2018-07-05 16:21:44 +00:00
pmodel = atoi ( InfoBuf_ValueForKey ( & host_client - > userinfo , " pmodel " ) ) ;
emodel = atoi ( InfoBuf_ValueForKey ( & host_client - > userinfo , " emodel " ) ) ;
2004-08-23 00:15:46 +00:00
if ( pmodel ! = sv . model_player_checksum | |
emodel ! = sv . eyes_player_checksum )
2013-11-29 14:36:47 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH , " warning: %s eyes or player model not verified \n " , host_client - > name ) ;
2004-08-23 00:15:46 +00:00
}
2005-07-03 15:16:20 +00:00
2005-05-26 12:55:34 +00:00
// MSG_WriteByte (&host_client->netchan.message, svc_signonnum);
// MSG_WriteByte (&host_client->netchan.message, 4);
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
host_client - > send_message = true ;
2015-06-20 14:22:06 +00:00
SV_PreRunCmd ( ) ;
host_client - > lastcmd . msec = 0 ;
SV_RunCmd ( & host_client - > lastcmd , false ) ;
SV_PostRunCmd ( ) ;
2018-10-27 04:32:18 +00:00
host_client - > lastruncmd = sv . time * 1000 ;
2004-08-23 00:15:46 +00:00
}
2017-01-24 10:27:39 +00:00
static void SVNQ_PreSpawn_f ( void )
2004-08-23 00:15:46 +00:00
{
2016-07-12 00:40:13 +00:00
if ( host_client - > prespawn_stage < PRESPAWN_MAPCHECK )
SV_StuffcmdToClient ( host_client , va ( " cmd prespawn %s \n " , Cmd_Args ( ) ) ) ;
else if ( host_client - > prespawn_stage = = PRESPAWN_MAPCHECK )
2011-10-27 16:16:29 +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
host_client - > checksum = ~ 0u ;
host_client - > prespawn_stage = PRESPAWN_MAPCHECK + 1 ;
host_client - > prespawn_idx = 0 ;
2014-12-02 02:00:41 +00:00
if ( sv_mapcheck . value )
2016-02-15 06:01:17 +00:00
{
const char * prot = " " ;
switch ( host_client - > protocol )
{
2016-07-12 00:40:13 +00:00
default :
break ;
2016-02-15 06:01:17 +00:00
case SCP_NETQUAKE :
2022-01-16 18:41:44 +00:00
prot = host_client - > qex ? " (qe15) " : " (nq) " ;
2016-02-15 06:01:17 +00:00
break ;
2016-07-12 00:40:13 +00:00
case SCP_BJP3 :
prot = " (bjp3) " ;
2016-02-15 06:01:17 +00:00
break ;
case SCP_FITZ666 :
2022-01-16 18:41:44 +00:00
prot = host_client - > qex ? " (qe666) " : " (fitz) " ;
2016-02-15 06:01:17 +00:00
break ;
case SCP_DARKPLACES6 :
prot = " (dpp6) " ;
break ;
case SCP_DARKPLACES7 :
prot = " (dpp7) " ;
break ;
}
2016-10-22 07:06:51 +00:00
Con_DPrintf ( " Warning: %s cannot be enforced on player %s%s. \n " , sv_mapcheck . name , host_client - > name , prot ) ; //as you can fake it in a client anyway, this is hardly a significant issue.
2016-02-15 06:01:17 +00:00
}
2011-10-27 16:16:29 +00:00
}
2004-08-23 00:15:46 +00:00
host_client - > send_message = true ;
}
2017-01-24 10:27:39 +00:00
static void SVNQ_NQInfo_f ( void )
2004-08-23 00:15:46 +00:00
{
2018-09-29 17:31:58 +00:00
char buf [ 8192 ] ;
Cmd_TokenizeString ( va ( " setinfo \" %s \" %s \n " , Cmd_Argv ( 0 ) , COM_QuotedString ( Cmd_Argv ( 1 ) , buf , sizeof ( buf ) , false ) ) , false , false ) ;
2005-07-03 15:16:20 +00:00
SV_SetInfo_f ( ) ;
2004-08-23 00:15:46 +00:00
}
2017-01-24 10:27:39 +00:00
static void SVNQ_NQColour_f ( void )
2004-08-23 00:15:46 +00:00
{
2016-07-12 00:40:13 +00:00
char * val ;
2004-08-23 00:15:46 +00:00
int top ;
int bottom ;
if ( Cmd_Argc ( ) = = 2 )
top = bottom = atoi ( Cmd_Argv ( 1 ) ) ;
else
{
top = atoi ( Cmd_Argv ( 1 ) ) ;
bottom = atoi ( Cmd_Argv ( 2 ) ) ;
}
top & = 15 ;
if ( top > 13 )
top = 13 ;
bottom & = 15 ;
if ( bottom > 13 )
bottom = 13 ;
2005-07-03 15:16:20 +00:00
2014-05-10 13:42:13 +00:00
if ( progstype ! = PROG_QW & & host_client - > edict )
2005-03-28 00:11:59 +00:00
host_client - > edict - > v - > team = bottom + 1 ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
val = va ( " %i " , top ) ;
2018-07-05 16:21:44 +00:00
if ( InfoBuf_SetValueForKey ( & host_client - > userinfo , " topcolor " , val ) )
2017-03-30 18:37:16 +00:00
SV_BroadcastUserinfoChange ( host_client , true , " topcolor " , NULL ) ;
2016-07-12 00:40:13 +00:00
val = va ( " %i " , bottom ) ;
2018-07-05 16:21:44 +00:00
if ( InfoBuf_SetValueForKey ( & host_client - > userinfo , " bottomcolor " , val ) )
2017-03-30 18:37:16 +00:00
SV_BroadcastUserinfoChange ( host_client , true , " bottomcolor " , NULL ) ;
2016-07-12 00:40:13 +00:00
2004-08-23 00:15:46 +00:00
switch ( bottom )
{
case 4 :
2016-07-12 00:40:13 +00:00
val = " red " ;
2004-08-23 00:15:46 +00:00
break ;
case 14 :
2016-07-12 00:40:13 +00:00
val = " blue " ;
2004-08-23 00:15:46 +00:00
break ;
default :
2016-07-12 00:40:13 +00:00
val = va ( " t%i " , bottom + 1 ) ;
2004-08-23 00:15:46 +00:00
break ;
}
2018-07-05 16:21:44 +00:00
if ( strcmp ( val , InfoBuf_ValueForKey ( & host_client - > userinfo , " team " ) ) )
2016-07-12 00:40:13 +00:00
{
2018-07-05 16:21:44 +00:00
InfoBuf_SetValueForKey ( & host_client - > userinfo , " team " , val ) ;
2017-03-30 18:37:16 +00:00
SV_BroadcastUserinfoChange ( host_client , true , " team " , NULL ) ;
2016-07-12 00:40:13 +00:00
}
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
SV_ExtractFromUserinfo ( host_client , true ) ;
2004-08-23 00:15:46 +00:00
}
2017-08-29 02:29:06 +00:00
static void SVNQ_DPModel_f ( void )
{
Cmd_TokenizeString ( va ( " setinfo model \" %s \" \n " , Cmd_Argv ( 1 ) ) , false , false ) ;
SV_SetInfo_f ( ) ;
}
static void SVNQ_DPSkin_f ( void )
{
Cmd_TokenizeString ( va ( " setinfo skin \" %s \" \n " , Cmd_Argv ( 1 ) ) , false , false ) ;
SV_SetInfo_f ( ) ;
}
2017-01-24 10:27:39 +00:00
static void SVNQ_Ping_f ( void )
2005-05-26 12:55:34 +00:00
{
int i ;
client_t * cl ;
2013-11-29 14:36:47 +00:00
//don't translate this, most advanced clients (including us) automate and parse them, the results being visible in the scoreboard and NOT the console.
//translating these prints can thus confuse things greatly.
2008-11-09 22:29:28 +00:00
SV_PrintToClient ( host_client , PRINT_HIGH , " Client ping times: \n " ) ;
2013-12-02 14:30:30 +00:00
for ( i = 0 , cl = svs . clients ; i < sv . allocated_client_slots ; i + + , cl + + )
2005-05-26 12:55:34 +00:00
{
if ( ! cl - > state )
continue ;
2010-02-06 01:25:04 +00:00
SV_PrintToClient ( host_client , PRINT_HIGH , va ( " %3i %s \n " , SV_CalcPing ( cl , false ) , cl - > name ) ) ;
2005-05-26 12:55:34 +00:00
}
}
2017-01-24 10:27:39 +00:00
static void SVNQ_Status_f ( void )
{ //note: numerous NQ clients poll for this...
//so try to ensure that we adhere to various rules...
//we have a different function for server operators to use which contains more info.
int i ;
client_t * cl ;
int count ;
extern cvar_t maxclients , maxspectators ;
/*
int nummodels , numsounds ;
for ( nummodels = 1 ; nummodels < MAX_PRECACHE_MODELS ; nummodels + + )
if ( ! sv . strings . model_precache [ nummodels ] )
break ;
for ( numsounds = 1 ; numsounds < MAX_PRECACHE_SOUNDS ; numsounds + + )
if ( ! sv . strings . sound_precache [ numsounds ] )
break ; */
SV_PrintToClient ( host_client , PRINT_HIGH , va ( " host: %s \n " , hostname . string ) ) ; //must be first, with same first 9 chars
SV_PrintToClient ( host_client , PRINT_HIGH , va ( " version: %s \n " , version_string ( ) ) ) ;
// SV_PrintToClient(host_client, PRINT_HIGH, va("IPv4: \n", ));
// SV_PrintToClient(host_client, PRINT_HIGH, va("IPv6: \n", ));
SV_PrintToClient ( host_client , PRINT_HIGH , va ( " map: %s \n " , svs . name ) ) ;
/* for (count = 1; count < MAX_PRECACHE_MODELS; count++)
if ( ! sv . strings . model_precache [ count ] )
break ;
SV_PrintToClient ( host_client , PRINT_HIGH , va ( " models: %i/%i \n " , count - 1 , MAX_PRECACHE_MODELS - 1 ) ) ; */
/* for (count = 1; count < MAX_PRECACHE_SOUNDS; count++)
if ( ! sv . strings . sound_precache [ count ] )
break ;
SV_PrintToClient ( host_client , PRINT_HIGH , va ( " sounds: %i/%i \n " , count - 1 , MAX_PRECACHE_SOUNDS - 1 ) ) ; */
// SV_PrintToClient(host_client, PRINT_HIGH, va("entities:%i/%i\n", sv.world.num_edicts, sv.world.max_edicts));
for ( count = 0 , i = 0 , cl = svs . clients ; i < sv . allocated_client_slots ; i + + , cl + + )
{
if ( cl - > state )
count + + ;
}
SV_PrintToClient ( host_client , PRINT_HIGH , va ( " players: %i active (%i max) \n \n " , count , min ( maxclients . ival + maxspectators . ival , sv . allocated_client_slots ) ) ) ; //must be last
for ( i = 0 , cl = svs . clients ; i < sv . allocated_client_slots ; i + + , cl + + )
{
2017-08-29 02:29:06 +00:00
int hours , mins , secs ;
2017-01-24 10:27:39 +00:00
if ( ! cl - > state )
continue ;
2017-08-29 02:29:06 +00:00
secs = realtime - cl - > connection_started ;
mins = secs / 60 ;
secs - = mins * 60 ;
hours = mins / 60 ;
mins - = hours * 60 ;
SV_PrintToClient ( host_client , PRINT_HIGH , va ( " #%-2u %-16.16s %3i %2i:%02i:%02i \n " , i + 1 , cl - > name , cl - > old_frags , hours , mins , secs ) ) ;
2017-02-11 16:14:06 +00:00
SV_PrintToClient ( host_client , PRINT_HIGH , va ( " %s \n " , SV_PlayerPublicAddress ( cl ) ) ) ;
2017-01-24 10:27:39 +00:00
}
}
2005-05-26 12:55:34 +00:00
2017-01-24 10:27:39 +00:00
static void SVNQ_Protocols_f ( void )
2016-07-12 00:40:13 +00:00
{
int i ;
host_client - > supportedprotocols = 0 ;
for ( i = 1 ; i < Cmd_Argc ( ) ; )
{
switch ( strtoul ( Cmd_Argv ( i + + ) , NULL , 0 ) )
{
case PROTOCOL_VERSION_BJP3 :
host_client - > supportedprotocols | = 1u < < SCP_BJP3 ;
break ;
case PROTOCOL_VERSION_FITZ :
host_client - > supportedprotocols | = 1u < < SCP_FITZ666 ;
break ;
case PROTOCOL_VERSION_RMQ :
host_client - > supportedprotocols | = 1u < < SCP_FITZ666 ;
break ;
case PROTOCOL_VERSION_DP6 :
host_client - > supportedprotocols | = 1u < < SCP_DARKPLACES6 ;
break ;
case PROTOCOL_VERSION_DP7 :
host_client - > supportedprotocols | = 1u < < SCP_DARKPLACES7 ;
break ;
default : //don't know what you are. at least don't bug out.
host_client - > supportedprotocols | = 1u < < SCP_NETQUAKE ;
break ;
}
}
}
2011-07-30 14:14:56 +00:00
/*
void SVNQ_ExecuteUserCommand ( char * s )
{
client_t * oldhost = host_client ;
ucmd_t * u ;
Cmd_TokenizeString ( s , false , false ) ;
sv_player = host_client - > edict ;
Cmd_ExecLevel = 1 ;
for ( u = nqucmds ; u - > name ; u + + )
{
if ( ! strcmp ( Cmd_Argv ( 0 ) , u - > name ) )
{
if ( / * ! fromQC & & * / ! u - > noqchandling )
if ( PR_UserCmd ( s ) )
{
host_client = oldhost ;
return ;
}
if ( ! u - > func )
{
SV_BeginRedirect ( RD_CLIENT , host_client - > language ) ;
Con_Printf ( " Command was disabled \n " ) ;
SV_EndRedirect ( ) ;
}
else
{
SV_BeginRedirect ( RD_CLIENT , host_client - > language ) ;
u - > func ( ) ;
SV_EndRedirect ( ) ;
}
host_client = oldhost ;
return ;
}
}
if ( ! u - > name )
Con_Printf ( " %s tried to \" %s \" \n " , host_client - > name , s ) ;
}
*/
# endif
2019-03-23 07:06:37 +00:00
//used when we can't use our getchallenge handshake for some reason.
//this is both nq (where there's no challenge at all) and qw-via-qwfwd (where the proxy handshakes before talking to the actual server)
void SV_Pext_f ( void )
{
int i ;
char * tag ;
char * val ;
if ( host_client - > pextknown )
return ;
host_client - > pextknown = true ;
host_client - > fteprotocolextensions = 0 ;
host_client - > fteprotocolextensions2 = 0 ;
for ( i = 1 ; i < Cmd_Argc ( ) ; )
{
tag = Cmd_Argv ( i + + ) ;
val = Cmd_Argv ( i + + ) ;
switch ( strtoul ( tag , NULL , 0 ) )
{
2019-05-10 09:31:21 +00:00
case PROTOCOL_VERSION_FTE1 :
host_client - > fteprotocolextensions = strtoul ( val , NULL , 0 ) & Net_PextMask ( PROTOCOL_VERSION_FTE1 , ISNQCLIENT ( host_client ) ) ;
2019-03-23 07:06:37 +00:00
break ;
case PROTOCOL_VERSION_FTE2 :
2019-05-10 09:31:21 +00:00
host_client - > fteprotocolextensions2 = strtoul ( val , NULL , 0 ) & Net_PextMask ( PROTOCOL_VERSION_FTE2 , ISNQCLIENT ( host_client ) ) ;
2019-03-23 07:06:37 +00:00
break ;
case PROTOCOL_VERSION_EZQUAKE1 :
2019-05-10 09:31:21 +00:00
host_client - > ezprotocolextensions1 = strtoul ( val , NULL , 0 ) & Net_PextMask ( PROTOCOL_VERSION_EZQUAKE1 , ISNQCLIENT ( host_client ) ) & EZPEXT1_SERVERADVERTISE ;
2019-03-23 07:06:37 +00:00
break ;
}
}
2020-10-06 03:17:28 +00:00
SV_ClientProtocolExtensionsChanged ( host_client ) ;
2019-03-23 07:06:37 +00:00
if ( ! host_client - > supportedprotocols & & Cmd_Argc ( ) = = 1 )
Con_DPrintf ( " %s reports no extended capabilities. \n " , host_client - > name ) ;
else
Con_DPrintf ( " %s now using pext: %x, %x, %x \n " , host_client - > name , host_client - > fteprotocolextensions , host_client - > fteprotocolextensions2 , host_client - > ezprotocolextensions1 ) ;
# ifdef NQPROT
if ( ISNQCLIENT ( host_client ) )
SVNQ_New_f ( ) ;
else
# endif
SV_New_f ( ) ;
}
2011-07-30 14:14:56 +00:00
void SV_MVDList_f ( void ) ;
void SV_MVDInfo_f ( void ) ;
typedef struct
{
char * name ;
void ( * func ) ( void ) ;
2018-08-23 06:03:31 +00:00
int noqchandling ;
2011-07-30 14:14:56 +00:00
} ucmd_t ;
ucmd_t ucmds [ ] =
{
2011-12-05 15:23:40 +00:00
/*connection process*/
2019-03-23 07:06:37 +00:00
{ " new " , SV_New_f , true } ,
{ " pext " , SV_Pext_f , true } ,
{ " modellist " , SVQW_Modellist_f , true } ,
{ " soundlist " , SVQW_Soundlist_f , true } ,
{ " prespawn " , SVQW_PreSpawn_f , true } ,
{ " spawn " , SVQW_Spawn_f , true } ,
{ " begin " , SV_Begin_f , true } ,
{ " drop " , SV_Drop_f } ,
{ " disconnect " , SV_Drop_f } ,
{ " pings " , SV_Pings_f } ,
{ " enablecsqc " , SV_EnableClientsCSQC , 2 } ,
{ " disablecsqc " , SV_DisableClientsCSQC , 2 } ,
2011-07-30 14:14:56 +00:00
2019-03-23 07:06:37 +00:00
/* issued by hand at client console*/
{ " rate " , SV_Rate_f } ,
{ " kill " , SV_Kill_f } ,
{ " pause " , SV_Pause_f } ,
{ " msg " , SV_Msg_f } ,
{ " efpslist " , Cmd_FPSList_f } , //don't conflict with the ktpro one
{ " vote " , SV_Vote_f } ,
2011-07-30 14:14:56 +00:00
2020-03-25 20:56:01 +00:00
//{"ban", Cmd_Ban_f}, //for admins
//{"banip", Cmd_BanIP_f}, //for admins
//{"banrem", Cmd_BanRem_f}, //for admins
2019-03-23 07:06:37 +00:00
/*user interactions*/
{ " sayone " , SV_SayOne_f } ,
{ " say " , SV_Say_f } ,
{ " say_team " , SV_Say_Team_f } ,
# ifdef SVRANKING
{ " topten " , Rank_ListTop10_f } ,
# endif
2011-07-30 14:14:56 +00:00
2019-03-23 07:06:37 +00:00
{ " setinfo " , SV_SetInfo_f } ,
{ " serverinfo " , SV_ShowServerinfo_f } ,
2011-07-30 14:14:56 +00:00
2019-03-23 07:06:37 +00:00
/*download/demo commands*/
2018-09-01 04:18:08 +00:00
# ifdef MVD_RECORDING
2019-03-23 07:06:37 +00:00
{ " demolist " , SV_UserCmdMVDList_f } ,
{ " dlist " , SV_UserCmdMVDList_f } , //apparently people are too lazy to type.
//mvdsv has 4 more variants, for 6 total doing the same thing.
{ " demoinfo " , SV_MVDInfo_f } ,
{ " dl " , SV_DemoDownload_f } ,
2018-09-01 04:18:08 +00:00
# endif
2019-03-23 07:06:37 +00:00
{ " stopdownload " , SV_StopDownload_f } ,
{ " stopdl " , SV_StopDownload_f } , //mvdsv compat
{ " dlsize " , SV_DownloadSize_f } ,
{ " download " , SV_BeginDownload_f } ,
{ " nextdl " , SV_NextDownload_f , true } ,
2011-07-30 14:14:56 +00:00
2011-12-05 15:23:40 +00:00
/*quakeworld specific things*/
2019-03-23 07:06:37 +00:00
{ " addseat " , Cmd_AddSeat_f } , //splitscreen
{ " join " , Cmd_Join_f } ,
{ " observe " , Cmd_Observe_f } ,
{ " ptrack " , SV_PTrack_f } , //ZOID - used with autocam
{ " snap " , SV_NoSnap_f } , //cheat detection
2011-07-30 14:14:56 +00:00
2019-03-23 07:06:37 +00:00
/*cheats*/
{ " god " , Cmd_God_f } ,
{ " give " , Cmd_Give_f } ,
{ " noclip " , Cmd_Noclip_f } ,
{ " spiderpig " , Cmd_Spiderpig_f } ,
{ " 6dof " , Cmd_6dof_f } ,
{ " fly " , Cmd_Fly_f } ,
{ " notarget " , Cmd_Notarget_f } ,
{ " setpos " , Cmd_SetPos_f } ,
2020-06-12 23:29:58 +00:00
# if defined(_DEBUG) && defined(SUBSERVERS)
2015-06-04 06:15:14 +00:00
{ " ssvtransfer " , Cmd_SSV_Transfer_f } , //transfer the player to a different map/server
2019-03-23 07:06:37 +00:00
{ " ssvsay " , Cmd_SSV_AllSay_f } , //says realm-wide
2015-06-04 06:15:14 +00:00
{ " ssvjoin " , Cmd_SSV_Join_f } , //transfer the player to a different map/server
2014-09-02 02:44:43 +00:00
# endif
2011-07-30 14:14:56 +00:00
2013-03-12 23:24:15 +00:00
# ifdef NQPROT
{ " name " , SVNQ_NQInfo_f } ,
# endif
2011-07-30 14:14:56 +00:00
# ifdef VOICECHAT
2019-03-23 07:06:37 +00:00
{ " voicetarg " , SV_Voice_Target_f } ,
{ " vignore " , SV_Voice_Ignore_f } , /*ignore/mute specific player*/
{ " muteall " , SV_Voice_MuteAll_f } , /*disables*/
2011-07-30 14:14:56 +00:00
# endif
2022-01-28 10:48:01 +00:00
{ " unmuteall " , SV_Voice_UnmuteAll_f } , /*reenables*/
2011-07-30 14:14:56 +00:00
{ NULL , NULL }
} ;
# ifdef Q2SERVER
ucmd_t ucmdsq2 [ ] = {
{ " new " , SV_New_f , true } ,
{ " configstrings " , SVQ2_ConfigStrings_f , true } ,
{ " baselines " , SVQ2_BaseLines_f , true } ,
{ " begin " , SV_Begin_f , true } ,
{ " serverinfo " , SV_ShowServerinfo_f , true } ,
{ " info " , SV_ShowServerinfo_f , true } ,
{ " download " , SV_BeginDownload_f , true } ,
{ " nextdl " , SV_NextDownload_f , true } ,
{ " nextserver " , SVQ2_NextServer_f , true } ,
2016-01-18 05:22:07 +00:00
//fte stuff
{ " setinfo " , SV_SetInfo_f , true } ,
{ " ftevote " , SV_Vote_f , true } , //voting... kinda messed up by 'vote' being common in mods
{ " addseat " , Cmd_AddSeat_f , true } , //for splitscreen
2011-07-30 14:14:56 +00:00
//#ifdef SVRANKING
// {"topten", Rank_ListTop10_f, true},
//#endif
2015-12-12 19:25:15 +00:00
//quakeworld uses 'drop', quake2 commonly uses that to chuck items away / to a friend.
2011-07-30 14:14:56 +00:00
{ " disconnect " , SV_Drop_f , true } ,
{ NULL , NULL }
} ;
# endif
# ifdef NQPROT
2004-08-23 00:15:46 +00:00
ucmd_t nqucmds [ ] =
{
2007-06-20 00:02:54 +00:00
{ " new " , SVNQ_New_f , true } ,
2011-12-05 15:23:40 +00:00
{ " spawn " , SVNQ_Spawn_f , true } ,
{ " begin " , SVNQ_Begin_f , true } ,
{ " prespawn " , SVNQ_PreSpawn_f , true } ,
2007-06-20 00:02:54 +00:00
2017-01-24 10:27:39 +00:00
{ " status " , SVNQ_Status_f } ,
2004-08-23 00:15:46 +00:00
2011-12-05 15:23:40 +00:00
2004-08-23 00:15:46 +00:00
{ " god " , Cmd_God_f } ,
{ " give " , Cmd_Give_f } ,
2005-01-07 02:36:13 +00:00
{ " notarget " , Cmd_Notarget_f } ,
2011-10-27 16:16:29 +00:00
{ " fly " , Cmd_Fly_f } ,
2004-08-23 00:15:46 +00:00
{ " noclip " , Cmd_Noclip_f } ,
{ " say " , SV_Say_f } ,
{ " say_team " , SV_Say_Team_f } ,
{ " tell " , SV_SayOne_f } ,
2011-12-05 15:23:40 +00:00
{ " efpslist " , Cmd_FPSList_f } , //don't conflict with the ktpro one
{ " pings " , SV_Pings_f } ,
{ " ping " , SVNQ_Ping_f } ,
2004-08-23 00:15:46 +00:00
{ " kill " , SV_Kill_f } ,
{ " pause " , SV_Pause_f } ,
{ " kick " , NULL } ,
{ " ban " , NULL } ,
{ " vote " , SV_Vote_f } ,
2011-12-05 15:23:40 +00:00
/*DP download protocol*/
2011-10-27 16:16:29 +00:00
{ " dlsize " , SV_DownloadSize_f } ,
2007-06-10 21:33:24 +00:00
{ " download " , SV_BeginDownload_f } ,
2007-06-20 00:02:54 +00:00
{ " sv_startdownload " , SVDP_StartDownload_f } ,
2007-06-10 21:33:24 +00:00
2018-07-05 16:21:44 +00:00
{ " serverinfo " , SV_ShowServerinfo_f } ,
2011-12-05 15:23:40 +00:00
/*userinfo stuff*/
2011-10-27 16:16:29 +00:00
{ " setinfo " , SV_SetInfo_f } ,
2011-12-05 15:23:40 +00:00
{ " name " , SVNQ_NQInfo_f } ,
{ " color " , SVNQ_NQColour_f } ,
2017-08-29 02:29:06 +00:00
{ " playermodel " , SVNQ_DPModel_f } ,
2019-04-01 10:16:36 +00:00
// {"pmodel", SVNQ_DPModel_f}, //nehahra
2017-08-29 02:29:06 +00:00
{ " playerskin " , SVNQ_DPSkin_f } ,
2005-07-01 19:23:00 +00:00
{ " rate " , SV_Rate_f } ,
2017-05-28 15:42:32 +00:00
{ " rate_burstsize " , NULL } ,
2005-05-19 02:53:03 +00:00
2004-08-23 00:15:46 +00:00
# ifdef SVRANKING
{ " topten " , Rank_ListTop10_f } ,
# endif
2005-07-03 15:16:20 +00:00
2011-12-05 15:23:40 +00:00
/*various misc extensions*/
2016-07-12 00:40:13 +00:00
{ " protocols " , SVNQ_Protocols_f , true } ,
2013-10-08 14:28:11 +00:00
{ " pext " , SV_Pext_f , true } ,
2018-09-01 04:18:08 +00:00
{ " enablecsqc " , SV_EnableClientsCSQC , 2 } ,
{ " disablecsqc " , SV_DisableClientsCSQC , 2 } ,
2012-01-17 07:57:46 +00:00
{ " challengeconnect " , NULL } ,
2011-12-05 15:23:40 +00:00
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
/*spectating, this should be fun...*/
{ " join " , Cmd_Join_f } ,
{ " observe " , Cmd_Observe_f } ,
{ " ptrack " , SV_PTrack_f } , //ZOID - used with autocam
2011-05-20 04:10:46 +00:00
# ifdef VOICECHAT
2011-10-27 16:16:29 +00:00
{ " voicetarg " , SV_Voice_Target_f } ,
{ " vignore " , SV_Voice_Ignore_f } , /*ignore/mute specific player*/
{ " muteall " , SV_Voice_MuteAll_f } , /*disables*/
{ " unmuteall " , SV_Voice_UnmuteAll_f } , /*reenables*/
2011-05-20 04:10:46 +00:00
# endif
2004-08-23 00:15:46 +00:00
{ NULL , NULL }
} ;
2011-07-30 14:14:56 +00:00
# endif
2005-10-23 17:57:20 +00:00
/*
2011-07-30 14:14:56 +00:00
= = = = = = = = = = = = = = = = = =
SV_ExecuteUserCommand
= = = = = = = = = = = = = = = = = =
*/
2017-08-14 16:38:44 +00:00
void SV_ExecuteUserCommand ( const char * s , qboolean fromQC )
2004-08-23 00:15:46 +00:00
{
ucmd_t * u ;
2011-07-30 14:14:56 +00:00
client_t * oldhost = host_client ;
2015-11-18 07:37:39 +00:00
if ( host_client - > state < cs_connected )
return ;
2017-03-04 19:36:06 +00:00
Con_DLPrintf ( ( host_client - > netchan . remote_address . type = = NA_LOOPBACK ) ? 2 : 1 , " Client command: %s \n " , s ) ;
2005-07-03 15:16:20 +00:00
2004-12-08 04:14:52 +00:00
Cmd_TokenizeString ( s , false , false ) ;
2004-08-23 00:15:46 +00:00
sv_player = host_client - > edict ;
Cmd_ExecLevel = 1 ;
2011-07-30 14:14:56 +00:00
# ifdef Q2SERVER
if ( ISQ2CLIENT ( host_client ) )
u = ucmdsq2 ;
else
# endif
# ifdef NQPROT
if ( ISNQCLIENT ( host_client ) )
u = nqucmds ;
else
# endif
u = ucmds ;
for ( ; u - > name ; u + + )
2004-08-23 00:15:46 +00:00
if ( ! strcmp ( Cmd_Argv ( 0 ) , u - > name ) )
{
2018-08-23 06:03:31 +00:00
if ( u - > noqchandling = = 2 )
{ //issue the command then let the QC handle it too
if ( ! fromQC )
{
if ( u - > func )
u - > func ( ) ;
2018-09-01 04:18:08 +00:00
if ( host_client - > spawned )
PR_KrimzonParseCommand ( s ) ;
2018-08-23 06:03:31 +00:00
}
host_client = oldhost ;
return ;
}
2011-07-30 14:14:56 +00:00
if ( ! fromQC & & ! u - > noqchandling )
2018-08-23 06:03:31 +00:00
if ( PR_KrimzonParseCommand ( s ) ) //KRIMZON_SV_PARSECLIENTCOMMAND has the opportunity to parse out certain commands.
2004-12-05 11:51:44 +00:00
{
host_client = oldhost ;
return ;
}
2011-07-30 14:14:56 +00:00
// SV_BeginRedirect (RD_CLIENT, host_client->language);
if ( u - > func )
2018-08-23 06:03:31 +00:00
u - > func ( ) ;
2011-07-30 14:14:56 +00:00
host_client = oldhost ;
// SV_EndRedirect ();
return ;
}
2004-12-05 11:51:44 +00:00
2011-07-30 14:14:56 +00:00
if ( ! u - > name )
{
# ifdef HLSERVER
if ( HLSV_ClientCommand ( host_client ) )
{
host_client = oldhost ;
return ;
}
# endif
if ( ! fromQC )
if ( PR_UserCmd ( s ) ) //Q2 and MVDSV command handling only happens if the engine didn't recognise it.
2004-08-23 00:15:46 +00:00
{
2011-07-30 14:14:56 +00:00
host_client = oldhost ;
return ;
2004-08-23 00:15:46 +00:00
}
2011-07-30 14:14:56 +00:00
# ifdef SVRANKING
if ( sv_cmdlikercon . value & & host_client - > rankid )
{
2016-07-12 00:40:13 +00:00
char adr [ MAX_ADR_SIZE ] ;
2011-07-30 14:14:56 +00:00
char remaining [ 1024 ] ;
int i ;
rankstats_t stats ;
if ( ! Rank_GetPlayerStats ( host_client - > rankid , & stats ) )
2004-12-05 11:51:44 +00:00
{
2011-07-30 14:14:56 +00:00
host_client = oldhost ;
return ;
2004-12-05 11:51:44 +00:00
}
2014-06-24 03:02:32 +00:00
Log_String ( LOG_RCON , va ( " cmd from %s - %s: \n %s \n "
, NET_AdrToString ( adr , sizeof ( adr ) , & net_from ) , host_client - > name , s ) ) ;
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " cmd from %s: \n %s \n "
2014-06-24 03:02:32 +00:00
, host_client - > name , s ) ;
2011-07-30 14:14:56 +00:00
SV_BeginRedirect ( RD_CLIENT , host_client - > language ) ;
remaining [ 0 ] = 0 ;
for ( i = 0 ; i < Cmd_Argc ( ) ; i + + )
{
if ( strlen ( remaining ) + strlen ( Cmd_Argv ( i ) ) > = sizeof ( remaining ) - 1 )
{
Con_Printf ( " cmd was too long \n " ) ;
host_client = oldhost ;
SV_EndRedirect ( ) ;
Con_Printf ( " cmd from %s: \n %s \n "
2013-05-03 04:28:08 +00:00
, NET_AdrToString ( adr , sizeof ( adr ) , & net_from ) , " Was too long - possible buffer overflow attempt " ) ;
2011-07-30 14:14:56 +00:00
return ;
}
2014-06-24 03:02:32 +00:00
Q_strncatz ( remaining , Cmd_Argv ( i ) , sizeof ( remaining ) ) ;
Q_strncatz ( remaining , " " , sizeof ( remaining ) ) ;
2011-07-30 14:14:56 +00:00
}
Cmd_ExecuteString ( remaining , stats . trustlevel ) ;
2004-12-05 11:51:44 +00:00
host_client = oldhost ;
2011-07-30 14:14:56 +00:00
SV_EndRedirect ( ) ;
2004-12-05 11:51:44 +00:00
return ;
2004-08-23 00:15:46 +00:00
}
2011-07-30 14:14:56 +00:00
# endif
2013-11-29 14:36:47 +00:00
Con_TPrintf ( " Bad user command: %s \n " , Cmd_Argv ( 0 ) ) ;
2004-08-23 00:15:46 +00:00
}
2011-07-30 14:14:56 +00:00
host_client = oldhost ;
SV_EndRedirect ( ) ;
2004-08-23 00:15:46 +00:00
}
int implevels [ 256 ] ;
2009-11-04 21:16:50 +00:00
qboolean SV_FilterImpulse ( int imp , int level )
2004-08-23 00:15:46 +00:00
{
if ( imp < 0 | | imp > 255 )
return true ; //erm
if ( implevels [ imp ] > level )
return false ;
return true ;
}
void SV_FilterImpulseInit ( void )
{
char buffer [ 1024 ] ;
char * s ;
int lev ;
int imp ;
memset ( implevels , 0 , sizeof ( implevels ) ) ;
2014-10-05 20:04:11 +00:00
s = COM_LoadStackFile ( " impfiltr.cfg " , buffer , sizeof ( buffer ) , NULL ) ;
2004-08-23 00:15:46 +00:00
if ( ! s )
2005-12-21 07:00:33 +00:00
Con_DPrintf ( " impfiltr.cfg not found. Impulse filters are disabled \n " ) ;
2004-08-23 00:15:46 +00:00
while ( s )
{
s = COM_Parse ( s ) ;
if ( ! s )
return ;
imp = atoi ( com_token ) ;
s = COM_Parse ( s ) ;
if ( ! s )
{
Con_Printf ( " Unexpected eof in impfiltr.cfg \n " ) ;
return ;
}
lev = atoi ( com_token ) ;
if ( imp > 255 | | imp < 0 | | lev < 0 | | lev > RESTRICT_MAX )
Con_Printf ( " impfiltr.cfg - bad paramters \n " ) ;
else
implevels [ imp ] = lev ;
}
}
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
USER CMD EXECUTION
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
# ifdef SERVERONLY
/*
= = = = = = = = = = = = = = =
V_CalcRoll
Used by view and sv_user
= = = = = = = = = = = = = = =
*/
float V_CalcRoll ( vec3_t angles , vec3_t velocity )
{
vec3_t forward , right , up ;
float sign ;
float side ;
float value ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
AngleVectors ( angles , forward , right , up ) ;
side = DotProduct ( velocity , right ) ;
sign = side < 0 ? - 1 : 1 ;
side = fabs ( side ) ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
value = cl_rollangle . value ;
if ( side < cl_rollspeed . value )
side = side * value / cl_rollspeed . value ;
else
side = value ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
return side * sign ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
}
# endif
//============================================================================
vec3_t pmove_mins , pmove_maxs ;
2017-08-29 02:29:06 +00:00
static qboolean AddEntityToPmove ( world_t * w , wedict_t * player , wedict_t * check )
2014-07-12 06:56:17 +00:00
{
physent_t * pe ;
int solid = check - > v - > solid ;
2021-04-14 05:21:04 +00:00
enum q1contents_e q1contents ;
2014-07-12 06:56:17 +00:00
if ( pmove . numphysent = = MAX_PHYSENTS )
return false ;
pe = & pmove . physents [ pmove . numphysent ] ;
pe - > notouch = ! ( ( int ) player - > xv - > dimension_solid & ( int ) check - > xv - > dimension_hit ) ;
if ( ! ( ( int ) player - > xv - > dimension_hit & ( int ) check - > xv - > dimension_solid ) )
return true ;
if ( ! check - > v - > size [ 0 ] ) //points are not meant to be solid
return true ;
pmove . numphysent + + ;
VectorCopy ( check - > v - > origin , pe - > origin ) ;
2017-08-29 02:29:06 +00:00
pe - > info = NUM_FOR_EDICT ( w - > progs , check ) ;
2014-07-12 06:56:17 +00:00
pe - > nonsolid = solid = = SOLID_TRIGGER ;
pe - > isportal = solid = = SOLID_PORTAL ;
q1contents = ( int ) check - > v - > skin ;
if ( solid = = SOLID_LADDER )
q1contents = Q1CONTENTS_LADDER ; //legacy crap
2021-07-06 00:12:12 +00:00
else if ( solid = = SOLID_CORPSE )
q1contents = Q1CONTENTS_CORPSE ; //legacy crap
2021-04-14 05:21:04 +00:00
safeswitch ( q1contents )
{
case Q1CONTENTS_EMPTY : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_EMPTY ; break ;
case Q1CONTENTS_TRANS :
case Q1CONTENTS_SOLID : pe - > nonsolid = false ; pe - > forcecontentsmask = FTECONTENTS_SOLID ; break ;
case Q1CONTENTS_WATER : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_WATER ; break ;
case Q1CONTENTS_LAVA : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_LAVA ; break ;
case Q1CONTENTS_SLIME : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_SLIME ; break ;
case Q1CONTENTS_SKY : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_SKY ; break ;
case Q1CONTENTS_CLIP : pe - > nonsolid = false ; pe - > forcecontentsmask = FTECONTENTS_PLAYERCLIP | FTECONTENTS_MONSTERCLIP ; break ;
case Q1CONTENTS_CURRENT_0 : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_WATER | Q2CONTENTS_CURRENT_0 ; break ;
case Q1CONTENTS_CURRENT_90 : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_WATER | Q2CONTENTS_CURRENT_90 ; break ;
case Q1CONTENTS_CURRENT_180 : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_WATER | Q2CONTENTS_CURRENT_180 ; break ;
case Q1CONTENTS_CURRENT_270 : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_WATER | Q2CONTENTS_CURRENT_270 ; break ;
case Q1CONTENTS_CURRENT_UP : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_WATER | Q2CONTENTS_CURRENT_UP ; break ;
case Q1CONTENTS_CURRENT_DOWN : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_WATER | Q2CONTENTS_CURRENT_DOWN ; break ;
case Q1CONTENTS_LADDER : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_LADDER ; break ;
case Q1CONTENTS_MONSTERCLIP : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_MONSTERCLIP ; break ;
case Q1CONTENTS_PLAYERCLIP : pe - > nonsolid = false ; pe - > forcecontentsmask = FTECONTENTS_PLAYERCLIP ; break ;
2021-07-06 00:12:12 +00:00
case Q1CONTENTS_CORPSE : pe - > nonsolid = true ; pe - > forcecontentsmask = FTECONTENTS_CORPSE ; break ;
2021-04-14 05:21:04 +00:00
safedefault :
2014-07-12 06:56:17 +00:00
pe - > forcecontentsmask = 0 ;
break ;
}
2020-04-19 01:23:32 +00:00
if ( solid = = SOLID_PORTAL | | solid = = SOLID_BSP | | solid = = SOLID_BSPTRIGGER )
2014-07-12 06:56:17 +00:00
{
if ( progstype ! = PROG_H2 )
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
pe - > angles [ 0 ] * = r_meshpitch . value ; //quake is wierd. I guess someone fixed it hexen2... or my code is buggy or something...
2014-07-12 06:56:17 +00:00
pe - > model = sv . models [ ( int ) ( check - > v - > modelindex ) ] ;
VectorCopy ( check - > v - > angles , pe - > angles ) ;
}
else
{
pe - > model = NULL ;
VectorCopy ( check - > v - > mins , pe - > mins ) ;
VectorCopy ( check - > v - > maxs , pe - > maxs ) ;
VectorClear ( pe - > angles ) ;
}
return true ;
}
2017-08-29 02:29:06 +00:00
# if 1
# ifdef USEAREAGRID
extern size_t areagridsequence ;
static void AddLinksToPmove ( world_t * w , wedict_t * player , areagridlink_t * node )
{
int Q1_HullPointContents ( hull_t * hull , int num , vec3_t p ) ;
link_t * l , * next ;
wedict_t * check ;
int pl ;
int i ;
int solid ;
pl = EDICT_TO_PROG ( w - > progs , player ) ;
// touch linked edicts
for ( l = node - > l . next ; l ! = & node - > l ; l = next )
{
next = l - > next ;
check = ( ( areagridlink_t * ) l ) - > ed ;
if ( check - > gridareasequence = = areagridsequence )
continue ;
check - > gridareasequence = areagridsequence ;
if ( check - > v - > owner = = pl )
continue ; // player's own missile
if ( check = = player )
continue ;
solid = check - > v - > solid ;
if (
( solid = = SOLID_TRIGGER & & check - > v - > skin < 0 )
| | solid = = SOLID_BSP
| | solid = = SOLID_PORTAL
| | solid = = SOLID_BBOX
| | solid = = SOLID_SLIDEBOX
| | solid = = SOLID_LADDER
//|| (solid == SOLID_PHASEH2 && progstype == PROG_H2) //logically matches hexen2, but I hate it
)
{
for ( i = 0 ; i < 3 ; i + + )
if ( check - > v - > absmin [ i ] > pmove_maxs [ i ]
| | check - > v - > absmax [ i ] < pmove_mins [ i ] )
break ;
if ( i ! = 3 )
continue ;
if ( ! AddEntityToPmove ( w , player , check ) )
break ;
}
}
}
//ignores mins/maxs.
//portals are expected to be weird. player movement code is nasty.
static void AddPortalsToPmove ( world_t * w , wedict_t * player , areagridlink_t * node )
{
link_t * l , * next ;
wedict_t * check ;
int pl ;
// int i;
int solid ;
pl = EDICT_TO_PROG ( w - > progs , player ) ;
// touch linked edicts
for ( l = node - > l . next ; l ! = & node - > l ; l = next )
{
next = l - > next ;
check = ( ( areagridlink_t * ) l ) - > ed ;
if ( check - > gridareasequence = = areagridsequence )
continue ;
check - > gridareasequence = areagridsequence ;
if ( check - > v - > owner = = pl )
continue ; // player's own missile
if ( check = = player )
continue ;
solid = check - > v - > solid ;
if (
( solid = = SOLID_TRIGGER & & check - > v - > skin < 0 )
| | solid = = SOLID_BSP
| | solid = = SOLID_PORTAL
| | solid = = SOLID_BBOX
| | solid = = SOLID_SLIDEBOX
| | solid = = SOLID_LADDER
//|| (solid == SOLID_PHASEH2 && progstype == PROG_H2) //logically matches hexen2, but I hate it
)
{
if ( ! AddEntityToPmove ( w , player , check ) )
break ;
}
}
}
void AddAllLinksToPmove ( world_t * w , wedict_t * player )
{
int ming [ 2 ] , maxg [ 2 ] , g [ 2 ] ;
CALCAREAGRIDBOUNDS ( w , pmove_mins , pmove_maxs ) ;
areagridsequence + + ;
AddLinksToPmove ( w , player , & w - > jumboarea ) ;
for ( g [ 0 ] = ming [ 0 ] ; g [ 0 ] < maxg [ 0 ] ; g [ 0 ] + + )
for ( g [ 1 ] = ming [ 1 ] ; g [ 1 ] < maxg [ 1 ] ; g [ 1 ] + + )
AddLinksToPmove ( w , player , & w - > gridareas [ g [ 0 ] + g [ 1 ] * w - > gridsize [ 0 ] ] ) ;
AddPortalsToPmove ( w , player , & w - > portallist ) ;
}
# else
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = = =
AddLinksToPmove
= = = = = = = = = = = = = = = = = = = =
*/
2017-08-29 02:29:06 +00:00
void AddLinksToPmove ( world_t * w , wedict_t * player , areanode_t * node )
2004-08-23 00:15:46 +00:00
{
int Q1_HullPointContents ( hull_t * hull , int num , vec3_t p ) ;
link_t * l , * next ;
2017-08-29 02:29:06 +00:00
wedict_t * check ;
2004-08-23 00:15:46 +00:00
int pl ;
int i ;
2014-01-13 02:42:25 +00:00
int solid ;
2005-07-16 00:53:08 +00:00
2017-08-29 02:29:06 +00:00
pl = EDICT_TO_PROG ( w - > progs , player ) ;
2004-08-23 00:15:46 +00:00
// touch linked edicts
2011-06-29 18:39:11 +00:00
for ( l = node - > edicts . next ; l ! = & node - > edicts ; l = next )
2004-08-23 00:15:46 +00:00
{
next = l - > next ;
2017-08-29 02:29:06 +00:00
check = ( wedict_t * ) EDICT_FROM_AREA ( l ) ;
2004-08-23 00:15:46 +00:00
2005-03-28 00:11:59 +00:00
if ( check - > v - > owner = = pl )
2004-08-23 00:15:46 +00:00
continue ; // player's own missile
2012-02-12 05:18:31 +00:00
if ( check = = player )
continue ;
2014-01-13 02:42:25 +00:00
solid = check - > v - > solid ;
if (
( solid = = SOLID_TRIGGER & & check - > v - > skin < 0 )
| | solid = = SOLID_BSP
| | solid = = SOLID_PORTAL
| | solid = = SOLID_BBOX
| | solid = = SOLID_SLIDEBOX
2014-07-12 06:56:17 +00:00
| | solid = = SOLID_LADDER
2014-01-13 02:42:25 +00:00
//|| (solid == SOLID_PHASEH2 && progstype == PROG_H2) //logically matches hexen2, but I hate it
2010-08-28 17:14:38 +00:00
)
2004-08-23 00:15:46 +00:00
{
for ( i = 0 ; i < 3 ; i + + )
2005-03-28 00:11:59 +00:00
if ( check - > v - > absmin [ i ] > pmove_maxs [ i ]
| | check - > v - > absmax [ i ] < pmove_mins [ i ] )
2004-08-23 00:15:46 +00:00
break ;
if ( i ! = 3 )
continue ;
2004-09-04 18:01:53 +00:00
2017-08-29 02:29:06 +00:00
if ( ! AddEntityToPmove ( w , player , check ) )
2012-02-12 05:18:31 +00:00
break ;
2004-08-23 00:15:46 +00:00
}
}
2014-07-12 06:56:17 +00:00
// recurse down both sides
if ( node - > axis = = - 1 )
return ;
if ( pmove_maxs [ node - > axis ] > node - > dist )
2017-08-29 02:29:06 +00:00
AddLinksToPmove ( w , player , node - > children [ 0 ] ) ;
2014-07-12 06:56:17 +00:00
if ( pmove_mins [ node - > axis ] < node - > dist )
2017-08-29 02:29:06 +00:00
AddLinksToPmove ( w , player , node - > children [ 1 ] ) ;
2014-07-12 06:56:17 +00:00
}
//ignores mins/maxs.
//portals are expected to be weird. player movement code is nasty.
2017-08-29 02:29:06 +00:00
void AddLinksToPmove_Force ( world_t * w , wedict_t * player , areanode_t * node )
2014-07-12 06:56:17 +00:00
{
link_t * l , * next ;
2017-08-29 02:29:06 +00:00
wedict_t * check ;
2014-07-12 06:56:17 +00:00
int pl ;
2014-08-03 14:47:47 +00:00
// int i;
2014-07-12 06:56:17 +00:00
int solid ;
2017-08-29 02:29:06 +00:00
pl = EDICT_TO_PROG ( w - > progs , player ) ;
2014-07-12 06:56:17 +00:00
// touch linked edicts
2011-06-29 18:39:11 +00:00
for ( l = node - > edicts . next ; l ! = & node - > edicts ; l = next )
2004-08-23 00:15:46 +00:00
{
next = l - > next ;
2017-08-29 02:29:06 +00:00
check = ( wedict_t * ) EDICT_FROM_AREA ( l ) ;
2004-08-23 00:15:46 +00:00
2005-03-28 00:11:59 +00:00
if ( check - > v - > owner = = pl )
2004-08-23 00:15:46 +00:00
continue ; // player's own missile
2014-07-12 06:56:17 +00:00
if ( check = = player )
continue ;
solid = check - > v - > solid ;
if (
( solid = = SOLID_TRIGGER & & check - > v - > skin < 0 )
| | solid = = SOLID_BSP
| | solid = = SOLID_PORTAL
| | solid = = SOLID_BBOX
| | solid = = SOLID_SLIDEBOX
| | solid = = SOLID_LADDER
//|| (solid == SOLID_PHASEH2 && progstype == PROG_H2) //logically matches hexen2, but I hate it
)
2004-08-23 00:15:46 +00:00
{
2017-08-29 02:29:06 +00:00
if ( ! AddEntityToPmove ( w , player , check ) )
2014-07-12 06:56:17 +00:00
break ;
2004-08-23 00:15:46 +00:00
}
}
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
// recurse down both sides
if ( node - > axis = = - 1 )
return ;
2008-11-09 22:29:28 +00:00
if ( pmove_maxs [ node - > axis ] > node - > dist )
2017-08-29 02:29:06 +00:00
AddLinksToPmove_Force ( w , player , node - > children [ 0 ] ) ;
2008-11-09 22:29:28 +00:00
if ( pmove_mins [ node - > axis ] < node - > dist )
2017-08-29 02:29:06 +00:00
AddLinksToPmove_Force ( w , player , node - > children [ 1 ] ) ;
2004-08-23 00:15:46 +00:00
}
2017-08-29 02:29:06 +00:00
# endif
2004-08-23 00:15:46 +00:00
2017-08-29 02:29:06 +00:00
# else
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = =
AddAllEntsToPmove
For debugging
= = = = = = = = = = = = = = = =
*/
2017-08-29 02:29:06 +00:00
void AddAllEntsToPmove ( wedict_t * player , world_t * w )
2004-08-23 00:15:46 +00:00
{
int e ;
2017-08-29 02:29:06 +00:00
wedict_t * check ;
2004-08-23 00:15:46 +00:00
int i ;
int pl ;
2017-08-29 02:29:06 +00:00
pl = EDICT_TO_PROG ( w - > progs , player ) ;
for ( e = 1 ; e < w - > num_edicts ; e + + )
2004-08-23 00:15:46 +00:00
{
2017-08-29 02:29:06 +00:00
check = EDICT_NUM ( w - > progs , e ) ;
2016-07-21 19:27:59 +00:00
if ( ED_ISFREE ( check ) )
2004-08-23 00:15:46 +00:00
continue ;
2005-03-28 00:11:59 +00:00
if ( check - > v - > owner = = pl )
2004-08-23 00:15:46 +00:00
continue ;
2005-07-03 15:16:20 +00:00
if ( check - > v - > solid = = SOLID_BSP
| | check - > v - > solid = = SOLID_BBOX
2005-03-28 00:11:59 +00:00
| | check - > v - > solid = = SOLID_SLIDEBOX )
2004-08-23 00:15:46 +00:00
{
2014-07-12 06:56:17 +00:00
if ( check = = player )
2004-08-23 00:15:46 +00:00
continue ;
for ( i = 0 ; i < 3 ; i + + )
2005-03-28 00:11:59 +00:00
if ( check - > v - > absmin [ i ] > pmove_maxs [ i ]
| | check - > v - > absmax [ i ] < pmove_mins [ i ] )
2004-08-23 00:15:46 +00:00
break ;
if ( i ! = 3 )
continue ;
2014-07-12 06:56:17 +00:00
if ( ! AddEntityToPmove ( player , check ) )
2004-08-23 00:15:46 +00:00
break ;
}
}
}
2017-08-29 02:29:06 +00:00
# endif
2004-08-23 00:15:46 +00:00
2015-03-03 00:14:43 +00:00
int SV_PMTypeForClient ( client_t * cl , edict_t * ent )
2004-08-23 00:15:46 +00:00
{
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2004-12-06 01:57:07 +00:00
if ( sv . demostatevalid )
{ //force noclip... This does create problems for closing demos.
if ( cl - > zquake_extensions & Z_EXT_PM_TYPE_NEW )
return PM_SPECTATOR ;
return PM_OLD_SPECTATOR ;
}
2009-11-07 13:29:15 +00:00
# endif
2005-05-26 12:55:34 +00:00
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2005-05-26 12:55:34 +00:00
if ( sv_brokenmovetypes . value ) //this is to mimic standard qw servers, which don't support movetypes other than MOVETYPE_FLY.
{ //it prevents bugs from being visible in unsuspecting mods.
2015-03-03 00:14:43 +00:00
if ( cl & & cl - > spectator )
2005-05-26 12:55:34 +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 - > zquake_extensions & Z_EXT_PM_TYPE_NEW ) | | ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) )
2005-05-26 12:55:34 +00:00
return PM_SPECTATOR ;
return PM_OLD_SPECTATOR ;
}
2015-03-03 00:14:43 +00:00
if ( ent - > v - > health < = 0 )
2005-05-26 12:55:34 +00:00
return PM_DEAD ;
return PM_NORMAL ;
}
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
# endif
2005-05-26 12:55:34 +00:00
2015-03-03 00:14:43 +00:00
switch ( ( int ) ent - > v - > movetype )
2004-08-23 00:15:46 +00:00
{
2012-02-15 13:53:30 +00:00
case MOVETYPE_NOCLIP :
/*older/vanilla clients have a b0rked spectator mode that we don't want to break*/
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 )
if ( ( cl - > zquake_extensions & Z_EXT_PM_TYPE_NEW ) | | ( cl - > fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS ) )
return PM_SPECTATOR ;
2004-08-23 00:15:46 +00:00
return PM_OLD_SPECTATOR ;
2012-02-15 13:53:30 +00:00
case MOVETYPE_WALLWALK :
return PM_WALLWALK ;
2014-06-21 17:58:17 +00:00
case MOVETYPE_6DOF :
return PM_6DOF ;
2012-02-15 13:53:30 +00:00
2015-03-03 00:14:43 +00:00
case MOVETYPE_FLY_WORLDONLY :
2012-02-15 13:53:30 +00:00
case MOVETYPE_FLY :
2004-08-23 00:15:46 +00:00
return PM_FLY ;
2012-02-15 13:53:30 +00:00
case MOVETYPE_NONE :
2004-08-23 00:15:46 +00:00
return PM_NONE ;
2019-04-16 22:40:05 +00:00
# ifndef HAVE_LEGACY
2015-09-02 03:12:25 +00:00
case MOVETYPE_TOSS :
case MOVETYPE_BOUNCE :
return PM_DEAD ;
# endif
2012-02-15 13:53:30 +00:00
case MOVETYPE_WALK :
default :
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2016-12-07 18:45:25 +00:00
if ( cl & & ent - > v - > health < = 0 )
2012-02-15 13:53:30 +00:00
return PM_DEAD ;
2015-09-02 03:12:25 +00:00
# endif
2012-02-15 13:53:30 +00:00
return PM_NORMAL ;
}
2004-08-23 00:15:46 +00:00
}
2005-06-22 17:10:13 +00:00
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = =
SV_PreRunCmd
= = = = = = = = = = =
Done before running a player command . Clears the touch array
*/
2015-02-02 08:01:53 +00:00
qbyte * playertouch ;
size_t playertouchmax ;
2004-08-23 00:15:46 +00:00
void SV_PreRunCmd ( void )
{
2020-05-14 15:50:26 +00:00
size_t max = ( sv . world . num_edicts + 512 + 7 ) & ~ 7 ;
2015-02-02 08:01:53 +00:00
if ( max > playertouchmax )
{
playertouchmax = max ;
BZ_Free ( playertouch ) ;
playertouch = BZ_Malloc ( ( playertouchmax > > 3 ) + 1 ) ;
}
memset ( playertouch , 0 , playertouchmax > > 3 ) ;
}
void SV_RunCmdCleanup ( void )
{
BZ_Free ( playertouch ) ;
playertouch = NULL ;
playertouchmax = 0 ;
2004-08-23 00:15:46 +00:00
}
2015-07-27 08:21:34 +00:00
void Sh_CalcPointLight ( vec3_t point , vec3_t light ) ;
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = =
SV_RunCmd
= = = = = = = = = = =
*/
void SV_RunCmd ( usercmd_t * ucmd , qboolean recurse )
{
edict_t * ent ;
int i , n ;
int oldmsec ;
qboolean jumpable ;
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
vec3_t new_vel ;
vec3_t old_vel ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
// To prevent a infinite loop
2006-10-05 22:10:09 +00:00
if ( ! recurse )
{
2015-01-21 18:18:37 +00:00
# ifdef NEWSPEEDCHEATPROT
if ( ucmd - > msec & & host_client - > msecs > 500 )
host_client - > msecs = 500 ;
if ( ucmd - > msec > host_client - > msecs )
2017-08-29 02:29:06 +00:00
{ //they're over their timeslice allocation
//if they're not taking the piss then be prepared to truncate the frame. this should hide clockskew without allowing full-on speedcheats.
if ( ucmd - > msec > 10 )
ucmd - > msec - = 1 ;
if ( ucmd - > msec > host_client - > msecs )
2021-04-14 05:21:04 +00:00
{
if ( sv_showpredloss . ival )
Con_Printf ( " %s: ignoring %g msecs (anti speed cheat) \n " , host_client - > name , ucmd - > msec ) ;
2017-08-29 02:29:06 +00:00
return ;
2021-04-14 05:21:04 +00:00
}
2017-08-29 02:29:06 +00:00
ucmd - > msec = host_client - > msecs ;
}
2015-01-21 18:18:37 +00:00
host_client - > msecs - = ucmd - > msec ;
# else
// DMW copied this KK hack copied from QuakeForge anti-cheat
// (also extra inside parm on all SV_RunCmds that follow)
2015-01-07 13:34:05 +00:00
//FIXME: update protocol to use server's timestamps instead of msecs over the wire, obsoleting speed cheat checks (by allowing the server to clamp sanely).
2013-03-12 22:53:23 +00:00
if ( ! host_client - > last_check )
{
host_client - > msecs = 0 ;
2015-01-07 13:34:05 +00:00
host_client - > last_check = realtime ;
2013-03-12 22:53:23 +00:00
}
2004-08-23 00:15:46 +00:00
host_client - > msecs + = ucmd - > msec ;
2006-10-05 22:10:09 +00:00
if ( ( tmp_time = realtime - host_client - > last_check ) > = sv_cheatspeedchecktime . value )
{
2016-02-15 06:01:17 +00:00
extern int isPlugin ;
2015-02-02 08:01:53 +00:00
double tmp_time ;
2004-08-23 00:15:46 +00:00
tmp_time = tmp_time * 1000.0 * sv_cheatpc . value / 100.0 ;
2015-01-07 13:34:05 +00:00
if ( host_client - > msecs > tmp_time & &
2016-02-15 06:01:17 +00:00
isPlugin < 2 ) //qc-debugging can result in WEIRD timings, so don't warn about weird timings if we're likely to get blocked out for long periods
2006-10-05 22:10:09 +00:00
{
2004-08-23 00:15:46 +00:00
host_client - > msec_cheating + + ;
2005-07-03 15:16:20 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH ,
2015-01-07 13:34:05 +00:00
" Speed cheat possibility, analyzing: \n %d>%.1f %d for: %s \n " ,
2004-08-23 00:15:46 +00:00
host_client - > msecs , tmp_time ,
host_client - > msec_cheating , host_client - > name ) ;
2006-10-05 22:10:09 +00:00
if ( host_client - > msec_cheating > = 2 )
{
2015-02-02 08:01:53 +00:00
char adr [ MAX_ADR_SIZE ] ;
2005-07-03 15:16:20 +00:00
SV_BroadcastTPrintf ( PRINT_HIGH ,
2013-11-29 14:36:47 +00:00
" %s was kicked for speedcheating (%s) \n " ,
2013-05-03 04:28:08 +00:00
host_client - > name , NET_AdrToString ( adr , sizeof ( adr ) , & host_client - > netchan . remote_address ) ) ;
2006-10-05 22:10:09 +00:00
host_client - > drop = true ; //drop later
2004-08-23 00:15:46 +00:00
}
2015-01-07 13:34:05 +00:00
}
2004-08-23 00:15:46 +00:00
2015-01-07 13:34:05 +00:00
host_client - > msecs = 0 ;
host_client - > last_check = realtime ;
2004-08-23 00:15:46 +00:00
}
2015-01-21 18:18:37 +00:00
// end KK hack copied from QuakeForge anti-cheat
//it's amazing how code get's copied around...
# endif
2004-08-23 00:15:46 +00:00
}
2009-04-19 00:50:42 +00:00
if ( SV_RunFullQCMovement ( host_client , ucmd ) )
{
return ;
}
2004-08-23 00:15:46 +00:00
cmd = * ucmd ;
// chop up very long commands
if ( cmd . msec > 50 )
{
oldmsec = ucmd - > msec ;
cmd . msec = oldmsec / 2 ;
SV_RunCmd ( & cmd , true ) ;
2007-10-05 17:43:26 +00:00
cmd . msec = oldmsec / 2 + ( oldmsec & 1 ) ; //give them back their msec.
2004-08-23 00:15:46 +00:00
cmd . impulse = 0 ;
SV_RunCmd ( & cmd , true ) ;
return ;
}
2019-07-29 05:28:20 +00:00
VALGRIND_MAKE_MEM_UNDEFINED ( & pmove , sizeof ( pmove ) ) ;
2004-08-23 00:15:46 +00:00
host_frametime = ucmd - > msec * 0.001 ;
2005-03-20 02:57:11 +00:00
host_frametime * = sv . gamespeed ;
2004-08-23 00:15:46 +00:00
if ( host_frametime > 0.1 )
host_frametime = 0.1 ;
2005-07-03 15:16:20 +00:00
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2005-01-26 03:39:47 +00:00
if ( sv . demostatevalid )
{ //spectators watching MVDs do not affect the running progs.
player_mins [ 0 ] = - 16 ;
player_mins [ 1 ] = - 16 ;
player_mins [ 2 ] = - 24 ;
player_maxs [ 0 ] = 16 ;
player_maxs [ 1 ] = 16 ;
player_maxs [ 2 ] = 32 ;
pmove . angles [ 0 ] = SHORT2ANGLE ( ucmd - > angles [ 0 ] ) ;
pmove . angles [ 1 ] = SHORT2ANGLE ( ucmd - > angles [ 1 ] ) ;
pmove . angles [ 2 ] = SHORT2ANGLE ( ucmd - > angles [ 2 ] ) ;
2005-07-03 15:16:20 +00:00
2005-01-26 03:39:47 +00:00
VectorCopy ( host_client - > specorigin , pmove . origin ) ;
VectorCopy ( host_client - > specvelocity , pmove . velocity ) ;
if ( host_client - > zquake_extensions & Z_EXT_PM_TYPE_NEW )
pmove . pm_type = PM_SPECTATOR ;
else
pmove . pm_type = PM_OLD_SPECTATOR ;
pmove . jump_held = host_client - > jump_held ;
pmove . jump_msec = 0 ;
pmove . waterjumptime = 0 ;
pmove . numphysent = 1 ;
2009-11-04 21:16:50 +00:00
pmove . physents [ 0 ] . model = sv . world . worldmodel ;
2005-01-26 03:39:47 +00:00
pmove . cmd = * ucmd ;
pmove . hullnum = SV_HullNumForPlayer ( 0 , player_mins , player_maxs ) ;
2014-09-17 03:04:08 +00:00
pmove . capsule = ( sv_player - > xv - > geomtype = = GEOMTYPE_CAPSULE ) ;
2005-01-26 03:39:47 +00:00
movevars . entgravity = 0 ;
movevars . maxspeed = 0 ;
movevars . bunnyspeedcap = pm_bunnyspeedcap . value ;
movevars . ktjump = pm_ktjump . value ;
movevars . slidefix = ( pm_slidefix . value ! = 0 ) ;
movevars . airstep = ( pm_airstep . value ! = 0 ) ;
2019-03-01 22:39:30 +00:00
movevars . pground = ( pm_pground . value ! = 0 ) ;
2018-01-22 19:18:04 +00:00
movevars . stepdown = ( pm_stepdown . value ! = 0 ) ;
2005-01-26 03:39:47 +00:00
movevars . walljump = ( pm_walljump . value ) ;
2005-05-17 02:36:54 +00:00
movevars . slidyslopes = ( pm_slidyslopes . value ! = 0 ) ;
2021-05-09 13:00:30 +00:00
movevars . autobunny = ( pm_autobunny . value ! = 0 ) ;
2014-04-06 15:16:39 +00:00
movevars . watersinkspeed = * pm_watersinkspeed . string ? pm_watersinkspeed . value : 60 ;
2014-06-21 17:58:17 +00:00
movevars . flyfriction = * pm_flyfriction . string ? pm_flyfriction . value : 4 ;
2018-12-11 00:20:59 +00:00
movevars . edgefriction = * pm_edgefriction . string ? pm_edgefriction . value : 2 ;
2019-10-14 02:36:57 +00:00
movevars . coordtype = host_client - > netchan . netprim . coordtype ;
2019-03-23 07:06:37 +00:00
movevars . flags = MOVEFLAG_VALID | MOVEFLAG_NOGRAVITYONGROUND | ( * pm_edgefriction . string ? 0 : MOVEFLAG_QWEDGEBOX ) ;
2005-01-26 03:39:47 +00:00
for ( i = 0 ; i < 3 ; i + + )
{
pmove_mins [ i ] = pmove . origin [ i ] - 256 ;
pmove_maxs [ i ] = pmove . origin [ i ] + 256 ;
}
2005-03-20 03:07:24 +00:00
PM_PlayerMove ( sv . gamespeed ) ;
2005-07-03 15:16:20 +00:00
2005-01-26 03:39:47 +00:00
VectorCopy ( pmove . origin , host_client - > specorigin ) ;
VectorCopy ( pmove . velocity , host_client - > specvelocity ) ;
return ;
}
2009-11-07 13:29:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
# ifdef SVCHAT
if ( SV_ChatMove ( ucmd - > impulse ) )
{
ucmd - > buttons = 0 ;
ucmd - > impulse = 0 ;
ucmd - > forwardmove = ucmd - > sidemove = ucmd - > upmove = 0 ;
}
# endif
2005-03-28 00:11:59 +00:00
if ( ! sv_player - > v - > fixangle )
2004-08-23 00:15:46 +00:00
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > v_angle [ 0 ] = SHORT2ANGLE ( ucmd - > angles [ 0 ] ) ;
sv_player - > v - > v_angle [ 1 ] = SHORT2ANGLE ( ucmd - > angles [ 1 ] ) ;
sv_player - > v - > v_angle [ 2 ] = SHORT2ANGLE ( ucmd - > angles [ 2 ] ) ;
2004-08-23 00:15:46 +00:00
}
2014-10-05 20:04:11 +00:00
# ifdef HEXEN2
2004-08-23 00:15:46 +00:00
if ( progstype = = PROG_H2 )
2014-10-05 20:04:11 +00:00
{
//fixme: should probably support rtlights, but this is a server, so urgh.
if ( sv . world . worldmodel & & sv . world . worldmodel - > funcs . LightPointValues )
{
vec3_t diffuse , ambient , dir ;
2015-07-27 08:21:34 +00:00
float lev = 0 ;
2015-07-27 09:00:18 +00:00
# if defined(RTLIGHTS) && !defined(SERVERONLY)
2015-07-27 08:21:34 +00:00
Sh_CalcPointLight ( sv_player - > v - > origin , ambient ) ;
lev + = VectorLength ( ambient ) ;
if ( ! r_shadow_realtime_world . ival | | r_shadow_realtime_world_lightmaps . value )
# endif
{
2015-07-27 09:00:18 +00:00
sv . world . worldmodel - > funcs . LightPointValues ( sv . world . worldmodel , sv_player - > v - > origin , ambient , diffuse , dir ) ;
2015-07-27 08:21:34 +00:00
lev + = ( VectorLength ( ambient ) + VectorLength ( diffuse ) / 2.0 ) / 256 ;
}
sv_player - > xv - > light_level = lev * 255 ;
2014-10-05 20:04:11 +00:00
}
else
sv_player - > xv - > light_level = 128 ; //don't know, some dummy value.
}
# endif
2004-08-23 00:15:46 +00:00
2018-10-11 10:31:23 +00:00
SV_SetEntityButtons ( sv_player , ucmd - > buttons ) ;
2009-11-04 21:16:50 +00:00
if ( ucmd - > impulse & & SV_FilterImpulse ( ucmd - > impulse , host_client - > trustlevel ) )
2005-03-28 00:11:59 +00:00
sv_player - > v - > impulse = ucmd - > impulse ;
2004-08-23 00:15:46 +00:00
2014-06-25 03:53:11 +00:00
if ( host_client - > penalties & BAN_CUFF )
2004-08-23 00:15:46 +00:00
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > impulse = 0 ;
sv_player - > v - > button0 = 0 ;
2004-08-23 00:15:46 +00:00
}
2007-10-08 12:23:55 +00:00
if ( host_client - > state & & host_client - > protocol ! = SCP_BAD )
{
2020-02-16 19:14:48 +00:00
sv_player - > xv - > movement [ 0 ] = ucmd - > forwardmove ;
sv_player - > xv - > movement [ 1 ] = ucmd - > sidemove ;
sv_player - > xv - > movement [ 2 ] = ucmd - > upmove ;
2007-10-08 12:23:55 +00:00
}
2004-08-23 00:15:46 +00:00
2011-09-03 03:49:43 +00:00
WPhys_CheckVelocity ( & sv . world , ( wedict_t * ) sv_player ) ;
2004-08-23 00:15:46 +00:00
//
// angles
2005-07-03 15:16:20 +00:00
// show 1/3 the pitch angle and all the roll angle
2015-08-20 03:17:47 +00:00
if ( sv_player - > v - > health > 0 & & sv_player - > v - > movetype )
2004-08-23 00:15:46 +00:00
{
2015-01-21 18:18:37 +00:00
if ( sv_player - > v - > movetype = = MOVETYPE_6DOF )
2004-08-23 00:15:46 +00:00
{
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
sv_player - > v - > angles [ PITCH ] = r_meshpitch . value * sv_player - > v - > v_angle [ PITCH ] ;
2005-03-28 00:11:59 +00:00
sv_player - > v - > angles [ YAW ] = sv_player - > v - > v_angle [ YAW ] ;
2015-01-21 18:18:37 +00:00
sv_player - > v - > angles [ ROLL ] = sv_player - > v - > v_angle [ ROLL ] ;
}
else
{
if ( ! sv_player - > v - > fixangle )
{
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
sv_player - > v - > angles [ PITCH ] = r_meshpitch . value * sv_player - > v - > v_angle [ PITCH ] / 3 ;
2015-01-21 18:18:37 +00:00
sv_player - > v - > angles [ YAW ] = sv_player - > v - > v_angle [ YAW ] ;
}
sv_player - > v - > angles [ ROLL ] =
V_CalcRoll ( sv_player - > v - > angles , sv_player - > v - > velocity ) * 4 ;
2004-08-23 00:15:46 +00:00
}
}
2010-02-06 01:25:04 +00:00
if ( SV_PlayerPhysicsQC & & ! host_client - > spectator )
2013-03-12 22:53:23 +00:00
{ //player movement tweaks that fuck over player prediction.
2005-06-22 17:10:13 +00:00
pr_global_struct - > frametime = host_frametime ;
pr_global_struct - > time = sv . time ;
2011-09-03 03:49:43 +00:00
WPhys_RunEntity ( & sv . world , ( wedict_t * ) sv_player ) ;
2005-06-22 17:10:13 +00:00
return ;
}
2017-02-21 20:22:07 +00:00
for ( i = 0 ; i < 3 ; i + + )
{
if ( sv_player - > xv - > punchangle [ i ] < 0 )
{
sv_player - > xv - > punchangle [ i ] + = 10 * host_frametime ;
if ( sv_player - > xv - > punchangle [ i ] > 0 )
sv_player - > xv - > punchangle [ i ] = 0 ;
}
if ( sv_player - > xv - > punchangle [ i ] > 0 )
{
sv_player - > xv - > punchangle [ i ] - = 10 * host_frametime ;
if ( sv_player - > xv - > punchangle [ i ] < 0 )
sv_player - > xv - > punchangle [ i ] = 0 ;
}
}
2004-08-23 00:15:46 +00:00
if ( ! host_client - > spectator )
{
vec_t oldvz ;
pr_global_struct - > frametime = host_frametime ;
pr_global_struct - > time = sv . time ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
2005-03-28 00:11:59 +00:00
oldvz = sv_player - > v - > velocity [ 2 ] ;
2004-08-23 00:15:46 +00:00
if ( progstype ! = PROG_QW )
{
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
jumpable = ( ( int ) sv_player - > v - > flags & FL_JUMPRELEASED ) & & ( ( int ) sv_player - > v - > flags & FL_ONGROUND ) ;
2004-08-23 00:15:46 +00:00
2005-03-28 00:11:59 +00:00
pmove . waterjumptime = sv_player - > v - > teleport_time ;
2004-08-23 00:15:46 +00:00
if ( pmove . waterjumptime > sv . time )
2005-03-28 00:11:59 +00:00
sv_player - > v - > flags = ( int ) sv_player - > v - > flags | FL_WATERJUMP ;
2004-08-23 00:15:46 +00:00
}
else
jumpable = false ;
2011-05-15 13:23:13 +00:00
2007-09-02 19:55:17 +00:00
# ifdef VM_Q1
if ( svs . gametype = = GT_Q1QVM )
Q1QVM_PlayerPreThink ( ) ;
else
# endif
2011-12-05 15:23:40 +00:00
if ( pr_global_ptrs - > PlayerPreThink )
PR_ExecuteProgram ( svprogfuncs , * pr_global_ptrs - > PlayerPreThink ) ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
if ( progstype ! = PROG_QW )
{
2005-03-28 00:11:59 +00:00
if ( sv_player - > v - > velocity [ 2 ] = = 225 & & sv_player - > v - > teleport_time > sv . time )
2004-08-23 00:15:46 +00:00
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > velocity [ 2 ] = oldvz ;
2004-08-23 00:15:46 +00:00
// Con_Printf("Waterjump detected\n");
}
2005-03-28 00:11:59 +00:00
sv_player - > v - > flags = ( int ) sv_player - > v - > flags & ~ FL_WATERJUMP ;
sv_player - > v - > teleport_time = pmove . waterjumptime ;
if ( jumpable & & ! ( ( int ) sv_player - > v - > flags & FL_JUMPRELEASED ) ) //hmm... a jump was hit.
sv_player - > v - > velocity [ 2 ] - = 270 ;
2004-08-23 00:15:46 +00:00
}
2019-02-24 08:31:04 +00:00
{
2019-03-01 22:39:30 +00:00
double ptime = sv . world . physicstime ;
2019-02-24 08:31:04 +00:00
sv . world . physicstime = sv . time ; //urgh, WPhys_RunThink uses the wrong time base
WPhys_RunThink ( & sv . world , ( wedict_t * ) sv_player ) ;
sv . world . physicstime = ptime ;
}
------------------------------------------------------------------------
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 ( host_client - > state & & host_client - > protocol = = SCP_BAD )
{
//botclients update their movement during prethink. make sure we use that stuff.
ucmd - > angles [ 0 ] = ( int ) ( sv_player - > v - > v_angle [ 0 ] * ( 65535 / 360.0f ) ) ;
ucmd - > angles [ 1 ] = ( int ) ( sv_player - > v - > v_angle [ 1 ] * ( 65535 / 360.0f ) ) ;
ucmd - > angles [ 2 ] = ( int ) ( sv_player - > v - > v_angle [ 2 ] * ( 65535 / 360.0f ) ) ;
2020-02-16 19:14:48 +00:00
ucmd - > forwardmove = sv_player - > xv - > movement [ 0 ] ;
ucmd - > sidemove = sv_player - > xv - > movement [ 1 ] ;
ucmd - > upmove = sv_player - > xv - > movement [ 2 ] ;
------------------------------------------------------------------------
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
}
2004-08-23 00:15:46 +00:00
}
// memset(&pmove, 0, sizeof(pmove));
// memset(&movevars, 0, sizeof(movevars));
2014-01-13 02:42:25 +00:00
pmove . player_mins [ 0 ] = sv_player - > v - > mins [ 0 ] ;
pmove . player_mins [ 1 ] = sv_player - > v - > mins [ 1 ] ;
pmove . player_mins [ 2 ] = sv_player - > v - > mins [ 2 ] ;
2004-08-23 00:15:46 +00:00
2014-01-13 02:42:25 +00:00
pmove . player_maxs [ 0 ] = sv_player - > v - > maxs [ 0 ] ;
pmove . player_maxs [ 1 ] = sv_player - > v - > maxs [ 1 ] ;
pmove . player_maxs [ 2 ] = sv_player - > v - > maxs [ 2 ] ;
2004-08-23 00:15:46 +00:00
2015-10-27 15:20:15 +00:00
if ( sv_player - > xv - > gravitydir [ 2 ] | | sv_player - > xv - > gravitydir [ 1 ] | | sv_player - > xv - > gravitydir [ 0 ] )
VectorCopy ( sv_player - > xv - > gravitydir , pmove . gravitydir ) ;
else
VectorCopy ( sv . world . g . defaultgravitydir , pmove . gravitydir ) ;
2014-07-12 06:56:17 +00:00
VectorCopy ( sv_player - > v - > origin , pmove . origin ) ;
VectorCopy ( sv_player - > v - > oldorigin , pmove . safeorigin ) ;
2017-05-18 10:24:09 +00:00
pmove . safeorigin_known = progstype ! = PROG_QW ;
2004-08-23 00:15:46 +00:00
2005-03-28 00:11:59 +00:00
VectorCopy ( sv_player - > v - > velocity , pmove . velocity ) ;
VectorCopy ( sv_player - > v - > v_angle , pmove . angles ) ;
2004-08-23 00:15:46 +00:00
2015-03-03 00:14:43 +00:00
pmove . pm_type = SV_PMTypeForClient ( host_client , sv_player ) ;
2019-03-01 22:39:30 +00:00
pmove . onground = ( ( int ) sv_player - > v - > flags & FL_ONGROUND ) ! = 0 ;
2004-08-23 00:15:46 +00:00
pmove . jump_held = host_client - > jump_held ;
pmove . jump_msec = 0 ;
if ( progstype ! = PROG_QW ) //this is just annoying.
2005-03-28 00:11:59 +00:00
pmove . waterjumptime = sv_player - > v - > teleport_time - sv . time ;
2004-08-23 00:15:46 +00:00
else
2005-03-28 00:11:59 +00:00
pmove . waterjumptime = sv_player - > v - > teleport_time ;
2004-08-23 00:15:46 +00:00
pmove . numphysent = 1 ;
2009-11-04 21:16:50 +00:00
pmove . physents [ 0 ] . model = sv . world . worldmodel ;
2004-08-23 00:15:46 +00:00
pmove . cmd = * ucmd ;
2012-02-12 05:18:31 +00:00
pmove . skipent = - 1 ;
2014-09-17 03:04:08 +00:00
pmove . capsule = ( sv_player - > xv - > geomtype = = GEOMTYPE_CAPSULE ) ;
2004-08-23 00:15:46 +00:00
2005-02-12 18:56:04 +00:00
movevars . entgravity = host_client - > entgravity / movevars . gravity ;
2004-08-23 00:15:46 +00:00
movevars . maxspeed = host_client - > maxspeed ;
movevars . bunnyspeedcap = pm_bunnyspeedcap . value ;
movevars . ktjump = pm_ktjump . value ;
movevars . slidefix = ( pm_slidefix . value ! = 0 ) ;
movevars . airstep = ( pm_airstep . value ! = 0 ) ;
2019-03-01 22:39:30 +00:00
movevars . pground = ( pm_pground . value ! = 0 ) ;
2018-01-22 19:18:04 +00:00
movevars . stepdown = ( pm_stepdown . value ! = 0 ) ;
2005-01-16 00:59:48 +00:00
movevars . walljump = ( pm_walljump . value ) ;
2005-05-17 02:36:54 +00:00
movevars . slidyslopes = ( pm_slidyslopes . value ! = 0 ) ;
2021-05-09 13:00:30 +00:00
movevars . autobunny = ( pm_autobunny . value ! = 0 ) ;
2014-04-06 15:16:39 +00:00
movevars . watersinkspeed = * pm_watersinkspeed . string ? pm_watersinkspeed . value : 60 ;
2014-06-21 17:58:17 +00:00
movevars . flyfriction = * pm_flyfriction . string ? pm_flyfriction . value : 4 ;
2018-12-11 00:20:59 +00:00
movevars . edgefriction = * pm_edgefriction . string ? pm_edgefriction . value : 2 ;
2019-10-14 02:36:57 +00:00
movevars . coordtype = host_client - > netchan . netprim . coordtype ;
2019-03-23 07:06:37 +00:00
movevars . flags = MOVEFLAG_VALID | MOVEFLAG_NOGRAVITYONGROUND | ( * pm_edgefriction . string ? 0 : MOVEFLAG_QWEDGEBOX ) ;
2004-08-23 00:15:46 +00:00
2014-11-03 09:38:17 +00:00
// should already be folded into host_client->maxspeed
// if (sv_player->xv->hasted)
// movevars.maxspeed*=sv_player->xv->hasted;
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
{
pmove_mins [ i ] = pmove . origin [ i ] - 256 ;
pmove_maxs [ i ] = pmove . origin [ i ] + 256 ;
}
2009-04-19 00:50:42 +00:00
sv_player - > xv - > pmove_flags = ( int ) sv_player - > xv - > pmove_flags & ~ PMF_LADDER ; //assume not touching ladder trigger
2017-08-29 02:29:06 +00:00
AddAllLinksToPmove ( & sv . world , ( wedict_t * ) sv_player ) ;
2004-08-23 00:15:46 +00:00
2009-04-19 00:50:42 +00:00
if ( ( int ) sv_player - > xv - > pmove_flags & PMF_LADDER )
2004-08-23 00:15:46 +00:00
pmove . onladder = true ;
else
pmove . onladder = false ;
2014-01-13 02:42:25 +00:00
pmove . world = & sv . world ;
2004-08-23 00:15:46 +00:00
#if 0
{
int before , after ;
before = PM_TestPlayerPosition ( pmove . origin ) ;
PlayerMove ( ) ;
after = PM_TestPlayerPosition ( pmove . origin ) ;
2005-03-28 00:11:59 +00:00
if ( sv_player - > v - > health > 0 & & before & & ! after )
2004-08-23 00:15:46 +00:00
Con_Printf ( " player %s got stuck in playermove!!!! \n " , host_client - > name ) ;
}
# else
2005-03-20 02:57:11 +00:00
PM_PlayerMove ( sv . gamespeed ) ;
2004-08-23 00:15:46 +00:00
# endif
2014-01-13 02:42:25 +00:00
pmove . world = NULL ;
2004-08-23 00:15:46 +00:00
2014-06-21 17:58:17 +00:00
{
vec3_t delta ;
2016-01-18 05:22:07 +00:00
delta [ 0 ] = pmove . angles [ 0 ] - SHORT2ANGLE ( pmove . cmd . angles [ 0 ] ) ;
delta [ 1 ] = pmove . angles [ 1 ] - SHORT2ANGLE ( pmove . cmd . angles [ 1 ] ) ;
delta [ 2 ] = pmove . angles [ 2 ] - SHORT2ANGLE ( pmove . cmd . angles [ 2 ] ) ;
2014-06-21 17:58:17 +00:00
if ( delta [ 0 ] | | delta [ 1 ] | | delta [ 2 ] )
{
2014-07-02 03:20:40 +00:00
if ( host_client - > fteprotocolextensions2 & PEXT2_SETANGLEDELTA )
{
client_t * cl = ClientReliableWrite_BeginSplit ( host_client , svcfte_setangledelta , 7 ) ;
for ( i = 0 ; i < 3 ; i + + )
ClientReliableWrite_Angle16 ( cl , delta [ i ] ) ;
}
else
{
client_t * cl = ClientReliableWrite_BeginSplit ( host_client , svc_setangle , 7 ) ;
for ( i = 0 ; i < 3 ; i + + )
ClientReliableWrite_Angle ( cl , pmove . angles [ i ] ) ;
}
2014-06-21 17:58:17 +00:00
}
}
2004-08-23 00:15:46 +00:00
host_client - > jump_held = pmove . jump_held ;
if ( progstype ! = PROG_QW ) //this is just annoying.
2011-12-23 03:12:29 +00:00
{
if ( pmove . waterjumptime )
sv_player - > v - > teleport_time = pmove . waterjumptime + sv . time ;
}
2004-08-23 00:15:46 +00:00
else
2005-03-28 00:11:59 +00:00
sv_player - > v - > teleport_time = pmove . waterjumptime ;
sv_player - > v - > waterlevel = pmove . waterlevel ;
2004-08-23 00:15:46 +00:00
if ( pmove . watertype & FTECONTENTS_SOLID )
2005-03-28 00:11:59 +00:00
sv_player - > v - > watertype = Q1CONTENTS_SOLID ;
2004-08-23 00:15:46 +00:00
else if ( pmove . watertype & FTECONTENTS_SKY )
2005-03-28 00:11:59 +00:00
sv_player - > v - > watertype = Q1CONTENTS_SKY ;
2004-08-23 00:15:46 +00:00
else if ( pmove . watertype & FTECONTENTS_LAVA )
2005-03-28 00:11:59 +00:00
sv_player - > v - > watertype = Q1CONTENTS_LAVA ;
2004-08-23 00:15:46 +00:00
else if ( pmove . watertype & FTECONTENTS_SLIME )
2005-03-28 00:11:59 +00:00
sv_player - > v - > watertype = Q1CONTENTS_SLIME ;
2004-08-23 00:15:46 +00:00
else if ( pmove . watertype & FTECONTENTS_WATER )
2005-03-28 00:11:59 +00:00
sv_player - > v - > watertype = Q1CONTENTS_WATER ;
2004-08-23 00:15:46 +00:00
else
2005-03-28 00:11:59 +00:00
sv_player - > v - > watertype = Q1CONTENTS_EMPTY ;
2004-08-23 00:15:46 +00:00
2021-05-19 04:49:52 +00:00
if ( pmove . jump_held & & movevars . autobunny ) //make sure the qc thinks we released the button at some point, triggering a new jump sound.
sv_player - > v - > flags = ( int ) sv_player - > v - > flags | FL_JUMPRELEASED ;
2004-08-23 00:15:46 +00:00
if ( pmove . onground )
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > flags = ( int ) sv_player - > v - > flags | FL_ONGROUND ;
2018-04-06 17:21:15 +00:00
sv_player - > v - > groundentity = EDICT_TO_PROG ( svprogfuncs , EDICT_NUM_PB ( svprogfuncs , pmove . physents [ pmove . groundent ] . info ) ) ;
2004-08-23 00:15:46 +00:00
}
else
2005-03-28 00:11:59 +00:00
sv_player - > v - > flags = ( int ) sv_player - > v - > flags & ~ FL_ONGROUND ;
2004-08-23 00:15:46 +00:00
2014-07-12 06:56:17 +00:00
VectorCopy ( pmove . safeorigin , sv_player - > v - > oldorigin ) ;
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
VectorCopy ( pmove . origin , sv_player - > v - > origin ) ;
2016-01-18 05:22:07 +00:00
if ( ! sv_player - > v - > fixangle )
{
VectorCopy ( pmove . angles , sv_player - > v - > v_angle ) ;
//some clients (especially NQ ones) attempt to cheat. don't let it benefit them.
//some things would break though.
if ( ( ! sv_player - > xv - > gravitydir [ 0 ] & & ! sv_player - > xv - > gravitydir [ 1 ] & & ! sv_player - > xv - > gravitydir [ 2 ] ) & & sv_player - > v - > movetype = = MOVETYPE_WALK )
{
float minpitch = * sv_minpitch . string ? sv_minpitch . value : - 70 ;
float maxpitch = * sv_maxpitch . string ? sv_maxpitch . value : 80 ;
if ( sv_player - > v - > v_angle [ 0 ] < minpitch )
sv_player - > v - > v_angle [ 0 ] = minpitch ;
if ( sv_player - > v - > v_angle [ 0 ] > maxpitch )
sv_player - > v - > v_angle [ 0 ] = maxpitch ;
}
}
2004-08-23 00:15:46 +00:00
2014-06-21 17:58:17 +00:00
// VectorCopy (pmove.gravitydir, sv_player->xv->gravitydir);
2014-01-13 02:42:25 +00:00
if ( pmove . gravitydir [ 0 ] | | pmove . gravitydir [ 1 ] | | ( pmove . gravitydir [ 2 ] & & pmove . gravitydir [ 2 ] ! = - 1 ) )
2012-02-15 13:53:30 +00:00
{
if ( ! sv_player - > v - > fixangle )
{
//FIXME: bound to pmove.gravitydir
vec3_t view [ 3 ] ;
vec3_t surf [ 3 ] ;
vec3_t fwd , up ;
AngleVectors ( sv_player - > v - > v_angle , view [ 0 ] , view [ 1 ] , view [ 2 ] ) ;
/*calculate the surface axis with up from the pmove code and right/forwards relative to the player's directions*/
VectorNegate ( pmove . gravitydir , surf [ 2 ] ) ;
CrossProduct ( view [ 0 ] , surf [ 2 ] , surf [ 1 ] ) ;
VectorNormalize ( surf [ 1 ] ) ;
CrossProduct ( surf [ 2 ] , surf [ 1 ] , surf [ 0 ] ) ;
/*interpolate the forward direction to be 1/3rd the player, and 2/3rds the surface forward*/
VectorInterpolate ( surf [ 0 ] , 0.333 , view [ 0 ] , fwd ) ;
CrossProduct ( surf [ 1 ] , fwd , up ) ;
/*we have our player's new axis*/
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
VectorAngles ( fwd , up , sv_player - > v - > angles , true ) ;
2012-02-15 13:53:30 +00:00
}
}
2014-01-13 02:42:25 +00:00
pmove . player_mins [ 0 ] = - 16 ;
pmove . player_mins [ 1 ] = - 16 ;
pmove . player_mins [ 2 ] = - 24 ;
2004-08-23 00:15:46 +00:00
2014-01-13 02:42:25 +00:00
pmove . player_maxs [ 0 ] = 16 ;
pmove . player_maxs [ 1 ] = 16 ;
pmove . player_maxs [ 2 ] = 32 ;
2004-08-23 00:15:46 +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
VectorCopy ( sv_player - > v - > velocity , old_vel ) ;
VectorCopy ( pmove . velocity , new_vel ) ;
if ( progstype = = PROG_QW )
VectorCopy ( new_vel , sv_player - > v - > velocity ) ;
2004-08-23 00:15:46 +00:00
if ( ! host_client - > spectator )
{
// link into place and touch triggers
2009-11-04 21:16:50 +00:00
World_LinkEdict ( & sv . world , ( wedict_t * ) sv_player , true ) ;
2004-08-23 00:15:46 +00:00
2004-09-04 18:01:53 +00:00
/* for (i = 0; i < pmove.numphysent; i++)
{
}
*/
2004-08-23 00:15:46 +00:00
// touch other objects
for ( i = 0 ; i < pmove . numtouch ; i + + )
{
2005-07-05 23:46:10 +00:00
if ( sv_pushplayers . value )
{
n = pmove . physents [ pmove . touchindex [ i ] ] . info ;
if ( n & & n < = sv . allocated_client_slots )
{
float vel ;
vec3_t dir ;
vec3_t svel ;
2018-04-06 17:21:15 +00:00
ent = EDICT_NUM_PB ( svprogfuncs , n ) ;
2005-07-05 23:46:10 +00:00
VectorSubtract ( ent - > v - > origin , sv_player - > v - > origin , dir ) ;
VectorNormalize ( dir ) ;
VectorCopy ( sv_player - > v - > velocity , svel ) ;
VectorNormalize ( svel ) ;
vel = DotProduct ( svel , dir ) ;
VectorMA ( ent - > v - > velocity , sv_pushplayers . value * vel , dir , ent - > v - > velocity ) ;
}
}
2004-09-04 18:01:53 +00:00
if ( pmove . physents [ pmove . touchindex [ i ] ] . notouch )
continue ;
2004-08-23 00:15:46 +00:00
n = pmove . physents [ pmove . touchindex [ i ] ] . info ;
2018-04-06 17:21:15 +00:00
ent = EDICT_NUM_PB ( svprogfuncs , n ) ;
2015-02-02 08:01:53 +00:00
2020-05-14 15:50:26 +00:00
if ( n > = playertouchmax | | ( playertouch [ n > > 3 ] & ( 1 < < ( n & 7 ) ) ) )
2004-08-23 00:15:46 +00:00
continue ;
2015-02-02 08:01:53 +00:00
playertouch [ n > > 3 ] | = 1 < < ( n & 7 ) ;
2004-09-04 18:01:53 +00:00
2010-08-11 23:55:35 +00:00
if ( ent - > v - > touch )
2012-01-17 07:57:46 +00:00
{
if ( progstype ! = PROG_QW & & VectorCompare ( sv_player - > v - > velocity , old_vel ) )
{
VectorCopy ( pmove . touchvel [ i ] , old_vel ) ;
VectorCopy ( pmove . touchvel [ i ] , sv_player - > v - > velocity ) ;
}
2018-09-23 19:35:24 +00:00
sv . world . Event_Touch ( & sv . world , ( wedict_t * ) ent , ( wedict_t * ) sv_player , NULL ) ;
2012-01-17 07:57:46 +00:00
}
2010-08-11 23:55:35 +00:00
2016-07-21 19:27:59 +00:00
if ( sv_player - > v - > touch & & ! ED_ISFREE ( ent ) )
2018-09-23 19:35:24 +00:00
sv . world . Event_Touch ( & sv . world , ( wedict_t * ) sv_player , ( wedict_t * ) ent , NULL ) ;
2004-08-23 00:15:46 +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
if ( progstype ! = PROG_QW )
{
if ( VectorCompare ( sv_player - > v - > velocity , old_vel ) )
VectorCopy ( new_vel , sv_player - > v - > velocity ) ;
}
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = =
SV_PostRunCmd
= = = = = = = = = = =
Done after running a player command .
*/
void SV_PostRunCmd ( void )
{
// run post-think
if ( ! svprogfuncs )
return ;
2007-09-02 19:55:17 +00:00
# ifdef VM_Q1
if ( svs . gametype = = GT_Q1QVM )
{
2004-08-23 00:15:46 +00:00
pr_global_struct - > time = sv . time ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
2007-09-02 19:55:17 +00:00
Q1QVM_PostThink ( ) ;
}
else
# endif
{
if ( ! host_client - > spectator )
{
pr_global_struct - > time = sv . time ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
2004-08-23 00:15:46 +00:00
2011-12-05 15:23:40 +00:00
if ( pr_global_ptrs - > PlayerPostThink )
PR_ExecuteProgram ( svprogfuncs , * pr_global_ptrs - > PlayerPostThink ) ;
2004-08-23 00:15:46 +00:00
2011-09-03 03:49:43 +00:00
WPhys_RunNewmis ( & sv . world ) ;
2007-09-02 19:55:17 +00:00
}
else if ( SpectatorThink )
{
pr_global_struct - > time = sv . time ;
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
PR_ExecuteProgram ( svprogfuncs , SpectatorThink ) ;
}
2004-08-23 00:15:46 +00:00
}
}
2021-04-14 05:21:04 +00:00
static void SV_ReadPrydonCursor ( usercmd_t * cmd )
2009-05-24 10:11:17 +00:00
{
eval_t * cursor_screen , * cursor_start , * cursor_impact , * cursor_entitynumber ;
2021-04-14 05:21:04 +00:00
cmd - > cursor_screen [ 0 ] = MSG_ReadShort ( ) * ( 1.0f / 32767.0f ) ;
cmd - > cursor_screen [ 1 ] = MSG_ReadShort ( ) * ( 1.0f / 32767.0f ) ;
cmd - > cursor_start [ 0 ] = MSG_ReadFloat ( ) ;
cmd - > cursor_start [ 1 ] = MSG_ReadFloat ( ) ;
cmd - > cursor_start [ 2 ] = MSG_ReadFloat ( ) ;
cmd - > cursor_impact [ 0 ] = MSG_ReadFloat ( ) ;
cmd - > cursor_impact [ 1 ] = MSG_ReadFloat ( ) ;
cmd - > cursor_impact [ 2 ] = MSG_ReadFloat ( ) ;
cmd - > cursor_entitynumber = MSGSV_ReadEntity ( host_client ) ;
2009-05-24 10:11:17 +00:00
if ( svprogfuncs )
{
2016-07-12 00:40:13 +00:00
cursor_screen = svprogfuncs - > GetEdictFieldValue ( svprogfuncs , host_client - > edict , " cursor_screen " , ev_vector , NULL ) ;
cursor_start = svprogfuncs - > GetEdictFieldValue ( svprogfuncs , host_client - > edict , " cursor_trace_start " , ev_vector , NULL ) ;
cursor_impact = svprogfuncs - > GetEdictFieldValue ( svprogfuncs , host_client - > edict , " cursor_trace_endpos " , ev_vector , NULL ) ;
cursor_entitynumber = svprogfuncs - > GetEdictFieldValue ( svprogfuncs , host_client - > edict , " cursor_trace_ent " , ev_entity , NULL ) ;
2009-05-24 10:11:17 +00:00
}
else
{
cursor_screen = NULL ;
cursor_start = NULL ;
cursor_impact = NULL ;
cursor_entitynumber = NULL ;
}
2021-04-14 05:21:04 +00:00
if ( cursor_screen )
Vector2Copy ( cmd - > cursor_screen , cursor_screen - > _vector ) ;
if ( cursor_start )
VectorCopy ( cmd - > cursor_start , cursor_start - > _vector ) ;
if ( cursor_impact )
VectorCopy ( cmd - > cursor_impact , cursor_impact - > _vector ) ;
2009-05-24 10:11:17 +00:00
// as requested by FrikaC, cursor_trace_ent is reset to world if the
// entity is free at time of receipt
2021-04-14 05:21:04 +00:00
if ( ! svprogfuncs | | ED_ISFREE ( EDICT_NUM_UB ( svprogfuncs , cmd - > cursor_entitynumber ) ) )
cmd - > cursor_entitynumber = 0 ;
2009-05-24 10:11:17 +00:00
if ( msg_badread ) Con_Printf ( " SV_ReadPrydonCursor: badread at %s:%i \n " , __FILE__ , __LINE__ ) ;
2021-04-14 05:21:04 +00:00
if ( cursor_entitynumber ) cursor_entitynumber - > edict = cmd - > cursor_entitynumber ;
2009-05-24 10:11:17 +00:00
}
void SV_ReadQCRequest ( void )
{
int e ;
------------------------------------------------------------------------
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
char args [ 8 ] ;
2016-02-10 23:23:43 +00:00
char * rname , * fname ;
2009-05-24 10:11:17 +00:00
func_t f ;
int i ;
globalvars_t * pr_globals ;
2017-11-16 22:20:40 +00:00
client_t * cl = host_client ;
2018-09-01 04:18:08 +00:00
edict_t * ed ;
2009-05-24 10:11:17 +00:00
if ( ! svprogfuncs )
{
msg_badread = true ;
return ;
}
pr_globals = PR_globals ( svprogfuncs , PR_CURRENT ) ;
2017-11-16 22:20:40 +00:00
for ( i = 0 ; ; )
2009-05-24 10:11:17 +00:00
{
2017-11-16 22:20:40 +00:00
qbyte ev = MSG_ReadByte ( ) ;
if ( ev > = 200 & & ev < 200 + MAX_SPLITS )
{
ev - = 200 ;
while ( ev - - & & cl )
cl = cl - > controlled ;
continue ;
}
------------------------------------------------------------------------
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 ( i > = sizeof ( args ) - 1 )
2009-11-04 21:16:50 +00:00
{
2017-11-16 22:20:40 +00:00
if ( ev ! = ev_void )
2009-05-24 10:11:17 +00:00
{
msg_badread = true ;
return ;
}
2009-11-04 21:16:50 +00:00
goto done ;
}
2017-11-16 22:20:40 +00:00
switch ( ev )
2009-05-24 10:11:17 +00:00
{
2017-11-16 22:20:40 +00:00
default :
args [ i ] = ' ? ' ;
G_INT ( OFS_PARM0 + i * 3 ) = MSG_ReadLong ( ) ;
break ;
2009-05-24 10:11:17 +00:00
case ev_void :
2009-11-04 21:16:50 +00:00
goto done ;
2009-05-24 10:11:17 +00:00
case ev_float :
args [ i ] = ' f ' ;
G_FLOAT ( OFS_PARM0 + i * 3 ) = MSG_ReadFloat ( ) ;
break ;
2020-09-29 07:09:01 +00:00
case ev_double :
args [ i ] = ' F ' ;
2021-04-14 05:21:04 +00:00
G_DOUBLE ( OFS_PARM0 + i * 3 ) = MSG_ReadDouble ( ) ;
2020-09-29 07:09:01 +00:00
break ;
2009-05-24 10:11:17 +00:00
case ev_vector :
args [ i ] = ' v ' ;
G_FLOAT ( OFS_PARM0 + i * 3 + 0 ) = MSG_ReadFloat ( ) ;
G_FLOAT ( OFS_PARM0 + i * 3 + 1 ) = MSG_ReadFloat ( ) ;
G_FLOAT ( OFS_PARM0 + i * 3 + 2 ) = MSG_ReadFloat ( ) ;
break ;
case ev_integer :
args [ i ] = ' i ' ;
G_INT ( OFS_PARM0 + i * 3 ) = MSG_ReadLong ( ) ;
break ;
2020-09-29 07:09:01 +00:00
case ev_uint :
args [ i ] = ' u ' ;
G_UINT ( OFS_PARM0 + i * 3 ) = MSG_ReadLong ( ) ;
break ;
case ev_int64 :
args [ i ] = ' I ' ;
G_INT64 ( OFS_PARM0 + i * 3 ) = MSG_ReadInt64 ( ) ;
break ;
case ev_uint64 :
args [ i ] = ' U ' ;
G_UINT64 ( OFS_PARM0 + i * 3 ) = MSG_ReadInt64 ( ) ;
break ;
2009-05-24 10:11:17 +00:00
case ev_string :
args [ i ] = ' s ' ;
G_INT ( OFS_PARM0 + i * 3 ) = PR_TempString ( svprogfuncs , MSG_ReadString ( ) ) ;
break ;
case ev_entity :
2011-12-05 15:23:40 +00:00
args [ i ] = ' e ' ;
------------------------------------------------------------------------
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
e = MSGSV_ReadEntity ( host_client ) ;
2009-11-04 21:16:50 +00:00
if ( e < 0 | | e > = sv . world . num_edicts )
2009-05-24 10:11:17 +00:00
e = 0 ;
2018-09-01 04:18:08 +00:00
ed = EDICT_NUM_PB ( svprogfuncs , e ) ;
if ( ! ed )
{
2018-09-01 06:05:51 +00:00
ed = ( edict_t * ) sv . world . edicts ;
Con_Printf ( " client %s sent invalid entity \n " , host_client - > name ) ;
2018-09-01 04:18:08 +00:00
host_client - > drop = true ;
}
G_INT ( OFS_PARM0 + i * 3 ) = EDICT_TO_PROG ( svprogfuncs , ed ) ;
2009-05-24 10:11:17 +00:00
break ;
}
2017-11-16 22:20:40 +00:00
i + + ;
2009-05-24 10:11:17 +00:00
}
2009-11-04 21:16:50 +00:00
done :
2011-10-27 16:16:29 +00:00
args [ i ] = 0 ;
2009-05-24 10:11:17 +00:00
rname = MSG_ReadString ( ) ;
2019-05-23 15:11:32 +00:00
//We used to use Cmd_foo_args, but that conflicts with a zquake extension and would cause [e]zquake mods that use it to be remotely exploitable (mostly crashes from uninitialised args though).
//Instead, we've switched to some more weird prefix that's much less likly to conflict.
2011-10-27 16:16:29 +00:00
if ( i )
2016-02-10 23:23:43 +00:00
fname = va ( " CSEv_%s_%s " , rname , args ) ;
2018-12-04 08:57:29 +00:00
else if ( strchr ( rname , ' _ ' ) ) //this is awkward, as not forcing an underscore would allow people to mis-call things with lingering data (the alternative is to block underscores entirely).
fname = va ( " CSEv_%s_ " , rname ) ;
2011-10-27 16:16:29 +00:00
else
2016-02-10 23:23:43 +00:00
fname = va ( " CSEv_%s " , rname ) ;
f = PR_FindFunction ( svprogfuncs , fname , PR_ANY ) ;
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2015-12-28 17:41:39 +00:00
if ( ! f )
{
if ( i )
rname = va ( " Cmd_%s_%s " , rname , args ) ;
else
rname = va ( " Cmd_%s " , rname ) ;
f = PR_FindFunction ( svprogfuncs , rname , PR_ANY ) ;
2018-12-04 08:57:29 +00:00
if ( f )
2019-05-23 15:11:32 +00:00
{
SV_ClientPrintf ( host_client , PRINT_HIGH , " \" %s \" is no longer supported. \n " , rname ) ;
f = 0 ;
}
2015-12-28 17:41:39 +00:00
}
2018-09-01 04:18:08 +00:00
# endif
if ( host_client - > drop )
;
else if ( ! cl )
2017-11-16 22:20:40 +00:00
; //bad seat! not going to warn as they might have been removed recently
else if ( f )
2011-10-27 16:16:29 +00:00
{
2017-11-16 22:20:40 +00:00
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , cl - > edict ) ;
2009-05-24 10:11:17 +00:00
PR_ExecuteProgram ( svprogfuncs , f ) ;
2011-10-27 16:16:29 +00:00
}
2009-11-04 21:16:50 +00:00
else
2016-02-10 23:23:43 +00:00
SV_ClientPrintf ( host_client , PRINT_HIGH , " qcrequest \" %s \" not supported \n " , fname ) ;
2009-05-24 10:11:17 +00:00
}
2021-07-17 15:10:01 +00:00
static double SVFTE_ExecuteClientMove ( client_t * controller )
{
client_t * split = controller ;
unsigned int flags = MSG_ReadUInt64 ( ) ;
unsigned int seats = ( flags & VRM_SEATS ) ? MSG_ReadUInt64 ( ) : 1 ;
unsigned int frames = ( flags & VRM_FRAMES ) ? MSG_ReadUInt64 ( ) : 3 ;
unsigned int loss = ( flags & VRM_LOSS ) ? MSG_ReadByte ( ) : 0 ;
double delay = ( flags & VRM_DELAY ) ? MSG_ReadByte ( ) / 10000.0 : 0 ; //networked as 10ths of a millisecond.
unsigned int numacks = ( flags & VRM_ACKS ) ? MSG_ReadUInt64 ( ) : 0 ;
usercmd_t old ;
unsigned int seat , frame , a ;
qboolean ran ;
for ( a = 0 ; a < numacks ; a + + )
{
controller - > delta_sequence = MSG_ReadLong ( ) ;
if ( controller - > delta_sequence = = - 1 )
{
unsigned int e ;
if ( controller - > pendingdeltabits )
controller - > pendingdeltabits [ 0 ] = UF_REMOVE ;
if ( host_client - > pendingcsqcbits )
for ( e = 1 ; e < host_client - > max_net_ents ; e + + )
if ( host_client - > pendingcsqcbits [ e ] & SENDFLAGS_PRESENT )
host_client - > pendingcsqcbits [ e ] | = SENDFLAGS_USABLE ;
}
SV_AckEntityFrame ( controller , controller - > delta_sequence ) ;
}
for ( seat = 0 ; seat < seats ; seat + + )
{
if ( ! split )
2021-08-04 21:16:57 +00:00
{ //err, they sent too many seats... assume we kicked one. swallow the extra data.
2021-07-17 15:10:01 +00:00
for ( frame = 0 ; frame < frames ; frame + + )
MSGFTE_ReadDeltaUsercmd ( & nullcmd , & old ) ;
continue ;
}
host_client = split ;
sv_player = split - > edict ;
split - > lossage = loss ;
split - > localtime = loss ;
//all sorts of reasons why we might not want to do physics here and now.
split - > isindependant = ! ( sv_nqplayerphysics . ival | | split - > state < cs_spawned | | SV_PlayerPhysicsQC | | sv . paused | | ! sv . world . worldmodel | | sv . world . worldmodel - > loadstate ! = MLS_LOADED ) ;
ran = false ;
old = nullcmd ;
for ( frame = 0 ; frame < frames ; frame + + )
{
MSGFTE_ReadDeltaUsercmd ( & old , & split - > lastcmd ) ;
2021-09-15 20:33:54 +00:00
split - > lastcmd . sequence = controller - > netchan . outgoing_sequence - ( frames - frame - 1 ) ;
2021-07-17 15:10:01 +00:00
old = split - > lastcmd ;
2021-08-04 21:16:57 +00:00
split - > lastcmd . angles [ 0 ] + = split - > baseangles [ 0 ] ;
split - > lastcmd . angles [ 1 ] + = split - > baseangles [ 1 ] ;
split - > lastcmd . angles [ 2 ] + = split - > baseangles [ 2 ] ;
2021-07-17 15:10:01 +00:00
if ( split - > penalties & BAN_CRIPPLED )
{
split - > lastcmd . forwardmove = 0 ;
split - > lastcmd . sidemove = 0 ;
split - > lastcmd . upmove = 0 ;
}
if ( split - > state = = cs_spawned )
{
2021-08-04 21:16:57 +00:00
//handle impulse here, doing it later might mean it got skipped entirely (nq physics often skips frames).
2021-07-17 15:10:01 +00:00
if ( split - > lastcmd . impulse )
split - > edict - > v - > impulse = split - > lastcmd . impulse ;
2021-08-04 21:16:57 +00:00
2021-07-17 15:10:01 +00:00
if ( split - > isindependant )
{ //this protocol uses bigger timestamps instead of msecs
unsigned int curtime = sv . time * 1000 ;
if ( split - > lastcmd . servertime < split - > lastruncmd )
{
if ( sv_showpredloss . ival )
Con_Printf ( " %s: client jumped %u msecs backwards (anti speed cheat) \n " , split - > name , split - > lastruncmd - split - > lastcmd . servertime ) ;
}
else if ( split - > lastruncmd < split - > lastcmd . servertime )
{
if ( split - > lastcmd . servertime > curtime )
{
//from last map?... attempted speedcheat?
if ( sv_showpredloss . ival )
Con_Printf ( " %s: client is %u msecs in the future (anti speed cheat) \n " , split - > name , split - > lastcmd . servertime - curtime ) ;
split - > lastcmd . servertime = curtime ;
}
if ( ! ran )
{
SV_PreRunCmd ( ) ;
ran = true ;
}
split - > lastcmd . msec = split - > lastcmd . servertime - split - > lastruncmd ;
SV_RunCmd ( & split - > lastcmd , false ) ;
split - > lastruncmd = split - > lastcmd . servertime ;
}
}
else
{
SV_SetEntityButtons ( split - > edict , split - > lastcmd . buttons ) ;
split - > lastcmd . buttons = 0 ;
}
}
}
if ( ran )
SV_PostRunCmd ( ) ;
//for framerate calcs
if ( split - > frameunion . frames )
split - > frameunion . frames [ split - > netchan . outgoing_sequence & UPDATE_MASK ] . move_msecs = split - > lastcmd . msec ;
split - > lastcmd . msec = 0 ;
split = split - > controlled ;
}
host_client = controller ;
sv_player = host_client - > edict ;
return delay ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = =
SV_ExecuteClientMessage
The current net_message is parsed for the given client
= = = = = = = = = = = = = = = = = = =
*/
void SV_ExecuteClientMessage ( client_t * cl )
{
2013-06-23 02:17:02 +00:00
client_t * split = cl ;
2004-08-23 00:15:46 +00:00
int c ;
char * s ;
usercmd_t oldest , oldcmd , newcmd ;
client_frame_t * frame ;
vec3_t o ;
int checksumIndex ;
qbyte checksum , calculatedChecksum ;
2018-12-28 00:04:36 +00:00
int seq_hash ;
2004-08-23 00:15:46 +00:00
2021-06-21 13:46:52 +00:00
if ( ! cl - > frameunion . frames )
{
Con_Printf ( " Server bug: No frames! \n " ) ;
cl - > send_message = false ;
return ; //shouldn't happen...
}
2005-02-28 07:16:19 +00:00
2021-06-21 13:46:52 +00:00
// calc ping time
frame = & cl - > frameunion . frames [ cl - > netchan . incoming_acknowledged & UPDATE_MASK ] ;
2007-08-30 20:45:01 +00:00
2021-08-04 21:16:57 +00:00
if ( cl - > lastsequence_acknowledged + UPDATE_BACKUP > cl - > netchan . incoming_acknowledged & & cl - > netchan . incoming_sequence - cl - > netchan . incoming_acknowledged < UPDATE_BACKUP )
2021-06-21 13:46:52 +00:00
{
/*note that if there is packetloss, we can change a single frame's ping_time multiple times
this means that the ' ping ' is more latency than ping times */
if ( frame - > ping_time = = - 1 | | ! sv_ping_ignorepl . ival )
frame - > ping_time = realtime - frame - > senttime ; //no more phenomanally low pings please
2021-08-04 21:16:57 +00:00
if ( cl - > spectator | | sv_minping . value < = 0 )
2021-06-21 13:46:52 +00:00
cl - > delay = 0 ;
else
{
float diff = frame - > ping_time * 1000 - sv_minping . value ;
if ( fabs ( diff ) > 1 )
2007-08-30 20:45:01 +00:00
{
2021-06-21 13:46:52 +00:00
//FIXME: we should use actual arrival times instead, so we don't get so much noise and seesawing.
diff = bound ( - 25 , diff , 25 ) ; //don't swing wildly
cl - > delay - = 0.001 * ( diff / 25 ) ; //scale towards the ideal value
2021-08-04 21:16:57 +00:00
cl - > delay = bound ( 0 , cl - > delay , UPDATE_BACKUP / 77.0 ) ; //but make sure things don't go crazy
2007-08-30 20:45:01 +00:00
}
}
2021-06-21 13:46:52 +00:00
if ( cl - > penalties & BAN_LAGGED )
if ( cl - > delay < 0.2 )
cl - > delay = 0.2 ;
}
2009-11-04 21:16:50 +00:00
2021-06-21 13:46:52 +00:00
if ( sv_antilag . ival | | ! * sv_antilag . string )
{
2011-10-27 16:16:29 +00:00
# ifdef warningmsg
# pragma warningmsg("FIXME: make antilag optionally support non-player ents too")
2011-05-29 04:26:29 +00:00
# endif
2021-06-21 13:46:52 +00:00
cl - > laggedents_count = sv . allocated_client_slots ;
memcpy ( cl - > laggedents , frame - > laggedplayer , sizeof ( * cl - > laggedents ) * cl - > laggedents_count ) ;
cl - > laggedents_time = frame - > laggedtime ;
cl - > laggedents_frac = ! * sv_antilag_frac . string ? 1 : sv_antilag_frac . value ;
2004-08-23 00:15:46 +00:00
}
else
2021-06-21 13:46:52 +00:00
cl - > laggedents_count = 0 ;
2004-08-23 00:15:46 +00:00
// make sure the reply sequence number matches the incoming
2005-07-03 15:16:20 +00:00
// sequence number
2004-08-23 00:15:46 +00:00
if ( cl - > netchan . incoming_sequence > = cl - > netchan . outgoing_sequence )
cl - > netchan . outgoing_sequence = cl - > netchan . incoming_sequence ;
else
2005-07-03 15:16:20 +00:00
cl - > send_message = false ; // don't reply, sequences have slipped
2004-08-23 00:15:46 +00:00
// save time for ping calculations
2006-02-17 02:51:59 +00:00
if ( cl - > frameunion . frames )
2004-08-23 00:15:46 +00:00
{ //split screen doesn't always have frames.
2006-02-17 02:51:59 +00:00
cl - > frameunion . frames [ cl - > netchan . outgoing_sequence & UPDATE_MASK ] . senttime = realtime ;
cl - > frameunion . frames [ cl - > netchan . outgoing_sequence & UPDATE_MASK ] . ping_time = - 1 ;
2007-07-23 11:44:45 +00:00
cl - > frameunion . frames [ cl - > netchan . outgoing_sequence & UPDATE_MASK ] . move_msecs = - 1 ;
2009-06-23 21:49:44 +00:00
cl - > frameunion . frames [ cl - > netchan . outgoing_sequence & UPDATE_MASK ] . packetsizein = net_message . cursize ;
cl - > frameunion . frames [ cl - > netchan . outgoing_sequence & UPDATE_MASK ] . packetsizeout = 0 ;
2004-08-23 00:15:46 +00:00
}
host_client = cl ;
sv_player = host_client - > edict ;
seq_hash = cl - > netchan . incoming_sequence ;
// mark time so clients will know how much to predict
// other players
cl - > localtime = sv . time ;
cl - > delta_sequence = - 1 ; // no delta unless requested
while ( 1 )
{
if ( msg_badread )
{
2012-10-01 14:29:44 +00:00
Con_Printf ( " SVQW_ReadClientMessage: badread \n " ) ;
2004-08-23 00:15:46 +00:00
SV_DropClient ( cl ) ;
return ;
2005-07-03 15:16:20 +00:00
}
2022-01-08 10:01:15 +00:00
if ( cl - > state < cs_connected )
{ //something went badly... just give up instead of crashing.
host_client = NULL ;
sv_player = NULL ;
return ;
}
2004-08-23 00:15:46 +00:00
c = MSG_ReadByte ( ) ;
if ( c = = - 1 )
break ;
2012-02-15 13:53:30 +00:00
// Con_Printf("(%s) %i: %i\n", cl->name, msg_readcount, c);
2004-08-23 00:15:46 +00:00
switch ( c )
{
default :
2012-10-01 14:29:44 +00:00
Con_Printf ( " SVQW_ReadClientMessage: unknown command char %i \n " , c ) ;
2004-08-23 00:15:46 +00:00
SV_DropClient ( cl ) ;
return ;
case clc_nop :
break ;
case clc_delta :
cl - > delta_sequence = MSG_ReadByte ( ) ;
break ;
2021-07-17 15:10:01 +00:00
case clcfte_move :
frame - > ping_time - = SVFTE_ExecuteClientMove ( cl ) ;
break ;
2004-08-23 00:15:46 +00:00
case clc_move :
2013-06-23 02:17:02 +00:00
if ( split = = cl )
{
//only the first player is checksummed. its pointless as a security measure now quake is open source.
checksumIndex = MSG_GetReadCount ( ) ;
checksum = ( qbyte ) MSG_ReadByte ( ) ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
//only the first player has packetloss calculated.
split - > lossage = MSG_ReadByte ( ) ;
}
else
{
checksumIndex = checksum = 0 ;
if ( split )
split - > lossage = cl - > lossage ;
}
2021-07-17 15:10:01 +00:00
MSGQW_ReadDeltaUsercmd ( & nullcmd , & oldest , PROTOCOL_VERSION_QW ) ;
oldest . fservertime = frame - > laggedtime ; //not very accurate, but our best guess.
oldest . servertime = frame - > laggedtime * 1000 ; //not very accurate
if ( split )
2021-04-14 05:21:04 +00:00
{
2021-07-17 15:10:01 +00:00
Vector2Copy ( split - > lastcmd . cursor_screen , oldest . cursor_screen ) ;
VectorCopy ( split - > lastcmd . cursor_start , oldest . cursor_start ) ;
VectorCopy ( split - > lastcmd . cursor_impact , oldest . cursor_impact ) ;
oldest . cursor_entitynumber = split - > lastcmd . cursor_entitynumber ;
2021-04-14 05:21:04 +00:00
}
2021-07-17 15:10:01 +00:00
MSGQW_ReadDeltaUsercmd ( & oldest , & oldcmd , PROTOCOL_VERSION_QW ) ;
MSGQW_ReadDeltaUsercmd ( & oldcmd , & newcmd , PROTOCOL_VERSION_QW ) ;
2021-09-15 20:33:54 +00:00
oldest . sequence = cl - > netchan . incoming_sequence - 2 ;
oldcmd . sequence = cl - > netchan . incoming_sequence - 1 ;
newcmd . sequence = cl - > netchan . incoming_sequence ;
2013-06-23 02:17:02 +00:00
if ( ! split )
break ; // either someone is trying to cheat, or they sent input commands for splitscreen clients they no longer own.
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
split - > localtime = sv . time ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
if ( split - > frameunion . frames )
split - > frameunion . frames [ split - > netchan . outgoing_sequence & UPDATE_MASK ] . move_msecs = newcmd . msec ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
if ( split - > state = = cs_spawned )
2004-08-23 00:15:46 +00:00
{
2013-06-23 02:17:02 +00:00
if ( split = = cl )
{
// if the checksum fails, ignore the rest of the packet
calculatedChecksum = COM_BlockSequenceCRCByte (
net_message . data + checksumIndex + 1 ,
MSG_GetReadCount ( ) - checksumIndex - 1 ,
seq_hash ) ;
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
if ( calculatedChecksum ! = checksum )
{
Con_DPrintf ( " Failed command checksum for %s(%d) (%d != %d) \n " ,
split - > name , split - > netchan . incoming_sequence , checksum , calculatedChecksum ) ;
break ;
}
}
2004-08-23 00:15:46 +00:00
2014-06-25 03:53:11 +00:00
if ( split - > penalties & BAN_CRIPPLED )
2013-06-23 02:17:02 +00:00
{
split - > lastcmd . forwardmove = 0 ; //hmmm.... does this work well enough?
oldest . forwardmove = 0 ;
oldcmd . forwardmove = 0 ;
newcmd . forwardmove = 0 ;
split - > lastcmd . sidemove = 0 ;
oldest . sidemove = 0 ;
oldcmd . sidemove = 0 ;
newcmd . sidemove = 0 ;
split - > lastcmd . upmove = 0 ;
oldest . upmove = 0 ;
oldcmd . upmove = 0 ;
newcmd . upmove = 0 ;
}
2007-07-23 11:44:45 +00:00
2013-06-23 02:17:02 +00:00
host_client = split ;
sv_player = split - > edict ;
# ifdef HLSERVER
if ( svs . gametype = = GT_HALFLIFE )
{
SVHL_RunPlayerCommand ( split , & oldest , & oldcmd , & newcmd ) ;
}
else
# endif
2016-09-01 14:31:24 +00:00
if ( ! sv . paused & & sv . world . worldmodel & & sv . world . worldmodel - > loadstate = = MLS_LOADED )
2004-08-23 00:15:46 +00:00
{
2016-07-12 00:40:13 +00:00
if ( sv_nqplayerphysics . ival | | split - > state < cs_spawned )
2004-08-23 00:15:46 +00:00
{
2013-06-23 02:17:02 +00:00
//store the info for the physics code to pick up the next time it ticks.
//yeah, nq sucks.
split - > isindependant = false ;
2021-08-19 06:02:03 +00:00
/*if (!split->edict->v->fixangle)
2004-08-23 00:15:46 +00:00
{
2013-06-23 02:17:02 +00:00
split - > edict - > v - > v_angle [ 0 ] = newcmd . angles [ 0 ] * ( 360.0 / 65536 ) ;
split - > edict - > v - > v_angle [ 1 ] = newcmd . angles [ 1 ] * ( 360.0 / 65536 ) ;
split - > edict - > v - > v_angle [ 2 ] = newcmd . angles [ 2 ] * ( 360.0 / 65536 ) ;
2021-08-19 06:02:03 +00:00
} */
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
if ( newcmd . impulse ) // && SV_FilterImpulse(newcmd.impulse, host_client->trustlevel))
split - > edict - > v - > impulse = newcmd . impulse ;
2018-10-11 10:31:23 +00:00
SV_SetEntityButtons ( split - > edict , newcmd . buttons ) ;
2009-03-03 01:52:30 +00:00
}
else
2004-08-23 00:15:46 +00:00
{
2013-06-23 02:17:02 +00:00
//run player physics instantly.
split - > isindependant = true ;
2004-09-04 18:01:53 +00:00
SV_PreRunCmd ( ) ;
2004-08-23 00:15:46 +00:00
2021-07-17 15:10:01 +00:00
if ( net_drop < 20 )
2004-08-23 00:15:46 +00:00
{
2021-07-17 15:10:01 +00:00
while ( net_drop > 2 )
2004-09-04 18:01:53 +00:00
{
2021-07-17 15:10:01 +00:00
SV_RunCmd ( & split - > lastcmd , false ) ;
net_drop - - ;
2004-09-04 18:01:53 +00:00
}
2021-07-17 15:10:01 +00:00
if ( net_drop > 1 )
SV_RunCmd ( & oldest , false ) ;
if ( net_drop > 0 )
SV_RunCmd ( & oldcmd , false ) ;
2004-08-23 00:15:46 +00:00
}
2021-07-17 15:10:01 +00:00
SV_RunCmd ( & newcmd , false ) ;
host_client - > lastruncmd = sv . time * 1000 ;
2004-09-04 18:01:53 +00:00
2010-02-06 01:25:04 +00:00
if ( ! SV_PlayerPhysicsQC | | host_client - > spectator )
2005-06-22 17:10:13 +00:00
SV_PostRunCmd ( ) ;
2010-08-16 02:03:02 +00:00
}
2004-08-23 00:15:46 +00:00
}
2013-06-23 02:17:02 +00:00
else
2004-09-04 18:01:53 +00:00
{
2013-06-23 02:17:02 +00:00
if ( newcmd . impulse ) // && SV_FilterImpulse(newcmd.impulse, host_client->trustlevel))
sv_player - > v - > impulse = newcmd . impulse ;
2005-01-26 03:39:47 +00:00
}
2004-08-23 00:15:46 +00:00
2013-06-23 02:17:02 +00:00
split - > lastcmd = newcmd ;
2004-08-23 00:15:46 +00:00
}
2013-06-23 02:17:02 +00:00
split = split - > controlled ; //so the next splitscreen client gets the next packet.
host_client = cl ;
2004-08-23 00:15:46 +00:00
sv_player = cl - > edict ;
break ;
2015-04-14 23:12:17 +00:00
case clcfte_prydoncursor :
2021-04-14 05:21:04 +00:00
SV_ReadPrydonCursor ( & host_client - > lastcmd ) ; //lame...
2009-05-24 10:11:17 +00:00
break ;
2015-04-14 23:12:17 +00:00
case clcfte_qcrequest :
2009-05-24 10:11:17 +00:00
SV_ReadQCRequest ( ) ;
break ;
2015-04-14 23:12:17 +00:00
# ifdef TERRAIN
case clcfte_brushedit :
if ( ! SV_Parse_BrushEdit ( ) )
{
SV_DropClient ( cl ) ;
return ;
}
break ;
# endif
2004-08-23 00:15:46 +00:00
2021-07-17 15:10:10 +00:00
case clcfte_stringcmd_seat :
c = MSG_ReadByte ( ) ;
host_client = cl ;
while ( c - - > 0 & & host_client - > controlled )
host_client = host_client - > controlled ;
sv_player = host_client - > edict ;
//fall through
2005-07-03 15:16:20 +00:00
case clc_stringcmd :
2004-08-23 00:15:46 +00:00
s = MSG_ReadString ( ) ;
SV_ExecuteUserCommand ( s , false ) ;
2021-06-25 18:50:42 +00:00
# ifdef NETPREPARSE
NPP_Flush ( ) ; //flush it just in case there was an error and we stopped preparsing. This is only really needed while debugging.
# endif
2004-08-23 00:15:46 +00:00
host_client = cl ;
sv_player = cl - > edict ;
break ;
case clc_tmove :
o [ 0 ] = MSG_ReadCoord ( ) ;
o [ 1 ] = MSG_ReadCoord ( ) ;
o [ 2 ] = MSG_ReadCoord ( ) ;
// only allowed by spectators
2009-11-07 13:29:15 +00:00
# ifdef SERVER_DEMO_PLAYBACK
2005-01-26 03:39:47 +00:00
if ( sv . mvdplayback )
{
VectorCopy ( o , host_client - > specorigin ) ;
}
2009-11-07 13:29:15 +00:00
else
# endif
if ( host_client - > spectator )
2005-01-26 03:39:47 +00:00
{
2005-03-28 00:11:59 +00:00
VectorCopy ( o , sv_player - > v - > origin ) ;
2009-11-04 21:16:50 +00:00
World_LinkEdict ( & sv . world , ( wedict_t * ) sv_player , false ) ;
2004-08-23 00:15:46 +00:00
}
break ;
case clc_upload :
SV_NextUpload ( ) ;
break ;
2011-09-05 01:48:23 +00:00
# ifdef VOICECHAT
2015-04-14 23:12:17 +00:00
case clcfte_voicechat :
2010-11-15 02:40:31 +00:00
SV_VoiceReadPacket ( ) ;
break ;
# endif
2013-03-12 22:35:33 +00:00
case clcdp_ackframe :
cl - > delta_sequence = MSG_ReadLong ( ) ;
2020-04-19 01:23:32 +00:00
if ( cl - > delta_sequence = = - 1 )
{
unsigned int e ;
if ( cl - > pendingdeltabits )
cl - > pendingdeltabits [ 0 ] = UF_REMOVE ;
if ( host_client - > pendingcsqcbits )
for ( e = 1 ; e < host_client - > max_net_ents ; e + + )
if ( host_client - > pendingcsqcbits [ e ] & SENDFLAGS_PRESENT )
host_client - > pendingcsqcbits [ e ] | = SENDFLAGS_USABLE ;
}
2013-03-12 22:35:33 +00:00
SV_AckEntityFrame ( cl , cl - > delta_sequence ) ;
break ;
2004-08-23 00:15:46 +00:00
}
}
2013-03-12 22:35:33 +00:00
SV_AckEntityFrame ( cl , cl - > netchan . incoming_acknowledged ) ;
2004-08-23 00:15:46 +00:00
host_client = NULL ;
sv_player = NULL ;
}
# ifdef Q2SERVER
2022-02-19 20:49:42 +00:00
static void SVQ2_ClientThink ( q2edict_t * ed , usercmd_t * cmd )
{
q2usercmd_t q2 ;
q2 . msec = cmd - > msec ;
q2 . buttons = cmd - > buttons ;
VectorCopy ( cmd - > angles , q2 . angles ) ;
q2 . forwardmove = cmd - > forwardmove ;
q2 . sidemove = cmd - > sidemove ;
q2 . upmove = cmd - > upmove ;
q2 . impulse = cmd - > impulse ;
q2 . lightlevel = cmd - > lightlevel ;
ge - > ClientThink ( ed , & q2 ) ;
}
2004-08-23 00:15:46 +00:00
void SVQ2_ExecuteClientMessage ( client_t * cl )
{
2018-06-18 16:44:29 +00:00
int c ;
2004-08-23 00:15:46 +00:00
char * s ;
usercmd_t oldest , oldcmd , newcmd ;
q2client_frame_t * frame ;
2016-01-18 05:22:07 +00:00
int move_issued = 0 ; //only allow one move command
2004-08-23 00:15:46 +00:00
int checksumIndex ;
qbyte checksum , calculatedChecksum ;
int seq_hash ;
int lastframe ;
2016-01-18 05:22:07 +00:00
client_t * split ;
2004-08-23 00:15:46 +00:00
2005-03-18 06:13:11 +00:00
if ( ! ge )
{
Con_Printf ( " Q2 client without Q2 server \n " ) ;
SV_DropClient ( cl ) ;
}
2004-08-23 00:15:46 +00:00
// make sure the reply sequence number matches the incoming
2005-07-03 15:16:20 +00:00
// sequence number
2004-08-23 00:15:46 +00:00
if ( cl - > netchan . incoming_sequence > = cl - > netchan . outgoing_sequence )
cl - > netchan . outgoing_sequence = cl - > netchan . incoming_sequence ;
else
2005-07-03 15:16:20 +00:00
cl - > send_message = false ; // don't reply, sequences have slipped
2004-08-23 00:15:46 +00:00
2015-05-14 03:06:58 +00:00
// calc ping time
if ( cl - > netchan . outgoing_sequence - cl - > netchan . incoming_acknowledged > Q2UPDATE_MASK )
{
cl - > delay - = 0.001 ;
if ( cl - > delay < 0 )
cl - > delay = 0 ;
}
else
{
frame = & cl - > frameunion . q2frames [ cl - > netchan . incoming_acknowledged & Q2UPDATE_MASK ] ;
if ( frame - > senttime ! = - 1 )
{
int ping_time = ( int ) ( realtime * 1000 ) - frame - > senttime ; //no more phenomanally low pings please
if ( ping_time > sv_minping . value + 1 )
{
cl - > delay - = 0.001 ;
if ( cl - > delay < 0 )
cl - > delay = 0 ;
}
if ( ping_time < sv_minping . value )
{
cl - > delay + = 0.001 ;
if ( cl - > delay > 1 )
cl - > delay = 1 ;
}
frame - > senttime = - 1 ;
frame - > ping_time = ping_time ;
}
}
2004-08-23 00:15:46 +00:00
// save time for ping calculations
2015-05-14 03:06:58 +00:00
// cl->frameunion.q2frames[cl->netchan.outgoing_sequence & Q2UPDATE_MASK].senttime = realtime*1000;
// cl->frameunion.q2frames[cl->netchan.outgoing_sequence & Q2UPDATE_MASK].ping_time = -1;
2004-08-23 00:15:46 +00:00
host_client = cl ;
sv_player = host_client - > edict ;
seq_hash = cl - > netchan . incoming_sequence ;
// mark time so clients will know how much to predict
// other players
cl - > localtime = sv . time ;
cl - > delta_sequence = - 1 ; // no delta unless requested
while ( 1 )
{
if ( msg_badread )
{
Con_Printf ( " SVQ2_ExecuteClientMessage: badread \n " ) ;
SV_DropClient ( cl ) ;
return ;
2005-07-03 15:16:20 +00:00
}
2004-08-23 00:15:46 +00:00
c = MSG_ReadByte ( ) ;
if ( c = = - 1 )
break ;
2021-08-04 21:16:57 +00:00
safeswitch ( ( enum clcq2_ops_e ) c )
2004-08-23 00:15:46 +00:00
{
case clcq2_nop :
break ;
case clcq2_move :
2016-01-18 05:22:07 +00:00
if ( move_issued > = MAX_SPLITS )
2004-08-23 00:15:46 +00:00
return ; // someone is trying to cheat...
2016-01-18 05:22:07 +00:00
for ( checksumIndex = 0 , split = cl ; split & & checksumIndex < move_issued ; checksumIndex + + )
split = split - > controlled ;
2004-08-23 00:15:46 +00:00
2016-01-18 05:22:07 +00:00
if ( move_issued )
{
checksumIndex = - 1 ;
checksum = 0 ;
}
else
{
checksumIndex = MSG_GetReadCount ( ) ;
checksum = ( qbyte ) MSG_ReadByte ( ) ;
2004-08-23 00:15:46 +00:00
2005-07-03 15:16:20 +00:00
2016-01-18 05:22:07 +00:00
lastframe = MSG_ReadLong ( ) ;
if ( lastframe ! = split - > delta_sequence )
{
split - > delta_sequence = lastframe ;
}
2004-08-23 00:15:46 +00:00
}
MSGQ2_ReadDeltaUsercmd ( & nullcmd , & oldest ) ;
MSGQ2_ReadDeltaUsercmd ( & oldest , & oldcmd ) ;
MSGQ2_ReadDeltaUsercmd ( & oldcmd , & newcmd ) ;
2016-01-18 05:22:07 +00:00
if ( split & & split - > state = = cs_spawned )
2004-08-23 00:15:46 +00:00
{
2016-01-18 05:22:07 +00:00
if ( checksumIndex ! = - 1 )
{
// if the checksum fails, ignore the rest of the packet
calculatedChecksum = Q2COM_BlockSequenceCRCByte (
net_message . data + checksumIndex + 1 ,
MSG_GetReadCount ( ) - checksumIndex - 1 ,
seq_hash ) ;
2004-08-23 00:15:46 +00:00
2016-01-18 05:22:07 +00:00
if ( calculatedChecksum ! = checksum )
{
Con_DPrintf ( " Failed command checksum for %s(%d) (%d != %d) \n " ,
cl - > name , cl - > netchan . incoming_sequence , checksum , calculatedChecksum ) ;
return ;
}
}
2004-08-23 00:15:46 +00:00
2016-01-18 05:22:07 +00:00
if ( split - > penalties & BAN_CRIPPLED )
{
split - > lastcmd . forwardmove = 0 ; //hmmm.... does this work well enough?
oldest . forwardmove = 0 ;
newcmd . forwardmove = 0 ;
2004-08-23 00:15:46 +00:00
2016-01-18 05:22:07 +00:00
split - > lastcmd . sidemove = 0 ;
oldest . sidemove = 0 ;
newcmd . sidemove = 0 ;
2004-08-23 00:15:46 +00:00
2016-01-18 05:22:07 +00:00
split - > lastcmd . upmove = 0 ;
oldest . upmove = 0 ;
newcmd . upmove = 0 ;
}
split - > q2edict - > client - > ping = SV_CalcPing ( split , false ) ;
if ( ! sv . paused )
2004-08-23 00:15:46 +00:00
{
2016-01-18 05:22:07 +00:00
if ( net_drop < 20 )
2004-08-23 00:15:46 +00:00
{
2016-01-18 05:22:07 +00:00
while ( net_drop > 2 )
{
2022-02-19 20:49:42 +00:00
SVQ2_ClientThink ( split - > q2edict , & split - > lastcmd ) ;
2016-01-18 05:22:07 +00:00
net_drop - - ;
}
if ( net_drop > 1 )
2022-02-19 20:49:42 +00:00
SVQ2_ClientThink ( split - > q2edict , & oldest ) ;
2016-01-18 05:22:07 +00:00
if ( net_drop > 0 )
2022-02-19 20:49:42 +00:00
SVQ2_ClientThink ( split - > q2edict , & oldcmd ) ;
2004-08-23 00:15:46 +00:00
}
2022-02-19 20:49:42 +00:00
SVQ2_ClientThink ( split - > q2edict , & newcmd ) ;
2004-08-23 00:15:46 +00:00
}
2016-01-18 05:22:07 +00:00
split - > lastcmd = newcmd ;
}
move_issued + + ;
2004-08-23 00:15:46 +00:00
break ;
case clcq2_userinfo :
2018-07-05 16:21:44 +00:00
//FIXME: allows the client to set * keys mid-game.
s = MSG_ReadString ( ) ;
InfoBuf_FromString ( & cl - > userinfo , s , 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
SV_ExtractFromUserinfo ( cl , true ) ; //let the server routines know
2018-07-05 16:21:44 +00:00
ge - > ClientUserinfoChanged ( cl - > q2edict , s ) ; //tell the gamecode
2004-08-23 00:15:46 +00:00
break ;
2021-07-17 15:10:10 +00:00
case clcq2_stringcmd_seat :
c = MSG_ReadByte ( ) ;
host_client = cl ;
while ( c - - > 0 & & host_client - > controlled )
host_client = host_client - > controlled ;
sv_player = host_client - > edict ;
//fall through
2005-07-03 15:16:20 +00:00
case clcq2_stringcmd :
2004-08-23 00:15:46 +00:00
s = MSG_ReadString ( ) ;
SV_ExecuteUserCommand ( s , false ) ;
2005-10-23 17:57:20 +00:00
host_client = cl ;
sv_player = cl - > edict ;
2017-08-14 16:38:44 +00:00
if ( cl - > state < cs_connected )
2004-08-23 00:15:46 +00:00
return ; // disconnect command
break ;
2011-05-20 04:10:46 +00:00
2011-09-05 01:48:23 +00:00
# ifdef VOICECHAT
2013-05-11 05:03:07 +00:00
case clcq2_voicechat :
2011-05-20 04:10:46 +00:00
SV_VoiceReadPacket ( ) ;
break ;
# endif
2021-08-04 21:16:57 +00:00
case clcq2_bad :
case clcr1q2_setting :
case clcr1q2_multimoves :
safedefault :
Con_Printf ( " SVQ2_ReadClientMessage: unknown command char %i \n " , c ) ;
SV_DropClient ( cl ) ;
return ;
2004-08-23 00:15:46 +00:00
}
}
}
# endif
# ifdef NQPROT
2022-01-08 10:01:15 +00:00
void SVNQ_ReadClientMove ( qboolean forceangle16 , qboolean quakeex )
2004-08-23 00:15:46 +00:00
{
int i ;
2005-07-03 15:16:20 +00:00
client_frame_t * frame ;
2008-11-09 22:29:28 +00:00
float timesincelast ;
2021-04-14 05:21:04 +00:00
usercmd_t * from = & host_client - > lastcmd ;
usercmd_t cmd ;
2005-07-03 15:16:20 +00:00
2006-02-17 02:51:59 +00:00
frame = & host_client - > frameunion . frames [ host_client - > netchan . incoming_acknowledged & UPDATE_MASK ] ;
2005-05-27 05:41:07 +00:00
2022-01-08 10:01:15 +00:00
if ( quakeex )
;
else if ( host_client - > protocol = = SCP_DARKPLACES7 )
2005-06-22 17:10:13 +00:00
host_client - > last_sequence = MSG_ReadLong ( ) ;
2016-10-22 07:06:51 +00:00
else if ( host_client - > fteprotocolextensions2 & PEXT2_PREDINFO )
{
int seq = ( unsigned short ) MSG_ReadShort ( ) ;
if ( seq < ( host_client - > last_sequence & 0xffff ) )
host_client - > last_sequence + = 0x10000 ; //wrapped
host_client - > last_sequence = ( host_client - > last_sequence & 0xffff0000 ) | seq ;
}
2005-06-22 17:10:13 +00:00
else
host_client - > last_sequence = 0 ;
2012-02-27 12:23:15 +00:00
2021-07-17 15:10:01 +00:00
cmd = nullcmd ;
2021-04-14 05:21:04 +00:00
2021-09-15 20:33:54 +00:00
cmd . sequence = host_client - > last_sequence ;
2021-07-17 15:10:01 +00:00
//read the time, woo... should be an ack of our serverside time.
cmd . fservertime = MSG_ReadFloat ( ) ;
if ( cmd . fservertime < from - > fservertime )
cmd . fservertime = from - > fservertime ;
if ( cmd . fservertime > sv . time )
cmd . fservertime = sv . time ;
if ( cmd . fservertime < sv . time - 2 ) //if you do lag more than this, you won't get your free time.
cmd . fservertime = sv . time - 2 ;
cmd . servertime = cmd . fservertime * 1000 ;
2021-04-14 05:21:04 +00:00
2022-01-08 10:01:15 +00:00
if ( quakeex )
{ //I'm guessing this has something to do with splitscreen.
if ( MSG_ReadByte ( ) ! = 1 )
2022-01-16 18:41:44 +00:00
{
Con_Printf ( " Unknown byte wasn't 1 \n " ) ;
2022-01-08 10:01:15 +00:00
msg_badread = true ;
2022-01-16 18:41:44 +00:00
}
2022-01-08 10:01:15 +00:00
}
2021-07-17 15:10:01 +00:00
//read angles
for ( i = 0 ; i < 3 ; i + + )
{
float a ;
if ( forceangle16 )
a = MSG_ReadAngle16 ( ) ;
else
a = MSG_ReadAngle ( ) ;
2021-04-14 05:21:04 +00:00
2021-07-17 15:10:01 +00:00
cmd . angles [ i ] = ANGLE2SHORT ( a ) ;
}
2008-11-09 22:29:28 +00:00
2021-07-17 15:10:01 +00:00
// read movement
cmd . forwardmove = MSG_ReadShort ( ) ;
cmd . sidemove = MSG_ReadShort ( ) ;
cmd . upmove = MSG_ReadShort ( ) ;
2021-04-14 05:21:04 +00:00
2021-07-17 15:10:01 +00:00
// read buttons
if ( host_client - > protocol = = SCP_DARKPLACES6 | | host_client - > protocol = = SCP_DARKPLACES7 )
cmd . buttons = MSG_ReadLong ( ) | ( 1u < < 31 ) ;
else if ( host_client - > fteprotocolextensions2 & PEXT2_PRYDONCURSOR )
cmd . buttons = MSG_ReadLong ( ) ;
else
cmd . buttons = MSG_ReadByte ( ) ;
2004-08-23 00:15:46 +00:00
2021-07-17 15:10:01 +00:00
//impulse...
cmd . impulse = MSG_ReadByte ( ) ;
2021-04-14 05:21:04 +00:00
2021-07-17 15:10:01 +00:00
//weapon extension
if ( cmd . buttons & ( 1u < < 30 ) )
cmd . weapon = MSG_ReadLong ( ) ;
else
cmd . weapon = 0 ;
2021-04-14 05:21:04 +00:00
2021-07-17 15:10:01 +00:00
//cursor extension
if ( cmd . buttons & ( 1u < < 31 ) )
SV_ReadPrydonCursor ( & cmd ) ;
2021-04-14 05:21:04 +00:00
2021-07-17 15:10:01 +00:00
//clear out extension buttons that are part of the protocol rather than actual buttons..
cmd . buttons & = ~ ( ( 1u < < 30 ) | ( 1u < < 31 ) ) ;
2021-04-14 05:21:04 +00:00
//figure out ping
frame - > ping_time = sv . time - cmd . fservertime ;
//figure out how far we moved.
timesincelast = cmd . fservertime - from - > fservertime ;
cmd . msec = bound ( 0 , timesincelast * 1000 , 250 ) ;
frame - > move_msecs = timesincelast * 1000 ;
2005-07-03 15:16:20 +00:00
2013-03-12 22:35:33 +00:00
if ( frame - > ping_time * 1000 > sv_minping . value + 1 )
{
host_client - > delay - = 0.001 ;
if ( host_client - > delay < 0 )
host_client - > delay = 0 ;
}
if ( frame - > ping_time * 1000 < sv_minping . value )
{
host_client - > delay + = 0.001 ;
if ( host_client - > delay > 1 )
host_client - > delay = 1 ;
}
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
if ( host_client - > spectator )
{
qboolean tracknext = false ;
2021-04-14 05:21:04 +00:00
unsigned int pressed = cmd . buttons & ~ from - > buttons ;
if ( pressed & BUTTON_ATTACK )
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
{ //enable/disable tracking
if ( host_client - > spec_track )
{ //disable tracking
host_client - > spec_track = 0 ;
2018-04-06 17:21:15 +00:00
host_client - > edict - > v - > goalentity = EDICT_TO_PROG ( svprogfuncs , EDICT_NUM_PB ( svprogfuncs , 0 ) ) ;
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
ClientReliableWrite_Begin ( host_client , svc_setview , 4 ) ;
ClientReliableWrite_Entity ( host_client , host_client - svs . clients + 1 ) ;
}
else //otherwise track the next person, if we can
tracknext = true ;
}
2021-04-14 05:21:04 +00:00
if ( ( pressed & BUTTON_JUMP ) & & host_client - > spec_track )
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
tracknext = true ;
if ( tracknext )
{ //track the next player
for ( i = host_client - > spec_track + 1 ; i < sv . allocated_client_slots ; i + + )
{
if ( SV_CanTrack ( host_client , i ) )
break ;
}
//try a previous one instead of disabling
if ( i = = sv . allocated_client_slots )
{
for ( i = 1 ; i < host_client - > spec_track ; i + + )
{
if ( SV_CanTrack ( host_client , i ) )
break ;
}
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 ( i > = host_client - > spec_track )
i = 0 ;
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
}
host_client - > spec_track = i ;
2018-04-06 17:21:15 +00:00
host_client - > edict - > v - > goalentity = EDICT_TO_PROG ( svprogfuncs , EDICT_NUM_PB ( svprogfuncs , i ) ) ;
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
ClientReliableWrite_Begin ( host_client , svc_setview , 4 ) ;
ClientReliableWrite_Entity ( host_client , i ? i : ( host_client - svs . clients + 1 ) ) ;
if ( i )
SV_ClientTPrintf ( host_client , PRINT_HIGH , " tracking %s \n " , svs . clients [ i - 1 ] . name ) ;
}
}
2004-11-20 00:52:49 +00:00
2021-08-19 06:02:03 +00:00
/*host_client->edict->v->v_angle[0] = SHORT2ANGLE(cmd.angles[0]);
2021-04-14 05:21:04 +00:00
host_client - > edict - > v - > v_angle [ 1 ] = SHORT2ANGLE ( cmd . angles [ 1 ] ) ;
2021-08-19 06:02:03 +00:00
host_client - > edict - > v - > v_angle [ 2 ] = SHORT2ANGLE ( cmd . angles [ 2 ] ) ; */
2004-11-20 00:52:49 +00:00
2021-04-14 05:21:04 +00:00
if ( SV_RunFullQCMovement ( host_client , & cmd ) )
{ //mod provides its own movement logic. this forces independance.
host_client - > msecs - = cmd . msec ;
2009-11-04 21:16:50 +00:00
pr_global_struct - > time = sv . world . physicstime ;
2009-04-19 00:50:42 +00:00
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
# ifdef VM_Q1
if ( svs . gametype = = GT_Q1QVM )
Q1QVM_PostThink ( ) ;
else
# endif
{
if ( pr_global_struct - > PlayerPostThink )
PR_ExecuteProgram ( svprogfuncs , pr_global_struct - > PlayerPostThink ) ;
}
host_client - > isindependant = true ;
2008-11-09 22:29:28 +00:00
}
else
2014-06-16 16:21:28 +00:00
{
2021-04-14 05:21:04 +00:00
SV_SetEntityButtons ( host_client - > edict , cmd . buttons ) ;
if ( host_client - > last_sequence & & ! sv_nqplayerphysics . ival & & host_client - > state = = cs_spawned )
{
host_frametime = timesincelast ;
host_client - > isindependant = true ;
SV_PreRunCmd ( ) ;
SV_RunCmd ( & cmd , false ) ;
SV_PostRunCmd ( ) ;
cmd . impulse = 0 ;
host_client - > lastruncmd = sv . time * 1000 ;
}
else
{
2022-01-16 18:41:44 +00:00
if ( ! host_client - > qex )
2022-01-08 10:01:15 +00:00
host_client - > last_sequence = 0 ; //let the client know that prediction is fucked, by not acking any input frames.
2021-04-14 05:21:04 +00:00
if ( cmd . impulse )
host_client - > edict - > v - > impulse = cmd . impulse ;
host_client - > isindependant = false ;
}
2014-06-16 16:21:28 +00:00
}
2021-04-14 05:21:04 +00:00
* from = cmd ;
2004-08-23 00:15:46 +00:00
}
void SVNQ_ExecuteClientMessage ( client_t * cl )
{
2022-03-08 05:34:26 +00:00
extern cvar_t sv_listen_dp ;
2004-08-23 00:15:46 +00:00
int c ;
char * s ;
2017-08-29 02:29:06 +00:00
// client_frame_t *frame;
2018-03-05 11:06:12 +00:00
qboolean forceangle16 ;
2004-08-23 00:15:46 +00:00
2005-05-26 12:55:34 +00:00
cl - > netchan . outgoing_sequence + + ;
cl - > netchan . incoming_acknowledged = cl - > netchan . outgoing_sequence - 1 ;
2004-08-23 00:15:46 +00:00
// calc ping time
2017-08-29 02:29:06 +00:00
// frame = &cl->frameunion.frames[cl->netchan.incoming_acknowledged & UPDATE_MASK];
// frame->ping_time = -1;
2004-08-23 00:15:46 +00:00
// make sure the reply sequence number matches the incoming
2005-07-03 15:16:20 +00:00
// sequence number
2005-05-26 12:55:34 +00:00
// if (cl->netchan.incoming_sequence >= cl->netchan.outgoing_sequence)
2004-08-23 00:15:46 +00:00
cl - > netchan . outgoing_sequence = cl - > netchan . incoming_sequence ;
2005-05-26 12:55:34 +00:00
// else
2005-07-03 15:16:20 +00:00
// cl->send_message = false; // don't reply, sequences have slipped
2004-08-23 00:15:46 +00:00
// save time for ping calculations
2017-08-29 02:29:06 +00:00
// cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].senttime = realtime;
// cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].ping_time = -1;
// cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].move_msecs = -1;
// cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].packetsizein = net_message.cursize;
// cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].packetsizeout = 0;
2004-08-23 00:15:46 +00:00
host_client = cl ;
sv_player = host_client - > edict ;
// mark time so clients will know how much to predict
// other players
cl - > localtime = sv . time ;
while ( 1 )
{
if ( msg_badread )
{
2012-10-01 14:29:44 +00:00
Con_Printf ( " SVNQ_ReadClientMessage: badread \n " ) ;
2004-08-23 00:15:46 +00:00
SV_DropClient ( cl ) ;
return ;
2005-07-03 15:16:20 +00:00
}
2004-08-23 00:15:46 +00:00
c = MSG_ReadByte ( ) ;
if ( c = = - 1 )
break ;
2021-08-04 21:16:57 +00:00
safeswitch ( c )
2004-08-23 00:15:46 +00:00
{
case clc_disconnect :
2011-12-05 15:23:40 +00:00
host_client = cl ;
sv_player = cl - > edict ;
SV_Drop_f ( ) ;
2013-08-27 13:18:09 +00:00
return ;
2004-08-23 00:15:46 +00:00
case clc_nop :
break ;
2018-03-05 11:06:12 +00:00
// case clc_delta: //not in NQ
2011-10-27 16:16:29 +00:00
// cl->delta_sequence = MSG_ReadByte ();
// break;
2004-08-23 00:15:46 +00:00
2021-07-17 15:10:01 +00:00
case clcfte_move :
{
int seq = ( unsigned short ) MSG_ReadShort ( ) ;
unsigned int oldservertime = cl - > lastcmd . servertime ;
float delay = SVFTE_ExecuteClientMove ( cl ) ;
client_frame_t * frame ;
//this is the input sequence that we'll need to ack later (no
if ( seq < ( host_client - > last_sequence & 0xffff ) )
host_client - > last_sequence + = 0x10000 ; //wrapped
host_client - > last_sequence = ( host_client - > last_sequence & 0xffff0000 ) | seq ;
2021-08-04 21:16:57 +00:00
if ( cl - > lastsequence_acknowledged > 0 & & cl - > netchan . incoming_sequence - cl - > lastsequence_acknowledged < UPDATE_BACKUP )
2021-07-17 15:10:01 +00:00
{
2021-08-04 21:16:57 +00:00
frame = & host_client - > frameunion . frames [ cl - > lastsequence_acknowledged & UPDATE_MASK ] ;
2021-07-17 15:10:01 +00:00
if ( frame - > ping_time = = - 1 )
2021-08-04 21:16:57 +00:00
frame - > ping_time = ( realtime - frame - > senttime ) ;
2021-07-17 15:10:01 +00:00
}
else
{
frame = & host_client - > frameunion . frames [ cl - > netchan . incoming_acknowledged & UPDATE_MASK ] ;
2021-08-04 21:16:57 +00:00
frame - > ping_time = ( sv . time - cl - > lastcmd . servertime / 1000.0 ) ;
2021-07-17 15:10:01 +00:00
}
frame - > move_msecs = cl - > lastcmd . servertime - oldservertime ;
if ( frame - > ping_time * 1000 > sv_minping . value + 1 )
{
host_client - > delay - = 0.001 ;
if ( host_client - > delay < 0 )
host_client - > delay = 0 ;
}
if ( frame - > ping_time * 1000 < sv_minping . value )
{
host_client - > delay + = 0.001 ;
if ( host_client - > delay > 1 )
host_client - > delay = 1 ;
}
2021-08-04 21:16:57 +00:00
frame - > ping_time - = delay ;
2021-07-17 15:10:01 +00:00
}
break ;
2018-03-05 11:06:12 +00:00
case clc_move : //bytes: 16(nq), 19(proquake/fitz), 56(dp7)
if ( cl - > state ! = cs_spawned )
2016-07-12 00:40:13 +00:00
return ; //shouldn't be sending moves at this point. typically they're stale, left from the previous map. this results in crashes if the protocol is different.
2018-03-05 11:06:12 +00:00
forceangle16 = false ;
2021-08-04 21:16:57 +00:00
safeswitch ( cl - > protocol )
2018-03-05 11:06:12 +00:00
{
case SCP_FITZ666 :
forceangle16 = true ;
break ;
case SCP_NETQUAKE :
case SCP_BJP3 :
2022-03-08 05:34:26 +00:00
if ( sv_listen_dp . ival )
2018-03-05 11:06:12 +00:00
{
2022-03-08 05:34:26 +00:00
unsigned int readcount = MSG_GetReadCount ( ) ;
//Hack to work around buggy DP clients that don't reset the proquake hack for the next server
//this ONLY works because the other clc commands are very unlikely to both be 3 bytes big and sent unreliably
//aka: DP ProQuake angles hack hack
//note that if a client then decides to use 16bit angles via this hack then it would be the 'fte dp proquake angles hack hack hack'....
if ( ! cl - > fteprotocolextensions & & ! cl - > fteprotocolextensions2 )
if ( ( net_message . cursize - ( readcount - 1 ) = = 16 & & cl - > proquake_angles_hack ) | |
( net_message . cursize - ( readcount - 1 ) = = 19 & & ! cl - > proquake_angles_hack ) )
{
cl - > proquake_angles_hack ^ = 1 ;
SV_ClientPrintf ( cl , PRINT_HIGH , " Client sent " S_COLOR_RED " wrong " S_COLOR_WHITE " clc_move size, switching to %u-bit angles to try to compensate \n " , cl - > proquake_angles_hack ? 16 : 8 ) ;
}
2018-03-05 11:06:12 +00:00
}
forceangle16 = cl - > proquake_angles_hack ;
break ;
case SCP_BAD :
case SCP_QUAKEWORLD :
case SCP_QUAKE2 :
case SCP_QUAKE3 :
case SCP_DARKPLACES6 :
case SCP_DARKPLACES7 :
2021-08-04 21:16:57 +00:00
safedefault :
2018-03-05 11:06:12 +00:00
break ;
}
2022-01-16 18:41:44 +00:00
SVNQ_ReadClientMove ( forceangle16 , cl - > qex ) ;
2004-08-23 00:15:46 +00:00
// cmd = host_client->lastcmd;
// SV_ClientThink();
break ;
2005-07-03 15:16:20 +00:00
case clc_stringcmd :
2004-08-23 00:15:46 +00:00
s = MSG_ReadString ( ) ;
2005-10-23 17:57:20 +00:00
SV_ExecuteUserCommand ( s , false ) ;
2021-06-25 18:50:42 +00:00
# ifdef NETPREPARSE
NPP_Flush ( ) ; //flush it just in case there was an error and we stopped preparsing. This is only really needed while debugging.
# endif
2005-10-23 17:57:20 +00:00
host_client = cl ;
sv_player = cl - > edict ;
2013-08-27 13:18:09 +00:00
if ( cl - > state < cs_connected )
return ;
2004-08-23 00:15:46 +00:00
break ;
2015-04-14 23:12:17 +00:00
case clcfte_qcrequest :
2013-03-12 22:35:33 +00:00
SV_ReadQCRequest ( ) ;
2018-03-05 11:06:12 +00:00
host_client = cl ;
sv_player = cl - > edict ;
if ( cl - > state < cs_connected )
return ;
2013-03-12 22:35:33 +00:00
break ;
2011-10-27 16:16:29 +00:00
case clcdp_ackframe :
cl - > delta_sequence = MSG_ReadLong ( ) ;
2020-04-19 01:23:32 +00:00
if ( cl - > delta_sequence = = - 1 )
{
unsigned int e ;
if ( cl - > pendingdeltabits )
cl - > pendingdeltabits [ 0 ] = UF_REMOVE ;
if ( host_client - > pendingcsqcbits )
for ( e = 1 ; e < host_client - > max_net_ents ; e + + )
if ( host_client - > pendingcsqcbits [ e ] & SENDFLAGS_PRESENT )
host_client - > pendingcsqcbits [ e ] | = SENDFLAGS_USABLE ;
}
2013-03-12 22:35:33 +00:00
SV_AckEntityFrame ( cl , cl - > delta_sequence ) ;
2017-12-15 06:56:40 +00:00
// if (cl->frameunion.frames[cl->delta_sequence&UPDATE_MASK].sequence == cl->delta_sequence)
// if (cl->frameunion.frames[cl->delta_sequence&UPDATE_MASK].ping_time < 0)
// cl->frameunion.frames[cl->delta_sequence&UPDATE_MASK].ping_time = realtime - cl->frameunion.frames[cl->delta_sequence&UPDATE_MASK].senttime;
2008-11-09 22:29:28 +00:00
break ;
2007-06-10 21:33:24 +00:00
case clcdp_ackdownloaddata :
2011-10-27 16:16:29 +00:00
SV_DarkPlacesDownloadAck ( cl ) ;
2007-06-10 21:33:24 +00:00
break ;
2011-05-20 04:10:46 +00:00
2011-09-05 01:48:23 +00:00
# ifdef VOICECHAT
2015-04-14 23:12:17 +00:00
case clcfte_voicechat :
2011-05-20 04:10:46 +00:00
SV_VoiceReadPacket ( ) ;
break ;
# endif
2021-08-04 21:16:57 +00:00
2022-01-08 10:01:15 +00:00
case clc_delta : //clcqex_sequence:
host_client - > last_sequence = MSG_ReadULEB128 ( ) ;
break ;
case clc_tmove : //clcqex_auth
//This allows for the client's positions to be slightly wrong, with the client being authoritive instead of the server (within tolerances anyway).
host_client - > last_sequence = MSG_ReadULEB128 ( ) ;
/*host_client->edict->v->origin[0] =*/ MSG_ReadFloat ( ) ;
/*host_client->edict->v->origin[1] =*/ MSG_ReadFloat ( ) ;
/*host_client->edict->v->origin[2] =*/ MSG_ReadFloat ( ) ;
break ;
2021-08-04 21:16:57 +00:00
safedefault :
Con_Printf ( " SVNQ_ReadClientMessage: unknown command char %i \n " , c ) ;
SV_DropClient ( cl ) ;
return ;
2004-08-23 00:15:46 +00:00
}
}
}
# endif
/*
= = = = = = = = = = = = = =
SV_UserInit
= = = = = = = = = = = = = =
*/
void SV_UserInit ( void )
2005-07-03 15:16:20 +00:00
{
2010-11-15 03:37:29 +00:00
# ifdef VOICECHAT
Cvar_Register ( & sv_voip , cvargroup_serverpermissions ) ;
2010-11-16 02:03:47 +00:00
Cvar_Register ( & sv_voip_echo , cvargroup_serverpermissions ) ;
2010-12-18 17:02:47 +00:00
Cvar_Register ( & sv_voip_record , cvargroup_serverpermissions ) ;
2010-11-15 03:37:29 +00:00
# endif
2004-08-23 00:15:46 +00:00
# ifdef SERVERONLY
Cvar_Register ( & cl_rollspeed , " Prediction stuff " ) ;
Cvar_Register ( & cl_rollangle , " Prediction stuff " ) ;
# endif
Cvar_Register ( & sv_chatfilter , cvargroup_serverpermissions ) ;
Cvar_Register ( & sv_spectalk , cvargroup_servercontrol ) ;
Cvar_Register ( & sv_mapcheck , cvargroup_servercontrol ) ;
2015-10-11 11:34:58 +00:00
Cvar_Register ( & sv_minpitch , cvargroup_servercontrol ) ;
Cvar_Register ( & sv_maxpitch , cvargroup_servercontrol ) ;
2011-09-06 20:53:38 +00:00
Cvar_Register ( & sv_fullredirect , cvargroup_servercontrol ) ;
2009-11-04 21:16:50 +00:00
Cvar_Register ( & sv_antilag , cvargroup_servercontrol ) ;
2009-11-13 16:54:21 +00:00
Cvar_Register ( & sv_antilag_frac , cvargroup_servercontrol ) ;
2015-01-21 18:18:37 +00:00
# ifndef NEWSPEEDCHEATPROT
2004-08-23 00:15:46 +00:00
Cvar_Register ( & sv_cheatpc , cvargroup_servercontrol ) ;
Cvar_Register ( & sv_cheatspeedchecktime , cvargroup_servercontrol ) ;
2015-01-21 18:18:37 +00:00
# endif
2021-04-14 05:21:04 +00:00
Cvar_Register ( & sv_showpredloss , cvargroup_servercontrol ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & sv_playermodelchecks , cvargroup_servercontrol ) ;
2008-05-25 22:23:43 +00:00
Cvar_Register ( & sv_getrealip , cvargroup_servercontrol ) ;
2008-05-27 18:59:07 +00:00
Cvar_Register ( & sv_realip_kick , cvargroup_servercontrol ) ;
2008-05-25 22:23:43 +00:00
Cvar_Register ( & sv_realiphostname_ipv4 , cvargroup_servercontrol ) ;
Cvar_Register ( & sv_realiphostname_ipv6 , cvargroup_servercontrol ) ;
Cvar_Register ( & sv_realip_timeout , cvargroup_servercontrol ) ;
2018-07-05 16:21:44 +00:00
Cvar_Register ( & sv_userinfo_keylimit , cvargroup_servercontrol ) ;
Cvar_Register ( & sv_userinfo_bytelimit , cvargroup_servercontrol ) ;
2005-07-05 23:46:10 +00:00
Cvar_Register ( & sv_pushplayers , cvargroup_servercontrol ) ;
2012-09-30 05:52:03 +00:00
Cvar_Register ( & sv_protocol_nq , cvargroup_servercontrol ) ;
2005-07-05 23:46:10 +00:00
2011-10-27 16:16:29 +00:00
Cvar_Register ( & sv_pure , cvargroup_servercontrol ) ;
2006-05-29 05:35:07 +00:00
Cvar_Register ( & sv_floodprotect , cvargroup_servercontrol ) ;
2006-05-29 06:12:12 +00:00
Cvar_Register ( & sv_floodprotect_interval , cvargroup_servercontrol ) ;
Cvar_Register ( & sv_floodprotect_messages , cvargroup_servercontrol ) ;
Cvar_Register ( & sv_floodprotect_silencetime , cvargroup_servercontrol ) ;
2006-05-30 04:00:24 +00:00
Cvar_Register ( & sv_floodprotect_suicide , cvargroup_servercontrol ) ;
Cvar_Register ( & sv_floodprotect_sendmessage , cvargroup_servercontrol ) ;
2006-05-29 05:35:07 +00:00
2004-08-23 00:15:46 +00:00
Cvar_Register ( & sv_cmdlikercon , cvargroup_serverpermissions ) ;
2005-03-12 23:40:42 +00:00
Cvar_Register ( & cmd_gamecodelevel , " Access controls " ) ;
Cvar_Register ( & cmd_allowaccess , " Access controls " ) ;
2004-08-23 00:15:46 +00:00
Cvar_Register ( & votelevel , sv_votinggroup ) ;
Cvar_Register ( & voteminimum , sv_votinggroup ) ;
Cvar_Register ( & votepercent , sv_votinggroup ) ;
Cvar_Register ( & votetime , sv_votinggroup ) ;
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2005-10-30 23:54:29 +00:00
Cvar_Register ( & sv_brokenmovetypes , " Backwards compatability " ) ;
2019-08-01 02:13:44 +00:00
Cvar_Register ( & pext_ezquake_nochunks , cvargroup_servercontrol ) ;
Cvar_Register ( & pext_ezquake_verfortrans , cvargroup_servercontrol ) ;
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
# endif
2004-08-23 00:15:46 +00:00
}
static vec3_t forward , right , up , wishdir ;
2020-06-27 19:32:49 +00:00
static pvec_t * origin , * velocity , * angles ;
2004-08-23 00:15:46 +00:00
extern cvar_t sv_accelerate , sv_friction ;
static qboolean onground ;
/*
= = = = = = = = = = = = = = = = = =
SV_UserFriction
= = = = = = = = = = = = = = = = = =
*/
2010-11-15 02:40:31 +00:00
static void SV_UserFriction ( void )
2004-08-23 00:15:46 +00:00
{
extern cvar_t sv_stopspeed ;
float * vel ;
float speed , newspeed , control ;
vec3_t start , stop ;
float friction ;
trace_t trace ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
vel = velocity ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
speed = sqrt ( vel [ 0 ] * vel [ 0 ] + vel [ 1 ] * vel [ 1 ] ) ;
if ( ! speed )
return ;
// if the leading edge is over a dropoff, increase friction
start [ 0 ] = stop [ 0 ] = origin [ 0 ] + vel [ 0 ] / speed * 16 ;
start [ 1 ] = stop [ 1 ] = origin [ 1 ] + vel [ 1 ] / speed * 16 ;
2005-03-28 00:11:59 +00:00
start [ 2 ] = origin [ 2 ] + sv_player - > v - > mins [ 2 ] ;
2004-08-23 00:15:46 +00:00
stop [ 2 ] = start [ 2 ] - 34 ;
2009-11-04 21:16:50 +00:00
trace = World_Move ( & sv . world , start , vec3_origin , vec3_origin , stop , true , ( wedict_t * ) sv_player ) ;
2004-08-23 00:15:46 +00:00
if ( trace . fraction = = 1.0 )
2019-03-03 06:13:38 +00:00
friction = sv_friction . value * ( * pm_edgefriction . string ? pm_edgefriction . value : 2 ) ;
2004-08-23 00:15:46 +00:00
else
friction = sv_friction . value ;
// val = GetEdictFieldValue(sv_player, "friction", &frictioncache);
// if (val && val->_float)
// friction *= val->_float;
2005-07-03 15:16:20 +00:00
// apply friction
2004-08-23 00:15:46 +00:00
control = speed < sv_stopspeed . value ? sv_stopspeed . value : speed ;
newspeed = speed - host_frametime * control * friction ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
if ( newspeed < 0 )
newspeed = 0 ;
newspeed / = speed ;
vel [ 0 ] = vel [ 0 ] * newspeed ;
vel [ 1 ] = vel [ 1 ] * newspeed ;
vel [ 2 ] = vel [ 2 ] * newspeed ;
}
2020-06-27 19:32:49 +00:00
static void SV_Accelerate ( float wishspeed )
2004-08-23 00:15:46 +00:00
{
int i ;
float addspeed , accelspeed , currentspeed ;
currentspeed = DotProduct ( velocity , wishdir ) ;
addspeed = wishspeed - currentspeed ;
if ( addspeed < = 0 )
return ;
accelspeed = sv_accelerate . value * host_frametime * wishspeed ;
if ( accelspeed > addspeed )
accelspeed = addspeed ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
2005-07-03 15:16:20 +00:00
velocity [ i ] + = accelspeed * wishdir [ i ] ;
2004-08-23 00:15:46 +00:00
}
2020-06-27 19:32:49 +00:00
static void SV_AirAccelerate ( vec3_t wishveloc , float wishspeed )
2004-08-23 00:15:46 +00:00
{
int i ;
float addspeed , wishspd , accelspeed , currentspeed ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
wishspd = VectorNormalize ( wishveloc ) ;
if ( wishspd > 30 )
wishspd = 30 ;
currentspeed = DotProduct ( velocity , wishveloc ) ;
addspeed = wishspd - currentspeed ;
if ( addspeed < = 0 )
return ;
// accelspeed = sv_accelerate.value * host_frametime;
accelspeed = sv_accelerate . value * wishspeed * host_frametime ;
if ( accelspeed > addspeed )
accelspeed = addspeed ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
2005-07-03 15:16:20 +00:00
velocity [ i ] + = accelspeed * wishveloc [ i ] ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = = = = = = = = = =
SV_AirMove
= = = = = = = = = = = = = = = = = = =
*/
2010-11-15 02:40:31 +00:00
static void SV_AirMove ( void )
2004-08-23 00:15:46 +00:00
{
int i ;
vec3_t wishvel ;
float fmove , smove ;
float scale , maxspeed ;
2020-06-27 19:32:49 +00:00
float wishspeed ;
2004-08-23 00:15:46 +00:00
2005-03-28 00:11:59 +00:00
AngleVectors ( sv_player - > v - > angles , forward , right , up ) ;
2004-08-23 00:15:46 +00:00
fmove = cmd . forwardmove ;
smove = cmd . sidemove ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
// hack to not let you back into teleporter
2005-03-28 00:11:59 +00:00
if ( sv . time < sv_player - > v - > teleport_time & & fmove < 0 )
2004-08-23 00:15:46 +00:00
fmove = 0 ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
wishvel [ i ] = forward [ i ] * fmove + right [ i ] * smove ;
2005-03-28 00:11:59 +00:00
if ( ( int ) sv_player - > v - > movetype ! = MOVETYPE_WALK )
2004-08-23 00:15:46 +00:00
wishvel [ 2 ] = cmd . upmove ;
else
wishvel [ 2 ] = 0 ;
VectorCopy ( wishvel , wishdir ) ;
wishspeed = VectorNormalize ( wishdir ) ;
// val = GetEdictFieldValue(sv_player, "scale", &scalecache);
// if (!val || !val->_float)
scale = 1 ;
// else
// scale = val->_float;
2007-10-05 18:08:47 +00:00
maxspeed = sv_player - > xv - > maxspeed ; //FIXME: This isn't fully compatible code...
2016-07-12 00:40:13 +00:00
# ifdef HEXEN2
2007-09-02 19:55:17 +00:00
if ( sv_player - > xv - > hasted )
maxspeed * = sv_player - > xv - > hasted ;
2016-07-12 00:40:13 +00:00
# endif
2004-08-23 00:15:46 +00:00
if ( wishspeed > maxspeed * scale )
{
VectorScale ( wishvel , maxspeed / wishspeed , wishvel ) ;
wishspeed = maxspeed * scale ;
}
2005-07-03 15:16:20 +00:00
2005-03-28 00:11:59 +00:00
if ( sv_player - > v - > movetype = = MOVETYPE_NOCLIP )
2004-08-23 00:15:46 +00:00
{ // noclip
VectorCopy ( wishvel , velocity ) ;
}
else if ( onground )
{
SV_UserFriction ( ) ;
2020-06-27 19:32:49 +00:00
SV_Accelerate ( wishspeed ) ;
2004-08-23 00:15:46 +00:00
}
else
{ // not on ground, so little effect on velocity
2020-06-27 19:32:49 +00:00
SV_AirAccelerate ( wishvel , wishspeed ) ;
2005-07-03 15:16:20 +00:00
}
2004-08-23 00:15:46 +00:00
}
2010-11-15 02:40:31 +00:00
static void SV_WaterMove ( void )
2004-08-23 00:15:46 +00:00
{
int i ;
vec3_t wishvel ;
float speed , newspeed , wishspeed , addspeed , accelspeed ;
float scale ;
float maxspeed ;
//
// user intentions
//
2005-03-28 00:11:59 +00:00
AngleVectors ( sv_player - > v - > v_angle , forward , right , up ) ;
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < 3 ; i + + )
wishvel [ i ] = forward [ i ] * cmd . forwardmove + right [ i ] * cmd . sidemove ;
if ( ! cmd . forwardmove & & ! cmd . sidemove & & ! cmd . upmove )
wishvel [ 2 ] - = 60 ; // drift towards bottom
else
wishvel [ 2 ] + = cmd . upmove ;
wishspeed = Length ( wishvel ) ;
// val = GetEdictFieldValue(sv_player, "scale", &scalecache);
// if (!val || !val->_float)
scale = 1 ;
// else
// scale = val->_float;
// val = GetEdictFieldValue(sv_player, "maxspeed", &maxspeedcache);
// if (val && val->_float)
// maxspeed = sv_maxspeed.value*val->_float;
// else
maxspeed = host_client - > maxspeed ;
if ( wishspeed > maxspeed * scale )
{
VectorScale ( wishvel , maxspeed / wishspeed , wishvel ) ;
wishspeed = maxspeed * scale ;
}
wishspeed * = 0.7 ;
//
// water friction
//
speed = Length ( velocity ) ;
if ( speed )
{
// val = GetEdictFieldValue(sv_player, "friction", &frictioncache);
// if (val&&val->_float)
// newspeed = speed - host_frametime * speed * sv_friction.value*val->_float;
// else
newspeed = speed - host_frametime * speed * sv_friction . value ;
if ( newspeed < 0 )
2005-07-03 15:16:20 +00:00
newspeed = 0 ;
2004-08-23 00:15:46 +00:00
VectorScale ( velocity , newspeed / speed , velocity ) ;
}
else
newspeed = 0 ;
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
//
// water acceleration
//
if ( ! wishspeed )
return ;
addspeed = wishspeed - newspeed ;
if ( addspeed < = 0 )
return ;
VectorNormalize ( wishvel ) ;
accelspeed = sv_accelerate . value * wishspeed * host_frametime ;
if ( accelspeed > addspeed )
accelspeed = addspeed ;
for ( i = 0 ; i < 3 ; i + + )
velocity [ i ] + = accelspeed * wishvel [ i ] ;
}
2019-09-17 19:49:39 +00:00
static void SV_LadderMove ( void )
{
int i ;
vec3_t wishvel ;
float speed , newspeed , wishspeed , addspeed , accelspeed ;
float scale ;
float maxspeed ;
//
// user intentions
//
AngleVectors ( sv_player - > v - > v_angle , forward , right , up ) ;
for ( i = 0 ; i < 3 ; i + + )
wishvel [ i ] = forward [ i ] * cmd . forwardmove + right [ i ] * cmd . sidemove ;
wishvel [ 2 ] + = cmd . upmove ;
wishspeed = Length ( wishvel ) ;
// val = GetEdictFieldValue(sv_player, "scale", &scalecache);
// if (!val || !val->_float)
scale = 1 ;
// else
// scale = val->_float;
// val = GetEdictFieldValue(sv_player, "maxspeed", &maxspeedcache);
// if (val && val->_float)
// maxspeed = sv_maxspeed.value*val->_float;
// else
maxspeed = host_client - > maxspeed ;
if ( wishspeed > maxspeed * scale )
{
VectorScale ( wishvel , maxspeed / wishspeed , wishvel ) ;
wishspeed = maxspeed * scale ;
}
wishspeed * = 0.7 ;
//
// water friction
//
speed = Length ( velocity ) ;
if ( speed )
{
// val = GetEdictFieldValue(sv_player, "friction", &frictioncache);
// if (val&&val->_float)
// newspeed = speed - host_frametime * speed * sv_friction.value*val->_float;
// else
newspeed = speed - host_frametime * speed * sv_friction . value ;
if ( newspeed < 0 )
newspeed = 0 ;
VectorScale ( velocity , newspeed / speed , velocity ) ;
}
else
newspeed = 0 ;
//
// water acceleration
//
if ( ! wishspeed )
return ;
addspeed = wishspeed - newspeed ;
if ( addspeed < = 0 )
return ;
VectorNormalize ( wishvel ) ;
accelspeed = sv_accelerate . value * wishspeed * host_frametime ;
if ( accelspeed > addspeed )
accelspeed = addspeed ;
for ( i = 0 ; i < 3 ; i + + )
velocity [ i ] + = accelspeed * wishvel [ i ] ;
}
2010-11-15 02:40:31 +00:00
static void SV_WaterJump ( void )
2004-08-23 00:15:46 +00:00
{
2005-03-28 00:11:59 +00:00
if ( sv . time > sv_player - > v - > teleport_time
| | ! sv_player - > v - > waterlevel )
2004-08-23 00:15:46 +00:00
{
2005-03-28 00:11:59 +00:00
sv_player - > v - > flags = ( int ) sv_player - > v - > flags & ~ FL_WATERJUMP ;
sv_player - > v - > teleport_time = 0 ;
2004-08-23 00:15:46 +00:00
}
2005-03-28 00:11:59 +00:00
sv_player - > v - > velocity [ 0 ] = sv_player - > v - > movedir [ 0 ] ;
sv_player - > v - > velocity [ 1 ] = sv_player - > v - > movedir [ 1 ] ;
2004-08-23 00:15:46 +00:00
}
void SV_ClientThink ( void )
{
2017-02-21 20:22:07 +00:00
int i ;
2004-08-23 00:15:46 +00:00
vec3_t v_angle ;
2004-09-22 15:29:33 +00:00
cmd = host_client - > lastcmd ;
sv_player = host_client - > edict ;
2007-10-08 12:23:55 +00:00
if ( host_client - > state & & host_client - > protocol ! = SCP_BAD )
{
sv_player - > xv - > movement [ 0 ] = cmd . forwardmove ;
sv_player - > xv - > movement [ 1 ] = cmd . sidemove ;
sv_player - > xv - > movement [ 2 ] = cmd . upmove ;
2021-08-04 21:18:20 +00:00
if ( ! sv_player - > v - > fixangle )
{
sv_player - > v - > v_angle [ 0 ] = SHORT2ANGLE ( cmd . angles [ 0 ] ) ;
sv_player - > v - > v_angle [ 1 ] = SHORT2ANGLE ( cmd . angles [ 1 ] ) ;
sv_player - > v - > v_angle [ 2 ] = SHORT2ANGLE ( cmd . angles [ 2 ] ) ;
}
2007-10-08 12:23:55 +00:00
}
2004-08-23 00:15:46 +00:00
2021-07-06 00:12:12 +00:00
SV_SetSSQCInputs ( & cmd ) ;
2010-02-06 01:25:04 +00:00
if ( SV_PlayerPhysicsQC & & ! host_client - > spectator )
2004-08-23 00:15:46 +00:00
{
2009-11-04 21:16:50 +00:00
pr_global_struct - > time = sv . world . physicstime ;
2004-08-23 00:15:46 +00:00
pr_global_struct - > self = EDICT_TO_PROG ( svprogfuncs , sv_player ) ;
PR_ExecuteProgram ( svprogfuncs , SV_PlayerPhysicsQC ) ;
return ;
}
2004-09-07 23:12:46 +00:00
2005-03-28 00:11:59 +00:00
if ( sv_player - > v - > movetype = = MOVETYPE_NONE )
2004-08-23 00:15:46 +00:00
return ;
2005-07-03 15:16:20 +00:00
2005-03-28 00:11:59 +00:00
onground = ( int ) sv_player - > v - > flags & FL_ONGROUND ;
2004-08-23 00:15:46 +00:00
2005-03-28 00:11:59 +00:00
origin = sv_player - > v - > origin ;
velocity = sv_player - > v - > velocity ;
2004-08-23 00:15:46 +00:00
// DropPunchAngle ();
2017-02-21 20:22:07 +00:00
for ( i = 0 ; i < 3 ; i + + )
{
if ( sv_player - > xv - > punchangle [ i ] < 0 )
{
sv_player - > xv - > punchangle [ i ] + = 10 * host_frametime ;
if ( sv_player - > xv - > punchangle [ i ] > 0 )
sv_player - > xv - > punchangle [ i ] = 0 ;
}
if ( sv_player - > xv - > punchangle [ i ] > 0 )
{
sv_player - > xv - > punchangle [ i ] - = 10 * host_frametime ;
if ( sv_player - > xv - > punchangle [ i ] < 0 )
sv_player - > xv - > punchangle [ i ] = 0 ;
}
}
2005-07-03 15:16:20 +00:00
2004-08-23 00:15:46 +00:00
//
// if dead, behave differently
//
2018-01-03 04:40:06 +00:00
if ( sv_player - > v - > health < = 0 & & ! host_client - > spectator )
2004-08-23 00:15:46 +00:00
return ;
//
// angles
// show 1/3 the pitch angle and all the roll angle
2005-03-28 00:11:59 +00:00
angles = sv_player - > v - > angles ;
2005-07-03 15:16:20 +00:00
2005-03-28 00:11:59 +00:00
VectorCopy ( sv_player - > v - > v_angle , v_angle ) ;
// VectorAdd (sv_player->v->v_angle, sv_player->v->punchangle, v_angle);
2013-12-29 22:48:28 +00:00
//FIXME: gravitydir stuff, the roll value gets destroyed for intents
2020-06-27 19:32:49 +00:00
angles [ ROLL ] = V_CalcRoll ( angles , velocity ) * 4 ;
2005-03-28 00:11:59 +00:00
if ( ! sv_player - > v - > fixangle )
2004-08-23 00:15:46 +00:00
{
angles [ PITCH ] = - v_angle [ PITCH ] / 3 ;
angles [ YAW ] = v_angle [ YAW ] ;
}
2005-03-28 00:11:59 +00:00
if ( ( int ) sv_player - > v - > flags & FL_WATERJUMP )
2004-08-23 00:15:46 +00:00
{
SV_WaterJump ( ) ;
return ;
}
//
// walk
//
2019-09-17 19:49:39 +00:00
if ( ( sv_player - > v - > waterlevel > = 2 ) & & ( sv_player - > v - > movetype ! = MOVETYPE_NOCLIP ) )
2004-08-23 00:15:46 +00:00
SV_WaterMove ( ) ;
2019-09-17 19:49:39 +00:00
else if ( ( ( int ) sv_player - > xv - > pmove_flags & PMF_LADDER ) & & ( sv_player - > v - > movetype ! = MOVETYPE_NOCLIP ) )
SV_LadderMove ( ) ;
else
SV_AirMove ( ) ;
2004-08-23 00:15:46 +00:00
}
2004-11-29 01:21:00 +00:00
# endif