Commit graph

725 commits

Author SHA1 Message Date
Bill Currie
c443e2c024 info.c:
support unlimited info strings when maxsize is 0
sv_main.c:
	make localinfo unlimited
2001-11-05 02:08:20 +00:00
Bill Currie
ac93a620d7 remove instead of set "" info keys for localinfo 2001-11-05 02:03:37 +00:00
Bill Currie
bf4570de72 fix some reversed logic that caused the server to send the wrong info keys
to a connecting client.
2001-11-04 23:02:43 +00:00
Adam Olsen
87a0a4d7d6 - a TODO item
- converted svc_packetentities and svc_deltapacketentities
- added some convenience defines for U_foo grouping
- tweaked Host_NetError's "please report this" print, but it still
  doesn't work
2001-11-04 21:23:22 +00:00
Bill Currie
7c5c53774f cache some info strings (team and skin from client user info) and values
(no_pogo_stick and teamplay from server info) to cut down on the calls to
Info_ValueForKey (from over 550k to 23.5k in spam2.qwd).
2001-11-04 19:06:50 +00:00
Bill Currie
dcd9b0040e rewrite the info strings to use hash tables instead of a static string.
This required changes to the api (info_t instead of char *) but should be
a net gain in speed (not a lot, admittedly: it was pretty fast to begin
with, but this paves the way for some other changes I have in mind).
2001-11-04 07:50:39 +00:00
Adam Olsen
c5f4af0109 - convert svc_playerinfo, cvs_nails, svc_modellist, and svc_soundlist 2001-11-03 10:48:55 +00:00
Bill Currie
6daf712d5f turns out the server can send MAX_MSGLEN + 8 bytes, so handle this when
reading demo packets.
2001-11-03 00:54:18 +00:00
Bill Currie
e1e56c417d Host_NetError is not appropriate for an oversize packet as that packet's data
has not yet been read.
2001-11-02 23:57:22 +00:00
Adam Olsen
d7e5f88ee3 - conver svc_spawnstaticsound, svc_updateuserinfo, svc_setinfo,
svc_serverinfo, and svc_download

I havn't tested svc_download, since I don't want to play with having
seperate dirs for the client vs server on one computer.
2001-11-02 14:52:29 +00:00
Adam Olsen
9f088567d1 - convert svc_sound, svc_spawnbaseline, svc_spawnstatic, and
svc_tempentity

there isn't actually anything in the server that uses svc_tempentity,
only the progs do, so it's currently unused.
2001-11-02 10:40:20 +00:00
Adam Olsen
a77619f665 - convert svc_damage and svc_serverdata emitting 2001-11-02 08:10:41 +00:00
Adam Olsen
56f1d6f49b Begin phase 2 :)
- link net_svc.c to the server
- add a NET_SVC_Print_Emit function
- make the server use the above instead of svc_print manually

It's actually kind of ugly, because of how backbuffers are
implimented.  Hopefully I'll be able to clean that up later.
2001-11-02 07:32:19 +00:00
Adam Olsen
f9ab09356e - make nails, soundlist, and modellist return NET_ERROR when there's
too many items in the block
2001-11-02 06:39:51 +00:00
Adam Olsen
1c30d89149 - add a net_status_t enum, containing NET_OK, NET_SHORT, and
NET_ERROR.
- change all the NET_SVC_*_Parse return values from qboolean to
  net_status_t
- make NET_SVC_{,Delta}PacketEntities_Parse return NET_ERROR instead
  of 1 (NET_SHORT now) if the struct size is exceeded
2001-11-02 06:00:21 +00:00
Adam Olsen
c79294f57d - consider ':' and '"' to be special characters in names, just in case
- make sure to update the infostrings if they tried changing a name
  and it was the same after sanitizing
2001-10-31 03:05:59 +00:00
Adam Olsen
388c3a78ee - fix handling of highbit whitespace in names, as well as stripping
all highbits from names
2001-10-31 02:18:09 +00:00
Adam Olsen
2bbb759232 - change the sv_kickfake default to 0, so it replaces \r with #
instead of kicking
2001-10-31 00:30:31 +00:00
Ragnvald Maartmann-Moe IV
c174188c0c Remove local len, use mathlib's Length, among other cleanups. 2001-10-30 20:00:05 +00:00
Adam Olsen
c0f363e05c it seems that map changes generate from mismatches, so change that
back to a silent warning (but also make it drop the packet)
2001-10-30 09:15:09 +00:00
Adam Olsen
61f819b5c9 - further error checking rearangements, putting the "old packet" check
first, and making it a Con_DPrintf that just invalidates that packet
2001-10-30 02:29:04 +00:00
Adam Olsen
950331a1f4 clean up a few error messages, rearange error checks, and change some
"impossible" warnings into errors.
2001-10-30 00:24:25 +00:00
Bill Currie
ddd7989b85 turns out I was wrong about how U_REMOVE gets into an update packet (thanks
Rhamph) but the change from short to int in words does a nice bit to the
speed.
2001-10-29 21:46:00 +00:00
Bill Currie
5819fc200c shrink the packet entities word arrays down to MAX_PACKET_ENTITIES + 1 and
ensure the array is always terminated with a 0. This seems to give -x11 a
0.03 fps (0.06%) boost.
2001-10-29 19:15:29 +00:00
Bill Currie
85c9e0ab1e more externs cleaned up 2001-10-29 17:46:03 +00:00
Bill Currie
d04edfaaf2 whitespace 2001-10-29 05:42:10 +00:00
Adam Olsen
36b8256b3a - fixed net_packetlog to use Con_Printf when there's no logfile open,
rather than a stdout hack (which had problems with buffering)
- actually parse net_deltapacketentities
- print offset within net_{,delta}packetentities blocks for each
  entity
- fix indenting in Log_Delta
- fix off-by-one for packet offset printing
- fix a miss-parsing of svc_deltapacketentities
  (MAX_PACKET_ENTITIES does NOT include U_REMOVE entities)
- remove "full update" handling for CL_ParseDeltaPacketEntities, since
  that only happens with svc_packetentities
2001-10-29 00:32:16 +00:00
Bill Currie
78a3e398d5 * taniwha gets medieval on extern 2001-10-28 04:23:37 +00:00
Adam Olsen
f3fe1cec87 - add a request to send any errors to quake-devel in Host_NetError
- cleanup CL_ParseDeltaPacketEntites a little bit
- change some warnings in CL_{,Delta}PacketEntites to errors, as well
  as full updates with delta*, so that they can either be debugged or
  shown not to be needed
2001-10-28 00:51:14 +00:00
Bill Currie
d62c381262 Con_Printf -> SV_Printf for some cases that should be 2001-10-27 22:33:42 +00:00
Bill Currie
aa6472da2b cleanup qport usage a little 2001-10-27 08:28:15 +00:00
Brian Koropoff
05f35f9cd4 This adds the ability to access special characters in console commands by proceeding certain characters with $. See libs/util/cmd.c for the conversion table. Preceeding a character by # will shift it up or down by 128, which basically is useful for accessing the brown letters and numbers. All special characters were removed from Team_ParseSay, and variable substitution now takes the form of ${var} to prevent conflicts with special character substitution. Special character access is controlled by cmd_highchars, which defaults to off. 2001-10-27 04:34:53 +00:00
Adam Olsen
b8eb324ded - make CL_ParseServerMessage's loop break if we disconnected while it
was running
2001-10-26 16:01:59 +00:00
Bill Currie
7910fe026b nuke FlushEntityPacket and CL_ParseDelta as they are both redundant and
FlushEntityPacket now causes a crash.
2001-10-26 15:04:51 +00:00
Adam Olsen
b5856e8be0 - audit of the net_svc.c users' sanity checking 2001-10-25 23:26:33 +00:00
Adam Olsen
3bba5398ba - audit malloc usage. now everything checks the return value :) 2001-10-24 22:50:06 +00:00
Adam Olsen
dd19f7b500 - convert svc_deltapacketentities
- add a Host_NetError that dumps a packet log and disconnects, and use
  it instead of Host_EndGame in most cases
- fix a couple multiply-defined vars
2001-10-24 15:23:02 +00:00
Bill Currie
4ae92c8d42 new cvar: sv_hide_version_info. This hides QuakeForge specific info strings
from progs.
2001-10-24 02:50:11 +00:00
Bill Currie
b5341f0d13 we now compile and link with -fno-common. this cleans up the multiple,
uninitialized declarations of variables.
2001-10-23 16:55:23 +00:00
Adam Olsen
818f5de658 - rename CL_ParsePacketEntities to CL_ParseDeltaPacketEntities
- fix various spots in the above that called Host_EndGame but didn't
  return
- switched the order of modellist and soundlist in net_svc*, to
  conform with the rest of the files
- create a new CL_ParsePacketEntities, that only handles
  svc_packetentities (so it's much simpler).  it uses net_svc*
2001-10-21 14:21:30 +00:00
Bill Currie
cc89fb23c8 fix for win32 (need to init winsock) 2001-10-21 00:48:38 +00:00
Adam Olsen
d69c8013aa - convert svc_spawnbaseline and svc_spawnstatic
Only notable ones left now are packetentities and deltapackentities :)
2001-10-20 11:59:42 +00:00
Adam Olsen
f779a03254 - hopefully a fix for master's socket errors on windows
- start of static server support
2001-10-20 08:20:27 +00:00
Adam Olsen
32fbdba399 - move the MAX_PROJECTILES def from cl_ents.c to bothdefs.h
- convert svc_nails
2001-10-20 08:10:25 +00:00
Adam Olsen
a4d9507895 - roast the unnecesary MAX_STYLESTRING def from bothdefs.h
- rename the message argument of NET_SVC_*_Parse to msg
- rename the other argument to block, for brevity
- convert svc_spawnstaticsound
- convert svc_serverinfo
- convert svc_playerinfo
- fix a exploitable buffer overflow with svc_lightstyle
2001-10-19 21:20:49 +00:00
Adam Olsen
c2807a6da1 - and svc_temp_entity too. Probably the last I'll do today. 2001-10-18 18:48:49 +00:00
Bill Currie
6ea400fb30 d'oh, forgot to compile test :P 2001-10-18 17:03:50 +00:00
Bill Currie
00bfc128a0 more printf elimination 2001-10-18 16:49:40 +00:00
Adam Olsen
9cef5a1edc - svs_sound too of course 2001-10-18 13:33:12 +00:00
Adam Olsen
eb9c515c2a - yada svc_damage, svc_serverdata
- remove a no longer valid commit from NET_SVC_UpdateUserInfo_Parse,
  and make it always set name/data to 0 if they're unused
2001-10-18 08:57:03 +00:00
Adam Olsen
cf8380b528 - change NET_SVC_*_Parse to return qboolean, indicating if they had a
bad read
2001-10-18 07:34:38 +00:00
Adam Olsen
d2fe052d59 - convert svc_setinfo, bla bla, you know hte drill 2001-10-18 07:23:33 +00:00
Adam Olsen
634c2c6acf - rename CL_UpdateUserinfo to CL_ParseUpdateUserInfo for uniformness
- rework svc_updateuserinfo/CL_ParseUpdateUserInfo like everything
  else
2001-10-18 07:01:40 +00:00
Adam Olsen
7d26e6e2b9 - move the svc_print handling into a seperate function (CL_ParsePrint)
- add NET_SVC_{Print,Download}_Parse functions and assosiated
  net_svc_{print,download}_t structs.
- make CL_Parse{Print,Download} use the above stuff
2001-10-18 06:35:28 +00:00
Bill Currie
6c0d760102 msg.h:
give mst_t a buffer to hold unterminated message strings
	kill MSG_ReadStaticString and MSG_ReadStringLine
msg.c:
	kill MSG_ReadStaticString and MSG_ReadStringLine
	MSG_ReadString: implement the buffer for unterminated message strings
	and update readcount on badread
cl_main.c:
	go back to MSG_ReadString and fix up the resulting const char * issues
cl_parse.c:
	rewrite the cl_mofake code all because of an uninitialized variable :)
sv_main.c:
	use MSG_ReadString instead of MSG_ReadStringLine because
	Cmd_TokenizeString really doesn't care about a terminating \n
2001-10-18 06:23:26 +00:00
Adam Olsen
18036b63d9 - change MSG_ReadString to return const char * and return a pointer
directly into the packet data.
- change a bunch of char *'s to const char *'s for the above.  Only
  thing that had trouble was the cl_nofake handler, which I changed to
  use a local buffer.
- add MSG_ReadStaticString which acts like the old MSG_ReadString,
  specifically that it uses a static buffer and tollerates
  unterminated strings.
- add a Q_strnlen function, and make strnlen use it if strnlen is
  undefined.
- Add a net_svc.h and net_svc.c which will preparse svc messages into
  structs, for easier handling.  Currently only soundlist and
  modellist are done.
2001-10-18 04:44:58 +00:00
Bill Currie
3ab66f5e75 remove the non-qw code and the ifdef QUAKEWORLD stuff 2001-10-18 03:19:04 +00:00
Bill Currie
f9fcf2f09f freebsd fixes 2001-10-17 18:49:25 +00:00
Bill Currie
7883280d9a whitespace 2001-10-16 22:55:37 +00:00
Bill Currie
2d068c0745 massive windows.h and WIN32 cleanup. 2001-10-16 21:40:45 +00:00
Bill Currie
6ad55725c2 chase cam seems to work properly now 2001-10-11 16:26:09 +00:00
Bill Currie
a7abedccbb fix a woopsie that brok playdemo 2001-10-11 04:54:50 +00:00
Bill Currie
c0f0dcb4b8 sort of apply Serplord's chasecam fix (it wasn't complete) 2001-10-11 04:43:40 +00:00
Bill Currie
3c4e094493 timedemo looping. "timedemo overkill 10" will give 10 runs 2001-10-10 22:00:26 +00:00
Adam Olsen
9f7e1f864e - add a pr_double_remove cvar, that either ignores (0), warns about
(1), or causes a fatal error (2) when the progs remove an already
  removed entity.  default is 1.
- fix a segfault in FFnickFF parsing that causes a segfault
2001-10-09 22:47:14 +00:00
Bill Currie
3a366f4f7e break out the backtrace code from PR_RunError into PR_DumpState and use
PR_DumpState instead of PR_RunError in seg_fault_handler so we get both a
progs trace /and/ a core file (ulimit allowing)
2001-10-08 03:46:44 +00:00
Bill Currie
5b8aca001b diff snr-- 2001-10-07 18:45:23 +00:00
Adam Olsen
0785610296 - fix a little mistake in SV_PrintToClient that'd cause it to
segfault if your first call was with "".  Probably could cause
  crashes too
- add a string.c file to libQFutil, with a Q_strcasestr function,
  which strcasestr is defined to if it's not already defined.  (we'd
  get that with glibc if we defined __USE_GNU, but we don't)
- make client_t and SV_ExtractFromUserinfo both use NAME_MAX for
  their name arrays, instead of 32 for one and 80 for the other
- rewrite almost all of SV_ExtractFromUserinfo's name handling.
  - \r, \n, and \t are all converted to spaces
  - leading/trailing spaces are stripped
  - consecutive spaces are reduced to a single space
  - empty names are considered bad
  - user-* nicks are considered bad (unless forced to them)
  - a name containing console or admin is considered bad
  - a name that already exists is considered bad
  - if they have a bad name it gets forced to user-%d, where %d is
    their userid
  - netname in the progs is now updated properly
  - name changes are always reported unless it's the initial setting,
    rather than only if they're full connected and not a spectator
  - finally, if the name change fails (info string exceeded), give
    them the boot.  (before this was only done for duplicate names)

That's about it :)
2001-10-04 19:11:39 +00:00
Bill Currie
1929797cc9 get nq-server so it runs. part of this involved renaming cl_warncmd to
cmd_warncmd
2001-10-03 21:25:43 +00:00
Bill Currie
bbc83c30ca hey, it segs, but who cares? so does nq-glx -dedicated :P 2001-10-03 19:52:03 +00:00
Bill Currie
a1d2cf3532 duplicate file name cleanup and make dist works 2001-10-03 17:50:36 +00:00
Ragnvald Maartmann-Moe IV
450dd9f504 5.2 time and fps in demo output, for both nq and qw. 2001-10-02 19:43:25 +00:00
Adam Olsen
362e4eefc9 - make the fallback console use stdin
- don't draw scores overlay if the screen is less than 244 wide.
2001-10-02 03:24:36 +00:00
Bill Currie
7fcdffb42e mirror the chase and watervis serverinfo keys in the cl struct so
Info_ValueForKey doesn't get hit so often.
2001-10-01 01:51:36 +00:00
Bill Currie
e9c420c749 nuke SV_RecursiveHullCheck from cl_cam.c and use PM_RecursiveHullCheck
instead. Also add prototype for PM_RecursiveHullCheck to pmove.h
2001-10-01 00:20:57 +00:00
Bill Currie
f505e8630c fixes for rh 7.1 2001-09-30 23:24:53 +00:00
Bill Currie
5e82c0cac7 correct a spelling error in a comment 2001-09-30 03:58:24 +00:00
Bill Currie
138a4a1c14 rename console_t to old_console_t in preparation for a better version and
temporarily disable the client console plugin as it currently doesn't
compile.
2001-09-29 04:24:04 +00:00
Bill Currie
9f612ec82a this fixes the rendering of the player when not in chasecam mode. not sure
what it does for chasecam mode.
2001-09-28 22:07:26 +00:00
Bill Currie
cca3e4c203 fix a coupld d'ohs for pr_checkextensions 2001-09-28 21:39:13 +00:00
Bill Currie
5eb35f0b2a fix a tiny case&paste (?) error that prevented players from being drawn. 2001-09-28 21:15:48 +00:00
Bill Currie
4a8eb5e7cf more namespace issues 2001-09-28 16:50:35 +00:00
Bill Currie
514a4a56cb fix a win32 namespace issue 2001-09-28 16:29:34 +00:00
Bill Currie
8e27422c72 partial fixes for mingw cross builds. still have issues with ar :( 2001-09-28 16:03:45 +00:00
Bill Currie
89fbacdc78 make sv_progs CVAR_NONE rather thatn CVAR_ROM so it can be set in server.cfg. 2001-09-28 15:29:22 +00:00
Bill Currie
c78edb3a36 Apply Seth Galbraith's <sgalbrai@linknet.kitsap.lib.wa.us> chasecam patch 2001-09-28 07:51:15 +00:00
Bill Currie
b1f4a778f9 the rcsid commit from hell }:> 2001-09-28 06:26:31 +00:00
Jeff Teunissen
343bb529b4 And this fixes QW. 2001-09-28 05:40:14 +00:00
Ragnvald Maartmann-Moe IV
2941c07b0a Add small cyan light to lightning impacts. And restore particle direction use in nq. Greatly improves blood effects. 2001-09-27 00:43:46 +00:00
Adam Olsen
376f05d357 - add some conversion builtins, now we have ftoi, ftos, itof, itos,
stof, stoi, stov, and vtos.
- fix PF_sprintf
- add FFnameFF support, where it tacks <userid> after the nick on the
  console.
2001-09-26 22:26:31 +00:00
Bill Currie
dec9503620 set the default rcon_address port to 27500 rather than 0 2001-09-26 21:06:51 +00:00
Bill Currie
694619cd70 thou shalt not use strlen as a boolean value! 2001-09-26 20:57:40 +00:00
Jeff Teunissen
e110f6da83 -3dfx is gone, pending someone to work on it again. Most of the stuff it
did specially will be folded into -glx.
2001-09-25 23:58:23 +00:00
Chris Ison
0d0f0a7f73 bootstrap now works in cygwin 2001-09-25 23:47:13 +00:00
Jeff Teunissen
27b6bac88f do the same for QW. 2001-09-25 23:32:11 +00:00
Bill Currie
df330f33fd expernimental code to get window resizing working 2001-09-25 20:16:24 +00:00
Bill Currie
06da30ac89 mingw build fixes again (including mostly working in sid: got some link issues) 2001-09-25 06:18:30 +00:00
Bill Currie
36de3c147e move Sys_Quit and Sys_Error totally into libQFutil. They will call a list
of pre-registered (Sys_RegisterShutdown) function before actually exiting
the program. This should take care of the pain when an ncurses server
crashes.
2001-09-24 21:00:23 +00:00
Bill Currie
169f1ceac2 thou shalt not rely on order of evaluation 2001-09-24 19:12:05 +00:00
Adam Olsen
5d757c0d85 - fix our favorite svc_updatefrags overflow bug! weeeeee 2001-09-24 18:26:23 +00:00