pred@2077: /**
pred@2077: * vim: set ts=4 :
pred@2077: * =============================================================================
pred@2077: * SourceMod
pred@2077: * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
pred@2077: * =============================================================================
pred@2077: *
pred@2077: * This program is free software; you can redistribute it and/or modify it under
pred@2077: * the terms of the GNU General Public License, version 3.0, as published by the
pred@2077: * Free Software Foundation.
pred@2077: *
pred@2077: * This program is distributed in the hope that it will be useful, but WITHOUT
pred@2077: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
pred@2077: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
pred@2077: * details.
pred@2077: *
pred@2077: * You should have received a copy of the GNU General Public License along with
pred@2077: * this program. If not, see .
pred@2077: *
pred@2077: * As a special exception, AlliedModders LLC gives you permission to link the
pred@2077: * code of this program (as well as its derivative works) to "Half-Life 2," the
pred@2077: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
pred@2077: * by the Valve Corporation. You must obey the GNU General Public License in
pred@2077: * all respects for all other code used. Additionally, AlliedModders LLC grants
pred@2077: * this exception to all derivative works. AlliedModders LLC defines further
pred@2077: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
pred@2077: * or .
pred@2077: *
pred@2077: * Version: $Id$
pred@2077: */
pred@2077:
pred@2077: #ifndef _INCLUDE_SOURCEMOD_NEXTMAP_H_
pred@2077: #define _INCLUDE_SOURCEMOD_NEXTMAP_H_
pred@2077:
pred@2077: #include "sm_globals.h"
pred@2077: #include "eiface.h"
pred@2203: #include "sh_list.h"
pred@2203: #include "sm_stringutil.h"
pred@2203:
pred@2203: struct MapChangeData
pred@2203: {
pred@2203: MapChangeData(const char *mapName, const char *changeReason, time_t time)
pred@2203: {
pred@2203: UTIL_Format(m_mapName, sizeof(m_mapName), mapName);
pred@2203: UTIL_Format(m_changeReason, sizeof(m_changeReason), changeReason);
pred@2203: startTime = time;
pred@2203: }
pred@2203:
pred@2203: MapChangeData()
pred@2203: {
pred@2203: m_mapName[0] = '\0';
pred@2203: m_changeReason[0] = '\0';
pred@2203: startTime = 0;
pred@2203: }
pred@2203:
skamonkey@4124: char m_mapName[PLATFORM_MAX_PATH];
pred@2203: char m_changeReason[100];
pred@2203: time_t startTime;
pred@2203: };
pred@2077:
skamonkey@3899: #if SOURCE_ENGINE == SE_DOTA
skamonkey@3942: void CmdChangeLevelCallback(const CCommandContext &context, const CCommand &command);
skamonkey@3899: #elif SOURCE_ENGINE >= SE_ORANGEBOX
pred@2205: void CmdChangeLevelCallback(const CCommand &command);
pred@2205: #else
pred@2205: void CmdChangeLevelCallback();
pred@2205: #endif
pred@2205:
pred@2077: class NextMapManager : public SMGlobalClass
pred@2077: {
pred@2077: public:
pred@2203: NextMapManager();
pred@2203:
skamonkey@3899: #if SOURCE_ENGINE == SE_DOTA
skamonkey@3942: friend void CmdChangeLevelCallback(const CCommandContext &context, const CCommand &command);
skamonkey@3899: #elif SOURCE_ENGINE >= SE_ORANGEBOX
pred@2203: friend void CmdChangeLevelCallback(const CCommand &command);
pred@2203: #else
pred@2203: friend void CmdChangeLevelCallback();
pred@2203: #endif
pred@2203:
pred@2077: void OnSourceModAllInitialized_Post();
pred@2077: void OnSourceModShutdown();
pred@2203: void OnSourceModLevelChange(const char *mapName);
pred@2077:
pred@2077: const char *GetNextMap();
pred@2077: bool SetNextMap(const char *map);
pred@2077:
pred@2203: void ForceChangeLevel(const char *mapName, const char* changeReason);
pred@2203:
ds@2583: #if SOURCE_ENGINE != SE_DARKMESSIAH
pred@2077: void HookChangeLevel(const char *map, const char *unknown);
ds@2583: #else
ds@2583: void HookChangeLevel(const char *map, const char *unknown, const char *video, bool bLongLoading);
ds@2583: #endif
pred@2203:
pred@2203: public:
pred@2203: SourceHook::List m_mapHistory;
pred@2203:
pred@2203: private:
pred@2203: MapChangeData m_tempChangeInfo;
pred@2203: char lastMap[32];
pred@2077: };
pred@2077:
pred@2077: extern NextMapManager g_NextMap;
pred@2077:
pred@2077: #endif //_INCLUDE_SOURCEMOD_NEXTMAP_H_