mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-26 19:54:14 +01:00
mimiced new meta list fprmatting to client console
--HG-- branch : sourcemm-1.4.3 extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/sourcemm-1.4.3%40603
This commit is contained in:
parent
7cc4820b04
commit
db8501c0bf
@ -265,8 +265,6 @@ CON_COMMAND(meta, "Metamod:Source Menu")
|
|||||||
CONMSG("%s\n", buffer);
|
CONMSG("%s\n", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef IS_STR_FILLED
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else if (strcmp(command, "cmds") == 0) {
|
} else if (strcmp(command, "cmds") == 0) {
|
||||||
if (args >= 3)
|
if (args >= 3)
|
||||||
@ -727,44 +725,48 @@ void ClientCommand_handler(edict_t *client)
|
|||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
} else if(strcmp(subcmd, "list") == 0) {
|
} else if(strcmp(subcmd, "list") == 0) {
|
||||||
SourceMM::CPluginManager::CPlugin *pl;
|
SourceMM::CPluginManager::CPlugin *pl;
|
||||||
Pl_Status st;
|
ISmmPlugin *plapi;
|
||||||
|
const char *plname;
|
||||||
PluginIter i;
|
PluginIter i;
|
||||||
const char *version = NULL;
|
char buffer[256];
|
||||||
const char *name = NULL;
|
int len = 0;
|
||||||
const char *author = NULL;
|
int plnum = 0;
|
||||||
const char *status = NULL;
|
|
||||||
|
|
||||||
CLIENT_CONMSG(client, "-Id- %-20.19s %-10.9s %-20.19s %6s\n", "Name", "Version", "Author", "Status");
|
for (i = g_PluginMngr._begin(); i != g_PluginMngr._end(); i++, len=0)
|
||||||
|
|
||||||
for (i=g_PluginMngr._begin(); i!=g_PluginMngr._end(); i++)
|
|
||||||
{
|
{
|
||||||
pl = (*i);
|
pl = (*i);
|
||||||
if (!pl)
|
if (pl && pl->m_Status == Pl_Running)
|
||||||
break;
|
|
||||||
|
|
||||||
st = pl->m_Status;
|
|
||||||
|
|
||||||
/* Only show plugins that are running or paused */
|
|
||||||
if (pl->m_API && (st == Pl_Running || st == Pl_Paused))
|
|
||||||
{
|
{
|
||||||
version = pl->m_API->GetVersion();
|
plapi = pl->m_API;
|
||||||
author = pl->m_API->GetAuthor();
|
if (!plapi || !plapi->QueryRunning(NULL, 0))
|
||||||
name = pl->m_API->GetName();
|
|
||||||
|
|
||||||
if (st == Pl_Running && pl->m_API->QueryRunning(NULL, 0))
|
|
||||||
{
|
{
|
||||||
status = "RUN";
|
continue;
|
||||||
} else {
|
}
|
||||||
status = "PAUSE";
|
plnum++;
|
||||||
|
|
||||||
|
len += UTIL_Format(buffer, sizeof(buffer), " [%02d]", plnum);
|
||||||
|
|
||||||
|
plname = IS_STR_FILLED(plapi->GetName()) ? plapi->GetName() : pl->m_File.c_str();
|
||||||
|
len += UTIL_Format(&buffer[len], sizeof(buffer)-len, " %s", plname);
|
||||||
|
|
||||||
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!version || !author || !name)
|
CLIENT_CONMSG(client, "%s\n", buffer);
|
||||||
break;
|
|
||||||
|
|
||||||
CLIENT_CONMSG(client, "[%02d] %-20.19s %-10.9s %-20.19s %6s\n", pl->m_Id, name, version, author, status);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!plnum)
|
||||||
|
{
|
||||||
|
CLIENT_CONMSG(client, "No active plugins loaded.\n");
|
||||||
|
}
|
||||||
|
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
#define SVN_PRODUCT_VERSION "1.4.3"
|
#define SVN_PRODUCT_VERSION "1.4.3"
|
||||||
|
|
||||||
#define SVN_REVISION 602
|
#define SVN_REVISION 603
|
||||||
#define SVN_REVISION_STRING "602"
|
#define SVN_REVISION_STRING "603"
|
||||||
#define SVN_FILE_VERSION 1,4,3,602
|
#define SVN_FILE_VERSION 1,4,3,603
|
||||||
#define SVN_FILE_VERSION_STRING "1.4.3.602"
|
#define SVN_FILE_VERSION_STRING "1.4.3.603"
|
||||||
|
|
||||||
#endif //_INCLUDE_SVN_VERSION_H_
|
#endif //_INCLUDE_SVN_VERSION_H_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user