Implemented initial pass at proper client/server separation handling for module initialization

Added GameModeName to Scene
Added function to get number of active scenes
Added logic to level/client loading to enact gameplay mode logic driven by either Scene's GameModeName or project setting's default game mode
Added template module.cs file for module creation and adjusted new module logic in AssetBrowser to create off template
Updated FPSGameplay code to have deathmatchGame mode work with new GameMode logic
Updated EmptyLevel scene to define deathMatchGame as gamemode
Updated FPSGameplay module script to properly client/server initialize
This commit is contained in:
Areloch 2019-08-04 23:21:28 -05:00
parent d97c05b411
commit 7dc03ae17a
32 changed files with 774 additions and 294 deletions

View file

@ -12,7 +12,7 @@ Scene::Scene() :
mIsEditing(false),
mIsDirty(false)
{
mGameModeName = StringTable->EmptyString();
}
Scene::~Scene()
@ -29,6 +29,10 @@ void Scene::initPersistFields()
addField("isEditing", TypeBool, Offset(mIsEditing, Scene), "", AbstractClassRep::FIELD_HideInInspectors);
addField("isDirty", TypeBool, Offset(mIsDirty, Scene), "", AbstractClassRep::FIELD_HideInInspectors);
endGroup("Internal");
addGroup("Gameplay");
addField("gameModeName", TypeString, Offset(mGameModeName, Scene), "The name of the gamemode that this scene utilizes");
endGroup("Gameplay");
}
bool Scene::onAdd()
@ -186,6 +190,13 @@ DefineEngineFunction(getScene, Scene*, (U32 sceneId), (0),
return Scene::smSceneList[sceneId];
}
DefineEngineFunction(getSceneCount, S32, (),,
"Get the number of active Scene objects that are loaded.\n"
"@return The number of active scenes")
{
return Scene::smSceneList.size();
}
DefineEngineFunction(getRootScene, S32, (), ,
"Get the root Scene object that is loaded.\n"
"@return The id of the Root Scene. Will be 0 if no root scene is loaded")