diff --git a/luprex/cpp/core/drivenengine.cpp b/luprex/cpp/core/drivenengine.cpp index 1c64e525..fea88b8f 100644 --- a/luprex/cpp/core/drivenengine.cpp +++ b/luprex/cpp/core/drivenengine.cpp @@ -444,8 +444,7 @@ void DrivenEngine::drv_get_animation_queues(uint32_t count, const int64_t *ids, ////////////////////////////////////////////////////////////////////////////// void DrivenEngine::drv_initialize(uint32_t srcpklen, const char *srcpk, int argc, char **argv) { - drv_set_lua_source_pack(srcpklen, srcpk); - event_init(argc, argv); + event_init(std::string_view(srcpk, srcpklen), argc, argv); } void DrivenEngine::drv_clear_new_outgoing() { diff --git a/luprex/cpp/core/drivenengine.hpp b/luprex/cpp/core/drivenengine.hpp index 2591b459..0c43b222 100644 --- a/luprex/cpp/core/drivenengine.hpp +++ b/luprex/cpp/core/drivenengine.hpp @@ -144,7 +144,7 @@ public: // The init callback. You may override this in a subclass. // This will be called once at program initialization. // - virtual void event_init(int argc, char *argv[]) {} + virtual void event_init(std::string_view srcpk, int argc, char *argv[]) {} // The update callback. You may override this in a subclass. // This will be called whenever anything changes. diff --git a/luprex/cpp/core/lpxclient.cpp b/luprex/cpp/core/lpxclient.cpp index 872d4a25..5463dd7c 100644 --- a/luprex/cpp/core/lpxclient.cpp +++ b/luprex/cpp/core/lpxclient.cpp @@ -69,7 +69,7 @@ public: channel_.reset(); } - virtual void event_init(int argc, char *argv[]) { + virtual void event_init(std::string_view srcpk, int argc, char *argv[]) { // Put the world into the starting state. set_initial_state(); @@ -78,10 +78,6 @@ public: // Set the console prompt set_console_prompt(console_.get_prompt()); - - // The driver loads the lua source automatically. - // However, we don't need it. Throw it out. - get_lua_source_pack(); } void send_invocation(const Invocation &inv) { diff --git a/luprex/cpp/core/lpxserver.cpp b/luprex/cpp/core/lpxserver.cpp index 0134d562..729fa063 100644 --- a/luprex/cpp/core/lpxserver.cpp +++ b/luprex/cpp/core/lpxserver.cpp @@ -31,12 +31,12 @@ public: Gui gui_; public: - virtual void event_init(int argc, char *argv[]) { + virtual void event_init(std::string_view srcpk, int argc, char *argv[]) { // Create the master world model. master_.reset(new World(WORLD_TYPE_MASTER)); // Update the source code of the master model. - master_->update_source(get_lua_source_pack()); + master_->update_source(srcpk); // Create an actor for administrative commands. admin_id_ = master_->create_login_actor();