Improve plugin console diagnostics.
This commit is contained in:
parent
87e9dee78b
commit
59623695af
@ -1913,51 +1913,34 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const ICommandArg
|
||||
const sm_plugininfo_t *info = pl->GetPublicInfo();
|
||||
|
||||
rootmenu->ConsolePrint(" Filename: %s", pl->GetFilename());
|
||||
if (pl->GetStatus() <= Plugin_Error || pl->GetStatus() == Plugin_Failed)
|
||||
{
|
||||
if (IS_STR_FILLED(info->name))
|
||||
{
|
||||
if (pl->GetStatus() != Plugin_BadLoad) {
|
||||
if (IS_STR_FILLED(info->name)) {
|
||||
if (IS_STR_FILLED(info->description))
|
||||
{
|
||||
rootmenu->ConsolePrint(" Title: %s (%s)", info->name, info->description);
|
||||
} else {
|
||||
else
|
||||
rootmenu->ConsolePrint(" Title: %s", info->name);
|
||||
}
|
||||
}
|
||||
if (IS_STR_FILLED(info->author))
|
||||
{
|
||||
if (IS_STR_FILLED(info->author)) {
|
||||
rootmenu->ConsolePrint(" Author: %s", info->author);
|
||||
}
|
||||
if (IS_STR_FILLED(info->version))
|
||||
{
|
||||
if (IS_STR_FILLED(info->version)) {
|
||||
rootmenu->ConsolePrint(" Version: %s", info->version);
|
||||
}
|
||||
if (IS_STR_FILLED(info->url))
|
||||
{
|
||||
if (IS_STR_FILLED(info->url)) {
|
||||
rootmenu->ConsolePrint(" URL: %s", info->url);
|
||||
}
|
||||
if (pl->GetStatus() == Plugin_Error || pl->GetStatus() == Plugin_Failed)
|
||||
{
|
||||
if (pl->IsInErrorState()) {
|
||||
rootmenu->ConsolePrint(" Error: %s", pl->GetErrorMsg());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pl->GetStatus() == Plugin_Running)
|
||||
{
|
||||
} else {
|
||||
rootmenu->ConsolePrint(" Status: running");
|
||||
}
|
||||
else
|
||||
{
|
||||
rootmenu->ConsolePrint(" Status: not running");
|
||||
}
|
||||
}
|
||||
if (pl->GetFileVersion() >= 3)
|
||||
{
|
||||
if (pl->GetFileVersion() >= 3) {
|
||||
rootmenu->ConsolePrint(" Timestamp: %s", pl->GetDateTime());
|
||||
}
|
||||
|
||||
unsigned char *pCodeHash = pl->GetRuntime()->GetCodeHash();
|
||||
unsigned char *pDataHash = pl->GetRuntime()->GetDataHash();
|
||||
if (IPluginRuntime *runtime = pl->GetRuntime()) {
|
||||
unsigned char *pCodeHash = runtime->GetCodeHash();
|
||||
unsigned char *pDataHash = runtime->GetDataHash();
|
||||
|
||||
char combinedHash[33];
|
||||
for (int i = 0; i < 16; i++)
|
||||
@ -1965,21 +1948,9 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const ICommandArg
|
||||
|
||||
rootmenu->ConsolePrint(" Hash: %s", combinedHash);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
rootmenu->ConsolePrint(" Load error: %s", pl->GetErrorMsg());
|
||||
if (pl->GetStatus() < Plugin_Created)
|
||||
{
|
||||
rootmenu->ConsolePrint(" File info: (title \"%s\") (version \"%s\")",
|
||||
info->name ? info->name : "<none>",
|
||||
info->version ? info->version : "<none>");
|
||||
if (IS_STR_FILLED(info->url))
|
||||
{
|
||||
rootmenu->ConsolePrint(" File URL: %s", info->url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else if (strcmp(cmd, "refresh") == 0)
|
||||
|
@ -237,8 +237,10 @@ public:
|
||||
return m_EnteredSecondPass;
|
||||
}
|
||||
|
||||
bool HasErrorOrFail() const {
|
||||
return m_status == Plugin_Error || m_status == Plugin_Failed;
|
||||
bool IsInErrorState() const {
|
||||
if (m_status == Plugin_Running || m_status == Plugin_Loaded)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TryCompile();
|
||||
|
Loading…
Reference in New Issue
Block a user