mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-20 13:54:14 +01:00
Changed to namespaces
--HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%4099
This commit is contained in:
parent
05f9912d4e
commit
ac1ea74510
@ -11,6 +11,8 @@
|
|||||||
#ifndef _INCLUDE_SMM_LIST_H
|
#ifndef _INCLUDE_SMM_LIST_H
|
||||||
#define _INCLUDE_SMM_LIST_H
|
#define _INCLUDE_SMM_LIST_H
|
||||||
|
|
||||||
|
namespace SourceHook
|
||||||
|
{
|
||||||
//This class is from CSDM_amxx by BAILOPAN
|
//This class is from CSDM_amxx by BAILOPAN
|
||||||
//
|
//
|
||||||
template <class T>
|
template <class T>
|
||||||
@ -240,5 +242,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}; //NAMESPACE
|
||||||
|
|
||||||
#endif //_INCLUDE_CSDM_LIST_H
|
#endif //_INCLUDE_CSDM_LIST_H
|
@ -20,6 +20,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
namespace SourceHook
|
||||||
|
{
|
||||||
|
|
||||||
class String
|
class String
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -361,4 +364,6 @@ public:
|
|||||||
static const int npos = -1;
|
static const int npos = -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}; //NAMESPACE
|
||||||
|
|
||||||
#endif //_INCLUDE_CSTRING_H
|
#endif //_INCLUDE_CSTRING_H
|
@ -68,7 +68,7 @@
|
|||||||
#include "FastDelegate.h"
|
#include "FastDelegate.h"
|
||||||
#include "sh_memfuncinfo.h"
|
#include "sh_memfuncinfo.h"
|
||||||
#include "sh_memory.h"
|
#include "sh_memory.h"
|
||||||
#include "smm_list.h"
|
#include "sh_list.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include "sourcehook_impl.h"
|
#include "sourcehook_impl.h"
|
||||||
#include "smm_list.h"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ bool CPluginManager::UnloadAll()
|
|||||||
{
|
{
|
||||||
PluginIter i;
|
PluginIter i;
|
||||||
|
|
||||||
List<SourceMM::CPluginManager::CPlugin *> remqueue;
|
SourceHook::List<SourceMM::CPluginManager::CPlugin *> remqueue;
|
||||||
|
|
||||||
for (i=m_Plugins.begin(); i!=m_Plugins.end(); i++)
|
for (i=m_Plugins.begin(); i!=m_Plugins.end(); i++)
|
||||||
remqueue.push_back( (*i) );
|
remqueue.push_back( (*i) );
|
||||||
@ -476,7 +476,7 @@ void CPluginManager::RemovePluginCmd(ISmmPlugin *api, ConCommandBase *pCmd)
|
|||||||
|
|
||||||
void CPluginManager::UnregAllConCmds(CPlugin *pl)
|
void CPluginManager::UnregAllConCmds(CPlugin *pl)
|
||||||
{
|
{
|
||||||
List<ConCommandBase *>::iterator i;
|
SourceHook::List<ConCommandBase *>::iterator i;
|
||||||
|
|
||||||
for (i=pl->m_Cvars.begin(); i!=pl->m_Cvars.end(); i++)
|
for (i=pl->m_Cvars.begin(); i!=pl->m_Cvars.end(); i++)
|
||||||
g_SMConVarAccessor.Unregister( (*i) );
|
g_SMConVarAccessor.Unregister( (*i) );
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
#include <convar.h>
|
#include <convar.h>
|
||||||
#include "IPluginManager.h"
|
#include "IPluginManager.h"
|
||||||
#include "oslink.h"
|
#include "oslink.h"
|
||||||
#include "smm_list.h"
|
#include "sh_list.h"
|
||||||
#include "smm_string.h"
|
#include "sh_string.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* History of plugin versions: (M=min, C=current)
|
* History of plugin versions: (M=min, C=current)
|
||||||
@ -54,14 +54,14 @@ namespace SourceMM
|
|||||||
CPlugin();
|
CPlugin();
|
||||||
public:
|
public:
|
||||||
PluginId m_Id;
|
PluginId m_Id;
|
||||||
String m_File;
|
SourceHook::String m_File;
|
||||||
Pl_Status m_Status;
|
Pl_Status m_Status;
|
||||||
PluginId m_Source;
|
PluginId m_Source;
|
||||||
ISmmPlugin *m_API;
|
ISmmPlugin *m_API;
|
||||||
HINSTANCE m_Lib;
|
HINSTANCE m_Lib;
|
||||||
factories fac_list;
|
factories fac_list;
|
||||||
List<ConCommandBase *> m_Cvars;
|
SourceHook::List<ConCommandBase *> m_Cvars;
|
||||||
List<ConCommandBase *> m_Cmds;
|
SourceHook::List<ConCommandBase *> m_Cmds;
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
CPluginManager();
|
CPluginManager();
|
||||||
@ -102,8 +102,8 @@ namespace SourceMM
|
|||||||
bool Retry(PluginId id, char *error, size_t len);
|
bool Retry(PluginId id, char *error, size_t len);
|
||||||
|
|
||||||
//Internal iterators
|
//Internal iterators
|
||||||
List<SourceMM::CPluginManager::CPlugin *>::iterator _begin();
|
SourceHook::List<SourceMM::CPluginManager::CPlugin *>::iterator _begin();
|
||||||
List<SourceMM::CPluginManager::CPlugin *>::iterator _end();
|
SourceHook::List<SourceMM::CPluginManager::CPlugin *>::iterator _end();
|
||||||
private:
|
private:
|
||||||
//These are identical internal functions for the wrappers above.
|
//These are identical internal functions for the wrappers above.
|
||||||
CPlugin *_Load(const char *file, PluginId source, char *error, size_t maxlen);
|
CPlugin *_Load(const char *file, PluginId source, char *error, size_t maxlen);
|
||||||
@ -113,12 +113,12 @@ namespace SourceMM
|
|||||||
void UnregAllConCmds(CPlugin *pl);
|
void UnregAllConCmds(CPlugin *pl);
|
||||||
private:
|
private:
|
||||||
PluginId m_LastId;
|
PluginId m_LastId;
|
||||||
List<CPlugin *> m_Plugins;
|
SourceHook::List<CPlugin *> m_Plugins;
|
||||||
bool m_AllLoaded;
|
bool m_AllLoaded;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef List<SourceMM::CPluginManager::CPlugin *>::iterator PluginIter;
|
typedef SourceHook::List<SourceMM::CPluginManager::CPlugin *>::iterator PluginIter;
|
||||||
|
|
||||||
/** @brief Singleton for plugin manager */
|
/** @brief Singleton for plugin manager */
|
||||||
extern SourceMM::CPluginManager g_PluginMngr;
|
extern SourceMM::CPluginManager g_PluginMngr;
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
#include "CSmmAPI.h"
|
#include "CSmmAPI.h"
|
||||||
#include "concommands.h"
|
#include "concommands.h"
|
||||||
#include "CPlugin.h"
|
#include "CPlugin.h"
|
||||||
#include "smm_string.h"
|
#include "sh_string.h"
|
||||||
#include "smm_list.h"
|
#include "sh_list.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Console Command Implementations
|
* @brief Console Command Implementations
|
||||||
@ -50,7 +50,7 @@ bool SMConVarAccessor::Register(ConCommandBase *pCommand)
|
|||||||
|
|
||||||
void SMConVarAccessor::MarkCommandsAsGameDLL()
|
void SMConVarAccessor::MarkCommandsAsGameDLL()
|
||||||
{
|
{
|
||||||
for (List<ConCommandBase*>::iterator iter = m_RegisteredCommands.begin();
|
for (SourceHook::List<ConCommandBase*>::iterator iter = m_RegisteredCommands.begin();
|
||||||
iter != m_RegisteredCommands.end(); ++iter)
|
iter != m_RegisteredCommands.end(); ++iter)
|
||||||
{
|
{
|
||||||
(*iter)->AddFlags(FCVAR_GAMEDLL);
|
(*iter)->AddFlags(FCVAR_GAMEDLL);
|
||||||
@ -203,7 +203,7 @@ CON_COMMAND(meta, "Metamod:Source Menu")
|
|||||||
CONMSG("Plugin %d is not loaded.\n", id);
|
CONMSG("Plugin %d is not loaded.\n", id);
|
||||||
} else {
|
} else {
|
||||||
CONMSG("Console commands for %s:\n", pl->m_API->GetName());
|
CONMSG("Console commands for %s:\n", pl->m_API->GetName());
|
||||||
List<ConCommandBase *>::iterator ci;
|
SourceHook::List<ConCommandBase *>::iterator ci;
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
|
|
||||||
for (ci=pl->m_Cmds.begin(); ci!=pl->m_Cmds.end(); ci++)
|
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);
|
CONMSG("Plugin %d is not loaded.\n", id);
|
||||||
} else {
|
} else {
|
||||||
CONMSG("Registered cvars for %s:\n", pl->m_API->GetName());
|
CONMSG("Registered cvars for %s:\n", pl->m_API->GetName());
|
||||||
List<ConCommandBase *>::iterator ci;
|
SourceHook::List<ConCommandBase *>::iterator ci;
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
|
|
||||||
for (ci=pl->m_Cvars.begin(); ci!=pl->m_Cvars.end(); ci++)
|
for (ci=pl->m_Cvars.begin(); ci!=pl->m_Cvars.end(); ci++)
|
||||||
|
@ -20,11 +20,11 @@
|
|||||||
#include <eiface.h>
|
#include <eiface.h>
|
||||||
#include "sourcemm.h"
|
#include "sourcemm.h"
|
||||||
#include <convar.h>
|
#include <convar.h>
|
||||||
#include "smm_list.h"
|
#include "sh_list.h"
|
||||||
|
|
||||||
class SMConVarAccessor : public IConCommandBaseAccessor
|
class SMConVarAccessor : public IConCommandBaseAccessor
|
||||||
{
|
{
|
||||||
List<ConCommandBase*> m_RegisteredCommands;
|
SourceHook::List<ConCommandBase*> m_RegisteredCommands;
|
||||||
public:
|
public:
|
||||||
virtual bool RegisterConCommandBase(ConCommandBase *pCommand);
|
virtual bool RegisterConCommandBase(ConCommandBase *pCommand);
|
||||||
bool Register(ConCommandBase *pCommand);
|
bool Register(ConCommandBase *pCommand);
|
||||||
|
@ -34,8 +34,8 @@ GameDllInfo g_GameDll = {false, NULL, NULL};
|
|||||||
EngineInfo g_Engine = {NULL, NULL, NULL, NULL};
|
EngineInfo g_Engine = {NULL, NULL, NULL, NULL};
|
||||||
SourceHook::CSourceHookImpl g_SourceHook;
|
SourceHook::CSourceHookImpl g_SourceHook;
|
||||||
SourceHook::ISourceHook *g_SHPtr;
|
SourceHook::ISourceHook *g_SHPtr;
|
||||||
String g_ModPath;
|
SourceHook::String g_ModPath;
|
||||||
String g_BinPath;
|
SourceHook::String g_BinPath;
|
||||||
PluginId g_PLID = Pl_Console; //Technically, SourceMM is the "Console" plugin... :p
|
PluginId g_PLID = Pl_Console; //Technically, SourceMM is the "Console" plugin... :p
|
||||||
bool bInShutdown = false;
|
bool bInShutdown = false;
|
||||||
bool bInFirstLevel = true;
|
bool bInFirstLevel = true;
|
||||||
|
@ -78,10 +78,10 @@ extern EngineInfo g_Engine;
|
|||||||
extern SourceHook::CSourceHookImpl g_SourceHook;
|
extern SourceHook::CSourceHookImpl g_SourceHook;
|
||||||
|
|
||||||
/** @brief Mod path (important!)*/
|
/** @brief Mod path (important!)*/
|
||||||
extern String g_ModPath;
|
extern SourceHook::String g_ModPath;
|
||||||
|
|
||||||
/** @brief Path to server binary */
|
/** @brief Path to server binary */
|
||||||
extern String g_BinPath;
|
extern SourceHook::String g_BinPath;
|
||||||
|
|
||||||
/** @brief Global variable for SourceHook macros */
|
/** @brief Global variable for SourceHook macros */
|
||||||
extern SourceHook::ISourceHook *g_SHPtr;
|
extern SourceHook::ISourceHook *g_SHPtr;
|
||||||
|
@ -180,15 +180,6 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath=".\resource.h">
|
RelativePath=".\resource.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\smm_list.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\smm_string.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\smm_vector.h">
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\sourcemm.h">
|
RelativePath=".\sourcemm.h">
|
||||||
</File>
|
</File>
|
||||||
@ -220,6 +211,9 @@
|
|||||||
<Filter
|
<Filter
|
||||||
Name="SourceHook"
|
Name="SourceHook"
|
||||||
Filter="">
|
Filter="">
|
||||||
|
<File
|
||||||
|
RelativePath="..\sourcehook\sh_string.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\sourcehook\sourcehook.cpp">
|
RelativePath="..\sourcehook\sourcehook.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user