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