fix: Updated Templates (#3090)

This commit is contained in:
MrGadget 2022-02-06 06:25:08 -05:00 committed by GitHub
parent c94ee5222f
commit b117b92d08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 20 deletions

View File

@ -131,14 +131,14 @@ public class #SCRIPTNAME# : NetworkManager
/// <para>Unity calls this on the Server when a Client connects to the Server. Use an override to tell the NetworkManager what to do when a client connects to the server.</para> /// <para>Unity calls this on the Server when a Client connects to the Server. Use an override to tell the NetworkManager what to do when a client connects to the server.</para>
/// </summary> /// </summary>
/// <param name="conn">Connection from client.</param> /// <param name="conn">Connection from client.</param>
public override void OnServerConnect(NetworkConnection conn) { } public override void OnServerConnect(NetworkConnectionToClient conn) { }
/// <summary> /// <summary>
/// Called on the server when a client is ready. /// Called on the server when a client is ready.
/// <para>The default implementation of this function calls NetworkServer.SetClientReady() to continue the network setup process.</para> /// <para>The default implementation of this function calls NetworkServer.SetClientReady() to continue the network setup process.</para>
/// </summary> /// </summary>
/// <param name="conn">Connection from client.</param> /// <param name="conn">Connection from client.</param>
public override void OnServerReady(NetworkConnection conn) public override void OnServerReady(NetworkConnectionToClient conn)
{ {
base.OnServerReady(conn); base.OnServerReady(conn);
} }
@ -148,7 +148,7 @@ public class #SCRIPTNAME# : NetworkManager
/// <para>The default implementation for this function creates a new player object from the playerPrefab.</para> /// <para>The default implementation for this function creates a new player object from the playerPrefab.</para>
/// </summary> /// </summary>
/// <param name="conn">Connection from client.</param> /// <param name="conn">Connection from client.</param>
public override void OnServerAddPlayer(NetworkConnection conn) public override void OnServerAddPlayer(NetworkConnectionToClient conn)
{ {
base.OnServerAddPlayer(conn); base.OnServerAddPlayer(conn);
} }
@ -158,7 +158,7 @@ public class #SCRIPTNAME# : NetworkManager
/// <para>This is called on the Server when a Client disconnects from the Server. Use an override to decide what should happen when a disconnection is detected.</para> /// <para>This is called on the Server when a Client disconnects from the Server. Use an override to decide what should happen when a disconnection is detected.</para>
/// </summary> /// </summary>
/// <param name="conn">Connection from client.</param> /// <param name="conn">Connection from client.</param>
public override void OnServerDisconnect(NetworkConnection conn) public override void OnServerDisconnect(NetworkConnectionToClient conn)
{ {
base.OnServerDisconnect(conn); base.OnServerDisconnect(conn);
} }
@ -169,7 +169,7 @@ public class #SCRIPTNAME# : NetworkManager
/// </summary> /// </summary>
/// <param name="conn">Connection of the client...may be null</param> /// <param name="conn">Connection of the client...may be null</param>
/// <param name="exception">Exception thrown from the Transport.</param> /// <param name="exception">Exception thrown from the Transport.</param>
public override void OnServerError(NetworkConnection conn, Exception exception) { } public override void OnServerError(NetworkConnectionToClient conn, Exception exception) { }
#endregion #endregion

View File

@ -35,14 +35,14 @@ public class #SCRIPTNAME# : NetworkAuthenticator
/// Called on server from OnServerAuthenticateInternal when a client needs to authenticate /// Called on server from OnServerAuthenticateInternal when a client needs to authenticate
/// </summary> /// </summary>
/// <param name="conn">Connection to client.</param> /// <param name="conn">Connection to client.</param>
public override void OnServerAuthenticate(NetworkConnection conn) { } public override void OnServerAuthenticate(NetworkConnectionToClient conn) { }
/// <summary> /// <summary>
/// Called on server when the client's AuthRequestMessage arrives /// Called on server when the client's AuthRequestMessage arrives
/// </summary> /// </summary>
/// <param name="conn">Connection to client.</param> /// <param name="conn">Connection to client.</param>
/// <param name="msg">The message payload</param> /// <param name="msg">The message payload</param>
public void OnAuthRequestMessage(NetworkConnection conn, AuthRequestMessage msg) public void OnAuthRequestMessage(NetworkConnectionToClient conn, AuthRequestMessage msg)
{ {
AuthResponseMessage authResponseMessage = new AuthResponseMessage(); AuthResponseMessage authResponseMessage = new AuthResponseMessage();

View File

@ -53,7 +53,7 @@ public class #SCRIPTNAME# : NetworkBehaviour
/// <summary> /// <summary>
/// This is invoked on behaviours that have authority, based on context and <see cref="NetworkIdentity.hasAuthority">NetworkIdentity.hasAuthority</see>. /// This is invoked on behaviours that have authority, based on context and <see cref="NetworkIdentity.hasAuthority">NetworkIdentity.hasAuthority</see>.
/// <para>This is called after <see cref="OnStartServer">OnStartServer</see> and before <see cref="OnStartClient">OnStartClient.</see></para> /// <para>This is called after <see cref="OnStartServer">OnStartServer</see> and before <see cref="OnStartClient">OnStartClient.</see></para>
/// <para>When <see cref="NetworkIdentity.AssignClientAuthority">AssignClientAuthority</see> is called on the server, this will be called on the client that owns the object. When an object is spawned with <see cref="NetworkServer.Spawn">NetworkServer.Spawn</see> with a NetworkConnection parameter included, this will be called on the client that owns the object.</para> /// <para>When <see cref="NetworkIdentity.AssignClientAuthority">AssignClientAuthority</see> is called on the server, this will be called on the client that owns the object. When an object is spawned with <see cref="NetworkServer.Spawn">NetworkServer.Spawn</see> with a NetworkConnectionToClient parameter included, this will be called on the client that owns the object.</para>
/// </summary> /// </summary>
public override void OnStartAuthority() { } public override void OnStartAuthority() { }

View File

@ -19,7 +19,7 @@ public class #SCRIPTNAME# : InterestManagement
/// <param name="newObserver">Network Connection of a client.</param> /// <param name="newObserver">Network Connection of a client.</param>
/// <returns>True if the client can see this object.</returns> /// <returns>True if the client can see this object.</returns>
[ServerCallback] [ServerCallback]
public override bool OnCheckObserver(NetworkIdentity identity, NetworkConnection newObserver) public override bool OnCheckObserver(NetworkIdentity identity, NetworkConnectionToClient newObserver)
{ {
// Default behaviour of making the identity object visible to all clients. // Default behaviour of making the identity object visible to all clients.
// Replace this code with your own logic as appropriate. // Replace this code with your own logic as appropriate.
@ -34,7 +34,7 @@ public class #SCRIPTNAME# : InterestManagement
/// <param name="newObservers">cached hashset to put the result into</param> /// <param name="newObservers">cached hashset to put the result into</param>
/// <param name="initialize">true if being rebuilt for the first time</param> /// <param name="initialize">true if being rebuilt for the first time</param>
[ServerCallback] [ServerCallback]
public override void OnRebuildObservers(NetworkIdentity identity, HashSet<NetworkConnection> newObservers, bool initialize) public override void OnRebuildObservers(NetworkIdentity identity, HashSet<NetworkConnectionToClient> newObservers, bool initialize)
{ {
// Default behaviour of making the identity object visible to all clients. // Default behaviour of making the identity object visible to all clients.
// Replace this code with your own logic as appropriate. // Replace this code with your own logic as appropriate.

View File

@ -44,13 +44,13 @@ public class #SCRIPTNAME# : NetworkRoomManager
/// This is called on the server when a new client connects to the server. /// This is called on the server when a new client connects to the server.
/// </summary> /// </summary>
/// <param name="conn">The new connection.</param> /// <param name="conn">The new connection.</param>
public override void OnRoomServerConnect(NetworkConnection conn) { } public override void OnRoomServerConnect(NetworkConnectionToClient conn) { }
/// <summary> /// <summary>
/// This is called on the server when a client disconnects. /// This is called on the server when a client disconnects.
/// </summary> /// </summary>
/// <param name="conn">The connection that disconnected.</param> /// <param name="conn">The connection that disconnected.</param>
public override void OnRoomServerDisconnect(NetworkConnection conn) { } public override void OnRoomServerDisconnect(NetworkConnectionToClient conn) { }
/// <summary> /// <summary>
/// This is called on the server when a networked scene finishes loading. /// This is called on the server when a networked scene finishes loading.
@ -64,7 +64,7 @@ public class #SCRIPTNAME# : NetworkRoomManager
/// </summary> /// </summary>
/// <param name="conn">The connection the player object is for.</param> /// <param name="conn">The connection the player object is for.</param>
/// <returns>The new room-player object.</returns> /// <returns>The new room-player object.</returns>
public override GameObject OnRoomServerCreateRoomPlayer(NetworkConnection conn) public override GameObject OnRoomServerCreateRoomPlayer(NetworkConnectionToClient conn)
{ {
return base.OnRoomServerCreateRoomPlayer(conn); return base.OnRoomServerCreateRoomPlayer(conn);
} }
@ -76,7 +76,7 @@ public class #SCRIPTNAME# : NetworkRoomManager
/// <param name="conn">The connection the player object is for.</param> /// <param name="conn">The connection the player object is for.</param>
/// <param name="roomPlayer">The room player object for this connection.</param> /// <param name="roomPlayer">The room player object for this connection.</param>
/// <returns>A new GamePlayer object.</returns> /// <returns>A new GamePlayer object.</returns>
public override GameObject OnRoomServerCreateGamePlayer(NetworkConnection conn, GameObject roomPlayer) public override GameObject OnRoomServerCreateGamePlayer(NetworkConnectionToClient conn, GameObject roomPlayer)
{ {
return base.OnRoomServerCreateGamePlayer(conn, roomPlayer); return base.OnRoomServerCreateGamePlayer(conn, roomPlayer);
} }
@ -87,7 +87,7 @@ public class #SCRIPTNAME# : NetworkRoomManager
/// <para>See OnRoomServerCreateGamePlayer to customize the player object for the initial GamePlay scene.</para> /// <para>See OnRoomServerCreateGamePlayer to customize the player object for the initial GamePlay scene.</para>
/// </summary> /// </summary>
/// <param name="conn">The connection the player object is for.</param> /// <param name="conn">The connection the player object is for.</param>
public override void OnRoomServerAddPlayer(NetworkConnection conn) public override void OnRoomServerAddPlayer(NetworkConnectionToClient conn)
{ {
base.OnRoomServerAddPlayer(conn); base.OnRoomServerAddPlayer(conn);
} }
@ -100,7 +100,7 @@ public class #SCRIPTNAME# : NetworkRoomManager
/// <param name="roomPlayer">The room player object.</param> /// <param name="roomPlayer">The room player object.</param>
/// <param name="gamePlayer">The game player object.</param> /// <param name="gamePlayer">The game player object.</param>
/// <returns>False to not allow this player to replace the room player.</returns> /// <returns>False to not allow this player to replace the room player.</returns>
public override bool OnRoomServerSceneLoadedForPlayer(NetworkConnection conn, GameObject roomPlayer, GameObject gamePlayer) public override bool OnRoomServerSceneLoadedForPlayer(NetworkConnectionToClient conn, GameObject roomPlayer, GameObject gamePlayer)
{ {
return base.OnRoomServerSceneLoadedForPlayer(conn, roomPlayer, gamePlayer); return base.OnRoomServerSceneLoadedForPlayer(conn, roomPlayer, gamePlayer);
} }

View File

@ -50,7 +50,7 @@ public class #SCRIPTNAME# : NetworkRoomPlayer
/// <summary> /// <summary>
/// This is invoked on behaviours that have authority, based on context and <see cref="NetworkIdentity.hasAuthority">NetworkIdentity.hasAuthority</see>. /// This is invoked on behaviours that have authority, based on context and <see cref="NetworkIdentity.hasAuthority">NetworkIdentity.hasAuthority</see>.
/// <para>This is called after <see cref="OnStartServer">OnStartServer</see> and before <see cref="OnStartClient">OnStartClient.</see></para> /// <para>This is called after <see cref="OnStartServer">OnStartServer</see> and before <see cref="OnStartClient">OnStartClient.</see></para>
/// <para>When <see cref="NetworkIdentity.AssignClientAuthority"/> is called on the server, this will be called on the client that owns the object. When an object is spawned with <see cref="NetworkServer.Spawn">NetworkServer.Spawn</see> with a NetworkConnection parameter included, this will be called on the client that owns the object.</para> /// <para>When <see cref="NetworkIdentity.AssignClientAuthority"/> is called on the server, this will be called on the client that owns the object. When an object is spawned with <see cref="NetworkServer.Spawn">NetworkServer.Spawn</see> with a NetworkConnectionToClient parameter included, this will be called on the client that owns the object.</para>
/// </summary> /// </summary>
public override void OnStartAuthority() { } public override void OnStartAuthority() { }

View File

@ -88,7 +88,7 @@ public class #SCRIPTNAME# : NetworkTransformBase
/// <summary> /// <summary>
/// Called by both CmdTeleport and RpcTeleport on server and clients, respectively. /// Called by both CmdTeleport and RpcTeleport on server and clients, respectively.
/// Here you can disable a Character Controller before calling the base method, /// Here you can disable a Character Controller before calling the base method,
/// and re-enabling it after the base method call to avoid conflicting with it. /// and re-enable it after the base method call to avoid conflicting with it.
/// </summary> /// </summary>
protected override void OnTeleport(Vector3 destination) protected override void OnTeleport(Vector3 destination)
{ {
@ -96,9 +96,9 @@ public class #SCRIPTNAME# : NetworkTransformBase
} }
/// <summary> /// <summary>
/// Called by both CmdTeleportAndRotate and RpcTeleportAndRotate on server and clients, respectively. /// Called by both CmdTeleport and RpcTeleport on server and clients, respectively.
/// Here you can disable a Character Controller before calling the base method, /// Here you can disable a Character Controller before calling the base method,
/// and re-enabling it after the base method call to avoid conflicting with it. /// and re-enable it after the base method call to avoid conflicting with it.
/// </summary> /// </summary>
protected override void OnTeleport(Vector3 destination, Quaternion rotation) protected override void OnTeleport(Vector3 destination, Quaternion rotation)
{ {