From 8933b795003f8ad202fce6e553191be8932a37b6 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 30 May 2008 19:56:10 +0000 Subject: zlib support --- src/server/server.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/server') diff --git a/src/server/server.cc b/src/server/server.cc index ee54352..27cdf9b 100644 --- a/src/server/server.cc +++ b/src/server/server.cc @@ -100,10 +100,19 @@ void Server::shutdown() { con_print << "Shutting down server..." << std::endl; - con_debug << "Network statistics:" << std::endl; - con_debug << " bytes sent " << std::setw(6) << core::Stats::network_bytes_sent / 1024 << " Kb" << std::endl; - con_debug << " bytes received " << std::setw(6) << core::Stats::network_bytes_received / 1024 << " Kb" << std::endl; + float ratio = 0; + if (core::Stats::network_uncompressed_bytes_sent > 0) + ratio = 100.0f - floorf((float)core::Stats::network_bytes_sent / + (float) core::Stats::network_uncompressed_bytes_sent * 100.0f); + + int minutes = (int) floorf(time() / 60.0f); + int seconds = (int) floorf(time() - (float) minutes* 60.0f); + con_debug << "Statistics:" << std::endl; + con_debug << " uptime " << std::setfill(' ') << std::setw(3) << minutes << ":" << std::setfill('0') << std::setw(2) << seconds << std::endl; + con_debug << " bytes sent " << std::setfill(' ') << std::setw(6) << core::Stats::network_bytes_sent / 1024 << " Kb" << std::endl; + con_debug << " bytes received " << std::setw(6) << core::Stats::network_bytes_received / 1024 << " Kb" << std::endl; + con_debug << " compression " << std::setw(6) << ratio << " %" << std::endl; Console::shutdown(); core::Application::shutdown(); -- cgit v1.2.3