summaryrefslogtreecommitdiff
path: root/source/sv_send.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-10-11 15:05:50 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-10-11 15:05:50 +0000
commitd02633af4e780c4b6f6d938c67d84d2c968adb79 (patch)
tree3379b9615e285346ad6b1f87639912e01ecd44c7 /source/sv_send.c
parentf8abe42a0d1a42653b39f6cf320d3fbdd1279bb3 (diff)
Major redesign of GTV protocol: added support for persistent GTV connections,
bidirectional pinging, low traffic (`suspended') modes. HTTP server is now gone (remote console logging is temporary gone too), custom binary protocol is used for GTV connections now. MVD client no longer serves other MVD clients, only regular spectators. Changed FIFO buffers to be regular circular buffers, not BIP-buffers. Removed `sv_http_*', `sv_console_auth' variables. Added `sv_mvd_maxclients' variable, `addgtvhost', `delgtvhost' and `listgtvhosts' commands. Renamed `sv_mvd_max*' cvars for consistency. Reset `sv_ghostime' default value back to 6, but changed semantics: it now waits for any packet from client, not just `begin' packet. Added `--disable-mvd-server' and `--disable-mvd-client' options to configure script. FS_Restart() no longer chokes on real files opened for reading. Fixed client chat prompt length. Stubbed out more debugging stuff from dedicated server builds.
Diffstat (limited to 'source/sv_send.c')
-rw-r--r--source/sv_send.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/sv_send.c b/source/sv_send.c
index 6d85d29..99ca99f 100644
--- a/source/sv_send.c
+++ b/source/sv_send.c
@@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// sv_send.c
#include "sv_local.h"
-#include "mvd_local.h"
/*
=============================================================================
@@ -308,8 +307,10 @@ void SV_Multicast( vec3_t origin, multicast_t to ) {
SV_ClientAddMessage( client, flags );
}
+#if USE_MVD_SERVER
// add to MVD datagram
SV_MvdMulticast( leafnum, to );
+#endif
// clear the buffer
SZ_Clear( &msg_write );
@@ -327,10 +328,12 @@ unless told otherwise.
=======================
*/
void SV_ClientAddMessage( client_t *client, int flags ) {
+#if USE_CLIENT
if( sv_debug_send->integer > 1 ) {
Com_Printf( S_COLOR_BLUE"%s: add%c: %"PRIz"\n", client->name,
( flags & MSG_RELIABLE ) ? 'r' : 'u', msg_write.cursize );
}
+#endif
if( !msg_write.cursize ) {
return;
@@ -425,10 +428,12 @@ static void emit_snd( client_t *client, message_packet_t *msg ) {
}
}
if( i == frame->numEntities ) {
+#if USE_CLIENT
if( sv_debug_send->integer ) {
Com_Printf( S_COLOR_BLUE "Forcing position on entity %d for %s\n",
entnum, client->name );
}
+#endif
flags |= SND_POS; // entity is not present in frame
}
}
@@ -519,9 +524,11 @@ void SV_ClientWriteReliableMessages_Old( client_t *client, size_t maxsize ) {
int count;
if( client->netchan->reliable_length ) {
+#if USE_CLIENT
if( sv_debug_send->integer > 1 ) {
Com_Printf( S_COLOR_BLUE"%s: unacked\n", client->name );
}
+#endif
return; // there is still outgoing reliable message pending
}
@@ -537,10 +544,12 @@ void SV_ClientWriteReliableMessages_Old( client_t *client, size_t maxsize ) {
break;
}
+#if USE_CLIENT
if( sv_debug_send->integer > 1 ) {
Com_Printf( S_COLOR_BLUE"%s: wrt%d: %d\n",
client->name, count, msg->cursize );
}
+#endif
SZ_Write( &client->netchan->message, msg->data, msg->cursize );
SV_PacketizedRemove( client, msg );
@@ -630,10 +639,12 @@ void SV_ClientWriteDatagram_Old( client_t *client ) {
// and the player_state_t
client->WriteFrame( client );
if( msg_write.cursize > maxsize ) {
+#if USE_CLIENT
if( sv_debug_send->integer ) {
Com_Printf( S_COLOR_BLUE"Frame overflowed for %s: %"PRIz" > %"PRIz"\n",
client->name, msg_write.cursize, maxsize );
}
+#endif
SZ_Clear( &msg_write );
}
@@ -703,6 +714,7 @@ void SV_ClientWriteDatagram_New( client_t *client ) {
emit_messages( client, msg_write.maxsize );
}
+#if USE_CLIENT
if( sv_pad_packets->integer ) {
size_t pad = msg_write.cursize + sv_pad_packets->integer;
@@ -713,6 +725,7 @@ void SV_ClientWriteDatagram_New( client_t *client ) {
MSG_WriteByte( svc_nop );
}
}
+#endif
// send the datagram
cursize = client->netchan->Transmit( client->netchan,
@@ -769,10 +782,12 @@ void SV_SendClientMessages( void ) {
// don't overrun bandwidth
if( SV_RateDrop( client ) ) {
+#if USE_CLIENT
if( sv_debug_send->integer ) {
Com_Printf( "Frame %d surpressed for %s\n",
sv.framenum, client->name );
}
+#endif
client->surpressCount++;
} else {
// don't write any frame data until all fragments are sent