summaryrefslogtreecommitdiff
path: root/source/sv_send.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-10-07 20:09:00 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-10-07 20:09:00 +0000
commite2a278c4a223328ac8c90d8c2b8b7c86cf095fa1 (patch)
tree066598d97300032c7a6f88f4cf0b4d656adbe4b1 /source/sv_send.c
parent8c81e98c2ae39b84efda70df9eb30a6d8a7a45be (diff)
Added sv_uptime cvar.
Optimized some string buffer functions. Made redirect buffer size safe.
Diffstat (limited to 'source/sv_send.c')
-rw-r--r--source/sv_send.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/sv_send.c b/source/sv_send.c
index 6ae881b..02369a2 100644
--- a/source/sv_send.c
+++ b/source/sv_send.c
@@ -32,13 +32,17 @@ MISC
char sv_outputbuf[SV_OUTPUTBUF_LENGTH];
-void SV_FlushRedirect( int sv_redirected, char *outputbuf ) {
- if( sv_redirected == RD_PACKET ) {
- Netchan_OutOfBandPrint( NS_SERVER, &net_from, "print\n%s", outputbuf );
- } else if( sv_redirected == RD_CLIENT ) {
+void SV_FlushRedirect( int redirected, char *outputbuf, int length ) {
+ byte buffer[MAX_PACKETLEN_DEFAULT];
+
+ if( redirected == RD_PACKET ) {
+ memcpy( buffer, "\xff\xff\xff\xffprint\n", 10 );
+ memcpy( buffer + 10, outputbuf, length );
+ NET_SendPacket( NS_SERVER, &net_from, length + 10, buffer );
+ } else if( redirected == RD_CLIENT ) {
MSG_WriteByte( svc_print );
MSG_WriteByte( PRINT_HIGH );
- MSG_WriteString( outputbuf );
+ MSG_WriteData( outputbuf, length + 1 );
SV_ClientAddMessage( sv_client, MSG_RELIABLE|MSG_CLEAR );
}
}