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:
@@ -82,7 +82,14 @@ dataReceivedSingle(NetConnection *conn, const uint8 *data,
|
|||||||
log_add(log_Debug, "NETPLAY: [%d] <== Received packet of type %s.\n",
|
log_add(log_Debug, "NETPLAY: [%d] <== Received packet of type %s.\n",
|
||||||
NetConnection_getPlayerNr(conn), packetTypeData[type].name);
|
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);
|
result = packetTypeData[type].handler(conn, data);
|
||||||
if (result == -1) {
|
if (result == -1) {
|
||||||
|
|||||||
@@ -47,7 +47,14 @@ sendPacket(NetConnection *conn, Packet *packet) {
|
|||||||
// log_add(log_Debug, "NETPLAY: [%d] ==> Sending packet of type %s.\n",
|
// log_add(log_Debug, "NETPLAY: [%d] ==> Sending packet of type %s.\n",
|
||||||
// conn->player, packetTypeData[packetType(packet)].name);
|
// 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);
|
socket = NetDescriptor_getSocket(conn->nd);
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,15 @@ queuePacket(NetConnection *conn, Packet *packet, bool urgent) {
|
|||||||
NetConnection_getPlayerNr(conn),
|
NetConnection_getPlayerNr(conn),
|
||||||
packetTypeData[packetType(packet)].name);
|
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
|
// If an error occurs during sending, we leave the unsent packets in
|
||||||
|
|||||||
Reference in New Issue
Block a user