Fixed build for real.
3 * =============================================================================
4 * SourceMod Extension Code for Metamod:Source
5 * Copyright (C) 2004-2008 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>.
34 #include "stub_util.h"
39 bool SM_LoadExtension(char *error, size_t maxlength)
41 if ((smexts = (IExtensionManager *)g_SMAPI->MetaFactory(
42 SOURCEMOD_INTERFACE_EXTENSIONS,
47 if (error && maxlength)
49 UTIL_Format(error, maxlength, SOURCEMOD_INTERFACE_EXTENSIONS " interface not found");
54 /* This could be more dynamic */
56 g_SMAPI->PathFormat(path,
58 "addons/myplugin/bin/myplugin%s",
66 if ((myself = smexts->LoadExternal(&g_SMExt,
80 void SM_UnloadExtension()
82 smexts->UnloadExtension(myself);
85 bool MyExtension::OnExtensionLoad(IExtension *me,
94 /* Get the default interfaces from our configured SDK header */
95 if (!SM_AcquireInterfaces(error, maxlength))
103 void MyExtension::OnExtensionUnload()
105 /* Clean up any resources here, and more importantly, make sure
106 * any listeners/hooks into SourceMod are totally removed, as well
107 * as data structures like handle types and forwards.
112 /* Make sure our pointers get NULL'd just in case */
113 SM_UnsetInterfaces();
116 void MyExtension::OnExtensionsAllLoaded()
118 /* Called once all extensions are marked as loaded.
119 * This always called, and always called only once.
123 void MyExtension::OnExtensionPauseChange(bool pause)
127 bool MyExtension::QueryRunning(char *error, size_t maxlength)
129 /* if something is required that can't be determined during the initial
130 * load process, print a message here will show a helpful message to
131 * users when they view the extension's info.
136 bool MyExtension::IsMetamodExtension()
138 /* Must return false! */
142 const char *MyExtension::GetExtensionName()
144 return mmsplugin->GetName();
147 const char *MyExtension::GetExtensionURL()
149 return mmsplugin->GetURL();
152 const char *MyExtension::GetExtensionTag()
154 return mmsplugin->GetLogTag();
157 const char *MyExtension::GetExtensionAuthor()
159 return mmsplugin->GetAuthor();
162 const char *MyExtension::GetExtensionVerString()
164 return mmsplugin->GetVersion();
167 const char *MyExtension::GetExtensionDescription()
169 return mmsplugin->GetDescription();
172 const char *MyExtension::GetExtensionDateString()
174 return mmsplugin->GetDate();