Move the "sm" command to core/logic.
This commit is contained in:
parent
1a7b708df8
commit
8a7dfdbc11
@ -35,7 +35,7 @@ namespace SourceMod {
|
|||||||
|
|
||||||
// Add 1 to the RHS of this expression to bump the intercom file
|
// Add 1 to the RHS of this expression to bump the intercom file
|
||||||
// This is to prevent mismatching core/logic binaries
|
// This is to prevent mismatching core/logic binaries
|
||||||
static const uint32_t SM_LOGIC_MAGIC = 0x0F47C0DE - 53;
|
static const uint32_t SM_LOGIC_MAGIC = 0x0F47C0DE - 54;
|
||||||
|
|
||||||
} // namespace SourceMod
|
} // namespace SourceMod
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ struct sm_logic_t
|
|||||||
void (*GenerateError)(IPluginContext *, cell_t, int, const char *, ...);
|
void (*GenerateError)(IPluginContext *, cell_t, int, const char *, ...);
|
||||||
void (*AddNatives)(sp_nativeinfo_t *natives);
|
void (*AddNatives)(sp_nativeinfo_t *natives);
|
||||||
void (*RegisterProfiler)(IProfilingTool *tool);
|
void (*RegisterProfiler)(IProfilingTool *tool);
|
||||||
void (*OnRootCommand)(const ICommandArgs *args);
|
|
||||||
IDataPack * (*CreateDataPack)();
|
IDataPack * (*CreateDataPack)();
|
||||||
void (*FreeDataPack)(IDataPack *pack);
|
void (*FreeDataPack)(IDataPack *pack);
|
||||||
IScriptManager *scripts;
|
IScriptManager *scripts;
|
||||||
|
@ -36,7 +36,6 @@ project.sources += [
|
|||||||
'EventManager.cpp',
|
'EventManager.cpp',
|
||||||
'MenuStyle_Radio.cpp',
|
'MenuStyle_Radio.cpp',
|
||||||
'sm_autonatives.cpp',
|
'sm_autonatives.cpp',
|
||||||
'sm_srvcmds.cpp',
|
|
||||||
'ConsoleDetours.cpp',
|
'ConsoleDetours.cpp',
|
||||||
'vprof_tool.cpp',
|
'vprof_tool.cpp',
|
||||||
'smn_commandline.cpp',
|
'smn_commandline.cpp',
|
||||||
|
@ -57,6 +57,10 @@ void RootConsoleMenu::OnSourceModStartup(bool late)
|
|||||||
|
|
||||||
bridge->DefineCommand("sm_dump_handles", "Dumps Handle usage to a file for finding Handle leaks",
|
bridge->DefineCommand("sm_dump_handles", "Dumps Handle usage to a file for finding Handle leaks",
|
||||||
sm_dump_handles);
|
sm_dump_handles);
|
||||||
|
bridge->DefineCommand("sm", "SourceMod Menu", [this] (int client, const ICommandArgs *args) -> bool {
|
||||||
|
GotRootCmd(args);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void RootConsoleMenu::OnSourceModAllInitialized()
|
void RootConsoleMenu::OnSourceModAllInitialized()
|
||||||
@ -281,4 +285,5 @@ static bool sm_dump_handles(int client, const ICommandArgs *args)
|
|||||||
|
|
||||||
g_HandleSys.Dump(write_handles_to_log);
|
g_HandleSys.Dump(write_handles_to_log);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -114,11 +114,6 @@ static void RegisterProfiler(IProfilingTool *tool)
|
|||||||
g_ProfileToolManager.RegisterTool(tool);
|
g_ProfileToolManager.RegisterTool(tool);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OnRootCommand(const ICommandArgs *args)
|
|
||||||
{
|
|
||||||
g_RootMenu.GotRootCmd(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Defined in smn_filesystem.cpp.
|
// Defined in smn_filesystem.cpp.
|
||||||
extern bool OnLogPrint(const char *msg);
|
extern bool OnLogPrint(const char *msg);
|
||||||
|
|
||||||
@ -150,7 +145,6 @@ static sm_logic_t logic =
|
|||||||
GenerateError,
|
GenerateError,
|
||||||
AddNatives,
|
AddNatives,
|
||||||
RegisterProfiler,
|
RegisterProfiler,
|
||||||
OnRootCommand,
|
|
||||||
CDataPack::New,
|
CDataPack::New,
|
||||||
CDataPack::Free,
|
CDataPack::Free,
|
||||||
&g_PluginSys,
|
&g_PluginSys,
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 sw=4 tw=99 noet :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod
|
|
||||||
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
#include "sourcemod.h"
|
|
||||||
#include "sourcemm_api.h"
|
|
||||||
#include "logic_bridge.h"
|
|
||||||
#include "sm_globals.h"
|
|
||||||
#include "CoreConfig.h"
|
|
||||||
#include "command_args.h"
|
|
||||||
#include <ITranslator.h>
|
|
||||||
#include <amtl/am-string.h>
|
|
||||||
|
|
||||||
CON_COMMAND(sm, "SourceMod Menu")
|
|
||||||
{
|
|
||||||
#if SOURCE_ENGINE <= SE_DARKMESSIAH
|
|
||||||
CCommand args;
|
|
||||||
#endif
|
|
||||||
EngineArgs cargs(args);
|
|
||||||
|
|
||||||
logicore.OnRootCommand(&cargs);
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user