mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-12-06 18:08:31 +00:00
Obsolete KVLoadFromFile
Current implementation isn't used anywhere in the s2 provider and due to the removal of MemAllocScratch & MemFreeScratch I guess this could be obsoleted
This commit is contained in:
parent
ee9243c82f
commit
3b5d72df1d
@ -354,36 +354,6 @@ void LocalCommand_Meta(const CCommandContext &, const CCommand& args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Source2Provider::KVLoadFromFile(KeyValues* kv, IFileSystem* filesystem, const char* resourceName, const char* pathID)
|
|
||||||
{
|
|
||||||
Assert(filesystem);
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
Assert(_heapchk() == _HEAPOK);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FileHandle_t f = filesystem->Open(resourceName, "rb", pathID);
|
|
||||||
if (!f)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// load file into a null-terminated buffer
|
|
||||||
int fileSize = filesystem->Size(f);
|
|
||||||
char* buffer = (char*)MemAllocScratch(fileSize + 1);
|
|
||||||
|
|
||||||
Assert(buffer);
|
|
||||||
|
|
||||||
filesystem->Read(buffer, fileSize, f); // read into local buffer
|
|
||||||
|
|
||||||
buffer[fileSize] = 0; // null terminate file as EOF
|
|
||||||
|
|
||||||
filesystem->Close(f); // close file after reading
|
|
||||||
|
|
||||||
bool retOK = kv->LoadFromBuffer(resourceName, buffer, filesystem);
|
|
||||||
|
|
||||||
MemFreeScratch();
|
|
||||||
|
|
||||||
return retOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Source2Provider::Hook_StartupServer_Post(const GameSessionConfiguration_t &config, ISource2WorldSession *, const char *)
|
void Source2Provider::Hook_StartupServer_Post(const GameSessionConfiguration_t &config, ISource2WorldSession *, const char *)
|
||||||
{
|
{
|
||||||
static bool bGameServerHooked = false;
|
static bool bGameServerHooked = false;
|
||||||
|
|||||||
@ -72,8 +72,6 @@ public:
|
|||||||
CUtlVector<INetworkGameClient *> *Hook_StartChangeLevel(const char*, const char*, void*);
|
CUtlVector<INetworkGameClient *> *Hook_StartChangeLevel(const char*, const char*, void*);
|
||||||
void Hook_SwitchToLoop(const char *pszLoopName, KeyValues *pKV, uint32 nId, const char *pszUnk, bool bUnk);
|
void Hook_SwitchToLoop(const char *pszLoopName, KeyValues *pKV, uint32 nId, const char *pszUnk, bool bUnk);
|
||||||
void Hook_ClientCommand(CPlayerSlot nSlot, const CCommand& args);
|
void Hook_ClientCommand(CPlayerSlot nSlot, const CCommand& args);
|
||||||
private:
|
|
||||||
bool KVLoadFromFile(KeyValues *kv, IFileSystem *filesystem, const char *resourceName, const char *pathID);
|
|
||||||
private:
|
private:
|
||||||
IFileSystem* baseFs = nullptr;
|
IFileSystem* baseFs = nullptr;
|
||||||
std::string sLastMap;
|
std::string sLastMap;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user