mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 23:24:41 +00:00
Adds function for sceneObjects to report utilized assets
Add reporting of used assets to tsStatics and TerrData When saving a Scene, it will write static object asset dependencies to it's levelAsset Shifted level loader logic to pass up the levelAsset rather than full level path Made it so when level is loading, the levelAsset loads its dependencies. When the level is ended, as part of cleanup, they are unloaded Shifts defaultEditorLevel to be an actual asset and made the ToolsModule load assets Fixes the Save As action to correctly save out to the new level asset Fixed the autoLoadAssets logic to be cleaner and not manually check types Removed extra, unused DefaultEditorFile file
This commit is contained in:
parent
f7dbfff42d
commit
40dd926873
21 changed files with 263 additions and 255 deletions
|
|
@ -60,11 +60,11 @@ function Core_ClientServer::onDestroy( %this )
|
|||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
function StartGame( %mission, %hostingType )
|
||||
function StartGame( %levelAsset, %hostingType )
|
||||
{
|
||||
if( %mission $= "" )
|
||||
if( %levelAsset $= "" )
|
||||
{
|
||||
%mission = $selectedLevelFile;
|
||||
%levelAsset = $selectedLevelAsset;
|
||||
}
|
||||
|
||||
if (%hostingType !$= "")
|
||||
|
|
@ -88,7 +88,7 @@ function StartGame( %mission, %hostingType )
|
|||
Canvas.repaint();
|
||||
}
|
||||
|
||||
createAndConnectToLocalServer( %serverType, %mission );
|
||||
createAndConnectToLocalServer( %serverType, %levelAsset );
|
||||
}
|
||||
|
||||
function JoinGame( %serverIndex )
|
||||
|
|
|
|||
|
|
@ -33,22 +33,26 @@ $MissionLoadPause = 5000;
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
//This is the first call made by the server to kick the loading process off
|
||||
function loadMission( %missionName, %isFirstMission )
|
||||
function loadMission( %levelAsset, %isFirstMission )
|
||||
{
|
||||
endMission();
|
||||
echo("*** LOADING MISSION: " @ %missionName);
|
||||
$Server::LevelAsset = AssetDatabase.acquireAsset(%levelAsset);
|
||||
|
||||
echo("*** LOADING MISSION: " @ $Server::LevelAsset.LevelName);
|
||||
echo("*** Stage 1 load");
|
||||
|
||||
// increment the mission sequence (used for ghost sequencing)
|
||||
$missionSequence++;
|
||||
$missionRunning = false;
|
||||
$Server::MissionFile = %missionName;
|
||||
$Server::MissionFile = $Server::LevelAsset.getLevelFile();
|
||||
$Server::LoadFailMsg = "";
|
||||
|
||||
$Server::LevelAsset.loadDependencies();
|
||||
|
||||
// Extract mission info from the mission file,
|
||||
// including the display name and stuff to send
|
||||
// to the client.
|
||||
buildLoadInfo( %missionName );
|
||||
buildLoadInfo( $Server::MissionFile );
|
||||
|
||||
// Download mission info to the clients
|
||||
%count = ClientGroup.getCount();
|
||||
|
|
@ -163,6 +167,9 @@ function endMission()
|
|||
getScene(0).delete();
|
||||
MissionCleanup.delete();
|
||||
|
||||
if(isObject($Server::LevelAsset))
|
||||
AssetDatabase.releaseAsset($Server::LevelAsset.getAssetId()); //cleanup
|
||||
|
||||
if ($Pref::Server::EnableDatablockCache)
|
||||
resetDatablockCache();
|
||||
DatablockFilesList.empty();
|
||||
|
|
|
|||
|
|
@ -93,9 +93,9 @@ function portInit(%port)
|
|||
/// create a local client connection to the server.
|
||||
//
|
||||
/// @return true if successful.
|
||||
function createAndConnectToLocalServer( %serverType, %level )
|
||||
function createAndConnectToLocalServer( %serverType, %levelAsset )
|
||||
{
|
||||
if( !createServer( %serverType, %level ) )
|
||||
if( !createServer( %serverType, %levelAsset ) )
|
||||
return false;
|
||||
|
||||
%conn = new GameConnection( ServerConnection );
|
||||
|
|
@ -124,7 +124,7 @@ function createAndConnectToLocalServer( %serverType, %level )
|
|||
|
||||
/// Create a server with either a "SinglePlayer" or "MultiPlayer" type
|
||||
/// Specify the level to load on the server
|
||||
function createServer(%serverType, %level)
|
||||
function createServer(%serverType, %levelAsset)
|
||||
{
|
||||
if($Game::firstTimeServerRun == true)
|
||||
{
|
||||
|
|
@ -135,7 +135,7 @@ function createServer(%serverType, %level)
|
|||
// working with the server session we think we are.
|
||||
$Server::Session++;
|
||||
|
||||
if (%level $= "")
|
||||
if (%levelAsset $= "")
|
||||
{
|
||||
error("createServer(): level name unspecified");
|
||||
return false;
|
||||
|
|
@ -143,7 +143,7 @@ function createServer(%serverType, %level)
|
|||
|
||||
// Make sure our level name is relative so that it can send
|
||||
// across the network correctly
|
||||
%level = makeRelativePath(%level, getWorkingDirectory());
|
||||
//%level = makeRelativePath(%level, getWorkingDirectory());
|
||||
|
||||
destroyServer();
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ function createServer(%serverType, %level)
|
|||
// the server has been created
|
||||
onServerCreated();
|
||||
|
||||
loadMission(%level, true);
|
||||
loadMission(%levelAsset, true);
|
||||
|
||||
$Game::running = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue