mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-20 13:54:14 +01: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 *)
|
||||
{
|
||||
static bool bGameServerHooked = false;
|
||||
|
@ -72,8 +72,6 @@ public:
|
||||
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_ClientCommand(CPlayerSlot nSlot, const CCommand& args);
|
||||
private:
|
||||
bool KVLoadFromFile(KeyValues *kv, IFileSystem *filesystem, const char *resourceName, const char *pathID);
|
||||
private:
|
||||
IFileSystem* baseFs = nullptr;
|
||||
std::string sLastMap;
|
||||
|
Loading…
x
Reference in New Issue
Block a user