shithub: choc

Download patch

ref: 197188e1f1b62e476978816a498270a0d95d207a
parent: d5f0ddc20b192cf1f17b27347dd467cddf493a6d
author: Simon Howard <[email protected]>
date: Thu Apr 6 16:49:16 EDT 2006

Debug code for tracking bandwidth usage

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 465

--- a/src/net_sdl.c
+++ b/src/net_sdl.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: net_sdl.c 244 2006-01-02 20:11:49Z fraggle $
+// $Id: net_sdl.c 465 2006-04-06 20:49:16Z fraggle $
 //
 // Copyright(C) 2005 Simon Howard
 //
@@ -209,6 +209,22 @@
 {
     UDPpacket sdl_packet;
     IPaddress *ip = (IPaddress *) addr->handle;
+
+#if 0
+    {
+        static int this_second_sent = 0;
+        static int lasttime;
+
+        this_second_sent += packet->len + 64;
+
+        if (I_GetTime() - lasttime > 35)
+        {
+            printf("%i bytes sent in the last second\n", this_second_sent);
+            lasttime = I_GetTime();
+            this_second_sent = 0;
+        }
+    }
+#endif
 
     sdl_packet.channel = 0;
     sdl_packet.data = packet->data;