More netplay debugging code

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2694 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2007-02-01 22:00:22 +00:00
parent 81af460cfe
commit fe3e52b80a
3 changed files with 25 additions and 3 deletions
+8 -1
View File
@@ -82,7 +82,14 @@ dataReceivedSingle(NetConnection *conn, const uint8 *data,
log_add(log_Debug, "NETPLAY: [%d] <== Received packet of type %s.\n",
NetConnection_getPlayerNr(conn), packetTypeData[type].name);
}
#endif
#ifdef NETPLAY_DEBUG_FILE
if (conn->debugFile != NULL) {
uio_fprintf(conn->debugFile,
"NETPLAY: [%d] <== Received packet of type %s.\n",
NetConnection_getPlayerNr(conn), packetTypeData[type].name);
}
#endif /* NETPLAY_DEBUG_FILE */
#endif /* NETPLAY_DEBUG */
result = packetTypeData[type].handler(conn, data);
if (result == -1) {
+8 -1
View File
@@ -47,7 +47,14 @@ sendPacket(NetConnection *conn, Packet *packet) {
// log_add(log_Debug, "NETPLAY: [%d] ==> Sending packet of type %s.\n",
// conn->player, packetTypeData[packetType(packet)].name);
//}
#endif
#ifdef NETPLAY_DEBUG_FILE
if (conn->debugFile != NULL) {
uio_fprintf(conn->debugFile,
"NETPLAY: [%d] ==> Sending packet of type %s.\n",
conn->player, packetTypeData[packetType(packet)].name);
}
#endif /* NETPLAY_DEBUG_FILE */
#endif /* NETPLAY_DEBUG */
socket = NetDescriptor_getSocket(conn->nd);
+9 -1
View File
@@ -102,7 +102,15 @@ queuePacket(NetConnection *conn, Packet *packet, bool urgent) {
NetConnection_getPlayerNr(conn),
packetTypeData[packetType(packet)].name);
}
#endif
#ifdef NETPLAY_DEBUG_FILE
if (conn->debugFile != NULL) {
uio_fprintf(conn->debugFile,
"NETPLAY: [%d] ==> Queueing packet of type %s.\n",
NetConnection_getPlayerNr(conn),
packetTypeData[packetType(packet)].name);
}
#endif /* NETPLAY_DEBUG_FILE */
#endif /* NETPLAY_DEBUG */
}
// If an error occurs during sending, we leave the unsent packets in