Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .yamato/_triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ pr_code_changes_checks:
# Coverage on other standalone machines is present in Nightly job so it's enough to not run all of them for PRs
# desktop_standalone_test and cmb_service_standalone_test are both reusing desktop_standalone_build dependency so we run those in the same configuration on PRs to reduce waiting time.
# Note that our daily tests will anyway run both test configurations in "minimal supported" and "trunk" configurations
- .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_ubuntu_il2cpp_trunk
- .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_trunk
# TODO: Move these tests back to trunk
- .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_ubuntu_il2cpp_6000.4
- .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_6000.4
triggers:
expression: |-
(pull_request.comment eq "ngo" OR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ internal NetworkSceneHandle(int handle, bool asMock)
/// <summary>
/// Implicit conversion from <see cref="SceneHandle"/> to <see cref="NetworkSceneHandle"/>.
/// </summary>
/// <param name="handle"></param>
/// <param name="handle">The SceneHandle to covert</param>
public static implicit operator NetworkSceneHandle(SceneHandle handle) => new(handle);

/// <summary>
/// Implicit conversion from <see cref="NetworkSceneHandle"/> to <see cref="SceneHandle"/>.
/// </summary>
/// <param name="handle">The NetworkSceneHandle to convert</param>
public static implicit operator SceneHandle(NetworkSceneHandle handle) => handle.m_Handle;
#else
/// <summary>
/// Implicit conversion from <see langword="int"/> to <see cref="NetworkSceneHandle"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3115,19 +3115,67 @@ public struct SceneMap : INetworkSerializable
/// The name of the scene
/// </summary>
public string SceneName;

#if SCENE_MANAGEMENT_SCENE_HANDLE_NO_INT_CONVERSION
/// <summary>
/// The scene's server handle (a.k.a network scene handle)
/// </summary>
/// <remarks>
/// This is deprecated in favor of ServerSceneHandle
/// </remarks>
[Obsolete("Int representation of a SceneHandle is deprecated, please use SceneHandle instead. (UnityUpgradable) -> ServerSceneHandle")]
#else
/// <summary>
/// The scene's server handle (a.k.a network scene handle)
/// </summary>
#endif
public int ServerHandle;

#if SCENE_MANAGEMENT_SCENE_HANDLE_NO_INT_CONVERSION
/// <summary>
/// The mapped handled. This could be the ServerHandle or LocalHandle depending upon context (client or server).
/// </summary>
/// <remarks>
/// This is deprecated in favor of MappedLocalSceneHandle
/// </remarks>
[Obsolete("Int representation of a SceneHandle is deprecated, please use SceneHandle instead. (UnityUpgradable) -> MappedLocalSceneHandle")]
#else
/// <summary>
/// The mapped handled. This could be the ServerHandle or LocalHandle depending upon context (client or server).
/// </summary>
#endif
public int MappedLocalHandle;

#if SCENE_MANAGEMENT_SCENE_HANDLE_NO_INT_CONVERSION
/// <summary>
/// The local handle of the scene.
/// </summary>
/// <remarks>
/// This is deprecated in favor of LocalSceneHandle
/// </remarks>
[Obsolete("Int representation of a SceneHandle is deprecated, please use SceneHandle instead. (UnityUpgradable) -> LocalSceneHandle")]
#else
/// <summary>
/// The local handle of the scene.
/// </summary>
#endif
public int LocalHandle;

#if SCENE_MANAGEMENT_SCENE_HANDLE_AVAILABLE
/// <summary>
/// The scene's server handle (a.k.a network scene handle)
/// </summary>
public SceneHandle ServerSceneHandle;
/// <summary>
/// The mapped handled. This could be the ServerSceneHandle or LocalSceneHandle depending upon context (client or server).
/// </summary>
public SceneHandle MappedLocalSceneHandle;
/// <summary>
/// The local handle of the scene.
/// </summary>
public SceneHandle LocalSceneHandle;
#endif

/// <inheritdoc cref="INetworkSerializable.NetworkSerialize{T}(BufferSerializer{T})"/>
public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
{
Expand Down Expand Up @@ -3156,43 +3204,38 @@ public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReade
public List<SceneMap> GetSceneMapping(MapTypes mapType)
{
var mapping = new List<SceneMap>();
if (mapType == MapTypes.ServerToClient)
{
foreach (var entry in ServerSceneHandleToClientSceneHandle)
{
var scene = ScenesLoaded[entry.Value];
var sceneIsPresent = scene.IsValid() && scene.isLoaded;
var sceneMap = new SceneMap()
{
MapType = mapType,
ServerHandle = entry.Key.GetRawData(),
MappedLocalHandle = entry.Value.GetRawData(),
LocalHandle = new NetworkSceneHandle(scene.handle).GetRawData(),
Scene = scene,
ScenePresent = sceneIsPresent,
SceneName = sceneIsPresent ? scene.name : "NotPresent",
};
mapping.Add(sceneMap);
}
}
else
var map = mapType == MapTypes.ServerToClient ? ServerSceneHandleToClientSceneHandle : ClientSceneHandleToServerSceneHandle;

foreach (var entry in map)
{
foreach (var entry in ClientSceneHandleToServerSceneHandle)
var scene = ScenesLoaded[entry.Key];
var sceneIsPresent = scene.IsValid() && scene.isLoaded;
var sceneMap = new SceneMap()
{
var scene = ScenesLoaded[entry.Key];
var sceneIsPresent = scene.IsValid() && scene.isLoaded;
var sceneMap = new SceneMap()
{
MapType = mapType,
ServerHandle = entry.Key.GetRawData(),
MappedLocalHandle = entry.Value.GetRawData(),
LocalHandle = new NetworkSceneHandle(scene.handle).GetRawData(),
Scene = scene,
ScenePresent = sceneIsPresent,
SceneName = sceneIsPresent ? scene.name : "NotPresent",
};
mapping.Add(sceneMap);
}
MapType = mapType,

#pragma warning disable CS0618 // Type or member is obsolete
#if SCENE_MANAGEMENT_SCENE_HANDLE_MUST_USE_ULONG
ServerHandle = (int)entry.Key.GetRawData(),
MappedLocalHandle = (int)entry.Value.GetRawData(),
LocalHandle = (int)new NetworkSceneHandle(scene.handle).GetRawData(),
#else
ServerHandle = entry.Key.GetRawData(),
MappedLocalHandle = entry.Value.GetRawData(),
LocalHandle = new NetworkSceneHandle(scene.handle).GetRawData(),
#endif
#pragma warning restore CS0618 // Type or member is obsolete

#if SCENE_MANAGEMENT_SCENE_HANDLE_AVAILABLE
ServerSceneHandle = entry.Key,
MappedLocalSceneHandle = entry.Value,
LocalSceneHandle = scene.handle,
#endif
Scene = scene,
ScenePresent = sceneIsPresent,
SceneName = sceneIsPresent ? scene.name : "NotPresent",
};
mapping.Add(sceneMap);
}

return mapping;
Expand Down
Loading