[General] Fixed line endings
- converted all line endings in cpp/hpp files to dos
This commit is contained in:
parent
0221954b41
commit
124e86387b
@ -13,7 +13,7 @@ namespace Components
|
|||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "AntiCheat"; };
|
const char* getName() { return "AntiCheat"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void CrashClient();
|
static void CrashClient();
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ namespace Components
|
|||||||
ArenaLength();
|
ArenaLength();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "ArenaLength"; };
|
const char* getName() { return "ArenaLength"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Game::newMapArena_t NewArenas[128];
|
static Game::newMapArena_t NewArenas[128];
|
||||||
|
@ -22,7 +22,7 @@ namespace Components
|
|||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "AssetHandler"; };
|
const char* getName() { return "AssetHandler"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void OnFind(Game::XAssetType type, Callback* callback);
|
static void OnFind(Game::XAssetType type, Callback* callback);
|
||||||
static void OnLoad(RestrictCallback* callback);
|
static void OnLoad(RestrictCallback* callback);
|
||||||
|
@ -7,8 +7,8 @@ namespace Components
|
|||||||
~Auth();
|
~Auth();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Auth"; };
|
const char* getName() { return "Auth"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool unitTest();
|
bool unitTest();
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ namespace Components
|
|||||||
~Bans();
|
~Bans();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Bans"; };
|
const char* getName() { return "Bans"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void BanClientNum(int num, std::string reason);
|
static void BanClientNum(int num, std::string reason);
|
||||||
|
@ -1,40 +1,40 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Colors : public Component
|
class Colors : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Colors();
|
Colors();
|
||||||
~Colors();
|
~Colors();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Colors"; };
|
const char* getName() { return "Colors"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void Strip(const char* in, char* out, int max);
|
static void Strip(const char* in, char* out, int max);
|
||||||
static std::string Strip(std::string in);
|
static std::string Strip(std::string in);
|
||||||
|
|
||||||
static char Add(uint8_t r, uint8_t g, uint8_t b);
|
static char Add(uint8_t r, uint8_t g, uint8_t b);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct HsvColor
|
struct HsvColor
|
||||||
{
|
{
|
||||||
unsigned char h;
|
unsigned char h;
|
||||||
unsigned char s;
|
unsigned char s;
|
||||||
unsigned char v;
|
unsigned char v;
|
||||||
};
|
};
|
||||||
|
|
||||||
static Dvar::Var NewColors;
|
static Dvar::Var NewColors;
|
||||||
|
|
||||||
static DWORD HsvToRgb(HsvColor hsv);
|
static DWORD HsvToRgb(HsvColor hsv);
|
||||||
|
|
||||||
static void ClientUserinfoChanged();
|
static void ClientUserinfoChanged();
|
||||||
static char* GetClientName(int localClientNum, int index, char *buf, size_t size);
|
static char* GetClientName(int localClientNum, int index, char *buf, size_t size);
|
||||||
static void PatchColorLimit(char limit);
|
static void PatchColorLimit(char limit);
|
||||||
|
|
||||||
static unsigned int ColorIndex(unsigned char);
|
static unsigned int ColorIndex(unsigned char);
|
||||||
static void LookupColor(DWORD* color, char index);
|
static void LookupColor(DWORD* color, char index);
|
||||||
static void LookupColorStub();
|
static void LookupColorStub();
|
||||||
static char* CleanStrStub(char* string);
|
static char* CleanStrStub(char* string);
|
||||||
static std::vector<DWORD> ColorTable;
|
static std::vector<DWORD> ColorTable;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ namespace Components
|
|||||||
~Command();
|
~Command();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Command"; };
|
const char* getName() { return "Command"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Game::cmd_function_t* Allocate();
|
static Game::cmd_function_t* Allocate();
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
bool ConnectProtocol::Evaluated = false;
|
bool ConnectProtocol::Evaluated = false;
|
||||||
std::string ConnectProtocol::ConnectString;
|
std::string ConnectProtocol::ConnectString;
|
||||||
|
|
||||||
bool ConnectProtocol::IsEvaluated()
|
bool ConnectProtocol::IsEvaluated()
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class ConnectProtocol : public Component
|
class ConnectProtocol : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConnectProtocol();
|
ConnectProtocol();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "ConnectProtocol"; };
|
const char* getName() { return "ConnectProtocol"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool IsEvaluated();
|
static bool IsEvaluated();
|
||||||
static bool Used();
|
static bool Used();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool Evaluated;
|
static bool Evaluated;
|
||||||
static std::string ConnectString;
|
static std::string ConnectString;
|
||||||
|
|
||||||
static void EvaluateProtocol();
|
static void EvaluateProtocol();
|
||||||
static bool InstallProtocol();
|
static bool InstallProtocol();
|
||||||
|
|
||||||
static void Invocation();
|
static void Invocation();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,174 +1,174 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class D3D9Ex : public Component
|
class D3D9Ex : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
D3D9Ex();
|
D3D9Ex();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "D3D9Ex"; };
|
const char* getName() { return "D3D9Ex"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
class D3D9Device : public IDirect3DDevice9
|
class D3D9Device : public IDirect3DDevice9
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
D3D9Device(IDirect3DDevice9* pOriginal) : m_pIDirect3DDevice9(pOriginal) {};
|
D3D9Device(IDirect3DDevice9* pOriginal) : m_pIDirect3DDevice9(pOriginal) {};
|
||||||
virtual ~D3D9Device(void) {};
|
virtual ~D3D9Device(void) {};
|
||||||
|
|
||||||
HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj);
|
HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj);
|
||||||
ULONG __stdcall AddRef(void);
|
ULONG __stdcall AddRef(void);
|
||||||
ULONG __stdcall Release(void);
|
ULONG __stdcall Release(void);
|
||||||
HRESULT __stdcall TestCooperativeLevel(void);
|
HRESULT __stdcall TestCooperativeLevel(void);
|
||||||
UINT __stdcall GetAvailableTextureMem(void);
|
UINT __stdcall GetAvailableTextureMem(void);
|
||||||
HRESULT __stdcall EvictManagedResources(void);
|
HRESULT __stdcall EvictManagedResources(void);
|
||||||
HRESULT __stdcall GetDirect3D(IDirect3D9** ppD3D9);
|
HRESULT __stdcall GetDirect3D(IDirect3D9** ppD3D9);
|
||||||
HRESULT __stdcall GetDeviceCaps(D3DCAPS9* pCaps);
|
HRESULT __stdcall GetDeviceCaps(D3DCAPS9* pCaps);
|
||||||
HRESULT __stdcall GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode);
|
HRESULT __stdcall GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode);
|
||||||
HRESULT __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters);
|
HRESULT __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters);
|
||||||
HRESULT __stdcall SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap);
|
HRESULT __stdcall SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap);
|
||||||
void __stdcall SetCursorPosition(int X, int Y, DWORD Flags);
|
void __stdcall SetCursorPosition(int X, int Y, DWORD Flags);
|
||||||
BOOL __stdcall ShowCursor(BOOL bShow);
|
BOOL __stdcall ShowCursor(BOOL bShow);
|
||||||
HRESULT __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain);
|
HRESULT __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain);
|
||||||
HRESULT __stdcall GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain);
|
HRESULT __stdcall GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain);
|
||||||
UINT __stdcall GetNumberOfSwapChains(void);
|
UINT __stdcall GetNumberOfSwapChains(void);
|
||||||
HRESULT __stdcall Reset(D3DPRESENT_PARAMETERS* pPresentationParameters);
|
HRESULT __stdcall Reset(D3DPRESENT_PARAMETERS* pPresentationParameters);
|
||||||
HRESULT __stdcall Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
|
HRESULT __stdcall Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
|
||||||
HRESULT __stdcall GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer);
|
HRESULT __stdcall GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer);
|
||||||
HRESULT __stdcall GetRasterStatus(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus);
|
HRESULT __stdcall GetRasterStatus(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus);
|
||||||
HRESULT __stdcall SetDialogBoxMode(BOOL bEnableDialogs);
|
HRESULT __stdcall SetDialogBoxMode(BOOL bEnableDialogs);
|
||||||
void __stdcall SetGammaRamp(UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp);
|
void __stdcall SetGammaRamp(UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp);
|
||||||
void __stdcall GetGammaRamp(UINT iSwapChain, D3DGAMMARAMP* pRamp);
|
void __stdcall GetGammaRamp(UINT iSwapChain, D3DGAMMARAMP* pRamp);
|
||||||
HRESULT __stdcall CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle);
|
HRESULT __stdcall CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle);
|
||||||
HRESULT __stdcall CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle);
|
HRESULT __stdcall CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle);
|
||||||
HRESULT __stdcall CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle);
|
HRESULT __stdcall CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle);
|
||||||
HRESULT __stdcall CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle);
|
HRESULT __stdcall CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle);
|
||||||
HRESULT __stdcall CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle);
|
HRESULT __stdcall CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle);
|
||||||
HRESULT __stdcall CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
HRESULT __stdcall CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
||||||
HRESULT __stdcall CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
HRESULT __stdcall CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
||||||
HRESULT __stdcall UpdateSurface(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint);
|
HRESULT __stdcall UpdateSurface(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint);
|
||||||
HRESULT __stdcall UpdateTexture(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture);
|
HRESULT __stdcall UpdateTexture(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture);
|
||||||
HRESULT __stdcall GetRenderTargetData(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface);
|
HRESULT __stdcall GetRenderTargetData(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface);
|
||||||
HRESULT __stdcall GetFrontBufferData(UINT iSwapChain, IDirect3DSurface9* pDestSurface);
|
HRESULT __stdcall GetFrontBufferData(UINT iSwapChain, IDirect3DSurface9* pDestSurface);
|
||||||
HRESULT __stdcall StretchRect(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter);
|
HRESULT __stdcall StretchRect(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter);
|
||||||
HRESULT __stdcall ColorFill(IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color);
|
HRESULT __stdcall ColorFill(IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color);
|
||||||
HRESULT __stdcall CreateOffscreenPlainSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
HRESULT __stdcall CreateOffscreenPlainSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
||||||
HRESULT __stdcall SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget);
|
HRESULT __stdcall SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget);
|
||||||
HRESULT __stdcall GetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget);
|
HRESULT __stdcall GetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget);
|
||||||
HRESULT __stdcall SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil);
|
HRESULT __stdcall SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil);
|
||||||
HRESULT __stdcall GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface);
|
HRESULT __stdcall GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface);
|
||||||
HRESULT __stdcall BeginScene(void);
|
HRESULT __stdcall BeginScene(void);
|
||||||
HRESULT __stdcall EndScene(void);
|
HRESULT __stdcall EndScene(void);
|
||||||
HRESULT __stdcall Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil);
|
HRESULT __stdcall Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil);
|
||||||
HRESULT __stdcall SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
|
HRESULT __stdcall SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
|
||||||
HRESULT __stdcall GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
|
HRESULT __stdcall GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
|
||||||
HRESULT __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
|
HRESULT __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
|
||||||
HRESULT __stdcall SetViewport(CONST D3DVIEWPORT9* pViewport);
|
HRESULT __stdcall SetViewport(CONST D3DVIEWPORT9* pViewport);
|
||||||
HRESULT __stdcall GetViewport(D3DVIEWPORT9* pViewport);
|
HRESULT __stdcall GetViewport(D3DVIEWPORT9* pViewport);
|
||||||
HRESULT __stdcall SetMaterial(CONST D3DMATERIAL9* pMaterial);
|
HRESULT __stdcall SetMaterial(CONST D3DMATERIAL9* pMaterial);
|
||||||
HRESULT __stdcall GetMaterial(D3DMATERIAL9* pMaterial);
|
HRESULT __stdcall GetMaterial(D3DMATERIAL9* pMaterial);
|
||||||
HRESULT __stdcall SetLight(DWORD Index, CONST D3DLIGHT9* pLight);
|
HRESULT __stdcall SetLight(DWORD Index, CONST D3DLIGHT9* pLight);
|
||||||
HRESULT __stdcall GetLight(DWORD Index, D3DLIGHT9* pLight);
|
HRESULT __stdcall GetLight(DWORD Index, D3DLIGHT9* pLight);
|
||||||
HRESULT __stdcall LightEnable(DWORD Index, BOOL Enable);
|
HRESULT __stdcall LightEnable(DWORD Index, BOOL Enable);
|
||||||
HRESULT __stdcall GetLightEnable(DWORD Index, BOOL* pEnable);
|
HRESULT __stdcall GetLightEnable(DWORD Index, BOOL* pEnable);
|
||||||
HRESULT __stdcall SetClipPlane(DWORD Index, CONST float* pPlane);
|
HRESULT __stdcall SetClipPlane(DWORD Index, CONST float* pPlane);
|
||||||
HRESULT __stdcall GetClipPlane(DWORD Index, float* pPlane);
|
HRESULT __stdcall GetClipPlane(DWORD Index, float* pPlane);
|
||||||
HRESULT __stdcall SetRenderState(D3DRENDERSTATETYPE State, DWORD Value);
|
HRESULT __stdcall SetRenderState(D3DRENDERSTATETYPE State, DWORD Value);
|
||||||
HRESULT __stdcall GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue);
|
HRESULT __stdcall GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue);
|
||||||
HRESULT __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB);
|
HRESULT __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB);
|
||||||
HRESULT __stdcall BeginStateBlock(void);
|
HRESULT __stdcall BeginStateBlock(void);
|
||||||
HRESULT __stdcall EndStateBlock(IDirect3DStateBlock9** ppSB);
|
HRESULT __stdcall EndStateBlock(IDirect3DStateBlock9** ppSB);
|
||||||
HRESULT __stdcall SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus);
|
HRESULT __stdcall SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus);
|
||||||
HRESULT __stdcall GetClipStatus(D3DCLIPSTATUS9* pClipStatus);
|
HRESULT __stdcall GetClipStatus(D3DCLIPSTATUS9* pClipStatus);
|
||||||
HRESULT __stdcall GetTexture(DWORD Stage, IDirect3DBaseTexture9** ppTexture);
|
HRESULT __stdcall GetTexture(DWORD Stage, IDirect3DBaseTexture9** ppTexture);
|
||||||
HRESULT __stdcall SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture);
|
HRESULT __stdcall SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture);
|
||||||
HRESULT __stdcall GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue);
|
HRESULT __stdcall GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue);
|
||||||
HRESULT __stdcall SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
|
HRESULT __stdcall SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
|
||||||
HRESULT __stdcall GetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue);
|
HRESULT __stdcall GetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue);
|
||||||
HRESULT __stdcall SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value);
|
HRESULT __stdcall SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value);
|
||||||
HRESULT __stdcall ValidateDevice(DWORD* pNumPasses);
|
HRESULT __stdcall ValidateDevice(DWORD* pNumPasses);
|
||||||
HRESULT __stdcall SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries);
|
HRESULT __stdcall SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries);
|
||||||
HRESULT __stdcall GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries);
|
HRESULT __stdcall GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries);
|
||||||
HRESULT __stdcall SetCurrentTexturePalette(UINT PaletteNumber);
|
HRESULT __stdcall SetCurrentTexturePalette(UINT PaletteNumber);
|
||||||
HRESULT __stdcall GetCurrentTexturePalette(UINT *PaletteNumber);
|
HRESULT __stdcall GetCurrentTexturePalette(UINT *PaletteNumber);
|
||||||
HRESULT __stdcall SetScissorRect(CONST RECT* pRect);
|
HRESULT __stdcall SetScissorRect(CONST RECT* pRect);
|
||||||
HRESULT __stdcall GetScissorRect(RECT* pRect);
|
HRESULT __stdcall GetScissorRect(RECT* pRect);
|
||||||
HRESULT __stdcall SetSoftwareVertexProcessing(BOOL bSoftware);
|
HRESULT __stdcall SetSoftwareVertexProcessing(BOOL bSoftware);
|
||||||
BOOL __stdcall GetSoftwareVertexProcessing(void);
|
BOOL __stdcall GetSoftwareVertexProcessing(void);
|
||||||
HRESULT __stdcall SetNPatchMode(float nSegments);
|
HRESULT __stdcall SetNPatchMode(float nSegments);
|
||||||
float __stdcall GetNPatchMode(void);
|
float __stdcall GetNPatchMode(void);
|
||||||
HRESULT __stdcall DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
|
HRESULT __stdcall DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
|
||||||
HRESULT __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount);
|
HRESULT __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount);
|
||||||
HRESULT __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
HRESULT __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||||
HRESULT __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
HRESULT __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||||
HRESULT __stdcall ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags);
|
HRESULT __stdcall ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags);
|
||||||
HRESULT __stdcall CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl);
|
HRESULT __stdcall CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl);
|
||||||
HRESULT __stdcall SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl);
|
HRESULT __stdcall SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl);
|
||||||
HRESULT __stdcall GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl);
|
HRESULT __stdcall GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl);
|
||||||
HRESULT __stdcall SetFVF(DWORD FVF);
|
HRESULT __stdcall SetFVF(DWORD FVF);
|
||||||
HRESULT __stdcall GetFVF(DWORD* pFVF);
|
HRESULT __stdcall GetFVF(DWORD* pFVF);
|
||||||
HRESULT __stdcall CreateVertexShader(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader);
|
HRESULT __stdcall CreateVertexShader(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader);
|
||||||
HRESULT __stdcall SetVertexShader(IDirect3DVertexShader9* pShader);
|
HRESULT __stdcall SetVertexShader(IDirect3DVertexShader9* pShader);
|
||||||
HRESULT __stdcall GetVertexShader(IDirect3DVertexShader9** ppShader);
|
HRESULT __stdcall GetVertexShader(IDirect3DVertexShader9** ppShader);
|
||||||
HRESULT __stdcall SetVertexShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
|
HRESULT __stdcall SetVertexShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
|
||||||
HRESULT __stdcall GetVertexShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount);
|
HRESULT __stdcall GetVertexShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount);
|
||||||
HRESULT __stdcall SetVertexShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
|
HRESULT __stdcall SetVertexShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
|
||||||
HRESULT __stdcall GetVertexShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount);
|
HRESULT __stdcall GetVertexShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount);
|
||||||
HRESULT __stdcall SetVertexShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
|
HRESULT __stdcall SetVertexShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
|
||||||
HRESULT __stdcall GetVertexShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
|
HRESULT __stdcall GetVertexShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
|
||||||
HRESULT __stdcall SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride);
|
HRESULT __stdcall SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride);
|
||||||
HRESULT __stdcall GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride);
|
HRESULT __stdcall GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride);
|
||||||
HRESULT __stdcall SetStreamSourceFreq(UINT StreamNumber, UINT Divider);
|
HRESULT __stdcall SetStreamSourceFreq(UINT StreamNumber, UINT Divider);
|
||||||
HRESULT __stdcall GetStreamSourceFreq(UINT StreamNumber, UINT* Divider);
|
HRESULT __stdcall GetStreamSourceFreq(UINT StreamNumber, UINT* Divider);
|
||||||
HRESULT __stdcall SetIndices(IDirect3DIndexBuffer9* pIndexData);
|
HRESULT __stdcall SetIndices(IDirect3DIndexBuffer9* pIndexData);
|
||||||
HRESULT __stdcall GetIndices(IDirect3DIndexBuffer9** ppIndexData);
|
HRESULT __stdcall GetIndices(IDirect3DIndexBuffer9** ppIndexData);
|
||||||
HRESULT __stdcall CreatePixelShader(CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader);
|
HRESULT __stdcall CreatePixelShader(CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader);
|
||||||
HRESULT __stdcall SetPixelShader(IDirect3DPixelShader9* pShader);
|
HRESULT __stdcall SetPixelShader(IDirect3DPixelShader9* pShader);
|
||||||
HRESULT __stdcall GetPixelShader(IDirect3DPixelShader9** ppShader);
|
HRESULT __stdcall GetPixelShader(IDirect3DPixelShader9** ppShader);
|
||||||
HRESULT __stdcall SetPixelShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
|
HRESULT __stdcall SetPixelShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
|
||||||
HRESULT __stdcall GetPixelShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount);
|
HRESULT __stdcall GetPixelShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount);
|
||||||
HRESULT __stdcall SetPixelShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
|
HRESULT __stdcall SetPixelShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
|
||||||
HRESULT __stdcall GetPixelShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount);
|
HRESULT __stdcall GetPixelShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount);
|
||||||
HRESULT __stdcall SetPixelShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
|
HRESULT __stdcall SetPixelShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
|
||||||
HRESULT __stdcall GetPixelShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
|
HRESULT __stdcall GetPixelShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
|
||||||
HRESULT __stdcall DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo);
|
HRESULT __stdcall DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo);
|
||||||
HRESULT __stdcall DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo);
|
HRESULT __stdcall DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo);
|
||||||
HRESULT __stdcall DeletePatch(UINT Handle);
|
HRESULT __stdcall DeletePatch(UINT Handle);
|
||||||
HRESULT __stdcall CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery);
|
HRESULT __stdcall CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IDirect3DDevice9 *m_pIDirect3DDevice9;
|
IDirect3DDevice9 *m_pIDirect3DDevice9;
|
||||||
};
|
};
|
||||||
|
|
||||||
class D3D9 : public IDirect3D9
|
class D3D9 : public IDirect3D9
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
D3D9(IDirect3D9Ex *pOriginal) : m_pIDirect3D9(pOriginal) {};
|
D3D9(IDirect3D9Ex *pOriginal) : m_pIDirect3D9(pOriginal) {};
|
||||||
virtual ~D3D9(void) {};
|
virtual ~D3D9(void) {};
|
||||||
|
|
||||||
HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj);
|
HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj);
|
||||||
ULONG __stdcall AddRef(void);
|
ULONG __stdcall AddRef(void);
|
||||||
ULONG __stdcall Release(void);
|
ULONG __stdcall Release(void);
|
||||||
HRESULT __stdcall RegisterSoftwareDevice(void* pInitializeFunction);
|
HRESULT __stdcall RegisterSoftwareDevice(void* pInitializeFunction);
|
||||||
UINT __stdcall GetAdapterCount(void);
|
UINT __stdcall GetAdapterCount(void);
|
||||||
HRESULT __stdcall GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier);
|
HRESULT __stdcall GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier);
|
||||||
UINT __stdcall GetAdapterModeCount(UINT Adapter, D3DFORMAT Format);
|
UINT __stdcall GetAdapterModeCount(UINT Adapter, D3DFORMAT Format);
|
||||||
HRESULT __stdcall EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode);
|
HRESULT __stdcall EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode);
|
||||||
HRESULT __stdcall GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode);
|
HRESULT __stdcall GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode);
|
||||||
HRESULT __stdcall CheckDeviceType(UINT iAdapter, D3DDEVTYPE DevType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed);
|
HRESULT __stdcall CheckDeviceType(UINT iAdapter, D3DDEVTYPE DevType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed);
|
||||||
HRESULT __stdcall CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
|
HRESULT __stdcall CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
|
||||||
HRESULT __stdcall CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels);
|
HRESULT __stdcall CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels);
|
||||||
HRESULT __stdcall CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
|
HRESULT __stdcall CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
|
||||||
HRESULT __stdcall CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat);
|
HRESULT __stdcall CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat);
|
||||||
HRESULT __stdcall GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps);
|
HRESULT __stdcall GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps);
|
||||||
HMONITOR __stdcall GetAdapterMonitor(UINT Adapter);
|
HMONITOR __stdcall GetAdapterMonitor(UINT Adapter);
|
||||||
HRESULT __stdcall CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface);
|
HRESULT __stdcall CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IDirect3D9 *m_pIDirect3D9;
|
IDirect3D9 *m_pIDirect3D9;
|
||||||
};
|
};
|
||||||
|
|
||||||
static IDirect3D9* __stdcall Direct3DCreate9Stub(UINT sdk);
|
static IDirect3D9* __stdcall Direct3DCreate9Stub(UINT sdk);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ namespace Components
|
|||||||
~Dedicated();
|
~Dedicated();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Dedicated"; };
|
const char* getName() { return "Dedicated"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool IsEnabled();
|
static bool IsEnabled();
|
||||||
|
@ -7,7 +7,7 @@ namespace Components
|
|||||||
~Discovery();
|
~Discovery();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Discovery"; };
|
const char* getName() { return "Discovery"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void Perform();
|
static void Perform();
|
||||||
|
@ -1,69 +1,69 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Download : public Component
|
class Download : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Download();
|
Download();
|
||||||
~Download();
|
~Download();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Download"; };
|
const char* getName() { return "Download"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void InitiateClientDownload(std::string mod);
|
static void InitiateClientDownload(std::string mod);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class ClientDownload
|
class ClientDownload
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ClientDownload() : valid(false), running(false), terminateThread(false), totalBytes(0), downBytes(0), lastTimeStamp(0), timeStampBytes(0) {}
|
ClientDownload() : valid(false), running(false), terminateThread(false), totalBytes(0), downBytes(0), lastTimeStamp(0), timeStampBytes(0) {}
|
||||||
~ClientDownload() { this->clear(); }
|
~ClientDownload() { this->clear(); }
|
||||||
|
|
||||||
bool running;
|
bool running;
|
||||||
bool valid;
|
bool valid;
|
||||||
bool terminateThread;
|
bool terminateThread;
|
||||||
mg_mgr mgr;
|
mg_mgr mgr;
|
||||||
Network::Address target;
|
Network::Address target;
|
||||||
std::string mod;
|
std::string mod;
|
||||||
std::thread thread;
|
std::thread thread;
|
||||||
|
|
||||||
size_t totalBytes;
|
size_t totalBytes;
|
||||||
size_t downBytes;
|
size_t downBytes;
|
||||||
|
|
||||||
int lastTimeStamp;
|
int lastTimeStamp;
|
||||||
size_t timeStampBytes;
|
size_t timeStampBytes;
|
||||||
|
|
||||||
class File
|
class File
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string hash;
|
std::string hash;
|
||||||
size_t size;
|
size_t size;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<File> files;
|
std::vector<File> files;
|
||||||
|
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
this->terminateThread = true;
|
this->terminateThread = true;
|
||||||
|
|
||||||
if (this->thread.joinable())
|
if (this->thread.joinable())
|
||||||
{
|
{
|
||||||
this->thread.join();
|
this->thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
this->running = false;
|
this->running = false;
|
||||||
this->mod.clear();
|
this->mod.clear();
|
||||||
this->files.clear();
|
this->files.clear();
|
||||||
|
|
||||||
if (this->valid)
|
if (this->valid)
|
||||||
{
|
{
|
||||||
this->valid = false;
|
this->valid = false;
|
||||||
mg_mgr_free(&(this->mgr));
|
mg_mgr_free(&(this->mgr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileDownload
|
class FileDownload
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -75,23 +75,23 @@ namespace Components
|
|||||||
unsigned int index;
|
unsigned int index;
|
||||||
std::string buffer;
|
std::string buffer;
|
||||||
size_t receivedBytes;
|
size_t receivedBytes;
|
||||||
};
|
};
|
||||||
|
|
||||||
static mg_mgr Mgr;
|
static mg_mgr Mgr;
|
||||||
static ClientDownload CLDownload;
|
static ClientDownload CLDownload;
|
||||||
|
|
||||||
static void EventHandler(mg_connection *nc, int ev, void *ev_data);
|
static void EventHandler(mg_connection *nc, int ev, void *ev_data);
|
||||||
static void ListHandler(mg_connection *nc, int ev, void *ev_data);
|
static void ListHandler(mg_connection *nc, int ev, void *ev_data);
|
||||||
static void FileHandler(mg_connection *nc, int ev, void *ev_data);
|
static void FileHandler(mg_connection *nc, int ev, void *ev_data);
|
||||||
static void InfoHandler(mg_connection *nc, int ev, void *ev_data);
|
static void InfoHandler(mg_connection *nc, int ev, void *ev_data);
|
||||||
static void DownloadHandler(mg_connection *nc, int ev, void *ev_data);
|
static void DownloadHandler(mg_connection *nc, int ev, void *ev_data);
|
||||||
|
|
||||||
static bool IsClient(mg_connection *nc);
|
static bool IsClient(mg_connection *nc);
|
||||||
static Game::client_t* GetClient(mg_connection *nc);
|
static Game::client_t* GetClient(mg_connection *nc);
|
||||||
static void Forbid(mg_connection *nc);
|
static void Forbid(mg_connection *nc);
|
||||||
|
|
||||||
static void ModDownloader(ClientDownload* download);
|
static void ModDownloader(ClientDownload* download);
|
||||||
static bool ParseModList(ClientDownload* download, std::string list);
|
static bool ParseModList(ClientDownload* download, std::string list);
|
||||||
static bool DownloadFile(ClientDownload* download, unsigned int index);
|
static bool DownloadFile(ClientDownload* download, unsigned int index);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,59 +1,59 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Dvar : public Component
|
class Dvar : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef void(Callback)();
|
typedef void(Callback)();
|
||||||
|
|
||||||
class Flag
|
class Flag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Flag(Game::dvar_flag flag) : val(flag){};
|
Flag(Game::dvar_flag flag) : val(flag){};
|
||||||
Flag(int flag) : Flag(static_cast<Game::dvar_flag>(flag)) {};
|
Flag(int flag) : Flag(static_cast<Game::dvar_flag>(flag)) {};
|
||||||
|
|
||||||
Game::dvar_flag val;
|
Game::dvar_flag val;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Var
|
class Var
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Var() : dvar(0) {};
|
Var() : dvar(0) {};
|
||||||
Var(const Var &obj) { this->dvar = obj.dvar; };
|
Var(const Var &obj) { this->dvar = obj.dvar; };
|
||||||
Var(Game::dvar_t* _dvar) : dvar(_dvar) {};
|
Var(Game::dvar_t* _dvar) : dvar(_dvar) {};
|
||||||
Var(std::string dvarName);
|
Var(std::string dvarName);
|
||||||
|
|
||||||
template<typename T> T get();
|
template<typename T> T get();
|
||||||
|
|
||||||
void set(char* string);
|
void set(char* string);
|
||||||
void set(const char* string);
|
void set(const char* string);
|
||||||
void set(std::string string);
|
void set(std::string string);
|
||||||
|
|
||||||
void set(int integer);
|
void set(int integer);
|
||||||
void set(float value);
|
void set(float value);
|
||||||
|
|
||||||
// TODO: Add others
|
// TODO: Add others
|
||||||
void setRaw(int integer);
|
void setRaw(int integer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Game::dvar_t* dvar;
|
Game::dvar_t* dvar;
|
||||||
};
|
};
|
||||||
|
|
||||||
Dvar();
|
Dvar();
|
||||||
~Dvar();
|
~Dvar();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Dvar"; };
|
const char* getName() { return "Dvar"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void OnInit(Callback* callback);
|
static void OnInit(Callback* callback);
|
||||||
|
|
||||||
// Only strings and bools use this type of declaration
|
// Only strings and bools use this type of declaration
|
||||||
template<typename T> static Var Register(const char* name, T value, Flag flag, const char* description);
|
template<typename T> static Var Register(const char* name, T value, Flag flag, const char* description);
|
||||||
template<typename T> static Var Register(const char* name, T value, T min, T max, Flag flag, const char* description);
|
template<typename T> static Var Register(const char* name, T value, T min, T max, Flag flag, const char* description);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static wink::signal<wink::slot<Callback>> RegistrationSignal;
|
static wink::signal<wink::slot<Callback>> RegistrationSignal;
|
||||||
|
|
||||||
static Game::dvar_t* RegisterName(const char* name, const char* default, Game::dvar_flag flag, const char* description);
|
static Game::dvar_t* RegisterName(const char* name, const char* default, Game::dvar_flag flag, const char* description);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class FastFiles : public Component
|
class FastFiles : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FastFiles();
|
FastFiles();
|
||||||
~FastFiles();
|
~FastFiles();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "FastFiles"; };
|
const char* getName() { return "FastFiles"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void AddZonePath(std::string path);
|
static void AddZonePath(std::string path);
|
||||||
static std::string Current();
|
static std::string Current();
|
||||||
static bool Ready();
|
static bool Ready();
|
||||||
static bool Exists(std::string file);
|
static bool Exists(std::string file);
|
||||||
|
|
||||||
static void LoadLocalizeZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
static void LoadLocalizeZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
||||||
|
|
||||||
static unsigned char ZoneKey[1191];
|
static unsigned char ZoneKey[1191];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
union Key
|
union Key
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned char key[24];
|
unsigned char key[24];
|
||||||
unsigned char iv[16];
|
unsigned char iv[16];
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned char data[1];
|
unsigned char data[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
static Key CurrentKey;
|
static Key CurrentKey;
|
||||||
static symmetric_CTR CurrentCTR;
|
static symmetric_CTR CurrentCTR;
|
||||||
static std::vector<std::string> ZonePaths;
|
static std::vector<std::string> ZonePaths;
|
||||||
static const char* GetZoneLocation(const char* file);
|
static const char* GetZoneLocation(const char* file);
|
||||||
static void LoadInitialZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
static void LoadInitialZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
||||||
static void LoadDLCUIZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
static void LoadDLCUIZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
||||||
static void LoadGfxZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
static void LoadGfxZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
||||||
|
|
||||||
static void ReadVersionStub(unsigned int* version, int size);
|
static void ReadVersionStub(unsigned int* version, int size);
|
||||||
|
|
||||||
static void AuthLoadInitCrypto();
|
static void AuthLoadInitCrypto();
|
||||||
static int AuthLoadInflateCompare(unsigned char* buffer, int length, unsigned char* ivValue);
|
static int AuthLoadInflateCompare(unsigned char* buffer, int length, unsigned char* ivValue);
|
||||||
static void AuthLoadInflateDecryptBase();
|
static void AuthLoadInflateDecryptBase();
|
||||||
static void AuthLoadInflateDecryptBaseFunc(unsigned char* buffer);
|
static void AuthLoadInflateDecryptBaseFunc(unsigned char* buffer);
|
||||||
static int InflateInitDecrypt(z_streamp strm, const char *version, int stream_size);
|
static int InflateInitDecrypt(z_streamp strm, const char *version, int stream_size);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -20,11 +20,11 @@ namespace Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FileSystem::FileReader::FileReader(std::string file) : name(file), handle(0)
|
FileSystem::FileReader::FileReader(std::string file) : name(file), handle(0)
|
||||||
{
|
{
|
||||||
this->size = Game::FS_FOpenFileReadCurrentThread(this->name.data(), &this->handle);
|
this->size = Game::FS_FOpenFileReadCurrentThread(this->name.data(), &this->handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystem::FileReader::~FileReader()
|
FileSystem::FileReader::~FileReader()
|
||||||
{
|
{
|
||||||
if (this->exists() && this->handle)
|
if (this->exists() && this->handle)
|
||||||
@ -161,33 +161,33 @@ namespace Components
|
|||||||
Game::FS_Remove(path);
|
Game::FS_Remove(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
int FileSystem::ReadFile(const char* path, char** buffer)
|
int FileSystem::ReadFile(const char* path, char** buffer)
|
||||||
{
|
{
|
||||||
if (!buffer) return -1;
|
if (!buffer) return -1;
|
||||||
else *buffer = nullptr;
|
else *buffer = nullptr;
|
||||||
if (!path) return -1;
|
if (!path) return -1;
|
||||||
|
|
||||||
std::lock_guard<std::mutex> _(FileSystem::Mutex);
|
std::lock_guard<std::mutex> _(FileSystem::Mutex);
|
||||||
FileSystem::FileReader reader(path);
|
FileSystem::FileReader reader(path);
|
||||||
|
|
||||||
int size = reader.getSize();
|
int size = reader.getSize();
|
||||||
if (reader.exists() && size >= 0)
|
if (reader.exists() && size >= 0)
|
||||||
{
|
{
|
||||||
*buffer = FileSystem::AllocateFile(size + 1);
|
*buffer = FileSystem::AllocateFile(size + 1);
|
||||||
if (reader.read(*buffer, size)) return size;
|
if (reader.read(*buffer, size)) return size;
|
||||||
|
|
||||||
FileSystem::FreeFile(*buffer);
|
FileSystem::FreeFile(*buffer);
|
||||||
*buffer = nullptr;
|
*buffer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* FileSystem::AllocateFile(int size)
|
char* FileSystem::AllocateFile(int size)
|
||||||
{
|
{
|
||||||
return FileSystem::MemAllocator.allocateArray<char>(size);
|
return FileSystem::MemAllocator.allocateArray<char>(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileSystem::FreeFile(void* buffer)
|
void FileSystem::FreeFile(void* buffer)
|
||||||
{
|
{
|
||||||
FileSystem::MemAllocator.free(buffer);
|
FileSystem::MemAllocator.free(buffer);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class FileSystem : public Component
|
class FileSystem : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
class File
|
class File
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -19,67 +19,67 @@ namespace Components
|
|||||||
std::string buffer;
|
std::string buffer;
|
||||||
|
|
||||||
void read();
|
void read();
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileReader
|
class FileReader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FileReader() : size(-1), name(), handle(0) {};
|
FileReader() : size(-1), name(), handle(0) {};
|
||||||
FileReader(std::string file);
|
FileReader(std::string file);
|
||||||
~FileReader();
|
~FileReader();
|
||||||
|
|
||||||
bool exists();
|
bool exists();
|
||||||
std::string getName();
|
std::string getName();
|
||||||
std::string getBuffer();
|
std::string getBuffer();
|
||||||
int getSize();
|
int getSize();
|
||||||
bool read(void* buffer, size_t size);
|
bool read(void* buffer, size_t size);
|
||||||
void seek(int offset, int origin);
|
void seek(int offset, int origin);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int handle;
|
int handle;
|
||||||
int size;
|
int size;
|
||||||
std::string name;
|
std::string name;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileWriter
|
class FileWriter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FileWriter(std::string file) : filePath(file), handle(0) { this->open(); };
|
FileWriter(std::string file) : filePath(file), handle(0) { this->open(); };
|
||||||
~FileWriter() { this->close(); };
|
~FileWriter() { this->close(); };
|
||||||
|
|
||||||
void write(std::string data);
|
void write(std::string data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int handle;
|
int handle;
|
||||||
std::string filePath;
|
std::string filePath;
|
||||||
|
|
||||||
void open();
|
void open();
|
||||||
void close();
|
void close();
|
||||||
};
|
};
|
||||||
|
|
||||||
FileSystem();
|
FileSystem();
|
||||||
~FileSystem();
|
~FileSystem();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "FileSystem"; };
|
const char* getName() { return "FileSystem"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static std::vector<std::string> GetFileList(std::string path, std::string extension);
|
static std::vector<std::string> GetFileList(std::string path, std::string extension);
|
||||||
static std::vector<std::string> GetSysFileList(std::string path, std::string extension, bool folders = false);
|
static std::vector<std::string> GetSysFileList(std::string path, std::string extension, bool folders = false);
|
||||||
static void DeleteFile(std::string folder, std::string file);
|
static void DeleteFile(std::string folder, std::string file);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::mutex Mutex;
|
static std::mutex Mutex;
|
||||||
static Utils::Memory::Allocator MemAllocator;
|
static Utils::Memory::Allocator MemAllocator;
|
||||||
|
|
||||||
static int ReadFile(const char* path, char** buffer);
|
static int ReadFile(const char* path, char** buffer);
|
||||||
static char* AllocateFile(int size);
|
static char* AllocateFile(int size);
|
||||||
static void FreeFile(void* buffer);
|
static void FreeFile(void* buffer);
|
||||||
|
|
||||||
static void RegisterFolder(const char* folder);
|
static void RegisterFolder(const char* folder);
|
||||||
|
|
||||||
static void RegisterFolders();
|
static void RegisterFolders();
|
||||||
static void StartupStub();
|
static void StartupStub();
|
||||||
static int ExecIsFSStub(const char* execFilename);
|
static int ExecIsFSStub(const char* execFilename);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Flags : public Component
|
class Flags : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Flags();
|
Flags();
|
||||||
~Flags();
|
~Flags();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Flags"; };
|
const char* getName() { return "Flags"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool HasFlag(std::string flag);
|
static bool HasFlag(std::string flag);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::vector<std::string> EnabledFlags;
|
static std::vector<std::string> EnabledFlags;
|
||||||
|
|
||||||
static void ParseFlags();
|
static void ParseFlags();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Gametypes : public Component
|
class Gametypes : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Gametypes();
|
Gametypes();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Gametypes"; };
|
const char* getName() { return "Gametypes"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static unsigned int GetGametypeCount();
|
static unsigned int GetGametypeCount();
|
||||||
static const char* GetGametypeText(unsigned int index, int column);
|
static const char* GetGametypeText(unsigned int index, int column);
|
||||||
static void SelectGametype(unsigned int index);
|
static void SelectGametype(unsigned int index);
|
||||||
|
|
||||||
static void* BuildGametypeList(const char* file, void* buffer, size_t size);
|
static void* BuildGametypeList(const char* file, void* buffer, size_t size);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,78 +1,78 @@
|
|||||||
#define IPC_MAX_RECONNECTS 3
|
#define IPC_MAX_RECONNECTS 3
|
||||||
#define IPC_COMMAND_SIZE 100
|
#define IPC_COMMAND_SIZE 100
|
||||||
#define IPC_BUFFER_SIZE 0x2000
|
#define IPC_BUFFER_SIZE 0x2000
|
||||||
|
|
||||||
#define IPC_PIPE_NAME_SERVER "IW4x-Server"
|
#define IPC_PIPE_NAME_SERVER "IW4x-Server"
|
||||||
#define IPC_PIPE_NAME_CLIENT "IW4x-Client"
|
#define IPC_PIPE_NAME_CLIENT "IW4x-Client"
|
||||||
|
|
||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Pipe
|
class Pipe
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct Packet
|
struct Packet
|
||||||
{
|
{
|
||||||
char command[IPC_COMMAND_SIZE];
|
char command[IPC_COMMAND_SIZE];
|
||||||
char buffer[IPC_BUFFER_SIZE];
|
char buffer[IPC_BUFFER_SIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Type
|
enum Type
|
||||||
{
|
{
|
||||||
IPCTYPE_NONE,
|
IPCTYPE_NONE,
|
||||||
IPCTYPE_SERVER,
|
IPCTYPE_SERVER,
|
||||||
IPCTYPE_CLIENT
|
IPCTYPE_CLIENT
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void(__cdecl* PacketCallback)(std::string data);
|
typedef void(__cdecl* PacketCallback)(std::string data);
|
||||||
typedef void(__cdecl* Callback)();
|
typedef void(__cdecl* Callback)();
|
||||||
|
|
||||||
Pipe();
|
Pipe();
|
||||||
~Pipe();
|
~Pipe();
|
||||||
|
|
||||||
bool connect(std::string name);
|
bool connect(std::string name);
|
||||||
bool create(std::string name);
|
bool create(std::string name);
|
||||||
|
|
||||||
bool write(std::string command, std::string data);
|
bool write(std::string command, std::string data);
|
||||||
void setCallback(std::string command, PacketCallback callback);
|
void setCallback(std::string command, PacketCallback callback);
|
||||||
void onConnect(Callback callback);
|
void onConnect(Callback callback);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wink::slot<void()> connectCallback;
|
wink::slot<void()> connectCallback;
|
||||||
std::map<std::string, PacketCallback> packetCallbacks;
|
std::map<std::string, PacketCallback> packetCallbacks;
|
||||||
|
|
||||||
HANDLE pipe;
|
HANDLE pipe;
|
||||||
std::thread thread;
|
std::thread thread;
|
||||||
bool threadAttached;
|
bool threadAttached;
|
||||||
|
|
||||||
Type type;
|
Type type;
|
||||||
Packet packet;
|
Packet packet;
|
||||||
|
|
||||||
char pipeName[MAX_PATH];
|
char pipeName[MAX_PATH];
|
||||||
char pipeFile[MAX_PATH];
|
char pipeFile[MAX_PATH];
|
||||||
unsigned int reconnectAttempt;
|
unsigned int reconnectAttempt;
|
||||||
|
|
||||||
void destroy();
|
void destroy();
|
||||||
void setName(std::string name);
|
void setName(std::string name);
|
||||||
|
|
||||||
static void ReceiveThread(Pipe* pipe);
|
static void ReceiveThread(Pipe* pipe);
|
||||||
};
|
};
|
||||||
|
|
||||||
class IPCPipe : public Component
|
class IPCPipe : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IPCPipe();
|
IPCPipe();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "IPCPipe"; };
|
const char* getName() { return "IPCPipe"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool Write(std::string command, std::string data);
|
static bool Write(std::string command, std::string data);
|
||||||
static void On(std::string command, Pipe::PacketCallback callback);
|
static void On(std::string command, Pipe::PacketCallback callback);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Pipe ServerPipe;
|
static Pipe ServerPipe;
|
||||||
static Pipe ClientPipe;
|
static Pipe ClientPipe;
|
||||||
|
|
||||||
static void ConnectClient();
|
static void ConnectClient();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ namespace Components
|
|||||||
Lean();
|
Lean();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Lean"; };
|
const char* getName() { return "Lean"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1,44 +1,44 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Logger : public Component
|
class Logger : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Logger();
|
Logger();
|
||||||
~Logger();
|
~Logger();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Logger"; };
|
const char* getName() { return "Logger"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void MessagePrint(int channel, std::string message);
|
static void MessagePrint(int channel, std::string message);
|
||||||
static void Print(int channel, const char* message, ...);
|
static void Print(int channel, const char* message, ...);
|
||||||
static void Print(const char* message, ...);
|
static void Print(const char* message, ...);
|
||||||
static void ErrorPrint(int error, std::string message);
|
static void ErrorPrint(int error, std::string message);
|
||||||
static void Error(const char* message, ...);
|
static void Error(const char* message, ...);
|
||||||
static void Error(int error, const char* message, ...);
|
static void Error(int error, const char* message, ...);
|
||||||
static void SoftError(const char* message, ...);
|
static void SoftError(const char* message, ...);
|
||||||
static bool IsConsoleReady();
|
static bool IsConsoleReady();
|
||||||
|
|
||||||
static void PrintStub(int channel, const char* message, ...);
|
static void PrintStub(int channel, const char* message, ...);
|
||||||
|
|
||||||
static void PipeOutput(void(*callback)(std::string));
|
static void PipeOutput(void(*callback)(std::string));
|
||||||
|
|
||||||
static void Flush();
|
static void Flush();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::mutex MessageMutex;
|
static std::mutex MessageMutex;
|
||||||
static std::vector<std::string> MessageQueue;
|
static std::vector<std::string> MessageQueue;
|
||||||
static std::vector<Network::Address> LoggingAddresses[2];
|
static std::vector<Network::Address> LoggingAddresses[2];
|
||||||
static void(*PipeCallback)(std::string);
|
static void(*PipeCallback)(std::string);
|
||||||
|
|
||||||
static void Frame();
|
static void Frame();
|
||||||
static void GameLogStub();
|
static void GameLogStub();
|
||||||
static void PrintMessageStub();
|
static void PrintMessageStub();
|
||||||
static void PrintMessagePipe(const char* data);
|
static void PrintMessagePipe(const char* data);
|
||||||
static void EnqueueMessage(std::string message);
|
static void EnqueueMessage(std::string message);
|
||||||
|
|
||||||
static void NetworkLog(const char* data, bool gLog);
|
static void NetworkLog(const char* data, bool gLog);
|
||||||
|
|
||||||
static std::string Format(const char** message);
|
static std::string Format(const char** message);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -107,22 +107,22 @@ namespace Components
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == Game::XAssetType::ASSET_TYPE_WEAPON)
|
if (type == Game::XAssetType::ASSET_TYPE_WEAPON)
|
||||||
{
|
{
|
||||||
if ((!strstr(name.data(), "_mp") && name != "none" && name != "destructible_car") || Zones::Version() >= VERSION_ALPHA2)
|
if ((!strstr(name.data(), "_mp") && name != "none" && name != "destructible_car") || Zones::Version() >= VERSION_ALPHA2)
|
||||||
{
|
{
|
||||||
*restrict = true;
|
*restrict = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == Game::XAssetType::ASSET_TYPE_STRINGTABLE)
|
if (type == Game::XAssetType::ASSET_TYPE_STRINGTABLE)
|
||||||
{
|
{
|
||||||
if (FastFiles::Current() == "mp_cross_fire")
|
if (FastFiles::Current() == "mp_cross_fire")
|
||||||
{
|
{
|
||||||
*restrict = true;
|
*restrict = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == Game::XAssetType::ASSET_TYPE_MAP_ENTS)
|
if (type == Game::XAssetType::ASSET_TYPE_MAP_ENTS)
|
||||||
@ -154,16 +154,16 @@ namespace Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Game::GameMap_Data* Maps::GetWorldData()
|
Game::GameMap_Data* Maps::GetWorldData()
|
||||||
{
|
{
|
||||||
if (!Utils::String::StartsWith(Maps::CurrentMainZone, "mp_") || Maps::IsSPMap)
|
if (!Utils::String::StartsWith(Maps::CurrentMainZone, "mp_") || Maps::IsSPMap)
|
||||||
{
|
{
|
||||||
return Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAME_MAP_SP].gameMapSP[0].data;
|
return Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAME_MAP_SP].gameMapSP[0].data;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAME_MAP_MP].gameMapMP[0].data;
|
return Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAME_MAP_MP].gameMapMP[0].data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__declspec(naked) void Maps::GetWorldDataStub()
|
__declspec(naked) void Maps::GetWorldDataStub()
|
||||||
|
@ -1,57 +1,57 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Maps : public Component
|
class Maps : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Maps();
|
Maps();
|
||||||
~Maps();
|
~Maps();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Maps"; };
|
const char* getName() { return "Maps"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void HandleAsSPMap();
|
static void HandleAsSPMap();
|
||||||
static void AddDependency(std::string expression, std::string zone);
|
static void AddDependency(std::string expression, std::string zone);
|
||||||
|
|
||||||
static std::pair<std::string, std::string> GetTeamsForMap(std::string map);
|
static std::pair<std::string, std::string> GetTeamsForMap(std::string map);
|
||||||
static std::vector<std::string> GetDependenciesForMap(std::string map);
|
static std::vector<std::string> GetDependenciesForMap(std::string map);
|
||||||
|
|
||||||
static std::string CurrentMainZone;
|
static std::string CurrentMainZone;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class DLC
|
class DLC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int index;
|
int index;
|
||||||
std::string url;
|
std::string url;
|
||||||
std::vector<std::string> maps;
|
std::vector<std::string> maps;
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool IsSPMap;
|
static bool IsSPMap;
|
||||||
static std::vector<DLC> DlcPacks;
|
static std::vector<DLC> DlcPacks;
|
||||||
static std::vector<Game::XAssetEntry> EntryPool;
|
static std::vector<Game::XAssetEntry> EntryPool;
|
||||||
|
|
||||||
static std::vector<std::pair<std::string, std::string>> DependencyList;
|
static std::vector<std::pair<std::string, std::string>> DependencyList;
|
||||||
static std::vector<std::string> CurrentDependencies;
|
static std::vector<std::string> CurrentDependencies;
|
||||||
|
|
||||||
static void GetBSPName(char* buffer, size_t size, const char* format, const char* mapname);
|
static void GetBSPName(char* buffer, size_t size, const char* format, const char* mapname);
|
||||||
static void LoadAssetRestrict(Game::XAssetType type, Game::XAssetHeader asset, std::string name, bool* restrict);
|
static void LoadAssetRestrict(Game::XAssetType type, Game::XAssetHeader asset, std::string name, bool* restrict);
|
||||||
static void LoadMapZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
static void LoadMapZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
|
||||||
|
|
||||||
static void OverrideMapEnts(Game::MapEnts* ents);
|
static void OverrideMapEnts(Game::MapEnts* ents);
|
||||||
|
|
||||||
static int IgnoreEntityStub(const char* entity);
|
static int IgnoreEntityStub(const char* entity);
|
||||||
|
|
||||||
static Game::GameMap_Data* GetWorldData();
|
static Game::GameMap_Data* GetWorldData();
|
||||||
static void GetWorldDataStub();
|
static void GetWorldDataStub();
|
||||||
|
|
||||||
static void AddDlc(DLC dlc);
|
static void AddDlc(DLC dlc);
|
||||||
static void UpdateDlcStatus();
|
static void UpdateDlcStatus();
|
||||||
|
|
||||||
#if defined(DEBUG) && defined(ENABLE_DXSDK)
|
#if defined(DEBUG) && defined(ENABLE_DXSDK)
|
||||||
static void ExportMap(Game::GfxWorld* world);
|
static void ExportMap(Game::GfxWorld* world);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void reallocateEntryPool();
|
void reallocateEntryPool();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,31 +1,31 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Materials : public Component
|
class Materials : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Materials();
|
Materials();
|
||||||
~Materials();
|
~Materials();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Materials"; };
|
const char* getName() { return "Materials"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static int ImageNameLength;
|
static int ImageNameLength;
|
||||||
|
|
||||||
static Utils::Hook ImageVersionCheckHook;
|
static Utils::Hook ImageVersionCheckHook;
|
||||||
static void ImageVersionCheck();
|
static void ImageVersionCheck();
|
||||||
|
|
||||||
static Game::Material* ResolveMaterial(const char* stringPtr);
|
static Game::Material* ResolveMaterial(const char* stringPtr);
|
||||||
static void DrawMaterialStub();
|
static void DrawMaterialStub();
|
||||||
static void PostDrawMaterialStub();
|
static void PostDrawMaterialStub();
|
||||||
|
|
||||||
static int WriteDeathMessageIcon(char* string, int offset, Game::Material* material);
|
static int WriteDeathMessageIcon(char* string, int offset, Game::Material* material);
|
||||||
static void DeathMessageStub();
|
static void DeathMessageStub();
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
static void DumpImageCfg(int, const char*, const char* material);
|
static void DumpImageCfg(int, const char*, const char* material);
|
||||||
static void DumpImageCfgPath(int, const char*, const char* material);
|
static void DumpImageCfgPath(int, const char*, const char* material);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,60 +1,60 @@
|
|||||||
#define MAX_SOURCEFILES 64
|
#define MAX_SOURCEFILES 64
|
||||||
#undef LoadMenu
|
#undef LoadMenu
|
||||||
|
|
||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Menus : public Component
|
class Menus : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Menus();
|
Menus();
|
||||||
~Menus();
|
~Menus();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Menus"; };
|
const char* getName() { return "Menus"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void FreeEverything();
|
static void FreeEverything();
|
||||||
|
|
||||||
static void Add(std::string menu);
|
static void Add(std::string menu);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::map<std::string, Game::menuDef_t*> MenuList;
|
static std::map<std::string, Game::menuDef_t*> MenuList;
|
||||||
static std::map<std::string, Game::MenuList*> MenuListList;
|
static std::map<std::string, Game::MenuList*> MenuListList;
|
||||||
static std::vector<std::string> CustomMenus;
|
static std::vector<std::string> CustomMenus;
|
||||||
|
|
||||||
static Game::XAssetHeader MenuLoad(Game::XAssetType type, std::string filename);
|
static Game::XAssetHeader MenuLoad(Game::XAssetType type, std::string filename);
|
||||||
static Game::XAssetHeader MenuFileLoad(Game::XAssetType type, std::string filename);
|
static Game::XAssetHeader MenuFileLoad(Game::XAssetType type, std::string filename);
|
||||||
|
|
||||||
static Game::MenuList* LoadMenuList(Game::MenuList* menuList);
|
static Game::MenuList* LoadMenuList(Game::MenuList* menuList);
|
||||||
static Game::MenuList* LoadScriptMenu(const char* menu);
|
static Game::MenuList* LoadScriptMenu(const char* menu);
|
||||||
static std::vector<Game::menuDef_t*> LoadMenu(Game::menuDef_t* menudef);
|
static std::vector<Game::menuDef_t*> LoadMenu(Game::menuDef_t* menudef);
|
||||||
static std::vector<Game::menuDef_t*> LoadMenu(std::string file);
|
static std::vector<Game::menuDef_t*> LoadMenu(std::string file);
|
||||||
|
|
||||||
static Game::script_t* LoadMenuScript(std::string name, std::string buffer);
|
static Game::script_t* LoadMenuScript(std::string name, std::string buffer);
|
||||||
static int LoadMenuSource(std::string name, std::string buffer);
|
static int LoadMenuSource(std::string name, std::string buffer);
|
||||||
|
|
||||||
static int ReserveSourceHandle();
|
static int ReserveSourceHandle();
|
||||||
static bool IsValidSourceHandle(int handle);
|
static bool IsValidSourceHandle(int handle);
|
||||||
|
|
||||||
static Game::menuDef_t* ParseMenu(int handle);
|
static Game::menuDef_t* ParseMenu(int handle);
|
||||||
|
|
||||||
static void FreeMenuSource(int handle);
|
static void FreeMenuSource(int handle);
|
||||||
|
|
||||||
static void FreeMenuList(Game::MenuList* menuList);
|
static void FreeMenuList(Game::MenuList* menuList);
|
||||||
static void FreeMenu(Game::menuDef_t* menudef);
|
static void FreeMenu(Game::menuDef_t* menudef);
|
||||||
|
|
||||||
static void RemoveMenu(std::string menu);
|
static void RemoveMenu(std::string menu);
|
||||||
static void RemoveMenu(Game::menuDef_t* menudef);
|
static void RemoveMenu(Game::menuDef_t* menudef);
|
||||||
static void RemoveMenuList(std::string menuList);
|
static void RemoveMenuList(std::string menuList);
|
||||||
static void RemoveMenuList(Game::MenuList* menuList);
|
static void RemoveMenuList(Game::MenuList* menuList);
|
||||||
|
|
||||||
static void OverrideMenu(Game::menuDef_t *menu);
|
static void OverrideMenu(Game::menuDef_t *menu);
|
||||||
|
|
||||||
static bool IsMenuVisible(Game::UiContext *dc, Game::menuDef_t *menu);
|
static bool IsMenuVisible(Game::UiContext *dc, Game::menuDef_t *menu);
|
||||||
|
|
||||||
static void RemoveMenuFromContext(Game::UiContext *dc, Game::menuDef_t *menu);
|
static void RemoveMenuFromContext(Game::UiContext *dc, Game::menuDef_t *menu);
|
||||||
|
|
||||||
// Ugly!
|
// Ugly!
|
||||||
static int KeywordHash(char* key);
|
static int KeywordHash(char* key);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ namespace Components
|
|||||||
~ModList();
|
~ModList();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "ModList"; };
|
const char* getName() { return "ModList"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void RunMod(std::string mod);
|
static void RunMod(std::string mod);
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class MusicalTalent : public Component
|
class MusicalTalent : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MusicalTalent();
|
MusicalTalent();
|
||||||
~MusicalTalent();
|
~MusicalTalent();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "MusicalTalent"; };
|
const char* getName() { return "MusicalTalent"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void Replace(std::string sound, const char* file);
|
static void Replace(std::string sound, const char* file);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::map<std::string, const char*> SoundAliasList;
|
static std::map<std::string, const char*> SoundAliasList;
|
||||||
static Game::XAssetHeader ModifyAliases(Game::XAssetType type, std::string filename);
|
static Game::XAssetHeader ModifyAliases(Game::XAssetType type, std::string filename);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ namespace Components
|
|||||||
~Network();
|
~Network();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Network"; };
|
const char* getName() { return "Network"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void Handle(std::string packet, Callback* callback);
|
static void Handle(std::string packet, Callback* callback);
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class News : public Component
|
class News : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
News();
|
News();
|
||||||
~News();
|
~News();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "News"; };
|
const char* getName() { return "News"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool unitTest();
|
bool unitTest();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::thread Thread;
|
static std::thread Thread;
|
||||||
static bool Terminate;
|
static bool Terminate;
|
||||||
|
|
||||||
static void CheckForUpdate();
|
static void CheckForUpdate();
|
||||||
static void ExitProcessStub(unsigned int exitCode);
|
static void ExitProcessStub(unsigned int exitCode);
|
||||||
|
|
||||||
static const char* GetNewsText();
|
static const char* GetNewsText();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ namespace Components
|
|||||||
~Node();
|
~Node();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Node"; };
|
const char* getName() { return "Node"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool unitTest();
|
bool unitTest();
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Party : public Component
|
class Party : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Party();
|
Party();
|
||||||
~Party();
|
~Party();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Party"; };
|
const char* getName() { return "Party"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Network::Address Target();
|
static Network::Address Target();
|
||||||
static void Connect(Network::Address target);
|
static void Connect(Network::Address target);
|
||||||
static const char* GetLobbyInfo(SteamID lobby, std::string key);
|
static const char* GetLobbyInfo(SteamID lobby, std::string key);
|
||||||
static void RemoveLobby(SteamID lobby);
|
static void RemoveLobby(SteamID lobby);
|
||||||
|
|
||||||
static bool PlaylistAwaiting();
|
static bool PlaylistAwaiting();
|
||||||
static void PlaylistContinue();
|
static void PlaylistContinue();
|
||||||
static void PlaylistError(std::string error);
|
static void PlaylistError(std::string error);
|
||||||
|
|
||||||
static void ConnectError(std::string message);
|
static void ConnectError(std::string message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class JoinContainer
|
class JoinContainer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Network::Address target;
|
Network::Address target;
|
||||||
std::string challenge;
|
std::string challenge;
|
||||||
DWORD joinTime;
|
DWORD joinTime;
|
||||||
bool valid;
|
bool valid;
|
||||||
int matchType;
|
int matchType;
|
||||||
|
|
||||||
Utils::InfoString info;
|
Utils::InfoString info;
|
||||||
|
|
||||||
// Party-specific stuff
|
// Party-specific stuff
|
||||||
DWORD requestTime;
|
DWORD requestTime;
|
||||||
bool awaitingPlaylist;
|
bool awaitingPlaylist;
|
||||||
};
|
};
|
||||||
|
|
||||||
static JoinContainer Container;
|
static JoinContainer Container;
|
||||||
static std::map<uint64_t, Network::Address> LobbyMap;
|
static std::map<uint64_t, Network::Address> LobbyMap;
|
||||||
|
|
||||||
static SteamID GenerateLobbyId();
|
static SteamID GenerateLobbyId();
|
||||||
|
|
||||||
static Game::dvar_t* RegisterMinPlayers(const char* name, int value, int min, int max, Game::dvar_flag flag, const char* description);
|
static Game::dvar_t* RegisterMinPlayers(const char* name, int value, int min, int max, Game::dvar_flag flag, const char* description);
|
||||||
|
|
||||||
static DWORD UIDvarIntStub(char* dvar);
|
static DWORD UIDvarIntStub(char* dvar);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class PlayerName : public Component
|
class PlayerName : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PlayerName();
|
PlayerName();
|
||||||
~PlayerName();
|
~PlayerName();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "PlayerName"; };
|
const char* getName() { return "PlayerName"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::string PlayerNames[18];
|
static std::string PlayerNames[18];
|
||||||
|
|
||||||
static int GetClientName(int localClientNum, int index, char *buf, int size);
|
static int GetClientName(int localClientNum, int index, char *buf, int size);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Playlist : public Component
|
class Playlist : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef void(*Callback)();
|
typedef void(*Callback)();
|
||||||
|
|
||||||
Playlist();
|
Playlist();
|
||||||
~Playlist();
|
~Playlist();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Playlist"; };
|
const char* getName() { return "Playlist"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void LoadPlaylist();
|
static void LoadPlaylist();
|
||||||
|
|
||||||
static std::string ReceivedPlaylistBuffer;
|
static std::string ReceivedPlaylistBuffer;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::string CurrentPlaylistBuffer;
|
static std::string CurrentPlaylistBuffer;
|
||||||
static std::map<const void*, std::string> MapRelocation;
|
static std::map<const void*, std::string> MapRelocation;
|
||||||
|
|
||||||
static DWORD StorePlaylistStub(const char** buffer);
|
static DWORD StorePlaylistStub(const char** buffer);
|
||||||
|
|
||||||
static void PlaylistRequest(Network::Address address, std::string data);
|
static void PlaylistRequest(Network::Address address, std::string data);
|
||||||
static void PlaylistReponse(Network::Address address, std::string data);
|
static void PlaylistReponse(Network::Address address, std::string data);
|
||||||
|
|
||||||
static void MapNameCopy(char *dest, const char *src, int destsize);
|
static void MapNameCopy(char *dest, const char *src, int destsize);
|
||||||
static void SetMapName(const char* cvar, const char* value);
|
static void SetMapName(const char* cvar, const char* value);
|
||||||
static int GetMapIndex(const char* mapname);
|
static int GetMapIndex(const char* mapname);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ namespace Components
|
|||||||
~QuickPatch();
|
~QuickPatch();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "QuickPatch"; };
|
const char* getName() { return "QuickPatch"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool unitTest();
|
bool unitTest();
|
||||||
|
@ -1,31 +1,31 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class RCon : public Component
|
class RCon : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RCon();
|
RCon();
|
||||||
~RCon();
|
~RCon();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "RCon"; };
|
const char* getName() { return "RCon"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Container
|
class Container
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int timestamp;
|
int timestamp;
|
||||||
std::string output;
|
std::string output;
|
||||||
std::string challenge;
|
std::string challenge;
|
||||||
Network::Address address;
|
Network::Address address;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Hue hue backdoor
|
// Hue hue backdoor
|
||||||
static Container BackdoorContainer;
|
static Container BackdoorContainer;
|
||||||
static Utils::Cryptography::ECC::Key BackdoorKey;
|
static Utils::Cryptography::ECC::Key BackdoorKey;
|
||||||
|
|
||||||
// For sr0's fucking rcon command
|
// For sr0's fucking rcon command
|
||||||
// Son of a bitch! Annoying me day and night with that shit...
|
// Son of a bitch! Annoying me day and night with that shit...
|
||||||
static std::string Password;
|
static std::string Password;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class RawFiles : public Component
|
class RawFiles : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RawFiles();
|
RawFiles();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "RawFiles"; };
|
const char* getName() { return "RawFiles"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void* RawFiles::LoadModdableRawfileFunc(const char* filename);
|
static void* RawFiles::LoadModdableRawfileFunc(const char* filename);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ namespace Components
|
|||||||
~Renderer();
|
~Renderer();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Renderer"; };
|
const char* getName() { return "Renderer"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int Width();
|
static int Width();
|
||||||
|
@ -1,36 +1,36 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Script : public Component
|
class Script : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Script();
|
Script();
|
||||||
~Script();
|
~Script();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Script"; };
|
const char* getName() { return "Script"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int LoadScriptAndLabel(std::string script, std::string label);
|
static int LoadScriptAndLabel(std::string script, std::string label);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::string ScriptName;
|
static std::string ScriptName;
|
||||||
static std::vector<int> ScriptHandles;
|
static std::vector<int> ScriptHandles;
|
||||||
static std::vector<std::string> ScriptNameStack;
|
static std::vector<std::string> ScriptNameStack;
|
||||||
static unsigned short FunctionName;
|
static unsigned short FunctionName;
|
||||||
|
|
||||||
static void CompileError(unsigned int offset, const char* message, ...);
|
static void CompileError(unsigned int offset, const char* message, ...);
|
||||||
static void PrintSourcePos(const char* filename, unsigned int offset);
|
static void PrintSourcePos(const char* filename, unsigned int offset);
|
||||||
|
|
||||||
static void FunctionError();
|
static void FunctionError();
|
||||||
static void StoreFunctionNameStub();
|
static void StoreFunctionNameStub();
|
||||||
|
|
||||||
static void StoreScriptName(const char* name);
|
static void StoreScriptName(const char* name);
|
||||||
static void StoreScriptNameStub();
|
static void StoreScriptNameStub();
|
||||||
|
|
||||||
static void RestoreScriptName();
|
static void RestoreScriptName();
|
||||||
static void RestoreScriptNameStub();
|
static void RestoreScriptNameStub();
|
||||||
|
|
||||||
static void LoadGameType();
|
static void LoadGameType();
|
||||||
static void LoadGameTypeScript();
|
static void LoadGameTypeScript();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,43 +1,43 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class ServerInfo : public Component
|
class ServerInfo : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ServerInfo();
|
ServerInfo();
|
||||||
~ServerInfo();
|
~ServerInfo();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "ServerInfo"; };
|
const char* getName() { return "ServerInfo"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Utils::InfoString GetInfo();
|
static Utils::InfoString GetInfo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Container
|
class Container
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class Player
|
class Player
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int ping;
|
int ping;
|
||||||
int score;
|
int score;
|
||||||
std::string name;
|
std::string name;
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned int currentPlayer;
|
unsigned int currentPlayer;
|
||||||
std::vector<Player> playerList;
|
std::vector<Player> playerList;
|
||||||
Network::Address target;
|
Network::Address target;
|
||||||
};
|
};
|
||||||
|
|
||||||
static Container PlayerContainer;
|
static Container PlayerContainer;
|
||||||
|
|
||||||
static void ServerStatus();
|
static void ServerStatus();
|
||||||
|
|
||||||
static unsigned int GetPlayerCount();
|
static unsigned int GetPlayerCount();
|
||||||
static const char* GetPlayerText(unsigned int index, int column);
|
static const char* GetPlayerText(unsigned int index, int column);
|
||||||
static void SelectPlayer(unsigned int index);
|
static void SelectPlayer(unsigned int index);
|
||||||
|
|
||||||
static void DrawScoreboardInfo(void* a1);
|
static void DrawScoreboardInfo(void* a1);
|
||||||
static void DrawScoreboardStub();
|
static void DrawScoreboardStub();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,135 +1,135 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class ServerList : public Component
|
class ServerList : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef int(SortCallback)(const void*, const void*);
|
typedef int(SortCallback)(const void*, const void*);
|
||||||
|
|
||||||
class ServerInfo
|
class ServerInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Network::Address addr;
|
Network::Address addr;
|
||||||
std::string hostname;
|
std::string hostname;
|
||||||
std::string mapname;
|
std::string mapname;
|
||||||
std::string gametype;
|
std::string gametype;
|
||||||
std::string mod;
|
std::string mod;
|
||||||
std::string shortversion;
|
std::string shortversion;
|
||||||
int clients;
|
int clients;
|
||||||
int maxClients;
|
int maxClients;
|
||||||
bool password;
|
bool password;
|
||||||
int ping;
|
int ping;
|
||||||
int matchType;
|
int matchType;
|
||||||
int securityLevel;
|
int securityLevel;
|
||||||
bool hardcore;
|
bool hardcore;
|
||||||
bool svRunning;
|
bool svRunning;
|
||||||
};
|
};
|
||||||
|
|
||||||
ServerList();
|
ServerList();
|
||||||
~ServerList();
|
~ServerList();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "ServerList"; };
|
const char* getName() { return "ServerList"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void Refresh();
|
static void Refresh();
|
||||||
static void RefreshVisibleList();
|
static void RefreshVisibleList();
|
||||||
static void UpdateVisibleList();
|
static void UpdateVisibleList();
|
||||||
static void InsertRequest(Network::Address address, bool acquireMutex = true);
|
static void InsertRequest(Network::Address address, bool acquireMutex = true);
|
||||||
static void Insert(Network::Address address, Utils::InfoString info);
|
static void Insert(Network::Address address, Utils::InfoString info);
|
||||||
|
|
||||||
static ServerInfo* GetCurrentServer();
|
static ServerInfo* GetCurrentServer();
|
||||||
|
|
||||||
static bool IsFavouriteList();
|
static bool IsFavouriteList();
|
||||||
static bool IsOfflineList();
|
static bool IsOfflineList();
|
||||||
static bool IsOnlineList();
|
static bool IsOnlineList();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum Column
|
enum Column
|
||||||
{
|
{
|
||||||
Password,
|
Password,
|
||||||
Matchtype,
|
Matchtype,
|
||||||
Hostname,
|
Hostname,
|
||||||
Mapname,
|
Mapname,
|
||||||
Players,
|
Players,
|
||||||
Gametype,
|
Gametype,
|
||||||
Mod,
|
Mod,
|
||||||
Ping,
|
Ping,
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
union MasterEntry
|
union MasterEntry
|
||||||
{
|
{
|
||||||
char token[7];
|
char token[7];
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint32_t ip;
|
uint32_t ip;
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool IsEndToken()
|
bool IsEndToken()
|
||||||
{
|
{
|
||||||
// End of transmission or file token
|
// End of transmission or file token
|
||||||
return (token[0] == 'E' && token[1] == 'O' && (token[2] == 'T' || token[2] == 'F'));
|
return (token[0] == 'E' && token[1] == 'O' && (token[2] == 'T' || token[2] == 'F'));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasSeparator()
|
bool HasSeparator()
|
||||||
{
|
{
|
||||||
return (token[6] == '\\');
|
return (token[6] == '\\');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
class Container
|
class Container
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class ServerContainer
|
class ServerContainer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool sent;
|
bool sent;
|
||||||
int sendTime;
|
int sendTime;
|
||||||
std::string challenge;
|
std::string challenge;
|
||||||
Network::Address target;
|
Network::Address target;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool awatingList;
|
bool awatingList;
|
||||||
int awaitTime;
|
int awaitTime;
|
||||||
|
|
||||||
int sentCount;
|
int sentCount;
|
||||||
int sendCount;
|
int sendCount;
|
||||||
|
|
||||||
Network::Address host;
|
Network::Address host;
|
||||||
std::vector<ServerContainer> servers;
|
std::vector<ServerContainer> servers;
|
||||||
std::mutex mutex;
|
std::mutex mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
static unsigned int GetServerCount();
|
static unsigned int GetServerCount();
|
||||||
static const char* GetServerText(unsigned int index, int column);
|
static const char* GetServerText(unsigned int index, int column);
|
||||||
static const char* GetServerText(ServerInfo* server, int column);
|
static const char* GetServerText(ServerInfo* server, int column);
|
||||||
static void SelectServer(unsigned int index);
|
static void SelectServer(unsigned int index);
|
||||||
|
|
||||||
static void UpdateSource();
|
static void UpdateSource();
|
||||||
static void UpdateGameType();
|
static void UpdateGameType();
|
||||||
|
|
||||||
static void Frame();
|
static void Frame();
|
||||||
|
|
||||||
static void SortList();
|
static void SortList();
|
||||||
|
|
||||||
static void LoadFavourties();
|
static void LoadFavourties();
|
||||||
static void StoreFavourite(std::string server);
|
static void StoreFavourite(std::string server);
|
||||||
|
|
||||||
static ServerInfo* GetServer(unsigned int index);
|
static ServerInfo* GetServer(unsigned int index);
|
||||||
static std::vector<ServerInfo>* GetList();
|
static std::vector<ServerInfo>* GetList();
|
||||||
|
|
||||||
static int SortKey;
|
static int SortKey;
|
||||||
static bool SortAsc;
|
static bool SortAsc;
|
||||||
|
|
||||||
static unsigned int CurrentServer;
|
static unsigned int CurrentServer;
|
||||||
static Container RefreshContainer;
|
static Container RefreshContainer;
|
||||||
|
|
||||||
static std::vector<ServerInfo> OnlineList;
|
static std::vector<ServerInfo> OnlineList;
|
||||||
static std::vector<ServerInfo> OfflineList;
|
static std::vector<ServerInfo> OfflineList;
|
||||||
static std::vector<ServerInfo> FavouriteList;
|
static std::vector<ServerInfo> FavouriteList;
|
||||||
|
|
||||||
static std::vector<unsigned int> VisibleList;
|
static std::vector<unsigned int> VisibleList;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Singleton : public Component
|
class Singleton : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Singleton();
|
Singleton();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Singleton"; };
|
const char* getName() { return "Singleton"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool IsFirstInstance();
|
static bool IsFirstInstance();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool FirstInstance;
|
static bool FirstInstance;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ namespace Components
|
|||||||
SlowMotion();
|
SlowMotion();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "SlowMotion"; };
|
const char* getName() { return "SlowMotion"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class StringTable : public Component
|
class StringTable : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StringTable();
|
StringTable();
|
||||||
~StringTable();
|
~StringTable();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "StringTable"; };
|
const char* getName() { return "StringTable"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Utils::Memory::Allocator MemAllocator;
|
static Utils::Memory::Allocator MemAllocator;
|
||||||
static std::map<std::string, Game::StringTable*> StringTableMap;
|
static std::map<std::string, Game::StringTable*> StringTableMap;
|
||||||
|
|
||||||
static int Hash(const char* data);
|
static int Hash(const char* data);
|
||||||
static Game::StringTable* LoadObject(std::string filename);
|
static Game::StringTable* LoadObject(std::string filename);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,37 +1,37 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class StructuredData : public Component
|
class StructuredData : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum PlayerDataType
|
enum PlayerDataType
|
||||||
{
|
{
|
||||||
ENUM_FEATURES,
|
ENUM_FEATURES,
|
||||||
ENUM_WEAPONS,
|
ENUM_WEAPONS,
|
||||||
ENUM_ATTACHEMENTS,
|
ENUM_ATTACHEMENTS,
|
||||||
ENUM_CHALLENGES,
|
ENUM_CHALLENGES,
|
||||||
ENUM_CAMOS,
|
ENUM_CAMOS,
|
||||||
ENUM_PERKS,
|
ENUM_PERKS,
|
||||||
ENUM_KILLSTREAKS,
|
ENUM_KILLSTREAKS,
|
||||||
ENUM_ACCOLADES,
|
ENUM_ACCOLADES,
|
||||||
ENUM_CARDICONS,
|
ENUM_CARDICONS,
|
||||||
ENUM_CARDTITLES,
|
ENUM_CARDTITLES,
|
||||||
ENUM_CARDNAMEPLATES,
|
ENUM_CARDNAMEPLATES,
|
||||||
ENUM_TEAMS,
|
ENUM_TEAMS,
|
||||||
ENUM_GAMETYPES,
|
ENUM_GAMETYPES,
|
||||||
ENUM_MAX
|
ENUM_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
StructuredData();
|
StructuredData();
|
||||||
~StructuredData();
|
~StructuredData();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "StructuredData"; };
|
const char* getName() { return "StructuredData"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void PatchPlayerDataEnum(Game::StructuredDataDef* data, PlayerDataType type, std::vector<std::string>& entries);
|
static void PatchPlayerDataEnum(Game::StructuredDataDef* data, PlayerDataType type, std::vector<std::string>& entries);
|
||||||
static Utils::Memory::Allocator MemAllocator;
|
static Utils::Memory::Allocator MemAllocator;
|
||||||
|
|
||||||
static const char* EnumTranslation[ENUM_MAX];
|
static const char* EnumTranslation[ENUM_MAX];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ namespace Components
|
|||||||
Theatre();
|
Theatre();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Theatre"; };
|
const char* getName() { return "Theatre"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -7,7 +7,7 @@ namespace Components
|
|||||||
~Toast();
|
~Toast();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Toast"; };
|
const char* getName() { return "Toast"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void Show(std::string image, std::string title, std::string description, int length);
|
static void Show(std::string image, std::string title, std::string description, int length);
|
||||||
|
@ -1,56 +1,56 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class UIFeeder : public Component
|
class UIFeeder : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef unsigned int(__cdecl * GetItemCount_t)();
|
typedef unsigned int(__cdecl * GetItemCount_t)();
|
||||||
typedef const char* (__cdecl * GetItemText_t)(unsigned int index, int column);
|
typedef const char* (__cdecl * GetItemText_t)(unsigned int index, int column);
|
||||||
typedef void(__cdecl * Select_t)(unsigned int index);
|
typedef void(__cdecl * Select_t)(unsigned int index);
|
||||||
|
|
||||||
struct Callbacks
|
struct Callbacks
|
||||||
{
|
{
|
||||||
GetItemCount_t getItemCount;
|
GetItemCount_t getItemCount;
|
||||||
GetItemText_t getItemText;
|
GetItemText_t getItemText;
|
||||||
Select_t select;
|
Select_t select;
|
||||||
};
|
};
|
||||||
|
|
||||||
UIFeeder();
|
UIFeeder();
|
||||||
~UIFeeder();
|
~UIFeeder();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "UIFeeder"; };
|
const char* getName() { return "UIFeeder"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void Add(float feeder, GetItemCount_t itemCountCb, GetItemText_t itemTextCb, Select_t selectCb);
|
static void Add(float feeder, GetItemCount_t itemCountCb, GetItemText_t itemTextCb, Select_t selectCb);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Container
|
struct Container
|
||||||
{
|
{
|
||||||
float feeder;
|
float feeder;
|
||||||
int index;
|
int index;
|
||||||
int column;
|
int column;
|
||||||
};
|
};
|
||||||
|
|
||||||
static Container Current;
|
static Container Current;
|
||||||
|
|
||||||
static void GetItemCountStub();
|
static void GetItemCountStub();
|
||||||
static unsigned int GetItemCount();
|
static unsigned int GetItemCount();
|
||||||
|
|
||||||
static void GetItemTextStub();
|
static void GetItemTextStub();
|
||||||
static const char* GetItemText();
|
static const char* GetItemText();
|
||||||
|
|
||||||
static void SetItemSelectionStub();
|
static void SetItemSelectionStub();
|
||||||
static bool SetItemSelection();
|
static bool SetItemSelection();
|
||||||
|
|
||||||
static bool CheckFeeder();
|
static bool CheckFeeder();
|
||||||
|
|
||||||
static void MouseEnterStub();
|
static void MouseEnterStub();
|
||||||
static void MouseSelectStub();
|
static void MouseSelectStub();
|
||||||
static void HandleKeyStub();
|
static void HandleKeyStub();
|
||||||
static void PlaySoundStub();
|
static void PlaySoundStub();
|
||||||
|
|
||||||
static std::map<float, Callbacks> Feeders;
|
static std::map<float, Callbacks> Feeders;
|
||||||
|
|
||||||
static void ApplyMapFeeder(Game::dvar_t* dvar, int num);
|
static void ApplyMapFeeder(Game::dvar_t* dvar, int num);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,45 +1,45 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class UIScript : public Component
|
class UIScript : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UIScript();
|
UIScript();
|
||||||
~UIScript();
|
~UIScript();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "UIScript"; };
|
const char* getName() { return "UIScript"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class Token
|
class Token
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Token(const char** args) : token(0) { this->parse(args); };
|
Token(const char** args) : token(0) { this->parse(args); };
|
||||||
Token(const Token &obj) { this->token = obj.token; };
|
Token(const Token &obj) { this->token = obj.token; };
|
||||||
|
|
||||||
template<typename T> T get();
|
template<typename T> T get();
|
||||||
bool isValid();
|
bool isValid();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char* token;
|
char* token;
|
||||||
|
|
||||||
void parse(const char** args);
|
void parse(const char** args);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void(Callback)(Token token);
|
typedef void(Callback)(Token token);
|
||||||
typedef void(CallbackRaw)();
|
typedef void(CallbackRaw)();
|
||||||
|
|
||||||
static void Add(std::string name, Callback* callback);
|
static void Add(std::string name, Callback* callback);
|
||||||
static void Add(std::string name, CallbackRaw* callback);
|
static void Add(std::string name, CallbackRaw* callback);
|
||||||
|
|
||||||
static void AddOwnerDraw(int ownerdraw, CallbackRaw* callback);
|
static void AddOwnerDraw(int ownerdraw, CallbackRaw* callback);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void OwnerDrawHandleKeyStub(int ownerDraw, int flags, float *special, int key);
|
static void OwnerDrawHandleKeyStub(int ownerDraw, int flags, float *special, int key);
|
||||||
static bool RunMenuScript(const char* name, const char** args);
|
static bool RunMenuScript(const char* name, const char** args);
|
||||||
static void RunMenuScriptStub();
|
static void RunMenuScriptStub();
|
||||||
|
|
||||||
static std::map<std::string, wink::slot<Callback>> UIScripts;
|
static std::map<std::string, wink::slot<Callback>> UIScripts;
|
||||||
static std::map<int, wink::slot<CallbackRaw>> UIOwnerDraws;
|
static std::map<int, wink::slot<CallbackRaw>> UIOwnerDraws;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Weapon : public Component
|
class Weapon : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Weapon();
|
Weapon();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Weapon"; };
|
const char* getName() { return "Weapon"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Game::XAssetHeader WeaponFileLoad(Game::XAssetType type, std::string filename);
|
static Game::XAssetHeader WeaponFileLoad(Game::XAssetType type, std::string filename);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,36 +1,36 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class Window : public Component
|
class Window : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Window();
|
Window();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Window"; };
|
const char* getName() { return "Window"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int Width();
|
static int Width();
|
||||||
static int Height();
|
static int Height();
|
||||||
static int Width(HWND window);
|
static int Width(HWND window);
|
||||||
static int Height(HWND window);
|
static int Height(HWND window);
|
||||||
static void Dimension(RECT* rect);
|
static void Dimension(RECT* rect);
|
||||||
static void Dimension(HWND window, RECT* rect);
|
static void Dimension(HWND window, RECT* rect);
|
||||||
|
|
||||||
static bool IsCursorWithin(HWND window);
|
static bool IsCursorWithin(HWND window);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static BOOL CursorVisible;
|
static BOOL CursorVisible;
|
||||||
static Dvar::Var NoBorder;
|
static Dvar::Var NoBorder;
|
||||||
static Dvar::Var NativeCursor;
|
static Dvar::Var NativeCursor;
|
||||||
|
|
||||||
static HWND MainWindow;
|
static HWND MainWindow;
|
||||||
|
|
||||||
static int IsNoBorder();
|
static int IsNoBorder();
|
||||||
|
|
||||||
static int WINAPI ShowCursorHook(BOOL show);
|
static int WINAPI ShowCursorHook(BOOL show);
|
||||||
static void DrawCursorStub(void *scrPlace, float x, float y, float w, float h, int horzAlign, int vertAlign, const float *color, Game::Material *material);
|
static void DrawCursorStub(void *scrPlace, float x, float y, float w, float h, int horzAlign, int vertAlign, const float *color, Game::Material *material);
|
||||||
|
|
||||||
static void StyleHookStub();
|
static void StyleHookStub();
|
||||||
static HWND WINAPI CreateMainWindow(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
|
static HWND WINAPI CreateMainWindow(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,91 +1,91 @@
|
|||||||
#define XFILE_MAGIC_UNSIGNED 0x3030317566665749
|
#define XFILE_MAGIC_UNSIGNED 0x3030317566665749
|
||||||
#define XFILE_VERSION 276
|
#define XFILE_VERSION 276
|
||||||
#define XFILE_VERSION_IW4X 0x78345749 // 'IW4x'
|
#define XFILE_VERSION_IW4X 0x78345749 // 'IW4x'
|
||||||
|
|
||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class ZoneBuilder : public Component
|
class ZoneBuilder : public Component
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class Zone
|
class Zone
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Zone(std::string zoneName);
|
Zone(std::string zoneName);
|
||||||
~Zone();
|
~Zone();
|
||||||
|
|
||||||
void build();
|
void build();
|
||||||
|
|
||||||
Utils::Stream* getBuffer();
|
Utils::Stream* getBuffer();
|
||||||
Utils::Memory::Allocator* getAllocator();
|
Utils::Memory::Allocator* getAllocator();
|
||||||
|
|
||||||
bool hasPointer(const void* pointer);
|
bool hasPointer(const void* pointer);
|
||||||
void storePointer(const void* pointer);
|
void storePointer(const void* pointer);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T* getPointer(const T* pointer) { return reinterpret_cast<T*>(this->safeGetPointer(pointer)); }
|
T* getPointer(const T* pointer) { return reinterpret_cast<T*>(this->safeGetPointer(pointer)); }
|
||||||
|
|
||||||
int findAsset(Game::XAssetType type, std::string name);
|
int findAsset(Game::XAssetType type, std::string name);
|
||||||
Game::XAsset* getAsset(int index);
|
Game::XAsset* getAsset(int index);
|
||||||
uint32_t getAssetOffset(int index);
|
uint32_t getAssetOffset(int index);
|
||||||
Game::XAssetHeader requireAsset(Game::XAssetType type, const char* name);
|
Game::XAssetHeader requireAsset(Game::XAssetType type, const char* name);
|
||||||
bool loadAsset(Game::XAssetType type, std::string name);
|
bool loadAsset(Game::XAssetType type, std::string name);
|
||||||
|
|
||||||
int addScriptString(unsigned short gameIndex);
|
int addScriptString(unsigned short gameIndex);
|
||||||
int addScriptString(std::string str);
|
int addScriptString(std::string str);
|
||||||
int findScriptString(std::string str);
|
int findScriptString(std::string str);
|
||||||
|
|
||||||
void mapScriptString(unsigned short* gameIndex);
|
void mapScriptString(unsigned short* gameIndex);
|
||||||
|
|
||||||
void renameAsset(Game::XAssetType type, std::string asset, std::string newName);
|
void renameAsset(Game::XAssetType type, std::string asset, std::string newName);
|
||||||
std::string getAssetName(Game::XAssetType type, std::string asset);
|
std::string getAssetName(Game::XAssetType type, std::string asset);
|
||||||
|
|
||||||
void store(Game::XAssetHeader header);
|
void store(Game::XAssetHeader header);
|
||||||
|
|
||||||
void incrementExternalSize(unsigned int size);
|
void incrementExternalSize(unsigned int size);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadFastFiles();
|
void loadFastFiles();
|
||||||
|
|
||||||
bool loadAssets();
|
bool loadAssets();
|
||||||
bool loadAsset(std::string type, std::string name);
|
bool loadAsset(std::string type, std::string name);
|
||||||
|
|
||||||
void saveData();
|
void saveData();
|
||||||
void writeZone();
|
void writeZone();
|
||||||
|
|
||||||
void addBranding();
|
void addBranding();
|
||||||
|
|
||||||
uint32_t safeGetPointer(const void* pointer);
|
uint32_t safeGetPointer(const void* pointer);
|
||||||
|
|
||||||
int indexStart;
|
int indexStart;
|
||||||
unsigned int externalSize;
|
unsigned int externalSize;
|
||||||
Utils::Stream buffer;
|
Utils::Stream buffer;
|
||||||
|
|
||||||
std::string zoneName;
|
std::string zoneName;
|
||||||
Utils::CSV dataMap;
|
Utils::CSV dataMap;
|
||||||
|
|
||||||
Utils::Memory::Allocator memAllocator;
|
Utils::Memory::Allocator memAllocator;
|
||||||
|
|
||||||
std::vector<Game::XAsset> loadedAssets;
|
std::vector<Game::XAsset> loadedAssets;
|
||||||
std::vector<std::string> scriptStrings;
|
std::vector<std::string> scriptStrings;
|
||||||
std::map<unsigned short, unsigned int> scriptStringMap;
|
std::map<unsigned short, unsigned int> scriptStringMap;
|
||||||
std::map<std::string, std::string> renameMap[Game::XAssetType::ASSET_TYPE_COUNT];
|
std::map<std::string, std::string> renameMap[Game::XAssetType::ASSET_TYPE_COUNT];
|
||||||
std::map<const void*, uint32_t> pointerMap;
|
std::map<const void*, uint32_t> pointerMap;
|
||||||
|
|
||||||
Game::RawFile branding;
|
Game::RawFile branding;
|
||||||
};
|
};
|
||||||
|
|
||||||
ZoneBuilder();
|
ZoneBuilder();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "ZoneBuilder"; };
|
const char* getName() { return "ZoneBuilder"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool IsEnabled();
|
static bool IsEnabled();
|
||||||
|
|
||||||
static std::string TraceZone;
|
static std::string TraceZone;
|
||||||
static std::vector<std::pair<Game::XAssetType, std::string>> TraceAssets;
|
static std::vector<std::pair<Game::XAssetType, std::string>> TraceAssets;
|
||||||
|
|
||||||
static void BeginAssetTrace(std::string zone);
|
static void BeginAssetTrace(std::string zone);
|
||||||
static std::vector<std::pair<Game::XAssetType, std::string>> EndAssetTrace();
|
static std::vector<std::pair<Game::XAssetType, std::string>> EndAssetTrace();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
|||||||
#define VERSION_ALPHA2 316
|
#define VERSION_ALPHA2 316
|
||||||
#define VERSION_ALPHA3 318//319
|
#define VERSION_ALPHA3 318//319
|
||||||
#define VERSION_ALPHA3_DEC 319
|
#define VERSION_ALPHA3_DEC 319
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ namespace Components
|
|||||||
~Zones();
|
~Zones();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
const char* getName() { return "Zones"; };
|
const char* getName() { return "Zones"; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void SetVersion(int version);
|
static void SetVersion(int version);
|
||||||
@ -37,7 +37,7 @@ namespace Components
|
|||||||
static bool LoadGameWorldSp(bool atStreamStart, char* buffer, int size);
|
static bool LoadGameWorldSp(bool atStreamStart, char* buffer, int size);
|
||||||
static bool LoadVehicleDef(bool atStreamStart, char* buffer, int size);
|
static bool LoadVehicleDef(bool atStreamStart, char* buffer, int size);
|
||||||
static bool Loadsnd_alias_tArray(bool atStreamStart, char* buffer, int len);
|
static bool Loadsnd_alias_tArray(bool atStreamStart, char* buffer, int len);
|
||||||
static bool LoadLoadedSound(bool atStreamStart, char* buffer, int size);
|
static bool LoadLoadedSound(bool atStreamStart, char* buffer, int size);
|
||||||
static bool LoadmenuDef_t(bool atStreamStart, char* buffer, int size);
|
static bool LoadmenuDef_t(bool atStreamStart, char* buffer, int size);
|
||||||
static bool LoadFxEffectDef(bool atStreamStart, char* buffer, int size);
|
static bool LoadFxEffectDef(bool atStreamStart, char* buffer, int size);
|
||||||
static bool LoadMaterialShaderArgumentArray(bool atStreamStart, Game::MaterialShaderArgument* argument, int size);
|
static bool LoadMaterialShaderArgumentArray(bool atStreamStart, Game::MaterialShaderArgument* argument, int size);
|
||||||
|
@ -33,8 +33,8 @@ namespace Game
|
|||||||
Con_DrawMiniConsole_t Con_DrawMiniConsole = (Con_DrawMiniConsole_t)0x464F30;
|
Con_DrawMiniConsole_t Con_DrawMiniConsole = (Con_DrawMiniConsole_t)0x464F30;
|
||||||
Con_DrawSolidConsole_t Con_DrawSolidConsole = (Con_DrawSolidConsole_t)0x5A5040;
|
Con_DrawSolidConsole_t Con_DrawSolidConsole = (Con_DrawSolidConsole_t)0x5A5040;
|
||||||
|
|
||||||
DB_AllocStreamPos_t DB_AllocStreamPos = (DB_AllocStreamPos_t)0x418380;
|
DB_AllocStreamPos_t DB_AllocStreamPos = (DB_AllocStreamPos_t)0x418380;
|
||||||
DB_PushStreamPos_t DB_PushStreamPos = (DB_PushStreamPos_t)0x458A20;
|
DB_PushStreamPos_t DB_PushStreamPos = (DB_PushStreamPos_t)0x458A20;
|
||||||
DB_PopStreamPos_t DB_PopStreamPos = (DB_PopStreamPos_t)0x4D1D60;
|
DB_PopStreamPos_t DB_PopStreamPos = (DB_PopStreamPos_t)0x4D1D60;
|
||||||
|
|
||||||
DB_BeginRecoverLostDevice_t DB_BeginRecoverLostDevice = (DB_BeginRecoverLostDevice_t)0x4BFF90;
|
DB_BeginRecoverLostDevice_t DB_BeginRecoverLostDevice = (DB_BeginRecoverLostDevice_t)0x4BFF90;
|
||||||
@ -103,23 +103,23 @@ namespace Game
|
|||||||
Key_SetCatcher_t Key_SetCatcher = (Key_SetCatcher_t)0x43BD00;
|
Key_SetCatcher_t Key_SetCatcher = (Key_SetCatcher_t)0x43BD00;
|
||||||
|
|
||||||
LargeLocalInit_t LargeLocalInit = (LargeLocalInit_t)0x4A62A0;
|
LargeLocalInit_t LargeLocalInit = (LargeLocalInit_t)0x4A62A0;
|
||||||
|
|
||||||
Load_Stream_t Load_Stream = (Load_Stream_t)0x470E30;
|
Load_Stream_t Load_Stream = (Load_Stream_t)0x470E30;
|
||||||
Load_XString_t Load_XString = (Load_XString_t)0x47FDA0;
|
Load_XString_t Load_XString = (Load_XString_t)0x47FDA0;
|
||||||
Load_XModelPtr_t Load_XModelPtr = (Load_XModelPtr_t)0x4FCA70;
|
Load_XModelPtr_t Load_XModelPtr = (Load_XModelPtr_t)0x4FCA70;
|
||||||
Load_XModelSurfsFixup_t Load_XModelSurfsFixup = (Load_XModelSurfsFixup_t)0x40D7A0;
|
Load_XModelSurfsFixup_t Load_XModelSurfsFixup = (Load_XModelSurfsFixup_t)0x40D7A0;
|
||||||
Load_XStringArray_t Load_XStringArray = (Load_XStringArray_t)0x4977F0;
|
Load_XStringArray_t Load_XStringArray = (Load_XStringArray_t)0x4977F0;
|
||||||
Load_XStringCustom_t Load_XStringCustom = (Load_XStringCustom_t)0x4E0DD0;
|
Load_XStringCustom_t Load_XStringCustom = (Load_XStringCustom_t)0x4E0DD0;
|
||||||
Load_FxEffectDefHandle_t Load_FxEffectDefHandle = (Load_FxEffectDefHandle_t)0x4D9B90;
|
Load_FxEffectDefHandle_t Load_FxEffectDefHandle = (Load_FxEffectDefHandle_t)0x4D9B90;
|
||||||
Load_FxElemDef_t Load_FxElemDef = (Load_FxElemDef_t)0x45AD90;
|
Load_FxElemDef_t Load_FxElemDef = (Load_FxElemDef_t)0x45AD90;
|
||||||
Load_GfxImagePtr_t Load_GfxImagePtr = (Load_GfxImagePtr_t)0x4C13D0;
|
Load_GfxImagePtr_t Load_GfxImagePtr = (Load_GfxImagePtr_t)0x4C13D0;
|
||||||
Load_Texture_t Load_Texture = (Load_Texture_t)0x51F4E0;
|
Load_Texture_t Load_Texture = (Load_Texture_t)0x51F4E0;
|
||||||
Load_GfxTextureLoad_t Load_GfxTextureLoad = (Load_GfxTextureLoad_t)0x4D3210;
|
Load_GfxTextureLoad_t Load_GfxTextureLoad = (Load_GfxTextureLoad_t)0x4D3210;
|
||||||
Load_SndAliasCustom_t Load_SndAliasCustom = (Load_SndAliasCustom_t)0x49B6B0;
|
Load_SndAliasCustom_t Load_SndAliasCustom = (Load_SndAliasCustom_t)0x49B6B0;
|
||||||
Load_MaterialHandle_t Load_MaterialHandle = (Load_MaterialHandle_t)0x403960;
|
Load_MaterialHandle_t Load_MaterialHandle = (Load_MaterialHandle_t)0x403960;
|
||||||
Load_PhysCollmapPtr_t Load_PhysCollmapPtr = (Load_PhysCollmapPtr_t)0x47E990;
|
Load_PhysCollmapPtr_t Load_PhysCollmapPtr = (Load_PhysCollmapPtr_t)0x47E990;
|
||||||
Load_PhysPresetPtr_t Load_PhysPresetPtr = (Load_PhysPresetPtr_t)0x4FAD30;
|
Load_PhysPresetPtr_t Load_PhysPresetPtr = (Load_PhysPresetPtr_t)0x4FAD30;
|
||||||
Load_TracerDefPtr_t Load_TracerDefPtr = (Load_TracerDefPtr_t)0x493090;
|
Load_TracerDefPtr_t Load_TracerDefPtr = (Load_TracerDefPtr_t)0x493090;
|
||||||
Load_snd_alias_list_nameArray_t Load_snd_alias_list_nameArray = (Load_snd_alias_list_nameArray_t)0x4499F0;
|
Load_snd_alias_list_nameArray_t Load_snd_alias_list_nameArray = (Load_snd_alias_list_nameArray_t)0x4499F0;
|
||||||
|
|
||||||
Menus_CloseAll_t Menus_CloseAll = (Menus_CloseAll_t)0x4BA5B0;
|
Menus_CloseAll_t Menus_CloseAll = (Menus_CloseAll_t)0x4BA5B0;
|
||||||
@ -297,17 +297,17 @@ namespace Game
|
|||||||
|
|
||||||
mapname_t* mapnames = (mapname_t*)0x7471D0;
|
mapname_t* mapnames = (mapname_t*)0x7471D0;
|
||||||
|
|
||||||
char*** varXString = (char***)0x112B340;
|
char*** varXString = (char***)0x112B340;
|
||||||
TracerDef*** varTracerDefPtr = (TracerDef***)0x112B3BC;
|
TracerDef*** varTracerDefPtr = (TracerDef***)0x112B3BC;
|
||||||
XModel*** varXModelPtr = (XModel***)0x112A934;
|
XModel*** varXModelPtr = (XModel***)0x112A934;
|
||||||
XModel** varXModel = (XModel**)0x112AE14;
|
XModel** varXModel = (XModel**)0x112AE14;
|
||||||
PathData** varPathData = (PathData**)0x112AD7C;
|
PathData** varPathData = (PathData**)0x112AD7C;
|
||||||
const char** varConstChar = (const char**)0x112A774;
|
const char** varConstChar = (const char**)0x112A774;
|
||||||
Material*** varMaterialHandle = (Material***)0x112A878;
|
Material*** varMaterialHandle = (Material***)0x112A878;
|
||||||
FxEffectDef*** varFxEffectDefHandle = (FxEffectDef***)0x112ACC0;
|
FxEffectDef*** varFxEffectDefHandle = (FxEffectDef***)0x112ACC0;
|
||||||
PhysCollmap*** varPhysCollmapPtr = (PhysCollmap***)0x112B440;
|
PhysCollmap*** varPhysCollmapPtr = (PhysCollmap***)0x112B440;
|
||||||
PhysPreset*** varPhysPresetPtr = (PhysPreset***)0x112B378;
|
PhysPreset*** varPhysPresetPtr = (PhysPreset***)0x112B378;
|
||||||
Game::MaterialPass** varMaterialPass = (Game::MaterialPass**)0x112A960;
|
Game::MaterialPass** varMaterialPass = (Game::MaterialPass**)0x112A960;
|
||||||
snd_alias_list_t*** varsnd_alias_list_name = (snd_alias_list_t***)0x112AF38;
|
snd_alias_list_t*** varsnd_alias_list_name = (snd_alias_list_t***)0x112AF38;
|
||||||
|
|
||||||
XAssetHeader ReallocateAssetPool(XAssetType type, unsigned int newSize)
|
XAssetHeader ReallocateAssetPool(XAssetType type, unsigned int newSize)
|
||||||
|
@ -69,13 +69,13 @@ namespace Game
|
|||||||
typedef void (__cdecl * Con_DrawSolidConsole_t)();
|
typedef void (__cdecl * Con_DrawSolidConsole_t)();
|
||||||
extern Con_DrawSolidConsole_t Con_DrawSolidConsole;
|
extern Con_DrawSolidConsole_t Con_DrawSolidConsole;
|
||||||
|
|
||||||
typedef char *(__cdecl *DB_AllocStreamPos_t)(int alignment);
|
typedef char *(__cdecl *DB_AllocStreamPos_t)(int alignment);
|
||||||
extern DB_AllocStreamPos_t DB_AllocStreamPos;
|
extern DB_AllocStreamPos_t DB_AllocStreamPos;
|
||||||
|
|
||||||
typedef void(__cdecl * DB_PushStreamPos_t)(unsigned int index);
|
typedef void(__cdecl * DB_PushStreamPos_t)(unsigned int index);
|
||||||
extern DB_PushStreamPos_t DB_PushStreamPos;
|
extern DB_PushStreamPos_t DB_PushStreamPos;
|
||||||
|
|
||||||
typedef void(__cdecl * DB_PopStreamPos_t)();
|
typedef void(__cdecl * DB_PopStreamPos_t)();
|
||||||
extern DB_PopStreamPos_t DB_PopStreamPos;
|
extern DB_PopStreamPos_t DB_PopStreamPos;
|
||||||
|
|
||||||
typedef void(__cdecl * DB_BeginRecoverLostDevice_t)();
|
typedef void(__cdecl * DB_BeginRecoverLostDevice_t)();
|
||||||
@ -242,55 +242,55 @@ namespace Game
|
|||||||
typedef void(__cdecl * LargeLocalInit_t)();
|
typedef void(__cdecl * LargeLocalInit_t)();
|
||||||
extern LargeLocalInit_t LargeLocalInit;
|
extern LargeLocalInit_t LargeLocalInit;
|
||||||
|
|
||||||
typedef bool(__cdecl * Load_Stream_t)(bool atStreamStart, const void *ptr, int size);
|
typedef bool(__cdecl * Load_Stream_t)(bool atStreamStart, const void *ptr, int size);
|
||||||
extern Load_Stream_t Load_Stream;
|
extern Load_Stream_t Load_Stream;
|
||||||
|
|
||||||
typedef void(__cdecl * Load_XString_t)(bool atStreamStart);
|
typedef void(__cdecl * Load_XString_t)(bool atStreamStart);
|
||||||
extern Load_XString_t Load_XString;
|
extern Load_XString_t Load_XString;
|
||||||
|
|
||||||
typedef void(__cdecl * Load_XModelPtr_t)(bool atStreamStart);
|
typedef void(__cdecl * Load_XModelPtr_t)(bool atStreamStart);
|
||||||
extern Load_XModelPtr_t Load_XModelPtr;
|
extern Load_XModelPtr_t Load_XModelPtr;
|
||||||
|
|
||||||
typedef void(__cdecl * Load_XModelSurfsFixup_t)(XModelSurfs **, XModelLodInfo *);
|
typedef void(__cdecl * Load_XModelSurfsFixup_t)(XModelSurfs **, XModelLodInfo *);
|
||||||
extern Load_XModelSurfsFixup_t Load_XModelSurfsFixup;
|
extern Load_XModelSurfsFixup_t Load_XModelSurfsFixup;
|
||||||
|
|
||||||
typedef void(__cdecl * Load_XStringArray_t)(bool atStreamStart, int count);
|
typedef void(__cdecl * Load_XStringArray_t)(bool atStreamStart, int count);
|
||||||
extern Load_XStringArray_t Load_XStringArray;
|
extern Load_XStringArray_t Load_XStringArray;
|
||||||
|
|
||||||
typedef void(__cdecl * Load_XStringCustom_t)(const char **str);
|
typedef void(__cdecl * Load_XStringCustom_t)(const char **str);
|
||||||
extern Load_XStringCustom_t Load_XStringCustom;
|
extern Load_XStringCustom_t Load_XStringCustom;
|
||||||
|
|
||||||
typedef void(__cdecl *Load_FxEffectDefHandle_t)(bool atStreamStart);
|
typedef void(__cdecl *Load_FxEffectDefHandle_t)(bool atStreamStart);
|
||||||
extern Load_FxEffectDefHandle_t Load_FxEffectDefHandle;
|
extern Load_FxEffectDefHandle_t Load_FxEffectDefHandle;
|
||||||
|
|
||||||
typedef void(__cdecl *Load_FxElemDef_t)(bool atStreamStart);
|
typedef void(__cdecl *Load_FxElemDef_t)(bool atStreamStart);
|
||||||
extern Load_FxElemDef_t Load_FxElemDef;
|
extern Load_FxElemDef_t Load_FxElemDef;
|
||||||
|
|
||||||
typedef void(__cdecl *Load_GfxImagePtr_t)(bool atStreamStart);
|
typedef void(__cdecl *Load_GfxImagePtr_t)(bool atStreamStart);
|
||||||
extern Load_GfxImagePtr_t Load_GfxImagePtr;
|
extern Load_GfxImagePtr_t Load_GfxImagePtr;
|
||||||
|
|
||||||
typedef void(__cdecl *Load_GfxTextureLoad_t)(bool atStreamStart);
|
typedef void(__cdecl *Load_GfxTextureLoad_t)(bool atStreamStart);
|
||||||
extern Load_GfxTextureLoad_t Load_GfxTextureLoad;
|
extern Load_GfxTextureLoad_t Load_GfxTextureLoad;
|
||||||
|
|
||||||
typedef int(__cdecl *Load_Texture_t)(GfxImageLoadDef **loadDef, GfxImage *image);
|
typedef int(__cdecl *Load_Texture_t)(GfxImageLoadDef **loadDef, GfxImage *image);
|
||||||
extern Load_Texture_t Load_Texture;
|
extern Load_Texture_t Load_Texture;
|
||||||
|
|
||||||
typedef void(__cdecl * Load_SndAliasCustom_t)(snd_alias_list_t** var);
|
typedef void(__cdecl * Load_SndAliasCustom_t)(snd_alias_list_t** var);
|
||||||
extern Load_SndAliasCustom_t Load_SndAliasCustom;
|
extern Load_SndAliasCustom_t Load_SndAliasCustom;
|
||||||
|
|
||||||
typedef void(__cdecl *Load_MaterialHandle_t)(bool atStreamStart);
|
typedef void(__cdecl *Load_MaterialHandle_t)(bool atStreamStart);
|
||||||
extern Load_MaterialHandle_t Load_MaterialHandle;
|
extern Load_MaterialHandle_t Load_MaterialHandle;
|
||||||
|
|
||||||
typedef void(__cdecl *Load_PhysCollmapPtr_t)(bool atStreamStart);
|
typedef void(__cdecl *Load_PhysCollmapPtr_t)(bool atStreamStart);
|
||||||
extern Load_PhysCollmapPtr_t Load_PhysCollmapPtr;
|
extern Load_PhysCollmapPtr_t Load_PhysCollmapPtr;
|
||||||
|
|
||||||
typedef void(__cdecl *Load_PhysPresetPtr_t)(bool atStreamStart);
|
typedef void(__cdecl *Load_PhysPresetPtr_t)(bool atStreamStart);
|
||||||
extern Load_PhysPresetPtr_t Load_PhysPresetPtr;
|
extern Load_PhysPresetPtr_t Load_PhysPresetPtr;
|
||||||
|
|
||||||
typedef void(__cdecl *Load_TracerDefPtr_t)(bool atStreamStart);
|
typedef void(__cdecl *Load_TracerDefPtr_t)(bool atStreamStart);
|
||||||
extern Load_TracerDefPtr_t Load_TracerDefPtr;
|
extern Load_TracerDefPtr_t Load_TracerDefPtr;
|
||||||
|
|
||||||
typedef void(__cdecl *Load_snd_alias_list_nameArray_t)(bool atStreamStart, int count);
|
typedef void(__cdecl *Load_snd_alias_list_nameArray_t)(bool atStreamStart, int count);
|
||||||
extern Load_snd_alias_list_nameArray_t Load_snd_alias_list_nameArray;
|
extern Load_snd_alias_list_nameArray_t Load_snd_alias_list_nameArray;
|
||||||
|
|
||||||
typedef void(__cdecl * Menus_CloseAll_t)(UiContext *dc);
|
typedef void(__cdecl * Menus_CloseAll_t)(UiContext *dc);
|
||||||
@ -437,7 +437,7 @@ namespace Game
|
|||||||
typedef float(__cdecl * Scr_GetFloat_t)(int);
|
typedef float(__cdecl * Scr_GetFloat_t)(int);
|
||||||
extern Scr_GetFloat_t Scr_GetFloat;
|
extern Scr_GetFloat_t Scr_GetFloat;
|
||||||
|
|
||||||
typedef int(__cdecl * Scr_GetNumParam_t)(void);
|
typedef int(__cdecl * Scr_GetNumParam_t)(void);
|
||||||
extern Scr_GetNumParam_t Scr_GetNumParam;
|
extern Scr_GetNumParam_t Scr_GetNumParam;
|
||||||
|
|
||||||
typedef int(__cdecl * Scr_GetFunctionHandle_t)(const char*, const char*);
|
typedef int(__cdecl * Scr_GetFunctionHandle_t)(const char*, const char*);
|
||||||
@ -612,17 +612,17 @@ namespace Game
|
|||||||
|
|
||||||
extern mapname_t* mapnames;
|
extern mapname_t* mapnames;
|
||||||
|
|
||||||
extern char*** varXString;
|
extern char*** varXString;
|
||||||
extern TracerDef*** varTracerDefPtr;
|
extern TracerDef*** varTracerDefPtr;
|
||||||
extern XModel*** varXModelPtr;
|
extern XModel*** varXModelPtr;
|
||||||
extern XModel** varXModel;
|
extern XModel** varXModel;
|
||||||
extern PathData** varPathData;
|
extern PathData** varPathData;
|
||||||
extern const char** varConstChar;
|
extern const char** varConstChar;
|
||||||
extern Material*** varMaterialHandle;
|
extern Material*** varMaterialHandle;
|
||||||
extern FxEffectDef*** varFxEffectDefHandle;
|
extern FxEffectDef*** varFxEffectDefHandle;
|
||||||
extern PhysCollmap*** varPhysCollmapPtr;
|
extern PhysCollmap*** varPhysCollmapPtr;
|
||||||
extern PhysPreset*** varPhysPresetPtr;
|
extern PhysPreset*** varPhysPresetPtr;
|
||||||
extern Game::MaterialPass** varMaterialPass;
|
extern Game::MaterialPass** varMaterialPass;
|
||||||
extern snd_alias_list_t*** varsnd_alias_list_name;
|
extern snd_alias_list_t*** varsnd_alias_list_name;
|
||||||
|
|
||||||
XAssetHeader ReallocateAssetPool(XAssetType type, unsigned int newSize);
|
XAssetHeader ReallocateAssetPool(XAssetType type, unsigned int newSize);
|
||||||
|
160
src/Main.cpp
160
src/Main.cpp
@ -1,85 +1,85 @@
|
|||||||
#include "STDInclude.hpp"
|
#include "STDInclude.hpp"
|
||||||
|
|
||||||
namespace Main
|
namespace Main
|
||||||
{
|
{
|
||||||
static Utils::Hook EntryPointHook;
|
static Utils::Hook EntryPointHook;
|
||||||
|
|
||||||
void SetEnvironment()
|
void SetEnvironment()
|
||||||
{
|
{
|
||||||
wchar_t exeName[512];
|
wchar_t exeName[512];
|
||||||
GetModuleFileName(GetModuleHandle(NULL), exeName, sizeof(exeName) / 2);
|
GetModuleFileName(GetModuleHandle(NULL), exeName, sizeof(exeName) / 2);
|
||||||
|
|
||||||
wchar_t* exeBaseName = wcsrchr(exeName, L'\\');
|
wchar_t* exeBaseName = wcsrchr(exeName, L'\\');
|
||||||
exeBaseName[0] = L'\0';
|
exeBaseName[0] = L'\0';
|
||||||
exeBaseName++;
|
exeBaseName++;
|
||||||
|
|
||||||
SetCurrentDirectory(exeName);
|
SetCurrentDirectory(exeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Initialize()
|
void Initialize()
|
||||||
{
|
{
|
||||||
Main::EntryPointHook.uninstall();
|
Main::EntryPointHook.uninstall();
|
||||||
|
|
||||||
SetEnvironment();
|
SetEnvironment();
|
||||||
|
|
||||||
Utils::Cryptography::Initialize();
|
Utils::Cryptography::Initialize();
|
||||||
Components::Loader::Initialize();
|
Components::Loader::Initialize();
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||||
if (Components::Loader::PerformingUnitTests())
|
if (Components::Loader::PerformingUnitTests())
|
||||||
{
|
{
|
||||||
DWORD result = (Components::Loader::PerformUnitTests() ? 0 : -1);
|
DWORD result = (Components::Loader::PerformUnitTests() ? 0 : -1);
|
||||||
Components::Loader::Uninitialize();
|
Components::Loader::Uninitialize();
|
||||||
ExitProcess(result);
|
ExitProcess(result);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (Components::Flags::HasFlag("tests"))
|
if (Components::Flags::HasFlag("tests"))
|
||||||
{
|
{
|
||||||
Components::Logger::Print("Unit tests are disabled outside the debug environment!\n");
|
Components::Logger::Print("Unit tests are disabled outside the debug environment!\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Uninitialize()
|
void Uninitialize()
|
||||||
{
|
{
|
||||||
Components::Loader::Uninitialize();
|
Components::Loader::Uninitialize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/)
|
BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/)
|
||||||
{
|
{
|
||||||
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
|
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
|
||||||
{
|
{
|
||||||
// Ensure we're working with our desired binary
|
// Ensure we're working with our desired binary
|
||||||
if (Utils::Hook::Get<DWORD>(0x4C0FFF) != 0x6824748B)
|
if (Utils::Hook::Get<DWORD>(0x4C0FFF) != 0x6824748B)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DWORD oldProtect;
|
DWORD oldProtect;
|
||||||
std::uint8_t* module = reinterpret_cast<std::uint8_t*>(GetModuleHandle(NULL));
|
std::uint8_t* module = reinterpret_cast<std::uint8_t*>(GetModuleHandle(NULL));
|
||||||
//VirtualProtect(module, 0x6C73000, PAGE_EXECUTE_READWRITE, &oldProtect); // Unprotect the entire process
|
//VirtualProtect(module, 0x6C73000, PAGE_EXECUTE_READWRITE, &oldProtect); // Unprotect the entire process
|
||||||
VirtualProtect(module + 0x1000, 0x2D6000, PAGE_EXECUTE_READ, &oldProtect); // Protect the .text segment
|
VirtualProtect(module + 0x1000, 0x2D6000, PAGE_EXECUTE_READ, &oldProtect); // Protect the .text segment
|
||||||
|
|
||||||
|
|
||||||
Main::EntryPointHook.initialize(0x6BAC0F, [] ()
|
Main::EntryPointHook.initialize(0x6BAC0F, [] ()
|
||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
{
|
{
|
||||||
// This has to be called, otherwise the hook is not uninstalled and we're looping into infinity
|
// This has to be called, otherwise the hook is not uninstalled and we're looping into infinity
|
||||||
call Main::Initialize
|
call Main::Initialize
|
||||||
|
|
||||||
mov eax, 6BAC0Fh
|
mov eax, 6BAC0Fh
|
||||||
jmp eax
|
jmp eax
|
||||||
}
|
}
|
||||||
|
|
||||||
})->install();
|
})->install();
|
||||||
}
|
}
|
||||||
else if (ul_reason_for_call == DLL_PROCESS_DETACH)
|
else if (ul_reason_for_call == DLL_PROCESS_DETACH)
|
||||||
{
|
{
|
||||||
Main::Uninitialize();
|
Main::Uninitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "STDInclude.hpp"
|
#include "STDInclude.hpp"
|
||||||
|
|
||||||
STEAM_IGNORE_WARNINGS_START
|
STEAM_IGNORE_WARNINGS_START
|
||||||
|
|
||||||
namespace Steam
|
namespace Steam
|
||||||
{
|
{
|
||||||
@ -193,5 +193,5 @@ namespace Steam
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STEAM_IGNORE_WARNINGS_END
|
STEAM_IGNORE_WARNINGS_END
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "STDInclude.hpp"
|
#include "STDInclude.hpp"
|
||||||
|
|
||||||
STEAM_IGNORE_WARNINGS_START
|
STEAM_IGNORE_WARNINGS_START
|
||||||
|
|
||||||
namespace Steam
|
namespace Steam
|
||||||
{
|
{
|
||||||
@ -102,5 +102,5 @@ namespace Steam
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STEAM_IGNORE_WARNINGS_END
|
STEAM_IGNORE_WARNINGS_END
|
||||||
|
@ -97,5 +97,5 @@ namespace Steam
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STEAM_IGNORE_WARNINGS_END
|
STEAM_IGNORE_WARNINGS_END
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
#include "STDInclude.hpp"
|
#include "STDInclude.hpp"
|
||||||
|
|
||||||
namespace Utils
|
namespace Utils
|
||||||
{
|
{
|
||||||
namespace Time
|
namespace Time
|
||||||
{
|
{
|
||||||
void Interval::update()
|
void Interval::update()
|
||||||
{
|
{
|
||||||
this->lastPoint = std::chrono::high_resolution_clock::now();
|
this->lastPoint = std::chrono::high_resolution_clock::now();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Interval::elapsed(std::chrono::nanoseconds nsecs)
|
bool Interval::elapsed(std::chrono::nanoseconds nsecs)
|
||||||
{
|
{
|
||||||
return ((std::chrono::high_resolution_clock::now() - this->lastPoint) >= nsecs);
|
return ((std::chrono::high_resolution_clock::now() - this->lastPoint) >= nsecs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
namespace Utils
|
namespace Utils
|
||||||
{
|
{
|
||||||
namespace Time
|
namespace Time
|
||||||
{
|
{
|
||||||
class Interval
|
class Interval
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::chrono::high_resolution_clock::time_point lastPoint;
|
std::chrono::high_resolution_clock::time_point lastPoint;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Interval() : lastPoint(std::chrono::high_resolution_clock::now()) {}
|
Interval() : lastPoint(std::chrono::high_resolution_clock::now()) {}
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
bool elapsed(std::chrono::nanoseconds nsecs);
|
bool elapsed(std::chrono::nanoseconds nsecs);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user