From a92e7da0f8620d4be9afc861eb9926fc35cd71ae Mon Sep 17 00:00:00 2001 From: /jedi/ Date: Thu, 6 Oct 2016 04:42:20 +0200 Subject: [PATCH] finetuning gameplay and disconnect fix --- game/network/session.cpp | 7 ++++++- game/state/trace.hpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/game/network/session.cpp b/game/network/session.cpp index 6bd360d..e622283 100644 --- a/game/network/session.cpp +++ b/game/network/session.cpp @@ -94,7 +94,12 @@ void Session::do_read() char c[]="> "; do_write(c,strlen(c)); } - } + }else if ((asio::error::eof == ec) || + (asio::error::connection_reset == ec)) + { + m_state->quitPlayer(m_pid); + } + }); } diff --git a/game/state/trace.hpp b/game/state/trace.hpp index b3eb104..9122b3b 100644 --- a/game/state/trace.hpp +++ b/game/state/trace.hpp @@ -14,7 +14,7 @@ namespace game { */ class Trace { public: - Trace(Missile *missile, float maxAge=12.0); + Trace(Missile *missile, float maxAge=15.0); ~Trace(); // Add the current position of the missile as a new point on the