MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / LoadBridge

Method LoadBridge

core/logic_bridge.cpp:696–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694}
695
696bool CoreProviderImpl::LoadBridge(char *error, size_t maxlength)
697{
698 char file[PLATFORM_MAX_PATH];
699
700 /* Now it's time to load the logic binary */
701 g_SMAPI->PathFormat(file,
702 sizeof(file),
703 "%s/bin/" PLATFORM_ARCH_FOLDER "sourcemod.logic." PLATFORM_LIB_EXT,
704 g_SourceMod.GetSourceModPath());
705
706 char myerror[255];
707 logic_ = ke::SharedLib::Open(file, myerror, sizeof(myerror));
708 if (!logic_) {
709 ke::SafeSprintf(error, maxlength, "failed to load %s: %s", file, myerror);
710 return false;
711 }
712
713 LogicLoadFunction llf = logic_->get<decltype(llf)>("logic_load");
714 if (!llf) {
715 logic_ = nullptr;
716 ke::SafeStrcpy(error, maxlength, "could not find logic_load function");
717 return false;
718 }
719
720 GetITextParsers getitxt = logic_->get<decltype(getitxt)>("get_textparsers");
721 textparsers = getitxt();
722
723 logic_init_ = llf(SM_LOGIC_MAGIC);
724 if (!logic_init_) {
725 ke::SafeStrcpy(error, maxlength, "component version mismatch");
726 return false;
727 }
728 return true;
729}
730
731ke::RefPtr<CommandHook>
732CoreProviderImpl::AddCommandHook(ConCommand *cmd, const CommandHook::Callback &callback)

Callers 2

StartLogicBridgeFunction · 0.80
InitializeSourceModMethod · 0.80

Calls 2

PathFormatMethod · 0.80
GetSourceModPathMethod · 0.80

Tested by

no test coverage detected