Skip to content

Commit 33b877d

Browse files
committed
updated more APIs
1 parent 2a83dcb commit 33b877d

6 files changed

Lines changed: 8 additions & 13 deletions

File tree

Examples/OverridingScenesAndPrefabs/Assets/Scripts/NetworkManagerBootstrapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ private void StartDedicatedServer()
499499
// Set the application frame rate to like 30 to reduce frame processing overhead
500500
Application.targetFrameRate = 30;
501501

502-
Debug.Log($"[Pre-Init] Server Address Endpoint: {m_UnityTransport.ConnectionData.ServerEndPoint}");
502+
Debug.Log($"[Pre-Init] Server Address Endpoint: {m_UnityTransport.ConnectionData.Address}:{m_UnityTransport.ConnectionData.Port}");
503503
Debug.Log($"[Pre-Init] Server Listen Endpoint: {m_UnityTransport.ConnectionData.ListenEndPoint}");
504504
// Setup your IP and port sepcific to your DGS
505505
//unityTransport.SetConnectionData(ListenAddress, ListenPort, ListenAddress);
@@ -527,7 +527,7 @@ private void StartDedicatedServer()
527527
private void ServerStarted()
528528
{
529529
Debug.Log("Dedicated Server Started!");
530-
Debug.Log($"[Started] Server Address Endpoint: {m_UnityTransport.ConnectionData.ServerEndPoint}");
530+
Debug.Log($"[Started] Server Address Endpoint: {m_UnityTransport.ConnectionData.Address}:{m_UnityTransport.ConnectionData.Port}");
531531
Debug.Log($"[Started] Server Listen Endpoint: {m_UnityTransport.ConnectionData.ListenEndPoint}");
532532
Debug.Log("===============================================================");
533533
Debug.Log("[X] Exits session (Shutdown) | [ESC] Exits application instance");

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
1717
- `Unity.Netcode.Editor.CodeGen``Unity.Netcode.GameObjects.Editor.CodeGen`
1818
- `Unity.Netcode.Editor.PackageChecker``Unity.Netcode.GameObjects.Editor.PackageChecker`
1919
- `Unity.Netcode.Editor.Tests``Unity.Netcode.GameObjects.Editor.Tests`
20-
- Several APIs that were already marked `[Obsolete]` with a warning now raise a compile error instead (they are not removed yet): `NetworkObject.IsSceneObject`, `NetworkObject.SetSceneObjectStatus`, `NetworkList.LastModifiedTick`, `UnityTransport.InitialMaxSendQueueSize`, `UnityTransport.DebugSimulator`, `UnityTransport.SetDebugSimulatorParameters`, the deprecated `BufferedLinearInterpolator` buffer/interpolation fields and its testing-only `Update(float, NetworkTime)` overload, `NetworkSpawnManager.InternalOnOwnershipChanged`, `CommandLineOptions.Instance`, `CommandLineOptions.GetArg`, and `NotListeningException`.
20+
- Several APIs that were already marked `[Obsolete]` with a warning now raise a compile error instead (they are not removed yet): `RpcAttribute.RequireOwnership`, `ServerRpcAttribute.RequireOwnership`, `NetworkObject.IsSceneObject`, `NetworkObject.SetSceneObjectStatus`, `NetworkList.LastModifiedTick`, `UnityTransport.InitialMaxSendQueueSize`, `UnityTransport.DebugSimulator`, `UnityTransport.SetDebugSimulatorParameters`, `UnityTransport.ConnectionData.ServerEndPoint`, the deprecated `BufferedLinearInterpolator` buffer/interpolation fields and its testing-only `Update(float, NetworkTime)` overload, `NetworkSpawnManager.InternalOnOwnershipChanged`, `CommandLineOptions.Instance`, `CommandLineOptions.GetArg`, and `NotListeningException`.
2121

2222
### Deprecated
2323

com.unity.netcode.gameobjects/Editor/CodeGen/NetworkBehaviourILPP.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,7 @@ private void CreateNetworkVariableTypeInitializers(AssemblyDefinition assembly,
617617
private const string k_RpcAttribute_Delivery = nameof(RpcAttribute.Delivery);
618618
private const string k_RpcAttribute_InvokePermission = nameof(RpcAttribute.InvokePermission);
619619

620-
#pragma warning disable CS0618 // Type or member is obsolete
621-
// Need to ignore the obsolete warning as the obsolete behaviour still needs to work
622-
private const string k_ServerRpcAttribute_RequireOwnership = nameof(ServerRpcAttribute.RequireOwnership);
623-
#pragma warning restore CS0618 // Type or member is obsolete
620+
private const string k_ServerRpcAttribute_RequireOwnership = "RequireOwnership";
624621

625622
private const string k_RpcParams_Server = nameof(__RpcParams.Server);
626623
private const string k_RpcParams_Client = nameof(__RpcParams.Client);

com.unity.netcode.gameobjects/Runtime/Messaging/RpcAttributes.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public struct RpcAttributeParams
9898
/// <remarks>
9999
/// Deprecated in favor of <see cref="InvokePermission"/>.
100100
/// </remarks>
101-
[Obsolete("RequireOwnership is deprecated. Please use InvokePermission = RpcInvokePermission.Owner or InvokePermission = RpcInvokePermission.Everyone instead.")]
101+
[Obsolete("RequireOwnership is deprecated. Please use InvokePermission = RpcInvokePermission.Owner or InvokePermission = RpcInvokePermission.Everyone instead.", true)]
102102
public bool RequireOwnership;
103103

104104
/// <summary>
@@ -151,7 +151,7 @@ public class ServerRpcAttribute : RpcAttribute
151151
/// [Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Owner)]
152152
/// </code>
153153
/// </remarks>
154-
[Obsolete("ServerRpc with RequireOwnership is deprecated. Use [Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Everyone)] or [Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Owner)] instead.)]")]
154+
[Obsolete("ServerRpc with RequireOwnership is deprecated. Use [Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Everyone)] or [Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Owner)] instead.)]", true)]
155155
public new bool RequireOwnership;
156156

157157
/// <summary>

com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ internal static NetworkEndpoint ParseNetworkEndpoint(string ip, ushort port)
266266
/// is still handled correctly by NGO, but for this reason usage of this property is
267267
/// discouraged.
268268
/// </remarks>
269-
[Obsolete("Use NetworkEndpoint.Parse on the Address field instead.")]
269+
[Obsolete("Use NetworkEndpoint.Parse on the Address field instead.", true)]
270270
public NetworkEndpoint ServerEndPoint => ParseNetworkEndpoint(Address, Port);
271271

272272
/// <summary>

com.unity.netcode.gameobjects/Tests/Runtime/Rpc/RpcInvocationTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,7 @@ public void ServerInvokePermissionRpc()
465465
}
466466

467467

468-
#pragma warning disable CS0618 // Type or member is obsolete
469-
[Rpc(SendTo.Everyone, RequireOwnership = true)]
470-
#pragma warning restore CS0618 // Type or member is obsolete
468+
[Rpc(SendTo.Everyone, InvokePermission = RpcInvokePermission.Owner)]
471469
public void OwnerRequireOwnershipRpc()
472470
{
473471
TrackRpcCalled(GetCaller());

0 commit comments

Comments
 (0)