3 * =============================================================================
5 * Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
6 * =============================================================================
8 * This program is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, version 3.0, as published by the
10 * Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to link the
21 * code of this program (as well as its derivative works) to "Half-Life 2," the
22 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
23 * by the Valve Corporation. You must obey the GNU General Public License in
24 * all respects for all other code used. Additionally, AlliedModders LLC grants
25 * this exception to all derivative works. AlliedModders LLC defines further
26 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
27 * or <http://www.sourcemod.net/license.php>.
32 #include <sp_vm_api.h>
33 #include <IHandleSys.h>
34 #include <IShareSys.h>
36 #ifndef _INCLUDE_SOURCEMOD_INTERCOM_H_
37 #define _INCLUDE_SOURCEMOD_INTERCOM_H_
39 using namespace SourceMod;
42 * Add 1 to the RHS of this expression to bump the intercom file
43 * This is to prevent mismatching core/logic binaries
45 #define SM_LOGIC_MAGIC (0x0F47C0DE - 15)
50 class IVEngineServer_Logic
54 virtual bool IsMapValid(const char *map) = 0;
55 virtual void ServerCommand(const char *cmd) = 0;
66 class IForwardManager;
71 class IPhraseCollection;
81 const double *universalTime;
82 float *interval_per_tick;
89 IHandleSys *handlesys;
90 IdentityToken_t *core_ident;
93 IVEngineServer *engine;
95 IRootConsole *rootmenu;
96 IPluginManager *pluginsys;
97 IForwardManager *forwardsys;
98 ITimerSystem *timersys;
99 IPlayerManager *playerhelpers;
100 IAdminSystem *adminsys;
101 IGameHelpers *gamehelpers;
103 void (*AddNatives)(sp_nativeinfo_t* nlist);
104 ConVar * (*FindConVar)(const char*);
105 unsigned int (*strncopy)(char*, const char*, size_t);
106 char * (*TrimWhitespace)(char *, size_t &);
107 void (*LogError)(const char*, ...);
108 const char * (*GetCvarString)(ConVar*);
109 size_t (*Format)(char*, size_t, const char*, ...);
110 void (*GenerateError)(IPluginContext *, cell_t, int, const char *, ...);
111 bool (*gnprintf)(char *, size_t, const char *, IPhraseCollection *, void **,
112 unsigned int, unsigned int &, size_t *, const char **);
113 size_t (*atcprintf)(char *, size_t, const char *, IPluginContext *, const cell_t *, int *);
114 bool (*GetGameName)(char *buffer, size_t maxlength);
115 const char * (*GetGameDescription)();
116 const char * (*GetSourceEngineName)();
117 bool (*SymbolsAreHidden)();
119 ServerGlobals *serverGlobals;
120 void * serverFactory;
121 void * engineFactory;
129 ITranslator *translator;
130 const char *(*stristr)(const char *, const char *);
131 bool (*CoreTranslate)(char *, size_t, const char *, unsigned int, size_t *, ...);
132 void (*AddCorePhraseFile)(const char *filename);
133 unsigned int (*ReplaceAll)(char*, size_t, const char *, const char *, bool);
134 char *(*ReplaceEx)(char *, size_t, const char *, size_t, const char *, size_t, bool);
135 size_t (*DecodeHexString)(unsigned char *, size_t, const char *);
136 IGameConfig * (*GetCoreGameConfig)();
139 typedef void (*LogicInitFunction)(const sm_core_t *core, sm_logic_t *logic);
140 typedef LogicInitFunction (*LogicLoadFunction)(uint32_t magic);
141 typedef ITextParsers *(*GetITextParsers)();
143 #endif /* _INCLUDE_SOURCEMOD_INTERCOM_H_ */