From abd1c1689d361cc086e3a020713794c5149d6066 Mon Sep 17 00:00:00 2001
From: MrGadget <9826063+MrGadget1024@users.noreply.github.com>
Date: Sat, 26 Nov 2022 14:03:29 -0500
Subject: [PATCH] NetworkRoomManager - Removed OnRoomClientAddPlayerFailed
virtual method - Fixes #3168 - There is no good place to call that - use
OnRoomClientDisconnect or OnRoomStopClient
---
Assets/Mirror/Components/NetworkRoomManager.cs | 14 +++++++++-----
...twork Room Manager-NewNetworkRoomManager.cs.txt | 6 ------
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/Assets/Mirror/Components/NetworkRoomManager.cs b/Assets/Mirror/Components/NetworkRoomManager.cs
index a59bf91ac..261c684c0 100644
--- a/Assets/Mirror/Components/NetworkRoomManager.cs
+++ b/Assets/Mirror/Components/NetworkRoomManager.cs
@@ -233,6 +233,7 @@ internal void CallOnClientExitRoom()
}
#region server handlers
+
///
/// Called on the server when a new client connects.
/// 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.
@@ -438,9 +439,11 @@ public override void OnStopHost()
{
OnRoomStopHost();
}
+
#endregion
#region client handlers
+
///
/// This is invoked when the client is started.
///
@@ -504,9 +507,11 @@ public override void OnClientSceneChanged()
base.OnClientSceneChanged();
OnRoomClientSceneChanged();
}
+
#endregion
#region room server virtuals
+
///
/// This is called on the host when a host is started.
///
@@ -608,9 +613,11 @@ public virtual void OnRoomServerPlayersReady()
/// May be called multiple times while not ready players are joining
///
public virtual void OnRoomServerPlayersNotReady() {}
+
#endregion
#region room client virtuals
+
///
/// This is a hook to allow custom behaviour when the game client enters the room.
///
@@ -646,14 +653,10 @@ public virtual void OnRoomStopClient() {}
///
public virtual void OnRoomClientSceneChanged() {}
- ///
- /// Called on the client when adding a player to the room fails.
- /// This could be because the room is full, or the connection is not allowed to have more players.
- ///
- public virtual void OnRoomClientAddPlayerFailed() {}
#endregion
#region optional UI
+
///
/// virtual so inheriting classes can roll their own
///
@@ -673,6 +676,7 @@ public virtual void OnGUI()
if (IsSceneActive(RoomScene))
GUI.Box(new Rect(10f, 180f, 520f, 150f), "PLAYERS");
}
+
#endregion
}
}
diff --git a/Assets/ScriptTemplates/54-Mirror__Network Room Manager-NewNetworkRoomManager.cs.txt b/Assets/ScriptTemplates/54-Mirror__Network Room Manager-NewNetworkRoomManager.cs.txt
index a0679264c..4c0b5111f 100644
--- a/Assets/ScriptTemplates/54-Mirror__Network Room Manager-NewNetworkRoomManager.cs.txt
+++ b/Assets/ScriptTemplates/54-Mirror__Network Room Manager-NewNetworkRoomManager.cs.txt
@@ -159,12 +159,6 @@ public class #SCRIPTNAME# : NetworkRoomManager
///
public override void OnRoomClientSceneChanged() { }
- ///
- /// Called on the client when adding a player to the room fails.
- /// This could be because the room is full, or the connection is not allowed to have more players.
- ///
- public override void OnRoomClientAddPlayerFailed() { }
-
#endregion
#region Optional UI