Progress toward implementing redirect

This commit is contained in:
2026-05-27 17:13:32 -04:00
parent 779c9f5c2e
commit e1f3c81cbd
6 changed files with 76 additions and 48 deletions

View File

@@ -107,17 +107,19 @@ public:
delete_client(client);
return false;
}
// Security check.
if (inv.actor() != client->actor_id_) {
delete_client(client);
return false;
}
// util::dprint("Invoking: ", inv.debug_string());
world_->invoke(inv);
// Acknowledge the invocation.
client->channel_->out()->write_uint8(util::MSG_ACK);
client->channel_->out()->write_uint32(0);
client->sync_->invoke(inv);
client->async_diff_ = true;
// Process the invocation.
//
// An invoke with the wrong actor_id is quietly a noop. This is
// to make leeway for clients who have recently been redirected, and
// who may not know their new actor_id yet.
if (inv.actor() == client->actor_id_) {
world_->invoke(inv);
client->sync_->invoke(inv);
client->async_diff_ = true;
}
return true;
}