mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-17 18:40:33 +00:00
fix: Updated Templates (#3090)
This commit is contained in:
parent
c94ee5222f
commit
b117b92d08
@ -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>
|
||||
/// </summary>
|
||||
/// <param name="conn">Connection from client.</param>
|
||||
public override void OnServerConnect(NetworkConnection conn) { }
|
||||
public override void OnServerConnect(NetworkConnectionToClient conn) { }
|
||||
|
||||
/// <summary>
|
||||
/// 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>
|
||||
/// </summary>
|
||||
/// <param name="conn">Connection from client.</param>
|
||||
public override void OnServerReady(NetworkConnection conn)
|
||||
public override void OnServerReady(NetworkConnectionToClient 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>
|
||||
/// </summary>
|
||||
/// <param name="conn">Connection from client.</param>
|
||||
public override void OnServerAddPlayer(NetworkConnection conn)
|
||||
public override void OnServerAddPlayer(NetworkConnectionToClient 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>
|
||||
/// </summary>
|
||||
/// <param name="conn">Connection from client.</param>
|
||||
public override void OnServerDisconnect(NetworkConnection conn)
|
||||
public override void OnServerDisconnect(NetworkConnectionToClient conn)
|
||||
{
|
||||
base.OnServerDisconnect(conn);
|
||||
}
|
||||
@ -169,7 +169,7 @@ public class #SCRIPTNAME# : NetworkManager
|
||||
/// </summary>
|
||||
/// <param name="conn">Connection of the client...may be null</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
|
||||
|
||||
|
@ -35,14 +35,14 @@ public class #SCRIPTNAME# : NetworkAuthenticator
|
||||
/// Called on server from OnServerAuthenticateInternal when a client needs to authenticate
|
||||
/// </summary>
|
||||
/// <param name="conn">Connection to client.</param>
|
||||
public override void OnServerAuthenticate(NetworkConnection conn) { }
|
||||
public override void OnServerAuthenticate(NetworkConnectionToClient conn) { }
|
||||
|
||||
/// <summary>
|
||||
/// Called on server when the client's AuthRequestMessage arrives
|
||||
/// </summary>
|
||||
/// <param name="conn">Connection to client.</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();
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class #SCRIPTNAME# : NetworkBehaviour
|
||||
/// <summary>
|
||||
/// 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>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>
|
||||
public override void OnStartAuthority() { }
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class #SCRIPTNAME# : InterestManagement
|
||||
/// <param name="newObserver">Network Connection of a client.</param>
|
||||
/// <returns>True if the client can see this object.</returns>
|
||||
[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.
|
||||
// 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="initialize">true if being rebuilt for the first time</param>
|
||||
[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.
|
||||
// Replace this code with your own logic as appropriate.
|
||||
|
@ -44,13 +44,13 @@ public class #SCRIPTNAME# : NetworkRoomManager
|
||||
/// This is called on the server when a new client connects to the server.
|
||||
/// </summary>
|
||||
/// <param name="conn">The new connection.</param>
|
||||
public override void OnRoomServerConnect(NetworkConnection conn) { }
|
||||
public override void OnRoomServerConnect(NetworkConnectionToClient conn) { }
|
||||
|
||||
/// <summary>
|
||||
/// This is called on the server when a client disconnects.
|
||||
/// </summary>
|
||||
/// <param name="conn">The connection that disconnected.</param>
|
||||
public override void OnRoomServerDisconnect(NetworkConnection conn) { }
|
||||
public override void OnRoomServerDisconnect(NetworkConnectionToClient conn) { }
|
||||
|
||||
/// <summary>
|
||||
/// This is called on the server when a networked scene finishes loading.
|
||||
@ -64,7 +64,7 @@ public class #SCRIPTNAME# : NetworkRoomManager
|
||||
/// </summary>
|
||||
/// <param name="conn">The connection the player object is for.</param>
|
||||
/// <returns>The new room-player object.</returns>
|
||||
public override GameObject OnRoomServerCreateRoomPlayer(NetworkConnection conn)
|
||||
public override GameObject OnRoomServerCreateRoomPlayer(NetworkConnectionToClient 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="roomPlayer">The room player object for this connection.</param>
|
||||
/// <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);
|
||||
}
|
||||
@ -87,7 +87,7 @@ public class #SCRIPTNAME# : NetworkRoomManager
|
||||
/// <para>See OnRoomServerCreateGamePlayer to customize the player object for the initial GamePlay scene.</para>
|
||||
/// </summary>
|
||||
/// <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);
|
||||
}
|
||||
@ -100,7 +100,7 @@ public class #SCRIPTNAME# : NetworkRoomManager
|
||||
/// <param name="roomPlayer">The room player object.</param>
|
||||
/// <param name="gamePlayer">The game player object.</param>
|
||||
/// <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);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class #SCRIPTNAME# : NetworkRoomPlayer
|
||||
/// <summary>
|
||||
/// 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>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>
|
||||
public override void OnStartAuthority() { }
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class #SCRIPTNAME# : NetworkTransformBase
|
||||
/// <summary>
|
||||
/// Called by both CmdTeleport and RpcTeleport on server and clients, respectively.
|
||||
/// 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>
|
||||
protected override void OnTeleport(Vector3 destination)
|
||||
{
|
||||
@ -96,9 +96,9 @@ public class #SCRIPTNAME# : NetworkTransformBase
|
||||
}
|
||||
|
||||
/// <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,
|
||||
/// 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>
|
||||
protected override void OnTeleport(Vector3 destination, Quaternion rotation)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user