Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarUniverseClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/game/StarUniverseClient.cpp')
-rw-r--r--source/game/StarUniverseClient.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/game/StarUniverseClient.cpp b/source/game/StarUniverseClient.cpp
index 9a1f31b..394cacc 100644
--- a/source/game/StarUniverseClient.cpp
+++ b/source/game/StarUniverseClient.cpp
@@ -258,7 +258,15 @@ void UniverseClient::update(float dt) {
}
m_connection->receive();
- handlePackets(m_connection->pull());
+ try {
+ handlePackets(m_connection->pull());
+ }
+ catch (StarException const& e) {
+ Logger::error("Exception caught handling incoming server packets {}", outputException(e, true));
+ reset();
+ if (!m_disconnectReason)
+ m_disconnectReason = String("Exception caught handling incoming server packets, check log");
+ }
if (!isConnected())
return;