From 0ab3da69fc15192d3b7bfac6e6e6ab94413f06ac Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 25 Jan 2015 13:17:47 +0000 Subject: [PATCH] Add line endings to formats. Lua reads from sockets line by line, so this simplifies a whole lot of lua code --- source/system/net.h | 2 +- source/ttrts/formatters.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/system/net.h b/source/system/net.h index bfcc97e..89c974e 100644 --- a/source/system/net.h +++ b/source/system/net.h @@ -16,7 +16,7 @@ #include #include -#define TTRTS_HANDSHAKE_FORMAT "player %u name %s" +#define TTRTS_HANDSHAKE_FORMAT "player %u name %s\n" //====================================================================================================================== // Structs for net management diff --git a/source/ttrts/formatters.cpp b/source/ttrts/formatters.cpp index 332c5ac..962f435 100644 --- a/source/ttrts/formatters.cpp +++ b/source/ttrts/formatters.cpp @@ -52,7 +52,7 @@ std::string GetStringFromGame( const CTTRTSGame& game ) state += '\n'; state += GAME_HEADER_DELIMITER; state += units; - state += "END"; + state += "END\n"; return state; }