Skip to content

Commit

Permalink
Updated crash logging
Browse files Browse the repository at this point in the history
Conflicts:
	MTA10/version.h
  • Loading branch information
ccw808 committed Jun 1, 2015
1 parent b7bbde6 commit 71515c3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
4 changes: 4 additions & 0 deletions MTA10/core/CCrashDumpWriter.cpp
Expand Up @@ -511,6 +511,10 @@ void CCrashDumpWriter::DumpMiniDump ( _EXCEPTION_POINTERS* pException, CExceptio
CCore::GetSingleton().SaveConfig();
AddReportLog( 9205, "Disabled volumetric shadows" );
}

CNet* pNet = CCore::GetSingleton().GetNetwork();
if ( pNet )
pNet->PostCrash();
}


Expand Down
31 changes: 30 additions & 1 deletion MTA10/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp
Expand Up @@ -1134,6 +1134,23 @@ void _declspec(naked) HOOK_CClumpModelInfo_GetFrameFromId ()
}


struct CStreamingInfo
{
DWORD gta_hash;
WORD chain_next;
uchar flg;
uchar archiveId;
DWORD offsetInBlocks;
DWORD sizeInBlocks;
DWORD reqload;
};

CStreamingInfo* GetStreamingInfoFromModelId( uint id )
{
CStreamingInfo* pItemInfo = (CStreamingInfo*)(0x8E4CC0);
return pItemInfo + id;
}

//////////////////////////////////////////////////////////////////////////////////////////
//
// CEntity::GetBoundRect
Expand All @@ -1160,7 +1177,19 @@ void OnMY_CEntity_GetBoundRect( CEntitySAInterface* pEntity )
if ( !pColModel )
{
// Crash will occur at offset 00134134
LogEvent( 815, "Model collision missing", "CEntity_GetBoundRect", SString( "No collision for model:%d", usModelId ), 5415 );
CStreamingInfo* pStreamingInfo = GetStreamingInfoFromModelId( usModelId );
SString strDetails( "refs:%d txd:%d RwObj:%08x bOwn:%d bColStr:%d flg:%d off:%d size:%d reqload:%d"
,pModelInfo->usNumberOfRefs
,pModelInfo->usTextureDictionary
,pModelInfo->pRwObject
,pModelInfo->bDoWeOwnTheColModel
,pModelInfo->bCollisionWasStreamedWithModel
,pStreamingInfo->flg
,pStreamingInfo->offsetInBlocks
,pStreamingInfo->sizeInBlocks
,pStreamingInfo->reqload
);
LogEvent( 815, "Model collision missing", "CEntity_GetBoundRect", SString( "No collision for model:%d %s", usModelId, *strDetails ), 5415 );
CArgMap argMap;
argMap.Set( "id", usModelId );
argMap.Set( "reason", "collision" );
Expand Down
1 change: 1 addition & 0 deletions MTA10/sdk/net/CNet.h
Expand Up @@ -126,6 +126,7 @@ class CNet
virtual CBinaryFileInterface* AllocateBinaryFile ( void ) = 0;
virtual bool EncryptDumpfile ( const char* szClearPathFilename, const char* szEncryptedPathFilename ) = 0;
virtual bool DecryptScript ( const char* cpInBuffer, uint uiInSize, const char** pcpOutBuffer, uint* puiOutSize, const char* szScriptName ) = 0;
virtual void PostCrash ( void ) = 0;
};

#endif
2 changes: 1 addition & 1 deletion MTA10/version.h
Expand Up @@ -75,7 +75,7 @@

#define _ASE_VERSION QUOTE_DEFINE(MTASA_VERSION_MAJOR) "." QUOTE_DEFINE(MTASA_VERSION_MINOR)
#define _NETCODE_VERSION_BRANCH_ID 0x4 // Use 0x1 - 0xF to indicate an incompatible branch is being used (0x0 is reserved, 0x4 is trunk)
#define _CLIENT_NET_MODULE_VERSION 0x08D // (0x000 - 0xfff) Lvl9 wizards only
#define _CLIENT_NET_MODULE_VERSION 0x08E // (0x000 - 0xfff) Lvl9 wizards only
#define _NETCODE_VERSION 0x1D8 // (0x000 - 0xfff) Increment when net messages change (pre-release)
#define MTA_DM_BITSTREAM_VERSION 0x060 // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code).

Expand Down

0 comments on commit 71515c3

Please sign in to comment.