Client can now connect to servers interactively

This commit is contained in:
2024-02-22 17:30:24 -05:00
parent e68d63915d
commit 7f7bd5a781
8 changed files with 129 additions and 29 deletions

View File

@@ -41,6 +41,8 @@ public:
// Create an actor for administrative commands.
admin_id_ = master_->create_login_actor();
// TODO: initialize the admin actor.
// Print out admin ID for debugging purposes.
stdostream() << "Admin actor id = " << admin_id_ << std::endl;
@@ -196,8 +198,11 @@ public:
if (chan->port() == 8085) {
Client *client = new Client;
client->actor_id_ = master_->create_login_actor();
// TODO: initialize the login actor on the master.
client->channel_ = std::move(chan);
client->sync_.reset(new World(WORLD_TYPE_PREDICTIVE));
// This login actor is never used, it is just to preserve the invariant that
// the client model and the server synchronous model are identical.
client->sync_->create_login_actor();
clients_.emplace_back(client);
stdostream() << "New client: actor id=" << client->actor_id_ << std::endl;