ds@661: /**
dvander@4070: * vim: set ts=4 sw=4 tw=99 noet :
ds@1330: * =============================================================================
dvander@1231: * SourceMod
ds@1947: * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
ds@1330: * =============================================================================
ds@661: *
ds@1330: * This program is free software; you can redistribute it and/or modify it under
ds@1330: * the terms of the GNU General Public License, version 3.0, as published by the
ds@1330: * Free Software Foundation.
dvander@1231: *
ds@1330: * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1330: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1330: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
ds@1330: * details.
dvander@1231: *
ds@1330: * You should have received a copy of the GNU General Public License along with
ds@1330: * this program. If not, see .
dvander@1231: *
ds@1330: * As a special exception, AlliedModders LLC gives you permission to link the
ds@1330: * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1330: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1330: * by the Valve Corporation. You must obey the GNU General Public License in
ds@1330: * all respects for all other code used. Additionally, AlliedModders LLC grants
ds@1330: * this exception to all derivative works. AlliedModders LLC defines further
ds@1330: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1330: * or .
ds@661: *
ds@661: * Version: $Id$
ds@661: */
ds@661:
ds@661: #ifndef _INCLUDE_SOURCEMOD_CORECONFIG_H_
ds@661: #define _INCLUDE_SOURCEMOD_CORECONFIG_H_
ds@661:
ds@661: #include "sm_globals.h"
ds@661: #include
ds@661: #include
dvander@4110: #include
dvander@4070: #include
ds@661:
ds@661: using namespace SourceMod;
ds@661:
ds@661: class CoreConfig :
ds@661: public SMGlobalClass,
ds@661: public ITextListener_SMC,
ds@661: public IRootConsoleCommand
ds@661: {
dvander@2574: public:
dvander@2574: CoreConfig();
dvander@2574: ~CoreConfig();
ds@661: public: // SMGlobalClass
ds@661: void OnSourceModAllInitialized();
ds@661: void OnSourceModShutdown();
dvander@978: void OnSourceModLevelChange(const char *mapName);
ds@661: public: // ITextListener_SMC
dvander@1656: SMCResult ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value);
ds@661: public: // IRootConsoleCommand
faluco@1541: void OnRootConsoleCommand(const char *cmdname, const CCommand &command);
ds@661: public:
ds@661: /**
ds@661: * Initializes CoreConfig by reading from core.cfg file
ds@661: */
ds@661: void Initialize();
dvander@2574: const char *GetCoreConfigValue(const char *key);
ds@661: private:
ds@661: /**
ds@661: * Sets configuration option by notifying SourceMod components that rely on core.cfg
ds@661: */
dvander@663: ConfigResult SetConfigOption(const char *option, const char *value, ConfigSource, char *Error, size_t maxlength);
dvander@2574: private:
dvander@4110: StringHashMap m_KeyValues;
ds@661: };
ds@661:
dvander@978: extern bool SM_AreConfigsExecuted();
dvander@978: extern void SM_ExecuteAllConfigs();
dvander@978: extern void SM_ExecuteForPlugin(IPluginContext *ctx);
dvander@978: extern void SM_ConfigsExecuted_Global();
dvander@978: extern void SM_ConfigsExecuted_Plugin(unsigned int serial);
dvander@2235: extern void SM_InternalCmdTrigger();
dvander@978:
ds@661: extern CoreConfig g_CoreConfig;
ds@661:
ds@661: #endif // _INCLUDE_SOURCEMOD_CORECONFIG_H_