Skip to content

Commit b183381

Browse files
Chore/phase 1 api documentation update 1 12 0 (#3158)
* Update README.md Adding note about where to find the NGO v2 branch along with the examples. * chore: api documentation phase 1 [backport] (#3157) * update updating XML API documentation for ConnectionEvent and ConnectionEventData. * update Updating XML API documentation for RpcTargetUse. * Update com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs Co-authored-by: Emma <[email protected]> * Update com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs Co-authored-by: Emma <[email protected]> --------- Co-authored-by: Emma <[email protected]> --------- Co-authored-by: Emma <[email protected]>
1 parent 739d5ce commit b183381

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,22 @@ Visit the [Multiplayer Docs Site](https://docs-multiplayer.unity3d.com/) for pac
1717

1818
You can also jump right into our [Hello World](https://docs-multiplayer.unity3d.com/netcode/current/tutorials/helloworld) guide for a taste of how to use the framework for basic networked tasks.
1919

20+
### Netcode for GameObjects v2
21+
The most recent version of Netcode for GameObjects (v2) includes several improvements along with the more recent [distributed authority network topology](https://docs-multiplayer.unity3d.com/netcode/current/terms-concepts/distributed-authority/) feature. You can find the source code for this on the [develop-2.0.0 branch](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/tree/develop-2.0.0).
22+
- The develop-2.0.0 branch incudes additional examples:
23+
- [Netcode for GameObjects Smooth Transform Space Transitions](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/tree/develop-2.0.0/Examples/CharacterControllerMovingBodies)
24+
- This example has plenty of parenting examples, parenting under moving bodies, smooth transitioning between two parents, and a basic example of path defined motion.
25+
- [Ping Tool](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/tree/develop-2.0.0/Examples/PingTool)
26+
- This includes a custom Runtime Netwokr Stats Monitor that includes client to client message processing ping times.
27+
2028
### Community and Feedback
2129

2230
For general questions, networking advice or discussions about Netcode for GameObjects, please join our [Discord Community](https://discord.gg/FM8SE9E) or create a post in the [Unity Multiplayer Forum](https://forum.unity.com/forums/multiplayer.26/).
2331

2432
### Compatibility
2533

2634
Netcode for GameObjects targets the following Unity versions:
27-
- Unity 2021.3(LTS), and 2022.3(LTS)
35+
- Unity 2021.3(LTS), 2022.3(LTS), and Unity 6 (6000.0)
2836

2937
On the following runtime platforms:
3038
- Windows, MacOS, and Linux

com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,54 @@
1010

1111
namespace Unity.Netcode
1212
{
13-
13+
/// <summary>
14+
/// The connection event type set within <see cref="ConnectionEventData"/> to signify the type of connection event notification received.
15+
/// </summary>
16+
/// <remarks>
17+
/// <see cref="ConnectionEventData"/> is returned as a parameter of the <see cref="NetworkManager.OnConnectionEvent"/> event notification.
18+
/// <see cref="ClientConnected"/> and <see cref="ClientDisconnected"/> event types occur on the client-side of the newly connected client and on the server-side. <br />
19+
/// <see cref="PeerConnected"/> and <see cref="PeerDisconnected"/> event types occur on connected clients to notify that a new client (peer) has joined/connected.
20+
/// </remarks>
1421
public enum ConnectionEvent
1522
{
23+
/// <summary>
24+
/// This event is set on the client-side of the newly connected client and on the server-side.<br />
25+
/// </summary>
26+
/// <remarks>
27+
/// On the newly connected client side, the <see cref="ConnectionEventData.ClientId"/> will be the <see cref="NetworkManager.LocalClientId"/>.<br />
28+
/// On the server side, the <see cref="ConnectionEventData.ClientId"/> will be the ID of the client that just connected.
29+
/// </remarks>
1630
ClientConnected,
31+
/// <summary>
32+
/// This event is set on clients that are already connected to the session.
33+
/// </summary>
34+
/// <remarks>
35+
/// The <see cref="ConnectionEventData.ClientId"/> will be the ID of the client that just connected.
36+
/// </remarks>
1737
PeerConnected,
38+
/// <summary>
39+
/// This event is set on the client-side of the client that disconnected client and on the server-side.
40+
/// </summary>
41+
/// <remarks>
42+
/// On the disconnected client side, the <see cref="ConnectionEventData.ClientId"/> will be the <see cref="NetworkManager.LocalClientId"/>.<br />
43+
/// On the server side, this will be the ID of the client that disconnected.
44+
/// </remarks>
1845
ClientDisconnected,
46+
/// <summary>
47+
/// This event is set on clients that are already connected to the session.
48+
/// </summary>
49+
/// <remarks>
50+
/// The <see cref="ConnectionEventData.ClientId"/> will be the ID of the client that just disconnected.
51+
/// </remarks>
1952
PeerDisconnected
2053
}
2154

55+
/// <summary>
56+
/// Returned as a parameter of the <see cref="NetworkManager.OnConnectionEvent"/> event notification.
57+
/// </summary>
58+
/// <remarks>
59+
/// See <see cref="ConnectionEvent"/> for more details on the types of connection events received.
60+
/// </remarks>
2261
public struct ConnectionEventData
2362
{
2463
public ConnectionEvent EventType;

com.unity.netcode.gameobjects/Runtime/Messaging/RpcTargets/RpcTarget.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,28 @@ public enum SendTo
6767
SpecifiedInParams
6868
}
6969

70+
/// <summary>
71+
/// This parameter configures a performance optimization. This optimization is not valid in all situations.<br />
72+
/// Because BaseRpcTarget is a managed type, allocating a new one is expensive, as it puts pressure on the garbage collector.
73+
/// </summary>
74+
/// <remarks>
75+
/// When using a <see cref="Temp"/> allocation type for the RPC target(s):<br />
76+
/// You typically don't need to worry about persisting the <see cref="BaseRpcTarget"/> generated.
77+
/// When using a <see cref="Persistent"/> allocation type for the RPC target(s): <br />
78+
/// You will want to use <see cref="RpcTarget"/>, which returns <see cref="BaseRpcTarget"/>, during <see cref="NetworkBehaviour"/> initialization (i.e. <see cref="NetworkBehaviour.OnNetworkPostSpawn"/>) and it to a property.<br />
79+
/// Then, When invoking the RPC, you would use your <see cref="BaseRpcTarget"/> which is a persisted allocation of a given set of client identifiers.
80+
/// !! Important !!<br />
81+
/// You will want to invoke <see cref="BaseRpcTarget.Dispose"/> of any persisted properties created via <see cref="RpcTarget"/> when despawning or destroying the associated <see cref="NetworkBehaviour"/> component's <see cref="NetworkObject"/>. Not doing so will result in small memory leaks.
82+
/// </remarks>
7083
public enum RpcTargetUse
7184
{
85+
/// <summary>
86+
/// Creates a temporary <see cref="BaseRpcTarget"/> used for the frame an <see cref="RpcAttribute"/> decorated method is invoked.
87+
/// </summary>
7288
Temp,
89+
/// <summary>
90+
/// Creates a persisted <see cref="BaseRpcTarget"/> that does not change and will persist until <see cref="BaseRpcTarget.Dispose"/> is called.
91+
/// </summary>
7392
Persistent
7493
}
7594

0 commit comments

Comments
 (0)