mail[Wesnoth-commits] r24747 - in /trunk/src/server: server.cpp simple_wml.cpp simple_wml.hpp


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

Header


Content

Posted by dave on March 17, 2008 - 17:31:
Author: dave
Date: Mon Mar 17 17:31:32 2008
New Revision: 24747

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24747&view=rev
Log:
attempt to fix compile errors

Modified:
    trunk/src/server/server.cpp
    trunk/src/server/simple_wml.cpp
    trunk/src/server/simple_wml.hpp

Modified: trunk/src/server/server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/server.cpp?rev=24747&r1=24746&r2=24747&view=diff
==============================================================================
--- trunk/src/server/server.cpp (original)
+++ trunk/src/server/server.cpp Mon Mar 17 17:31:32 2008
@@ -451,16 +451,13 @@
                                //TODO: this is a HUGE HACK. There was a bug 
in Wesnoth 1.4
                                //that caused it to still use binary WML for 
the leave game
                                //message. (ugh). We will see if this looks 
like binary WML
-                               //and if it does, see if it is indeed a leave 
game message.
+                               //and if it does, assume it's a leave_game 
message
                                if(buf.front() < 5) {
-                                       static std::string 
leave_game("leave_game");
-                                       if(std::search(buf.begin(), 
buf.end(), leave_game.begin(), leave_game.end()) != buf.end()) {
-                                               static simple_wml::document 
leave_game_doc(
-                                                   
"[leave_game]\n[/leave_game]\n",
-                                                       
simple_wml::INIT_COMPRESSED);
-                                               process_data(sock, 
leave_game_doc);
-                                               continue;
-                                       }
+                                       static simple_wml::document 
leave_game_doc(
+                                           "[leave_game]\n[/leave_game]\n",
+                                               simple_wml::INIT_COMPRESSED);
+                                       process_data(sock, leave_game_doc);
+                                       continue;
                                }
 
                                char* buf_ptr = new char [buf.size()];

Modified: trunk/src/server/simple_wml.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/simple_wml.cpp?rev=24747&r1=24746&r2=24747&view=diff
==============================================================================
--- trunk/src/server/simple_wml.cpp (original)
+++ trunk/src/server/simple_wml.cpp Mon Mar 17 17:31:32 2008
@@ -8,8 +8,6 @@
 #include <boost/iostreams/filtering_stream.hpp>
 #include <boost/iostreams/filter/gzip.hpp>
 
-#include "SDL.h"
-#include "../config.hpp"
 #include "../serialization/binary_wml.hpp"
 #include "simple_wml.hpp"
 
@@ -645,8 +643,12 @@
                                                         root_(NULL)
 {
        output_ = buf;
-       output_compressed();
-       output_ = NULL;
+       if(state == INIT_COMPRESSED) {
+               output_compressed();
+               output_ = NULL;
+       } else {
+               root_ = new node(*this, NULL, &buf);
+       }
 
        attach_list();
 }
@@ -656,11 +658,8 @@
     output_(NULL),
        root_(NULL)
 {
-       int ticks = SDL_GetTicks();
        string_span uncompressed_buf;
        buffers_.push_back(uncompress_buffer(compressed_buf, 
&uncompressed_buf));
-       std::cerr << "UNCOMPRESSED: " << (SDL_GetTicks() - ticks) << "\n";
-       ticks = SDL_GetTicks();
        output_ = uncompressed_buf.begin();
        const char* cbuf = output_;
        try {
@@ -670,7 +669,6 @@
                buffers_.clear();
                throw;
        }
-       std::cerr << "PARSED: " << (SDL_GetTicks() - ticks) << "\n";
 
        attach_list();
 }

Modified: trunk/src/server/simple_wml.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/simple_wml.hpp?rev=24747&r1=24746&r2=24747&view=diff
==============================================================================
--- trunk/src/server/simple_wml.hpp (original)
+++ trunk/src/server/simple_wml.hpp Mon Mar 17 17:31:32 2008
@@ -159,9 +159,9 @@
        string_span output_cache_;
 };
 
-enum INIT_BUFFER_CONTROL { INIT_TAKE_OWNERSHIP, INIT_STATIC };
-
-enum INIT_STATE { INIT_COMPRESSED };
+enum INIT_BUFFER_CONTROL { INIT_TAKE_OWNERSHIP };
+
+enum INIT_STATE { INIT_COMPRESSED, INIT_STATIC };
 
 class document
 {




Related Messages


Powered by MHonArc, Updated Mon Mar 17 17:41:05 2008