mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Eliminate unnecessary uses of ConsoleFunction
This commit is contained in:
parent
6be736ff85
commit
2bbc716db6
12 changed files with 103 additions and 158 deletions
|
|
@ -2722,33 +2722,32 @@ void GameConnection::resetDatablockCache()
|
|||
afx_saved_db_cache_CRC = 0xffffffff;
|
||||
}
|
||||
|
||||
ConsoleFunction(resetDatablockCache, void, 1, 1, "resetDatablockCache()")
|
||||
DefineEngineFunction(resetDatablockCache, void, (),,"")
|
||||
{
|
||||
GameConnection::resetDatablockCache();
|
||||
}
|
||||
|
||||
ConsoleFunction(isDatablockCacheSaved, bool, 1, 1, "resetDatablockCache()")
|
||||
DefineEngineFunction(isDatablockCacheSaved, bool, (),,"")
|
||||
{
|
||||
return afx_saved_db_cache;
|
||||
}
|
||||
|
||||
ConsoleFunction(getDatablockCacheCRC, S32, 1, 1, "getDatablockCacheCRC()")
|
||||
DefineEngineFunction(getDatablockCacheCRC, S32, (),,"")
|
||||
{
|
||||
return (S32)afx_saved_db_cache_CRC;
|
||||
}
|
||||
|
||||
ConsoleFunction(extractDatablockCacheCRC, S32, 2, 2, "extractDatablockCacheCRC(filename)")
|
||||
DefineEngineFunction(extractDatablockCacheCRC, S32, (const char* fileName),,"")
|
||||
{
|
||||
FileStream f_stream;
|
||||
const char* fileName = argv[1];
|
||||
if(!f_stream.open(fileName, Torque::FS::File::Read))
|
||||
if (!f_stream.open(fileName, Torque::FS::File::Read))
|
||||
{
|
||||
Con::errorf("Failed to open file '%s'.", fileName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
U32 stream_sz = f_stream.getStreamSize();
|
||||
if (stream_sz < 4*32)
|
||||
if (stream_sz < 4 * 32)
|
||||
{
|
||||
Con::errorf("File '%s' is not a valid datablock cache.", fileName);
|
||||
f_stream.close();
|
||||
|
|
@ -2777,17 +2776,16 @@ ConsoleFunction(extractDatablockCacheCRC, S32, 2, 2, "extractDatablockCacheCRC(f
|
|||
return (S32)crc_code;
|
||||
}
|
||||
|
||||
ConsoleFunction(setDatablockCacheCRC, void, 2, 2, "setDatablockCacheCRC(crc)")
|
||||
DefineEngineFunction(setDatablockCacheCRC, void, (U32 crc), , "")
|
||||
{
|
||||
GameConnection *conn = GameConnection::getConnectionToServer();
|
||||
if(!conn)
|
||||
if (!conn)
|
||||
return;
|
||||
|
||||
U32 crc_u = (U32)dAtoi(argv[1]);
|
||||
conn->setServerCacheCRC(crc_u);
|
||||
conn->setServerCacheCRC(crc);
|
||||
}
|
||||
|
||||
ConsoleMethod( GameConnection, saveDatablockCache, void, 2, 2, "saveDatablockCache()")
|
||||
DefineEngineMethod(GameConnection, saveDatablockCache, void, (),, "")
|
||||
{
|
||||
if (GameConnection::serverCacheEnabled() && !afx_saved_db_cache)
|
||||
{
|
||||
|
|
@ -2802,14 +2800,14 @@ ConsoleMethod( GameConnection, saveDatablockCache, void, 2, 2, "saveDatablockCac
|
|||
Con::expandScriptFilename(filename_buffer, sizeof(filename_buffer), filename.c_str());
|
||||
Torque::Path givenPath(Torque::Path::CompressPath(filename_buffer));
|
||||
Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(givenPath);
|
||||
if ( fileRef == NULL )
|
||||
if (fileRef == NULL)
|
||||
Con::errorf("saveDatablockCache() failed to get CRC for file '%s'.", filename.c_str());
|
||||
else
|
||||
afx_saved_db_cache_CRC = (S32)fileRef->getChecksum();
|
||||
}
|
||||
}
|
||||
|
||||
ConsoleMethod( GameConnection, loadDatablockCache, void, 2, 2, "loadDatablockCache()")
|
||||
DefineEngineMethod(GameConnection, loadDatablockCache, void, (),, "")
|
||||
{
|
||||
if (GameConnection::clientCacheEnabled())
|
||||
{
|
||||
|
|
@ -2817,7 +2815,7 @@ ConsoleMethod( GameConnection, loadDatablockCache, void, 2, 2, "loadDatablockCac
|
|||
}
|
||||
}
|
||||
|
||||
ConsoleMethod( GameConnection, loadDatablockCache_Begin, bool, 2, 2, "loadDatablockCache_Begin()")
|
||||
DefineEngineMethod(GameConnection, loadDatablockCache_Begin, bool, (),, "")
|
||||
{
|
||||
if (GameConnection::clientCacheEnabled())
|
||||
{
|
||||
|
|
@ -2827,7 +2825,7 @@ ConsoleMethod( GameConnection, loadDatablockCache_Begin, bool, 2, 2, "loadDatabl
|
|||
return false;
|
||||
}
|
||||
|
||||
ConsoleMethod( GameConnection, loadDatablockCache_Continue, bool, 2, 2, "loadDatablockCache_Continue()")
|
||||
DefineEngineMethod(GameConnection, loadDatablockCache_Continue, bool, (),, "")
|
||||
{
|
||||
if (GameConnection::clientCacheEnabled())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue