drunderscore / Tappy

A Terraria server written in C++
GNU General Public License v3.0
6 stars 1 forks source link

Possible Server race condition/inconsistency #8

Closed drunderscore closed 2 years ago

drunderscore commented 3 years ago

This one is bizarre. With the following patch:

diff --git a/Server/Client.cpp b/Server/Client.cpp
index c506834..859cf61 100644
--- a/Server/Client.cpp
+++ b/Server/Client.cpp
@@ -187,6 +187,8 @@ void Client::on_ready_to_read()

     // TODO: Some of these packets contain the player id, but we ignore that and assume it's the player id we assigned to this socket.

+    outln("received a {}", packet_id);
+
     // Connection request, let's send a user slot
     if (packet_id == Terraria::Net::Packet::Id::ConnectRequest)
     {

The client will crash before loading into the world. I suppose we're barely sending things in the right order, and the delay puts things too far apart or out of order? But it's TCP so order shouldn't matter but maybe the game ticks within that time before it gets a value it expects to have at some point.

drunderscore commented 2 years ago

Does not seem to occur anymore