2021-12-25 22:36:38 +01:00
//=============================================================================//
//
2022-02-14 23:16:24 +01:00
// Purpose: Completion functions for ConCommand callbacks.
2021-12-25 22:36:38 +01:00
//
//=============================================================================//
# include "core/stdafx.h"
# include "windows/id3dx.h"
2022-04-09 16:16:40 +02:00
# include "tier1/cvar.h"
# include "tier1/IConVar.h"
2022-02-06 15:59:46 +01:00
# ifndef DEDICATED
# include "engine/cl_rcon.h"
# endif // !DEDICATED
2022-04-02 02:48:54 +02:00
# include "engine/net.h"
2022-04-05 01:13:27 +02:00
# include "engine/net_chan.h"
2021-12-25 22:36:38 +01:00
# include "engine/sys_utils.h"
2022-03-26 00:24:13 +01:00
# include "engine/baseclient.h"
2021-12-27 16:53:35 +01:00
# include "rtech/rtech_game.h"
# include "rtech/rtech_utils.h"
2022-04-09 00:59:42 +02:00
# include "filesystem/basefilesystem.h"
# include "filesystem/filesystem.h"
2021-12-25 22:36:38 +01:00
# include "vpklib/packedstore.h"
2022-03-30 22:54:33 +02:00
# include "squirrel/sqvm.h"
2022-01-12 02:53:07 +01:00
# ifndef DEDICATED
# include "gameui/IBrowser.h"
2021-12-25 22:36:38 +01:00
# include "gameui/IConsole.h"
2022-01-12 02:53:07 +01:00
# endif // !DEDICATED
2021-12-25 22:36:38 +01:00
# include "public/include/bansystem.h"
2021-12-26 02:30:20 +01:00
# include "mathlib/crc32.h"
2022-04-09 16:16:40 +02:00
# include "vstdlib/completion.h"
2022-03-18 13:47:22 +01:00
# ifndef DEDICATED
# include "materialsystem/cmaterialglue.h"
# endif // !DEDICATED
2021-12-25 22:36:38 +01:00
# ifndef DEDICATED
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_CGameConsole_f_CompletionFunc
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _CGameConsole_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-01-12 02:53:07 +01:00
g_pIConsole - > m_bActivate = ! g_pIConsole - > m_bActivate ;
2021-12-25 22:36:38 +01:00
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_CCompanion_f_CompletionFunc
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-28 18:47:11 +02:00
void _CCompanion_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-01-12 02:53:07 +01:00
g_pIBrowser - > m_bActivate = ! g_pIBrowser - > m_bActivate ;
2021-12-25 22:36:38 +01:00
}
# endif // !DEDICATED
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_Kick_f_CompletionFunc
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _Kick_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-03-02 02:03:46 +01:00
if ( args . ArgC ( ) < 2 )
2021-12-25 22:36:38 +01:00
{
return ;
}
2022-03-02 02:03:46 +01:00
for ( int i = 0 ; i < MAX_PLAYERS ; i + + )
2021-12-25 22:36:38 +01:00
{
2022-04-05 01:13:27 +02:00
CBaseClient * pClient = g_pClient - > GetClient ( i ) ;
CNetChan * pNetChan = pClient - > GetNetChan ( ) ;
if ( ! pClient | | ! pNetChan )
2021-12-25 22:36:38 +01:00
{
continue ;
}
2022-04-06 00:49:17 +02:00
std : : string svClientName = pNetChan - > GetName ( ) ; // Get full name.
2021-12-25 22:36:38 +01:00
2022-04-05 01:13:27 +02:00
if ( svClientName . empty ( ) )
2021-12-25 22:36:38 +01:00
{
continue ;
}
2022-04-05 01:13:27 +02:00
if ( strcmp ( args . Arg ( 1 ) , svClientName . c_str ( ) ) ! = 0 ) // Our wanted name?
2021-12-25 22:36:38 +01:00
{
continue ;
}
2022-04-05 01:13:27 +02:00
NET_DisconnectClient ( pClient , i , " Kicked from Server " , 0 , 1 ) ;
2021-12-25 22:36:38 +01:00
}
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_KickID_f_CompletionFunc
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _KickID_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-03-02 02:03:46 +01:00
if ( args . ArgC ( ) < 2 ) // Do we atleast have 2 arguments?
2021-12-25 22:36:38 +01:00
{
return ;
}
try
{
2022-04-02 02:48:54 +02:00
bool bOnlyDigits = args . HasOnlyDigits ( 1 ) ;
2022-03-02 02:03:46 +01:00
for ( int i = 0 ; i < MAX_PLAYERS ; i + + )
2021-12-25 22:36:38 +01:00
{
2022-04-02 02:48:54 +02:00
CBaseClient * pClient = g_pClient - > GetClient ( i ) ;
CNetChan * pNetChan = pClient - > GetNetChan ( ) ;
2021-12-25 22:36:38 +01:00
2022-04-02 02:48:54 +02:00
if ( ! pClient | | ! pNetChan )
2021-12-25 22:36:38 +01:00
{
continue ;
}
2022-04-02 02:48:54 +02:00
std : : string svIpAddress = pNetChan - > GetAddress ( ) ; // If this stays null they modified the packet somehow.
2021-12-25 22:36:38 +01:00
2022-04-02 02:48:54 +02:00
if ( bOnlyDigits )
2021-12-25 22:36:38 +01:00
{
2022-04-02 02:48:54 +02:00
std : : int64_t nTargetID = static_cast < std : : int64_t > ( std : : stoll ( args . Arg ( 1 ) ) ) ;
if ( nTargetID > MAX_PLAYERS ) // Is it a possible originID?
2021-12-25 22:36:38 +01:00
{
2022-04-02 02:48:54 +02:00
std : : int64_t nOriginID = pClient - > GetOriginID ( ) ;
if ( nOriginID ! = nTargetID )
2021-12-25 22:36:38 +01:00
{
continue ;
}
}
else // If its not try by userID.
{
2022-04-02 02:48:54 +02:00
std : : int64_t nClientID = static_cast < std : : int64_t > ( pClient - > GetUserID ( ) + 1 ) ; // Get userID + 1.
if ( nClientID ! = nTargetID )
2021-12-25 22:36:38 +01:00
{
continue ;
}
}
2022-04-02 02:48:54 +02:00
NET_DisconnectClient ( pClient , i , " Kicked from Server " , 0 , 1 ) ;
2021-12-25 22:36:38 +01:00
}
else
{
2022-04-02 02:48:54 +02:00
if ( std : : string ( args . Arg ( 1 ) ) . compare ( svIpAddress ) ! = NULL )
2021-12-25 22:36:38 +01:00
{
continue ;
}
2022-04-02 02:48:54 +02:00
NET_DisconnectClient ( pClient , i , " Kicked from Server " , 0 , 1 ) ;
2021-12-25 22:36:38 +01:00
}
}
}
catch ( std : : exception & e )
{
2022-03-04 15:59:33 +01:00
Error ( eDLL_T : : SERVER , " sv_kickid requires a UserID or OriginID. You can get the UserID with the 'status' command. Error: %s " , e . what ( ) ) ;
2021-12-25 22:36:38 +01:00
return ;
}
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_Ban_f_CompletionFunc
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _Ban_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-03-02 02:03:46 +01:00
if ( args . ArgC ( ) < 2 )
2021-12-25 22:36:38 +01:00
{
return ;
}
2022-03-02 02:03:46 +01:00
for ( int i = 0 ; i < MAX_PLAYERS ; i + + )
2021-12-25 22:36:38 +01:00
{
2022-04-02 02:48:54 +02:00
CBaseClient * pClient = g_pClient - > GetClient ( i ) ;
CNetChan * pNetChan = pClient - > GetNetChan ( ) ;
2021-12-25 22:36:38 +01:00
2022-04-02 02:48:54 +02:00
if ( ! pClient | | ! pNetChan )
2021-12-25 22:36:38 +01:00
{
continue ;
}
2022-04-06 00:49:17 +02:00
std : : string svClientName = pNetChan - > GetName ( ) ; // Get full name.
2021-12-25 22:36:38 +01:00
2022-03-02 02:03:46 +01:00
if ( svClientName . empty ( ) )
2021-12-25 22:36:38 +01:00
{
continue ;
}
2022-03-02 02:03:46 +01:00
if ( strcmp ( args . Arg ( 1 ) , svClientName . c_str ( ) ) ! = 0 )
2021-12-25 22:36:38 +01:00
{
continue ;
}
2022-04-02 02:48:54 +02:00
std : : string svIpAddress = pNetChan - > GetAddress ( ) ; // If this stays empty they modified the packet somehow.
2021-12-25 22:36:38 +01:00
2022-04-02 02:48:54 +02:00
g_pBanSystem - > AddEntry ( svIpAddress , pClient - > GetOriginID ( ) ) ;
2022-03-02 02:03:46 +01:00
g_pBanSystem - > Save ( ) ;
2022-04-02 02:48:54 +02:00
NET_DisconnectClient ( pClient , i , " Banned from Server " , 0 , 1 ) ;
2021-12-25 22:36:38 +01:00
}
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_BanID_f_CompletionFunc
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _BanID_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-03-02 02:03:46 +01:00
if ( args . ArgC ( ) < 2 )
2021-12-25 22:36:38 +01:00
{
return ;
}
try
{
2022-04-02 02:48:54 +02:00
bool bOnlyDigits = args . HasOnlyDigits ( 1 ) ;
2022-03-02 02:03:46 +01:00
for ( int i = 0 ; i < MAX_PLAYERS ; i + + )
2021-12-25 22:36:38 +01:00
{
2022-04-02 02:48:54 +02:00
CBaseClient * pClient = g_pClient - > GetClient ( i ) ;
CNetChan * pNetChan = pClient - > GetNetChan ( ) ;
2021-12-25 22:36:38 +01:00
2022-04-02 02:48:54 +02:00
if ( ! pClient | | ! pNetChan )
2021-12-25 22:36:38 +01:00
{
continue ;
}
2022-04-02 02:48:54 +02:00
std : : string svIpAddress = pNetChan - > GetAddress ( ) ; // If this stays empty they modified the packet somehow.
2021-12-25 22:36:38 +01:00
2022-04-02 02:48:54 +02:00
if ( bOnlyDigits )
2021-12-25 22:36:38 +01:00
{
2022-04-02 02:48:54 +02:00
std : : int64_t nTargetID = static_cast < std : : int64_t > ( std : : stoll ( args . Arg ( 1 ) ) ) ;
if ( nTargetID > MAX_PLAYERS ) // Is it a possible originID?
2021-12-25 22:36:38 +01:00
{
2022-04-02 02:48:54 +02:00
std : : int64_t nOriginID = pClient - > GetOriginID ( ) ;
if ( nOriginID ! = nTargetID )
2021-12-25 22:36:38 +01:00
{
continue ;
}
}
else // If its not try by userID.
{
2022-04-02 02:48:54 +02:00
std : : int64_t nClientID = static_cast < std : : int64_t > ( pClient - > GetUserID ( ) + 1 ) ; // Get UserID + 1.
if ( nClientID ! = nTargetID )
2021-12-25 22:36:38 +01:00
{
continue ;
}
}
2022-04-02 02:48:54 +02:00
g_pBanSystem - > AddEntry ( svIpAddress , pClient - > GetOriginID ( ) ) ;
2022-03-02 02:03:46 +01:00
g_pBanSystem - > Save ( ) ;
2022-04-02 02:48:54 +02:00
NET_DisconnectClient ( pClient , i , " Banned from Server " , 0 , 1 ) ;
2021-12-25 22:36:38 +01:00
}
else
{
2022-04-02 02:48:54 +02:00
if ( std : : string ( args . Arg ( 1 ) ) . compare ( svIpAddress ) ! = NULL )
2021-12-25 22:36:38 +01:00
{
continue ;
}
2022-04-02 02:48:54 +02:00
g_pBanSystem - > AddEntry ( svIpAddress , pClient - > GetOriginID ( ) ) ;
2022-03-02 02:03:46 +01:00
g_pBanSystem - > Save ( ) ;
2022-04-02 02:48:54 +02:00
NET_DisconnectClient ( pClient , i , " Banned from Server " , 0 , 1 ) ;
2021-12-25 22:36:38 +01:00
}
}
}
catch ( std : : exception & e )
{
2022-03-04 15:59:33 +01:00
Error ( eDLL_T : : SERVER , " Banid Error: %s " , e . what ( ) ) ;
2021-12-25 22:36:38 +01:00
return ;
}
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_Unban_f_CompletionFunc
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _Unban_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-03-02 02:03:46 +01:00
if ( args . ArgC ( ) < 2 )
2021-12-25 22:36:38 +01:00
{
return ;
}
try
{
2022-03-28 18:47:11 +02:00
if ( args . HasOnlyDigits ( 1 ) ) // Check if we have an ip address or origin ID.
2021-12-25 22:36:38 +01:00
{
2022-03-02 02:03:46 +01:00
g_pBanSystem - > DeleteEntry ( " noIP " , std : : stoll ( args . Arg ( 1 ) ) ) ; // Delete ban entry.
2021-12-25 22:36:38 +01:00
g_pBanSystem - > Save ( ) ; // Save modified vector to file.
}
else
{
2022-03-02 02:03:46 +01:00
g_pBanSystem - > DeleteEntry ( args . Arg ( 1 ) , 1 ) ; // Delete ban entry.
2021-12-25 22:36:38 +01:00
g_pBanSystem - > Save ( ) ; // Save modified vector to file.
}
}
catch ( std : : exception & e )
{
2022-03-04 15:59:33 +01:00
Error ( eDLL_T : : SERVER , " Unban Error: %s " , e . what ( ) ) ;
2021-12-25 22:36:38 +01:00
return ;
}
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_ReloadBanList_f_CompletionFunc
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _ReloadBanList_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
g_pBanSystem - > Load ( ) ; // Reload banlist.
}
2022-03-23 20:31:29 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_Pak_ListPaks_f_CompletionFunc
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-28 18:47:11 +02:00
void _Pak_ListPaks_f_CompletionFunc ( const CCommand & args )
2022-03-23 20:31:29 +01:00
{
# ifdef GAMEDLL_S3
2022-03-28 18:47:11 +02:00
DevMsg ( eDLL_T : : RTECH , " | id | name | status | asset count | \n " ) ;
DevMsg ( eDLL_T : : RTECH , " |----|----------------------------------------------------|--------------------------------------|-------------| \n " ) ;
2022-03-23 20:31:29 +01:00
std : : uint32_t nActuallyLoaded = 0 ;
for ( int i = 0 ; i < * s_pLoadedPakCount ; + + i )
{
RPakLoadedInfo_t info = g_pLoadedPakInfo [ i ] ;
if ( info . m_nStatus = = RPakStatus_t : : PAK_STATUS_FREED )
continue ;
std : : string rpakStatus = " RPAK_CREATED_A_NEW_STATUS_SOMEHOW " ;
auto it = RPakStatusToString . find ( info . m_nStatus ) ;
if ( it ! = RPakStatusToString . end ( ) )
rpakStatus = it - > second ;
// todo: make status into a string from an array/vector
2022-03-28 18:47:11 +02:00
DevMsg ( eDLL_T : : RTECH , " | %02i | %-50s | %-36s | %11i | \n " , info . m_nPakId , info . m_pszFileName , rpakStatus . c_str ( ) , info . m_nAssetCount ) ;
2022-03-23 20:31:29 +01:00
nActuallyLoaded + + ;
}
2022-03-28 18:47:11 +02:00
DevMsg ( eDLL_T : : RTECH , " |----|----------------------------------------------------|--------------------------------------|-------------| \n " ) ;
DevMsg ( eDLL_T : : RTECH , " | %16i loaded paks. | \n " , nActuallyLoaded ) ;
DevMsg ( eDLL_T : : RTECH , " |----|----------------------------------------------------|--------------------------------------|-------------| \n " ) ;
# endif // GAMEDLL_S3
2022-03-23 20:31:29 +01:00
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
2022-03-28 18:47:11 +02:00
_Pak_RequestUnload_f_CompletionFunc
2022-02-14 23:16:24 +01:00
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-28 18:47:11 +02:00
void _Pak_RequestUnload_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-03-28 18:47:11 +02:00
# ifdef GAMEDLL_S3
2022-03-02 02:03:46 +01:00
if ( args . ArgC ( ) < 2 )
2021-12-25 22:36:38 +01:00
{
return ;
}
2022-03-28 18:47:11 +02:00
try
{
if ( args . HasOnlyDigits ( 1 ) )
{
int nPakId = std : : stoi ( args . Arg ( 1 ) ) ;
RPakLoadedInfo_t pakInfo = g_pRTech - > GetPakLoadedInfo ( nPakId ) ;
pakInfo . m_pszFileName ? DevMsg ( eDLL_T : : RTECH , " Requested Pak Unload for '%s' \n " , pakInfo . m_pszFileName ) : DevMsg ( eDLL_T : : RTECH , " Requested Pak Unload for '%d' \n " , nPakId ) ;
2022-04-18 03:35:08 +02:00
CPakFile_UnloadPak ( nPakId ) ;
2022-03-28 18:47:11 +02:00
}
else
{
throw std : : exception ( " Please provide a number as an arg. " ) ;
}
}
catch ( std : : exception & e )
{
Error ( eDLL_T : : RTECH , " RequestUnload Error: %s " , e . what ( ) ) ;
return ;
}
# endif // GAMEDLL_S3
}
2021-12-25 22:36:38 +01:00
2022-03-28 18:47:11 +02:00
/*
= = = = = = = = = = = = = = = = = = = = =
_Pak_RequestLoad_f_CompletionFunc
= = = = = = = = = = = = = = = = = = = = =
*/
void _Pak_RequestLoad_f_CompletionFunc ( const CCommand & args )
{
2022-04-18 03:35:08 +02:00
HPakFile_AsyncLoad ( args . Arg ( 1 ) ) ;
2021-12-25 22:36:38 +01:00
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
2022-03-28 18:47:11 +02:00
_RTech_StringToGUID_f_CompletionFunc
2022-02-14 23:16:24 +01:00
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-28 18:47:11 +02:00
void _RTech_StringToGUID_f_CompletionFunc ( const CCommand & args )
2021-12-27 16:53:35 +01:00
{
2022-03-28 18:47:11 +02:00
if ( args . ArgC ( ) < 2 )
{
return ;
}
unsigned long long guid = g_pRTech - > StringToGuid ( args . Arg ( 1 ) ) ;
DevMsg ( eDLL_T : : RTECH , " ______________________________________________________________ \n " ) ;
DevMsg ( eDLL_T : : RTECH , " ] RTECH_HASH ------------------------------------------------- \n " ) ;
DevMsg ( eDLL_T : : RTECH , " ] GUID: '0x%llX' \n " , guid ) ;
2021-12-27 16:53:35 +01:00
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_RTech_Decompress_f_CompletionFunc
Decompresses input RPak file and
dumps results to ' paks \ Win32 \ * . rpak '
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _RTech_Decompress_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-03-02 02:03:46 +01:00
if ( args . ArgC ( ) < 2 )
2021-12-25 22:36:38 +01:00
{
return ;
}
2022-02-13 17:07:02 +01:00
const std : : string modDir = " paks \\ Win32 \\ " ;
const std : : string baseDir = " paks \\ Win64 \\ " ;
2021-12-25 22:36:38 +01:00
2022-03-02 02:03:46 +01:00
std : : string pakNameOut = modDir + args . Arg ( 1 ) + " .rpak " ;
std : : string pakNameIn = baseDir + args . Arg ( 1 ) + " .rpak " ;
2021-12-25 22:36:38 +01:00
2022-02-13 17:07:02 +01:00
CreateDirectories ( pakNameOut ) ;
2021-12-26 02:30:20 +01:00
2021-12-25 22:36:38 +01:00
DevMsg ( eDLL_T : : RTECH , " ______________________________________________________________ \n " ) ;
DevMsg ( eDLL_T : : RTECH , " ] RTECH_DECOMPRESS ------------------------------------------- \n " ) ;
2022-02-13 17:07:02 +01:00
if ( ! FileExists ( pakNameIn . c_str ( ) ) )
2021-12-25 22:36:38 +01:00
{
2022-03-04 15:59:33 +01:00
Error ( eDLL_T : : RTECH , " Error: pak file '%s' does not exist! \n " , pakNameIn . c_str ( ) ) ;
2021-12-25 22:36:38 +01:00
return ;
}
2022-02-13 17:07:02 +01:00
DevMsg ( eDLL_T : : RTECH , " ] Processing: '%s' \n " , pakNameIn . c_str ( ) ) ;
2021-12-25 22:36:38 +01:00
std : : vector < std : : uint8_t > upak ; // Compressed region.
2022-02-13 17:07:02 +01:00
std : : ifstream ipak ( pakNameIn , std : : fstream : : binary ) ;
2021-12-25 22:36:38 +01:00
ipak . seekg ( 0 , std : : fstream : : end ) ;
upak . resize ( ipak . tellg ( ) ) ;
ipak . seekg ( 0 , std : : fstream : : beg ) ;
ipak . read ( ( char * ) upak . data ( ) , upak . size ( ) ) ;
2022-02-13 17:13:54 +01:00
RPakHeader_t * rheader = ( RPakHeader_t * ) upak . data ( ) ;
2021-12-25 22:36:38 +01:00
uint16_t flags = ( rheader - > m_nFlags [ 0 ] < < 8 ) | rheader - > m_nFlags [ 1 ] ;
DevMsg ( eDLL_T : : RTECH , " ______________________________________________________________ \n " ) ;
DevMsg ( eDLL_T : : RTECH , " ] HEADER_DETAILS --------------------------------------------- \n " ) ;
DevMsg ( eDLL_T : : RTECH , " ] Magic : '%08X' \n " , rheader - > m_nMagic ) ;
2022-04-05 11:33:37 +02:00
DevMsg ( eDLL_T : : RTECH , " ] Version : '%u' \n " , rheader - > m_nVersion ) ;
DevMsg ( eDLL_T : : RTECH , " ] Flags : '%04X' \n " , flags ) ;
2021-12-25 22:36:38 +01:00
DevMsg ( eDLL_T : : RTECH , " ] Hash : '%llu' \n " , rheader - > m_nHash ) ;
DevMsg ( eDLL_T : : RTECH , " ] Entries : '%zu' \n " , rheader - > m_nAssetEntryCount ) ;
DevMsg ( eDLL_T : : RTECH , " ______________________________________________________________ \n " ) ;
DevMsg ( eDLL_T : : RTECH , " ] COMPRESSION_DETAILS ---------------------------------------- \n " ) ;
DevMsg ( eDLL_T : : RTECH , " ] Size disk: '%lld' \n " , rheader - > m_nSizeDisk ) ;
DevMsg ( eDLL_T : : RTECH , " ] Size decp: '%lld' \n " , rheader - > m_nSizeMemory ) ;
DevMsg ( eDLL_T : : RTECH , " ] Ratio : '%.02f' \n " , ( rheader - > m_nSizeDisk * 100.f ) / rheader - > m_nSizeMemory ) ;
if ( rheader - > m_nMagic ! = ' kaPR ' )
{
2022-03-04 15:59:33 +01:00
Error ( eDLL_T : : RTECH , " Error: pak file '%s' has invalid magic! \n " , pakNameIn . c_str ( ) ) ;
2021-12-25 22:36:38 +01:00
return ;
}
if ( ( rheader - > m_nFlags [ 1 ] & 1 ) ! = 1 )
{
2022-03-04 15:59:33 +01:00
Error ( eDLL_T : : RTECH , " Error: pak file '%s' already decompressed! \n " , pakNameIn . c_str ( ) ) ;
2021-12-25 22:36:38 +01:00
return ;
}
if ( rheader - > m_nSizeDisk ! = upak . size ( ) )
{
2022-04-05 11:33:37 +02:00
Error ( eDLL_T : : RTECH , " Error: pak file '%s' decompressed size '%zu' doesn't match expected value '%zu'! \n " , pakNameIn . c_str ( ) , upak . size ( ) , rheader - > m_nSizeMemory ) ;
2021-12-25 22:36:38 +01:00
return ;
}
2022-02-13 17:07:02 +01:00
RPakDecompState_t state ;
2022-03-28 18:47:11 +02:00
std : : uint32_t decompSize = g_pRTech - > DecompressPakFileInit ( & state , upak . data ( ) , upak . size ( ) , 0 , PAK_HEADER_SIZE ) ;
2021-12-25 22:36:38 +01:00
2022-02-13 17:07:02 +01:00
if ( decompSize = = rheader - > m_nSizeDisk )
2021-12-25 22:36:38 +01:00
{
2022-03-04 15:59:33 +01:00
Error ( eDLL_T : : RTECH , " Error: calculated size: '%zu' expected: '%zu'! \n " , decompSize , rheader - > m_nSizeMemory ) ;
2021-12-25 22:36:38 +01:00
return ;
}
else
{
2022-02-13 17:07:02 +01:00
DevMsg ( eDLL_T : : RTECH , " ] Calculated size: '%zu' \n " , decompSize ) ;
2021-12-25 22:36:38 +01:00
}
2022-02-13 17:07:02 +01:00
std : : vector < std : : uint8_t > pakBuf ( rheader - > m_nSizeMemory , 0 ) ;
2021-12-25 22:36:38 +01:00
2021-12-26 02:30:20 +01:00
state . m_nOutMask = UINT64_MAX ;
2022-02-13 17:07:02 +01:00
state . m_nOut = uint64_t ( pakBuf . data ( ) ) ;
2021-12-25 22:36:38 +01:00
2022-03-28 18:47:11 +02:00
std : : uint8_t decompResult = g_pRTech - > DecompressPakFile ( & state , upak . size ( ) , pakBuf . size ( ) ) ;
2022-02-13 17:07:02 +01:00
if ( decompResult ! = 1 )
2021-12-25 22:36:38 +01:00
{
2022-03-04 15:59:33 +01:00
Error ( eDLL_T : : RTECH , " Error: decompression failed for '%s' return value: '%u'! \n " , pakNameIn . c_str ( ) , + decompResult ) ;
2021-12-25 22:36:38 +01:00
return ;
}
2022-03-02 02:03:46 +01:00
rheader - > m_nFlags [ 1 ] = 0x0 ; // Set compressed flag to false for the decompressed pak file.
rheader - > m_nSizeDisk = rheader - > m_nSizeMemory ; // Equal compressed size with decompressed.
2021-12-25 22:36:38 +01:00
2022-02-13 17:07:02 +01:00
std : : ofstream outBlock ( pakNameOut , std : : fstream : : binary ) ;
2021-12-25 22:36:38 +01:00
2021-12-27 20:44:37 +01:00
if ( rheader - > m_nPatchIndex > 0 ) // Check if its an patch rpak.
{
2021-12-27 21:30:04 +01:00
// Loop through all the structs and patch their compress size.
2022-02-13 17:07:02 +01:00
for ( int i = 1 , patch_offset = 0x88 ; i < = rheader - > m_nPatchIndex ; i + + , patch_offset + = sizeof ( RPakPatchCompressedHeader_t ) )
2021-12-27 20:44:37 +01:00
{
2022-02-13 17:07:02 +01:00
RPakPatchCompressedHeader_t * patch_header = ( RPakPatchCompressedHeader_t * ) ( ( std : : uintptr_t ) pakBuf . data ( ) + patch_offset ) ;
2021-12-27 21:30:04 +01:00
patch_header - > m_nSizeDisk = patch_header - > m_nSizeMemory ; // Fix size for decompress.
2021-12-27 20:44:37 +01:00
}
}
2022-02-13 17:07:02 +01:00
memcpy_s ( pakBuf . data ( ) , state . m_nDecompSize , ( ( std : : uint8_t * ) rheader ) , PAK_HEADER_SIZE ) ; // Overwrite first 0x80 bytes which are NULL with the header data.
2021-12-26 02:30:20 +01:00
2022-02-13 17:07:02 +01:00
outBlock . write ( ( char * ) pakBuf . data ( ) , state . m_nDecompSize ) ;
2021-12-25 22:36:38 +01:00
2021-12-26 02:30:20 +01:00
uint32_t crc32_init = { } ;
2022-02-13 17:07:02 +01:00
DevMsg ( eDLL_T : : RTECH , " ] CRC32 : '%08X' \n " , crc32 : : update ( crc32_init , pakBuf . data ( ) , state . m_nDecompSize ) ) ;
DevMsg ( eDLL_T : : RTECH , " ] Decompressed rpak to: '%s' \n " , pakNameOut . c_str ( ) ) ;
2021-12-25 22:36:38 +01:00
DevMsg ( eDLL_T : : RTECH , " -------------------------------------------------------------- \n " ) ;
2021-12-26 02:30:20 +01:00
2022-02-13 17:07:02 +01:00
outBlock . close ( ) ;
2021-12-25 22:36:38 +01:00
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_NET_TraceNetChan_f_CompletionFunc
Logs all data transmitted and received
over the UDP socket to a file on the disk .
File : ' < mod \ logs \ net_trace . log > ' .
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _NET_TraceNetChan_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
static bool bTraceNetChannel = false ;
if ( ! bTraceNetChannel )
{
2022-04-14 19:18:59 +02:00
net_usesocketsforloopback - > SetValue ( 1 ) ;
2021-12-25 22:36:38 +01:00
DevMsg ( eDLL_T : : ENGINE , " \n " ) ;
DevMsg ( eDLL_T : : ENGINE , " +--------------------------------------------------------+ \n " ) ;
DevMsg ( eDLL_T : : ENGINE , " |>>>>>>>>>>>>>| NETCHANNEL TRACE ACTIVATED |<<<<<<<<<<<<<| \n " ) ;
DevMsg ( eDLL_T : : ENGINE , " +--------------------------------------------------------+ \n " ) ;
DevMsg ( eDLL_T : : ENGINE , " \n " ) ;
2022-03-02 02:03:46 +01:00
// Begin the detour transaction to hook the the process.
2021-12-25 22:36:38 +01:00
DetourTransactionBegin ( ) ;
DetourUpdateThread ( GetCurrentThread ( ) ) ;
2022-04-02 02:48:54 +02:00
NET_Trace_Attach ( ) ;
2022-03-02 02:03:46 +01:00
// Commit the transaction.
2021-12-25 22:36:38 +01:00
if ( DetourTransactionCommit ( ) ! = NO_ERROR )
{
2022-03-02 02:03:46 +01:00
// Failed to hook into the process, terminate.
2021-12-25 22:36:38 +01:00
TerminateProcess ( GetCurrentProcess ( ) , 0xBAD0C0DE ) ;
}
}
else
{
DevMsg ( eDLL_T : : ENGINE , " \n " ) ;
DevMsg ( eDLL_T : : ENGINE , " +--------------------------------------------------------+ \n " ) ;
DevMsg ( eDLL_T : : ENGINE , " |>>>>>>>>>>>>| NETCHANNEL TRACE DEACTIVATED |<<<<<<<<<<<<| \n " ) ;
DevMsg ( eDLL_T : : ENGINE , " +--------------------------------------------------------+ \n " ) ;
DevMsg ( eDLL_T : : ENGINE , " \n " ) ;
2022-03-02 02:03:46 +01:00
// Begin the detour transaction to hook the the process.
2021-12-25 22:36:38 +01:00
DetourTransactionBegin ( ) ;
DetourUpdateThread ( GetCurrentThread ( ) ) ;
2022-04-02 02:48:54 +02:00
NET_Trace_Detach ( ) ;
2021-12-25 22:36:38 +01:00
2022-03-02 02:03:46 +01:00
// Commit the transaction.
2021-12-25 22:36:38 +01:00
DetourTransactionCommit ( ) ;
}
bTraceNetChannel = ! bTraceNetChannel ;
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_VPK_Decompress_f_CompletionFunc
Decompresses input VPK files and
dumps the output to ' < mod > \ vpk ' .
= = = = = = = = = = = = = = = = = = = = =
*/
2022-04-09 00:59:42 +02:00
void _VPK_Unpack_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-03-02 02:03:46 +01:00
if ( args . ArgC ( ) < 2 )
2021-12-25 22:36:38 +01:00
{
return ;
}
std : : string szPathOut = " platform \\ vpk " ;
std : : chrono : : milliseconds msStart = std : : chrono : : duration_cast < std : : chrono : : milliseconds > ( std : : chrono : : system_clock : : now ( ) . time_since_epoch ( ) ) ;
DevMsg ( eDLL_T : : FS , " ______________________________________________________________ \n " ) ;
DevMsg ( eDLL_T : : FS , " ] FS_DECOMPRESS ---------------------------------------------- \n " ) ;
2022-03-02 02:03:46 +01:00
DevMsg ( eDLL_T : : FS , " ] Processing: '%s' \n " , args . Arg ( 1 ) ) ;
2021-12-25 22:36:38 +01:00
2022-04-09 00:59:42 +02:00
VPKDir_t vpk = g_pPackedStore - > GetPackDirFile ( args . Arg ( 1 ) ) ;
2022-02-06 15:59:46 +01:00
g_pPackedStore - > InitLzDecompParams ( ) ;
2021-12-25 22:36:38 +01:00
std : : thread th ( [ & ] { g_pPackedStore - > UnpackAll ( vpk , szPathOut ) ; } ) ;
th . join ( ) ;
std : : chrono : : milliseconds msEnd = std : : chrono : : duration_cast < std : : chrono : : milliseconds > ( std : : chrono : : system_clock : : now ( ) . time_since_epoch ( ) ) ;
float duration = msEnd . count ( ) - msStart . count ( ) ;
DevMsg ( eDLL_T : : FS , " ______________________________________________________________ \n " ) ;
DevMsg ( eDLL_T : : FS , " ] OPERATION_DETAILS ------------------------------------------ \n " ) ;
DevMsg ( eDLL_T : : FS , " ] Time elapsed: '%.3f' seconds \n " , ( duration / 1000 ) ) ;
DevMsg ( eDLL_T : : FS , " ] Decompressed vpk to: '%s' \n " , szPathOut . c_str ( ) ) ;
DevMsg ( eDLL_T : : FS , " -------------------------------------------------------------- \n " ) ;
}
2022-04-09 00:59:42 +02:00
/*
= = = = = = = = = = = = = = = = = = = = =
_VPK_Mount_f_CompletionFunc
Mounts input VPK file for
internal FileSystem usage
= = = = = = = = = = = = = = = = = = = = =
*/
void _VPK_Mount_f_CompletionFunc ( const CCommand & args )
{
if ( args . ArgC ( ) < 2 )
{
return ;
}
if ( g_pFileSystem_Stdio )
{
VPKData_t * pPakData = g_pFileSystem_Stdio - > MountVPK ( args . Arg ( 1 ) ) ;
if ( pPakData )
{
DevMsg ( eDLL_T : : FS , " Mounted VPK file '%s' with handle '%d' \n " , args . Arg ( 1 ) , pPakData - > m_nHandle ) ;
}
else
{
Warning ( eDLL_T : : FS , " Unable to mount VPK file '%s': non-existent VPK file \n " , args . Arg ( 1 ) ) ;
}
}
else
{
Warning ( eDLL_T : : FS , " Unable to mount VPK file '%s': '%s' is not initalized \n " , args . Arg ( 1 ) , VAR_NAME ( g_pFileSystem ) ) ;
}
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_NET_SetKey_f_CompletionFunc
Sets the input netchannel encryption key
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _NET_SetKey_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-03-04 12:22:17 +01:00
if ( args . ArgC ( ) < 2 )
2021-12-25 22:36:38 +01:00
{
return ;
}
2022-04-02 02:48:54 +02:00
NET_SetKey ( args . Arg ( 1 ) ) ;
2021-12-25 22:36:38 +01:00
}
2022-02-14 23:16:24 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_NET_GenerateKey_f_CompletionFunc
Sets a random netchannel encryption key
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _NET_GenerateKey_f_CompletionFunc ( const CCommand & args )
2021-12-25 22:36:38 +01:00
{
2022-04-02 02:48:54 +02:00
NET_GenerateKey ( ) ;
2021-12-25 22:36:38 +01:00
}
2022-02-14 23:16:24 +01:00
# ifndef DEDICATED
/*
= = = = = = = = = = = = = = = = = = = = =
_RCON_CmdQuery_f_CompletionFunc
Issues an RCON command to the
RCON server .
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _RCON_CmdQuery_f_CompletionFunc ( const CCommand & args )
2022-02-06 15:59:46 +01:00
{
2022-03-02 02:03:46 +01:00
switch ( args . ArgC ( ) )
2022-02-14 23:16:24 +01:00
{
case 0 :
case 1 :
{
if ( g_pRConClient - > IsInitialized ( )
& & ! g_pRConClient - > IsConnected ( )
& & strlen ( rcon_address - > GetString ( ) ) > 0 )
{
g_pRConClient - > Connect ( ) ;
}
break ;
}
case 2 :
{
if ( ! g_pRConClient - > IsInitialized ( ) )
{
2022-03-04 15:59:33 +01:00
Warning ( eDLL_T : : CLIENT , " Failed to issue command to RCON server: uninitialized \n " ) ;
2022-02-14 23:16:24 +01:00
break ;
}
2022-02-15 02:31:41 +01:00
else if ( g_pRConClient - > IsConnected ( ) )
{
2022-03-02 02:03:46 +01:00
if ( strcmp ( args . Arg ( 1 ) , " PASS " ) = = 0 ) // Auth with RCON server using rcon_password ConVar value.
2022-02-15 02:31:41 +01:00
{
2022-03-02 02:03:46 +01:00
std : : string svCmdQuery = g_pRConClient - > Serialize ( args . Arg ( 1 ) , rcon_password - > GetString ( ) , cl_rcon : : request_t : : SERVERDATA_REQUEST_EXECCOMMAND ) ;
2022-02-15 02:31:41 +01:00
g_pRConClient - > Send ( svCmdQuery ) ;
break ;
}
2022-03-02 02:03:46 +01:00
else if ( strcmp ( args . Arg ( 1 ) , " disconnect " ) = = 0 ) // Disconnect from RCON server.
2022-02-15 02:31:41 +01:00
{
g_pRConClient - > Disconnect ( ) ;
break ;
}
2022-02-14 23:16:24 +01:00
2022-03-02 02:03:46 +01:00
std : : string svCmdQuery = g_pRConClient - > Serialize ( args . Arg ( 1 ) , " " , cl_rcon : : request_t : : SERVERDATA_REQUEST_EXECCOMMAND ) ;
2022-02-15 02:31:41 +01:00
g_pRConClient - > Send ( svCmdQuery ) ;
break ;
}
else
2022-02-14 23:16:24 +01:00
{
2022-03-04 15:59:33 +01:00
Warning ( eDLL_T : : CLIENT , " Failed to issue command to RCON server: unconnected \n " ) ;
2022-02-14 23:16:24 +01:00
break ;
}
break ;
}
case 3 :
{
2022-02-15 02:31:41 +01:00
if ( g_pRConClient - > IsConnected ( ) )
2022-02-14 23:16:24 +01:00
{
2022-03-02 02:03:46 +01:00
if ( strcmp ( args . Arg ( 1 ) , " PASS " ) = = 0 ) // Auth with RCON server.
2022-02-15 02:31:41 +01:00
{
2022-03-02 02:03:46 +01:00
std : : string svCmdQuery = g_pRConClient - > Serialize ( args . Arg ( 1 ) , args . Arg ( 2 ) , cl_rcon : : request_t : : SERVERDATA_REQUEST_AUTH ) ;
2022-02-15 02:31:41 +01:00
g_pRConClient - > Send ( svCmdQuery ) ;
break ;
}
2022-02-14 23:16:24 +01:00
2022-03-02 02:03:46 +01:00
std : : string svCmdQuery = g_pRConClient - > Serialize ( args . Arg ( 1 ) , args . Arg ( 2 ) , cl_rcon : : request_t : : SERVERDATA_REQUEST_SETVALUE ) ;
2022-02-15 02:31:41 +01:00
g_pRConClient - > Send ( svCmdQuery ) ;
2022-02-14 23:16:24 +01:00
break ;
}
2022-02-15 02:31:41 +01:00
else
2022-02-14 23:16:24 +01:00
{
2022-03-04 15:59:33 +01:00
Warning ( eDLL_T : : CLIENT , " Failed to issue command to RCON server: unconnected \n " ) ;
2022-02-14 23:16:24 +01:00
break ;
}
break ;
}
}
2022-02-06 15:59:46 +01:00
}
2022-02-24 16:44:33 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_RCON_CmdQuery_f_CompletionFunc
Disconnect from RCON server
= = = = = = = = = = = = = = = = = = = = =
*/
2022-03-02 02:03:46 +01:00
void _RCON_Disconnect_f_CompletionFunc ( const CCommand & args )
2022-02-24 16:44:33 +01:00
{
if ( g_pRConClient - > IsConnected ( ) )
{
g_pRConClient - > Disconnect ( ) ;
DevMsg ( eDLL_T : : CLIENT , " User closed RCON connection \n " ) ;
}
}
2022-02-14 23:16:24 +01:00
# endif // !DEDICATED
2022-03-18 13:47:22 +01:00
2022-03-30 22:54:33 +02:00
/*
= = = = = = = = = = = = = = = = = = = = =
_SQVM_ServerScript_f_CompletionFunc
Exectutes input on the
VM in SERVER context .
= = = = = = = = = = = = = = = = = = = = =
*/
void _SQVM_ServerScript_f_CompletionFunc ( const CCommand & args )
{
if ( args . ArgC ( ) < 2 )
{
return ;
}
SQVM_Execute ( args . Arg ( 1 ) , SQCONTEXT : : SERVER ) ;
}
2022-03-18 13:47:22 +01:00
# ifndef DEDICATED
2022-03-30 22:54:33 +02:00
/*
= = = = = = = = = = = = = = = = = = = = =
_SQVM_ClientScript_f_CompletionFunc
Exectutes input on the
VM in CLIENT context .
= = = = = = = = = = = = = = = = = = = = =
*/
void _SQVM_ClientScript_f_CompletionFunc ( const CCommand & args )
{
if ( args . ArgC ( ) < 2 )
{
return ;
}
SQVM_Execute ( args . Arg ( 1 ) , SQCONTEXT : : CLIENT ) ;
}
/*
= = = = = = = = = = = = = = = = = = = = =
_SQVM_UIScript_f_CompletionFunc
Exectutes input on the
VM in UI context .
= = = = = = = = = = = = = = = = = = = = =
*/
void _SQVM_UIScript_f_CompletionFunc ( const CCommand & args )
{
if ( args . ArgC ( ) < 2 )
{
return ;
}
SQVM_Execute ( args . Arg ( 1 ) , SQCONTEXT : : UI ) ;
}
2022-03-18 13:47:22 +01:00
/*
= = = = = = = = = = = = = = = = = = = = =
_IMaterial_GetMaterialAtCrossHair_f_CompletionFunc
Print the material under the crosshair .
= = = = = = = = = = = = = = = = = = = = =
*/
void _CMaterial_GetMaterialAtCrossHair_f_ComplectionFunc ( const CCommand & args )
{
2022-03-18 18:34:27 +01:00
# if defined (GAMEDLL_S3) // [ PIXIE ]: Verification needed for earlier seasons if CMaterialGlue matches.
CMaterialGlue * material = GetMaterialAtCrossHair ( ) ;
2022-03-18 13:47:22 +01:00
if ( material )
{
2022-03-18 18:34:27 +01:00
DevMsg ( eDLL_T : : MS , " ______________________________________________________________ \n " ) ;
DevMsg ( eDLL_T : : MS , " ] MATERIAL DETAILS ------------------------------------------- \n " ) ;
DevMsg ( eDLL_T : : MS , " ] ADDR: '%llX' \n " , material ) ;
DevMsg ( eDLL_T : : MS , " ] GUID: '%llX' \n " , material - > m_GUID ) ;
2022-03-18 21:38:57 +01:00
DevMsg ( eDLL_T : : MS , " ] UnknownSignature: '%d' \n " , material - > m_UnknownSignature ) ;
DevMsg ( eDLL_T : : MS , " ] Material Width: '%d' \n " , material - > m_iWidth ) ;
DevMsg ( eDLL_T : : MS , " ] Material Height: '%d' \n " , material - > m_iHeight ) ;
DevMsg ( eDLL_T : : MS , " ] Flags: '%llX' \n " , material - > m_iFlags ) ;
2022-03-18 18:34:27 +01:00
std : : function < void ( CMaterialGlue * , const char * ) > fnPrintChild = [ ] ( CMaterialGlue * material , const char * print )
{
DevMsg ( eDLL_T : : MS , " ]___________________________________________________________ \n " ) ;
DevMsg ( eDLL_T : : MS , " ] CHILD DETAILS -------------------------------------------- \n " ) ;
DevMsg ( eDLL_T : : MS , print , material ) ;
DevMsg ( eDLL_T : : MS , " ] GUID: '%llX' \n " , material - > m_GUID ) ;
if ( material - > m_pszName )
{
DevMsg ( eDLL_T : : MS , " ] Material Name: '%s' \n " , material - > m_pszName ) ;
}
else
{
DevMsg ( eDLL_T : : MS , " ] Material Name: 'NULL' \n " ) ;
}
DevMsg ( eDLL_T : : MS , " ]___________________________________________________________ \n " ) ;
} ;
if ( material - > m_pszName )
{
DevMsg ( eDLL_T : : MS , " ] Material Name: '%s' \n " , material - > m_pszName ) ;
}
else
{
DevMsg ( eDLL_T : : MS , " ] Material Name: 'NULL' \n " ) ;
}
if ( material - > m_pszSurfaceName1 )
{
DevMsg ( eDLL_T : : MS , " ] Material Surface Name 1: '%s' \n " , material - > m_pszSurfaceName1 ) ;
}
else
{
DevMsg ( eDLL_T : : MS , " ] Material Surface Name 1: 'NULL' \n " ) ;
}
if ( material - > m_pszSurfaceName2 )
{
DevMsg ( eDLL_T : : MS , " ] Material Surface Name 2: '%s' \n " , material - > m_pszSurfaceName2 ) ;
}
else
{
DevMsg ( eDLL_T : : MS , " ] Material Surface Name 2: 'NULL' \n " ) ;
}
2022-03-18 20:13:28 +01:00
if ( material - > m_ppDXTexture1 )
{
DevMsg ( eDLL_T : : MS , " ] DX Texture 1: '%llX' \n " , material - > m_ppDXTexture1 ) ;
}
else
{
DevMsg ( eDLL_T : : MS , " ] DX Texture 1: 'NULL' \n " ) ;
}
if ( material - > m_ppDXTexture2 )
{
DevMsg ( eDLL_T : : MS , " ] DX Texture 2: '%llX' \n " , material - > m_ppDXTexture2 ) ;
}
else
{
DevMsg ( eDLL_T : : MS , " ] DX Texture 2: 'NULL' \n " ) ;
}
2022-03-18 18:34:27 +01:00
material - > m_pDepthShadow ? fnPrintChild ( material - > m_pDepthShadow , " ] DepthShadow Addr: '%llX' \n " ) : DevMsg ( eDLL_T : : MS , " ] DepthShadow Addr: 'NULL' \n " ) ;
material - > m_pDepthPrepass ? fnPrintChild ( material - > m_pDepthPrepass , " ] DepthPrepass Addr: '%llX' \n " ) : DevMsg ( eDLL_T : : MS , " ] DepthPrepass Addr: 'NULL' \n " ) ;
material - > m_pDepthVSM ? fnPrintChild ( material - > m_pDepthVSM , " ] DepthVSM Addr: '%llX' \n " ) : DevMsg ( eDLL_T : : MS , " ] DepthVSM Addr: 'NULL' \n " ) ;
material - > m_pDepthShadow ? fnPrintChild ( material - > m_pDepthShadow , " ] DepthShadowTight Addr: '%llX' \n " ) : DevMsg ( eDLL_T : : MS , " ] DepthShadowTight Addr: 'NULL' \n " ) ;
material - > m_pColPass ? fnPrintChild ( material - > m_pColPass , " ] ColPass Addr: '%llX' \n " ) : DevMsg ( eDLL_T : : MS , " ] ColPass Addr: 'NULL' \n " ) ;
DevMsg ( eDLL_T : : MS , " ]___________________________________________________________ \n " ) ;
DevMsg ( eDLL_T : : MS , " ] TEXTURE GUID MAP DETAILS --------------------------------- \n " ) ;
material - > m_pTextureGUID1 ? DevMsg ( eDLL_T : : MS , " ] TextureMap 1 Addr: '%llX' \n " , material - > m_pTextureGUID1 ) : DevMsg ( eDLL_T : : MS , " ] TextureMap 1 Addr: 'NULL' \n " ) ;
material - > m_pTextureGUID2 ? DevMsg ( eDLL_T : : MS , " ] TextureMap 2 Addr: '%llX' \n " , material - > m_pTextureGUID2 ) : DevMsg ( eDLL_T : : MS , " ] TextureMap 2 Addr: 'NULL' \n " ) ;
DevMsg ( eDLL_T : : MS , " ]___________________________________________________________ \n " ) ;
DevMsg ( eDLL_T : : MS , " -------------------------------------------------------------- \n " ) ;
2022-03-18 13:47:22 +01:00
}
else
{
2022-03-31 02:26:05 +02:00
DevMsg ( eDLL_T : : MS , " No Material found >:( \n " ) ;
2022-03-18 13:47:22 +01:00
}
# endif
}
# endif // !DEDICATED