Merge remote-tracking branch 'upstream/development' into thin-transmission

Signed-off-by: Santi Paprika <santi.gonzalez.cs@gmail.com>
monroegm-disable-blank-issue-2
Santi Paprika 4 years ago
commit 6e21d63943

@ -87,12 +87,18 @@ class AtomComponentProperties:
def decal(property: str = 'name') -> str:
"""
Decal component properties.
- 'Attenuation Angle' controls how much the angle between geometry and decal impacts opacity. 0-1 Radians
- 'Opacity' where one is opaque and zero is transparent
- 'Sort Key' 0-255 stacking z-sort like key to define which decal is on top of another
- 'Material' the material Asset.id of the decal.
:param property: From the last element of the property tree path. Default 'name' for component name string.
:return: Full property path OR component name if no property specified.
"""
properties = {
'name': 'Decal',
'Attenuation Angle': 'Controller|Configuration|Attenuation Angle',
'Opacity': 'Controller|Configuration|Opacity',
'Sort Key': 'Controller|Configuration|Sort Key',
'Material': 'Controller|Configuration|Material',
}
return properties[property]
@ -242,12 +248,14 @@ class AtomComponentProperties:
def grid(property: str = 'name') -> str:
"""
Grid component properties.
- 'Grid Size': The size of the grid, default value is 32
- 'Secondary Grid Spacing': The spacing value for the secondary grid, i.e. 1.0
:param property: From the last element of the property tree path. Default 'name' for component name string.
:return: Full property path OR component name if no property specified.
"""
properties = {
'name': 'Grid',
'Grid Size': 'Controller|Configuration|Grid Size',
'Secondary Grid Spacing': 'Controller|Configuration|Secondary Grid Spacing',
}
return properties[property]
@ -378,11 +386,13 @@ class AtomComponentProperties:
def physical_sky(property: str = 'name') -> str:
"""
Physical Sky component properties.
- 'Sky Intensity' float that determines sky intensity value, default value is 4.
:param property: From the last element of the property tree path. Default 'name' for component name string.
:return: Full property path OR component name if no property specified.
"""
properties = {
'name': 'Physical Sky',
'Sky Intensity': 'Controller|Configuration|Sky Intensity',
}
return properties[property]

@ -8,49 +8,61 @@ SPDX-License-Identifier: Apache-2.0 OR MIT
class Tests:
camera_creation = (
"Camera Entity successfully created",
"Camera Entity failed to be created")
"P0: Camera Entity failed to be created")
camera_component_added = (
"Camera component was added to entity",
"Camera component failed to be added to entity")
"P0: Camera component failed to be added to entity")
camera_component_check = (
"Entity has a Camera component",
"Entity failed to find Camera component")
"P0: Entity failed to find Camera component")
creation_undo = (
"UNDO Entity creation success",
"UNDO Entity creation failed")
"P0: UNDO Entity creation failed")
creation_redo = (
"REDO Entity creation success",
"REDO Entity creation failed")
"P0: REDO Entity creation failed")
decal_creation = (
"Decal Entity successfully created",
"Decal Entity failed to be created")
"P0: Decal Entity failed to be created")
decal_component = (
"Entity has a Decal component",
"Entity failed to find Decal component")
"P0: Entity failed to find Decal component")
decal_component_removed = (
"Decal component removed",
"P0: Decal component failed to be removed")
material_property_set = (
"Material property set on Decal component",
"Couldn't set Material property on Decal component")
"P0: Couldn't set Material property on Decal component")
attenuation_property_set = (
"Attenuation Angle property set on Decal component",
"P1: Couldn't set Attenuation Angle property on Decal component")
opacity_property_set = (
"Opacity property set on Decal component",
"P1: Coudn't set Opacity property on Decal component")
sort_key_property_set = (
"Sort Key property set on Decal component",
"P1: Couldn't set Sort Key property on Decal component")
enter_game_mode = (
"Entered game mode",
"Failed to enter game mode")
"P0: Failed to enter game mode")
exit_game_mode = (
"Exited game mode",
"Couldn't exit game mode")
"P0: Couldn't exit game mode")
is_visible = (
"Entity is visible",
"Entity was not visible")
"P0: Entity was not visible")
is_hidden = (
"Entity is hidden",
"Entity was not hidden")
"P0: Entity was not hidden")
entity_deleted = (
"Entity deleted",
"Entity was not deleted")
"P0: Entity was not deleted")
deletion_undo = (
"UNDO deletion success",
"UNDO deletion failed")
"P0: UNDO deletion failed")
deletion_redo = (
"REDO deletion success",
"REDO deletion failed")
"P0: REDO deletion failed")
def AtomEditorComponents_Decal_AddedToEntity():
@ -71,14 +83,18 @@ def AtomEditorComponents_Decal_AddedToEntity():
2) Add Decal component to Decal entity.
3) UNDO the entity creation and component addition.
4) REDO the entity creation and component addition.
5) Enter/Exit game mode.
6) Test IsHidden.
7) Test IsVisible.
8) Set Material property on Decal component.
9) Delete Decal entity.
10) UNDO deletion.
11) REDO deletion.
12) Look for errors and asserts.
5) Set Material property on Decal component.
6) Set Attenuation Angle property on Decal component.
7) Set Opacity property on Decal component
8) Set Sort Key property on Decal Component
9) Remove Decal component then UNDO the remove
10) Enter/Exit game mode.
11) Test IsHidden.
12) Test IsVisible.
13) Delete Decal entity.
14) UNDO deletion.
15) REDO deletion.
16) Look for errors and asserts.
:return: None
"""
@ -130,42 +146,69 @@ def AtomEditorComponents_Decal_AddedToEntity():
general.idle_wait_frames(1)
Report.result(Tests.creation_redo, decal_entity.exists())
# 5. Enter/Exit game mode.
# 5. Set Material property on Decal component.
decal_material_asset_path = os.path.join("materials", "decal", "airship_symbol_decal.azmaterial")
decal_material_asset = Asset.find_asset_by_path(decal_material_asset_path, False)
decal_component.set_component_property_value(AtomComponentProperties.decal('Material'), decal_material_asset.id)
get_material_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Material'))
Report.result(Tests.material_property_set, get_material_property == decal_material_asset.id)
# 6. Set Attenuation Angle property on Decal component
decal_component.set_component_property_value(AtomComponentProperties.decal('Attenuation Angle'), value=0.75)
get_attenuation_property = decal_component.get_component_property_value(
AtomComponentProperties.decal('Attenuation Angle'))
Report.result(Tests.attenuation_property_set, get_attenuation_property == 0.75)
# 7. Set Opacity property on Decal component
decal_component.set_component_property_value(AtomComponentProperties.decal('Opacity'), value=0.5)
get_opacity_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Opacity'))
Report.result(Tests.opacity_property_set, get_opacity_property == 0.5)
# 8. Set Sort Key property on Decal component
decal_component.set_component_property_value(AtomComponentProperties.decal('Sort Key'), value=255.0)
get_sort_key_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Sort Key'))
Report.result(Tests.sort_key_property_set, get_sort_key_property == 255.0)
decal_component.set_component_property_value(AtomComponentProperties.decal('Sort Key'), value=0)
get_sort_key_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Sort Key'))
Report.result(Tests.sort_key_property_set, get_sort_key_property == 0)
# 9. Remove Decal component then UNDO the remove
decal_component.remove()
general.idle_wait_frames(1)
Report.result(Tests.decal_component_removed, not decal_entity.has_component(AtomComponentProperties.decal()))
general.undo()
general.idle_wait_frames(1)
Report.result(Tests.decal_component, decal_entity.has_component(AtomComponentProperties.decal()))
# 10. Enter/Exit game mode.
TestHelper.enter_game_mode(Tests.enter_game_mode)
general.idle_wait_frames(1)
TestHelper.exit_game_mode(Tests.exit_game_mode)
# 6. Test IsHidden.
# 11. Test IsHidden.
decal_entity.set_visibility_state(False)
Report.result(Tests.is_hidden, decal_entity.is_hidden() is True)
# 7. Test IsVisible.
# 12. Test IsVisible.
decal_entity.set_visibility_state(True)
general.idle_wait_frames(1)
Report.result(Tests.is_visible, decal_entity.is_visible() is True)
# 8. Set Material property on Decal component.
decal_material_asset_path = os.path.join("materials", "basic_grey.azmaterial")
decal_material_asset = Asset.find_asset_by_path(decal_material_asset_path, False)
decal_component.set_component_property_value(AtomComponentProperties.decal('Material'), decal_material_asset.id)
get_material_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Material'))
Report.result(Tests.material_property_set, get_material_property == decal_material_asset.id)
# 9. Delete Decal entity.
# 13. Delete Decal entity.
decal_entity.delete()
Report.result(Tests.entity_deleted, not decal_entity.exists())
# 10. UNDO deletion.
# 14. UNDO deletion.
general.undo()
general.idle_wait_frames(1)
Report.result(Tests.deletion_undo, decal_entity.exists())
# 11. REDO deletion.
# 15. REDO deletion.
general.redo()
general.idle_wait_frames(1)
Report.result(Tests.deletion_redo, not decal_entity.exists())
# 12. Look for errors and asserts.
# 16. Look for errors and asserts.
TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
for error_info in error_tracer.errors:
Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")

@ -18,6 +18,9 @@ class Tests:
grid_component_added = (
"Entity has a Grid component",
"Entity failed to find Grid component")
grid_size = (
"Grid Size value set successfully",
"Grid Size value could not be set")
enter_game_mode = (
"Entered game mode",
"Failed to enter game mode")
@ -59,13 +62,14 @@ def AtomEditorComponents_Grid_AddedToEntity():
2) Add a Grid component to Grid entity.
3) UNDO the entity creation and component addition.
4) REDO the entity creation and component addition.
5) Enter/Exit game mode.
6) Test IsHidden.
7) Test IsVisible.
8) Delete Grid entity.
9) UNDO deletion.
10) REDO deletion.
11) Look for errors.
5) Grid Size changed.
6) Enter/Exit game mode.
7) Test IsHidden.
8) Test IsVisible.
9) Delete Grid entity.
10) UNDO deletion.
11) REDO deletion.
12) Look for errors.
:return: None
"""
@ -119,35 +123,42 @@ def AtomEditorComponents_Grid_AddedToEntity():
general.idle_wait_frames(1)
Report.result(Tests.creation_redo, grid_entity.exists())
# 5. Enter/Exit game mode.
# 5. Grid Size changed
grid_component.set_component_property_value(
AtomComponentProperties.grid('Grid Size'), value=64)
current_grid_size = grid_component.get_component_property_value(
AtomComponentProperties.grid('Grid Size'))
Report.result(Tests.grid_size, current_grid_size == 64)
# 6. Enter/Exit game mode.
TestHelper.enter_game_mode(Tests.enter_game_mode)
general.idle_wait_frames(1)
TestHelper.exit_game_mode(Tests.exit_game_mode)
# 6. Test IsHidden.
# 7. Test IsHidden.
grid_entity.set_visibility_state(False)
Report.result(Tests.is_hidden, grid_entity.is_hidden() is True)
# 7. Test IsVisible.
# 8. Test IsVisible.
grid_entity.set_visibility_state(True)
general.idle_wait_frames(1)
Report.result(Tests.is_visible, grid_entity.is_visible() is True)
# 8. Delete Grid entity.
# 9. Delete Grid entity.
grid_entity.delete()
Report.result(Tests.entity_deleted, not grid_entity.exists())
# 9. UNDO deletion.
# 10. UNDO deletion.
general.undo()
general.idle_wait_frames(1)
Report.result(Tests.deletion_undo, grid_entity.exists())
# 10. REDO deletion.
# 11. REDO deletion.
general.redo()
general.idle_wait_frames(1)
Report.result(Tests.deletion_redo, not grid_entity.exists())
# 11. Look for errors or asserts.
# 12. Look for errors or asserts.
TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
for error_info in error_tracer.errors:
Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")

@ -68,13 +68,14 @@ def AtomEditorComponents_Light_AddedToEntity():
2) Add Light component to the Light entity.
3) UNDO the entity creation and component addition.
4) REDO the entity creation and component addition.
5) Enter/Exit game mode.
6) Test IsHidden.
7) Test IsVisible.
8) Delete Light entity.
9) UNDO deletion.
10) REDO deletion.
11) Look for errors.
5) Cycle through all light types.
6) Enter/Exit game mode.
7) Test IsHidden.
8) Test IsVisible.
9) Delete Light entity.
10) UNDO deletion.
11) REDO deletion.
12) Look for errors.
:return: None
"""
@ -83,7 +84,7 @@ def AtomEditorComponents_Light_AddedToEntity():
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.utils import Report, Tracer, TestHelper
from Atom.atom_utils.atom_constants import AtomComponentProperties
from Atom.atom_utils.atom_constants import AtomComponentProperties, LIGHT_TYPES
with Tracer() as error_tracer:
# Test setup begins.
@ -124,35 +125,46 @@ def AtomEditorComponents_Light_AddedToEntity():
general.idle_wait_frames(1)
Report.result(Tests.creation_redo, light_entity.exists())
# 5. Enter/Exit game mode.
# 5. Cycle through all light types.
for light_type in LIGHT_TYPES.keys():
light_component.set_component_property_value(
AtomComponentProperties.light('Light type'), LIGHT_TYPES[light_type])
current_light_type = light_component.get_component_property_value(
AtomComponentProperties.light('Light type'))
test_light_type = (
f"Light component has {light_type} type set",
f"Light component failed to set {light_type} type")
Report.result(test_light_type, current_light_type == LIGHT_TYPES[light_type])
# 6. Enter/Exit game mode.
TestHelper.enter_game_mode(Tests.enter_game_mode)
general.idle_wait_frames(1)
TestHelper.exit_game_mode(Tests.exit_game_mode)
# 6. Test IsHidden.
# 7. Test IsHidden.
light_entity.set_visibility_state(False)
Report.result(Tests.is_hidden, light_entity.is_hidden() is True)
# 7. Test IsVisible.
# 8. Test IsVisible.
light_entity.set_visibility_state(True)
general.idle_wait_frames(1)
Report.result(Tests.is_visible, light_entity.is_visible() is True)
# 8. Delete Light entity.
# 9. Delete Light entity.
light_entity.delete()
Report.result(Tests.entity_deleted, not light_entity.exists())
# 9. UNDO deletion.
# 10. UNDO deletion.
general.undo()
general.idle_wait_frames(1)
Report.result(Tests.deletion_undo, light_entity.exists())
# 10. REDO deletion.
# 11. REDO deletion.
general.redo()
general.idle_wait_frames(1)
Report.result(Tests.deletion_redo, not light_entity.exists())
# 11. Look for errors asserts.
# 12. Look for errors asserts.
TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
for error_info in error_tracer.errors:
Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")

@ -27,6 +27,9 @@ class Tests:
physical_sky_component = (
"Entity has a Physical Sky component",
"Entity failed to find Physical Sky component")
sky_intensity = (
"Sky Intensity value updated successfully",
"Sky Intensity value could not be set")
enter_game_mode = (
"Entered game mode",
"Failed to enter game mode")
@ -68,13 +71,14 @@ def AtomEditorComponents_PhysicalSky_AddedToEntity():
2) Add Physical Sky component to Physical Sky entity.
3) UNDO the entity creation and component addition.
4) REDO the entity creation and component addition.
5) Enter/Exit game mode.
6) Test IsHidden.
7) Test IsVisible.
8) Delete Physical Sky entity.
9) UNDO deletion.
10) REDO deletion.
11) Look for errors and asserts.
5) Update Sky Intensity value.
6) Enter/Exit game mode.
7) Test IsHidden.
8) Test IsVisible.
9) Delete Physical Sky entity.
10) UNDO deletion.
11) REDO deletion.
12) Look for errors and asserts.
:return: None
"""
@ -126,35 +130,42 @@ def AtomEditorComponents_PhysicalSky_AddedToEntity():
general.idle_wait_frames(1)
Report.result(Tests.creation_redo, physical_sky_entity.exists())
# 5. Enter/Exit game mode.
# 5. Set Sky Intensity value
physical_sky_component.set_component_property_value(
AtomComponentProperties.physical_sky('Sky Intensity'), value=2)
current_sky_intensity = physical_sky_component.get_component_property_value(
AtomComponentProperties.physical_sky('Sky Intensity'))
Report.result(Tests.sky_intensity, current_sky_intensity == 2)
# 6. Enter/Exit game mode.
TestHelper.enter_game_mode(Tests.enter_game_mode)
general.idle_wait_frames(1)
TestHelper.exit_game_mode(Tests.exit_game_mode)
# 6. Test IsHidden.
# 7. Test IsHidden.
physical_sky_entity.set_visibility_state(False)
Report.result(Tests.is_hidden, physical_sky_entity.is_hidden() is True)
# 7. Test IsVisible.
# 8. Test IsVisible.
physical_sky_entity.set_visibility_state(True)
general.idle_wait_frames(1)
Report.result(Tests.is_visible, physical_sky_entity.is_visible() is True)
# 8. Delete Physical Sky entity.
# 9. Delete Physical Sky entity.
physical_sky_entity.delete()
Report.result(Tests.entity_deleted, not physical_sky_entity.exists())
# 9. UNDO deletion.
# 10. UNDO deletion.
general.undo()
general.idle_wait_frames(1)
Report.result(Tests.deletion_undo, physical_sky_entity.exists())
# 10. REDO deletion.
# 11. REDO deletion.
general.redo()
general.idle_wait_frames(1)
Report.result(Tests.deletion_redo, not physical_sky_entity.exists())
# 11. Look for errors and asserts.
# 12. Look for errors and asserts.
TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
for error_info in error_tracer.errors:
Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")

@ -34,6 +34,7 @@ class EditorComponent:
EditorEntity.add_component() or Entity.add_components() or EditorEntity.get_components_of_type()
which also assigns self.id and self.type_id to the EditorComponent object.
self.type_id is the UUID for the component type as provided by an ebus call.
self.id is an azlmbr.entity.EntityComponentIdPair which contains both entity and component id's
"""
def __init__(self, type_id: uuid):
@ -270,6 +271,13 @@ class EditorComponent:
warnings.warn("disable_component is deprecated, use set_enabled(False) instead.", DeprecationWarning)
editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id])
def remove(self):
"""
Removes the component from its associated entity. Essentially a delete since only UNDO can return it.
:return: None
"""
editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", [self.id])
@staticmethod
def get_type_ids(component_names: list, entity_type: EditorEntityType = EditorEntityType.GAME) -> list:
"""

@ -31,11 +31,15 @@ class TestAutomation(TestAutomationBase):
def test_Multiplayer_AutoComponent_NetworkInput(self, request, workspace, editor, launcher_platform):
from .tests import Multiplayer_AutoComponent_NetworkInput as test_module
self._run_prefab_test(request, workspace, editor, test_module)
def test_Multiplayer_AutoComponent_RPC(self, request, workspace, editor, launcher_platform):
from .tests import Multiplayer_AutoComponent_RPC as test_module
self._run_prefab_test(request, workspace, editor, test_module)
def test_Multiplayer_BasicConnectivity_Connects(self, request, workspace, editor, launcher_platform):
from .tests import Multiplayer_BasicConnectivity_Connects as test_module
self._run_prefab_test(request, workspace, editor, test_module)
def test_Multiplayer_SimpleNetworkLevelEntity(self, request, workspace, editor, launcher_platform):
from .tests import Multiplayer_SimpleNetworkLevelEntity as test_module
self._run_prefab_test(request, workspace, editor, test_module)

@ -73,7 +73,20 @@ def Multiplayer_AutoComponent_RPC():
helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS)
helper.succeed_if_log_line_found('Script', "AutoComponent_RPC_NetLevelEntity: I'm a client playing some fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS)
# Autonomous->Authority RPC
# Sending 2 RPCs: 1 containing a parameter and 1 without
AUTONOMOUS_TO_AUTHORITY_RPC_WAIT_TIME_SECONDS = 1.0 # This RPC is sent as soon as the autonomous player script is spawned. 1 second should be more than enough time to send/receive that RPC.
helper.succeed_if_log_line_found('Script', "AutoComponent_RPC: Sending AutonomousToAuthorityNoParam RPC.", section_tracer.prints, AUTONOMOUS_TO_AUTHORITY_RPC_WAIT_TIME_SECONDS)
helper.succeed_if_log_line_found('Script', "AutoComponent_RPC: Sending AutonomousToAuthority RPC (with float param).", section_tracer.prints, AUTONOMOUS_TO_AUTHORITY_RPC_WAIT_TIME_SECONDS)
helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC: Successfully received AutonomousToAuthorityNoParams RPC.", section_tracer.prints, AUTONOMOUS_TO_AUTHORITY_RPC_WAIT_TIME_SECONDS)
helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC: Successfully received AutonomousToAuthority RPC (with expected float param).", section_tracer.prints, AUTONOMOUS_TO_AUTHORITY_RPC_WAIT_TIME_SECONDS)
# Server->Authority RPC. Inter-Entity Communication.
SERVER_TO_AUTHORITY_RPC_WAIT_TIME_SECONDS = 1.0 # This RPC is sent as soon as the networked level entity finds the player in the level, and previous tests are relying on the player's existence. 1 second should be more than enough time to send/receive that RPC.
helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity: Send ServerToAuthority RPC.", section_tracer.prints, SERVER_TO_AUTHORITY_RPC_WAIT_TIME_SECONDS)
helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC: Received ServerToAuthority RPC. Damage=42.", section_tracer.prints, SERVER_TO_AUTHORITY_RPC_WAIT_TIME_SECONDS)
# Exit game mode
helper.exit_game_mode(TestSuccessFailTuples.exit_game_mode)

@ -0,0 +1,66 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# Test Case Title : Check that the basic client connect test works
# fmt: off
class TestConstants:
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
exit_game_mode = ("Exited game mode", "Couldn't exit game mode")
find_network_player = ("Found network player", "Couldn't find network player")
# fmt: on
def Multiplayer_BasicConnectivity_Connects():
r"""
Summary:
Runs a test to make sure that a networked player can be spawned
Level Description:
- Dynamic
1. Although the level is empty, when the server and editor connect the server will spawn the player prefab.
- Static
1. This is an empty level.
Expected Outcome:
We should see the player connect and spawn with no errors.
:return:
"""
import azlmbr.legacy.general as general
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import Tracer
from editor_python_test_tools.utils import TestHelper as helper
level_name = "BasicConnectivity_Connects"
player_prefab_name = "Player"
player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable"
helper.init_idle()
# 1) Open Level
helper.open_level("Multiplayer", level_name)
with Tracer() as section_tracer:
# 2) Enter game mode
helper.multiplayer_enter_game_mode(TestConstants.enter_game_mode, player_prefab_path.lower())
# 3) Make sure the network player was spawned
player_id = general.find_game_entity(player_prefab_name)
Report.critical_result(TestConstants.find_network_player, player_id.IsValid())
# Exit game mode
helper.exit_game_mode(TestConstants.exit_game_mode)
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(Multiplayer_BasicConnectivity_Connects)

@ -4,6 +4,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
class HeightTests:
single_gradient_height_correct = (
"Successfully retrieved height for gradient1.",
@ -22,6 +23,7 @@ class HeightTests:
"OnTerrainDataChanged call count incorrect."
)
def TerrainHeightGradientList_AddRemoveGradientWorks():
"""
Summary:
@ -29,22 +31,16 @@ def TerrainHeightGradientList_AddRemoveGradientWorks():
:return: None
"""
import os
import math as sys_math
import azlmbr.legacy.general as general
import azlmbr.bus as bus
import azlmbr.math as math
import azlmbr.terrain as terrain
import azlmbr.editor as editor
import azlmbr.vegetation as vegetation
import azlmbr.entity as EntityId
import editor_python_test_tools.hydra_editor_utils as hydra
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
import editor_python_test_tools.pyside_utils as pyside_utils
from editor_python_test_tools.editor_entity_utils import EditorEntity
terrain_changed_call_count = 0
expected_terrain_changed_calls = 0
@ -87,11 +83,8 @@ def TerrainHeightGradientList_AddRemoveGradientWorks():
Report.result(test_results, sys_math.isclose(height, expected_height, abs_tol=test_tolerance))
helper.init_idle()
# Open a level.
helper.open_level("Physics", "Base")
helper.wait_for_condition(lambda: general.get_current_level_name() == "Base", 2.0)
hydra.open_base_level()
general.idle_wait_frames(1)
@ -101,7 +94,7 @@ def TerrainHeightGradientList_AddRemoveGradientWorks():
aabb_height = 1024.0
box_dimensions = math.Vector3(1.0, 1.0, aabb_height);
# Create a main entity with a LayerSpawner, AAbb and HeightGradientList.
# Create a main entity with a LayerSpawner, AAbb and HeightGradientList.
main_entity = create_entity_at("entity2", [layerspawner_component_name, gradientlist_component_name, aabb_component_name], 0.0, 0.0, aabb_height/2.0)
# Create three gradient entities.
@ -138,7 +131,8 @@ def TerrainHeightGradientList_AddRemoveGradientWorks():
# Add gradient3, the height should still be the second value, as that was the highest.
set_gradients_check_height(main_entity, [gradient_entity1.id, gradient_entity2.id, gradient_entity3.id], aabb_height * gradient_values[1], HeightTests.triple_gradient_height_correct)
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(TerrainHeightGradientList_AddRemoveGradientWorks)
Report.start_test(TerrainHeightGradientList_AddRemoveGradientWorks)

@ -4,6 +4,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
class MacroMaterialTests:
setup_test = (
"Setup successful",
@ -30,6 +31,7 @@ class MacroMaterialTests:
"Timed out waiting for OnTerrainMacroMaterialRegionChanged"
)
def TerrainMacroMaterialComponent_MacroMaterialActivates():
"""
Summary:
@ -38,7 +40,6 @@ def TerrainMacroMaterialComponent_MacroMaterialActivates():
"""
import os
import math as sys_math
import azlmbr.legacy.general as general
import azlmbr.asset as asset
@ -46,15 +47,11 @@ def TerrainMacroMaterialComponent_MacroMaterialActivates():
import azlmbr.math as math
import azlmbr.terrain as terrain
import azlmbr.editor as editor
import azlmbr.vegetation as vegetation
import azlmbr.entity as EntityId
import editor_python_test_tools.hydra_editor_utils as hydra
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
import editor_python_test_tools.pyside_utils as pyside_utils
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.asset_utils import Asset
material_created_called = False
material_changed_called = False
@ -84,11 +81,8 @@ def TerrainMacroMaterialComponent_MacroMaterialActivates():
nonlocal material_destroyed_called
material_destroyed_called = True
helper.init_idle()
# Open a level.
helper.open_level("Physics", "Base")
helper.wait_for_condition(lambda: general.get_current_level_name() == "Base", 2.0)
hydra.open_base_level()
general.idle_wait_frames(1)
@ -160,7 +154,8 @@ def TerrainMacroMaterialComponent_MacroMaterialActivates():
region_changed_call_result = helper.wait_for_condition(lambda: material_region_changed_called == True, 2.0)
Report.result(MacroMaterialTests.material_changed_call_on_aabb_change, region_changed_call_result)
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(TerrainMacroMaterialComponent_MacroMaterialActivates)
Report.start_test(TerrainMacroMaterialComponent_MacroMaterialActivates)

@ -5,8 +5,9 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
#fmt: off
class Tests():
class Tests:
create_test_entity = ("Entity created successfully", "Failed to create Entity")
add_axis_aligned_box_shape = ("Axis Aligned Box Shape component added", "Failed to add Axis Aligned Box Shape component")
add_terrain_collider = ("Terrain Physics Heightfield Collider component added", "Failed to add a Terrain Physics Heightfield Collider component")
@ -14,6 +15,7 @@ class Tests():
configuration_changed = ("Terrain size changed successfully", "Failed terrain size change")
#fmt: on
def TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges():
"""
Summary:
@ -36,24 +38,24 @@ def TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges():
:return: None
"""
import editor_python_test_tools.hydra_editor_utils as hydra
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.utils import Report, Tracer
import azlmbr.legacy.general as general
import azlmbr.physics as physics
import azlmbr.math as azmath
import azlmbr.bus as bus
import sys
import math
SET_BOX_X_SIZE = 5.0
SET_BOX_Y_SIZE = 6.0
EXPECTED_COLUMN_SIZE = SET_BOX_X_SIZE + 1
EXPECTED_ROW_SIZE = SET_BOX_Y_SIZE + 1
helper.init_idle()
# 1) Load the level
helper.open_level("", "Base")
hydra.open_base_level()
# 2) Create test entity
test_entity = EditorEntity.create_editor_entity("TestEntity")

@ -54,7 +54,6 @@ def TerrainSystem_VegetationSpawnsOnTerrainSurfaces():
"""
import os
import sys
import math as sys_math
import azlmbr.legacy.general as general
@ -62,10 +61,8 @@ def TerrainSystem_VegetationSpawnsOnTerrainSurfaces():
import azlmbr.math as math
import azlmbr.areasystem as areasystem
import azlmbr.editor as editor
import azlmbr.vegetation as vegetation
import azlmbr.terrain as terrain
import azlmbr.entity as EntityId
import azlmbr.surface_data as surface_data
import editor_python_test_tools.hydra_editor_utils as hydra
@ -86,11 +83,8 @@ def TerrainSystem_VegetationSpawnsOnTerrainSurfaces():
return highest_z, lowest_z
helper.init_idle()
# Open an empty level.
helper.open_level("Physics", "Base")
helper.wait_for_condition(lambda: general.get_current_level_name() == "Base", 2.0)
hydra.open_base_level()
general.idle_wait_frames(1)
@ -208,7 +202,8 @@ def TerrainSystem_VegetationSpawnsOnTerrainSurfaces():
Report.result(VegetationTests.testTag3_excluded_vegetation_z_correct, highest_z < box_height * gradient_value_2)
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(TerrainSystem_VegetationSpawnsOnTerrainSurfaces)
Report.start_test(TerrainSystem_VegetationSpawnsOnTerrainSurfaces)

@ -5,8 +5,9 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
#fmt: off
class Tests():
class Tests:
create_terrain_spawner_entity = ("Terrain_spawner_entity created successfully", "Failed to create terrain_spawner_entity")
create_height_provider_entity = ("Height_provider_entity created successfully", "Failed to create height_provider_entity")
create_test_ball = ("Ball created successfully", "Failed to create Ball")
@ -19,6 +20,7 @@ class Tests():
no_errors_and_warnings_found = ("No errors and warnings found", "Found errors and warnings")
#fmt: on
def Terrain_SupportsPhysics():
"""
Summary:
@ -46,8 +48,7 @@ def Terrain_SupportsPhysics():
:return: None
"""
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.utils import TestHelper as helper, Report
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.utils import Report, Tracer
import editor_python_test_tools.hydra_editor_utils as hydra
import azlmbr.math as azmath
@ -59,12 +60,9 @@ def Terrain_SupportsPhysics():
SET_BOX_X_SIZE = 1024.0
SET_BOX_Y_SIZE = 1024.0
SET_BOX_Z_SIZE = 100.0
helper.init_idle()
# 1) Load the level
helper.open_level("", "Base")
helper.wait_for_condition(lambda: general.get_current_level_name() == "Base", 2.0)
hydra.open_base_level()
#1a) Load the level components
hydra.add_level_component("Terrain World")

@ -47,8 +47,8 @@ def Terrain_World_ConfigurationWorks():
12) Check terrain does not exist at a known position outside the world
13) Check height value is the expected one when query resolution is changed
"""
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.utils import TestHelper as helper, Report
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.utils import Report, Tracer
import editor_python_test_tools.hydra_editor_utils as hydra
import azlmbr.math as azmath
@ -62,14 +62,11 @@ def Terrain_World_ConfigurationWorks():
SET_BOX_Y_SIZE = 2048.0
SET_BOX_Z_SIZE = 100.0
CLAMP = 1
helper.init_idle()
# 1) Start the Tracer to catch any errors and warnings
with Tracer() as section_tracer:
# 2) Load the level
helper.open_level("", "Base")
helper.wait_for_condition(lambda: general.get_current_level_name() == "Base", 2.0)
hydra.open_base_level()
# 3) Load the level components
terrain_world_component = hydra.add_level_component("Terrain World")

@ -3,25 +3,18 @@ Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# This suite consists of all test cases that are passing and have been verified.
import pytest
import os
import sys
from ly_test_tools import LAUNCHERS
from ly_test_tools.o3de.editor_test import EditorTestSuite, EditorSharedTest
@pytest.mark.SUITE_main
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
enable_prefab_system = False
class test_AxisAlignedBoxShape_ConfigurationWorks(EditorSharedTest):
from .EditorScripts import TerrainPhysicsCollider_ChangesSizeWithAxisAlignedBoxShapeChanges as test_module

@ -78,7 +78,7 @@ class TestAutomationBase:
file_system.restore_backup(workspace.paths.editor_log(), workspace.paths.project_log())
except FileNotFoundError as e:
self.logger.debug(f"File restoration failed, editor log could not be found.\nError: {e}")
editor.kill()
editor.stop()
request.addfinalizer(teardown)
@ -113,7 +113,7 @@ class TestAutomationBase:
editor.wait(TestAutomationBase.MAX_TIMEOUT)
except WaitTimeoutError:
errors.append(TestRunError("TIMEOUT", f"Editor did not close after {TestAutomationBase.MAX_TIMEOUT} seconds, verify the test is ending and the application didn't freeze"))
editor.kill()
editor.stop()
output = editor.get_output()
self.logger.debug("Test output:\n" + output)

@ -669,8 +669,14 @@
"Component_[7256163899440301540]": {
"$type": "EditorScriptCanvasComponent",
"Id": 7256163899440301540,
"m_name": "AutoComponent_RPC_NetLevelEntity",
"m_name": "AutoComponent_RPC_NetLevelEntity.scriptcanvas",
"runtimeDataIsValid": true,
"runtimeDataOverrides": {
"source": {
"id": "{1D517006-AC01-5ECA-AE66-0E007871F0CD}",
"path": "C:/prj/o3de/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas"
}
},
"sourceHandle": {
"id": "{1D517006-AC01-5ECA-AE66-0E007871F0CD}",
"path": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc_netlevelentity.scriptcanvas"

@ -91,22 +91,10 @@
"$type": "EditorScriptCanvasComponent",
"Id": 10596595655489113153,
"m_name": "AutoComponent_RPC",
"m_assetHolder": {
"m_asset": {
"assetId": {
"guid": "{5ED120C4-07DC-56F1-80A7-37BFC98FD74E}"
},
"assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc.scriptcanvas"
}
},
"runtimeDataIsValid": true,
"runtimeDataOverrides": {
"source": {
"assetId": {
"guid": "{5ED120C4-07DC-56F1-80A7-37BFC98FD74E}"
},
"assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc.scriptcanvas"
}
"sourceHandle": {
"id": "{5ED120C4-07DC-56F1-80A7-37BFC98FD74E}",
"path": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc.scriptcanvas"
}
},
"Component_[11440172471478606933]": {
@ -184,6 +172,13 @@
"$type": "EditorEntityIconComponent",
"Id": 9407892837096707905
},
"Component_[9505416969829669337]": {
"$type": "EditorTagComponent",
"Id": 9505416969829669337,
"Tags": [
"Player"
]
},
"Component_[9878555871810913249]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 9878555871810913249,

@ -0,0 +1,581 @@
{
"ContainerEntity": {
"Id": "Entity_[1146574390643]",
"Name": "Level",
"Components": {
"Component_[10641544592923449938]": {
"$type": "EditorInspectorComponent",
"Id": 10641544592923449938
},
"Component_[12039882709170782873]": {
"$type": "EditorOnlyEntityComponent",
"Id": 12039882709170782873
},
"Component_[12265484671603697631]": {
"$type": "EditorPendingCompositionComponent",
"Id": 12265484671603697631
},
"Component_[14126657869720434043]": {
"$type": "EditorEntitySortComponent",
"Id": 14126657869720434043
},
"Component_[15230859088967841193]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 15230859088967841193,
"Parent Entity": ""
},
"Component_[16239496886950819870]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 16239496886950819870
},
"Component_[5688118765544765547]": {
"$type": "EditorEntityIconComponent",
"Id": 5688118765544765547
},
"Component_[6545738857812235305]": {
"$type": "SelectionComponent",
"Id": 6545738857812235305
},
"Component_[7247035804068349658]": {
"$type": "EditorPrefabComponent",
"Id": 7247035804068349658
},
"Component_[9307224322037797205]": {
"$type": "EditorLockComponent",
"Id": 9307224322037797205
},
"Component_[9562516168917670048]": {
"$type": "EditorVisibilityComponent",
"Id": 9562516168917670048
}
}
},
"Entities": {
"Entity_[1155164325235]": {
"Id": "Entity_[1155164325235]",
"Name": "Sun",
"Components": {
"Component_[10440557478882592717]": {
"$type": "SelectionComponent",
"Id": 10440557478882592717
},
"Component_[13620450453324765907]": {
"$type": "EditorLockComponent",
"Id": 13620450453324765907
},
"Component_[2134313378593666258]": {
"$type": "EditorInspectorComponent",
"Id": 2134313378593666258
},
"Component_[234010807770404186]": {
"$type": "EditorVisibilityComponent",
"Id": 234010807770404186
},
"Component_[2970359110423865725]": {
"$type": "EditorEntityIconComponent",
"Id": 2970359110423865725
},
"Component_[3722854130373041803]": {
"$type": "EditorOnlyEntityComponent",
"Id": 3722854130373041803
},
"Component_[5992533738676323195]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 5992533738676323195
},
"Component_[7378860763541895402]": {
"$type": "AZ::Render::EditorDirectionalLightComponent",
"Id": 7378860763541895402,
"Controller": {
"Configuration": {
"Intensity": 1.0,
"CameraEntityId": "",
"ShadowFilterMethod": 1
}
}
},
"Component_[7892834440890947578]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 7892834440890947578,
"Parent Entity": "Entity_[1176639161715]",
"Transform Data": {
"Translate": [
0.0,
0.0,
13.487043380737305
],
"Rotate": [
-76.13099670410156,
-0.847000002861023,
-15.8100004196167
]
}
},
"Component_[8599729549570828259]": {
"$type": "EditorEntitySortComponent",
"Id": 8599729549570828259
},
"Component_[952797371922080273]": {
"$type": "EditorPendingCompositionComponent",
"Id": 952797371922080273
}
}
},
"Entity_[1159459292531]": {
"Id": "Entity_[1159459292531]",
"Name": "Ground",
"Components": {
"Component_[11701138785793981042]": {
"$type": "SelectionComponent",
"Id": 11701138785793981042
},
"Component_[12260880513256986252]": {
"$type": "EditorEntityIconComponent",
"Id": 12260880513256986252
},
"Component_[13711420870643673468]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 13711420870643673468
},
"Component_[138002849734991713]": {
"$type": "EditorOnlyEntityComponent",
"Id": 138002849734991713
},
"Component_[16578565737331764849]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 16578565737331764849,
"Parent Entity": "Entity_[1176639161715]"
},
"Component_[16919232076966545697]": {
"$type": "EditorInspectorComponent",
"Id": 16919232076966545697
},
"Component_[5182430712893438093]": {
"$type": "EditorMaterialComponent",
"Id": 5182430712893438093
},
"Component_[5675108321710651991]": {
"$type": "AZ::Render::EditorMeshComponent",
"Id": 5675108321710651991,
"Controller": {
"Configuration": {
"ModelAsset": {
"assetId": {
"guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}",
"subId": 277889906
},
"assetHint": "objects/groudplane/groundplane_512x512m.azmodel"
}
}
}
},
"Component_[5681893399601237518]": {
"$type": "EditorEntitySortComponent",
"Id": 5681893399601237518
},
"Component_[592692962543397545]": {
"$type": "EditorPendingCompositionComponent",
"Id": 592692962543397545
},
"Component_[7090012899106946164]": {
"$type": "EditorLockComponent",
"Id": 7090012899106946164
},
"Component_[9410832619875640998]": {
"$type": "EditorVisibilityComponent",
"Id": 9410832619875640998
}
}
},
"Entity_[1163754259827]": {
"Id": "Entity_[1163754259827]",
"Name": "Camera",
"Components": {
"Component_[11895140916889160460]": {
"$type": "EditorEntityIconComponent",
"Id": 11895140916889160460
},
"Component_[16880285896855930892]": {
"$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent",
"Id": 16880285896855930892,
"Controller": {
"Configuration": {
"Field of View": 55.0,
"EditorEntityId": 8929576024571800510
}
}
},
"Component_[17187464423780271193]": {
"$type": "EditorLockComponent",
"Id": 17187464423780271193
},
"Component_[17495696818315413311]": {
"$type": "EditorEntitySortComponent",
"Id": 17495696818315413311
},
"Component_[18086214374043522055]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 18086214374043522055,
"Parent Entity": "Entity_[1176639161715]",
"Transform Data": {
"Translate": [
-2.3000001907348633,
-3.9368600845336914,
1.0
],
"Rotate": [
-2.050307512283325,
1.9552897214889526,
-43.623355865478516
]
}
},
"Component_[18387556550380114975]": {
"$type": "SelectionComponent",
"Id": 18387556550380114975
},
"Component_[2654521436129313160]": {
"$type": "EditorVisibilityComponent",
"Id": 2654521436129313160
},
"Component_[5265045084611556958]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 5265045084611556958
},
"Component_[7169798125182238623]": {
"$type": "EditorPendingCompositionComponent",
"Id": 7169798125182238623
},
"Component_[7255796294953281766]": {
"$type": "GenericComponentWrapper",
"Id": 7255796294953281766,
"m_template": {
"$type": "FlyCameraInputComponent"
}
},
"Component_[8866210352157164042]": {
"$type": "EditorInspectorComponent",
"Id": 8866210352157164042
},
"Component_[9129253381063760879]": {
"$type": "EditorOnlyEntityComponent",
"Id": 9129253381063760879
}
}
},
"Entity_[1168049227123]": {
"Id": "Entity_[1168049227123]",
"Name": "Grid",
"Components": {
"Component_[11443347433215807130]": {
"$type": "EditorEntityIconComponent",
"Id": 11443347433215807130
},
"Component_[11779275529534764488]": {
"$type": "SelectionComponent",
"Id": 11779275529534764488
},
"Component_[14249419413039427459]": {
"$type": "EditorInspectorComponent",
"Id": 14249419413039427459
},
"Component_[15448581635946161318]": {
"$type": "AZ::Render::EditorGridComponent",
"Id": 15448581635946161318,
"Controller": {
"Configuration": {
"primarySpacing": 4.0,
"primaryColor": [
0.501960813999176,
0.501960813999176,
0.501960813999176
],
"secondarySpacing": 0.5,
"secondaryColor": [
0.250980406999588,
0.250980406999588,
0.250980406999588
]
}
}
},
"Component_[1843303322527297409]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 1843303322527297409
},
"Component_[380249072065273654]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 380249072065273654,
"Parent Entity": "Entity_[1176639161715]"
},
"Component_[7476660583684339787]": {
"$type": "EditorPendingCompositionComponent",
"Id": 7476660583684339787
},
"Component_[7557626501215118375]": {
"$type": "EditorEntitySortComponent",
"Id": 7557626501215118375
},
"Component_[7984048488947365511]": {
"$type": "EditorVisibilityComponent",
"Id": 7984048488947365511
},
"Component_[8118181039276487398]": {
"$type": "EditorOnlyEntityComponent",
"Id": 8118181039276487398
},
"Component_[9189909764215270515]": {
"$type": "EditorLockComponent",
"Id": 9189909764215270515
}
}
},
"Entity_[1172344194419]": {
"Id": "Entity_[1172344194419]",
"Name": "Shader Ball",
"Components": {
"Component_[10789351944715265527]": {
"$type": "EditorOnlyEntityComponent",
"Id": 10789351944715265527
},
"Component_[12037033284781049225]": {
"$type": "EditorEntitySortComponent",
"Id": 12037033284781049225
},
"Component_[13759153306105970079]": {
"$type": "EditorPendingCompositionComponent",
"Id": 13759153306105970079
},
"Component_[14135560884830586279]": {
"$type": "EditorInspectorComponent",
"Id": 14135560884830586279
},
"Component_[16247165675903986673]": {
"$type": "EditorVisibilityComponent",
"Id": 16247165675903986673
},
"Component_[18082433625958885247]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 18082433625958885247
},
"Component_[6472623349872972660]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 6472623349872972660,
"Parent Entity": "Entity_[1176639161715]",
"Transform Data": {
"Rotate": [
0.0,
0.10000000149011612,
180.0
]
}
},
"Component_[6495255223970673916]": {
"$type": "AZ::Render::EditorMeshComponent",
"Id": 6495255223970673916,
"Controller": {
"Configuration": {
"ModelAsset": {
"assetId": {
"guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}",
"subId": 281415304
},
"assetHint": "objects/shaderball/shaderball_default_1m.azmodel"
}
}
}
},
"Component_[8056625192494070973]": {
"$type": "SelectionComponent",
"Id": 8056625192494070973
},
"Component_[8550141614185782969]": {
"$type": "EditorEntityIconComponent",
"Id": 8550141614185782969
},
"Component_[9439770997198325425]": {
"$type": "EditorLockComponent",
"Id": 9439770997198325425
}
}
},
"Entity_[1176639161715]": {
"Id": "Entity_[1176639161715]",
"Name": "Atom Default Environment",
"Components": {
"Component_[10757302973393310045]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 10757302973393310045,
"Parent Entity": "Entity_[1146574390643]"
},
"Component_[14505817420424255464]": {
"$type": "EditorInspectorComponent",
"Id": 14505817420424255464,
"ComponentOrderEntryArray": [
{
"ComponentId": 10757302973393310045
}
]
},
"Component_[14988041764659020032]": {
"$type": "EditorLockComponent",
"Id": 14988041764659020032
},
"Component_[15808690248755038124]": {
"$type": "SelectionComponent",
"Id": 15808690248755038124
},
"Component_[15900837685796817138]": {
"$type": "EditorVisibilityComponent",
"Id": 15900837685796817138
},
"Component_[3298767348226484884]": {
"$type": "EditorOnlyEntityComponent",
"Id": 3298767348226484884
},
"Component_[4076975109609220594]": {
"$type": "EditorPendingCompositionComponent",
"Id": 4076975109609220594
},
"Component_[5679760548946028854]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 5679760548946028854
},
"Component_[5855590796136709437]": {
"$type": "EditorEntitySortComponent",
"Id": 5855590796136709437,
"ChildEntityOrderEntryArray": [
{
"EntityId": "Entity_[1155164325235]"
},
{
"EntityId": "Entity_[1180934129011]",
"SortIndex": 1
},
{
"EntityId": "Entity_[1172344194419]",
"SortIndex": 2
},
{
"EntityId": "Entity_[1168049227123]",
"SortIndex": 3
},
{
"EntityId": "Entity_[1163754259827]",
"SortIndex": 4
},
{
"EntityId": "Entity_[1159459292531]",
"SortIndex": 5
}
]
},
"Component_[9277695270015777859]": {
"$type": "EditorEntityIconComponent",
"Id": 9277695270015777859
}
}
},
"Entity_[1180934129011]": {
"Id": "Entity_[1180934129011]",
"Name": "Global Sky",
"Components": {
"Component_[11231930600558681245]": {
"$type": "AZ::Render::EditorHDRiSkyboxComponent",
"Id": 11231930600558681245,
"Controller": {
"Configuration": {
"CubemapAsset": {
"assetId": {
"guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}",
"subId": 1000
},
"assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage"
}
}
}
},
"Component_[11980494120202836095]": {
"$type": "SelectionComponent",
"Id": 11980494120202836095
},
"Component_[1428633914413949476]": {
"$type": "EditorLockComponent",
"Id": 1428633914413949476
},
"Component_[14936200426671614999]": {
"$type": "AZ::Render::EditorImageBasedLightComponent",
"Id": 14936200426671614999,
"Controller": {
"Configuration": {
"diffuseImageAsset": {
"assetId": {
"guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}",
"subId": 3000
},
"assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage"
},
"specularImageAsset": {
"assetId": {
"guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}",
"subId": 2000
},
"assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage"
}
}
}
},
"Component_[14994774102579326069]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 14994774102579326069
},
"Component_[15417479889044493340]": {
"$type": "EditorPendingCompositionComponent",
"Id": 15417479889044493340
},
"Component_[15826613364991382688]": {
"$type": "EditorEntitySortComponent",
"Id": 15826613364991382688
},
"Component_[1665003113283562343]": {
"$type": "EditorOnlyEntityComponent",
"Id": 1665003113283562343
},
"Component_[3704934735944502280]": {
"$type": "EditorEntityIconComponent",
"Id": 3704934735944502280
},
"Component_[5698542331457326479]": {
"$type": "EditorVisibilityComponent",
"Id": 5698542331457326479
},
"Component_[6644513399057217122]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 6644513399057217122,
"Parent Entity": "Entity_[1176639161715]"
},
"Component_[931091830724002070]": {
"$type": "EditorInspectorComponent",
"Id": 931091830724002070
}
}
}
},
"Instances": {
"Instance_[450137905015]": {
"Source": "Levels/Multiplayer/BasicConnectivity_Connects/Player.prefab",
"Patches": [
{
"op": "replace",
"path": "/ContainerEntity/Components/Component_[14438229160106431107]/Parent Entity",
"value": "../Entity_[1146574390643]"
},
{
"op": "replace",
"path": "/ContainerEntity/Components/Component_[14438229160106431107]/Transform Data/Translate/1",
"value": 10.0
}
]
}
}
}

@ -0,0 +1,118 @@
{
"ContainerEntity": {
"Id": "ContainerEntity",
"Name": "Player",
"Components": {
"Component_[10518577910351346732]": {
"$type": "EditorLockComponent",
"Id": 10518577910351346732
},
"Component_[10982887273490848966]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 10982887273490848966
},
"Component_[12400551793021799684]": {
"$type": "SelectionComponent",
"Id": 12400551793021799684
},
"Component_[1257365873906714292]": {
"$type": "EditorEntityIconComponent",
"Id": 1257365873906714292
},
"Component_[13311663931994949767]": {
"$type": "EditorOnlyEntityComponent",
"Id": 13311663931994949767
},
"Component_[14438229160106431107]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 14438229160106431107,
"Parent Entity": ""
},
"Component_[14636573223251575153]": {
"$type": "EditorVisibilityComponent",
"Id": 14636573223251575153
},
"Component_[18139850826775373128]": {
"$type": "EditorEntitySortComponent",
"Id": 18139850826775373128
},
"Component_[18149872971727933150]": {
"$type": "EditorInspectorComponent",
"Id": 18149872971727933150
},
"Component_[3361461948531668955]": {
"$type": "EditorPrefabComponent",
"Id": 3361461948531668955
},
"Component_[5198421115432838729]": {
"$type": "EditorPendingCompositionComponent",
"Id": 5198421115432838729
}
}
},
"Entities": {
"Entity_[458727839607]": {
"Id": "Entity_[458727839607]",
"Name": "Dummy",
"Components": {
"Component_[10453091667729858383]": {
"$type": "EditorLockComponent",
"Id": 10453091667729858383
},
"Component_[15287888392848689630]": {
"$type": "EditorEntityIconComponent",
"Id": 15287888392848689630
},
"Component_[15410933204460181490]": {
"$type": "EditorInspectorComponent",
"Id": 15410933204460181490,
"ComponentOrderEntryArray": [
{
"ComponentId": 868882495636022739
},
{
"ComponentId": 517239536919559179,
"SortIndex": 1
}
]
},
"Component_[17682830444684716936]": {
"$type": "EditorEntitySortComponent",
"Id": 17682830444684716936
},
"Component_[18433579260689698157]": {
"$type": "EditorPendingCompositionComponent",
"Id": 18433579260689698157
},
"Component_[2684999590909523769]": {
"$type": "SelectionComponent",
"Id": 2684999590909523769
},
"Component_[517239536919559179]": {
"$type": "GenericComponentWrapper",
"Id": 517239536919559179,
"m_template": {
"$type": "NetBindComponent"
}
},
"Component_[5980561685482761342]": {
"$type": "EditorDisabledCompositionComponent",
"Id": 5980561685482761342
},
"Component_[6553553408068929590]": {
"$type": "EditorVisibilityComponent",
"Id": 6553553408068929590
},
"Component_[8307469961954670365]": {
"$type": "EditorOnlyEntityComponent",
"Id": 8307469961954670365
},
"Component_[868882495636022739]": {
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
"Id": 868882495636022739,
"Parent Entity": "ContainerEntity"
}
}
}
}
}

@ -0,0 +1,12 @@
0,0,0,0,0,0
0,0,0,0,0,0
0,0,0,0,0,0
0,0,0,0,0,0
0,0,0,0,0,0
0,0,0,0,0,0
0,0,0,0,0,0
0,0,0,0,0,0
0,0,0,0,0,0
0,0,0,0,0,0
0,0,0,0,0,0
0,0,0,0,0,0

@ -0,0 +1,36 @@
{
"materialType": "Materials/Types/StandardPBR.materialtype",
"materialTypeVersion": 4,
"properties": {
"baseColor": {
"textureMap": "Materials/decal/airship_symbol_decal.tif"
},
"general": {
"doubleSided": true
},
"metallic": {
"useTexture": false
},
"normal": {
"useTexture": false
},
"opacity": {
"alphaSource": "Split",
"factor": 0.6899999976158142,
"mode": "Cutout",
"textureMap": "Materials/decal/airship_symbol_decal.tif"
},
"roughness": {
"useTexture": false
},
"specularF0": {
"useTexture": false
},
"uv": {
"center": [
0.0,
1.0
]
}
}
}

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2252ba28e19432d99e58fa03b672f855e1f520805eda71764e076fe349e1915a
size 4205906

@ -165,10 +165,6 @@ set(FILES
Logging/MissingAssetLogger.cpp
Logging/MissingAssetLogger.h
Logging/MissingAssetNotificationBus.h
Matchmaking/IMatchmakingRequests.h
Matchmaking/MatchmakingRequests.cpp
Matchmaking/MatchmakingRequests.h
Matchmaking/MatchmakingNotifications.h
Scene/Scene.h
Scene/Scene.inl
Scene/Scene.cpp
@ -182,13 +178,6 @@ set(FILES
Script/ScriptDebugMsgReflection.h
Script/ScriptRemoteDebugging.cpp
Script/ScriptRemoteDebugging.h
Session/ISessionHandlingRequests.h
Session/ISessionRequests.h
Session/SessionRequests.cpp
Session/SessionRequests.h
Session/SessionConfig.cpp
Session/SessionConfig.h
Session/SessionNotifications.h
StreamingInstall/StreamingInstall.h
StreamingInstall/StreamingInstall.cpp
StreamingInstall/StreamingInstallRequests.h

@ -19,45 +19,69 @@
namespace AzToolsFramework
{
namespace Prefab
{
//! A RootAliasPath can be used to store an alias path that starts from the Prefab EOS root instance.
//! The root instance itself is included in the path. These can be used as Instance handles across systems
//! that do not have visibility over InstanceOptionalReferences, or that need to store Instance handles
//! for longer than just the span of a function without the risk of them going out of scope.
using RootAliasPath = AliasPath;
}
class PrefabEditorEntityOwnershipInterface
{
public:
AZ_RTTI(PrefabEditorEntityOwnershipInterface,"{38E764BA-A089-49F3-848F-46018822CE2E}");
AZ_RTTI(PrefabEditorEntityOwnershipInterface, "{38E764BA-A089-49F3-848F-46018822CE2E}");
//! Returns whether the system has a root instance assigned.
//! @return True if a root prefab is assigned, false otherwise.
virtual bool IsRootPrefabAssigned() const = 0;
//! Returns an optional reference to the root prefab instance.
virtual Prefab::InstanceOptionalReference GetRootPrefabInstance() = 0;
//! Returns the template id for the root prefab instance.
virtual Prefab::TemplateId GetRootPrefabTemplateId() = 0;
virtual void CreateNewLevelPrefab(AZStd::string_view filename, const AZStd::string& templateFilename) = 0;
//! Creates a prefab instance with the provided entities and nestedPrefabInstances.
//! /param entities The entities to put under the new prefab.
//! /param nestedPrefabInstances The nested prefab instances to put under the new prefab.
//! /param filePath The filepath corresponding to the prefab file to be created.
//! /param instanceToParentUnder The instance the newly created prefab instance is parented under.
//! /return The optional reference to the prefab created.
//! @param entities The entities to put under the new prefab.
//! @param nestedPrefabInstances The nested prefab instances to put under the new prefab.
//! @param filePath The filepath corresponding to the prefab file to be created.
//! @param instanceToParentUnder The instance the newly created prefab instance is parented under.
//! @return The optional reference to the prefab created.
virtual Prefab::InstanceOptionalReference CreatePrefab(
const AZStd::vector<AZ::Entity*>& entities, AZStd::vector<AZStd::unique_ptr<Prefab::Instance>>&& nestedPrefabInstances,
AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder = AZStd::nullopt) = 0;
//! Instantiate the prefab file provided.
//! /param filePath The filepath for the prefab file the instance should be created from.
//! /param instanceToParentUnder The instance the newly instantiated prefab instance is parented under.
//! /return The optional reference to the prefab instance.
//! @param filePath The filepath for the prefab file the instance should be created from.
//! @param instanceToParentUnder The instance the newly instantiated prefab instance is parented under.
//! @return The optional reference to the prefab instance.
virtual Prefab::InstanceOptionalReference InstantiatePrefab(
AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder = AZStd::nullopt) = 0;
virtual Prefab::InstanceOptionalReference GetRootPrefabInstance() = 0;
virtual Prefab::TemplateId GetRootPrefabTemplateId() = 0;
virtual void StartPlayInEditor() = 0;
virtual void StopPlayInEditor() = 0;
//! Get all Assets generated by Prefab processing when entering Play-In Editor mode (Ctrl+G)
//! /return The vector of Assets generated by Prefab processing
//! @return The vector of Assets generated by Prefab processing
virtual const Prefab::PrefabConversionUtils::InMemorySpawnableAssetContainer::SpawnableAssets& GetPlayInEditorAssetData() const = 0;
virtual bool LoadFromStream(AZ::IO::GenericStream& stream, AZStd::string_view filename) = 0;
virtual bool SaveToStream(AZ::IO::GenericStream& stream, AZStd::string_view filename) = 0;
virtual void StartPlayInEditor() = 0;
virtual void StopPlayInEditor() = 0;
virtual void CreateNewLevelPrefab(AZStd::string_view filename, const AZStd::string& templateFilename) = 0;
//! Returns the reference to the instance corresponding to the RootAliasPath provided.
//! @param rootAliasPath The RootAliasPath to be queried.
//! @return A reference to the instance if valid, AZStd::nullopt otherwise.
virtual Prefab::InstanceOptionalReference GetInstanceReferenceFromRootAliasPath(Prefab::RootAliasPath rootAliasPath) const = 0;
virtual bool IsRootPrefabAssigned() const = 0;
//! Allows to iterate through all instances referenced in the path, from the root down.
//! @param rootAliasPath The RootAliasPath to iterate through. If invalid, callback will not be called.
//! @param callback The function to call on each instance. If it returns true, it prevents the rest of the path from being called.
//! @return True if the iteration was halted by a callback returning true, false otherwise. Also returns false if the path is invalid.
virtual bool GetInstancesInRootAliasPath(
Prefab::RootAliasPath rootAliasPath, const AZStd::function<bool(const Prefab::InstanceOptionalReference)>& callback) const = 0;
};
}

@ -510,6 +510,70 @@ namespace AzToolsFramework
m_playInEditorData.m_isEnabled = false;
}
bool PrefabEditorEntityOwnershipService::IsValidRootAliasPath(Prefab::RootAliasPath rootAliasPath) const
{
return GetInstanceReferenceFromRootAliasPath(rootAliasPath) != AZStd::nullopt;
}
Prefab::InstanceOptionalReference PrefabEditorEntityOwnershipService::GetInstanceReferenceFromRootAliasPath(
Prefab::RootAliasPath rootAliasPath) const
{
Prefab::InstanceOptionalReference instance = *m_rootInstance;
for (const auto& pathElement : rootAliasPath)
{
if (pathElement.Native() == rootAliasPath.begin()->Native())
{
// If the root is not the root Instance, the rootAliasPath is invalid.
if (pathElement.Native() != instance->get().GetInstanceAlias())
{
return Prefab::InstanceOptionalReference();
}
}
else
{
// If the instance alias can't be found, the rootAliasPath is invalid.
instance = instance->get().FindNestedInstance(pathElement.Native());
if (!instance.has_value())
{
return Prefab::InstanceOptionalReference();
}
}
}
return instance;
}
bool PrefabEditorEntityOwnershipService::GetInstancesInRootAliasPath(
Prefab::RootAliasPath rootAliasPath, const AZStd::function<bool(const Prefab::InstanceOptionalReference)>& callback) const
{
if (!IsValidRootAliasPath(rootAliasPath))
{
return false;
}
Prefab::InstanceOptionalReference instance;
for (const auto& pathElement : rootAliasPath)
{
if (!instance.has_value())
{
instance = *m_rootInstance;
}
else
{
instance = instance->get().FindNestedInstance(pathElement.Native());
}
if(callback(instance))
{
return true;
}
}
return false;
}
//////////////////////////////////////////////////////////////////////////
// Slice Buses implementation with Assert(false), this will exist only during Slice->Prefab
// development to pinpoint and replace specific calls to Slice system

@ -169,11 +169,17 @@ namespace AzToolsFramework
void CreateNewLevelPrefab(AZStd::string_view filename, const AZStd::string& templateFilename) override;
bool IsRootPrefabAssigned() const override;
Prefab::InstanceOptionalReference GetInstanceReferenceFromRootAliasPath(Prefab::RootAliasPath rootAliasPath) const override;
bool GetInstancesInRootAliasPath(
Prefab::RootAliasPath rootAliasPath, const AZStd::function<bool(const Prefab::InstanceOptionalReference)>& callback) const override;
protected:
AZ::SliceComponent::SliceInstanceAddress GetOwningSlice() override;
private:
bool IsValidRootAliasPath(Prefab::RootAliasPath rootAliasPath) const;
struct PlayInEditorData
{
AzToolsFramework::Prefab::PrefabConversionUtils::InMemorySpawnableAssetContainer m_assetsCache;

@ -177,7 +177,6 @@ namespace AzToolsFramework
AZStd::pair<Instance*, AZ::EntityId> GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath);
AZStd::pair<const Instance*, AZ::EntityId> GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath) const;
/**
* Gets the aliases of all the nested instances, which are sourced by the template with the given id.
*

@ -11,7 +11,6 @@
#include <AzToolsFramework/Commands/SelectionCommand.h>
#include <AzToolsFramework/ContainerEntity/ContainerEntityInterface.h>
#include <AzToolsFramework/Entity/EditorEntityHelpers.h>
#include <AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h>
#include <AzToolsFramework/Entity/ReadOnly/ReadOnlyEntityInterface.h>
#include <AzToolsFramework/Prefab/Instance/Instance.h>
#include <AzToolsFramework/Prefab/Instance/InstanceEntityMapperInterface.h>
@ -97,9 +96,9 @@ namespace AzToolsFramework::Prefab
ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequestBus::Events::SetSelectedEntities, selectedEntities);
}
// Edit Prefab
// Add undo element
{
auto editUndo = aznew PrefabFocusUndo("Edit Prefab");
auto editUndo = aznew PrefabFocusUndo("Focus Prefab");
editUndo->Capture(entityId);
editUndo->SetParent(undoBatch.GetUndoBatch());
FocusOnPrefabInstanceOwningEntityId(entityId);
@ -112,15 +111,24 @@ namespace AzToolsFramework::Prefab
[[maybe_unused]] AzFramework::EntityContextId entityContextId)
{
// If only one instance is in the hierarchy, this operation is invalid
size_t hierarchySize = m_instanceFocusHierarchy.size();
if (hierarchySize <= 1)
if (m_rootAliasFocusPathLength <= 1)
{
return AZ::Failure(
AZStd::string("Prefab Focus Handler: Could not complete FocusOnParentOfFocusedPrefab operation while focusing on the root."));
return AZ::Failure(AZStd::string(
"Prefab Focus Handler: Could not complete FocusOnParentOfFocusedPrefab operation while focusing on the root."));
}
RootAliasPath parentPath = m_rootAliasFocusPath;
parentPath.RemoveFilename();
// Retrieve parent of currently focused prefab.
InstanceOptionalReference parentInstance = GetReferenceFromContainerEntityId(m_instanceFocusHierarchy[hierarchySize - 2]);
InstanceOptionalReference parentInstance = GetInstanceReference(parentPath);
// If only one instance is in the hierarchy, this operation is invalid
if (!parentInstance.has_value())
{
return AZ::Failure(AZStd::string(
"Prefab Focus Handler: Could not retrieve parent of current focus in FocusOnParentOfFocusedPrefab."));
}
// Use container entity of parent Instance for focus operations.
AZ::EntityId entityId = parentInstance->get().GetContainerEntityId();
@ -136,9 +144,9 @@ namespace AzToolsFramework::Prefab
ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequestBus::Events::SetSelectedEntities, selectedEntities);
}
// Edit Prefab
// Add undo element
{
auto editUndo = aznew PrefabFocusUndo("Edit Prefab");
auto editUndo = aznew PrefabFocusUndo("Focus Prefab");
editUndo->Capture(entityId);
editUndo->SetParent(undoBatch.GetUndoBatch());
FocusOnPrefabInstanceOwningEntityId(entityId);
@ -149,12 +157,31 @@ namespace AzToolsFramework::Prefab
PrefabFocusOperationResult PrefabFocusHandler::FocusOnPathIndex([[maybe_unused]] AzFramework::EntityContextId entityContextId, int index)
{
if (index < 0 || index >= m_instanceFocusHierarchy.size())
if (index < 0 || index >= m_rootAliasFocusPathLength)
{
return AZ::Failure(AZStd::string("Prefab Focus Handler: Invalid index on FocusOnPathIndex."));
}
InstanceOptionalReference focusedInstance = GetReferenceFromContainerEntityId(m_instanceFocusHierarchy[index]);
int i = 0;
RootAliasPath indexedPath;
for (const auto& pathElement : m_rootAliasFocusPath)
{
indexedPath.Append(pathElement);
if (i == index)
{
break;
}
++i;
}
InstanceOptionalReference focusedInstance = GetInstanceReference(indexedPath);
if (!focusedInstance.has_value())
{
return AZ::Failure(AZStd::string::format("Prefab Focus Handler: Could not retrieve instance at index %i.", index));
}
return FocusOnOwningPrefab(focusedInstance->get().GetContainerEntityId());
}
@ -192,13 +219,14 @@ namespace AzToolsFramework::Prefab
}
// Close all container entities in the old path.
CloseInstanceContainers(m_instanceFocusHierarchy);
SetInstanceContainersOpenState(m_rootAliasFocusPath, false);
AZ::EntityId previousContainerEntityId = m_focusedInstanceContainerEntityId;
const RootAliasPath previousContainerRootAliasPath = m_rootAliasFocusPath;
const InstanceOptionalConstReference previousFocusedInstance = GetInstanceReference(previousContainerRootAliasPath);
// Do not store the container for the root instance, use an invalid EntityId instead.
m_focusedInstanceContainerEntityId = focusedInstance->get().GetParentInstance().has_value() ? focusedInstance->get().GetContainerEntityId() : AZ::EntityId();
m_rootAliasFocusPath = focusedInstance->get().GetAbsoluteInstanceAliasPath();
m_focusedTemplateId = focusedInstance->get().GetTemplateId();
m_rootAliasFocusPathLength = aznumeric_cast<int>(AZStd::distance(m_rootAliasFocusPath.begin(), m_rootAliasFocusPath.end()));
// Focus on the descendants of the container entity in the Editor, if the interface is initialized.
if (m_focusModeInterface)
@ -214,15 +242,22 @@ namespace AzToolsFramework::Prefab
// Refresh the read-only cache, if the interface is initialized.
if (m_readOnlyEntityQueryInterface)
{
m_readOnlyEntityQueryInterface->RefreshReadOnlyState({ previousContainerEntityId, m_focusedInstanceContainerEntityId });
EntityIdList containerEntities;
if (previousFocusedInstance.has_value())
{
containerEntities.push_back(previousFocusedInstance->get().GetContainerEntityId());
}
containerEntities.push_back(focusedInstance->get().GetContainerEntityId());
m_readOnlyEntityQueryInterface->RefreshReadOnlyState(containerEntities);
}
// Refresh path variables.
RefreshInstanceFocusList();
RefreshInstanceFocusPath();
// Open all container entities in the new path.
OpenInstanceContainers(m_instanceFocusHierarchy);
SetInstanceContainersOpenState(m_rootAliasFocusPath, true);
PrefabFocusNotificationBus::Broadcast(&PrefabFocusNotifications::OnPrefabFocusChanged);
@ -237,17 +272,12 @@ namespace AzToolsFramework::Prefab
InstanceOptionalReference PrefabFocusHandler::GetFocusedPrefabInstance(
[[maybe_unused]] AzFramework::EntityContextId entityContextId) const
{
return GetReferenceFromContainerEntityId(m_focusedInstanceContainerEntityId);
return GetInstanceReference(m_rootAliasFocusPath);
}
AZ::EntityId PrefabFocusHandler::GetFocusedPrefabContainerEntityId([[maybe_unused]] AzFramework::EntityContextId entityContextId) const
{
if (m_focusedInstanceContainerEntityId.IsValid())
{
return m_focusedInstanceContainerEntityId;
}
if (auto instance = GetReferenceFromContainerEntityId(m_focusedInstanceContainerEntityId); instance.has_value())
if (const InstanceOptionalConstReference instance = GetInstanceReference(m_rootAliasFocusPath); instance.has_value())
{
return instance->get().GetContainerEntityId();
}
@ -262,19 +292,13 @@ namespace AzToolsFramework::Prefab
return false;
}
InstanceOptionalReference instance = m_instanceEntityMapperInterface->FindOwningInstance(entityId);
const InstanceOptionalConstReference instance = m_instanceEntityMapperInterface->FindOwningInstance(entityId);
if (!instance.has_value())
{
return false;
}
// If this is owned by the root instance, that corresponds to an invalid m_focusedInstanceContainerEntityId.
if (!instance->get().GetParentInstance().has_value())
{
return !m_focusedInstanceContainerEntityId.IsValid();
}
return (instance->get().GetContainerEntityId() == m_focusedInstanceContainerEntityId);
return (instance->get().GetAbsoluteInstanceAliasPath() == m_rootAliasFocusPath);
}
bool PrefabFocusHandler::IsOwningPrefabInFocusHierarchy(AZ::EntityId entityId) const
@ -284,18 +308,10 @@ namespace AzToolsFramework::Prefab
return false;
}
// If the focus is on the root, m_focusedInstanceContainerEntityId will be the invalid id.
// In those case all entities are in the focus hierarchy and should return true.
if (!m_focusedInstanceContainerEntityId.IsValid())
{
return true;
}
InstanceOptionalReference instance = m_instanceEntityMapperInterface->FindOwningInstance(entityId);
InstanceOptionalConstReference instance = m_instanceEntityMapperInterface->FindOwningInstance(entityId);
while (instance.has_value())
{
if (instance->get().GetContainerEntityId() == m_focusedInstanceContainerEntityId)
if (instance->get().GetAbsoluteInstanceAliasPath() == m_rootAliasFocusPath)
{
return true;
}
@ -308,40 +324,47 @@ namespace AzToolsFramework::Prefab
const AZ::IO::Path& PrefabFocusHandler::GetPrefabFocusPath([[maybe_unused]] AzFramework::EntityContextId entityContextId) const
{
return m_instanceFocusPath;
return m_filenameFocusPath;
}
const int PrefabFocusHandler::GetPrefabFocusPathLength([[maybe_unused]] AzFramework::EntityContextId entityContextId) const
{
return aznumeric_cast<int>(m_instanceFocusHierarchy.size());
return m_rootAliasFocusPathLength;
}
void PrefabFocusHandler::OnContextReset()
{
// Clear the old focus vector
m_instanceFocusHierarchy.clear();
// Focus on the root prefab (AZ::EntityId() will default to it)
FocusOnPrefabInstanceOwningEntityId(AZ::EntityId());
}
void PrefabFocusHandler::OnEntityInfoUpdatedName(AZ::EntityId entityId, [[maybe_unused]]const AZStd::string& name)
{
// Determine if the entityId is the container for any of the instances in the vector.
auto result = AZStd::find_if(
m_instanceFocusHierarchy.begin(), m_instanceFocusHierarchy.end(),
[&, entityId](const AZ::EntityId& containerEntityId)
{
InstanceOptionalReference instance = GetReferenceFromContainerEntityId(containerEntityId);
return (instance->get().GetContainerEntityId() == entityId);
}
);
PrefabEditorEntityOwnershipInterface* prefabEditorEntityOwnershipInterface =
AZ::Interface<PrefabEditorEntityOwnershipInterface>::Get();
if (result != m_instanceFocusHierarchy.end())
if (prefabEditorEntityOwnershipInterface)
{
// Refresh the path and notify changes.
RefreshInstanceFocusPath();
PrefabFocusNotificationBus::Broadcast(&PrefabFocusNotifications::OnPrefabFocusChanged);
// Determine if the entityId is the container for any of the instances in the vector.
bool match = prefabEditorEntityOwnershipInterface->GetInstancesInRootAliasPath(
m_rootAliasFocusPath,
[&](const Prefab::InstanceOptionalReference instance)
{
if (instance->get().GetContainerEntityId() == entityId)
{
return true;
}
return false;
}
);
if (match)
{
// Refresh the path and notify changes.
RefreshInstanceFocusPath();
PrefabFocusNotificationBus::Broadcast(&PrefabFocusNotifications::OnPrefabFocusChanged);
}
}
}
@ -354,142 +377,116 @@ namespace AzToolsFramework::Prefab
void PrefabFocusHandler::OnPrefabTemplateDirtyFlagUpdated(TemplateId templateId, [[maybe_unused]] bool status)
{
// Determine if the templateId matches any of the instances in the vector.
auto result = AZStd::find_if(
m_instanceFocusHierarchy.begin(), m_instanceFocusHierarchy.end(),
[&, templateId](const AZ::EntityId& containerEntityId)
{
InstanceOptionalReference instance = GetReferenceFromContainerEntityId(containerEntityId);
return (instance->get().GetTemplateId() == templateId);
}
);
PrefabEditorEntityOwnershipInterface* prefabEditorEntityOwnershipInterface =
AZ::Interface<PrefabEditorEntityOwnershipInterface>::Get();
if (result != m_instanceFocusHierarchy.end())
if (prefabEditorEntityOwnershipInterface)
{
// Refresh the path and notify changes.
RefreshInstanceFocusPath();
PrefabFocusNotificationBus::Broadcast(&PrefabFocusNotifications::OnPrefabFocusChanged);
}
}
void PrefabFocusHandler::RefreshInstanceFocusList()
{
m_instanceFocusHierarchy.clear();
// Determine if the templateId matches any of the instances in the vector.
bool match = prefabEditorEntityOwnershipInterface->GetInstancesInRootAliasPath(
m_rootAliasFocusPath,
[&](const Prefab::InstanceOptionalReference instance)
{
if (instance->get().GetTemplateId() == templateId)
{
return true;
}
AZStd::list<InstanceOptionalReference> instanceFocusList;
return false;
}
);
InstanceOptionalReference currentInstance = GetReferenceFromContainerEntityId(m_focusedInstanceContainerEntityId);
while (currentInstance.has_value())
{
if (currentInstance->get().GetParentInstance().has_value())
if (match)
{
m_instanceFocusHierarchy.emplace_back(currentInstance->get().GetContainerEntityId());
// Refresh the path and notify changes.
RefreshInstanceFocusPath();
PrefabFocusNotificationBus::Broadcast(&PrefabFocusNotifications::OnPrefabFocusChanged);
}
else
{
m_instanceFocusHierarchy.emplace_back(AZ::EntityId());
}
currentInstance = currentInstance->get().GetParentInstance();
}
// Invert the vector, since we need the top instance to be at index 0.
AZStd::reverse(m_instanceFocusHierarchy.begin(), m_instanceFocusHierarchy.end());
}
void PrefabFocusHandler::RefreshInstanceFocusPath()
{
auto prefabSystemComponentInterface = AZ::Interface<PrefabSystemComponentInterface>::Get();
m_instanceFocusPath.clear();
size_t index = 0;
size_t maxIndex = m_instanceFocusHierarchy.size() - 1;
m_filenameFocusPath.clear();
PrefabEditorEntityOwnershipInterface* prefabEditorEntityOwnershipInterface =
AZ::Interface<PrefabEditorEntityOwnershipInterface>::Get();
PrefabSystemComponentInterface* prefabSystemComponentInterface = AZ::Interface<PrefabSystemComponentInterface>::Get();
for (const AZ::EntityId& containerEntityId : m_instanceFocusHierarchy)
if (prefabEditorEntityOwnershipInterface && prefabSystemComponentInterface)
{
InstanceOptionalReference instance = GetReferenceFromContainerEntityId(containerEntityId);
if (instance.has_value())
{
AZStd::string prefabName;
int i = 0;
if (index < maxIndex)
prefabEditorEntityOwnershipInterface->GetInstancesInRootAliasPath(
m_rootAliasFocusPath,
[&](const Prefab::InstanceOptionalReference instance)
{
// Get the filename without the extension (stem).
prefabName = instance->get().GetTemplateSourcePath().Stem().Native();
if (instance.has_value())
{
AZStd::string prefabName;
if (i == m_rootAliasFocusPathLength - 1)
{
// Get the full filename.
prefabName = instance->get().GetTemplateSourcePath().Filename().Native();
}
else
{
// Get the filename without the extension (stem).
prefabName = instance->get().GetTemplateSourcePath().Stem().Native();
}
if (prefabSystemComponentInterface->IsTemplateDirty(instance->get().GetTemplateId()))
{
prefabName += "*";
}
m_filenameFocusPath.Append(prefabName);
}
++i;
return false;
}
else
{
// Get the full filename.
prefabName = instance->get().GetTemplateSourcePath().Filename().Native();
}
if (prefabSystemComponentInterface->IsTemplateDirty(instance->get().GetTemplateId()))
{
prefabName += "*";
}
m_instanceFocusPath.Append(prefabName);
}
++index;
);
}
}
void PrefabFocusHandler::OpenInstanceContainers(const AZStd::vector<AZ::EntityId>& instances) const
void PrefabFocusHandler::SetInstanceContainersOpenState(const RootAliasPath& rootAliasPath, bool openState) const
{
// If this is called outside the Editor, this interface won't be initialized.
if (!m_containerEntityInterface)
{
return;
}
for (const AZ::EntityId& containerEntityId : instances)
{
InstanceOptionalReference instance = GetReferenceFromContainerEntityId(containerEntityId);
if (instance.has_value())
{
m_containerEntityInterface->SetContainerOpen(instance->get().GetContainerEntityId(), true);
}
}
}
void PrefabFocusHandler::CloseInstanceContainers(const AZStd::vector<AZ::EntityId>& instances) const
{
// If this is called outside the Editor, this interface won't be initialized.
if (!m_containerEntityInterface)
{
return;
}
PrefabEditorEntityOwnershipInterface* prefabEditorEntityOwnershipInterface =
AZ::Interface<PrefabEditorEntityOwnershipInterface>::Get();
for (const AZ::EntityId& containerEntityId : instances)
if (prefabEditorEntityOwnershipInterface)
{
InstanceOptionalReference instance = GetReferenceFromContainerEntityId(containerEntityId);
prefabEditorEntityOwnershipInterface->GetInstancesInRootAliasPath(
rootAliasPath,
[&](const Prefab::InstanceOptionalReference instance)
{
m_containerEntityInterface->SetContainerOpen(instance->get().GetContainerEntityId(), openState);
if (instance.has_value())
{
m_containerEntityInterface->SetContainerOpen(instance->get().GetContainerEntityId(), false);
}
return false;
}
);
}
}
InstanceOptionalReference PrefabFocusHandler::GetReferenceFromContainerEntityId(AZ::EntityId containerEntityId) const
InstanceOptionalReference PrefabFocusHandler::GetInstanceReference(RootAliasPath rootAliasPath) const
{
if (!containerEntityId.IsValid())
{
PrefabEditorEntityOwnershipInterface* prefabEditorEntityOwnershipInterface =
AZ::Interface<PrefabEditorEntityOwnershipInterface>::Get();
PrefabEditorEntityOwnershipInterface* prefabEditorEntityOwnershipInterface =
AZ::Interface<PrefabEditorEntityOwnershipInterface>::Get();
if (!prefabEditorEntityOwnershipInterface)
{
return AZStd::nullopt;
}
return prefabEditorEntityOwnershipInterface->GetRootPrefabInstance();
if (prefabEditorEntityOwnershipInterface)
{
return prefabEditorEntityOwnershipInterface->GetInstanceReferenceFromRootAliasPath(rootAliasPath);
}
return m_instanceEntityMapperInterface->FindOwningInstance(containerEntityId);
return AZStd::nullopt;
}
} // namespace AzToolsFramework::Prefab

@ -12,6 +12,7 @@
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
#include <AzToolsFramework/Entity/EditorEntityInfoBus.h>
#include <AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h>
#include <AzToolsFramework/FocusMode/FocusModeInterface.h>
#include <AzToolsFramework/Prefab/PrefabFocusInterface.h>
#include <AzToolsFramework/Prefab/PrefabFocusPublicInterface.h>
@ -28,6 +29,7 @@ namespace AzToolsFramework
namespace AzToolsFramework::Prefab
{
class InstanceEntityMapperInterface;
class PrefabSystemComponentInterface;
//! Handles Prefab Focus mode, determining which prefab file entity changes will target.
class PrefabFocusHandler final
@ -73,23 +75,20 @@ namespace AzToolsFramework::Prefab
private:
PrefabFocusOperationResult FocusOnPrefabInstance(InstanceOptionalReference focusedInstance);
void RefreshInstanceFocusList();
void RefreshInstanceFocusPath();
void OpenInstanceContainers(const AZStd::vector<AZ::EntityId>& instances) const;
void CloseInstanceContainers(const AZStd::vector<AZ::EntityId>& instances) const;
void SetInstanceContainersOpenState(const RootAliasPath& rootAliasPath, bool openState) const;
InstanceOptionalReference GetReferenceFromContainerEntityId(AZ::EntityId containerEntityId) const;
InstanceOptionalReference GetInstanceReference(RootAliasPath rootAliasPath) const;
//! The EntityId of the prefab container entity for the instance the editor is currently focusing on.
AZ::EntityId m_focusedInstanceContainerEntityId = AZ::EntityId();
//! The alias path for the instance the editor is currently focusing on, starting from the root instance.
RootAliasPath m_rootAliasFocusPath = RootAliasPath();
//! The templateId of the focused instance.
TemplateId m_focusedTemplateId;
//! The list of instances going from the root (index 0) to the focused instance,
//! referenced by their prefab container's EntityId.
AZStd::vector<AZ::EntityId> m_instanceFocusHierarchy;
//! A path containing the filenames of the instances in the focus hierarchy, separated with a /.
AZ::IO::Path m_instanceFocusPath;
AZ::IO::Path m_filenameFocusPath;
//! The length of the current focus path. Stored to simplify internal checks.
int m_rootAliasFocusPathLength = 0;
ContainerEntityInterface* m_containerEntityInterface = nullptr;
FocusModeInterface* m_focusModeInterface = nullptr;

@ -349,7 +349,7 @@ namespace AzToolsFramework
return false;
}
StatementPrototype stmt("SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name=:1;");
StatementPrototype stmt("SELECT COUNT(*) FROM sqlite_schema WHERE type='table' AND name=:1;");
Statement* execute = stmt.Prepare(m_db); // execute now belongs to stmt and will die when stmt leaves scope.
if (!execute->Prepared())
{
@ -501,7 +501,7 @@ namespace AzToolsFramework
// https://www.sqlite.org/c3ref/prepare.html ^^^^^^^^^
int res = sqlite3_prepare_v2(db, m_parentPrototype->GetSqlText().c_str(), (int)m_parentPrototype->GetSqlText().length() + 1, &m_statement, NULL);
AZ_Assert(res == SQLITE_OK, "Statement::PrepareFirstTime: failed! %s ( prototype is '%s'). Error code returned is %d.", sqlite3_errmsg(db), m_parentPrototype->GetSqlText().c_str(), res);
return ((res == SQLITE_OK)&&(m_statement));
}
@ -703,7 +703,7 @@ namespace AzToolsFramework
int res = sqlite3_clear_bindings(m_statement);
AZ_Assert(res == SQLITE_OK, "Statement::sqlite3_clear_bindings: failed!");
return (res == SQLITE_OK);
}
int Statement::GetNamedParamIdx(const char* name)

@ -783,6 +783,7 @@ namespace AzToolsFramework
}
EBUS_EVENT(ToolsApplicationEvents::Bus, InvalidatePropertyDisplay, Refresh_EntireTree);
ToolsApplicationRequests::Bus::Broadcast(&ToolsApplicationRequests::Bus::Events::AddDirtyEntity, GetEntityId());
}
void ScriptEditorComponent::LoadProperties()

@ -41,6 +41,11 @@ namespace UnitTest
&AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded,
AzToolsFramework::EntityList{ m_entityMap[Passenger1EntityName], m_entityMap[Passenger2EntityName], m_entityMap[CityEntityName] });
// Initialize Prefab EOS Interface
AzToolsFramework::PrefabEditorEntityOwnershipInterface* prefabEditorEntityOwnershipInterface =
AZ::Interface<AzToolsFramework::PrefabEditorEntityOwnershipInterface>::Get();
ASSERT_TRUE(prefabEditorEntityOwnershipInterface);
// Create a car prefab from the passenger1 entity. The container entity will be created as part of the process.
AZStd::unique_ptr<AzToolsFramework::Prefab::Instance> carInstance =
m_prefabSystemComponent->CreatePrefab({ m_entityMap[Passenger1EntityName] }, {}, "test/car");
@ -59,11 +64,14 @@ namespace UnitTest
ASSERT_TRUE(streetInstance);
m_instanceMap[StreetEntityName] = streetInstance.get();
// Create a city prefab that nests the street instances created above and the city entity. The container entity will be created as part of the process.
m_rootInstance =
m_prefabSystemComponent->CreatePrefab({ m_entityMap[CityEntityName] }, MakeInstanceList(AZStd::move(streetInstance)), "test/city");
ASSERT_TRUE(m_rootInstance);
m_instanceMap[CityEntityName] = m_rootInstance.get();
// Use the Prefab EOS root instance as the City instance. This will ensure functions that go through the EOS work in these tests too.
m_rootInstance = prefabEditorEntityOwnershipInterface->GetRootPrefabInstance();
ASSERT_TRUE(m_rootInstance.has_value());
m_rootInstance->get().AddEntity(*m_entityMap[CityEntityName]);
m_rootInstance->get().AddInstance(AZStd::move(streetInstance));
m_instanceMap[CityEntityName] = &m_rootInstance->get();
}
void SetUpEditorFixtureImpl() override
@ -84,7 +92,7 @@ namespace UnitTest
void TearDownEditorFixtureImpl() override
{
m_rootInstance.release();
m_rootInstance->get().Reset();
PrefabTestFixture::TearDownEditorFixtureImpl();
}
@ -92,7 +100,7 @@ namespace UnitTest
AZStd::unordered_map<AZStd::string, AZ::Entity*> m_entityMap;
AZStd::unordered_map<AZStd::string, Instance*> m_instanceMap;
AZStd::unique_ptr<AzToolsFramework::Prefab::Instance> m_rootInstance;
InstanceOptionalReference m_rootInstance;
PrefabFocusInterface* m_prefabFocusInterface = nullptr;
PrefabFocusPublicInterface* m_prefabFocusPublicInterface = nullptr;
@ -106,9 +114,7 @@ namespace UnitTest
inline static const char* Passenger2EntityName = "Passenger2";
};
// Test was disabled because the implementation of GetFocusedPrefabInstance now relies on the Prefab EOS,
// which is not used by our test environment. This can be restored once Instance handles are implemented.
TEST_F(PrefabFocusTests, DISABLED_PrefabFocus_FocusOnOwningPrefab_RootContainer)
TEST_F(PrefabFocusTests, FocusOnOwningPrefabRootContainer)
{
// Verify FocusOnOwningPrefab works when passing the container entity of the root prefab.
{
@ -123,9 +129,7 @@ namespace UnitTest
}
}
// Test was disabled because the implementation of GetFocusedPrefabInstance now relies on the Prefab EOS,
// which is not used by our test environment. This can be restored once Instance handles are implemented.
TEST_F(PrefabFocusTests, DISABLED_PrefabFocus_FocusOnOwningPrefab_RootEntity)
TEST_F(PrefabFocusTests, FocusOnOwningPrefabRootEntity)
{
// Verify FocusOnOwningPrefab works when passing a nested entity of the root prefab.
{
@ -140,7 +144,7 @@ namespace UnitTest
}
}
TEST_F(PrefabFocusTests, PrefabFocus_FocusOnOwningPrefab_NestedContainer)
TEST_F(PrefabFocusTests, FocusOnOwningPrefabNestedContainer)
{
// Verify FocusOnOwningPrefab works when passing the container entity of a nested prefab.
{
@ -154,7 +158,7 @@ namespace UnitTest
}
}
TEST_F(PrefabFocusTests, PrefabFocus_FocusOnOwningPrefab_NestedEntity)
TEST_F(PrefabFocusTests, FocusOnOwningPrefabNestedEntity)
{
// Verify FocusOnOwningPrefab works when passing a nested entity of the a nested prefab.
{
@ -168,7 +172,7 @@ namespace UnitTest
}
}
TEST_F(PrefabFocusTests, PrefabFocus_FocusOnOwningPrefab_Clear)
TEST_F(PrefabFocusTests, FocusOnOwningPrefabClear)
{
// Verify FocusOnOwningPrefab points to the root prefab when the focus is cleared.
{
@ -188,7 +192,32 @@ namespace UnitTest
}
}
TEST_F(PrefabFocusTests, PrefabFocus_IsOwningPrefabBeingFocused_Content)
TEST_F(PrefabFocusTests, FocusOnParentOfFocusedPrefabLeaf)
{
// Call FocusOnParentOfFocusedPrefab on a leaf instance and verify the parent is focused correctly.
{
m_prefabFocusPublicInterface->FocusOnOwningPrefab(m_instanceMap[CarEntityName]->GetContainerEntityId());
m_prefabFocusPublicInterface->FocusOnParentOfFocusedPrefab(m_editorEntityContextId);
EXPECT_EQ(
&m_prefabFocusInterface->GetFocusedPrefabInstance(m_editorEntityContextId)->get(),
m_instanceMap[StreetEntityName]
);
}
}
TEST_F(PrefabFocusTests, FocusOnParentOfFocusedPrefabRoot)
{
// Call FocusOnParentOfFocusedPrefab on the root instance and verify the operation fails.
{
m_prefabFocusPublicInterface->FocusOnOwningPrefab(m_instanceMap[CityEntityName]->GetContainerEntityId());
auto outcome = m_prefabFocusPublicInterface->FocusOnParentOfFocusedPrefab(m_editorEntityContextId);
EXPECT_FALSE(outcome.IsSuccess());
}
}
TEST_F(PrefabFocusTests, IsOwningPrefabBeingFocusedContent)
{
// Verify IsOwningPrefabBeingFocused returns true for all entities in a focused prefab (container/nested)
{
@ -199,7 +228,7 @@ namespace UnitTest
}
}
TEST_F(PrefabFocusTests, PrefabFocus_IsOwningPrefabBeingFocused_AncestorsDescendants)
TEST_F(PrefabFocusTests, IsOwningPrefabBeingFocusedAncestorsDescendants)
{
// Verify IsOwningPrefabBeingFocused returns false for all entities not in a focused prefab (ancestors/descendants)
{
@ -213,7 +242,7 @@ namespace UnitTest
}
}
TEST_F(PrefabFocusTests, PrefabFocus_IsOwningPrefabBeingFocused_Siblings)
TEST_F(PrefabFocusTests, IsOwningPrefabBeingFocusedSiblings)
{
// Verify IsOwningPrefabBeingFocused returns false for all entities not in a focused prefab (siblings)
{

@ -44,8 +44,6 @@ ly_add_target(
AZ::AssetBuilderSDK
AZ::AssetBuilder.Static
${additional_dependencies}
RUNTIME_DEPENDENCIES
AZ::AssetBuilder
)
# Aggregates all combined AssetBuilders into a single LY_ASSET_BUILDERS #define
@ -76,6 +74,8 @@ ly_add_target(
BUILD_DEPENDENCIES
PRIVATE
AZ::AssetProcessor.Static
RUNTIME_DEPENDENCIES
AZ::AssetBuilder
)
# Adds the AssetProcessor target as a C preprocessor define so that it can be used as a Settings Registry
@ -122,6 +122,8 @@ ly_add_target(
BUILD_DEPENDENCIES
PRIVATE
AZ::AssetProcessorBatch.Static
RUNTIME_DEPENDENCIES
AZ::AssetBuilder
)
if(LY_DEFAULT_PROJECT_PATH)

@ -2942,11 +2942,20 @@ namespace AssetProcessor
// File is a source file that has been processed before
AZStd::string fingerprintFromDatabase = sourceFileItr->m_analysisFingerprint.toUtf8().data();
AZStd::string_view builderEntries(fingerprintFromDatabase.begin() + s_lengthOfUuid + 1, fingerprintFromDatabase.end());
AZStd::string_view dependencyFingerprint(fingerprintFromDatabase.begin(), fingerprintFromDatabase.begin() + s_lengthOfUuid);
int numBuildersEmittingSourceDependencies = 0;
if (!fingerprintFromDatabase.empty() && AreBuildersUnchanged(builderEntries, numBuildersEmittingSourceDependencies))
{
// Builder(s) have not changed since last time
AZStd::string currentFingerprint = ComputeRecursiveDependenciesFingerprint(
fileInfo.m_filePath.toUtf8().constData(), sourceFileItr->m_sourceDatabaseName.toUtf8().constData());
if(dependencyFingerprint != currentFingerprint)
{
// Dependencies have changed
return false;
}
// Success - we can skip this file, nothing has changed!
// Remove it from the list of to-be-processed files, otherwise the AP will assume the file was deleted
@ -4311,6 +4320,32 @@ namespace AssetProcessor
}
}
AZStd::string AssetProcessorManager::ComputeRecursiveDependenciesFingerprint(const AZStd::string& fileAbsolutePath, const AZStd::string& fileDatabaseName)
{
AZStd::string concatenatedFingerprints;
// QSet is not ordered.
SourceFilesForFingerprintingContainer knownDependenciesAbsolutePaths;
// this automatically adds the input file to the list:
QueryAbsolutePathDependenciesRecursive(QString::fromUtf8(fileDatabaseName.c_str()), knownDependenciesAbsolutePaths,
AzToolsFramework::AssetDatabase::SourceFileDependencyEntry::DEP_Any, false);
AddMetadataFilesForFingerprinting(QString::fromUtf8(fileAbsolutePath.c_str()), knownDependenciesAbsolutePaths);
// reserve 17 chars for each since its a 64 bit hex number, and then one more for the dash inbetween each.
constexpr int bytesPerFingerprint = (sizeof(AZ::u64) * 2) + 1; // 2 HEX characters per byte +1 for the `-` we will add between each fingerprint
concatenatedFingerprints.reserve((knownDependenciesAbsolutePaths.size() * bytesPerFingerprint));
for (const auto& element : knownDependenciesAbsolutePaths)
{
// if its a placeholder then don't bother hitting the disk to find it.
concatenatedFingerprints.append(AssetUtilities::GetFileFingerprint(element.first, element.second));
concatenatedFingerprints.append("-");
}
// to keep this from growing out of hand, we don't use the full string, we use a hash of it:
return AZ::Uuid::CreateName(concatenatedFingerprints.c_str()).ToString<AZStd::string>();
}
void AssetProcessorManager::FinishAnalysis(AZStd::string fileToCheck)
{
using namespace AzToolsFramework::AssetDatabase;
@ -4378,29 +4413,9 @@ namespace AssetProcessor
if (found)
{
// construct the analysis fingerprint
// the format for this data is "modtimefingerprint:builder0:builder1:builder2:...:buildern"
source.m_analysisFingerprint.clear();
// compute mod times:
// get the appropriate modtimes:
AZStd::string modTimeArray;
// the format for this data is "hashfingerprint:builder0:builder1:builder2:...:buildern"
source.m_analysisFingerprint = ComputeRecursiveDependenciesFingerprint(fileToCheck, analysisTracker->m_databaseSourceName);
// QSet is not ordered.
SourceFilesForFingerprintingContainer knownDependenciesAbsolutePaths;
// this automatically adds the input file to the list:
QueryAbsolutePathDependenciesRecursive(QString::fromUtf8(analysisTracker->m_databaseSourceName.c_str()), knownDependenciesAbsolutePaths, SourceFileDependencyEntry::DEP_Any, false);
AddMetadataFilesForFingerprinting(QString::fromUtf8(fileToCheck.c_str()), knownDependenciesAbsolutePaths);
// reserve 17 chars for each since its a 64 bit hex number, and then one more for the dash inbetween each.
modTimeArray.reserve((knownDependenciesAbsolutePaths.size() * 17));
for (const auto& element : knownDependenciesAbsolutePaths)
{
// if its a placeholder then don't bother hitting the disk to find it.
modTimeArray.append(AssetUtilities::GetFileFingerprint(element.first, element.second));
modTimeArray.append("-");
}
// to keep this from growing out of hand, we don't use the full string, we use a hash of it:
source.m_analysisFingerprint = AZ::Uuid::CreateName(modTimeArray.c_str()).ToString<AZStd::string>();
for (const AZ::Uuid& builderID : analysisTracker->m_buildersInvolved)
{
source.m_analysisFingerprint.append(":");
@ -4423,7 +4438,7 @@ namespace AssetProcessor
const ScanFolderInfo* scanFolder = m_platformConfig->GetScanFolderForFile(fileToCheck.c_str());
scanFolderPk = aznumeric_cast<int>(scanFolder->ScanFolderID());
m_platformConfig->ConvertToRelativePath(fileToCheck.c_str(), scanFolder, databaseSourceName);
PlatformConfiguration::ConvertToRelativePath(fileToCheck.c_str(), scanFolder, databaseSourceName);
}
// Record the modtime for the file so we know we processed it

@ -485,6 +485,7 @@ namespace AssetProcessor
};
void ComputeBuilderDirty();
AZStd::string ComputeRecursiveDependenciesFingerprint(const AZStd::string& fileAbsolutePath, const AZStd::string& fileDatabaseName);
AZStd::unordered_map<AZ::Uuid, BuilderData> m_builderDataCache;
bool m_buildersAddedOrRemoved = true; //< true if any new builders exist. If this happens we actually need to re-analyze everything.
bool m_anyBuilderChange = true;

@ -516,6 +516,79 @@ namespace UnitTests
ASSERT_EQ(m_data->m_processResults.size(), 2);
}
TEST_F(ModtimeScanningTest, AssetProcessorIsRestartedBeforeDependencyIsProcessed_DependencyIsProcessedOnStart)
{
using namespace AzToolsFramework::AssetSystem;
auto theFile = m_data->m_absolutePath[1].toUtf8();
const char* theFileString = theFile.constData();
SetFileContents(theFileString, "hello world");
// Enable the features we're testing
m_assetProcessorManager->SetEnableModtimeSkippingFeature(true);
AssetUtilities::SetUseFileHashOverride(true, true);
QSet<AssetFileInfo> filePaths = BuildFileSet();
SimulateAssetScanner(filePaths);
// Even though we're only updating one file, we're expecting 2 createJob calls because our test file is a dependency that triggers
// the other test file to process as well
ExpectWork(2, 2);
// Sort the results and process the first one, which should always be the modtimeTestDependency.txt file
// which is the same file we modified above. modtimeTestFile.txt depends on this file but we're not going to process it yet.
{
std::sort(
m_data->m_processResults.begin(), m_data->m_processResults.end(),
[](decltype(m_data->m_processResults[0])& left, decltype(left)& right)
{
return left.m_jobEntry.m_databaseSourceName < right.m_jobEntry.m_databaseSourceName;
});
const auto& processResult = m_data->m_processResults[0];
auto file =
QDir(processResult.m_destinationPath).absoluteFilePath(processResult.m_jobEntry.m_databaseSourceName.toLower() + ".arc1");
m_data->m_productPaths.emplace(
QDir(processResult.m_jobEntry.m_watchFolderPath)
.absoluteFilePath(processResult.m_jobEntry.m_databaseSourceName)
.toUtf8()
.constData(),
file);
// Create the file on disk
ASSERT_TRUE(UnitTestUtils::CreateDummyFile(file, "products."));
AssetBuilderSDK::ProcessJobResponse response;
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(file.toUtf8().constData(), AZ::Uuid::CreateNull(), 1));
using JobEntry = AssetProcessor::JobEntry;
QMetaObject::invokeMethod(
m_assetProcessorManager.get(), "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResult.m_jobEntry),
Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
}
ASSERT_TRUE(BlockUntilIdle(5000));
// Shutdown and restart the APM
m_assetProcessorManager.reset();
m_assetProcessorManager = AZStd::make_unique<AssetProcessorManager_Test>(m_config.get());
SetUpAssetProcessorManager();
m_data->m_mockBuilderInfoHandler.m_createJobsCount = 0;
m_data->m_processResults.clear();
m_data->m_deletedSources.clear();
// Re-run the scanner on our files
filePaths = BuildFileSet();
SimulateAssetScanner(filePaths);
// Expect processing to resume on the job we didn't process before
ExpectWork(1, 1);
}
void DeleteTest::SetUp()
{
AssetProcessorManagerTest::SetUp();

@ -108,7 +108,7 @@ namespace LUAEditor
m_settingsDialog = aznew LUAEditorSettingsDialog(this);
actionTabForwards = new QAction(tr("Next Document Tab"), this);
actionTabBackwards = new QAction(tr("Prev Document Tab"), this);
actionTabBackwards = new QAction(tr("Previous Document Tab"), this);
actionTabForwards->setShortcut(QKeySequence("Ctrl+Tab"));
connect(actionTabForwards, SIGNAL(triggered(bool)), this, SLOT(OnTabForwards()));

@ -29,6 +29,7 @@ namespace AZ
if (behaviorContext)
{
behaviorContext->Class<SceneAPI::DataTypes::IAnimationData>()
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene")
->Method("GetKeyFrameCount", &SceneAPI::DataTypes::IAnimationData::GetKeyFrameCount)
@ -97,6 +98,7 @@ namespace AZ
if (behaviorContext)
{
behaviorContext->Class<SceneAPI::DataTypes::IBlendShapeAnimationData>()
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene")
->Method("GetBlendShapeName", &SceneAPI::DataTypes::IBlendShapeAnimationData::GetBlendShapeName)

@ -37,6 +37,7 @@ namespace AZ
if (behaviorContext)
{
behaviorContext->Class<SceneAPI::DataTypes::IBlendShapeData>()
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene")
->Method("GetUsedControlPointCount", &SceneAPI::DataTypes::IBlendShapeData::GetUsedControlPointCount)

@ -47,6 +47,7 @@ namespace AZ
if (behaviorContext)
{
behaviorContext->Class<SceneAPI::DataTypes::IBoneData>()
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene");
behaviorContext->Class<AZ::SceneData::GraphData::BoneData>()

@ -304,6 +304,7 @@ namespace AZ
if (behaviorContext)
{
behaviorContext->Class<SceneAPI::DataTypes::IMaterialData>()
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene");

@ -33,6 +33,7 @@ namespace AZ
if (behaviorContext)
{
behaviorContext->Class<SceneAPI::DataTypes::IMeshData>()
->Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "scene")
->Method("GetUnitSizeInMeters", &MeshData::GetUnitSizeInMeters)

@ -24,8 +24,8 @@ ly_add_target(
BUILD_DEPENDENCIES
PRIVATE
AZ::AzCore
AZ::AzFramework
Gem::AWSCore
Gem::Multiplayer.Static
3rdParty::AWSNativeSDK::GameLiftClient
)
@ -85,10 +85,10 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
BUILD_DEPENDENCIES
PRIVATE
AZ::AzCore
AZ::AzFramework
AZ::AzTest
Gem::AWSCore
Gem::AWSGameLift.Client.Static
Gem::Multiplayer.Static
3rdParty::AWSNativeSDK::GameLiftClient
AZ::AWSNativeSDKTestLibs
)

@ -8,7 +8,7 @@
#pragma once
#include <AzFramework/Matchmaking/MatchmakingRequests.h>
#include <Multiplayer/Session/MatchmakingRequests.h>
namespace AWSGameLift
{
@ -17,10 +17,10 @@ namespace AWSGameLift
//! Registers a player's acceptance or rejection of a proposed FlexMatch match.
//! AcceptMatchRequest
struct AWSGameLiftAcceptMatchRequest
: public AzFramework::AcceptMatchRequest
: public Multiplayer::AcceptMatchRequest
{
public:
AZ_RTTI(AWSGameLiftAcceptMatchRequest, "{8372B297-88E8-4C13-B31D-BE87236CA416}", AzFramework::AcceptMatchRequest);
AZ_RTTI(AWSGameLiftAcceptMatchRequest, "{8372B297-88E8-4C13-B31D-BE87236CA416}", Multiplayer::AcceptMatchRequest);
static void Reflect(AZ::ReflectContext* context);
AWSGameLiftAcceptMatchRequest() = default;

@ -8,7 +8,7 @@
#pragma once
#include <AzFramework/Session/SessionRequests.h>
#include <Multiplayer/Session/SessionRequests.h>
namespace AWSGameLift
{
@ -16,10 +16,10 @@ namespace AWSGameLift
//! GameLift create session on queue request which corresponds to Amazon GameLift
//! StartGameSessionPlacement
struct AWSGameLiftCreateSessionOnQueueRequest
: public AzFramework::CreateSessionRequest
: public Multiplayer::CreateSessionRequest
{
public:
AZ_RTTI(AWSGameLiftCreateSessionOnQueueRequest, "{2B99E594-CE81-4EB0-8888-74EF4242B59F}", AzFramework::CreateSessionRequest);
AZ_RTTI(AWSGameLiftCreateSessionOnQueueRequest, "{2B99E594-CE81-4EB0-8888-74EF4242B59F}", Multiplayer::CreateSessionRequest);
static void Reflect(AZ::ReflectContext* context);
AWSGameLiftCreateSessionOnQueueRequest() = default;

@ -8,7 +8,7 @@
#pragma once
#include <AzFramework/Session/SessionRequests.h>
#include <Multiplayer/Session/SessionRequests.h>
namespace AWSGameLift
{
@ -16,10 +16,10 @@ namespace AWSGameLift
//! GameLift create session on fleet request which corresponds to Amazon GameLift
//! CreateGameSessionRequest
struct AWSGameLiftCreateSessionRequest
: public AzFramework::CreateSessionRequest
: public Multiplayer::CreateSessionRequest
{
public:
AZ_RTTI(AWSGameLiftCreateSessionRequest, "{69612D5D-F899-4DEB-AD63-4C497ABC5C0D}", AzFramework::CreateSessionRequest);
AZ_RTTI(AWSGameLiftCreateSessionRequest, "{69612D5D-F899-4DEB-AD63-4C497ABC5C0D}", Multiplayer::CreateSessionRequest);
static void Reflect(AZ::ReflectContext* context);
AWSGameLiftCreateSessionRequest() = default;

@ -8,7 +8,7 @@
#pragma once
#include <AzFramework/Session/SessionRequests.h>
#include <Multiplayer/Session/SessionRequests.h>
namespace AWSGameLift
{
@ -17,10 +17,10 @@ namespace AWSGameLift
//! Once player session has been created successfully in game session, gamelift client manager will
//! signal Multiplayer Gem to setup networking connection.
struct AWSGameLiftJoinSessionRequest
: public AzFramework::JoinSessionRequest
: public Multiplayer::JoinSessionRequest
{
public:
AZ_RTTI(AWSGameLiftJoinSessionRequest, "{6EED6D15-531A-4956-90D0-2EDA31AC9CBA}", AzFramework::JoinSessionRequest);
AZ_RTTI(AWSGameLiftJoinSessionRequest, "{6EED6D15-531A-4956-90D0-2EDA31AC9CBA}", Multiplayer::JoinSessionRequest);
static void Reflect(AZ::ReflectContext* context);
AWSGameLiftJoinSessionRequest() = default;

@ -10,7 +10,7 @@
#include <AzCore/EBus/EBus.h>
#include <AzCore/std/string/string.h>
#include <AzFramework/Matchmaking/IMatchmakingRequests.h>
#include <Multiplayer/Session/IMatchmakingRequests.h>
namespace AWSGameLift
{
@ -23,7 +23,7 @@ namespace AWSGameLift
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
};
using AWSGameLiftMatchmakingAsyncRequestBus = AZ::EBus<AzFramework::IMatchmakingAsyncRequests, AWSGameLiftMatchmakingAsyncRequests>;
using AWSGameLiftMatchmakingAsyncRequestBus = AZ::EBus<Multiplayer::IMatchmakingAsyncRequests, AWSGameLiftMatchmakingAsyncRequests>;
// IMatchmakingRequests EBus wrapper
class AWSGameLiftMatchmakingRequests
@ -34,7 +34,7 @@ namespace AWSGameLift
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
};
using AWSGameLiftMatchmakingRequestBus = AZ::EBus<AzFramework::IMatchmakingRequests, AWSGameLiftMatchmakingRequests>;
using AWSGameLiftMatchmakingRequestBus = AZ::EBus<Multiplayer::IMatchmakingRequests, AWSGameLiftMatchmakingRequests>;
//! IAWSGameLiftMatchmakingEventRequests
//! GameLift Gem matchmaking event interfaces which is used to track matchmaking ticket event

@ -8,7 +8,7 @@
#pragma once
#include <AzFramework/Session/SessionRequests.h>
#include <Multiplayer/Session/SessionRequests.h>
namespace AWSGameLift
{
@ -16,10 +16,10 @@ namespace AWSGameLift
//! GameLift search sessions request which corresponds to Amazon GameLift
//! SearchSessionsRequest
struct AWSGameLiftSearchSessionsRequest
: public AzFramework::SearchSessionsRequest
: public Multiplayer::SearchSessionsRequest
{
public:
AZ_RTTI(AWSGameLiftSearchSessionsRequest, "{864C91C0-CA53-4585-BF07-066C0DF3E198}", AzFramework::SearchSessionsRequest);
AZ_RTTI(AWSGameLiftSearchSessionsRequest, "{864C91C0-CA53-4585-BF07-066C0DF3E198}", Multiplayer::SearchSessionsRequest);
static void Reflect(AZ::ReflectContext* context);
AWSGameLiftSearchSessionsRequest() = default;

@ -10,7 +10,7 @@
#include <AzCore/EBus/EBus.h>
#include <AzCore/std/string/string.h>
#include <AzFramework/Session/ISessionRequests.h>
#include <Multiplayer/Session/ISessionRequests.h>
namespace AWSGameLift
{
@ -23,7 +23,7 @@ namespace AWSGameLift
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
};
using AWSGameLiftSessionAsyncRequestBus = AZ::EBus<AzFramework::ISessionAsyncRequests, AWSGameLiftSessionAsyncRequests>;
using AWSGameLiftSessionAsyncRequestBus = AZ::EBus<Multiplayer::ISessionAsyncRequests, AWSGameLiftSessionAsyncRequests>;
// ISessionRequests EBus wrapper
class AWSGameLiftSessionRequests
@ -34,5 +34,5 @@ namespace AWSGameLift
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
};
using AWSGameLiftSessionRequestBus = AZ::EBus<AzFramework::ISessionRequests, AWSGameLiftSessionRequests>;
using AWSGameLiftSessionRequestBus = AZ::EBus<Multiplayer::ISessionRequests, AWSGameLiftSessionRequests>;
} // namespace AWSGameLift

@ -10,7 +10,7 @@
#include <AzCore/std/containers/unordered_map.h>
#include <AzCore/std/string/string.h>
#include <AzFramework/Matchmaking/MatchmakingRequests.h>
#include <Multiplayer/Session/MatchmakingRequests.h>
#include <AWSGameLiftPlayer.h>
@ -21,10 +21,10 @@ namespace AWSGameLift
//! Uses FlexMatch to create a game match for a group of players based on custom matchmaking rules
//! StartMatchmakingRequest
struct AWSGameLiftStartMatchmakingRequest
: public AzFramework::StartMatchmakingRequest
: public Multiplayer::StartMatchmakingRequest
{
public:
AZ_RTTI(AWSGameLiftStartMatchmakingRequest, "{D273DF71-9C55-48C1-95F9-8D7B66B9CF3E}", AzFramework::StartMatchmakingRequest);
AZ_RTTI(AWSGameLiftStartMatchmakingRequest, "{D273DF71-9C55-48C1-95F9-8D7B66B9CF3E}", Multiplayer::StartMatchmakingRequest);
static void Reflect(AZ::ReflectContext* context);
AWSGameLiftStartMatchmakingRequest() = default;

@ -8,7 +8,7 @@
#pragma once
#include <AzFramework/Matchmaking/MatchmakingRequests.h>
#include <Multiplayer/Session/MatchmakingRequests.h>
namespace AWSGameLift
{
@ -17,10 +17,10 @@ namespace AWSGameLift
//! Cancels a matchmaking ticket or match backfill ticket that is currently being processed.
//! StopMatchmakingRequest
struct AWSGameLiftStopMatchmakingRequest
: public AzFramework::StopMatchmakingRequest
: public Multiplayer::StopMatchmakingRequest
{
public:
AZ_RTTI(AWSGameLiftStopMatchmakingRequest, "{2766BC03-9F84-4346-A52B-49129BBAF38B}", AzFramework::StopMatchmakingRequest);
AZ_RTTI(AWSGameLiftStopMatchmakingRequest, "{2766BC03-9F84-4346-A52B-49129BBAF38B}", Multiplayer::StopMatchmakingRequest);
static void Reflect(AZ::ReflectContext* context);
AWSGameLiftStopMatchmakingRequest() = default;

@ -9,8 +9,8 @@
#include <AzCore/Interface/Interface.h>
#include <AzCore/std/bind/bind.h>
#include <AzCore/std/smart_ptr/shared_ptr.h>
#include <AzFramework/Session/ISessionHandlingRequests.h>
#include <AzFramework/Matchmaking/MatchmakingNotifications.h>
#include <Multiplayer/Session/ISessionHandlingRequests.h>
#include <Multiplayer/Session/MatchmakingNotifications.h>
#include <AWSGameLiftClientLocalTicketTracker.h>
#include <AWSGameLiftSessionConstants.h>
@ -97,7 +97,7 @@ namespace AWSGameLift
AZ_TracePrintf(AWSGameLiftClientLocalTicketTrackerName,
"Matchmaking ticket %s is complete.", ticket.GetTicketId().c_str());
RequestPlayerJoinMatch(ticket, playerId);
AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchComplete);
Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchComplete);
m_status = TicketTrackerStatus::Idle;
return;
}
@ -107,7 +107,7 @@ namespace AWSGameLift
{
AZ_Warning(AWSGameLiftClientLocalTicketTrackerName, false, "Matchmaking ticket %s is not complete, %s",
ticket.GetTicketId().c_str(), ticket.GetStatusMessage().c_str());
AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchFailure);
Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchFailure);
m_status = TicketTrackerStatus::Idle;
return;
}
@ -115,7 +115,7 @@ namespace AWSGameLift
{
AZ_TracePrintf(AWSGameLiftClientLocalTicketTrackerName, "Matchmaking ticket %s is pending on acceptance, %s.",
ticket.GetTicketId().c_str(), ticket.GetStatusMessage().c_str());
AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchAcceptance);
Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchAcceptance);
}
else
{
@ -126,7 +126,7 @@ namespace AWSGameLift
else
{
AZ_Error(AWSGameLiftClientLocalTicketTrackerName, false, "Unable to find expected ticket with id %s", ticketId.c_str());
AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchError);
Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchError);
}
}
else
@ -134,13 +134,13 @@ namespace AWSGameLift
AZ_Error(AWSGameLiftClientLocalTicketTrackerName, false, AWSGameLiftErrorMessageTemplate,
describeMatchmakingOutcome.GetError().GetExceptionName().c_str(),
describeMatchmakingOutcome.GetError().GetMessage().c_str());
AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchError);
Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchError);
}
}
else
{
AZ_Error(AWSGameLiftClientLocalTicketTrackerName, false, AWSGameLiftClientMissingErrorMessage);
AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchError);
Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchError);
}
m_waitEvent.try_acquire_for(AZStd::chrono::milliseconds(m_pollingPeriodInMS));
}
@ -150,7 +150,7 @@ namespace AWSGameLift
const Aws::GameLift::Model::MatchmakingTicket& ticket, const AZStd::string& playerId)
{
auto connectionInfo = ticket.GetGameSessionConnectionInfo();
AzFramework::SessionConnectionConfig sessionConnectionConfig;
Multiplayer::SessionConnectionConfig sessionConnectionConfig;
sessionConnectionConfig.m_ipAddress = connectionInfo.GetIpAddress().c_str();
for (auto matchedPlayer : connectionInfo.GetMatchedPlayerSessions())
{
@ -168,7 +168,7 @@ namespace AWSGameLift
"Requesting and validating player session %s to connect to the match ...",
sessionConnectionConfig.m_playerSessionId.c_str());
bool result =
AZ::Interface<AzFramework::ISessionHandlingClientRequests>::Get()->RequestPlayerJoinSession(sessionConnectionConfig);
AZ::Interface<Multiplayer::ISessionHandlingClientRequests>::Get()->RequestPlayerJoinSession(sessionConnectionConfig);
if (result)
{
AZ_TracePrintf(AWSGameLiftClientLocalTicketTrackerName,

@ -10,7 +10,7 @@
#include <AzCore/Interface/Interface.h>
#include <AzCore/Jobs/JobFunction.h>
#include <AzCore/std/smart_ptr/make_shared.h>
#include <AzFramework/Session/SessionConfig.h>
#include <Multiplayer/Session/SessionConfig.h>
#include <AWSCoreBus.h>
#include <Credential/AWSCredentialBus.h>
@ -42,32 +42,32 @@ namespace AWSGameLift
AZ::Interface<IAWSGameLiftRequests>::Register(this);
AWSGameLiftRequestBus::Handler::BusConnect();
AZ::Interface<AzFramework::ISessionAsyncRequests>::Register(this);
AZ::Interface<Multiplayer::ISessionAsyncRequests>::Register(this);
AWSGameLiftSessionAsyncRequestBus::Handler::BusConnect();
AZ::Interface<AzFramework::ISessionRequests>::Register(this);
AZ::Interface<Multiplayer::ISessionRequests>::Register(this);
AWSGameLiftSessionRequestBus::Handler::BusConnect();
AZ::Interface<AzFramework::IMatchmakingAsyncRequests>::Register(this);
AZ::Interface<Multiplayer::IMatchmakingAsyncRequests>::Register(this);
AWSGameLiftMatchmakingAsyncRequestBus::Handler::BusConnect();
AZ::Interface<AzFramework::IMatchmakingRequests>::Register(this);
AZ::Interface<Multiplayer::IMatchmakingRequests>::Register(this);
AWSGameLiftMatchmakingRequestBus::Handler::BusConnect();
}
void AWSGameLiftClientManager::DeactivateManager()
{
AWSGameLiftMatchmakingRequestBus::Handler::BusDisconnect();
AZ::Interface<AzFramework::IMatchmakingRequests>::Unregister(this);
AZ::Interface<Multiplayer::IMatchmakingRequests>::Unregister(this);
AWSGameLiftMatchmakingAsyncRequestBus::Handler::BusDisconnect();
AZ::Interface<AzFramework::IMatchmakingAsyncRequests>::Unregister(this);
AZ::Interface<Multiplayer::IMatchmakingAsyncRequests>::Unregister(this);
AWSGameLiftSessionRequestBus::Handler::BusDisconnect();
AZ::Interface<AzFramework::ISessionRequests>::Unregister(this);
AZ::Interface<Multiplayer::ISessionRequests>::Unregister(this);
AWSGameLiftSessionAsyncRequestBus::Handler::BusDisconnect();
AZ::Interface<AzFramework::ISessionAsyncRequests>::Unregister(this);
AZ::Interface<Multiplayer::ISessionAsyncRequests>::Unregister(this);
AWSGameLiftRequestBus::Handler::BusDisconnect();
AZ::Interface<IAWSGameLiftRequests>::Unregister(this);
@ -133,7 +133,7 @@ namespace AWSGameLift
return AZ::Uuid::CreateRandom().ToString<AZStd::string>(includeBrackets, includeDashes);
}
void AWSGameLiftClientManager::AcceptMatch(const AzFramework::AcceptMatchRequest& acceptMatchRequest)
void AWSGameLiftClientManager::AcceptMatch(const Multiplayer::AcceptMatchRequest& acceptMatchRequest)
{
if (AcceptMatchActivity::ValidateAcceptMatchRequest(acceptMatchRequest))
{
@ -143,12 +143,12 @@ namespace AWSGameLift
}
}
void AWSGameLiftClientManager::AcceptMatchAsync(const AzFramework::AcceptMatchRequest& acceptMatchRequest)
void AWSGameLiftClientManager::AcceptMatchAsync(const Multiplayer::AcceptMatchRequest& acceptMatchRequest)
{
if (!AcceptMatchActivity::ValidateAcceptMatchRequest(acceptMatchRequest))
{
AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast(
&AzFramework::MatchmakingAsyncRequestNotifications::OnAcceptMatchAsyncComplete);
Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast(
&Multiplayer::MatchmakingAsyncRequestNotifications::OnAcceptMatchAsyncComplete);
return;
}
@ -161,15 +161,15 @@ namespace AWSGameLift
{
AcceptMatchActivity::AcceptMatch(gameliftStartMatchmakingRequest);
AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast(
&AzFramework::MatchmakingAsyncRequestNotifications::OnAcceptMatchAsyncComplete);
Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast(
&Multiplayer::MatchmakingAsyncRequestNotifications::OnAcceptMatchAsyncComplete);
},
true, jobContext);
acceptMatchJob->Start();
}
AZStd::string AWSGameLiftClientManager::CreateSession(const AzFramework::CreateSessionRequest& createSessionRequest)
AZStd::string AWSGameLiftClientManager::CreateSession(const Multiplayer::CreateSessionRequest& createSessionRequest)
{
AZStd::string result = "";
if (CreateSessionActivity::ValidateCreateSessionRequest(createSessionRequest))
@ -192,7 +192,7 @@ namespace AWSGameLift
return result;
}
void AWSGameLiftClientManager::CreateSessionAsync(const AzFramework::CreateSessionRequest& createSessionRequest)
void AWSGameLiftClientManager::CreateSessionAsync(const Multiplayer::CreateSessionRequest& createSessionRequest)
{
if (CreateSessionActivity::ValidateCreateSessionRequest(createSessionRequest))
{
@ -206,8 +206,8 @@ namespace AWSGameLift
{
AZStd::string result = CreateSessionActivity::CreateSession(gameliftCreateSessionRequest);
AzFramework::SessionAsyncRequestNotificationBus::Broadcast(
&AzFramework::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, result);
Multiplayer::SessionAsyncRequestNotificationBus::Broadcast(
&Multiplayer::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, result);
},
true, jobContext);
createSessionJob->Start();
@ -224,8 +224,8 @@ namespace AWSGameLift
{
AZStd::string result = CreateSessionOnQueueActivity::CreateSessionOnQueue(gameliftCreateSessionOnQueueRequest);
AzFramework::SessionAsyncRequestNotificationBus::Broadcast(
&AzFramework::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, result);
Multiplayer::SessionAsyncRequestNotificationBus::Broadcast(
&Multiplayer::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, result);
},
true, jobContext);
createSessionOnQueueJob->Start();
@ -233,12 +233,12 @@ namespace AWSGameLift
else
{
AZ_Error(AWSGameLiftClientManagerName, false, AWSGameLiftCreateSessionRequestInvalidErrorMessage);
AzFramework::SessionAsyncRequestNotificationBus::Broadcast(
&AzFramework::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, "");
Multiplayer::SessionAsyncRequestNotificationBus::Broadcast(
&Multiplayer::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, "");
}
}
bool AWSGameLiftClientManager::JoinSession(const AzFramework::JoinSessionRequest& joinSessionRequest)
bool AWSGameLiftClientManager::JoinSession(const Multiplayer::JoinSessionRequest& joinSessionRequest)
{
bool result = false;
if (JoinSessionActivity::ValidateJoinSessionRequest(joinSessionRequest))
@ -252,12 +252,12 @@ namespace AWSGameLift
return result;
}
void AWSGameLiftClientManager::JoinSessionAsync(const AzFramework::JoinSessionRequest& joinSessionRequest)
void AWSGameLiftClientManager::JoinSessionAsync(const Multiplayer::JoinSessionRequest& joinSessionRequest)
{
if (!JoinSessionActivity::ValidateJoinSessionRequest(joinSessionRequest))
{
AzFramework::SessionAsyncRequestNotificationBus::Broadcast(
&AzFramework::SessionAsyncRequestNotifications::OnJoinSessionAsyncComplete, false);
Multiplayer::SessionAsyncRequestNotificationBus::Broadcast(
&Multiplayer::SessionAsyncRequestNotifications::OnJoinSessionAsyncComplete, false);
return;
}
@ -272,8 +272,8 @@ namespace AWSGameLift
auto createPlayerSessionOutcome = JoinSessionActivity::CreatePlayerSession(gameliftJoinSessionRequest);
bool result = JoinSessionActivity::RequestPlayerJoinSession(createPlayerSessionOutcome);
AzFramework::SessionAsyncRequestNotificationBus::Broadcast(
&AzFramework::SessionAsyncRequestNotifications::OnJoinSessionAsyncComplete, result);
Multiplayer::SessionAsyncRequestNotificationBus::Broadcast(
&Multiplayer::SessionAsyncRequestNotifications::OnJoinSessionAsyncComplete, result);
},
true, jobContext);
@ -293,18 +293,18 @@ namespace AWSGameLift
[this]()
{
LeaveSession();
AzFramework::SessionAsyncRequestNotificationBus::Broadcast(
&AzFramework::SessionAsyncRequestNotifications::OnLeaveSessionAsyncComplete);
Multiplayer::SessionAsyncRequestNotificationBus::Broadcast(
&Multiplayer::SessionAsyncRequestNotifications::OnLeaveSessionAsyncComplete);
},
true, jobContext);
leaveSessionJob->Start();
}
AzFramework::SearchSessionsResponse AWSGameLiftClientManager::SearchSessions(
const AzFramework::SearchSessionsRequest& searchSessionsRequest) const
Multiplayer::SearchSessionsResponse AWSGameLiftClientManager::SearchSessions(
const Multiplayer::SearchSessionsRequest& searchSessionsRequest) const
{
AzFramework::SearchSessionsResponse response;
Multiplayer::SearchSessionsResponse response;
if (SearchSessionsActivity::ValidateSearchSessionsRequest(searchSessionsRequest))
{
const AWSGameLiftSearchSessionsRequest& gameliftSearchSessionsRequest =
@ -315,12 +315,12 @@ namespace AWSGameLift
return response;
}
void AWSGameLiftClientManager::SearchSessionsAsync(const AzFramework::SearchSessionsRequest& searchSessionsRequest) const
void AWSGameLiftClientManager::SearchSessionsAsync(const Multiplayer::SearchSessionsRequest& searchSessionsRequest) const
{
if (!SearchSessionsActivity::ValidateSearchSessionsRequest(searchSessionsRequest))
{
AzFramework::SessionAsyncRequestNotificationBus::Broadcast(
&AzFramework::SessionAsyncRequestNotifications::OnSearchSessionsAsyncComplete, AzFramework::SearchSessionsResponse());
Multiplayer::SessionAsyncRequestNotificationBus::Broadcast(
&Multiplayer::SessionAsyncRequestNotifications::OnSearchSessionsAsyncComplete, Multiplayer::SearchSessionsResponse());
return;
}
@ -332,17 +332,17 @@ namespace AWSGameLift
AZ::Job* searchSessionsJob = AZ::CreateJobFunction(
[gameliftSearchSessionsRequest]()
{
AzFramework::SearchSessionsResponse response = SearchSessionsActivity::SearchSessions(gameliftSearchSessionsRequest);
Multiplayer::SearchSessionsResponse response = SearchSessionsActivity::SearchSessions(gameliftSearchSessionsRequest);
AzFramework::SessionAsyncRequestNotificationBus::Broadcast(
&AzFramework::SessionAsyncRequestNotifications::OnSearchSessionsAsyncComplete, response);
Multiplayer::SessionAsyncRequestNotificationBus::Broadcast(
&Multiplayer::SessionAsyncRequestNotifications::OnSearchSessionsAsyncComplete, response);
},
true, jobContext);
searchSessionsJob->Start();
}
AZStd::string AWSGameLiftClientManager::StartMatchmaking(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest)
AZStd::string AWSGameLiftClientManager::StartMatchmaking(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest)
{
AZStd::string response;
if (StartMatchmakingActivity::ValidateStartMatchmakingRequest(startMatchmakingRequest))
@ -355,12 +355,12 @@ namespace AWSGameLift
return response;
}
void AWSGameLiftClientManager::StartMatchmakingAsync(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest)
void AWSGameLiftClientManager::StartMatchmakingAsync(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest)
{
if (!StartMatchmakingActivity::ValidateStartMatchmakingRequest(startMatchmakingRequest))
{
AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast(
&AzFramework::MatchmakingAsyncRequestNotifications::OnStartMatchmakingAsyncComplete, AZStd::string{});
Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast(
&Multiplayer::MatchmakingAsyncRequestNotifications::OnStartMatchmakingAsyncComplete, AZStd::string{});
return;
}
@ -374,15 +374,15 @@ namespace AWSGameLift
{
AZStd::string response = StartMatchmakingActivity::StartMatchmaking(gameliftStartMatchmakingRequest);
AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast(
&AzFramework::MatchmakingAsyncRequestNotifications::OnStartMatchmakingAsyncComplete, response);
Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast(
&Multiplayer::MatchmakingAsyncRequestNotifications::OnStartMatchmakingAsyncComplete, response);
},
true, jobContext);
startMatchmakingJob->Start();
}
void AWSGameLiftClientManager::StopMatchmaking(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest)
void AWSGameLiftClientManager::StopMatchmaking(const Multiplayer::StopMatchmakingRequest& stopMatchmakingRequest)
{
if (StopMatchmakingActivity::ValidateStopMatchmakingRequest(stopMatchmakingRequest))
{
@ -393,12 +393,12 @@ namespace AWSGameLift
}
}
void AWSGameLiftClientManager::StopMatchmakingAsync(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest)
void AWSGameLiftClientManager::StopMatchmakingAsync(const Multiplayer::StopMatchmakingRequest& stopMatchmakingRequest)
{
if (!StopMatchmakingActivity::ValidateStopMatchmakingRequest(stopMatchmakingRequest))
{
AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast(
&AzFramework::MatchmakingAsyncRequestNotifications::OnStopMatchmakingAsyncComplete);
Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast(
&Multiplayer::MatchmakingAsyncRequestNotifications::OnStopMatchmakingAsyncComplete);
return;
}
@ -412,8 +412,8 @@ namespace AWSGameLift
{
StopMatchmakingActivity::StopMatchmaking(gameliftStopMatchmakingRequest);
AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast(
&AzFramework::MatchmakingAsyncRequestNotifications::OnStopMatchmakingAsyncComplete);
Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast(
&Multiplayer::MatchmakingAsyncRequestNotifications::OnStopMatchmakingAsyncComplete);
},
true, jobContext);

@ -10,7 +10,7 @@
#include <AzCore/RTTI/BehaviorContext.h>
#include <AzCore/std/smart_ptr/shared_ptr.h>
#include <AzFramework/Matchmaking/MatchmakingNotifications.h>
#include <Multiplayer/Session/MatchmakingNotifications.h>
#include <Request/AWSGameLiftRequestBus.h>
#include <Request/AWSGameLiftSessionRequestBus.h>
@ -28,7 +28,7 @@ namespace AWSGameLift
// MatchmakingNotificationBus EBus handler for scripting
class AWSGameLiftMatchmakingNotificationBusHandler
: public AzFramework::MatchmakingNotificationBus::Handler
: public Multiplayer::MatchmakingNotificationBus::Handler
, public AZ::BehaviorEBusHandler
{
public:
@ -61,7 +61,7 @@ namespace AWSGameLift
// MatchmakingAsyncRequestNotificationBus EBus handler for scripting
class AWSGameLiftMatchmakingAsyncRequestNotificationBusHandler
: public AzFramework::MatchmakingAsyncRequestNotificationBus::Handler
: public Multiplayer::MatchmakingAsyncRequestNotificationBus::Handler
, public AZ::BehaviorEBusHandler
{
public:
@ -91,7 +91,7 @@ namespace AWSGameLift
// SessionAsyncRequestNotificationBus EBus handler for scripting
class AWSGameLiftSessionAsyncRequestNotificationBusHandler
: public AzFramework::SessionAsyncRequestNotificationBus::Handler
: public Multiplayer::SessionAsyncRequestNotificationBus::Handler
, public AZ::BehaviorEBusHandler
{
public:
@ -109,7 +109,7 @@ namespace AWSGameLift
Call(FN_OnCreateSessionAsyncComplete, createSessionReponse);
}
void OnSearchSessionsAsyncComplete(const AzFramework::SearchSessionsResponse& searchSessionsResponse) override
void OnSearchSessionsAsyncComplete(const Multiplayer::SearchSessionsResponse& searchSessionsResponse) override
{
Call(FN_OnSearchSessionsAsyncComplete, searchSessionsResponse);
}
@ -155,25 +155,25 @@ namespace AWSGameLift
AZStd::string CreatePlayerId(bool includeBrackets, bool includeDashes) override;
// AWSGameLiftMatchmakingAsyncRequestBus interface implementation
void AcceptMatchAsync(const AzFramework::AcceptMatchRequest& acceptMatchRequest) override;
void StartMatchmakingAsync(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest) override;
void StopMatchmakingAsync(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest) override;
void AcceptMatchAsync(const Multiplayer::AcceptMatchRequest& acceptMatchRequest) override;
void StartMatchmakingAsync(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest) override;
void StopMatchmakingAsync(const Multiplayer::StopMatchmakingRequest& stopMatchmakingRequest) override;
// AWSGameLiftSessionAsyncRequestBus interface implementation
void CreateSessionAsync(const AzFramework::CreateSessionRequest& createSessionRequest) override;
void JoinSessionAsync(const AzFramework::JoinSessionRequest& joinSessionRequest) override;
void SearchSessionsAsync(const AzFramework::SearchSessionsRequest& searchSessionsRequest) const override;
void CreateSessionAsync(const Multiplayer::CreateSessionRequest& createSessionRequest) override;
void JoinSessionAsync(const Multiplayer::JoinSessionRequest& joinSessionRequest) override;
void SearchSessionsAsync(const Multiplayer::SearchSessionsRequest& searchSessionsRequest) const override;
void LeaveSessionAsync() override;
// AWSGameLiftMatchmakingRequestBus interface implementation
void AcceptMatch(const AzFramework::AcceptMatchRequest& acceptMatchRequest) override;
AZStd::string StartMatchmaking(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest) override;
void StopMatchmaking(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest) override;
void AcceptMatch(const Multiplayer::AcceptMatchRequest& acceptMatchRequest) override;
AZStd::string StartMatchmaking(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest) override;
void StopMatchmaking(const Multiplayer::StopMatchmakingRequest& stopMatchmakingRequest) override;
// AWSGameLiftSessionRequestBus interface implementation
AZStd::string CreateSession(const AzFramework::CreateSessionRequest& createSessionRequest) override;
bool JoinSession(const AzFramework::JoinSessionRequest& joinSessionRequest) override;
AzFramework::SearchSessionsResponse SearchSessions(const AzFramework::SearchSessionsRequest& searchSessionsRequest) const override;
AZStd::string CreateSession(const Multiplayer::CreateSessionRequest& createSessionRequest) override;
bool JoinSession(const Multiplayer::JoinSessionRequest& joinSessionRequest) override;
Multiplayer::SearchSessionsResponse SearchSessions(const Multiplayer::SearchSessionsRequest& searchSessionsRequest) const override;
void LeaveSession() override;
};
} // namespace AWSGameLift

@ -10,7 +10,7 @@
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/EditContextConstants.inl>
#include <AzFramework/Session/SessionConfig.h>
#include <Multiplayer/Session/SessionConfig.h>
#include <AWSGameLiftClientLocalTicketTracker.h>
#include <AWSCoreBus.h>
@ -129,7 +129,7 @@ namespace AWSGameLift
->Event("StopMatchmakingAsync", &AWSGameLiftMatchmakingAsyncRequestBus::Events::StopMatchmakingAsync,
{ { { "StopMatchmakingRequest", "" } } });
behaviorContext->EBus<AzFramework::MatchmakingAsyncRequestNotificationBus>("AWSGameLiftMatchmakingAsyncRequestNotificationBus")
behaviorContext->EBus<Multiplayer::MatchmakingAsyncRequestNotificationBus>("AWSGameLiftMatchmakingAsyncRequestNotificationBus")
->Attribute(AZ::Script::Attributes::Category, "AWSGameLift/Matchmaking")
->Handler<AWSGameLiftMatchmakingAsyncRequestNotificationBusHandler>();
@ -149,7 +149,7 @@ namespace AWSGameLift
{ "PlayerId", "" } } })
->Event("StopPolling", &AWSGameLiftMatchmakingEventRequestBus::Events::StopPolling);
behaviorContext->EBus<AzFramework::MatchmakingNotificationBus>("AWSGameLiftMatchmakingNotificationBus")
behaviorContext->EBus<Multiplayer::MatchmakingNotificationBus>("AWSGameLiftMatchmakingNotificationBus")
->Attribute(AZ::Script::Attributes::Category, "AWSGameLift/Matchmaking")
->Handler<AWSGameLiftMatchmakingNotificationBusHandler>();
}
@ -175,7 +175,7 @@ namespace AWSGameLift
{ { { "SearchSessionsRequest", "" } } })
->Event("LeaveSessionAsync", &AWSGameLiftSessionAsyncRequestBus::Events::LeaveSessionAsync);
behaviorContext->EBus<AzFramework::SessionAsyncRequestNotificationBus>("AWSGameLiftSessionAsyncRequestNotificationBus")
behaviorContext->EBus<Multiplayer::SessionAsyncRequestNotificationBus>("AWSGameLiftSessionAsyncRequestNotificationBus")
->Attribute(AZ::Script::Attributes::Category, "AWSGameLift/Session")
->Handler<AWSGameLiftSessionAsyncRequestNotificationBusHandler>();
@ -190,10 +190,10 @@ namespace AWSGameLift
void AWSGameLiftClientSystemComponent::ReflectCreateSessionRequest(AZ::ReflectContext* context)
{
AzFramework::CreateSessionRequest::Reflect(context);
Multiplayer::CreateSessionRequest::Reflect(context);
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
behaviorContext->Class<AzFramework::CreateSessionRequest>("CreateSessionRequest")
behaviorContext->Class<Multiplayer::CreateSessionRequest>("CreateSessionRequest")
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
// Expose base type to BehaviorContext, but hide it to be used directly
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
@ -204,34 +204,34 @@ namespace AWSGameLift
void AWSGameLiftClientSystemComponent::ReflectSearchSessionsResponse(AZ::ReflectContext* context)
{
// As it is a common response type, reflection could be moved to AzFramework to avoid duplication
AzFramework::SessionConfig::Reflect(context);
AzFramework::SearchSessionsResponse::Reflect(context);
Multiplayer::SessionConfig::Reflect(context);
Multiplayer::SearchSessionsResponse::Reflect(context);
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
behaviorContext->Class<AzFramework::SessionConfig>("SessionConfig")
behaviorContext->Class<Multiplayer::SessionConfig>("SessionConfig")
->Attribute(AZ::Script::Attributes::Category, "Session")
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
->Property("CreationTime", BehaviorValueProperty(&AzFramework::SessionConfig::m_creationTime))
->Property("CreatorId", BehaviorValueProperty(&AzFramework::SessionConfig::m_creatorId))
->Property("CurrentPlayer", BehaviorValueProperty(&AzFramework::SessionConfig::m_currentPlayer))
->Property("DnsName", BehaviorValueProperty(&AzFramework::SessionConfig::m_dnsName))
->Property("IpAddress", BehaviorValueProperty(&AzFramework::SessionConfig::m_ipAddress))
->Property("MaxPlayer", BehaviorValueProperty(&AzFramework::SessionConfig::m_maxPlayer))
->Property("Port", BehaviorValueProperty(&AzFramework::SessionConfig::m_port))
->Property("SessionId", BehaviorValueProperty(&AzFramework::SessionConfig::m_sessionId))
->Property("SessionName", BehaviorValueProperty(&AzFramework::SessionConfig::m_sessionName))
->Property("SessionProperties", BehaviorValueProperty(&AzFramework::SessionConfig::m_sessionProperties))
->Property("MatchmakingData", BehaviorValueProperty(&AzFramework::SessionConfig::m_matchmakingData))
->Property("Status", BehaviorValueProperty(&AzFramework::SessionConfig::m_status))
->Property("StatusReason", BehaviorValueProperty(&AzFramework::SessionConfig::m_statusReason))
->Property("TerminationTime", BehaviorValueProperty(&AzFramework::SessionConfig::m_terminationTime))
->Property("CreationTime", BehaviorValueProperty(&Multiplayer::SessionConfig::m_creationTime))
->Property("CreatorId", BehaviorValueProperty(&Multiplayer::SessionConfig::m_creatorId))
->Property("CurrentPlayer", BehaviorValueProperty(&Multiplayer::SessionConfig::m_currentPlayer))
->Property("DnsName", BehaviorValueProperty(&Multiplayer::SessionConfig::m_dnsName))
->Property("IpAddress", BehaviorValueProperty(&Multiplayer::SessionConfig::m_ipAddress))
->Property("MaxPlayer", BehaviorValueProperty(&Multiplayer::SessionConfig::m_maxPlayer))
->Property("Port", BehaviorValueProperty(&Multiplayer::SessionConfig::m_port))
->Property("SessionId", BehaviorValueProperty(&Multiplayer::SessionConfig::m_sessionId))
->Property("SessionName", BehaviorValueProperty(&Multiplayer::SessionConfig::m_sessionName))
->Property("SessionProperties", BehaviorValueProperty(&Multiplayer::SessionConfig::m_sessionProperties))
->Property("MatchmakingData", BehaviorValueProperty(&Multiplayer::SessionConfig::m_matchmakingData))
->Property("Status", BehaviorValueProperty(&Multiplayer::SessionConfig::m_status))
->Property("StatusReason", BehaviorValueProperty(&Multiplayer::SessionConfig::m_statusReason))
->Property("TerminationTime", BehaviorValueProperty(&Multiplayer::SessionConfig::m_terminationTime))
;
behaviorContext->Class<AzFramework::SearchSessionsResponse>("SearchSessionsResponse")
behaviorContext->Class<Multiplayer::SearchSessionsResponse>("SearchSessionsResponse")
->Attribute(AZ::Script::Attributes::Category, "Session")
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
->Property("NextToken", BehaviorValueProperty(&AzFramework::SearchSessionsResponse::m_nextToken))
->Property("SessionConfigs", BehaviorValueProperty(&AzFramework::SearchSessionsResponse::m_sessionConfigs))
->Property("NextToken", BehaviorValueProperty(&Multiplayer::SearchSessionsResponse::m_nextToken))
->Property("SessionConfigs", BehaviorValueProperty(&Multiplayer::SearchSessionsResponse::m_sessionConfigs))
;
}
}

@ -69,7 +69,7 @@ namespace AWSGameLift
}
}
bool ValidateAcceptMatchRequest(const AzFramework::AcceptMatchRequest& AcceptMatchRequest)
bool ValidateAcceptMatchRequest(const Multiplayer::AcceptMatchRequest& AcceptMatchRequest)
{
auto gameliftAcceptMatchRequest = azrtti_cast<const AWSGameLiftAcceptMatchRequest*>(&AcceptMatchRequest);
bool isValid = gameliftAcceptMatchRequest &&

@ -26,6 +26,6 @@ namespace AWSGameLift
void AcceptMatch(const AWSGameLiftAcceptMatchRequest& AcceptMatchRequest);
// Validate AcceptMatchRequest and check required request parameters
bool ValidateAcceptMatchRequest(const AzFramework::AcceptMatchRequest& AcceptMatchRequest);
bool ValidateAcceptMatchRequest(const Multiplayer::AcceptMatchRequest& AcceptMatchRequest);
} // namespace AcceptMatchActivity
} // namespace AWSGameLift

@ -99,7 +99,7 @@ namespace AWSGameLift
return result;
}
bool ValidateCreateSessionRequest(const AzFramework::CreateSessionRequest& createSessionRequest)
bool ValidateCreateSessionRequest(const Multiplayer::CreateSessionRequest& createSessionRequest)
{
auto gameliftCreateSessionRequest = azrtti_cast<const AWSGameLiftCreateSessionRequest*>(&createSessionRequest);

@ -25,7 +25,7 @@ namespace AWSGameLift
AZStd::string CreateSession(const AWSGameLiftCreateSessionRequest& createSessionRequest);
// Validate CreateSessionRequest and check required request parameters
bool ValidateCreateSessionRequest(const AzFramework::CreateSessionRequest& createSessionRequest);
bool ValidateCreateSessionRequest(const Multiplayer::CreateSessionRequest& createSessionRequest);
} // namespace CreateSessionActivity
} // namespace AWSGameLift

@ -87,7 +87,7 @@ namespace AWSGameLift
return result;
}
bool ValidateCreateSessionOnQueueRequest(const AzFramework::CreateSessionRequest& createSessionRequest)
bool ValidateCreateSessionOnQueueRequest(const Multiplayer::CreateSessionRequest& createSessionRequest)
{
auto gameliftCreateSessionOnQueueRequest =
azrtti_cast<const AWSGameLiftCreateSessionOnQueueRequest*>(&createSessionRequest);

@ -26,7 +26,7 @@ namespace AWSGameLift
AZStd::string CreateSessionOnQueue(const AWSGameLiftCreateSessionOnQueueRequest& createSessionOnQueueRequest);
// Validate CreateSessionOnQueueRequest and check required request parameters
bool ValidateCreateSessionOnQueueRequest(const AzFramework::CreateSessionRequest& createSessionRequest);
bool ValidateCreateSessionOnQueueRequest(const Multiplayer::CreateSessionRequest& createSessionRequest);
} // namespace CreateSessionOnQueueActivity
} // namespace AWSGameLift

@ -39,10 +39,10 @@ namespace AWSGameLift
return request;
}
AzFramework::SessionConnectionConfig BuildSessionConnectionConfig(
Multiplayer::SessionConnectionConfig BuildSessionConnectionConfig(
const Aws::GameLift::Model::CreatePlayerSessionOutcome& createPlayerSessionOutcome)
{
AzFramework::SessionConnectionConfig sessionConnectionConfig;
Multiplayer::SessionConnectionConfig sessionConnectionConfig;
auto createPlayerSessionResult = createPlayerSessionOutcome.GetResult();
// TODO: AWSNativeSDK needs to be updated to support this attribute, and it is a must have for TLS certificate enabled fleet
//sessionConnectionConfig.m_dnsName = createPlayerSessionResult.GetPlayerSession().GetDnsName().c_str();
@ -95,10 +95,10 @@ namespace AWSGameLift
bool result = false;
if (createPlayerSessionOutcome.IsSuccess())
{
auto clientRequestHandler = AZ::Interface<AzFramework::ISessionHandlingClientRequests>::Get();
auto clientRequestHandler = AZ::Interface<Multiplayer::ISessionHandlingClientRequests>::Get();
if (clientRequestHandler)
{
AzFramework::SessionConnectionConfig sessionConnectionConfig =
Multiplayer::SessionConnectionConfig sessionConnectionConfig =
BuildSessionConnectionConfig(createPlayerSessionOutcome);
AZ_TracePrintf(AWSGameLiftJoinSessionActivityName,
@ -114,7 +114,7 @@ namespace AWSGameLift
return result;
}
bool ValidateJoinSessionRequest(const AzFramework::JoinSessionRequest& joinSessionRequest)
bool ValidateJoinSessionRequest(const Multiplayer::JoinSessionRequest& joinSessionRequest)
{
auto gameliftJoinSessionRequest = azrtti_cast<const AWSGameLiftJoinSessionRequest*>(&joinSessionRequest);

@ -8,7 +8,7 @@
#pragma once
#include <AzFramework/Session/ISessionHandlingRequests.h>
#include <Multiplayer/Session/ISessionHandlingRequests.h>
#include <Request/AWSGameLiftJoinSessionRequest.h>
@ -31,7 +31,7 @@ namespace AWSGameLift
const AWSGameLiftJoinSessionRequest& joinSessionRequest);
// Build session connection config by using CreatePlayerSessionOutcome
AzFramework::SessionConnectionConfig BuildSessionConnectionConfig(
Multiplayer::SessionConnectionConfig BuildSessionConnectionConfig(
const Aws::GameLift::Model::CreatePlayerSessionOutcome& createPlayerSessionOutcome);
// Create CreatePlayerSessionRequest and make a CreatePlayerSession call through GameLift client
@ -43,7 +43,7 @@ namespace AWSGameLift
const Aws::GameLift::Model::CreatePlayerSessionOutcome& createPlayerSessionOutcome);
// Validate JoinSessionRequest and check required request parameters
bool ValidateJoinSessionRequest(const AzFramework::JoinSessionRequest& joinSessionRequest);
bool ValidateJoinSessionRequest(const Multiplayer::JoinSessionRequest& joinSessionRequest);
} // namespace JoinSessionActivity
} // namespace AWSGameLift

@ -8,7 +8,7 @@
#include <AzCore/Interface/Interface.h>
#include <AzCore/std/smart_ptr/shared_ptr.h>
#include <AzFramework/Session/ISessionHandlingRequests.h>
#include <Multiplayer/Session/ISessionHandlingRequests.h>
#include <Activity/AWSGameLiftLeaveSessionActivity.h>
@ -18,7 +18,7 @@ namespace AWSGameLift
{
void LeaveSession()
{
auto clientRequestHandler = AZ::Interface<AzFramework::ISessionHandlingClientRequests>::Get();
auto clientRequestHandler = AZ::Interface<Multiplayer::ISessionHandlingClientRequests>::Get();
if (clientRequestHandler)
{
AZ_TracePrintf(AWSGameLiftLeaveSessionActivityName, "Requesting player to leave the current session ...");

@ -8,7 +8,7 @@
#include <AzCore/Interface/Interface.h>
#include <AzCore/std/smart_ptr/shared_ptr.h>
#include <AzFramework/Session/SessionConfig.h>
#include <Multiplayer/Session/SessionConfig.h>
#include <Activity/AWSGameLiftSearchSessionsActivity.h>
#include <AWSGameLiftSessionConstants.h>
@ -67,10 +67,10 @@ namespace AWSGameLift
return request;
}
AzFramework::SearchSessionsResponse SearchSessions(
Multiplayer::SearchSessionsResponse SearchSessions(
const AWSGameLiftSearchSessionsRequest& searchSessionsRequest)
{
AzFramework::SearchSessionsResponse response;
Multiplayer::SearchSessionsResponse response;
auto gameliftClient = AZ::Interface<IAWSGameLiftInternalRequests>::Get()->GetGameLiftClient();
if (!gameliftClient)
@ -98,15 +98,15 @@ namespace AWSGameLift
return response;
}
AzFramework::SearchSessionsResponse ParseResponse(
Multiplayer::SearchSessionsResponse ParseResponse(
const Aws::GameLift::Model::SearchGameSessionsResult& gameLiftSearchSessionsResult)
{
AzFramework::SearchSessionsResponse response;
Multiplayer::SearchSessionsResponse response;
response.m_nextToken = gameLiftSearchSessionsResult.GetNextToken().c_str();
for (const Aws::GameLift::Model::GameSession& gameSession : gameLiftSearchSessionsResult.GetGameSessions())
{
AzFramework::SessionConfig session;
Multiplayer::SessionConfig session;
session.m_creationTime = gameSession.GetCreationTime().Millis();
session.m_creatorId = gameSession.GetCreatorId().c_str();
session.m_currentPlayer = gameSession.GetCurrentPlayerSessionCount();
@ -133,7 +133,7 @@ namespace AWSGameLift
return response;
};
bool ValidateSearchSessionsRequest(const AzFramework::SearchSessionsRequest& searchSessionsRequest)
bool ValidateSearchSessionsRequest(const Multiplayer::SearchSessionsRequest& searchSessionsRequest)
{
auto gameliftSearchSessionsRequest = azrtti_cast<const AWSGameLiftSearchSessionsRequest*>(&searchSessionsRequest);
if (gameliftSearchSessionsRequest &&

@ -25,14 +25,14 @@ namespace AWSGameLift
const AWSGameLiftSearchSessionsRequest& searchSessionsRequest);
// Create SearchGameSessionsRequest and make a SeachGameSessions call through GameLift client
AzFramework::SearchSessionsResponse SearchSessions(
Multiplayer::SearchSessionsResponse SearchSessions(
const AWSGameLiftSearchSessionsRequest& searchSessionsRequest);
// Convert from Aws::GameLift::Model::SearchGameSessionsResult to AzFramework::SearchSessionsResponse.
AzFramework::SearchSessionsResponse ParseResponse(
// Convert from Aws::GameLift::Model::SearchGameSessionsResult to Multiplayer::SearchSessionsResponse.
Multiplayer::SearchSessionsResponse ParseResponse(
const Aws::GameLift::Model::SearchGameSessionsResult& gameLiftSearchSessionsResult);
// Validate SearchSessionsRequest and check required request parameters
bool ValidateSearchSessionsRequest(const AzFramework::SearchSessionsRequest& searchSessionsRequest);
bool ValidateSearchSessionsRequest(const Multiplayer::SearchSessionsRequest& searchSessionsRequest);
} // namespace SearchSessionsActivity
} // namespace AWSGameLift

@ -110,7 +110,7 @@ namespace AWSGameLift
return result;
}
bool ValidateStartMatchmakingRequest(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest)
bool ValidateStartMatchmakingRequest(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest)
{
auto gameliftStartMatchmakingRequest = azrtti_cast<const AWSGameLiftStartMatchmakingRequest*>(&startMatchmakingRequest);
bool isValid = gameliftStartMatchmakingRequest &&

@ -26,6 +26,6 @@ namespace AWSGameLift
AZStd::string StartMatchmaking(const AWSGameLiftStartMatchmakingRequest& startMatchmakingRequest);
// Validate StartMatchmakingRequest and check required request parameters
bool ValidateStartMatchmakingRequest(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest);
bool ValidateStartMatchmakingRequest(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest);
} // namespace StartMatchmakingActivity
} // namespace AWSGameLift

@ -59,7 +59,7 @@ namespace AWSGameLift
}
}
bool ValidateStopMatchmakingRequest(const AzFramework::StopMatchmakingRequest& StopMatchmakingRequest)
bool ValidateStopMatchmakingRequest(const Multiplayer::StopMatchmakingRequest& StopMatchmakingRequest)
{
auto gameliftStopMatchmakingRequest = azrtti_cast<const AWSGameLiftStopMatchmakingRequest*>(&StopMatchmakingRequest);
bool isValid = gameliftStopMatchmakingRequest && (!gameliftStopMatchmakingRequest->m_ticketId.empty());

@ -26,6 +26,6 @@ namespace AWSGameLift
void StopMatchmaking(const AWSGameLiftStopMatchmakingRequest& stopMatchmakingRequest);
// Validate StopMatchmakingRequest and check required request parameters
bool ValidateStopMatchmakingRequest(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest);
bool ValidateStopMatchmakingRequest(const Multiplayer::StopMatchmakingRequest& stopMatchmakingRequest);
} // namespace StopMatchmakingActivity
} // namespace AWSGameLift

@ -16,11 +16,11 @@ namespace AWSGameLift
{
void AWSGameLiftAcceptMatchRequest::Reflect(AZ::ReflectContext* context)
{
AzFramework::AcceptMatchRequest::Reflect(context);
Multiplayer::AcceptMatchRequest::Reflect(context);
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<AWSGameLiftAcceptMatchRequest, AzFramework::AcceptMatchRequest>()
serializeContext->Class<AWSGameLiftAcceptMatchRequest, Multiplayer::AcceptMatchRequest>()
->Version(0);
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
@ -33,7 +33,7 @@ namespace AWSGameLift
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
behaviorContext->Class<AzFramework::AcceptMatchRequest>("AcceptMatchRequest")
behaviorContext->Class<Multiplayer::AcceptMatchRequest>("AcceptMatchRequest")
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
// Expose base type to BehaviorContext, but hide it to be used directly
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All);

@ -18,7 +18,7 @@ namespace AWSGameLift
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<AWSGameLiftCreateSessionOnQueueRequest, AzFramework::CreateSessionRequest>()
serializeContext->Class<AWSGameLiftCreateSessionOnQueueRequest, Multiplayer::CreateSessionRequest>()
->Version(0)
->Field("queueName", &AWSGameLiftCreateSessionOnQueueRequest::m_queueName)
->Field("placementId", &AWSGameLiftCreateSessionOnQueueRequest::m_placementId)

@ -18,7 +18,7 @@ namespace AWSGameLift
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<AWSGameLiftCreateSessionRequest, AzFramework::CreateSessionRequest>()
serializeContext->Class<AWSGameLiftCreateSessionRequest, Multiplayer::CreateSessionRequest>()
->Version(0)
->Field("aliasId", &AWSGameLiftCreateSessionRequest::m_aliasId)
->Field("fleetId", &AWSGameLiftCreateSessionRequest::m_fleetId)

@ -15,11 +15,11 @@ namespace AWSGameLift
{
void AWSGameLiftJoinSessionRequest::Reflect(AZ::ReflectContext* context)
{
AzFramework::JoinSessionRequest::Reflect(context);
Multiplayer::JoinSessionRequest::Reflect(context);
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<AWSGameLiftJoinSessionRequest, AzFramework::JoinSessionRequest>()
serializeContext->Class<AWSGameLiftJoinSessionRequest, Multiplayer::JoinSessionRequest>()
->Version(0)
;
@ -34,7 +34,7 @@ namespace AWSGameLift
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
behaviorContext->Class<AzFramework::JoinSessionRequest>("JoinSessionRequest")
behaviorContext->Class<Multiplayer::JoinSessionRequest>("JoinSessionRequest")
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
// Expose base type to BehaviorContext, but hide it to be used directly
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)

@ -12,17 +12,17 @@
#include <AzCore/RTTI/BehaviorContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzFramework/Session/SessionConfig.h>
#include <Multiplayer/Session/SessionConfig.h>
namespace AWSGameLift
{
void AWSGameLiftSearchSessionsRequest::Reflect(AZ::ReflectContext* context)
{
AzFramework::SearchSessionsRequest::Reflect(context);
Multiplayer::SearchSessionsRequest::Reflect(context);
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<AWSGameLiftSearchSessionsRequest, AzFramework::SearchSessionsRequest>()
serializeContext->Class<AWSGameLiftSearchSessionsRequest, Multiplayer::SearchSessionsRequest>()
->Version(0)
->Field("aliasId", &AWSGameLiftSearchSessionsRequest::m_aliasId)
->Field("fleetId", &AWSGameLiftSearchSessionsRequest::m_fleetId)
@ -47,7 +47,7 @@ namespace AWSGameLift
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
behaviorContext->Class<AzFramework::SearchSessionsRequest>("SearchSessionsRequest")
behaviorContext->Class<Multiplayer::SearchSessionsRequest>("SearchSessionsRequest")
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
// Expose base type to BehaviorContext, but hide it to be used directly
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All);

@ -16,12 +16,12 @@ namespace AWSGameLift
{
void AWSGameLiftStartMatchmakingRequest::Reflect(AZ::ReflectContext* context)
{
AzFramework::StartMatchmakingRequest::Reflect(context);
Multiplayer::StartMatchmakingRequest::Reflect(context);
AWSGameLiftPlayer::Reflect(context);
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<AWSGameLiftStartMatchmakingRequest, AzFramework::StartMatchmakingRequest>()
serializeContext->Class<AWSGameLiftStartMatchmakingRequest, Multiplayer::StartMatchmakingRequest>()
->Version(0)
->Field("configurationName", &AWSGameLiftStartMatchmakingRequest::m_configurationName)
->Field("players", &AWSGameLiftStartMatchmakingRequest::m_players);
@ -40,7 +40,7 @@ namespace AWSGameLift
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
behaviorContext->Class<AzFramework::StartMatchmakingRequest>("StartMatchmakingRequest")
behaviorContext->Class<Multiplayer::StartMatchmakingRequest>("StartMatchmakingRequest")
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
// Expose base type to BehaviorContext, but hide it to be used directly
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All);

@ -16,11 +16,11 @@ namespace AWSGameLift
{
void AWSGameLiftStopMatchmakingRequest::Reflect(AZ::ReflectContext* context)
{
AzFramework::StopMatchmakingRequest::Reflect(context);
Multiplayer::StopMatchmakingRequest::Reflect(context);
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<AWSGameLiftStopMatchmakingRequest, AzFramework::StopMatchmakingRequest>()
serializeContext->Class<AWSGameLiftStopMatchmakingRequest, Multiplayer::StopMatchmakingRequest>()
->Version(0);
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
@ -33,7 +33,7 @@ namespace AWSGameLift
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
behaviorContext->Class<AzFramework::StopMatchmakingRequest>("StopMatchmakingRequest")
behaviorContext->Class<Multiplayer::StopMatchmakingRequest>("StopMatchmakingRequest")
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
// Expose base type to BehaviorContext, but hide it to be used directly
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All);

@ -10,7 +10,7 @@
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/std/smart_ptr/make_shared.h>
#include <AzFramework/Session/SessionConfig.h>
#include <Multiplayer/Session/SessionConfig.h>
#include <Credential/AWSCredentialBus.h>
#include <ResourceMapping/AWSResourceMappingBus.h>
@ -201,9 +201,9 @@ protected:
return Aws::GameLift::Model::SearchGameSessionsOutcome(result);
}
AzFramework::SearchSessionsResponse GetValidSearchSessionsResponse()
Multiplayer::SearchSessionsResponse GetValidSearchSessionsResponse()
{
AzFramework::SessionConfig sessionConfig;
Multiplayer::SessionConfig sessionConfig;
sessionConfig.m_creationTime = 0;
sessionConfig.m_terminationTime = 0;
sessionConfig.m_creatorId = "dummyCreatorId";
@ -220,7 +220,7 @@ protected:
// TODO: Update the AWS Native SDK to set the new game session attributes.
// sessionConfig.m_dnsName = "dummyDnsName";
AzFramework::SearchSessionsResponse response;
Multiplayer::SearchSessionsResponse response;
response.m_nextToken = "dummyNextToken";
response.m_sessionConfigs = { sessionConfig };
@ -344,7 +344,7 @@ TEST_F(AWSGameLiftClientManagerTest, CreateSession_CallWithoutClientSetup_GetEmp
TEST_F(AWSGameLiftClientManagerTest, CreateSession_CallWithInvalidRequest_GetEmptyResponse)
{
AZ_TEST_START_TRACE_SUPPRESSION;
auto response = m_gameliftClientManager->CreateSession(AzFramework::CreateSessionRequest());
auto response = m_gameliftClientManager->CreateSession(Multiplayer::CreateSessionRequest());
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
EXPECT_TRUE(response == "");
}
@ -381,7 +381,7 @@ TEST_F(AWSGameLiftClientManagerTest, CreateSessionAsync_CallWithInvalidRequest_G
AZ_TEST_START_TRACE_SUPPRESSION;
SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock;
EXPECT_CALL(sessionHandlerMock, OnCreateSessionAsyncComplete(AZStd::string())).Times(1);
m_gameliftClientManager->CreateSessionAsync(AzFramework::CreateSessionRequest());
m_gameliftClientManager->CreateSessionAsync(Multiplayer::CreateSessionRequest());
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
}
@ -513,7 +513,7 @@ TEST_F(AWSGameLiftClientManagerTest, JoinSession_CallWithoutClientSetup_GetFalse
TEST_F(AWSGameLiftClientManagerTest, JoinSession_CallWithInvalidRequest_GetFalseResponse)
{
AZ_TEST_START_TRACE_SUPPRESSION;
auto response = m_gameliftClientManager->JoinSession(AzFramework::JoinSessionRequest());
auto response = m_gameliftClientManager->JoinSession(Multiplayer::JoinSessionRequest());
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
EXPECT_FALSE(response);
}
@ -590,7 +590,7 @@ TEST_F(AWSGameLiftClientManagerTest, JoinSessionAsync_CallWithInvalidRequest_Get
AZ_TEST_START_TRACE_SUPPRESSION;
SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock;
EXPECT_CALL(sessionHandlerMock, OnJoinSessionAsyncComplete(false)).Times(1);
m_gameliftClientManager->JoinSessionAsync(AzFramework::JoinSessionRequest());
m_gameliftClientManager->JoinSessionAsync(Multiplayer::JoinSessionRequest());
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
}
@ -698,7 +698,7 @@ TEST_F(AWSGameLiftClientManagerTest, SearchSessions_CallWithValidRequestAndSucce
.Times(1)
.WillOnce(::testing::Return(outcome));
AzFramework::SearchSessionsResponse expectedResponse = GetValidSearchSessionsResponse();
Multiplayer::SearchSessionsResponse expectedResponse = GetValidSearchSessionsResponse();
auto result = m_gameliftClientManager->SearchSessions(request);
EXPECT_TRUE(result.m_sessionConfigs.size() != 0);
}
@ -713,7 +713,7 @@ TEST_F(AWSGameLiftClientManagerTest, SearchSessionsAsync_CallWithoutClientSetup_
SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock;
EXPECT_CALL(sessionHandlerMock,
OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(AzFramework::SearchSessionsResponse()))).Times(1);
OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(Multiplayer::SearchSessionsResponse()))).Times(1);
AZ_TEST_START_TRACE_SUPPRESSION;
m_gameliftClientManager->SearchSessionsAsync(request);
@ -725,9 +725,9 @@ TEST_F(AWSGameLiftClientManagerTest, SearchSessionsAsync_CallWithInvalidRequest_
AZ_TEST_START_TRACE_SUPPRESSION;
SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock;
EXPECT_CALL(sessionHandlerMock,
OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(AzFramework::SearchSessionsResponse()))).Times(1);
OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(Multiplayer::SearchSessionsResponse()))).Times(1);
m_gameliftClientManager->SearchSessionsAsync(AzFramework::SearchSessionsRequest());
m_gameliftClientManager->SearchSessionsAsync(Multiplayer::SearchSessionsRequest());
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
}
@ -746,7 +746,7 @@ TEST_F(AWSGameLiftClientManagerTest, SearchSessionsAsync_CallWithValidRequestAnd
SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock;
EXPECT_CALL(sessionHandlerMock,
OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(AzFramework::SearchSessionsResponse()))).Times(1);
OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(Multiplayer::SearchSessionsResponse()))).Times(1);
AZ_TEST_START_TRACE_SUPPRESSION;
m_gameliftClientManager->SearchSessionsAsync(request);
@ -765,7 +765,7 @@ TEST_F(AWSGameLiftClientManagerTest, SearchSessionsAsync_CallWithValidRequestAnd
.Times(1)
.WillOnce(::testing::Return(outcome));
AzFramework::SearchSessionsResponse expectedResponse = GetValidSearchSessionsResponse();
Multiplayer::SearchSessionsResponse expectedResponse = GetValidSearchSessionsResponse();
SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock;
EXPECT_CALL(sessionHandlerMock,
OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(expectedResponse))).Times(1);
@ -926,7 +926,7 @@ TEST_F(AWSGameLiftClientManagerTest, StopMatchmaking_CallWithoutClientSetup_GetE
TEST_F(AWSGameLiftClientManagerTest, StopMatchmaking_CallWithInvalidRequest_GetError)
{
AZ_TEST_START_TRACE_SUPPRESSION;
m_gameliftClientManager->StopMatchmaking(AzFramework::StopMatchmakingRequest());
m_gameliftClientManager->StopMatchmaking(Multiplayer::StopMatchmakingRequest());
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
}
@ -1029,7 +1029,7 @@ TEST_F(AWSGameLiftClientManagerTest, AcceptMatch_CallWithoutClientSetup_GetError
TEST_F(AWSGameLiftClientManagerTest, AcceptMatch_CallWithInvalidRequest_GetError)
{
AZ_TEST_START_TRACE_SUPPRESSION;
m_gameliftClientManager->AcceptMatch(AzFramework::AcceptMatchRequest());
m_gameliftClientManager->AcceptMatch(Multiplayer::AcceptMatchRequest());
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
}

@ -9,10 +9,10 @@
#pragma once
#include <AzCore/Interface/Interface.h>
#include <AzFramework/Session/ISessionRequests.h>
#include <AzFramework/Session/ISessionHandlingRequests.h>
#include <AzFramework/Matchmaking/IMatchmakingRequests.h>
#include <AzFramework/Matchmaking/MatchmakingNotifications.h>
#include <Multiplayer/Session/ISessionRequests.h>
#include <Multiplayer/Session/ISessionHandlingRequests.h>
#include <Multiplayer/Session/IMatchmakingRequests.h>
#include <Multiplayer/Session/MatchmakingNotifications.h>
#include <AzTest/AzTest.h>
#include <aws/core/auth/AWSCredentialsProvider.h>
@ -58,17 +58,17 @@ public:
};
class MatchmakingAsyncRequestNotificationsHandlerMock
: public AzFramework::MatchmakingAsyncRequestNotificationBus::Handler
: public Multiplayer::MatchmakingAsyncRequestNotificationBus::Handler
{
public:
MatchmakingAsyncRequestNotificationsHandlerMock()
{
AzFramework::MatchmakingAsyncRequestNotificationBus::Handler::BusConnect();
Multiplayer::MatchmakingAsyncRequestNotificationBus::Handler::BusConnect();
}
~MatchmakingAsyncRequestNotificationsHandlerMock()
{
AzFramework::MatchmakingAsyncRequestNotificationBus::Handler::BusDisconnect();
Multiplayer::MatchmakingAsyncRequestNotificationBus::Handler::BusDisconnect();
}
MOCK_METHOD0(OnAcceptMatchAsyncComplete, void());
@ -77,17 +77,17 @@ public:
};
class MatchmakingNotificationsHandlerMock
: public AzFramework::MatchmakingNotificationBus::Handler
: public Multiplayer::MatchmakingNotificationBus::Handler
{
public:
MatchmakingNotificationsHandlerMock()
{
AzFramework::MatchmakingNotificationBus::Handler::BusConnect();
Multiplayer::MatchmakingNotificationBus::Handler::BusConnect();
}
~MatchmakingNotificationsHandlerMock()
{
AzFramework::MatchmakingNotificationBus::Handler::BusDisconnect();
Multiplayer::MatchmakingNotificationBus::Handler::BusDisconnect();
}
void OnMatchAcceptance() override
@ -117,39 +117,39 @@ public:
};
class SessionAsyncRequestNotificationsHandlerMock
: public AzFramework::SessionAsyncRequestNotificationBus::Handler
: public Multiplayer::SessionAsyncRequestNotificationBus::Handler
{
public:
SessionAsyncRequestNotificationsHandlerMock()
{
AzFramework::SessionAsyncRequestNotificationBus::Handler::BusConnect();
Multiplayer::SessionAsyncRequestNotificationBus::Handler::BusConnect();
}
~SessionAsyncRequestNotificationsHandlerMock()
{
AzFramework::SessionAsyncRequestNotificationBus::Handler::BusDisconnect();
Multiplayer::SessionAsyncRequestNotificationBus::Handler::BusDisconnect();
}
MOCK_METHOD1(OnCreateSessionAsyncComplete, void(const AZStd::string&));
MOCK_METHOD1(OnSearchSessionsAsyncComplete, void(const AzFramework::SearchSessionsResponse&));
MOCK_METHOD1(OnSearchSessionsAsyncComplete, void(const Multiplayer::SearchSessionsResponse&));
MOCK_METHOD1(OnJoinSessionAsyncComplete, void(bool));
MOCK_METHOD0(OnLeaveSessionAsyncComplete, void());
};
class SessionHandlingClientRequestsMock
: public AzFramework::ISessionHandlingClientRequests
: public Multiplayer::ISessionHandlingClientRequests
{
public:
SessionHandlingClientRequestsMock()
{
AZ::Interface<AzFramework::ISessionHandlingClientRequests>::Register(this);
AZ::Interface<Multiplayer::ISessionHandlingClientRequests>::Register(this);
}
virtual ~SessionHandlingClientRequestsMock()
{
AZ::Interface<AzFramework::ISessionHandlingClientRequests>::Unregister(this);
AZ::Interface<Multiplayer::ISessionHandlingClientRequests>::Unregister(this);
}
MOCK_METHOD1(RequestPlayerJoinSession, bool(const AzFramework::SessionConnectionConfig&));
MOCK_METHOD1(RequestPlayerJoinSession, bool(const Multiplayer::SessionConnectionConfig&));
MOCK_METHOD0(RequestPlayerLeaveSession, void());
};

@ -35,7 +35,7 @@ TEST_F(AWSGameLiftAcceptMatchActivityTest, BuildAWSGameLiftAcceptMatchRequest_Ca
TEST_F(AWSGameLiftAcceptMatchActivityTest, ValidateAcceptMatchRequest_CallWithBaseType_GetFalseResult)
{
AZ_TEST_START_TRACE_SUPPRESSION;
auto result = AcceptMatchActivity::ValidateAcceptMatchRequest(AzFramework::AcceptMatchRequest());
auto result = AcceptMatchActivity::ValidateAcceptMatchRequest(Multiplayer::AcceptMatchRequest());
EXPECT_FALSE(result);
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
}

@ -39,7 +39,7 @@ TEST_F(AWSGameLiftCreateSessionActivityTest, BuildAWSGameLiftCreateGameSessionRe
TEST_F(AWSGameLiftCreateSessionActivityTest, ValidateCreateSessionRequest_CallWithBaseType_GetFalseResult)
{
auto result = CreateSessionActivity::ValidateCreateSessionRequest(AzFramework::CreateSessionRequest());
auto result = CreateSessionActivity::ValidateCreateSessionRequest(Multiplayer::CreateSessionRequest());
EXPECT_FALSE(result);
}

@ -35,7 +35,7 @@ TEST_F(AWSGameLiftCreateSessionOnQueueActivityTest, BuildAWSGameLiftCreateGameSe
TEST_F(AWSGameLiftCreateSessionOnQueueActivityTest, ValidateCreateSessionOnQueueRequest_CallWithBaseType_GetFalseResult)
{
auto result = CreateSessionOnQueueActivity::ValidateCreateSessionOnQueueRequest(AzFramework::CreateSessionRequest());
auto result = CreateSessionOnQueueActivity::ValidateCreateSessionOnQueueRequest(Multiplayer::CreateSessionRequest());
EXPECT_FALSE(result);
}

@ -6,7 +6,7 @@
*
*/
#include <AzFramework/Session/ISessionHandlingRequests.h>
#include <Multiplayer/Session/ISessionHandlingRequests.h>
#include <AWSGameLiftClientFixture.h>
#include <Activity/AWSGameLiftJoinSessionActivity.h>
@ -47,7 +47,7 @@ TEST_F(AWSGameLiftJoinSessionActivityTest, BuildSessionConnectionConfig_Call_Get
TEST_F(AWSGameLiftJoinSessionActivityTest, ValidateJoinSessionRequest_CallWithBaseType_GetFalseResult)
{
AZ_TEST_START_TRACE_SUPPRESSION;
auto result = JoinSessionActivity::ValidateJoinSessionRequest(AzFramework::JoinSessionRequest());
auto result = JoinSessionActivity::ValidateJoinSessionRequest(Multiplayer::JoinSessionRequest());
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
EXPECT_FALSE(result);
}

@ -6,7 +6,7 @@
*
*/
#include <AzFramework/Session/SessionConfig.h>
#include <Multiplayer/Session/SessionConfig.h>
#include <Activity/AWSGameLiftSearchSessionsActivity.h>
#include <AWSGameLiftClientFixture.h>
@ -45,7 +45,7 @@ TEST_F(AWSGameLiftSearchSessionsActivityTest, BuildAWSGameLiftSearchGameSessions
TEST_F(AWSGameLiftSearchSessionsActivityTest, ValidateSearchSessionsRequest_CallWithBaseType_GetFalseResult)
{
AZ_TEST_START_TRACE_SUPPRESSION;
auto result = SearchSessionsActivity::ValidateSearchSessionsRequest(AzFramework::SearchSessionsRequest());
auto result = SearchSessionsActivity::ValidateSearchSessionsRequest(Multiplayer::SearchSessionsRequest());
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
EXPECT_FALSE(result);
}

@ -49,7 +49,7 @@ TEST_F(AWSGameLiftStartMatchmakingActivityTest, BuildAWSGameLiftStartMatchmaking
TEST_F(AWSGameLiftStartMatchmakingActivityTest, ValidateStartMatchmakingRequest_CallWithBaseType_GetFalseResult)
{
AZ_TEST_START_TRACE_SUPPRESSION;
auto result = StartMatchmakingActivity::ValidateStartMatchmakingRequest(AzFramework::StartMatchmakingRequest());
auto result = StartMatchmakingActivity::ValidateStartMatchmakingRequest(Multiplayer::StartMatchmakingRequest());
EXPECT_FALSE(result);
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
}

@ -26,7 +26,7 @@ TEST_F(AWSGameLiftStopMatchmakingActivityTest, BuildAWSGameLiftStopMatchmakingRe
TEST_F(AWSGameLiftStopMatchmakingActivityTest, ValidateStopMatchmakingRequest_CallWithoutTicketId_GetFalseResult)
{
AZ_TEST_START_TRACE_SUPPRESSION;
auto result = StopMatchmakingActivity::ValidateStopMatchmakingRequest(AzFramework::StopMatchmakingRequest());
auto result = StopMatchmakingActivity::ValidateStopMatchmakingRequest(Multiplayer::StopMatchmakingRequest());
EXPECT_FALSE(result);
AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message
}

@ -25,7 +25,7 @@ ly_add_target(
BUILD_DEPENDENCIES
PRIVATE
AZ::AzCore
AZ::AzFramework
Gem::Multiplayer.Static
3rdParty::AWSGameLiftServerSDK
)
@ -62,8 +62,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
BUILD_DEPENDENCIES
PRIVATE
AZ::AzCore
AZ::AzFramework
AZ::AzTest
Gem::Multiplayer.Static
Gem::AWSGameLift.Server.Static
3rdParty::AWSGameLiftServerSDK
)

@ -21,7 +21,7 @@
#include <AzCore/JSON/stringbuffer.h>
#include <AzCore/JSON/writer.h>
#include <AzCore/std/bind/bind.h>
#include <AzFramework/Session/SessionNotifications.h>
#include <Multiplayer/Session/SessionNotifications.h>
namespace AWSGameLift
{
@ -50,7 +50,7 @@ namespace AWSGameLift
AZ::Interface<IAWSGameLiftServerRequests>::Unregister(this);
}
bool AWSGameLiftServerManager::AddConnectedPlayer(const AzFramework::PlayerConnectionConfig& playerConnectionConfig)
bool AWSGameLiftServerManager::AddConnectedPlayer(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig)
{
AZStd::lock_guard<AZStd::mutex> lock(m_gameliftMutex);
if (m_connectedPlayers.contains(playerConnectionConfig.m_playerConnectionId))
@ -100,9 +100,9 @@ namespace AWSGameLift
return serverProcessDesc;
}
AzFramework::SessionConfig AWSGameLiftServerManager::BuildSessionConfig(const Aws::GameLift::Server::Model::GameSession& gameSession)
Multiplayer::SessionConfig AWSGameLiftServerManager::BuildSessionConfig(const Aws::GameLift::Server::Model::GameSession& gameSession)
{
AzFramework::SessionConfig sessionConfig;
Multiplayer::SessionConfig sessionConfig;
sessionConfig.m_dnsName = gameSession.GetDnsName().c_str();
AZStd::string propertiesOutput = "";
@ -437,9 +437,9 @@ namespace AWSGameLift
void AWSGameLiftServerManager::HandleDestroySession()
{
// No further request should be handled by GameLift server manager at this point
if (AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get())
if (AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Get())
{
AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Unregister(this);
AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Unregister(this);
}
AZ_TracePrintf(AWSGameLiftServerManagerName, "Server process is scheduled to be shut down at %s",
@ -448,7 +448,7 @@ namespace AWSGameLift
// Send notifications to handler(s) to gracefully shut down the server process.
bool destroySessionResult = true;
AZ::EBusReduceResult<bool&, AZStd::logical_and<bool>> result(destroySessionResult);
AzFramework::SessionNotificationBus::BroadcastResult(result, &AzFramework::SessionNotifications::OnDestroySessionBegin);
Multiplayer::SessionNotificationBus::BroadcastResult(result, &Multiplayer::SessionNotifications::OnDestroySessionBegin);
if (!destroySessionResult)
{
@ -461,7 +461,7 @@ namespace AWSGameLift
if (processEndingOutcome.IsSuccess())
{
AZ_TracePrintf(AWSGameLiftServerManagerName, "ProcessEnding request against Amazon GameLift service succeeded.");
AzFramework::SessionNotificationBus::Broadcast(&AzFramework::SessionNotifications::OnDestroySessionEnd);
Multiplayer::SessionNotificationBus::Broadcast(&Multiplayer::SessionNotifications::OnDestroySessionEnd);
}
else
{
@ -470,7 +470,7 @@ namespace AWSGameLift
}
}
void AWSGameLiftServerManager::HandlePlayerLeaveSession(const AzFramework::PlayerConnectionConfig& playerConnectionConfig)
void AWSGameLiftServerManager::HandlePlayerLeaveSession(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig)
{
AZStd::string playerSessionId = "";
RemoveConnectedPlayer(playerConnectionConfig.m_playerConnectionId, playerSessionId);
@ -536,12 +536,12 @@ namespace AWSGameLift
void AWSGameLiftServerManager::OnStartGameSession(const Aws::GameLift::Server::Model::GameSession& gameSession)
{
UpdateGameSessionData(gameSession);
AzFramework::SessionConfig sessionConfig = BuildSessionConfig(gameSession);
Multiplayer::SessionConfig sessionConfig = BuildSessionConfig(gameSession);
bool createSessionResult = true;
AZ::EBusReduceResult<bool&, AZStd::logical_and<bool>> result(createSessionResult);
AzFramework::SessionNotificationBus::BroadcastResult(
result, &AzFramework::SessionNotifications::OnCreateSessionBegin, sessionConfig);
Multiplayer::SessionNotificationBus::BroadcastResult(
result, &Multiplayer::SessionNotifications::OnCreateSessionBegin, sessionConfig);
if (createSessionResult)
{
@ -552,11 +552,11 @@ namespace AWSGameLift
{
AZ_TracePrintf(AWSGameLiftServerManagerName, "ActivateGameSession request against Amazon GameLift service succeeded.");
// Register server manager as handler once game session has been activated
if (!AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get())
if (!AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Get())
{
AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Register(this);
AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Register(this);
}
AzFramework::SessionNotificationBus::Broadcast(&AzFramework::SessionNotifications::OnCreateSessionEnd);
Multiplayer::SessionNotificationBus::Broadcast(&Multiplayer::SessionNotifications::OnCreateSessionEnd);
}
else
{
@ -583,16 +583,16 @@ namespace AWSGameLift
{
bool healthCheckResult = true;
AZ::EBusReduceResult<bool&, AZStd::logical_and<bool>> result(healthCheckResult);
AzFramework::SessionNotificationBus::BroadcastResult(result, &AzFramework::SessionNotifications::OnSessionHealthCheck);
Multiplayer::SessionNotificationBus::BroadcastResult(result, &Multiplayer::SessionNotifications::OnSessionHealthCheck);
return m_serverSDKInitialized && healthCheckResult;
}
void AWSGameLiftServerManager::OnUpdateGameSession(const Aws::GameLift::Server::Model::UpdateGameSession& updateGameSession)
{
AzFramework::SessionConfig sessionConfig = BuildSessionConfig(updateGameSession.GetGameSession());
Multiplayer::SessionConfig sessionConfig = BuildSessionConfig(updateGameSession.GetGameSession());
Aws::GameLift::Server::Model::UpdateReason updateReason = updateGameSession.GetUpdateReason();
AzFramework::SessionNotificationBus::Broadcast(&AzFramework::SessionNotifications::OnUpdateSessionBegin,
Multiplayer::SessionNotificationBus::Broadcast(&Multiplayer::SessionNotifications::OnUpdateSessionBegin,
sessionConfig, Aws::GameLift::Server::Model::UpdateReasonMapper::GetNameForUpdateReason(updateReason).c_str());
// Update game session data locally
@ -601,7 +601,7 @@ namespace AWSGameLift
UpdateGameSessionData(updateGameSession.GetGameSession());
}
AzFramework::SessionNotificationBus::Broadcast(&AzFramework::SessionNotifications::OnUpdateSessionEnd);
Multiplayer::SessionNotificationBus::Broadcast(&Multiplayer::SessionNotifications::OnUpdateSessionEnd);
}
bool AWSGameLiftServerManager::RemoveConnectedPlayer(uint32_t playerConnectionId, AZStd::string& outPlayerSessionId)
@ -713,7 +713,7 @@ namespace AWSGameLift
}
}
bool AWSGameLiftServerManager::ValidatePlayerJoinSession(const AzFramework::PlayerConnectionConfig& playerConnectionConfig)
bool AWSGameLiftServerManager::ValidatePlayerJoinSession(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig)
{
uint32_t playerConnectionId = playerConnectionConfig.m_playerConnectionId;
AZStd::string playerSessionId = playerConnectionConfig.m_playerSessionId;

@ -16,8 +16,8 @@
#include <AzCore/std/containers/vector.h>
#include <AzCore/std/string/string.h>
#include <AzCore/std/smart_ptr/unique_ptr.h>
#include <AzFramework/Session/ISessionHandlingRequests.h>
#include <AzFramework/Session/SessionConfig.h>
#include <Multiplayer/Session/ISessionHandlingRequests.h>
#include <Multiplayer/Session/SessionConfig.h>
#include <AWSGameLiftPlayer.h>
#include <Request/AWSGameLiftServerRequestBus.h>
@ -37,7 +37,7 @@ namespace AWSGameLift
//! Manage the server process for hosting game sessions via GameLiftServerSDK.
class AWSGameLiftServerManager
: public AWSGameLiftServerRequestBus::Handler
, public AzFramework::ISessionHandlingProviderRequests
, public Multiplayer::ISessionHandlingProviderRequests
{
public:
static constexpr const char AWSGameLiftServerManagerName[] = "AWSGameLiftServerManager";
@ -117,8 +117,8 @@ namespace AWSGameLift
// ISessionHandlingProviderRequests interface implementation
void HandleDestroySession() override;
bool ValidatePlayerJoinSession(const AzFramework::PlayerConnectionConfig& playerConnectionConfig) override;
void HandlePlayerLeaveSession(const AzFramework::PlayerConnectionConfig& playerConnectionConfig) override;
bool ValidatePlayerJoinSession(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig) override;
void HandlePlayerLeaveSession(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig) override;
AZ::IO::Path GetExternalSessionCertificate() override;
AZ::IO::Path GetInternalSessionCertificate() override;
@ -126,7 +126,7 @@ namespace AWSGameLift
void SetGameLiftServerSDKWrapper(AZStd::unique_ptr<GameLiftServerSDKWrapper> gameLiftServerSDKWrapper);
//! Add connected player session id.
bool AddConnectedPlayer(const AzFramework::PlayerConnectionConfig& playerConnectionConfig);
bool AddConnectedPlayer(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig);
//! Get active server player data from lazy loaded game session for server match backfill
AZStd::vector<AWSGameLiftPlayer> GetActiveServerMatchBackfillPlayers();
@ -157,7 +157,7 @@ namespace AWSGameLift
void BuildStopMatchBackfillRequest(const AZStd::string& ticketId, Aws::GameLift::Server::Model::StopMatchBackfillRequest& outRequest);
//! Build session config by using AWS GameLift Server GameSession Model.
AzFramework::SessionConfig BuildSessionConfig(const Aws::GameLift::Server::Model::GameSession& gameSession);
Multiplayer::SessionConfig BuildSessionConfig(const Aws::GameLift::Server::Model::GameSession& gameSession);
//! Check whether matchmaking data is in proper format
bool IsMatchmakingDataValid();

@ -11,8 +11,8 @@
#include <AzCore/Interface/Interface.h>
#include <AzFramework/IO/LocalFileIO.h>
#include <AzFramework/Session/SessionConfig.h>
#include <AzFramework/Session/SessionNotifications.h>
#include <Multiplayer/Session/SessionConfig.h>
#include <Multiplayer/Session/SessionNotifications.h>
namespace UnitTest
{
@ -154,25 +154,25 @@ R"({
}
class SessionNotificationsHandlerMock
: public AzFramework::SessionNotificationBus::Handler
: public Multiplayer::SessionNotificationBus::Handler
{
public:
SessionNotificationsHandlerMock()
{
AzFramework::SessionNotificationBus::Handler::BusConnect();
Multiplayer::SessionNotificationBus::Handler::BusConnect();
}
~SessionNotificationsHandlerMock()
{
AzFramework::SessionNotificationBus::Handler::BusDisconnect();
Multiplayer::SessionNotificationBus::Handler::BusDisconnect();
}
MOCK_METHOD0(OnSessionHealthCheck, bool());
MOCK_METHOD1(OnCreateSessionBegin, bool(const AzFramework::SessionConfig&));
MOCK_METHOD1(OnCreateSessionBegin, bool(const Multiplayer::SessionConfig&));
MOCK_METHOD0(OnCreateSessionEnd, void());
MOCK_METHOD0(OnDestroySessionBegin, bool());
MOCK_METHOD0(OnDestroySessionEnd, void());
MOCK_METHOD2(OnUpdateSessionBegin, void(const AzFramework::SessionConfig&, const AZStd::string&));
MOCK_METHOD2(OnUpdateSessionBegin, void(const Multiplayer::SessionConfig&, const AZStd::string&));
MOCK_METHOD0(OnUpdateSessionEnd, void());
};
@ -255,9 +255,9 @@ R"({
{
m_serverManager->InitializeGameLiftServerSDK();
m_serverManager->NotifyGameLiftProcessReady();
if (!AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get())
if (!AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Get())
{
AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Register(m_serverManager.get());
AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Register(m_serverManager.get());
}
SessionNotificationsHandlerMock handlerMock;
@ -270,16 +270,16 @@ R"({
m_serverManager->m_gameLiftServerSDKWrapperMockPtr->m_onProcessTerminateFunc();
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
EXPECT_FALSE(AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get());
EXPECT_FALSE(AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Get());
}
TEST_F(GameLiftServerManagerTest, OnProcessTerminate_OnDestroySessionBeginReturnsTrue_TerminationNotificationSent)
{
m_serverManager->InitializeGameLiftServerSDK();
m_serverManager->NotifyGameLiftProcessReady();
if (!AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get())
if (!AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Get())
{
AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Register(m_serverManager.get());
AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Register(m_serverManager.get());
}
SessionNotificationsHandlerMock handlerMock;
@ -292,16 +292,16 @@ R"({
m_serverManager->m_gameLiftServerSDKWrapperMockPtr->m_onProcessTerminateFunc();
EXPECT_FALSE(AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get());
EXPECT_FALSE(AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Get());
}
TEST_F(GameLiftServerManagerTest, OnProcessTerminate_OnDestroySessionBeginReturnsTrue_TerminationNotificationSentButFail)
{
m_serverManager->InitializeGameLiftServerSDK();
m_serverManager->NotifyGameLiftProcessReady();
if (!AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get())
if (!AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Get())
{
AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Register(m_serverManager.get());
AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Register(m_serverManager.get());
}
SessionNotificationsHandlerMock handlerMock;
@ -316,7 +316,7 @@ R"({
m_serverManager->m_gameLiftServerSDKWrapperMockPtr->m_onProcessTerminateFunc();
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
EXPECT_FALSE(AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get());
EXPECT_FALSE(AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Get());
}
TEST_F(GameLiftServerManagerTest, OnHealthCheck_OnSessionHealthCheckReturnsTrue_CallbackFunctionReturnsTrue)
@ -379,7 +379,7 @@ R"({
testProperty.SetValue("testValue");
testSession.AddGameProperties(testProperty);
m_serverManager->m_gameLiftServerSDKWrapperMockPtr->m_onStartGameSessionFunc(testSession);
EXPECT_TRUE(AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get());
EXPECT_TRUE(AZ::Interface<Multiplayer::ISessionHandlingProviderRequests>::Get());
m_serverManager->HandleDestroySession();
}
@ -465,14 +465,14 @@ R"({
TEST_F(GameLiftServerManagerTest, ValidatePlayerJoinSession_CallWithInvalidConnectionConfig_GetFalseResultAndExpectedErrorLog)
{
AZ_TEST_START_TRACE_SUPPRESSION;
auto result = m_serverManager->ValidatePlayerJoinSession(AzFramework::PlayerConnectionConfig());
auto result = m_serverManager->ValidatePlayerJoinSession(Multiplayer::PlayerConnectionConfig());
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
EXPECT_FALSE(result);
}
TEST_F(GameLiftServerManagerTest, ValidatePlayerJoinSession_CallWithDuplicatedConnectionId_GetFalseResultAndExpectedErrorLog)
{
AzFramework::PlayerConnectionConfig connectionConfig1;
Multiplayer::PlayerConnectionConfig connectionConfig1;
connectionConfig1.m_playerConnectionId = 123;
connectionConfig1.m_playerSessionId = "dummyPlayerSessionId1";
GenericOutcome successOutcome(nullptr);
@ -480,7 +480,7 @@ R"({
.Times(1)
.WillOnce(Return(successOutcome));
m_serverManager->ValidatePlayerJoinSession(connectionConfig1);
AzFramework::PlayerConnectionConfig connectionConfig2;
Multiplayer::PlayerConnectionConfig connectionConfig2;
connectionConfig2.m_playerConnectionId = 123;
connectionConfig2.m_playerSessionId = "dummyPlayerSessionId2";
AZ_TEST_START_TRACE_SUPPRESSION;
@ -491,7 +491,7 @@ R"({
TEST_F(GameLiftServerManagerTest, ValidatePlayerJoinSession_CallWithValidConnectionConfigButErrorOutcome_GetFalseResultAndExpectedErrorLog)
{
AzFramework::PlayerConnectionConfig connectionConfig;
Multiplayer::PlayerConnectionConfig connectionConfig;
connectionConfig.m_playerConnectionId = 123;
connectionConfig.m_playerSessionId = "dummyPlayerSessionId1";
EXPECT_CALL(*(m_serverManager->m_gameLiftServerSDKWrapperMockPtr), AcceptPlayerSession(testing::_)).Times(1);
@ -503,7 +503,7 @@ R"({
TEST_F(GameLiftServerManagerTest, ValidatePlayerJoinSession_CallWithValidConnectionConfigAndSuccessOutcome_GetTrueResult)
{
AzFramework::PlayerConnectionConfig connectionConfig;
Multiplayer::PlayerConnectionConfig connectionConfig;
connectionConfig.m_playerConnectionId = 123;
connectionConfig.m_playerSessionId = "dummyPlayerSessionId1";
GenericOutcome successOutcome(nullptr);
@ -516,7 +516,7 @@ R"({
TEST_F(GameLiftServerManagerTest, ValidatePlayerJoinSession_CallWithFirstErrorSecondSuccess_GetFirstFalseSecondTrueResult)
{
AzFramework::PlayerConnectionConfig connectionConfig1;
Multiplayer::PlayerConnectionConfig connectionConfig1;
connectionConfig1.m_playerConnectionId = 123;
connectionConfig1.m_playerSessionId = "dummyPlayerSessionId1";
GenericOutcome successOutcome(nullptr);
@ -530,7 +530,7 @@ R"({
auto result = m_serverManager->ValidatePlayerJoinSession(connectionConfig1);
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
EXPECT_FALSE(result);
AzFramework::PlayerConnectionConfig connectionConfig2;
Multiplayer::PlayerConnectionConfig connectionConfig2;
connectionConfig2.m_playerConnectionId = 123;
connectionConfig2.m_playerSessionId = "dummyPlayerSessionId2";
result = m_serverManager->ValidatePlayerJoinSession(connectionConfig2);
@ -549,7 +549,7 @@ R"({
for (int index = 0; index < testThreadNumber; index++)
{
testThreadPool.emplace_back(AZStd::thread([&]() {
AzFramework::PlayerConnectionConfig connectionConfig;
Multiplayer::PlayerConnectionConfig connectionConfig;
connectionConfig.m_playerConnectionId = 123;
connectionConfig.m_playerSessionId = "dummyPlayerSessionId";
auto result = m_serverManager->ValidatePlayerJoinSession(connectionConfig);
@ -571,19 +571,19 @@ R"({
EXPECT_CALL(*(m_serverManager->m_gameLiftServerSDKWrapperMockPtr), RemovePlayerSession(testing::_)).Times(0);
AZ_TEST_START_TRACE_SUPPRESSION;
m_serverManager->HandlePlayerLeaveSession(AzFramework::PlayerConnectionConfig());
m_serverManager->HandlePlayerLeaveSession(Multiplayer::PlayerConnectionConfig());
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
}
TEST_F(GameLiftServerManagerTest, HandlePlayerLeaveSession_CallWithNonExistentPlayerConnectionId_GetExpectedErrorLog)
{
AzFramework::PlayerConnectionConfig connectionConfig;
Multiplayer::PlayerConnectionConfig connectionConfig;
connectionConfig.m_playerConnectionId = 123;
connectionConfig.m_playerSessionId = "dummyPlayerSessionId";
auto result = m_serverManager->AddConnectedTestPlayer(connectionConfig);
EXPECT_TRUE(result);
AzFramework::PlayerConnectionConfig connectionConfig1;
Multiplayer::PlayerConnectionConfig connectionConfig1;
connectionConfig1.m_playerConnectionId = 456;
connectionConfig1.m_playerSessionId = "dummyPlayerSessionId";
@ -596,7 +596,7 @@ R"({
TEST_F(GameLiftServerManagerTest, HandlePlayerLeaveSession_CallWithValidConnectionConfigButErrorOutcome_GetExpectedErrorLog)
{
AzFramework::PlayerConnectionConfig connectionConfig;
Multiplayer::PlayerConnectionConfig connectionConfig;
connectionConfig.m_playerConnectionId = 123;
connectionConfig.m_playerSessionId = "dummyPlayerSessionId";
auto result = m_serverManager->AddConnectedTestPlayer(connectionConfig);
@ -615,7 +615,7 @@ R"({
TEST_F(GameLiftServerManagerTest, HandlePlayerLeaveSession_CallWithValidConnectionConfigAndSuccessOutcome_RemovePlayerSessionNotificationSent)
{
AzFramework::PlayerConnectionConfig connectionConfig;
Multiplayer::PlayerConnectionConfig connectionConfig;
connectionConfig.m_playerConnectionId = 123;
connectionConfig.m_playerSessionId = "dummyPlayerSessionId";
auto result = m_serverManager->AddConnectedTestPlayer(connectionConfig);
@ -631,7 +631,7 @@ R"({
TEST_F(GameLiftServerManagerTest, HandlePlayerLeaveSession_CallWithMultithread_OnlyOneNotificationIsSent)
{
AzFramework::PlayerConnectionConfig connectionConfig;
Multiplayer::PlayerConnectionConfig connectionConfig;
connectionConfig.m_playerConnectionId = 123;
connectionConfig.m_playerSessionId = "dummyPlayerSessionId";
auto result = m_serverManager->AddConnectedTestPlayer(connectionConfig);

@ -95,7 +95,7 @@ namespace UnitTest
UpdateGameSessionData(m_testGameSession);
}
bool AddConnectedTestPlayer(const AzFramework::PlayerConnectionConfig& playerConnectionConfig)
bool AddConnectedTestPlayer(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig)
{
return AddConnectedPlayer(playerConnectionConfig);
}

@ -0,0 +1,56 @@
{
"Type": "JsonSerialization",
"Version": 1,
"ClassName": "MultiplatformPresetSettings",
"ClassData": {
"DefaultPreset": {
"UUID": "{C5E76E09-39FA-411F-B2E2-15B47BB6AB5F}",
"Name": "GSI",
"OutputTypeHandling": "UseInputFormat",
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"PlatformsPresets": {
"android": {
"UUID": "{C5E76E09-39FA-411F-B2E2-15B47BB6AB5F}",
"Name": "GSI",
"OutputTypeHandling": "UseInputFormat",
"MaxTextureSize": 2048,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"ios": {
"UUID": "{C5E76E09-39FA-411F-B2E2-15B47BB6AB5F}",
"Name": "GSI",
"OutputTypeHandling": "UseInputFormat",
"MaxTextureSize": 2048,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"mac": {
"UUID": "{C5E76E09-39FA-411F-B2E2-15B47BB6AB5F}",
"Name": "GSI",
"OutputTypeHandling": "UseInputFormat",
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"provo": {
"UUID": "{C5E76E09-39FA-411F-B2E2-15B47BB6AB5F}",
"Name": "GSI",
"OutputTypeHandling": "UseInputFormat",
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
}
}
}
}

@ -0,0 +1,61 @@
{
"Type": "JsonSerialization",
"Version": 1,
"ClassName": "MultiplatformPresetSettings",
"ClassData": {
"DefaultPreset": {
"UUID": "{181FE328-5408-4722-895F-1BB61803997B}",
"Name": "GSI16",
"PixelFormat": "R16",
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"PlatformsPresets": {
"android": {
"UUID": "{181FE328-5408-4722-895F-1BB61803997B}",
"Name": "GSI16",
"PixelFormat": "R16",
"MaxTextureSize": 2048,
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"ios": {
"UUID": "{181FE328-5408-4722-895F-1BB61803997B}",
"Name": "GSI16",
"PixelFormat": "R16",
"MaxTextureSize": 2048,
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"mac": {
"UUID": "{181FE328-5408-4722-895F-1BB61803997B}",
"Name": "GSI16",
"PixelFormat": "R16",
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"provo": {
"UUID": "{181FE328-5408-4722-895F-1BB61803997B}",
"Name": "GSI16",
"PixelFormat": "R16",
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
}
}
}
}

@ -0,0 +1,61 @@
{
"Type": "JsonSerialization",
"Version": 1,
"ClassName": "MultiplatformPresetSettings",
"ClassData": {
"DefaultPreset": {
"UUID": "{604FB174-7165-4F6E-889A-3B91DEC9311C}",
"Name": "GSI32",
"PixelFormat": "R32",
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"PlatformsPresets": {
"android": {
"UUID": "{604FB174-7165-4F6E-889A-3B91DEC9311C}",
"Name": "GSI32",
"PixelFormat": "R32",
"MaxTextureSize": 2048,
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"ios": {
"UUID": "{604FB174-7165-4F6E-889A-3B91DEC9311C}",
"Name": "GSI32",
"PixelFormat": "R32",
"MaxTextureSize": 2048,
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"mac": {
"UUID": "{604FB174-7165-4F6E-889A-3B91DEC9311C}",
"Name": "GSI32",
"PixelFormat": "R32",
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"provo": {
"UUID": "{604FB174-7165-4F6E-889A-3B91DEC9311C}",
"Name": "GSI32",
"PixelFormat": "R32",
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
}
}
}
}

@ -0,0 +1,61 @@
{
"Type": "JsonSerialization",
"Version": 1,
"ClassName": "MultiplatformPresetSettings",
"ClassData": {
"DefaultPreset": {
"UUID": "{84B1FE72-AD1A-4E50-83CC-4253ABA59733}",
"Name": "GSI8",
"PixelFormat": "R8",
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"PlatformsPresets": {
"android": {
"UUID": "{84B1FE72-AD1A-4E50-83CC-4253ABA59733}",
"Name": "GSI8",
"PixelFormat": "R8",
"MaxTextureSize": 2048,
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"ios": {
"UUID": "{84B1FE72-AD1A-4E50-83CC-4253ABA59733}",
"Name": "GSI8",
"PixelFormat": "R8",
"MaxTextureSize": 2048,
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"mac": {
"UUID": "{84B1FE72-AD1A-4E50-83CC-4253ABA59733}",
"Name": "GSI8",
"PixelFormat": "R8",
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
},
"provo": {
"UUID": "{84B1FE72-AD1A-4E50-83CC-4253ABA59733}",
"Name": "GSI8",
"PixelFormat": "R8",
"DiscardAlpha": true,
"IsPowerOf2": true,
"MipMapSetting": {
"MipGenType": "Box"
}
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save