Commit Graph

49 Commits

Author SHA1 Message Date
temx 239ec66233 Only send baseline/static scales when using PROTOCOL_RMQ 2022-09-05 23:56:30 +03:00
temx 6bff9566a5 Make sure scales are initialized to ENTSCALE_DEFAULT 2022-09-05 23:56:30 +03:00
Ozkan Sezer 947c782f64 Un-revert the model scale patch.
See https://github.com/sezero/quakespasm/pull/32 for the followup discussions,
and https://github.com/sezero/quakespasm/pull/36 for the followup patches.
2022-09-05 23:56:20 +03:00
Ozkan Sezer e4e914c8a6 reverted the model scale patch :
see https://github.com/sezero/quakespasm/pull/32 for the issues
associated with it.
2022-08-11 01:32:00 +03:00
JosiahJack 6ebf6f097a Add support for model scale 2022-08-08 08:55:00 +03:00
Andrei Drexler fe15bc1ddd Server: fix protocol size checks for sounds and particles
6643f532bd
2022-06-25 20:56:10 +03:00
Ozkan Sezer c0cfba160d implemented PF_localsound && svc_localsound for 2021 re-release. 2022-04-22 18:11:20 +03:00
Ozkan Sezer f86f1595f3 minor error messages / whitespace tidy-up & small stuff. 2022-04-22 17:50:02 +03:00
Ozkan Sezer ddd1caebf5 SV_SendServerinfo: fixed off-by-one nummodels/numsounds for protocol 15 2022-04-22 11:41:20 +03:00
Andrei Drexler 065c158254 Quad/pentagram dlights for 2021 rerelease 2022-03-11 23:55:10 +03:00
temx 6cf0547d01 Fix SZ_GetSpace server crashes
See https://github.com/Novum/vkQuake/pull/438.  Also see
    https://github.com/andrei-drexler/ironwail/issues/32

Note: Changing that 24 to 39 does prevent the crash, but
the buffer size is still insufficient, so some entities
(e.g. nails) are missing occasionally. A MAX_DATAGRAM of
48000 seems enough to fix that (MAX_DATAGRAM in ironwail
has been bumped to 64000.) Long term though, it would be
much better to add support for pkt fragmentation like in
QSS since this jumbo packet size is only used in single-
player mode - multiplayer uses the much smaller value of
DATAGRAM_MTU (just 1400 bytes.)
2022-03-11 23:55:10 +03:00
Ozkan Sezer 824f01031e silence misleading indentation warnings from clang. 2021-06-28 03:01:02 +03:00
Stephen Kitt 9bd1cc8d1d Spelling fixes 2020-12-22 12:05:37 +00:00
Ozkan Sezer c671916fc7 sv_main.c (SV_Init): use a return instead of a dummy assignment after Sys_Error to silence compiler
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1442 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:00:56 +00:00
Eric Wasylishen e87a1b8d9d drop MAX_MAP_LEAFS limit and move 4 static buffers to use realloc().
4 buffers were: mod_novis, decompressed, checkpvs, and fatpvs.

Also fix fatbytes calculation in SV_FatPVS to match the other PVS
buffers, was (numleafs+31)>>3, changed to (numleafs+7)>>3.
I am assuming the previous was a bug/typo.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1434 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-26 04:27:16 +00:00
Eric Wasylishen 4fe5f6956f Adjust "exceeds standard limit of" debug warnings to include the actual QS limit.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1386 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-03-30 06:26:16 +00:00
Ozkan Sezer 9c7eb2c6ff Host_Loadgame_f(): no need for entnum >= sv.max_edicts check
because EDICT_NUM() does it already. also move ent->free=false
statement to partial zero-fill case.
Host_ClearMemory(): remove check before free(sv.edicts)
SV_Init(): initialize sv.edicts to NULL (just paranoia)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1319 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-06-25 05:21:22 +00:00
Eric Wasylishen 3261dd1213 add -protocol [15/666/999] command line flag, patch from szo
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1314 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-06-24 06:15:47 +00:00
Eric Wasylishen 5b21d5935f RMQ protocol (999) support, adapted from RMQEngine
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1313 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-06-24 06:15:41 +00:00
Eric Wasylishen ae8a4f82da SV_SpawnServer: use malloc for sv.edicts, and only zero it as needed
Previously we were Hunk_Alloc'ing space for 8192 edicts (by default) which zeros all of that memory, this way we only use as much RAM as needed since the unuesd pages aren't dirtied

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1286 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-29 01:05:11 +00:00
Eric Wasylishen 1f3c1a711a Make "exceeds standard limit of" messages only display when developer cvar is set, with a new Con_DWarning function.
Have heard these are confusing players and mappers/modders; people assume there is an error or a limit in QS is exceeded, but the messages are only about exceeding the limits in vanilla WinQuake/GLQuake.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1211 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-25 01:48:03 +00:00
Eric Wasylishen 26c1b63c00 sv_main: Second part of fixing the MAX_ENT_LEAFS issue (after bumping MAX_ENT_LEAFS to 32 in r967).
If an entity is visilbe from MAX_ENT_LEAFS (32) or more leafs, don't try to vis-cull it, just send it to the client.
This should completely eliminate any flickering entities, no matter how many leafs they're visible from.

This could potentially increase packet sizes a bit.. but ent->num_leafs == 32 never happens in id1 epsiode 1, so it will not cause any increase on those maps.
hip1m1 has one entity (a rotator) that is caught by this change and will be always sent.

see e.g.
http://forums.inside3d.com/viewtopic.php?f=1&t=5554
http://www.celephais.net/board/view_thread.php?id=60452&start=1235

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1069 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-28 19:02:27 +00:00
Ozkan Sezer b9032b7815 copyright years, general tidy-up, remove unused d_ifacea.h.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1059 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-22 08:55:46 +00:00
Ozkan Sezer 1f6e608267 pr_cmds.c, pr_exec.c, pr_edict.c, sv_main.c: Changed several Sys_Error()
calls to Host_Error(). ED_PrintEdict_f(),ED_PrintEdicts() and ED_Count()
require an active server to print any infos. ED_PrintEdict_f cannot work
with a negative argument.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@788 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-15 17:30:43 +00:00
Ozkan Sezer dbdd675552 renamed model_t to qmodel_t in order to avoid conflicts on solaris.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@676 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-05-30 08:56:06 +00:00
Ozkan Sezer d9711fdfa2 Limited the struct qsocket_s details only to net_*.c sources :
For menu serverlist handling, added new procedures NET_SlistSort,
NET_SlistPrintServer and NET_SlistPrintServerName. Added new
procedure NET_QSocketGetTime for status and spawn commands' print
functionality in host_cmd.c. Added new NET_QSocketGetAddressString
procedure for status and connect commands' print functionality in
host_cmd.c and sv_main.c.  Patch ported over from uhexen2.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@657 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-04-18 20:33:12 +00:00
Ozkan Sezer eb09523d00 changed some of the Cvar_Set[Value] calls to their *Quick variants in the
source files where the vars are defined.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@576 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 21:21:11 +00:00
Ozkan Sezer 1928f2e1b8 * first shot at cvar flag system and cvar layer clean-ups :
- removed the archive and server members of cvar_t structure
  which are now represented by the CVAR_ARCHIVE, CVAR_NOTIFY
  and CVAR_SERVERINFO flags.
- added new Cvar_SetROM and Cvar_SetValueROM functions to 
  set vars marked as CVAR_ROM (read-only vars) programaticaly
- added Cvar_SetCallback() as a new function to assign (or
  remove) a callback function to a cvar.
- changed Cvar_RegisterVariable() to only accept a var pointer
  as in original quake
- moved notification handling from Cvar_Set() to callbacks.
- changed Cvar_Set() so that it doesn't reallocate the var's
  string buffer if nothing is changed, nor does it run the
  var's callback.
- changed the 'registered' and 'cmdline' cvars to be read-only
  so that the users can't change it using the console.  (and
  with 'registered' flagged as CVAR_ROM, the 'static_registered'
  thing is no longer required)
- added comment that sending cmdline upon CCREQ_RULE_INFO is
  evil...
- more to follow later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@566 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:01:33 +00:00
Ozkan Sezer fb2f45126e changed many strcpy and strncpy into q_strlcpy
and strcat and strncat into q_strlcat

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@560 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 13:15:31 +00:00
Ozkan Sezer 983af887bf changed many sprintf() calls into q_snprintf().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@557 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 10:50:42 +00:00
Ozkan Sezer 5b9d317733 sv_main.c: changed a (cls.state != ca_dedicated) condition into (!isDedicated)
so that a server file doesn't use "cls"

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@527 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 09:55:18 +00:00
Ozkan Sezer 1363a0cced removed privileged member from the client structure
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@506 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 09:50:23 +00:00
Ozkan Sezer 09110d97b5 * Removed some useless memset calls onto newly hunk allocated memory.
Hunk_Alloc() already clears the memory before returning it.
* Some minor cleanups.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@465 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-07-05 06:28:42 +00:00
Ozkan Sezer f340ea2687 Increased localmodels array size to 8 (better alignment)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@464 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-28 11:33:23 +00:00
Steven 44ecfb19bb Trial a new Freeze cvar.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@457 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-10 03:04:51 +00:00
Ozkan Sezer 945262b863 min/max macros: renamed them to q_min and q_max, moved them common.h.
removed the inline versions which only handled integers.  moved CLAMP
macro to common.h.  Adjusted all places for the renamed macros.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@386 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 10:35:40 +00:00
Ozkan Sezer 1dfaee5d49 * sv_main.c (SV_WriteEntitiesToClient): the protocol check must be against
sv.protocol, not sv_protocol.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@347 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-11-23 06:48:02 +00:00
Ozkan Sezer 906df3f650 const correctness changes.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@300 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 02:22:55 +00:00
Ozkan Sezer 3a6e17e627 added q_stdinc.h, adapted from uhexen2, to tidy up several includes and
macros in one place.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@277 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-14 20:55:39 +00:00
Ozkan Sezer dd05f2d23b * host_cmd.c, menu.c, sv_main.c: Include net_sys.h (for net_defs.h).
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@216 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:50:21 +00:00
Ozkan Sezer febb164f0f * net.h: separated the functions and data exported through net.h into two:
net.h now holds all public exports and the new net_defs.h holds the exports
only required by the net layer. besides the net_* files, host_cmd.c and
sv_main.c are the only reasonable foreign importers of net_defs.h: they
require accessing the qsocket_s structure members. The only one that does
not fit is menu.c needing some net exports, but it may be properly handled,
later on.
* net_defs.h: New header.
* host_cmd.c: Include net_defs.h.
* menu.c: Likewise.
* net_bsd.c: Likewise.
* net_dgrm.c: Likewise.
* net_loop.c: Likewise.
* net_main.c: Likewise.
* net_sdl.c: Likewise.
* net_sdlnet.c: Likewise.
* net_udp.c: Likewise.
* net_win.c: Likewise.
* net_wins.c: Likewise.
* net_wipx.c: Likewise.
* sv_main.c: Likewise.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@204 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 17:21:10 +00:00
Ozkan Sezer a32d9f11bc * net_main.c: Fix NET_SendToAll() so that it really skips non-connected
clients. While we're at it, change the type of the blocktime argument
to double (the comparison is against a double.) Rename the cryptic
state1 and state2 variables to something more indicative of thei
purpose, ie. msg_init and msg_sent. from uhexen2.
* net.h, host.c, sv_main.c: Adjust for the NET_SendToAll() argument type
change.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@200 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 15:00:57 +00:00
Ozkan Sezer c24d592580 host_cmd.c, console.c, gl_draw.c, image.c, gl_model.c, r_sprite.c, cl_parse.c,
gl_warp.c, host.c, gl_mesh.c, gl_sky.c, gl_texmgr.c, cvar.c, sv_main.c, cvar.h,
gl_screen.c, r_brush.c, gl_vidsdl.c, zone.c, cl_main.c, cmd.c, snd_dma.c,
snd_mem.c, common.c, sv_phys.c: Added explicit casts to eliminate -Wc++-compat
warnings.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@170 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 07:42:36 +00:00
Ozkan Sezer 32335fa57b sv_main.c (localmodels): Bumped array size from 5 to 6 in order for it
to operate correctly with the raised limits of fitzquake-0.85.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@118 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-23 06:24:51 +00:00
Ozkan Sezer d1f28ddb43 sv_main.c (SV_SpawnServer): made the dummy array 8 bytes long.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@110 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-03-09 14:15:34 +00:00
Ozkan Sezer 088fb98279 Don't explicitly expose pr_strings to the whole engine, make it static
to pr_edict.c. Assign a static array of zeroes to sv.model_precache[0]
and sv.sound_precache[0], instead of pr_strings, in sv_main.c.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@109 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-03-09 14:11:10 +00:00
Ozkan Sezer 89e17301c9 64 bit compatibility effort, 4/nn: x86_64 works just fine now, yey!
the QuakeC interpreter used to use string pointer offsets from pr_strings
even when the pointers lead to engine data which is often well out of
32bit range on a 64bit architecture and they lead to crashes.  they now
go through the new PR_SetEngineString and PR_GetString functions which
turn any address outside the pr_strings area into an index into a table
of engine string addresses, adding new string addresses to the table as
needed. the engine strings table is allocated with 256 entries at first
(see the PR_STRING_ALLOCSLOTS definition in pr_edict.c) and its size is
incremented by 256 as needed and re-allocated on the zone. managing that
allocation and reallocation is accomplished by the recently added Z_Realloc
function. implementation based on the uhexen2 (hexen2: hammer of thyrion)
engine which, in turn, is loosely based on twilight and quakeforge engines.
pr_strings range check is from tyrquake.
pr_edict.c: added the new PR_SetEngineString, PR_GetString, PR_AllocString
public functions and the new private PR_AllocStringSlots function. made
ED_NewString private to pr_edict.c and reworked it to return an index to a
newly allocated string.
progs.h: added prototypes for the new public PR_SetEngineString, PR_GetString
and PR_AllocString functions.
host_cmd.c, pr_cmds.c, pr_edict.c, pr_exec.c, progs.h, sv_main.c, sv_phys.c:
modifed to use the new PR_SetEngineString and PR_GetString functions.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@38 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-17 15:04:50 +00:00
Ozkan Sezer 68fc38c3a6 chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h:  Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
Ozkan Sezer db613ab35d initial import of SDL port of Fitzquake-0.85 / 20090510 sources.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@2 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-15 23:26:55 +00:00