Strip sourcehook from Updater

This commit is contained in:
Kenzzer 2025-08-17 22:13:03 +00:00
parent b6f2070339
commit 949b0a62ff
No known key found for this signature in database
GPG Key ID: 64C3FD4332686DC1
3 changed files with 12 additions and 17 deletions

View File

@ -677,7 +677,7 @@ else:
'extensions/sqlite/AMBuilder', 'extensions/sqlite/AMBuilder',
#'extensions/tf2/AMBuilder', #'extensions/tf2/AMBuilder',
#'extensions/topmenus/AMBuilder', #'extensions/topmenus/AMBuilder',
#'extensions/updater/AMBuilder', 'extensions/updater/AMBuilder',
] ]
if builder.backend == 'amb2': if builder.backend == 'amb2':

View File

@ -34,11 +34,9 @@
#include <IWebternet.h> #include <IWebternet.h>
#include <ITextParsers.h> #include <ITextParsers.h>
#include <sh_string.h> #include <string>
#include "MemoryDownloader.h" #include "MemoryDownloader.h"
using namespace SourceHook;
struct UpdatePart struct UpdatePart
{ {
UpdatePart* next; UpdatePart* next;
@ -72,8 +70,8 @@ namespace SourceMod
MemoryDownloader mdl; MemoryDownloader mdl;
unsigned int ustate; unsigned int ustate;
unsigned int ignoreLevel; unsigned int ignoreLevel;
SourceHook::String curfile; std::string curfile;
SourceHook::String url; std::string url;
char checksum[33]; char checksum[33];
UpdatePart *partFirst; UpdatePart *partFirst;
UpdatePart *partLast; UpdatePart *partLast;

View File

@ -36,20 +36,18 @@
#include <stdlib.h> #include <stdlib.h>
#include "extension.h" #include "extension.h"
#include "Updater.h" #include "Updater.h"
#include <sh_list.h> #include <list>
#include <sh_string.h> #include <string>
#define DEFAULT_UPDATE_URL "http://www.sourcemod.net/update/" #define DEFAULT_UPDATE_URL "http://www.sourcemod.net/update/"
using namespace SourceHook;
SmUpdater g_Updater; /**< Global singleton for extension's main interface */ SmUpdater g_Updater; /**< Global singleton for extension's main interface */
SMEXT_LINK(&g_Updater); SMEXT_LINK(&g_Updater);
IWebternet *webternet; IWebternet *webternet;
static List<String *> update_errors; static std::list<std::string *> update_errors;
static IThreadHandle *update_thread; static IThreadHandle *update_thread;
static String update_url; static std::string update_url;
bool SmUpdater::SDK_OnLoad(char *error, size_t maxlength, bool late) bool SmUpdater::SDK_OnLoad(char *error, size_t maxlength, bool late)
{ {
@ -90,7 +88,7 @@ void SmUpdater::SDK_OnUnload()
} }
/* Clear message tables */ /* Clear message tables */
List<String *>::iterator iter = update_errors.begin(); auto iter = update_errors.begin();
while (iter != update_errors.end()) while (iter != update_errors.end())
{ {
iter = update_errors.erase(iter); iter = update_errors.erase(iter);
@ -120,9 +118,8 @@ void SmUpdater::NotifyInterfaceDrop(SMInterface *pInterface)
static void PumpUpdate(void *data) static void PumpUpdate(void *data)
{ {
String *str; std::string *str;
bool new_files = false; bool new_files = false;
List<String *>::iterator iter;
char path[PLATFORM_MAX_PATH]; char path[PLATFORM_MAX_PATH];
UpdatePart *temp; UpdatePart *temp;
@ -185,7 +182,7 @@ skip_create:
{ {
smutils->LogError(myself, "--- BEGIN ERRORS FROM AUTOMATIC UPDATER ---"); smutils->LogError(myself, "--- BEGIN ERRORS FROM AUTOMATIC UPDATER ---");
for (iter = update_errors.begin(); for (auto iter = update_errors.begin();
iter != update_errors.end(); iter != update_errors.end();
iter++) iter++)
{ {
@ -244,7 +241,7 @@ void AddUpdateError(const char *fmt, ...)
smutils->FormatArgs(buffer, sizeof(buffer), fmt, ap); smutils->FormatArgs(buffer, sizeof(buffer), fmt, ap);
va_end(ap); va_end(ap);
update_errors.push_back(new String(buffer)); update_errors.push_back(new std::string(buffer));
} }
const char *SmUpdater::GetExtensionVerString() const char *SmUpdater::GetExtensionVerString()