Refactor code to make it easier to do 'nopredict' inside of any function without having a dependency on world model.

This commit is contained in:
2023-03-01 16:07:13 -05:00
parent aa77480fb5
commit 9ce34d950b
15 changed files with 86 additions and 49 deletions

View File

@@ -33,7 +33,7 @@ public:
public:
virtual void event_init(int argc, char *argv[]) {
// Create the master world model.
master_.reset(new World(util::WORLD_TYPE_MASTER));
master_.reset(new World(WORLD_TYPE_MASTER));
// Update the source code of the master model.
master_->update_source(get_lua_source());
@@ -189,7 +189,7 @@ public:
Client *client = new Client;
client->actor_id_ = master_->create_login_actor();
client->channel_ = std::move(chan);
client->sync_.reset(new World(util::WORLD_TYPE_S_SYNC));
client->sync_.reset(new World(WORLD_TYPE_PREDICTIVE));
client->sync_->create_login_actor();
clients_.emplace_back(client);
stdostream() << "New client: actor id=" << client->actor_id_ << std::endl;