diff --git a/sourcehook/smm_list.h b/sourcehook/sh_list.h similarity index 99% rename from sourcehook/smm_list.h rename to sourcehook/sh_list.h index 0a6c5a7..c06b1ef 100644 --- a/sourcehook/smm_list.h +++ b/sourcehook/sh_list.h @@ -11,6 +11,8 @@ #ifndef _INCLUDE_SMM_LIST_H #define _INCLUDE_SMM_LIST_H +namespace SourceHook +{ //This class is from CSDM_amxx by BAILOPAN // template @@ -240,5 +242,6 @@ public: return *this; } }; +}; //NAMESPACE #endif //_INCLUDE_CSDM_LIST_H diff --git a/sourcehook/smm_string.h b/sourcehook/sh_string.h similarity index 99% rename from sourcehook/smm_string.h rename to sourcehook/sh_string.h index 2d19502..97bda37 100755 --- a/sourcehook/smm_string.h +++ b/sourcehook/sh_string.h @@ -20,6 +20,9 @@ #include #include +namespace SourceHook +{ + class String { public: @@ -361,4 +364,6 @@ public: static const int npos = -1; }; +}; //NAMESPACE + #endif //_INCLUDE_CSTRING_H diff --git a/sourcehook/sourcehook.h b/sourcehook/sourcehook.h index d20242e..e328e90 100644 --- a/sourcehook/sourcehook.h +++ b/sourcehook/sourcehook.h @@ -68,7 +68,7 @@ #include "FastDelegate.h" #include "sh_memfuncinfo.h" #include "sh_memory.h" -#include "smm_list.h" +#include "sh_list.h" #include #include diff --git a/sourcehook/test/main.cpp b/sourcehook/test/main.cpp index bfc22ad..ecd8114 100644 --- a/sourcehook/test/main.cpp +++ b/sourcehook/test/main.cpp @@ -6,7 +6,6 @@ #include #include #include "sourcehook_impl.h" -#include "smm_list.h" using namespace std; diff --git a/sourcemm/CPlugin.cpp b/sourcemm/CPlugin.cpp index eb6f794..b02acfa 100644 --- a/sourcemm/CPlugin.cpp +++ b/sourcemm/CPlugin.cpp @@ -389,7 +389,7 @@ bool CPluginManager::UnloadAll() { PluginIter i; - List remqueue; + SourceHook::List remqueue; for (i=m_Plugins.begin(); i!=m_Plugins.end(); i++) remqueue.push_back( (*i) ); @@ -476,7 +476,7 @@ void CPluginManager::RemovePluginCmd(ISmmPlugin *api, ConCommandBase *pCmd) void CPluginManager::UnregAllConCmds(CPlugin *pl) { - List::iterator i; + SourceHook::List::iterator i; for (i=pl->m_Cvars.begin(); i!=pl->m_Cvars.end(); i++) g_SMConVarAccessor.Unregister( (*i) ); diff --git a/sourcemm/CPlugin.h b/sourcemm/CPlugin.h index 0a9a32a..6a58aad 100644 --- a/sourcemm/CPlugin.h +++ b/sourcemm/CPlugin.h @@ -21,8 +21,8 @@ #include #include "IPluginManager.h" #include "oslink.h" -#include "smm_list.h" -#include "smm_string.h" +#include "sh_list.h" +#include "sh_string.h" /** * History of plugin versions: (M=min, C=current) @@ -54,14 +54,14 @@ namespace SourceMM CPlugin(); public: PluginId m_Id; - String m_File; + SourceHook::String m_File; Pl_Status m_Status; PluginId m_Source; ISmmPlugin *m_API; HINSTANCE m_Lib; factories fac_list; - List m_Cvars; - List m_Cmds; + SourceHook::List m_Cvars; + SourceHook::List m_Cmds; }; public: CPluginManager(); @@ -102,8 +102,8 @@ namespace SourceMM bool Retry(PluginId id, char *error, size_t len); //Internal iterators - List::iterator _begin(); - List::iterator _end(); + SourceHook::List::iterator _begin(); + SourceHook::List::iterator _end(); private: //These are identical internal functions for the wrappers above. CPlugin *_Load(const char *file, PluginId source, char *error, size_t maxlen); @@ -113,12 +113,12 @@ namespace SourceMM void UnregAllConCmds(CPlugin *pl); private: PluginId m_LastId; - List m_Plugins; + SourceHook::List m_Plugins; bool m_AllLoaded; }; }; -typedef List::iterator PluginIter; +typedef SourceHook::List::iterator PluginIter; /** @brief Singleton for plugin manager */ extern SourceMM::CPluginManager g_PluginMngr; diff --git a/sourcemm/concommands.cpp b/sourcemm/concommands.cpp index d70e748..82e6668 100644 --- a/sourcemm/concommands.cpp +++ b/sourcemm/concommands.cpp @@ -12,8 +12,8 @@ #include "CSmmAPI.h" #include "concommands.h" #include "CPlugin.h" -#include "smm_string.h" -#include "smm_list.h" +#include "sh_string.h" +#include "sh_list.h" /** * @brief Console Command Implementations @@ -50,7 +50,7 @@ bool SMConVarAccessor::Register(ConCommandBase *pCommand) void SMConVarAccessor::MarkCommandsAsGameDLL() { - for (List::iterator iter = m_RegisteredCommands.begin(); + for (SourceHook::List::iterator iter = m_RegisteredCommands.begin(); iter != m_RegisteredCommands.end(); ++iter) { (*iter)->AddFlags(FCVAR_GAMEDLL); @@ -203,7 +203,7 @@ CON_COMMAND(meta, "Metamod:Source Menu") CONMSG("Plugin %d is not loaded.\n", id); } else { CONMSG("Console commands for %s:\n", pl->m_API->GetName()); - List::iterator ci; + SourceHook::List::iterator ci; size_t count = 0; for (ci=pl->m_Cmds.begin(); ci!=pl->m_Cmds.end(); ci++) @@ -234,7 +234,7 @@ CON_COMMAND(meta, "Metamod:Source Menu") CONMSG("Plugin %d is not loaded.\n", id); } else { CONMSG("Registered cvars for %s:\n", pl->m_API->GetName()); - List::iterator ci; + SourceHook::List::iterator ci; size_t count = 0; for (ci=pl->m_Cvars.begin(); ci!=pl->m_Cvars.end(); ci++) diff --git a/sourcemm/concommands.h b/sourcemm/concommands.h index 1d97f80..7f7db7f 100644 --- a/sourcemm/concommands.h +++ b/sourcemm/concommands.h @@ -20,11 +20,11 @@ #include #include "sourcemm.h" #include -#include "smm_list.h" +#include "sh_list.h" class SMConVarAccessor : public IConCommandBaseAccessor { - List m_RegisteredCommands; + SourceHook::List m_RegisteredCommands; public: virtual bool RegisterConCommandBase(ConCommandBase *pCommand); bool Register(ConCommandBase *pCommand); diff --git a/sourcemm/sourcemm.cpp b/sourcemm/sourcemm.cpp index c15b09d..777f0ce 100644 --- a/sourcemm/sourcemm.cpp +++ b/sourcemm/sourcemm.cpp @@ -34,8 +34,8 @@ GameDllInfo g_GameDll = {false, NULL, NULL}; EngineInfo g_Engine = {NULL, NULL, NULL, NULL}; SourceHook::CSourceHookImpl g_SourceHook; SourceHook::ISourceHook *g_SHPtr; -String g_ModPath; -String g_BinPath; +SourceHook::String g_ModPath; +SourceHook::String g_BinPath; PluginId g_PLID = Pl_Console; //Technically, SourceMM is the "Console" plugin... :p bool bInShutdown = false; bool bInFirstLevel = true; diff --git a/sourcemm/sourcemm.h b/sourcemm/sourcemm.h index 124493f..42a47cb 100644 --- a/sourcemm/sourcemm.h +++ b/sourcemm/sourcemm.h @@ -78,10 +78,10 @@ extern EngineInfo g_Engine; extern SourceHook::CSourceHookImpl g_SourceHook; /** @brief Mod path (important!)*/ -extern String g_ModPath; +extern SourceHook::String g_ModPath; /** @brief Path to server binary */ -extern String g_BinPath; +extern SourceHook::String g_BinPath; /** @brief Global variable for SourceHook macros */ extern SourceHook::ISourceHook *g_SHPtr; diff --git a/sourcemm/sourcemm.vcproj b/sourcemm/sourcemm.vcproj index 4ff43d7..5c9c12d 100644 --- a/sourcemm/sourcemm.vcproj +++ b/sourcemm/sourcemm.vcproj @@ -180,15 +180,6 @@ - - - - - - @@ -220,6 +211,9 @@ + +