diff --git a/rehlds/HLTV/Console/src/System.cpp b/rehlds/HLTV/Console/src/System.cpp index ccab18439..6cc4957ae 100644 --- a/rehlds/HLTV/Console/src/System.cpp +++ b/rehlds/HLTV/Console/src/System.cpp @@ -30,19 +30,8 @@ System gSystem; -#ifdef _WIN32 -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) -#else -int main(int argc, char *argv[]) -#endif // _WIN32 +int System::Run() { -#ifdef _WIN32 - gSystem.BuildCommandLine(lpCmdLine); -#else - gSystem.BuildCommandLine(argc, argv); - _snprintf(g_szEXEName, sizeof(g_szEXEName), "%s", argv[0]); -#endif // _WIN32 - if (!gSystem.Init(&gSystem, 0, "Console")) { gSystem.Sleep(2000); @@ -600,47 +589,6 @@ void System::ShutDown() m_State = MODULE_DISCONNECTED; } -#ifdef _WIN32 - -void System::BuildCommandLine(char *argv) -{ - m_Parameters.SetLine(argv); -} - -#else // _WIN32 - -#define MAX_LINUX_CMDLINE 2048 - -void System::BuildCommandLine(int argc, char **argv) -{ - int len = 0; - char string[MAX_LINUX_CMDLINE]; - - for (int i = 1; i < argc && len < MAX_LINUX_CMDLINE; i++) - { - len += strlen(argv[i]) + 1; - - if (i > 1) { - strcat(string, " "); - } - - strcat(string, argv[i]); - } - - m_Parameters.SetLine(string); -} - -#endif // _WIN32 - -void System::Sleep(int msec) -{ -#ifdef _WIN32 - ::Sleep(msec); -#else - usleep(1000 * msec); -#endif // _WIN32 -} - bool System::InitFileSystem() { char *filesystemmodule = STDIO_FILESYSTEM_LIB; @@ -1139,3 +1087,58 @@ unsigned char *System::LoadFile(const char *name, int *length) return buf; } + +#ifdef _WIN32 + +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) +{ + gSystem.BuildCommandLine(lpCmdLine); + return gSystem.Run(); +} + +void System::BuildCommandLine(char *argv) +{ + m_Parameters.SetLine(argv); +} + +void System::Sleep(int msec) +{ + ::Sleep(msec); +} + +#else // _WIN32 + +int main(int argc, char *argv[]) +{ + gSystem.BuildCommandLine(argc, argv); + _snprintf(g_szEXEName, sizeof(g_szEXEName), "%s", argv[0]); + return gSystem.Run(); +} + +#define MAX_LINUX_CMDLINE 2048 + +void System::BuildCommandLine(int argc, char **argv) +{ + int len = 0; + char string[MAX_LINUX_CMDLINE]; + + for (int i = 1; i < argc && len < MAX_LINUX_CMDLINE; i++) + { + len += strlen(argv[i]) + 1; + + if (i > 1) { + strcat(string, " "); + } + + strcat(string, argv[i]); + } + + m_Parameters.SetLine(string); +} + +void System::Sleep(int msec) +{ + usleep(1000 * msec); +} + +#endif // _WIN32 diff --git a/rehlds/HLTV/Console/src/System.h b/rehlds/HLTV/Console/src/System.h index 75a589cb8..7d3c560a5 100644 --- a/rehlds/HLTV/Console/src/System.h +++ b/rehlds/HLTV/Console/src/System.h @@ -73,12 +73,10 @@ class System: public IBaseSystem, public BaseSystemModule { void ShutDown(); char *GetBaseDir(); -#ifdef _WIN32 + int Run(); + void Sleep(int msec); void BuildCommandLine(char *argv); -#else void BuildCommandLine(int argc, char **argv); -#endif // _WIN32 - void Sleep(int msec); protected: struct command_t { diff --git a/rehlds/HLTV/Core/src/BSPModel.cpp b/rehlds/HLTV/Core/src/BSPModel.cpp index 32b7e5b9b..57ad2e4cb 100644 --- a/rehlds/HLTV/Core/src/BSPModel.cpp +++ b/rehlds/HLTV/Core/src/BSPModel.cpp @@ -410,35 +410,40 @@ bool BSPModel::InPVS(vec_t *point) return false; } +void BSPModel::Free(void *ptr) +{ + if (ptr) { + Mem_Free(ptr); + } +} + void BSPModel::Clear() { - #define FREE_FIELD(field) if (field) { Mem_Free(field); } - FREE_FIELD(m_model.leafs); - FREE_FIELD(m_model.nodes); - FREE_FIELD(m_model.planes); - FREE_FIELD(m_model.visdata); - FREE_FIELD(m_model.vertexes); - FREE_FIELD(m_model.entities); - FREE_FIELD(m_model.edges); - FREE_FIELD(m_model.lightdata); - FREE_FIELD(m_model.surfedges); - FREE_FIELD(m_model.surfaces); - FREE_FIELD(m_model.marksurfaces); - FREE_FIELD(m_model.clipnodes); - FREE_FIELD(m_model.hulls[0].clipnodes); - FREE_FIELD(m_model.texinfo); + Free(m_model.leafs); + Free(m_model.nodes); + Free(m_model.planes); + Free(m_model.visdata); + Free(m_model.vertexes); + Free(m_model.entities); + Free(m_model.edges); + Free(m_model.lightdata); + Free(m_model.surfedges); + Free(m_model.surfaces); + Free(m_model.marksurfaces); + Free(m_model.clipnodes); + Free(m_model.hulls[0].clipnodes); + Free(m_model.texinfo); if (m_model.textures) { for (int i = 0; i < m_model.numtextures; ++i) { - FREE_FIELD(m_model.textures[i]); + Free(m_model.textures[i]); } - FREE_FIELD(m_model.textures); + Free(m_model.textures); } - FREE_FIELD(m_wadpath); - #undef FREE_FIELD + Free(m_wadpath); memset(&m_model, 0, sizeof(m_model)); diff --git a/rehlds/HLTV/Core/src/BSPModel.h b/rehlds/HLTV/Core/src/BSPModel.h index 45ea405be..141001219 100644 --- a/rehlds/HLTV/Core/src/BSPModel.h +++ b/rehlds/HLTV/Core/src/BSPModel.h @@ -83,6 +83,7 @@ class BSPModel: public IBSPModel { void DecompressPVS(unsigned char *in, unsigned char *decompressed, int byteCount); unsigned char *DecompressVis(unsigned char *in); void SetParent(mnode_t *node, mnode_t *parent); + void Free(void *ptr); protected: model_t m_model; diff --git a/rehlds/HLTV/Core/src/World.cpp b/rehlds/HLTV/Core/src/World.cpp index 9c16748cf..5dc353a5c 100644 --- a/rehlds/HLTV/Core/src/World.cpp +++ b/rehlds/HLTV/Core/src/World.cpp @@ -1393,7 +1393,7 @@ char *World::GetStatusLine() m_LevelName, COM_FormatTime(m_WorldTime), GetNumPlayers(), - (float)m_CacheHits / (float)(m_CacheHits + m_CacheFaults), + m_CacheHits / float(m_CacheHits + m_CacheFaults), GetBufferedGameTime()); } else diff --git a/rehlds/HLTV/Director/src/Director.cpp b/rehlds/HLTV/Director/src/Director.cpp index e44fa5c27..971eff13b 100644 --- a/rehlds/HLTV/Director/src/Director.cpp +++ b/rehlds/HLTV/Director/src/Director.cpp @@ -161,7 +161,7 @@ void Director::NewGame(IWorld *world, IProxy *proxy) m_World = world; m_Proxy = proxy; - world->RegisterListener(this); + m_World->RegisterListener(this); m_WorldModel = m_World->GetWorldModel(); memset(m_history, 0, sizeof(*m_history) * m_historyLength); @@ -203,7 +203,7 @@ void Director::AnalyseFrame(frame_t *frame) return; } - if (m_currentTime) + if (!m_currentTime) { m_nextCutTime = frame->time; m_nextCutSeqnr = seqnr; @@ -224,7 +224,7 @@ void Director::AnalyseFrame(frame_t *frame) continue; } - playerData_t *player = &now->players[i]; + playerData_t *player = &now->players[index]; player->active = (ent->solid != SOLID_NOT); if (player->active) { @@ -477,7 +477,7 @@ float Director::AddBestMODCut() cmd = new DirectorCmd; cmd->SetTimeScaleData(1.0); - cmd->SetTime(timepoint->time + 1.5f); + cmd->SetTime(timepoint->time + trailTime); m_Commands.Add(cmd, cmd->GetTime()); } @@ -642,7 +642,7 @@ void Director::ExecuteDirectorCommands() if (timescale < 1.0) { - vec3_t pos = { 0.02f, 0.85f, 0.f }; + vec3_t pos = { 0.02f, 0.75f, 0.f }; DirectorCmd slowmo; slowmo.SetMessageData(0, COM_PackRGBA(255, 160, 0, 255), pos, 0.3f, 0.1f, 2, 0, "Slow Motion"); @@ -685,12 +685,14 @@ void Director::CMD_SlowMotion(char *cmdLine) Director::worldHistory_t *Director::FindBestEvent() { + const int MAX_BEST_EVENT = 4; + int i; int nseqMod = m_nextCutSeqnr % m_historyLength; - int bestEvent[] = { 0, 0, 0, 0 }; - int bestEventPrio[] = { 0, 0, 0, 0 }; + int bestEvent[MAX_BEST_EVENT] = { 0, 0, 0, 0 }; + int bestEventPrio[MAX_BEST_EVENT] = { 0, 0, 0, 0 }; - for (i = 0; i < 4; i++) + for (i = 0; i < MAX_BEST_EVENT; i++) { bestEventPrio[i] = 0; bestEvent[i] = 0; diff --git a/rehlds/HLTV/Director/src/Director.h b/rehlds/HLTV/Director/src/Director.h index 63def9e04..95ce4b48a 100644 --- a/rehlds/HLTV/Director/src/Director.h +++ b/rehlds/HLTV/Director/src/Director.h @@ -49,9 +49,9 @@ class Director: public IDirector, public BaseSystemModule { virtual void ShutDown(); virtual void NewGame(IWorld *world, IProxy *proxy); - virtual int AddCommand(DirectorCmd *cmd); - virtual void WriteCommands(BitBuffer *stream, float startTime, float endTime); virtual char *GetModName(); + virtual void WriteCommands(BitBuffer *stream, float startTime, float endTime); + virtual int AddCommand(DirectorCmd *cmd); virtual bool RemoveCommand(int index); virtual DirectorCmd *GetLastCommand(); virtual IObjectContainer *GetCommands(); diff --git a/rehlds/HLTV/Proxy/msvc/Proxy.vcxproj b/rehlds/HLTV/Proxy/msvc/Proxy.vcxproj index 625d9465d..8a664a41f 100644 --- a/rehlds/HLTV/Proxy/msvc/Proxy.vcxproj +++ b/rehlds/HLTV/Proxy/msvc/Proxy.vcxproj @@ -231,6 +231,7 @@ + diff --git a/rehlds/HLTV/Proxy/msvc/Proxy.vcxproj.filters b/rehlds/HLTV/Proxy/msvc/Proxy.vcxproj.filters index d86b8759d..5f80d892a 100644 --- a/rehlds/HLTV/Proxy/msvc/Proxy.vcxproj.filters +++ b/rehlds/HLTV/Proxy/msvc/Proxy.vcxproj.filters @@ -191,5 +191,8 @@ engine + + src + \ No newline at end of file diff --git a/rehlds/HLTV/Proxy/src/DemoClient.h b/rehlds/HLTV/Proxy/src/DemoClient.h index fd8e0a6ab..a3fab45ad 100644 --- a/rehlds/HLTV/Proxy/src/DemoClient.h +++ b/rehlds/HLTV/Proxy/src/DemoClient.h @@ -40,18 +40,19 @@ class DemoClient: public IClient, public BaseSystemModule { char *GetStatusLine(); char *GetType(); void ShutDown(); + bool Connect(INetSocket *socket = nullptr, NetAddress *adr = nullptr, char *userinfo = ""); + void Send(unsigned char *data, int length, bool isReliable); void Disconnect(const char *reason); void Reconnect(); void SetWorld(IWorld *world); - bool IsHearingVoices(); - bool HasChatEnabled(); - NetAddress *GetAddress(); int GetClientType(); char *GetClientName(); InfoString *GetUserInfo(); + NetAddress *GetAddress(); bool IsActive(); - void Send(unsigned char *data, int length, bool isReliable); + bool IsHearingVoices(); + bool HasChatEnabled(); void SetProxy(IProxy *proxy); void SetFileName(char *fileName); diff --git a/rehlds/HLTV/Proxy/src/Proxy.cpp b/rehlds/HLTV/Proxy/src/Proxy.cpp index 640cf56a2..e6e44e57b 100644 --- a/rehlds/HLTV/Proxy/src/Proxy.cpp +++ b/rehlds/HLTV/Proxy/src/Proxy.cpp @@ -470,7 +470,7 @@ void Proxy::ReplyConnect(NetAddress *to, int protocol, int challenge, char *prot if (type == TYPE_CLIENT && m_DispatchMode != DISPATCH_OFF) { float ratio = m_Status.GetBestRelayProxy(&relayProxy); - float myRatio = (float)(m_Clients.CountElements() / m_MaxClients) * 1.25f; + float myRatio = float(m_Clients.CountElements()) / float(m_MaxClients) * 1.25f; if (myRatio > 1) { myRatio = 1; } @@ -740,7 +740,7 @@ bool Proxy::WriteSignonData(int type, BitBuffer *stream) stream->WriteString(COM_VarArgs("%s\n", m_SignonCommands)); } - float ex_interp = (float)(1 / GetMaxUpdateRate()) + 0.05f; + float ex_interp = (1.0f / GetMaxUpdateRate()) + 0.05f; stream->WriteByte(svc_stufftext); stream->WriteString(COM_VarArgs("ex_interp %.2f\n", ex_interp)); @@ -1811,7 +1811,7 @@ bool Proxy::CheckDirectorModule() m_Director = dynamic_cast(m_System->GetModule(DIRECTOR_INTERFACE_VERSION, szAbsoluteLibFilename, "director")); if (m_Director) { - m_System->Printf("Using extern director module (%s).\n", szAbsoluteLibFilename); + m_System->DPrintf("Using extern director module (%s).\n", szAbsoluteLibFilename); return true; } @@ -2363,7 +2363,7 @@ double Proxy::GetProxyTime() void Proxy::IncreaseCheering(int votes) { m_CheeringPlayers += votes; - float fraction = (float)(m_CheeringPlayers / m_Clients.CountElements()); + float fraction = float(m_CheeringPlayers) / float(m_Clients.CountElements()); if (fraction > 1) { fraction = 1; } @@ -2496,7 +2496,7 @@ void Proxy::SetClientTime(double time, bool relative) void Proxy::SetClientTimeScale(float scale) { BitBuffer buf(32); - m_ClientTimeScale = clamp(scale, 4.0f, 0.5f); + m_ClientTimeScale = clamp(scale, 0.5f, 4.0f); buf.WriteByte(svc_timescale); buf.WriteFloat(m_ClientTimeScale); diff --git a/rehlds/HLTV/Proxy/src/ProxyClient.h b/rehlds/HLTV/Proxy/src/ProxyClient.h index d397cb008..b4db907b8 100644 --- a/rehlds/HLTV/Proxy/src/ProxyClient.h +++ b/rehlds/HLTV/Proxy/src/ProxyClient.h @@ -36,7 +36,7 @@ class IBaseSystem; class ProxyClient: public BaseClient { public: - ProxyClient(IProxy *proxy); + ProxyClient(IProxy *proxy = nullptr); virtual ~ProxyClient() {} bool Init(IBaseSystem *system, int serial, char *name); diff --git a/rehlds/HLTV/Proxy/src/Status.cpp b/rehlds/HLTV/Proxy/src/Status.cpp index bdf93425a..4bf605a48 100644 --- a/rehlds/HLTV/Proxy/src/Status.cpp +++ b/rehlds/HLTV/Proxy/src/Status.cpp @@ -254,7 +254,11 @@ void Status::ParseStatusReport(NetAddress *from, BitBuffer *stream) proxy->time = float(m_SystemTime); proxy->isPrivate = isPrivate; - float ratio = (slots > 0 && !isPrivate) ? float(spectators / slots) : 1; + float ratio = 1; + if (slots > 0 && !isPrivate) { + ratio = float(spectators) / float(slots); + } + m_Proxies.ChangeKey(proxy, ratio); } @@ -313,7 +317,7 @@ float Status::GetBestRelayProxy(NetAddress *addr) { if (proxy->slots > 0 && proxy->slots >= proxy->spectators && !proxy->isPrivate) { - float ratio = float(++proxy->spectators / proxy->slots); + float ratio = float(++proxy->spectators) / float(proxy->slots); m_Proxies.ChangeKey(proxy, ratio); addr->FromNetAddress(&proxy->address); diff --git a/rehlds/HLTV/Proxy/src/Status.h b/rehlds/HLTV/Proxy/src/Status.h index be5c70d5a..7f89242cb 100644 --- a/rehlds/HLTV/Proxy/src/Status.h +++ b/rehlds/HLTV/Proxy/src/Status.h @@ -48,8 +48,8 @@ class Status: public BaseSystemModule { virtual ~Status() {} bool Init(IBaseSystem *system, int serial, char *name); - void ExecuteCommand(int commandID, char *commandLine); void RunFrame(double time); + void ExecuteCommand(int commandID, char *commandLine); char *GetStatusLine(); char *GetType(); void ShutDown(); diff --git a/rehlds/hookers/HLTV/Proxy/hooklist.cpp b/rehlds/hookers/HLTV/Proxy/hooklist.cpp index 2fb1ca5df..b4a2e595b 100644 --- a/rehlds/hookers/HLTV/Proxy/hooklist.cpp +++ b/rehlds/hookers/HLTV/Proxy/hooklist.cpp @@ -37,6 +37,14 @@ //#define Mem_region //#define Proxy_region //#define BaseClient_region +//#define ProxyClient_region +//#define FakeClient_region +//#define DemoFile_region +//#define DemoClient_region +//#define Director_region +//#define DirectorCmd_region +//#define Status_region +//#define InfoString_region //#define BitBuffer_region //#define NetChannel_region //#define Master_region @@ -207,11 +215,48 @@ FunctionHook g_FunctionHooks[] = HOOK_DEF(0x01D14A50, Proxy::CMD_Region), //HOOK_DEF(0x01D12E70, Proxy::GetModVersion), // NOXREF - //HOOK_DEF(0x0, Proxy::CMD_InformPlayers), // NOXREF - //HOOK_DEF(0x0, Proxy::CMD_MaxUpdateRate), // NOXREF + //HOOK_DEF(0x0, Proxy::CMD_InformPlayers), // NOXREF + //HOOK_DEF(0x0, Proxy::CMD_MaxUpdateRate), // NOXREF #endif // Proxy_region +#ifndef ProxyClient_region + + // BaseSystemModule + HOOK_VIRTUAL_DEF(0x01D16C50, ProxyClient::Init), + HOOK_VIRTUAL_DEF(0x01D16D20, ProxyClient::ShutDown), + + // BaseClient + HOOK_VIRTUAL_DEF(0x01D16A40, ProxyClient::HasChatEnabled), + HOOK_VIRTUAL_DEF(0x01D16B30, ProxyClient::DownloadFile), + HOOK_VIRTUAL_DEF(0x01D16920, ProxyClient::SendDatagram), + HOOK_VIRTUAL_DEF(0x01D168E0, ProxyClient::ReplySpawn), + HOOK_VIRTUAL_DEF(0x01D16770, ProxyClient::UpdateUserInfo), + HOOK_VIRTUAL_DEF(0x01D16A50, ProxyClient::ParseVoiceData), + HOOK_VIRTUAL_DEF(0x01D16310, ProxyClient::ProcessStringCmd), + HOOK_VIRTUAL_DEF(0x01D16850, ProxyClient::ParseHLTV), + +#endif // ProxyClient_region + +#ifndef FakeClient_region + + // BaseSystemModule + HOOK_VIRTUAL_DEF(0x01D09300, FakeClient::Init), + HOOK_VIRTUAL_DEF(0x01D09310, FakeClient::RunFrame), + HOOK_VIRTUAL_DEF(0x01D09320, FakeClient::ReceiveSignal), + HOOK_VIRTUAL_DEF(0x01D09380, FakeClient::GetStatusLine), + HOOK_VIRTUAL_DEF(0x01D09390, FakeClient::GetType), + HOOK_VIRTUAL_DEF(0x01D093D0, FakeClient::ShutDown), + + // FakeClient + HOOK_DEF(0x01D08EA0, FakeClient::SetRate), + HOOK_DEF(0x01D08EB0, FakeClient::Connect), + HOOK_DEF(0x01D08EE0, FakeClient::Retry), // NOXREF + HOOK_DEF(0x01D08EF0, FakeClient::Say), // NOXREF + HOOK_DEF(0x01D08F50, FakeClient::Disconnect), // NOXREF + +#endif // FakeClient_region + #ifndef BaseClient_region // IClient @@ -280,12 +325,12 @@ FunctionHook g_FunctionHooks[] = HOOK_DEF(0x01D03D30, BitBuffer::ConcatBuffer), HOOK_DEF(0x01D03BF0, BitBuffer::SkipBytes), HOOK_DEF(0x01D03040, BitBuffer::CurrentBit), // NOXREF - HOOK_DEF(0x01D038F0, BitBuffer::SpaceLeft), // NOXREF - HOOK_DEF(0x01D03900, BitBuffer::AlignByte), // NOXREF + HOOK_DEF(0x01D038F0, BitBuffer::SpaceLeft), // NOXREF + HOOK_DEF(0x01D03900, BitBuffer::AlignByte), // NOXREF HOOK_DEF(0x01D03A70, BitBuffer::StartBitMode), // NOXREF HOOK_DEF(0x01D03A80, BitBuffer::EndBitMode), // NOXREF - HOOK_DEF(0x01D03AC0, BitBuffer::SetBuffer), // NOXREF - HOOK_DEF(0x01D03C20, BitBuffer::SkipBits), // NOXREF + HOOK_DEF(0x01D03AC0, BitBuffer::SetBuffer), // NOXREF + HOOK_DEF(0x01D03C20, BitBuffer::SkipBits), // NOXREF HOOK_DEF(0x01D03CB0, BitBuffer::SkipString), // NOXREF // Read @@ -305,9 +350,9 @@ FunctionHook g_FunctionHooks[] = HOOK_DEF(0x01D03AF0, BitBuffer::ReadBitVec3Coord), HOOK_DEF(0x01D03B50, BitBuffer::ReadBitCoord), HOOK_DEF(0x01D03BD0, BitBuffer::ReadCoord), - HOOK_DEF(0x01D03420, BitBuffer::ReadAngle), // NOXREF + HOOK_DEF(0x01D03420, BitBuffer::ReadAngle), // NOXREF HOOK_DEF(0x01D03440, BitBuffer::ReadHiresAngle), // NOXREF - HOOK_DEF(0x01D03920, BitBuffer::ReadSBits), // NOXREF + HOOK_DEF(0x01D03920, BitBuffer::ReadSBits), // NOXREF HOOK_DEF(0x01D03950, BitBuffer::ReadBitAngle), // NOXREF // Write @@ -379,7 +424,7 @@ FunctionHook g_FunctionHooks[] = HOOK_DEF(0x01D0D9C0, NetChannel::FreePacket), HOOK_DEF(0x01D0DA30, NetChannel::CopyNormalFragments), HOOK_DEF(0x01D0DBD0, NetChannel::GetFlowStats), - HOOK_DEF(0x01D0DBC0, NetChannel::SetConnected), // NOXREF + HOOK_DEF(0x01D0DBC0, NetChannel::SetConnected), // NOXREF HOOK_DEF(0x01D0DD70, NetChannel::CopyFileFragments), // NOXREF #endif // NetChannel_region @@ -402,6 +447,184 @@ FunctionHook g_FunctionHooks[] = #endif // Master_region +#ifndef DemoFile_region + + HOOK_DEF(0x01D04F60, MethodThunk::Destructor), + HOOK_DEF(0x01D04F10, MethodThunk::Constructor), + + HOOK_DEF(0x01D06380, DemoFile::Init), + HOOK_DEF(0x01D059D0, DemoFile::LoadDemo), + HOOK_DEF(0x01D05D30, DemoFile::StopPlayBack), + HOOK_DEF(0x01D056B0, DemoFile::StartRecording), + HOOK_DEF(0x01D04FC0, DemoFile::CloseFile), + HOOK_DEF(0x01D04F70, DemoFile::Reset), + HOOK_DEF(0x01D06370, DemoFile::SetContinuous), // NOXREF + HOOK_DEF(0x01D06360, DemoFile::IsContinuous), // NOXREF + HOOK_DEF(0x01D059C0, DemoFile::IsPlaying), + HOOK_DEF(0x01D04FB0, DemoFile::IsRecording), + HOOK_DEF(0x01D06350, DemoFile::GetFileName), + HOOK_DEF(0x01D05D60, DemoFile::ReadDemoPacket), + HOOK_DEF(0x01D053B0, DemoFile::WriteDemoMessage), + HOOK_DEF(0x01D05500, DemoFile::WriteUpdateClientData), + HOOK_DEF(0x01D055B0, DemoFile::GetDemoTime), + HOOK_DEF(0x01D06260, DemoFile::ReadSequenceInfo), + HOOK_DEF(0x01D06220, DemoFile::ReadDemoInfo), + HOOK_DEF(0x01D052B0, DemoFile::WriteDemoStartup), + HOOK_DEF(0x01D051C0, DemoFile::WriteSequenceInfo), + HOOK_DEF(0x01D05190, DemoFile::WriteDemoInfo), + HOOK_DEF(0x01D055D0, DemoFile::WriteSignonData), + +#endif // DemoFile_region + +#ifndef DemoClient_region + + // BaseSystemModule + HOOK_VIRTUAL_DEF(0x01D04E30, DemoClient::Init), + HOOK_VIRTUAL_DEF(0x01D04E40, DemoClient::RunFrame), + HOOK_VIRTUAL_DEF(0x01D04EB0, DemoClient::GetStatusLine), + HOOK_VIRTUAL_DEF(0x01D04EC0, DemoClient::GetType), + HOOK_VIRTUAL_DEF(0x01D04F00, DemoClient::ShutDown), + + // IClient + HOOK_VIRTUAL_DEF(0x01D04810, DemoClient::Connect), + HOOK_VIRTUAL_DEF(0x01D04D30, DemoClient::Send), + HOOK_VIRTUAL_DEF(0x01D04BE0, DemoClient::Disconnect), + HOOK_VIRTUAL_DEF(0x01D04800, DemoClient::Reconnect), + HOOK_VIRTUAL_DEF(0x01D04D90, DemoClient::SetWorld), + HOOK_VIRTUAL_DEF(0x01D047F0, DemoClient::GetClientType), + HOOK_VIRTUAL_DEF(0x01D04D60, DemoClient::GetClientName), + HOOK_VIRTUAL_DEF(0x01D04D70, DemoClient::GetUserInfo), + HOOK_VIRTUAL_DEF(0x01D04CE0, DemoClient::GetAddress), + HOOK_VIRTUAL_DEF(0x01D04BD0, DemoClient::IsActive), + HOOK_VIRTUAL_DEF(0x01D047C0, DemoClient::IsHearingVoices), + HOOK_VIRTUAL_DEF(0x01D047D0, DemoClient::HasChatEnabled), + + HOOK_DEF(0x01D04990, DemoClient::SendDatagram), + HOOK_DEF(0x01D04A30, DemoClient::WriteDatagram), + HOOK_DEF(0x01D04C70, DemoClient::FinishDemo), + HOOK_DEF(0x01D04D80, DemoClient::SetProxy), + HOOK_DEF(0x01D04DA0, DemoClient::SetFileName), + HOOK_DEF(0x01D04DD0, DemoClient::GetDemoFile), + +#endif // DemoClient_region + +#ifndef Director_region + + // BaseSystemModule + HOOK_VIRTUAL_DEF(0x01D07BC0, Director::Init), + HOOK_VIRTUAL_DEF(0x01D07BD0, Director::RunFrame), + HOOK_VIRTUAL_DEF(0x01D07BE0, Director::ReceiveSignal), + HOOK_VIRTUAL_DEF(0x01D07BF0, Director::ExecuteCommand), + HOOK_VIRTUAL_DEF(0x01D07C40, Director::GetStatusLine), + HOOK_VIRTUAL_DEF(0x01D07C50, Director::GetType), + HOOK_VIRTUAL_DEF(0x01D07C90, Director::ShutDown), + + // IDirector + HOOK_VIRTUAL_DEF(0x01D068C0, Director::NewGame), + HOOK_VIRTUAL_DEF(0x01D068B0, Director::GetModName), + HOOK_VIRTUAL_DEF(0x01D06E10, Director::WriteCommands), + HOOK_VIRTUAL_DEF(0x01D07A60, Director::AddCommand), + HOOK_VIRTUAL_DEF(0x01D07B50, Director::RemoveCommand), + HOOK_VIRTUAL_DEF(0x01D07B60, Director::GetLastCommand), + HOOK_VIRTUAL_DEF(0x01D07B40, Director::GetCommands), + + // Director + HOOK_DEF(0x01D07910, Director::FindBestEvent), + HOOK_DEF(0x01D07690, Director::ExecuteDirectorCommands), + HOOK_DEF(0x01D07420, Director::RandomizeCommand), + HOOK_DEF(0x01D07280, Director::GetClosestPlayer), + HOOK_DEF(0x01D06EC0, Director::AddEvent), + HOOK_DEF(0x01D06B50, Director::SmoothRank), + HOOK_DEF(0x01D06C40, Director::AnalysePlayer), + HOOK_DEF(0x01D06980, Director::AnalyseFrame), + HOOK_DEF(0x01D073E0, Director::ClearDirectorCommands), + HOOK_DEF(0x01D07110, Director::AddBestMODCut), + HOOK_DEF(0x01D06F00, Director::AddBestGenericCut), + HOOK_DEF(0x01D06EA0, Director::WriteSignonData), + //HOOK_DEF(0x0, Director::WriteProxyStatus), // NOXREF + HOOK_DEF(0x01D07830, Director::CMD_SlowMotion), + +#endif // Director_region + +#ifndef DirectorCmd_region + + HOOK_DEF(0x01D07D00, DirectorCmd::GetEventData), + HOOK_DEF(0x01D07D50, DirectorCmd::GetModeData), + HOOK_DEF(0x01D07D80, DirectorCmd::GetChaseData), + HOOK_DEF(0x01D07DD0, DirectorCmd::GetInEyeData), + HOOK_DEF(0x01D07E00, DirectorCmd::GetMapData), + HOOK_DEF(0x01D07E50, DirectorCmd::GetCameraData), + HOOK_DEF(0x01D07EE0, DirectorCmd::GetCamPathData), + HOOK_DEF(0x01D07F70, DirectorCmd::GetSoundData), + HOOK_DEF(0x01D07FB0, DirectorCmd::GetTime), // NOXREF + HOOK_DEF(0x01D07FC0, DirectorCmd::GetType), + HOOK_DEF(0x01D07FD0, DirectorCmd::GetName), // NOXREF + HOOK_DEF(0x01D07FE0, DirectorCmd::GetTimeScaleData), + HOOK_DEF(0x01D08010, DirectorCmd::GetWayPointsData), + HOOK_DEF(0x01D08040, DirectorCmd::GetMessageData), + HOOK_DEF(0x01D080E0, DirectorCmd::GetStatusData), + HOOK_DEF(0x01D08130, DirectorCmd::GetBannerData), + HOOK_DEF(0x01D08170, DirectorCmd::GetStuffTextData), + HOOK_DEF(0x01D081B0, DirectorCmd::SetEventData), + HOOK_DEF(0x01D081F0, DirectorCmd::SetChaseData), // NOXREF + HOOK_DEF(0x01D08240, DirectorCmd::SetInEyeData), // NOXREF + HOOK_DEF(0x01D08270, DirectorCmd::SetMapData), // NOXREF + HOOK_DEF(0x01D082B0, DirectorCmd::SetStartData), // NOXREF + HOOK_DEF(0x01D082C0, DirectorCmd::SetModeData), // NOXREF + HOOK_DEF(0x01D082F0, DirectorCmd::SetCameraData), // NOXREF + HOOK_DEF(0x01D08370, DirectorCmd::SetCamPathData), // NOXREF + HOOK_DEF(0x01D083F0, DirectorCmd::SetSoundData), + HOOK_DEF(0x01D08440, DirectorCmd::SetTimeScaleData), + HOOK_DEF(0x01D08470, DirectorCmd::SetTime), + HOOK_DEF(0x01D08480, DirectorCmd::SetMessageData), + HOOK_DEF(0x01D08520, DirectorCmd::Copy), // NOXREF + HOOK_DEF(0x01D08570, DirectorCmd::SetStatusData), + HOOK_DEF(0x01D085B0, DirectorCmd::SetBannerData), + HOOK_DEF(0x01D085F0, DirectorCmd::SetStuffTextData), // NOXREF + HOOK_DEF(0x01D08630, DirectorCmd::SetWayPoints), // NOXREF + HOOK_DEF(0x01D08660, DirectorCmd::ReadFromStream), // NOXREF + HOOK_DEF(0x01D088C0, DirectorCmd::WriteToStream), + HOOK_DEF(0x01D08920, DirectorCmd::ToString), // NOXREF + HOOK_DEF(0x01D08D50, DirectorCmd::FromString), // NOXREF + HOOK_DEF(0x01D08D60, DirectorCmd::Clear), + HOOK_DEF(0x01D08D70, DirectorCmd::Resize), + +#endif // DirectorCmd_region + +#ifndef Status_region + + // BaseSystemModule + HOOK_VIRTUAL_DEF(0x01D178A0, Status::Init), + HOOK_VIRTUAL_DEF(0x01D178B0, Status::RunFrame), + HOOK_VIRTUAL_DEF(0x01D178D0, Status::ExecuteCommand), + HOOK_VIRTUAL_DEF(0x01D17920, Status::GetStatusLine), + HOOK_VIRTUAL_DEF(0x01D17930, Status::GetType), + HOOK_VIRTUAL_DEF(0x01D17970, Status::ShutDown), + +#endif // Status_region + +#ifndef InfoString_region + + HOOK_DEF(0x01D09590, MethodThunk::Destructor), + HOOK_DEF(0x01D094F0, (MethodThunk::Constructor), void()), + HOOK_DEF(0x01D09510, (MethodThunk::Constructor), void(unsigned int)), + HOOK_DEF(0x01D09540, (MethodThunk::Constructor), void(char *)), + HOOK_DEF(0x01D09480, (MethodThunk::Constructor), void(char *, unsigned int)), + + HOOK_DEF(0x01D095B0, InfoString::SetString), + HOOK_DEF(0x01D09600, InfoString::SetMaxSize), + HOOK_DEF(0x01D09660, InfoString::GetMaxSize), + HOOK_DEF(0x01D09670, InfoString::GetCurrentSize), + HOOK_DEF(0x01D09690, InfoString::Clear), + HOOK_DEF(0x01D096B0, InfoString::GetString), + HOOK_DEF(0x01D096C0, InfoString::ValueForKey), + HOOK_DEF(0x01D097B0, InfoString::RemoveKey), + HOOK_DEF(0x01D09880, InfoString::RemovePrefixedKeys), + HOOK_DEF(0x01D09900, InfoString::SetValueForStarKey), + HOOK_DEF(0x01D09AB0, InfoString::SetValueForKey), + +#endif // InfoString_region + { NULL, NULL, NULL }, }; @@ -418,7 +641,6 @@ AddressRef g_DataRefs[] = { #ifndef Data_References_region - #endif // Data_References_region { NULL, NULL, NULL },