Skip to content

Commit

Permalink
Add missing files.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Jan 27, 2024
1 parent 192b2b2 commit 2275d24
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
47 changes: 47 additions & 0 deletions Plugins/SCModelDownloader/UtilAssetsIntegrity.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include <metahook.h>
#include "plugins.h"
#include "UtilAssetsIntegrity.h"

static HINTERFACEMODULE g_hUtilAssetsIntegrity;
static IUtilAssetsIntegrity* g_pUtilAssetsIntegrity;

IUtilAssetsIntegrity* UtilAssetsIntegrity()
{
return g_pUtilAssetsIntegrity;
}

void UtilAssetsIntegrity_Init()
{
g_hUtilAssetsIntegrity = Sys_LoadModule("UtilAssetsIntegrity.dll");

if (!g_hUtilAssetsIntegrity)
{
g_pMetaHookAPI->SysError("Could not load UtilAssetsIntegrity.dll");
return;
}

auto factory = Sys_GetFactory(g_hUtilAssetsIntegrity);

if (!factory)
{
g_pMetaHookAPI->SysError("Could not get factory from UtilAssetsIntegrity.dll");
return;
}

g_pUtilAssetsIntegrity = (decltype(g_pUtilAssetsIntegrity))factory(UTIL_ASSETS_INTEGRITY_INTERFACE_VERSION, NULL);

if (!g_pUtilAssetsIntegrity)
{
g_pMetaHookAPI->SysError("Could not get UtilAssetsIntegrity from UtilAssetsIntegrity.dll");
return;
}
}

void UtilAssetsIntegrity_Shutdown()
{
if (g_hUtilAssetsIntegrity)
{
Sys_FreeModule(g_hUtilAssetsIntegrity);
g_hUtilAssetsIntegrity = NULL;
}
}
6 changes: 6 additions & 0 deletions Plugins/SCModelDownloader/UtilAssetsIntegrity.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

#include <IUtilAssetsIntegrity.h>

void UtilAssetsIntegrity_Init();
void UtilAssetsIntegrity_Shutdown();

0 comments on commit 2275d24

Please sign in to comment.