2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-16 08:38:10 +03:00

HLTV: Some fixes director part and small refactoring.

This commit is contained in:
s1lent 2017-05-13 21:52:14 +07:00
parent 92b6fd6944
commit 5981a4c544
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
15 changed files with 351 additions and 111 deletions

View File

@ -30,19 +30,8 @@
System gSystem; System gSystem;
#ifdef _WIN32 int System::Run()
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
#else
int main(int argc, char *argv[])
#endif // _WIN32
{ {
#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")) if (!gSystem.Init(&gSystem, 0, "Console"))
{ {
gSystem.Sleep(2000); gSystem.Sleep(2000);
@ -600,47 +589,6 @@ void System::ShutDown()
m_State = MODULE_DISCONNECTED; 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() bool System::InitFileSystem()
{ {
char *filesystemmodule = STDIO_FILESYSTEM_LIB; char *filesystemmodule = STDIO_FILESYSTEM_LIB;
@ -1139,3 +1087,58 @@ unsigned char *System::LoadFile(const char *name, int *length)
return buf; 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

View File

@ -73,12 +73,10 @@ public:
void ShutDown(); void ShutDown();
char *GetBaseDir(); char *GetBaseDir();
#ifdef _WIN32 int Run();
void BuildCommandLine(char *argv);
#else
void BuildCommandLine(int argc, char **argv);
#endif // _WIN32
void Sleep(int msec); void Sleep(int msec);
void BuildCommandLine(char *argv);
void BuildCommandLine(int argc, char **argv);
protected: protected:
struct command_t { struct command_t {

View File

@ -410,35 +410,40 @@ bool BSPModel::InPVS(vec_t *point)
return false; return false;
} }
void BSPModel::Free(void *ptr)
{
if (ptr) {
Mem_Free(ptr);
}
}
void BSPModel::Clear() void BSPModel::Clear()
{ {
#define FREE_FIELD(field) if (field) { Mem_Free(field); } Free(m_model.leafs);
FREE_FIELD(m_model.leafs); Free(m_model.nodes);
FREE_FIELD(m_model.nodes); Free(m_model.planes);
FREE_FIELD(m_model.planes); Free(m_model.visdata);
FREE_FIELD(m_model.visdata); Free(m_model.vertexes);
FREE_FIELD(m_model.vertexes); Free(m_model.entities);
FREE_FIELD(m_model.entities); Free(m_model.edges);
FREE_FIELD(m_model.edges); Free(m_model.lightdata);
FREE_FIELD(m_model.lightdata); Free(m_model.surfedges);
FREE_FIELD(m_model.surfedges); Free(m_model.surfaces);
FREE_FIELD(m_model.surfaces); Free(m_model.marksurfaces);
FREE_FIELD(m_model.marksurfaces); Free(m_model.clipnodes);
FREE_FIELD(m_model.clipnodes); Free(m_model.hulls[0].clipnodes);
FREE_FIELD(m_model.hulls[0].clipnodes); Free(m_model.texinfo);
FREE_FIELD(m_model.texinfo);
if (m_model.textures) if (m_model.textures)
{ {
for (int i = 0; i < m_model.numtextures; ++i) { 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); Free(m_wadpath);
#undef FREE_FIELD
memset(&m_model, 0, sizeof(m_model)); memset(&m_model, 0, sizeof(m_model));

View File

@ -83,6 +83,7 @@ private:
void DecompressPVS(unsigned char *in, unsigned char *decompressed, int byteCount); void DecompressPVS(unsigned char *in, unsigned char *decompressed, int byteCount);
unsigned char *DecompressVis(unsigned char *in); unsigned char *DecompressVis(unsigned char *in);
void SetParent(mnode_t *node, mnode_t *parent); void SetParent(mnode_t *node, mnode_t *parent);
void Free(void *ptr);
protected: protected:
model_t m_model; model_t m_model;

View File

@ -1393,7 +1393,7 @@ char *World::GetStatusLine()
m_LevelName, m_LevelName,
COM_FormatTime(m_WorldTime), COM_FormatTime(m_WorldTime),
GetNumPlayers(), GetNumPlayers(),
(float)m_CacheHits / (float)(m_CacheHits + m_CacheFaults), m_CacheHits / float(m_CacheHits + m_CacheFaults),
GetBufferedGameTime()); GetBufferedGameTime());
} }
else else

View File

@ -161,7 +161,7 @@ void Director::NewGame(IWorld *world, IProxy *proxy)
m_World = world; m_World = world;
m_Proxy = proxy; m_Proxy = proxy;
world->RegisterListener(this); m_World->RegisterListener(this);
m_WorldModel = m_World->GetWorldModel(); m_WorldModel = m_World->GetWorldModel();
memset(m_history, 0, sizeof(*m_history) * m_historyLength); memset(m_history, 0, sizeof(*m_history) * m_historyLength);
@ -203,7 +203,7 @@ void Director::AnalyseFrame(frame_t *frame)
return; return;
} }
if (m_currentTime) if (!m_currentTime)
{ {
m_nextCutTime = frame->time; m_nextCutTime = frame->time;
m_nextCutSeqnr = seqnr; m_nextCutSeqnr = seqnr;
@ -224,7 +224,7 @@ void Director::AnalyseFrame(frame_t *frame)
continue; continue;
} }
playerData_t *player = &now->players[i]; playerData_t *player = &now->players[index];
player->active = (ent->solid != SOLID_NOT); player->active = (ent->solid != SOLID_NOT);
if (player->active) if (player->active)
{ {
@ -477,7 +477,7 @@ float Director::AddBestMODCut()
cmd = new DirectorCmd; cmd = new DirectorCmd;
cmd->SetTimeScaleData(1.0); cmd->SetTimeScaleData(1.0);
cmd->SetTime(timepoint->time + 1.5f); cmd->SetTime(timepoint->time + trailTime);
m_Commands.Add(cmd, cmd->GetTime()); m_Commands.Add(cmd, cmd->GetTime());
} }
@ -642,7 +642,7 @@ void Director::ExecuteDirectorCommands()
if (timescale < 1.0) if (timescale < 1.0)
{ {
vec3_t pos = { 0.02f, 0.85f, 0.f }; vec3_t pos = { 0.02f, 0.75f, 0.f };
DirectorCmd slowmo; DirectorCmd slowmo;
slowmo.SetMessageData(0, COM_PackRGBA(255, 160, 0, 255), pos, 0.3f, 0.1f, 2, 0, "Slow Motion"); 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() Director::worldHistory_t *Director::FindBestEvent()
{ {
const int MAX_BEST_EVENT = 4;
int i; int i;
int nseqMod = m_nextCutSeqnr % m_historyLength; int nseqMod = m_nextCutSeqnr % m_historyLength;
int bestEvent[] = { 0, 0, 0, 0 }; int bestEvent[MAX_BEST_EVENT] = { 0, 0, 0, 0 };
int bestEventPrio[] = { 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; bestEventPrio[i] = 0;
bestEvent[i] = 0; bestEvent[i] = 0;

View File

@ -49,9 +49,9 @@ public:
virtual void ShutDown(); virtual void ShutDown();
virtual void NewGame(IWorld *world, IProxy *proxy); 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 char *GetModName();
virtual void WriteCommands(BitBuffer *stream, float startTime, float endTime);
virtual int AddCommand(DirectorCmd *cmd);
virtual bool RemoveCommand(int index); virtual bool RemoveCommand(int index);
virtual DirectorCmd *GetLastCommand(); virtual DirectorCmd *GetLastCommand();
virtual IObjectContainer *GetCommands(); virtual IObjectContainer *GetCommands();

View File

@ -231,6 +231,7 @@
<ClInclude Include="..\..\common\NetAddress.h" /> <ClInclude Include="..\..\common\NetAddress.h" />
<ClInclude Include="..\..\common\net_internal.h" /> <ClInclude Include="..\..\common\net_internal.h" />
<ClInclude Include="..\..\common\random.h" /> <ClInclude Include="..\..\common\random.h" />
<ClInclude Include="..\..\Director\src\Director.h" />
<ClInclude Include="..\src\DemoClient.h" /> <ClInclude Include="..\src\DemoClient.h" />
<ClInclude Include="..\src\FakeClient.h" /> <ClInclude Include="..\src\FakeClient.h" />
<ClInclude Include="..\src\Master.h" /> <ClInclude Include="..\src\Master.h" />

View File

@ -191,5 +191,8 @@
<ClInclude Include="..\..\..\engine\mem.h"> <ClInclude Include="..\..\..\engine\mem.h">
<Filter>engine</Filter> <Filter>engine</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\Director\src\Director.h">
<Filter>src</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -40,18 +40,19 @@ public:
char *GetStatusLine(); char *GetStatusLine();
char *GetType(); char *GetType();
void ShutDown(); void ShutDown();
bool Connect(INetSocket *socket = nullptr, NetAddress *adr = nullptr, char *userinfo = ""); 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 Disconnect(const char *reason);
void Reconnect(); void Reconnect();
void SetWorld(IWorld *world); void SetWorld(IWorld *world);
bool IsHearingVoices();
bool HasChatEnabled();
NetAddress *GetAddress();
int GetClientType(); int GetClientType();
char *GetClientName(); char *GetClientName();
InfoString *GetUserInfo(); InfoString *GetUserInfo();
NetAddress *GetAddress();
bool IsActive(); bool IsActive();
void Send(unsigned char *data, int length, bool isReliable); bool IsHearingVoices();
bool HasChatEnabled();
void SetProxy(IProxy *proxy); void SetProxy(IProxy *proxy);
void SetFileName(char *fileName); void SetFileName(char *fileName);

View File

@ -470,7 +470,7 @@ void Proxy::ReplyConnect(NetAddress *to, int protocol, int challenge, char *prot
if (type == TYPE_CLIENT && m_DispatchMode != DISPATCH_OFF) if (type == TYPE_CLIENT && m_DispatchMode != DISPATCH_OFF)
{ {
float ratio = m_Status.GetBestRelayProxy(&relayProxy); 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) { if (myRatio > 1) {
myRatio = 1; myRatio = 1;
} }
@ -740,7 +740,7 @@ bool Proxy::WriteSignonData(int type, BitBuffer *stream)
stream->WriteString(COM_VarArgs("%s\n", m_SignonCommands)); 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->WriteByte(svc_stufftext);
stream->WriteString(COM_VarArgs("ex_interp %.2f\n", ex_interp)); stream->WriteString(COM_VarArgs("ex_interp %.2f\n", ex_interp));
@ -1811,7 +1811,7 @@ bool Proxy::CheckDirectorModule()
m_Director = dynamic_cast<IDirector *>(m_System->GetModule(DIRECTOR_INTERFACE_VERSION, szAbsoluteLibFilename, "director")); m_Director = dynamic_cast<IDirector *>(m_System->GetModule(DIRECTOR_INTERFACE_VERSION, szAbsoluteLibFilename, "director"));
if (m_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; return true;
} }
@ -2363,7 +2363,7 @@ double Proxy::GetProxyTime()
void Proxy::IncreaseCheering(int votes) void Proxy::IncreaseCheering(int votes)
{ {
m_CheeringPlayers += votes; m_CheeringPlayers += votes;
float fraction = (float)(m_CheeringPlayers / m_Clients.CountElements()); float fraction = float(m_CheeringPlayers) / float(m_Clients.CountElements());
if (fraction > 1) { if (fraction > 1) {
fraction = 1; fraction = 1;
} }
@ -2496,7 +2496,7 @@ void Proxy::SetClientTime(double time, bool relative)
void Proxy::SetClientTimeScale(float scale) void Proxy::SetClientTimeScale(float scale)
{ {
BitBuffer buf(32); BitBuffer buf(32);
m_ClientTimeScale = clamp(scale, 4.0f, 0.5f); m_ClientTimeScale = clamp(scale, 0.5f, 4.0f);
buf.WriteByte(svc_timescale); buf.WriteByte(svc_timescale);
buf.WriteFloat(m_ClientTimeScale); buf.WriteFloat(m_ClientTimeScale);

View File

@ -36,7 +36,7 @@ class IBaseSystem;
class ProxyClient: public BaseClient { class ProxyClient: public BaseClient {
public: public:
ProxyClient(IProxy *proxy); ProxyClient(IProxy *proxy = nullptr);
virtual ~ProxyClient() {} virtual ~ProxyClient() {}
bool Init(IBaseSystem *system, int serial, char *name); bool Init(IBaseSystem *system, int serial, char *name);

View File

@ -254,7 +254,11 @@ void Status::ParseStatusReport(NetAddress *from, BitBuffer *stream)
proxy->time = float(m_SystemTime); proxy->time = float(m_SystemTime);
proxy->isPrivate = isPrivate; 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); m_Proxies.ChangeKey(proxy, ratio);
} }
@ -313,7 +317,7 @@ float Status::GetBestRelayProxy(NetAddress *addr)
{ {
if (proxy->slots > 0 && proxy->slots >= proxy->spectators && !proxy->isPrivate) 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); m_Proxies.ChangeKey(proxy, ratio);
addr->FromNetAddress(&proxy->address); addr->FromNetAddress(&proxy->address);

View File

@ -48,8 +48,8 @@ public:
virtual ~Status() {} virtual ~Status() {}
bool Init(IBaseSystem *system, int serial, char *name); bool Init(IBaseSystem *system, int serial, char *name);
void ExecuteCommand(int commandID, char *commandLine);
void RunFrame(double time); void RunFrame(double time);
void ExecuteCommand(int commandID, char *commandLine);
char *GetStatusLine(); char *GetStatusLine();
char *GetType(); char *GetType();
void ShutDown(); void ShutDown();

View File

@ -37,6 +37,14 @@
//#define Mem_region //#define Mem_region
//#define Proxy_region //#define Proxy_region
//#define BaseClient_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 BitBuffer_region
//#define NetChannel_region //#define NetChannel_region
//#define Master_region //#define Master_region
@ -212,6 +220,43 @@ FunctionHook g_FunctionHooks[] =
#endif // Proxy_region #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 #ifndef BaseClient_region
// IClient // IClient
@ -402,6 +447,184 @@ FunctionHook g_FunctionHooks[] =
#endif // Master_region #endif // Master_region
#ifndef DemoFile_region
HOOK_DEF(0x01D04F60, MethodThunk<DemoFile>::Destructor),
HOOK_DEF(0x01D04F10, MethodThunk<DemoFile>::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<InfoString>::Destructor),
HOOK_DEF(0x01D094F0, (MethodThunk<InfoString>::Constructor), void()),
HOOK_DEF(0x01D09510, (MethodThunk<InfoString, unsigned int>::Constructor), void(unsigned int)),
HOOK_DEF(0x01D09540, (MethodThunk<InfoString, char *>::Constructor), void(char *)),
HOOK_DEF(0x01D09480, (MethodThunk<InfoString, char *, unsigned int>::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 }, { NULL, NULL, NULL },
}; };
@ -418,7 +641,6 @@ AddressRef g_DataRefs[] =
{ {
#ifndef Data_References_region #ifndef Data_References_region
#endif // Data_References_region #endif // Data_References_region
{ NULL, NULL, NULL }, { NULL, NULL, NULL },