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

Method StartFromConsole

core/logic/ProfileTools.cpp:76–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void
77ProfileToolManager::StartFromConsole(IProfilingTool *tool)
78{
79 if (active_) {
80 rootmenu->ConsolePrint("A profile is already active using %s.", active_->Name());
81 return;
82 }
83
84 active_ = tool;
85 if (!active_->Start()) {
86 rootmenu->ConsolePrint("Failed to attach to or start %s.", active_->Name());
87 active_ = nullptr;
88 return;
89 }
90
91 g_pPawnEnv->SetProfilingTool(active_);
92 g_pPawnEnv->EnableProfiling();
93 rootmenu->ConsolePrint("Started profiling with %s.", active_->Name());
94
95 default_ = active_;
96}
97
98void
99ProfileToolManager::OnRootConsoleCommand(const char *cmdname, const ICommandArgs *args)

Callers

nothing calls this directly

Calls 3

NameMethod · 0.80
ConsolePrintMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected