Adding warning if server fails to load the sv_defaultPlayerSpawnAsset when a client joins the server. Updating Multiplayer PyTest to watch out for this warning.
Signed-off-by: Gene Walters <genewalt@amazon.com>
This commit is contained in:
+2
@@ -118,6 +118,8 @@ class TestHelper:
|
||||
|
||||
wait_for_critical_expected_line("Editor-server ready. Editor has successfully connected to the editor-server's network simulation.", section_tracer.prints, 5.0)
|
||||
|
||||
wait_for_critical_unexpected_line(f"MultiplayerSystemComponent: SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '{sv_default_player_spawn_asset.lower()}'.", section_tracer.prints, 0.5)
|
||||
|
||||
TestHelper.wait_for_condition(lambda : multiplayer.PythonEditorFuncs_is_in_game_mode(), 5.0)
|
||||
Report.critical_result(msgtuple_success_fail, multiplayer.PythonEditorFuncs_is_in_game_mode())
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
}
|
||||
|
||||
CryWarning(VALIDATOR_MODULE_UNKNOWN, VALIDATOR_WARNING, "(%s) - %s", window, message);
|
||||
return true; // suppress default AzCore behavior.
|
||||
return m_suppressSystemOutput;
|
||||
}
|
||||
|
||||
bool OnOutput(const char* window, const char* message) override
|
||||
|
||||
@@ -1135,9 +1135,15 @@ namespace Multiplayer
|
||||
// make sure the player prefab path is lowercase (how it's stored in the cache folder)
|
||||
auto sv_defaultPlayerSpawnAssetLowerCase = static_cast<AZ::CVarFixedString>(sv_defaultPlayerSpawnAsset);
|
||||
AZStd::to_lower(sv_defaultPlayerSpawnAssetLowerCase.begin(), sv_defaultPlayerSpawnAssetLowerCase.end());
|
||||
PrefabEntityId playerPrefabEntityId(AZ::Name(static_cast<AZ::CVarFixedString>(sv_defaultPlayerSpawnAssetLowerCase).c_str()));
|
||||
PrefabEntityId playerPrefabEntityId(AZ::Name(sv_defaultPlayerSpawnAssetLowerCase.c_str()));
|
||||
|
||||
INetworkEntityManager::EntityList entityList = m_networkEntityManager.CreateEntitiesImmediate(playerPrefabEntityId, NetEntityRole::Authority, AZ::Transform::CreateIdentity(), Multiplayer::AutoActivate::DoNotActivate);
|
||||
|
||||
AZ_Warning(
|
||||
"MultiplayerSystemComponent", !entityList.empty(),
|
||||
"SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '%s'.\n",
|
||||
sv_defaultPlayerSpawnAssetLowerCase.c_str())
|
||||
|
||||
for (NetworkEntityHandle subEntity : entityList)
|
||||
{
|
||||
subEntity.Activate();
|
||||
|
||||
Reference in New Issue
Block a user