From 63f8ea89cad205890af13985d22f65d2755ee283 Mon Sep 17 00:00:00 2001 From: "zer0.k" <61156310+zer0k-z@users.noreply.github.com> Date: Fri, 25 Nov 2022 20:00:48 +0100 Subject: [PATCH] Return the full list of exts/plugins with "sm exts/plugins" client commands (#1862) --- core/PlayerManager.cpp | 67 ------------------------------------------ 1 file changed, 67 deletions(-) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 34f25db3..08fc299d 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -974,8 +974,6 @@ void ClientConsolePrint(edict_t *e, const char *fmt, ...) void ListExtensionsToClient(CPlayer *player, const CCommand &args) { char buffer[256]; - unsigned int id = 0; - unsigned int start = 0; AutoExtensionList extensions(extsys); if (!extensions->size()) @@ -984,11 +982,6 @@ void ListExtensionsToClient(CPlayer *player, const CCommand &args) return; } - if (args.ArgC() > 2) - { - start = atoi(args.Arg(2)); - } - size_t i = 0; for (; i < extensions->size(); i++) { @@ -1000,17 +993,6 @@ void ListExtensionsToClient(CPlayer *player, const CCommand &args) continue; } - id++; - if (id < start) - { - continue; - } - - if (id - start > 10) - { - break; - } - IExtensionInterface *api = ext->GetAPI(); const char *name = api->GetExtensionName(); @@ -1035,31 +1017,14 @@ void ListExtensionsToClient(CPlayer *player, const CCommand &args) len += ke::SafeSprintf(&buffer[len], sizeof(buffer)-len, ": %s", description); } - ClientConsolePrint(player->GetEdict(), "%s", buffer); } - - for (; i < extensions->size(); i++) - { - char error[255]; - if (extensions->at(i)->IsRunning(error, sizeof(error))) - { - break; - } - } - - if (i < extensions->size()) - { - ClientConsolePrint(player->GetEdict(), "To see more, type \"sm exts %d\"", id); - } } void ListPluginsToClient(CPlayer *player, const CCommand &args) { char buffer[256]; - unsigned int id = 0; edict_t *e = player->GetEdict(); - unsigned int start = 0; AutoPluginList plugins(scripts); if (!plugins->size()) @@ -1068,11 +1033,6 @@ void ListPluginsToClient(CPlayer *player, const CCommand &args) return; } - if (args.ArgC() > 2) - { - start = atoi(args.Arg(2)); - } - SourceHook::List m_FailList; size_t i = 0; @@ -1085,18 +1045,6 @@ void ListPluginsToClient(CPlayer *player, const CCommand &args) continue; } - /* Count valid plugins */ - id++; - if (id < start) - { - continue; - } - - if (id - start > 10) - { - break; - } - size_t len; const sm_plugininfo_t *info = pl->GetPublicInfo(); len = ke::SafeSprintf(buffer, sizeof(buffer), " \"%s\"", (IS_STR_FILLED(info->name)) ? info->name : pl->GetFilename()); @@ -1114,21 +1062,6 @@ void ListPluginsToClient(CPlayer *player, const CCommand &args) } ClientConsolePrint(e, "%s", buffer); } - - /* See if we can get more plugins */ - for (; i < plugins->size(); i++) - { - if (plugins->at(i)->GetStatus() == Plugin_Running) - { - break; - } - } - - /* Do we actually have more plugins? */ - if (i < plugins->size()) - { - ClientConsolePrint(e, "To see more, type \"sm plugins %d\"", id); - } } #if SOURCE_ENGINE >= SE_ORANGEBOX