diff --git a/saco/main.cpp b/saco/main.cpp index e964823..0c1d42b 100644 --- a/saco/main.cpp +++ b/saco/main.cpp @@ -28,6 +28,9 @@ CUnkClass15 *pUnkClass15=0; BOOL bGameInited=FALSE; +BOOL bQuitGame=FALSE; +DWORD dwStartQuitTick=0; + WORD wVehicleComponentDebug=0; IDirect3D9 *pD3D; @@ -428,6 +431,17 @@ void TheGraphicsLoop() //---------------------------------------------------- +void QuitGame() +{ + if(pNetGame && pNetGame->GetGameState() == GAMESTATE_CONNECTED) { + pNetGame->GetRakClient()->Disconnect(500); + } + bQuitGame = TRUE; + dwStartQuitTick = GetTickCount(); +} + +//---------------------------------------------------- + void InitSettings() { PCHAR szCmdLine = GetCommandLineA(); diff --git a/saco/net/netgame.h b/saco/net/netgame.h index d6c98cf..62967e0 100644 --- a/saco/net/netgame.h +++ b/saco/net/netgame.h @@ -1,6 +1,8 @@ #pragma once +#define GAMESTATE_CONNECTED 5 + #define GAMESTATE_WAIT_CONNECT 1 struct struc_41 @@ -70,6 +72,7 @@ public: void InitPools(); DWORD GetTime(); + int GetGameState() { return m_iGameState; }; BOOL GetWalkStyle() { return field_3D5->bUseCJWalk; }; CPlayerPool * GetPlayerPool() { return m_pPools->pPlayerPool; };