mail[Wesnoth-commits] r28543 - in /trunk/src: network.cpp network_worker.hpp server/game.cpp server/game.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by paniemin on August 13, 2008 - 15:58:
Author: suokko
Date: Wed Aug 13 15:03:21 2008
New Revision: 28543

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28543&view=rev
Log:
Fixed merge problems for bandwidth monitor

Modified:
    trunk/src/network.cpp
    trunk/src/network_worker.hpp
    trunk/src/server/game.cpp
    trunk/src/server/game.hpp

Modified: trunk/src/network.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/network.cpp?rev=28543&r1=28542&r2=28543&view=diff
==============================================================================
--- trunk/src/network.cpp (original)
+++ trunk/src/network.cpp Wed Aug 13 15:03:21 2008
@@ -925,14 +925,16 @@
        int day = timeinfo->tm_mday;
        assert(hour < 24 && hour >= 0);
        std::pair<bandwidth_map::iterator,bool> insertion = 
hour_stats[hour].insert(std::make_pair(packet_type, bandwidth_stats()));
+       bandwidth_map::iterator inserted = insertion.first;
        if (!insertion.second && day != inserted->second.day)
        {
                // clear previuos day stats
-               hour[hour].clear();
+               hour_stats[hour].clear();
                //insert again to cleared map
                insertion = 
hour_stats[hour].insert(std::make_pair(packet_type, bandwidth_stats()));
-       }
-       bandwidth_map::iterator inserted = insertion.first;
+               inserted = insertion.first;
+       }
+       
        inserted->second.day = day;
        return inserted;
 }

Modified: trunk/src/network_worker.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/network_worker.hpp?rev=28543&r1=28542&r2=28543&view=diff
==============================================================================
--- trunk/src/network_worker.hpp (original)
+++ trunk/src/network_worker.hpp Wed Aug 13 15:03:21 2008
@@ -53,9 +53,9 @@
 /** Function to asynchronously received data to the given socket. */
 void receive_data(TCPsocket sock);
 
-TCPsocket get_received_data(TCPsocket sock, config& cfg, bool* gzipped= 0
+TCPsocket get_received_data(TCPsocket sock, config& cfg, bool* gzipped
 #ifdef BANDWIDTH_MONITOR
-               , network::bandwidth_in_ptr& 
+               , network::bandwidth_in_ptr&
 #endif
                );
 

Modified: trunk/src/server/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/game.cpp?rev=28543&r1=28542&r2=28543&view=diff
==============================================================================
--- trunk/src/server/game.cpp (original)
+++ trunk/src/server/game.cpp Wed Aug 13 15:03:21 2008
@@ -1113,7 +1113,7 @@
        send_observerjoins(user->first);
 }
 
-void game::send_data(simple_wml::document& data, const network::connection 
exclude) const
+void game::send_data(simple_wml::document& data, const network::connection 
exclude, const std::string packet_type) const
 {
        simple_wml::string_span s = data.output_compressed();
        const user_vector& users = all_game_users();
@@ -1124,7 +1124,7 @@
        }
 }
 
-void game::send_to_one(simple_wml::document& data, const network::connection 
sock) const
+void game::send_to_one(simple_wml::document& data, const network::connection 
sock, const std::string packet_type) const
 {
        simple_wml::string_span s = data.output_compressed();
        network::send_raw_data(s.begin(), s.size(), sock,"game");

Modified: trunk/src/server/game.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/game.hpp?rev=28543&r1=28542&r2=28543&view=diff
==============================================================================
--- trunk/src/server/game.hpp (original)
+++ trunk/src/server/game.hpp Wed Aug 13 15:03:21 2008
@@ -93,8 +93,8 @@
        //! Send data to all players in this game except 'exclude'.
        void send_and_record_server_message(const char* message,
                        const network::connection exclude=0);
-       void send_data(simple_wml::document& data, const network::connection 
exclude=0) const;
-       void send_to_one(simple_wml::document& data, const 
network::connection sock) const;
+       void send_data(simple_wml::document& data, const network::connection 
exclude=0, const std::string packet_type = "unknown") const;
+       void send_to_one(simple_wml::document& data, const 
network::connection sock, const std::string packet_type = "unknown") const;
 
        void record_data(simple_wml::document* data);
 




Related Messages


Powered by MHonArc, Updated Wed Aug 13 16:01:40 2008