|
pred@2077
|
1 |
/** |
|
pred@2077
|
2 |
* vim: set ts=4 : |
|
pred@2077
|
3 |
* ============================================================================= |
|
pred@2077
|
4 |
* SourceMod |
|
pred@2077
|
5 |
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. |
|
pred@2077
|
6 |
* ============================================================================= |
|
pred@2077
|
7 |
* |
|
pred@2077
|
8 |
* This program is free software; you can redistribute it and/or modify it under |
|
pred@2077
|
9 |
* the terms of the GNU General Public License, version 3.0, as published by the |
|
pred@2077
|
10 |
* Free Software Foundation. |
|
pred@2077
|
11 |
* |
|
pred@2077
|
12 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
pred@2077
|
13 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
pred@2077
|
14 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
pred@2077
|
15 |
* details. |
|
pred@2077
|
16 |
* |
|
pred@2077
|
17 |
* You should have received a copy of the GNU General Public License along with |
|
pred@2077
|
18 |
* this program. If not, see <http://www.gnu.org/licenses/>. |
|
pred@2077
|
19 |
* |
|
pred@2077
|
20 |
* As a special exception, AlliedModders LLC gives you permission to link the |
|
pred@2077
|
21 |
* code of this program (as well as its derivative works) to "Half-Life 2," the |
|
pred@2077
|
22 |
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software |
|
pred@2077
|
23 |
* by the Valve Corporation. You must obey the GNU General Public License in |
|
pred@2077
|
24 |
* all respects for all other code used. Additionally, AlliedModders LLC grants |
|
pred@2077
|
25 |
* this exception to all derivative works. AlliedModders LLC defines further |
|
pred@2077
|
26 |
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), |
|
pred@2077
|
27 |
* or <http://www.sourcemod.net/license.php>. |
|
pred@2077
|
28 |
* |
|
pred@2077
|
29 |
* Version: $Id$ |
|
pred@2077
|
30 |
*/ |
|
pred@2077
|
31 |
|
|
pred@2077
|
32 |
#ifndef _INCLUDE_SOURCEMOD_NEXTMAP_H_ |
|
pred@2077
|
33 |
#define _INCLUDE_SOURCEMOD_NEXTMAP_H_ |
|
pred@2077
|
34 |
|
|
pred@2077
|
35 |
#include "sm_globals.h" |
|
pred@2077
|
36 |
#include "eiface.h" |
|
pred@2203
|
37 |
#include "sh_list.h" |
|
pred@2203
|
38 |
#include "sm_stringutil.h" |
|
pred@2203
|
39 |
|
|
pred@2203
|
40 |
struct MapChangeData |
|
pred@2203
|
41 |
{ |
|
pred@2203
|
42 |
MapChangeData(const char *mapName, const char *changeReason, time_t time) |
|
pred@2203
|
43 |
{ |
|
pred@2203
|
44 |
UTIL_Format(m_mapName, sizeof(m_mapName), mapName); |
|
pred@2203
|
45 |
UTIL_Format(m_changeReason, sizeof(m_changeReason), changeReason); |
|
pred@2203
|
46 |
startTime = time; |
|
pred@2203
|
47 |
} |
|
pred@2203
|
48 |
|
|
pred@2203
|
49 |
MapChangeData() |
|
pred@2203
|
50 |
{ |
|
pred@2203
|
51 |
m_mapName[0] = '\0'; |
|
pred@2203
|
52 |
m_changeReason[0] = '\0'; |
|
pred@2203
|
53 |
startTime = 0; |
|
pred@2203
|
54 |
} |
|
pred@2203
|
55 |
|
|
pred@2203
|
56 |
char m_mapName[32]; |
|
pred@2203
|
57 |
char m_changeReason[100]; |
|
pred@2203
|
58 |
time_t startTime; |
|
pred@2203
|
59 |
}; |
|
pred@2077
|
60 |
|
|
pred@2205
|
61 |
#if defined ORANGEBOX_BUILD |
|
pred@2205
|
62 |
void CmdChangeLevelCallback(const CCommand &command); |
|
pred@2205
|
63 |
#else |
|
pred@2205
|
64 |
void CmdChangeLevelCallback(); |
|
pred@2205
|
65 |
#endif |
|
pred@2205
|
66 |
|
|
pred@2077
|
67 |
class NextMapManager : public SMGlobalClass |
|
pred@2077
|
68 |
{ |
|
pred@2077
|
69 |
public: |
|
pred@2203
|
70 |
NextMapManager(); |
|
pred@2203
|
71 |
|
|
pred@2203
|
72 |
#if defined ORANGEBOX_BUILD |
|
pred@2203
|
73 |
friend void CmdChangeLevelCallback(const CCommand &command); |
|
pred@2203
|
74 |
#else |
|
pred@2203
|
75 |
friend void CmdChangeLevelCallback(); |
|
pred@2203
|
76 |
#endif |
|
pred@2203
|
77 |
|
|
pred@2077
|
78 |
void OnSourceModAllInitialized_Post(); |
|
pred@2077
|
79 |
void OnSourceModShutdown(); |
|
pred@2203
|
80 |
void OnSourceModLevelChange(const char *mapName); |
|
pred@2077
|
81 |
|
|
pred@2077
|
82 |
const char *GetNextMap(); |
|
pred@2077
|
83 |
bool SetNextMap(const char *map); |
|
pred@2077
|
84 |
|
|
pred@2203
|
85 |
void ForceChangeLevel(const char *mapName, const char* changeReason); |
|
pred@2203
|
86 |
|
|
pred@2077
|
87 |
void HookChangeLevel(const char *map, const char *unknown); |
|
pred@2203
|
88 |
|
|
pred@2203
|
89 |
public: |
|
pred@2203
|
90 |
SourceHook::List<MapChangeData *> m_mapHistory; |
|
pred@2203
|
91 |
|
|
pred@2203
|
92 |
private: |
|
pred@2203
|
93 |
MapChangeData m_tempChangeInfo; |
|
pred@2203
|
94 |
char lastMap[32]; |
|
pred@2077
|
95 |
}; |
|
pred@2077
|
96 |
|
|
pred@2077
|
97 |
extern NextMapManager g_NextMap; |
|
pred@2077
|
98 |
|
|
pred@2077
|
99 |
#endif //_INCLUDE_SOURCEMOD_NEXTMAP_H_ |