1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-26 19:54:14 +01:00

updated changelog, added new formatting for meta list

--HG--
branch : sourcemm-1.4.3
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/sourcemm-1.4.3%40602
This commit is contained in:
David Anderson 2007-12-24 03:50:50 +00:00
parent cf6b8f8378
commit 7cc4820b04
6 changed files with 95 additions and 42 deletions

View File

@ -665,3 +665,34 @@ void CPluginManager::UnregAllConCmds(CPlugin *pl)
pl->m_Cmds.clear();
}
const char *CPluginManager::GetStatusText(CPlugin *pl)
{
switch (pl->m_Status)
{
case Pl_NotFound:
return "NOFILE";
case Pl_Error:
return "ERROR";
case Pl_Refused:
return "FAILED";
case Pl_Paused:
return "PAUSED";
case Pl_Running:
{
if (pl->m_API && pl->m_API->QueryRunning(NULL, 0))
{
return "STOPPED";
} else {
return "RUNNING";
}
}
default:
return "-";
}
}
unsigned int CPluginManager::GetPluginCount()
{
return (unsigned int)m_Plugins.size();
}

View File

@ -132,6 +132,8 @@ namespace SourceMM
SourceHook::List<SourceMM::CPluginManager::CPlugin *>::iterator _end();
void SetVSPAsLoaded();
unsigned int GetPluginCount();
const char *CPluginManager::GetStatusText(CPlugin *pl);
private:
//These are identical internal functions for the wrappers above.
CPlugin *_Load(const char *file, PluginId source, char *error, size_t maxlen);

View File

@ -1,3 +1,10 @@
2007/12/24 1.4.3:
- Metamod:Source can now be loaded via a .vdf instead of gameinfo.txt.
- Added new plugin loading mechanism via .vdf files in the metamod folder.
- Changed "meta list" output to look similar to Metamod:Source 1.6.
- Plugins which need a VSP pointer can now receive it on late load.
- Fixed a rare memory corruption bug in the CVector class.
2007/06/26 1.4.2:
- Fixed a bug where unloading all plugins could crash if one plugin had child plugins.

View File

@ -154,11 +154,11 @@ CON_COMMAND(meta, "Metamod:Source Menu")
CONMSG("Metamod:Source version %s\n", SOURCEMM_VERSION);
if (g_VspListener.IsRootLoadMethod())
{
CONMSG("Load Method: Valve Server Plugin\n");
CONMSG("Loaded As: Valve Server Plugin\n");
}
else
{
CONMSG("Load Method: GameDLL (gameinfo.txt)\n");
CONMSG("Loaded As: GameDLL (gameinfo.txt)\n");
}
CONMSG("Compiled on: %s\n", SOURCEMM_DATE);
CONMSG("Plugin interface version: %d:%d\n", PLAPI_VERSION, PLAPI_MIN_VERSION);
@ -208,58 +208,64 @@ CON_COMMAND(meta, "Metamod:Source Menu")
return;
} else if (strcmp(command, "list") == 0) {
SourceMM::CPluginManager::CPlugin *pl;
size_t len;
PluginIter i;
const char *status="";
const char *version=NULL;
const char *name=NULL;
const char *author=NULL;
char buffer[255];
ISmmPlugin *plapi;
const char *plname;
SourceMM::CPluginManager::CPlugin *pl;
unsigned int plnum = g_PluginMngr.GetPluginCount();
#define IS_STR_FILLED(var) (var != NULL && var[0] != '\0')
if (!plnum)
{
CONMSG("No plugins loaded.\n");
return;
}
else
{
CONMSG("Listing %d plugin%s:\n", plnum, (plnum > 1) ? "s" : "");
}
CONMSG("-Id- %-20.19s %-10.9s %-20.19s %-8.7s\n", "Name", "Version", "Author", "Status");
for (i=g_PluginMngr._begin(); i!=g_PluginMngr._end(); i++)
{
pl = (*i);
if (!pl)
{
break;
if (pl->m_Status == Pl_Paused)
}
len = 0;
if (pl->m_Status != Pl_Running)
{
status = "PAUSE";
} else if (pl->m_Status == Pl_Running) {
if (pl->m_API && pl->m_API->QueryRunning(NULL, 0))
status = "RUN";
len += UTIL_Format(buffer, sizeof(buffer), " [%02d] <%s>", pl->m_Id, g_PluginMngr.GetStatusText(pl));
}
else
status = "STOPPED";
} else if (pl->m_Status == Pl_Refused) {
status = "FAIL";
} else if (pl->m_Status == Pl_Error) {
status = "ERROR";
} else if (pl->m_Status == Pl_NotFound) {
status = "NOFILE";
}
if (pl->m_API)
{
version = pl->m_API->GetVersion();
author = pl->m_API->GetAuthor();
name = pl->m_API->GetName();
} else {
version = "-";
author = "-";
name = "-";
len += UTIL_Format(buffer, sizeof(buffer), " [%02d]", pl->m_Id);
}
if (!version)
version = "-";
if (!author)
author = "-";
if (!name)
name = pl->m_File.c_str();
if ((plapi = pl->m_API))
{
plname = IS_STR_FILLED(plapi->GetName()) ? plapi->GetName() : pl->m_File.c_str();
len += UTIL_Format(&buffer[len], sizeof(buffer)-len, " %s", plname);
CONMSG("[%02d] %-20.19s %-10.9s %-20.19s %-8.7s\n", pl->m_Id, name, version, author, status);
if (IS_STR_FILLED(plapi->GetVersion()))
{
len += UTIL_Format(&buffer[len], sizeof(buffer)-len, " (%s)", plapi->GetVersion());
}
if (IS_STR_FILLED(plapi->GetAuthor()))
{
UTIL_Format(&buffer[len], sizeof(buffer)-len, " by %s", plapi->GetAuthor());
}
}
//CONMSG("\n");
CONMSG("%s\n", buffer);
}
#undef IS_STR_FILLED
return;
} else if (strcmp(command, "cmds") == 0) {

View File

@ -5,9 +5,9 @@
#define SVN_PRODUCT_VERSION "1.4.3"
#define SVN_REVISION 600
#define SVN_REVISION_STRING "600"
#define SVN_FILE_VERSION 1,4,3,600
#define SVN_FILE_VERSION_STRING "1.4.3.600"
#define SVN_REVISION 602
#define SVN_REVISION_STRING "602"
#define SVN_FILE_VERSION 1,4,3,602
#define SVN_FILE_VERSION_STRING "1.4.3.602"
#endif //_INCLUDE_SVN_VERSION_H_

View File

@ -173,6 +173,13 @@ bool VSPListener::Load(CreateInterfaceFn interfaceFactory, CreateInterfaceFn gam
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, g_plugin_unload, InterceptPluginUnloads, false);
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, g_plugin_unload, InterceptPluginUnloads_Post, true);
}
/* Ho ho ho... if we get here, set a new cvar version. */
extern ConVar metamod_version;
char buffer[255];
UTIL_Format(buffer, sizeof(buffer), "%sV", metamod_version.GetString());
metamod_version.SetValue(buffer);
}
m_Loaded = true;