]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - net_loop.c
improved Com_HexDumpToConsole, it now prints properly (not with a data byte on the...
[xonotic/darkplaces.git] / net_loop.c
index 133766aa1ca5240ef752565af7cbdcf5d3549b00..47d8d0e166f38a6b4d7bd6283a1def630770ddbe 100644 (file)
@@ -39,6 +39,11 @@ void Loop_Shutdown (void)
 }
 
 
+void Loop_Heartbeat (const char *master)
+{
+}
+
+
 void Loop_Listen (qboolean state)
 {
 }
@@ -62,7 +67,13 @@ void Loop_SearchForHosts (qboolean xmit)
 }
 
 
-qsocket_t *Loop_Connect (char *host)
+qboolean Loop_SearchForInetHosts (const char *master)
+{
+       return false;
+}
+
+
+qsocket_t *Loop_Connect (const char *host)
 {
        if (strcmp(host,"local") != 0)
                return NULL;
@@ -153,8 +164,8 @@ int Loop_GetMessage (qsocket_t *sock)
 
 int Loop_SendMessage (qsocket_t *sock, sizebuf_t *data)
 {
-       byte *buffer;
-       int  *bufferLength;
+       qbyte *buffer;
+       int *bufferLength;
 
        if (!sock->driverdata)
                return -1;
@@ -187,15 +198,16 @@ int Loop_SendMessage (qsocket_t *sock, sizebuf_t *data)
 
 int Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data)
 {
-       byte *buffer;
-       int  *bufferLength;
+       qbyte *buffer;
+       int *bufferLength;
 
        if (!sock->driverdata)
                return -1;
 
        bufferLength = &((qsocket_t *)sock->driverdata)->receiveMessageLength;
 
-       if ((*bufferLength + data->cursize + sizeof(byte) + sizeof(short)) > NET_MAXMESSAGE)
+       // LordHavoc: added an extra sizeof(qbyte) to account for alignment
+       if ((*bufferLength + data->cursize + sizeof(qbyte) + sizeof(short) + sizeof(qbyte)) > NET_MAXMESSAGE)
                return 0;
 
        buffer = ((qsocket_t *)sock->driverdata)->receiveMessage + *bufferLength;
@@ -243,3 +255,4 @@ void Loop_Close (qsocket_t *sock)
        else
                loop_server = NULL;
 }
+