Fixed message ordering issues
This commit is contained in:
parent
61e0b2ff24
commit
cda773915e
8 changed files with 48 additions and 29 deletions
|
|
@ -74,9 +74,9 @@ void DrawComponent::server_send_erase_set(MainServer& server, const std::unorder
|
|||
|
||||
void DrawComponent::server_send_update(MainServer& server, bool final) {
|
||||
if(final)
|
||||
server.netServer->send_items_to_all_clients(RELIABLE_COMMAND_CHANNEL, CLIENT_UPDATE_COMPONENT, id, *this);
|
||||
server.netServer->send_items_to_all_clients(RELIABLE_COMMAND_CHANNEL, CLIENT_UPDATE_COMPONENT, final, id, *this);
|
||||
else
|
||||
server.netServer->send_items_to_all_clients(UNRELIABLE_COMMAND_CHANNEL, CLIENT_UPDATE_COMPONENT, id, *this);
|
||||
server.netServer->send_items_to_all_clients(UNRELIABLE_COMMAND_CHANNEL, CLIENT_UPDATE_COMPONENT, final, id, *this);
|
||||
}
|
||||
|
||||
void DrawComponent::server_send_transform_many(MainServer& server, const std::vector<std::pair<ServerClientID, CoordSpaceHelper>>& transforms) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ DrawingProgram::DrawingProgram(World& initWorld):
|
|||
void DrawingProgram::init_client_callbacks() {
|
||||
world.con.client_add_recv_callback(CLIENT_UPDATE_COMPONENT, [&](cereal::PortableBinaryInputArchive& message) {
|
||||
ServerClientID id;
|
||||
message(id);
|
||||
bool isFinal; // Not actually used, but sent for debugging purposes
|
||||
message(isFinal, id);
|
||||
auto objPtr = components.get_item_by_id(id);
|
||||
if(!objPtr)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue