Skip to content

Commit

Permalink
feat: Added Virtual OnRoomStopServer to NetworkRoomManager and Script…
Browse files Browse the repository at this point in the history
… Template
  • Loading branch information
Chris Langsenkamp committed Mar 25, 2020
1 parent 8026f6d commit d034ef6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Assets/Mirror/Components/NetworkRoomManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public override void OnStartHost()
public override void OnStopServer()
{
roomSlots.Clear();
base.OnStopServer();
OnRoomStopServer();
}

/// <summary>
Expand Down Expand Up @@ -495,6 +495,11 @@ public override void OnClientSceneChanged(NetworkConnection conn)
/// </summary>
public virtual void OnRoomStartServer() { }

/// <summary>
/// This is called on the server when the server is started - including when a host is stopped.
/// </summary>
public virtual void OnRoomStopServer() { }

/// <summary>
/// This is called on the server when a new client connects to the server.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public class #SCRIPTNAME# : NetworkRoomManager
/// </summary>
public override void OnRoomStartServer() { }

/// <summary>
/// This is called on the server when the server is started - including when a host is stopped.
/// </summary>
public override void OnRoomStopServer() { }

/// <summary>
/// This is called on the host when a host is started.
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions doc/General/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Mirror uses semantic versioning, and the versions shown here are those that were

## Version 11.x.x - In Progress
- Added: SyncVar hooks can be virtual now, and overriden in a derived class.
- Added: Virtual OnRoomStopServer to NetworkRoomManager and Script Template
- Fixed: Setting breakpoints in an IDE for Command's and Rpc's work correctly now.
- Fixed: NetworkServer's calls to SendToObservers now reports correct channel to Mirror Profiler.
- Fixed: NetworkRoomManager's `roomPlayerPrefab` is now `protected` so it can be accessed in derived classes.
Expand Down

0 comments on commit d034ef6

Please sign in to comment.