Example #1
0
        public void SetClientNotReadyTest()
        {
            readyComp = identity.gameObject.AddComponent <ObjectReady>();

            readyComp.SetClientNotReady();

            Assert.That(readyComp.IsReady, Is.False);
        }
Example #2
0
        public void SetClientReadyTest()
        {
            readyComp = playerIdentity.gameObject.AddComponent <ObjectReady>();

            readyComp.SetClientReady();

            Assert.That(readyComp.IsReady, Is.True);
        }
Example #3
0
        public void SetAllClientsNotReadyTest()
        {
            readyComp = identity.gameObject.AddComponent <ObjectReady>();
            lobby.ObjectReadyList.Add(readyComp);
            readyComp.IsReady = true;

            lobby.SetAllClientsNotReady();

            Assert.That(readyComp.IsReady, Is.False);
        }
Example #4
0
        public IEnumerator ClientReadyTest() => UniTask.ToCoroutine(async() =>
        {
            NetworkIdentity readyPlayer = CreateNetworkIdentity();
            readyComp = readyPlayer.gameObject.AddComponent <ObjectReady>();

            serverObjectManager.Spawn(readyPlayer, server.LocalPlayer);
            readyComp.Ready();

            await AsyncUtil.WaitUntilWithTimeout(() => readyComp.IsReady);
        });
Example #5
0
        public void ClientReadyTest()
        {
            readyPlayer = new GameObject();
            readyPlayer.AddComponent <NetworkIdentity>();
            readyComp = readyPlayer.AddComponent <ObjectReady>();

            server.Spawn(readyPlayer, server.LocalConnection);
            readyComp.Ready();

            Assert.That(readyComp.IsReady, Is.False);
        }
Example #6
0
        public IEnumerator SendToReadyTest() => UniTask.ToCoroutine(async() =>
        {
            readyComp = identity.gameObject.AddComponent <ObjectReady>();
            lobby.ObjectReadyList.Add(readyComp);
            readyComp.IsReady = true;

            bool invokeWovenTestMessage = false;
            client.Player.RegisterHandler <SceneMessage>(msg => invokeWovenTestMessage = true);
            lobby.SendToReady(identity, new SceneMessage(), true, Channel.Reliable);

            await AsyncUtil.WaitUntilWithTimeout(() => invokeWovenTestMessage);
        });
Example #7
0
        public IEnumerator SendToReadyTest() => RunAsync(async() =>
        {
            readyComp = identity.gameObject.AddComponent <ObjectReady>();
            lobby.ObjectReadyList.Add(readyComp);
            readyComp.IsReady = true;

            bool invokeWovenTestMessage = false;
            client.Connection.RegisterHandler <SceneMessage>(msg => invokeWovenTestMessage = true);
            lobby.SendToReady(identity, new SceneMessage(), true, Channels.DefaultReliable);

            await WaitFor(() => invokeWovenTestMessage);
        });
Example #8
0
        public void IsReadyStateTest()
        {
            readyComp = identity.gameObject.AddComponent <ObjectReady>();

            Assert.That(readyComp.IsReady, Is.False);
        }