Commit 9afc8220 authored by Robert Poienar's avatar Robert Poienar

Fix problem with start server and changed tests

parent faa6ef78
......@@ -88,7 +88,7 @@ public class TestForScene1TestSample
listOfElements=element.name+"; ";
}
Debug.Log(listOfElements);
Assert.AreEqual(18, altElements.Count);
Assert.AreEqual(19, altElements.Count);
Assert.IsNotNull(altElements.Where(p => p.name == "Capsule"));
Assert.IsNotNull(altElements.Where(p => p.name == "Main Camera"));
Assert.IsNotNull(altElements.Where(p => p.name == "Directional Light"));
......@@ -110,7 +110,7 @@ public class TestForScene1TestSample
listOfElements=element.name+"; ";
}
Debug.Log(listOfElements);
Assert.AreEqual(19, altElements.Count);
Assert.AreEqual(23, altElements.Count);
Assert.IsNotNull(altElements.Where(p => p.name == "Capsule"));
Assert.IsNotNull(altElements.Where(p => p.name == "Main Camera"));
Assert.IsNotNull(altElements.Where(p => p.name == "Directional Light"));
......
......@@ -119,6 +119,7 @@ public class AltClientSocketHandler
finally
{
Client.Close();
ToBeKilled = true;
UnityEngine.Debug.Log("AltClientSocketHandler - Client closed");
}
......
......@@ -65,6 +65,10 @@ public class AltSocketServer {
return ClientHandlerThreads.Count;
}
}
public bool IsServerStopped()
{
return ClientHandlerThreads == null || (ClientHandlerThreads.Count!=0 &&((AltSocketClientThreadHolder)ClientHandlerThreads[0]).Handler.ToBeKilled);
}
public AltSocketServer(AltIClientSocketHandlerDelegate clientSocketHandlerDelegate,
int portNumber = 13000,
......
......@@ -1417,7 +1417,7 @@ public class AltUnityRunner : UnityEngine.MonoBehaviour, AltIClientSocketHandler
public void IconPressed()
{
_socketServer.Cleanup();
_socketServer.StartListeningForConnections();
StartSocketServer();
AltUnityPopUp.SetActive(true);
}
......@@ -1431,7 +1431,7 @@ public class AltUnityRunner : UnityEngine.MonoBehaviour, AltIClientSocketHandler
{
AltUnityPopUp.SetActive(true);
}
if (_socketServer.IsStarted())
if (!_socketServer.IsServerStopped())
{
AltUnityIcon.color = UnityEngine.Color.white;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment