core/CoreConfig.h
author David Anderson <dvander@alliedmods.net>
Thu Aug 09 19:05:34 2007 +0000 (2007-08-09)
changeset 1291 c6d26de53926
parent 1231 17badaf66ce4
child 1330 ab94316bb52b
permissions -rw-r--r--
added amb764, vote delay setting
ds@661
     1
/**
ds@661
     2
 * vim: set ts=4 :
dvander@1231
     3
 * ================================================================
dvander@1231
     4
 * SourceMod
dvander@1231
     5
 * Copyright (C) 2004-2007 AlliedModders LLC.  All rights reserved.
dvander@1231
     6
 * ================================================================
ds@661
     7
 *
dvander@1231
     8
 * This program is free software; you can redistribute it and/or 
dvander@1231
     9
 * modify it under the terms of the GNU General Public License, 
dvander@1231
    10
 * version 3.0, as published by the Free Software Foundation.
dvander@1231
    11
 * 
dvander@1231
    12
 * This program is distributed in the hope that it will be useful,
dvander@1231
    13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
dvander@1231
    14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dvander@1231
    15
 * GNU General Public License for more details.
dvander@1231
    16
 *
dvander@1231
    17
 * You should have received a copy of the GNU General Public License
dvander@1231
    18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
dvander@1231
    19
 *
dvander@1231
    20
 * As a special exception, AlliedModders LLC gives you permission to 
dvander@1231
    21
 * link the code of this program (as well as its derivative works) to 
dvander@1231
    22
 * "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any 
dvander@1231
    23
 * Game MODs that run on software by the Valve Corporation.  You must 
dvander@1231
    24
 * obey the GNU General Public License in all respects for all other 
dvander@1231
    25
 * code used. Additionally, AlliedModders LLC grants this exception 
dvander@1231
    26
 * to all derivative works. AlliedModders LLC defines further 
dvander@1231
    27
 * exceptions, found in LICENSE.txt (as of this writing, version 
dvander@1231
    28
 * JULY-31-2007), or <http://www.sourcemod.net/license.php>.
ds@661
    29
 *
ds@661
    30
 * Version: $Id$
ds@661
    31
 */
ds@661
    32
ds@661
    33
#ifndef _INCLUDE_SOURCEMOD_CORECONFIG_H_
ds@661
    34
#define _INCLUDE_SOURCEMOD_CORECONFIG_H_
ds@661
    35
ds@661
    36
#include "sm_globals.h"
ds@661
    37
#include <ITextParsers.h>
ds@661
    38
#include <IRootConsoleMenu.h>
ds@661
    39
ds@661
    40
using namespace SourceMod;
ds@661
    41
ds@661
    42
class CoreConfig : 
ds@661
    43
	public SMGlobalClass,
ds@661
    44
	public ITextListener_SMC,
ds@661
    45
	public IRootConsoleCommand
ds@661
    46
{
ds@661
    47
public: // SMGlobalClass
ds@661
    48
	void OnSourceModAllInitialized();
ds@661
    49
	void OnSourceModShutdown();
dvander@978
    50
	void OnSourceModLevelChange(const char *mapName);
ds@661
    51
public: // ITextListener_SMC
ds@661
    52
	SMCParseResult ReadSMC_KeyValue(const char *key, const char *value, bool key_quotes, bool value_quotes);
ds@661
    53
public: // IRootConsoleCommand
ds@661
    54
	void OnRootConsoleCommand(const char *command, unsigned int argcount);
ds@661
    55
public:
ds@661
    56
	/**
ds@661
    57
	 * Initializes CoreConfig by reading from core.cfg file
ds@661
    58
	 */
ds@661
    59
	void Initialize();
ds@661
    60
private:
ds@661
    61
	/**
ds@661
    62
	 * Sets configuration option by notifying SourceMod components that rely on core.cfg
ds@661
    63
	 */
dvander@663
    64
	ConfigResult SetConfigOption(const char *option, const char *value, ConfigSource, char *Error, size_t maxlength);
ds@661
    65
};
ds@661
    66
dvander@978
    67
extern bool SM_AreConfigsExecuted();
dvander@978
    68
extern void SM_ExecuteAllConfigs();
dvander@978
    69
extern void SM_ExecuteForPlugin(IPluginContext *ctx);
dvander@978
    70
extern void SM_ConfigsExecuted_Global();
dvander@978
    71
extern void SM_ConfigsExecuted_Plugin(unsigned int serial);
dvander@978
    72
ds@661
    73
extern CoreConfig g_CoreConfig;
ds@661
    74
ds@661
    75
#endif // _INCLUDE_SOURCEMOD_CORECONFIG_H_