Commit b115bcab authored by Robert Poienar's avatar Robert Poienar

Merge branch 'master' of gitlab.com:altom/altunity/altunitytester

parents cf3a7a67 6a4407a7
......@@ -179,15 +179,15 @@ deploy-altunitytester-python:
- cd "Assets/AltUnityTester-BindingsAndExamples(can_be_deleted)/Bindings~/python"
- python setup.py sdist upload -r pypi
pages:
stage: deploy
dependencies:
- create-unity-package
script:
- echo Pages deploy done
tags:
- unity
artifacts:
paths:
- public
expire_in: 30 days
# pages:
# stage: deploy
# dependencies:
# - create-unity-package
# script:
# - echo Pages deploy done
# tags:
# - unity
# artifacts:
# paths:
# - public
# expire_in: 30 days
......@@ -337,7 +337,7 @@ class PythonTests(unittest.TestCase):
def test_find_objects_by_layer(self):
self.altdriver.load_scene('Scene 1 AltUnityDriverTestScene')
altElements = self.altdriver.find_objects(By.LAYER,"Default")
self.assertEquals(7, len(altElements))
self.assertEquals(8, len(altElements))
def test_find_objects_by_contains_name(self):
self.altdriver.load_scene('Scene 1 AltUnityDriverTestScene')
......
......@@ -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(25, 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"));
......@@ -689,7 +689,7 @@ public class TestForScene1TestSample
public void TestFindObjectsByLayer()
{
var altElements = altUnityDriver.FindObjects(AltUnityDriver.By.LAYER,"Default");
Assert.AreEqual(7, altElements.Count);
Assert.AreEqual(8, altElements.Count);
}
[Test]
public void TestFindObjectsByContainName()
......
......@@ -119,6 +119,7 @@ public class AltClientSocketHandler
finally
{
Client.Close();
ToBeKilled = true;
UnityEngine.Debug.Log("AltClientSocketHandler - Client closed");
}
......
......@@ -42,7 +42,6 @@ public class AltSocketServer {
protected readonly int portNumber;
protected readonly System.Net.IPEndPoint localEndPoint;
protected readonly int maxClients;
public int PortNumber {
get {
return portNumber;
......@@ -66,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,
......
......@@ -4,6 +4,10 @@ using System.Linq;
public class AltUnityRunner : UnityEngine.MonoBehaviour, AltIClientSocketHandlerDelegate
{
public UnityEngine.GameObject AltUnityPopUp;
public UnityEngine.UI.Image AltUnityIcon;
public UnityEngine.UI.Text AltUnityPopUpText;
public bool AltUnityIconPressed=false;
private static AltUnityRunner _altUnityRunner;
private UnityEngine.Vector3 _position;
......@@ -40,6 +44,8 @@ public class AltUnityRunner : UnityEngine.MonoBehaviour, AltIClientSocketHandler
public string requestSeparatorString=";";
public string requestEndingString="&";
private static AltResponseQueue _responseQueue;
void Awake()
......@@ -150,7 +156,7 @@ public class AltUnityRunner : UnityEngine.MonoBehaviour, AltIClientSocketHandler
clientSocketHandlerDelegate, SocketPortNumber, maxClients, requestEndingString, encoding);
_socketServer.StartListeningForConnections();
AltUnityPopUpText.text = "Waiting for connection"+System.Environment.NewLine+"on port " + _socketServer.PortNumber + "...";
UnityEngine.Debug.Log(string.Format(
"AltUnity Server at {0} on port {1}",
_socketServer.LocalEndPoint.Address, _socketServer.PortNumber));
......@@ -1648,9 +1654,41 @@ public class AltUnityRunner : UnityEngine.MonoBehaviour, AltIClientSocketHandler
handler.SendResponse(errorCouldNotPerformOperationMessage);
});
}
public void ServerRestartPressed()
{
AltUnityIconPressed = false;
_socketServer.Cleanup();
StartSocketServer();
AltUnityPopUp.SetActive(true);
}
public void IconPressed()
{
AltUnityPopUp.SetActive(!AltUnityPopUp.activeSelf);
AltUnityIconPressed = !AltUnityIconPressed;
}
void Update()
{
if (!AltUnityIconPressed)
{
if (_socketServer.ClientCount != 0)
{
AltUnityPopUp.SetActive(false);
}
else
{
AltUnityPopUp.SetActive(true);
}
}
if (!_socketServer.IsServerStopped())
{
AltUnityIcon.color = UnityEngine.Color.white;
}
else
{
AltUnityIcon.color = UnityEngine.Color.red;
AltUnityPopUpText.text = "Server stopped working."+System.Environment.NewLine+" Please restart the server";
}
_responseQueue.Cycle();
}
......
fileFormatVersion: 2
guid: 0f1a80f61f5b88b4e936cd2851440318
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
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