From 5a0fb4633e091c222a11fb6b2fd9c00f9af4717a Mon Sep 17 00:00:00 2001 From: sajt Date: Tue, 23 Aug 2005 05:39:12 +0000 Subject: [PATCH] Added DP_SV_WRITEUNTERMINATEDSTRING extension git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5635 d7cf8633-e32d-0410-b094-e92efae38249 --- common.c | 6 ++++++ common.h | 1 + svvm_cmds.c | 8 +++++++- todo | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/common.c b/common.c index 86d448b0..df8bbcc9 100644 --- a/common.c +++ b/common.c @@ -252,6 +252,12 @@ void MSG_WriteString (sizebuf_t *sb, const char *s) SZ_Write (sb, s, (int)strlen(s)+1); } +void MSG_WriteUnterminatedString (sizebuf_t *sb, const char *s) +{ + if (s) + SZ_Write (sb, s, (int)strlen(s)); +} + void MSG_WriteCoord13i (sizebuf_t *sb, float f) { if (f >= 0) diff --git a/common.h b/common.h index 507d3f7d..f87a0607 100644 --- a/common.h +++ b/common.h @@ -148,6 +148,7 @@ void MSG_WriteShort (sizebuf_t *sb, int c); void MSG_WriteLong (sizebuf_t *sb, int c); void MSG_WriteFloat (sizebuf_t *sb, float f); void MSG_WriteString (sizebuf_t *sb, const char *s); +void MSG_WriteUnterminatedString (sizebuf_t *sb, const char *s); void MSG_WriteAngle8i (sizebuf_t *sb, float f); void MSG_WriteAngle16i (sizebuf_t *sb, float f); void MSG_WriteAngle32f (sizebuf_t *sb, float f); diff --git a/svvm_cmds.c b/svvm_cmds.c index 746ea331..c6def35f 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -94,6 +94,7 @@ char *vm_sv_extensions = "DP_SV_ROTATINGBMODEL " "DP_SV_SETCOLOR " "DP_SV_SLOWMO " +"DP_SV_WRITEUNTERMINATEDSTRING " "DP_TE_BLOOD " "DP_TE_BLOODSHOWER " "DP_TE_CUSTOMFLASH " @@ -1186,6 +1187,11 @@ void PF_WriteString (void) MSG_WriteString (WriteDest(), PRVM_G_STRING(OFS_PARM1)); } +void PF_WriteUnterminatedString (void) +{ + MSG_WriteUnterminatedString (WriteDest(), PRVM_G_STRING(OFS_PARM1)); +} + void PF_WriteEntity (void) { @@ -2470,7 +2476,7 @@ PF_gettaginfo, // #452 vector(entity ent, float tagindex) gettaginfo (DP_QC_G PF_dropclient, // #453 void(entity clent) dropclient (DP_SV_DROPCLIENT) PF_spawnclient, // #454 entity() spawnclient (DP_SV_BOTCLIENT) PF_clienttype, // #455 float(entity clent) clienttype (DP_SV_BOTCLIENT) -NULL, // #456 +PF_WriteUnterminatedString, // #456 NULL, // #457 NULL, // #458 NULL, // #459 diff --git a/todo b/todo index 84c51baa..a28dbebc 100644 --- a/todo +++ b/todo @@ -6,6 +6,7 @@ -d (Mabus) bug darkplaces loading: test zlib support with entirely pk3'd id1 data (should crash because of zlib not being setup early enough - fix this) (Mabus) d bug darkplaces renderer: fix q3bsp fogging (Sajt) d feature darkplaces client: v_deathtilt cvar (Sajt, MauveBib) +-d (shadowalker) feature darkplaces server: add DP_QC_WRITEUNTERMINATEDSTRING extension (shadowalker) -d (Speedy) feature darkplaces init: add -demolooponly option which makes escape key quit, and disables all other keys (Speedy) -d (Spike) bug darkplaces console: inserting characters in the commandline is not adding a nul terminator to the commandline, resulting in lots of trash from older commandlines suddenly showing up (Spike) -d (Spike) feature darkplaces server: add filename/line number reporting to progs stack and opcode printouts (Spike) @@ -156,7 +157,6 @@ d feature darkplaces client: v_deathtilt cvar (Sajt, MauveBib) 0 feature darkplaces renderer: add rtlight "avelocity" parameter to make lights that spin, useful with cubemaps (romi) 0 feature darkplaces renderer: save r_shadow_glsl* cvars (and possibly a few others) to config because they are useful user settings (SavageX) 0 feature darkplaces server: add DP_QC_STRTOKEN extension with these functions: float strtokens(string s, string separator) = #;string strtoken(string s, string separator, float index) = #; (FrikaC) -0 feature darkplaces server: add DP_QC_WRITESTRING2 extension, same as writestring but does not write trailing 0 (shadowalker) 0 feature darkplaces server: add DP_SV_DRAWONLYTOTEAM extension (Supajoe) 0 feature darkplaces server: add PF_tokenizeseparator function and DP_QC_TOKENIZESEPARATOR extension 0 feature darkplaces server: add a .collision_cancollide QC function call to decide if an entity should collide with another, or pass through it (Uffe) -- 2.39.2