core/CoreConfig.h
author Borja Ferrer <faluco@alliedmods.net>
Thu Jul 05 14:47:36 2007 +0000 (2007-07-05)
changeset 1041 f7b2073013df
parent 978 54782a83a1ef
child 1231 17badaf66ce4
permissions -rw-r--r--
added a time stamp argument to FormatTime
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     5  * ===============================================================
     6  *
     7  * This file is not open source and may not be copied without explicit
     8  * written permission of AlliedModders LLC.  This file may not be redistributed 
     9  * in whole or significant part.
    10  * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
    11  *
    12  * Version: $Id$
    13  */
    14 
    15 #ifndef _INCLUDE_SOURCEMOD_CORECONFIG_H_
    16 #define _INCLUDE_SOURCEMOD_CORECONFIG_H_
    17 
    18 #include "sm_globals.h"
    19 #include <ITextParsers.h>
    20 #include <IRootConsoleMenu.h>
    21 
    22 using namespace SourceMod;
    23 
    24 class CoreConfig : 
    25 	public SMGlobalClass,
    26 	public ITextListener_SMC,
    27 	public IRootConsoleCommand
    28 {
    29 public: // SMGlobalClass
    30 	void OnSourceModAllInitialized();
    31 	void OnSourceModShutdown();
    32 	void OnSourceModLevelChange(const char *mapName);
    33 public: // ITextListener_SMC
    34 	SMCParseResult ReadSMC_KeyValue(const char *key, const char *value, bool key_quotes, bool value_quotes);
    35 public: // IRootConsoleCommand
    36 	void OnRootConsoleCommand(const char *command, unsigned int argcount);
    37 public:
    38 	/**
    39 	 * Initializes CoreConfig by reading from core.cfg file
    40 	 */
    41 	void Initialize();
    42 private:
    43 	/**
    44 	 * Sets configuration option by notifying SourceMod components that rely on core.cfg
    45 	 */
    46 	ConfigResult SetConfigOption(const char *option, const char *value, ConfigSource, char *Error, size_t maxlength);
    47 };
    48 
    49 extern bool SM_AreConfigsExecuted();
    50 extern void SM_ExecuteAllConfigs();
    51 extern void SM_ExecuteForPlugin(IPluginContext *ctx);
    52 extern void SM_ConfigsExecuted_Global();
    53 extern void SM_ConfigsExecuted_Plugin(unsigned int serial);
    54 
    55 extern CoreConfig g_CoreConfig;
    56 
    57 #endif // _INCLUDE_SOURCEMOD_CORECONFIG_H_