-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: moving ready methods to NetworkSceneManager
BREAKING CHANGE: moving SetAllClientsNotReady and SetClientNotReady from ServerObjectManager to NetworkSceneManager
- Loading branch information
1 parent
77413da
commit 5dade34
Showing
5 changed files
with
86 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using NUnit.Framework; | ||
using static Mirage.Tests.LocalConnections; | ||
|
||
namespace Mirage.Tests.Runtime.Host | ||
{ | ||
public class PlayerSceneReadyHostTests : HostSetup<MockComponent> | ||
{ | ||
[Test] | ||
public void SetClientReadyAndNotReadyTest() | ||
{ | ||
(_, NetworkPlayer connection) = PipedConnections(ClientMessageHandler, ServerMessageHandler); | ||
Assert.That(connection.SceneIsReady, Is.False); | ||
|
||
serverObjectManager.SpawnVisibleObjects(connection); | ||
Assert.That(connection.SceneIsReady, Is.True); | ||
|
||
sceneManager.SetClientNotReady(connection); | ||
Assert.That(connection.SceneIsReady, Is.False); | ||
} | ||
|
||
[Test] | ||
public void SetAllClientsNotReadyTest() | ||
{ | ||
// add first ready client | ||
(_, NetworkPlayer first) = PipedConnections(ClientMessageHandler, ServerMessageHandler); | ||
first.SceneIsReady = true; | ||
server.Players.Add(first); | ||
|
||
// add second ready client | ||
(_, NetworkPlayer second) = PipedConnections(ClientMessageHandler, ServerMessageHandler); | ||
second.SceneIsReady = true; | ||
server.Players.Add(second); | ||
|
||
// set all not ready | ||
sceneManager.SetAllClientsNotReady(); | ||
Assert.That(first.SceneIsReady, Is.False); | ||
Assert.That(second.SceneIsReady, Is.False); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/Tests/Runtime/Host/PlayerSceneReadyHostTests.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters