File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -511,7 +511,24 @@ Local<Value> CommandClass::addOverload(const Arguments& args) {
511511 cmd.execute (onExecute);
512512 });
513513 };
514-
514+ if (args.size () == 0 ) {
515+ if (ll::getGamingStatus () == ll::GamingStatus::Starting) {
516+ EventBus::getInstance ().emplaceListener <ServerStartedEvent>(
517+ [commandName (commandName), e (EngineScope::currentEngine ())](ServerStartedEvent&) {
518+ getEngineData (e)->plugin ->registeredCommands [commandName].push_back ({});
519+ auto cmd = ll::command::CommandRegistrar::getInstance ()
520+ .getOrCreateCommand (commandName)
521+ .runtimeOverload (getEngineData (e)->plugin );
522+ cmd.execute (onExecute);
523+ }
524+ );
525+ } else {
526+ getEngineOwnData ()->plugin ->registeredCommands [commandName].push_back ({});
527+ auto cmd = get ().runtimeOverload (getEngineOwnData ()->plugin );
528+ cmd.execute (onExecute);
529+ }
530+ return Boolean::newBoolean (true );
531+ }
515532 if (args[0 ].isNumber ()) {
516533 if (ll::getGamingStatus () == ll::GamingStatus::Starting) {
517534 std::vector<std::string> paramNames;
You can’t perform that action at this time.
0 commit comments