attempt to fix compile errors
This commit is contained in:
parent
c3da3df551
commit
914e3c5500
3 changed files with 14 additions and 19 deletions
|
@ -451,16 +451,13 @@ void server::run() {
|
|||
//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()];
|
||||
|
|
|
@ -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 @@ document::document(const char* buf, INIT_STATE state) : output_(NULL),
|
|||
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 @@ document::document(string_span compressed_buf)
|
|||
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 @@ document::document(string_span compressed_buf)
|
|||
buffers_.clear();
|
||||
throw;
|
||||
}
|
||||
std::cerr << "PARSED: " << (SDL_GetTicks() - ticks) << "\n";
|
||||
|
||||
attach_list();
|
||||
}
|
||||
|
|
|
@ -159,9 +159,9 @@ private:
|
|||
string_span output_cache_;
|
||||
};
|
||||
|
||||
enum INIT_BUFFER_CONTROL { INIT_TAKE_OWNERSHIP, INIT_STATIC };
|
||||
enum INIT_BUFFER_CONTROL { INIT_TAKE_OWNERSHIP };
|
||||
|
||||
enum INIT_STATE { INIT_COMPRESSED };
|
||||
enum INIT_STATE { INIT_COMPRESSED, INIT_STATIC };
|
||||
|
||||
class document
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue