| 2086 | { |
| 2087 | nMsg = nBytes = nMsgG = nBytesG = 0; |
| 2088 | } |
| 2089 | leaveUsr(); |
| 2090 | } |
| 2091 | |
| 2092 | bool NetServer::GetConnectionInfo(int to, int& latencyMS, int& throughputBPS) |
| 2093 | { |
| 2094 | enterUsr(); |
| 2095 | RefD<NetChannel> channel; |
| 2096 | if (!users.get(to, channel)) |
| 2097 | { |
| 2098 | leaveUsr(); |
| 2099 | return false; |
| 2100 | } |
| 2101 | latencyMS = (int)(channel->getLatency() / 1000); |
| 2102 | throughputBPS = (int)channel->getOutputBandWidth(); |
| 2103 | #ifdef NET_LOG_INFO |
| 2104 | if (latencyMS != oldLatency || throughputBPS != oldThroughput) |
| 2105 | { |
| 2106 | NetLog("Channel(%u): NetServer::GetConnectionInfo(player=%d): %d ms,%d B/s", channel->getChannelId(), to, |
| 2107 | latencyMS, throughputBPS); |
| 2108 | oldLatency = latencyMS; |
| 2109 | oldThroughput = throughputBPS; |
| 2110 | } |
| 2111 | #endif |
| 2112 | // check the channel condition: |
| 2113 | bool dropped = (to != botId) && channel->dropped(); |
| 2114 | if (dropped) |
| 2115 | { |
| 2116 | finishDestroyPlayer(to); |
| 2117 | } |
| 2118 | #ifdef DEDICATED_STAT_LOG |
| 2119 | if (IsDedicatedServer()) |
| 2120 | { |
| 2121 | unsigned64 now = getSystemTime(); |
| 2122 | #ifdef NET_LOG_TRANSP_STAT |
| 2123 | if (true) |
| 2124 | { |
| 2125 | const bool doConsole = (now >= nextConsoleLog); |
| 2126 | #else |
no test coverage detected