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

summaryrefslogtreecommitdiff
path: root/source/game
diff options
context:
space:
mode:
authorWasabiRaptor <ketchupraptor@gmail.com>2025-05-25 19:12:06 -0400
committerWasabiRaptor <ketchupraptor@gmail.com>2025-05-25 19:12:06 -0400
commit28466a651bd8449f17bd229178698aa8eac7c56d (patch)
treee8e07473fec4af4ce5a1021390e76f7b34b99dac /source/game
parent59854f015602b791b51c20a008e78aaed68d20b9 (diff)
parent4b3cf6a40c4a2291dd6cf344320840ba7a1980b3 (diff)
Merge remote-tracking branch 'upstream/main' into networked-animator-improvements
Diffstat (limited to 'source/game')
-rw-r--r--source/game/StarUniverseClient.cpp10
-rw-r--r--source/game/StarWorldClient.cpp2
2 files changed, 10 insertions, 2 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;
diff --git a/source/game/StarWorldClient.cpp b/source/game/StarWorldClient.cpp
index 8db6a62..42b031a 100644
--- a/source/game/StarWorldClient.cpp
+++ b/source/game/StarWorldClient.cpp
@@ -1068,7 +1068,7 @@ void WorldClient::handleIncomingPackets(List<PacketPtr> const& packets) {
} else if (auto entityInteract = as<EntityInteractPacket>(packet)) {
auto interactResult = interact(entityInteract->interactRequest).result();
- m_outgoingPackets.append(make_shared<EntityInteractResultPacket>(interactResult.take(), entityInteract->requestId, entityInteract->interactRequest.sourceId));
+ m_outgoingPackets.append(make_shared<EntityInteractResultPacket>(interactResult.value(), entityInteract->requestId, entityInteract->interactRequest.sourceId));
} else if (auto interactResult = as<EntityInteractResultPacket>(packet)) {
if (auto response = m_entityInteractionResponses.maybeTake(interactResult->requestId)) {