public IEnumerator SetServerPublicAccess() { EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects); MeshSyncRuntimeSettings runtimeSettings = MeshSyncRuntimeSettings.GetOrCreateSettings(); MeshSyncServer mss = MeshSyncServerEditor.CreateMeshSyncServer(true); Assert.IsTrue(mss.IsServerStarted()); yield return(null); //Check the original public access bool origPublicAccess = runtimeSettings.GetServerPublicAccess(); UnityEngine.Assertions.Assert.AreEqual(origPublicAccess, mss.DoesServerAllowPublicAccess()); yield return(null); //Change the public access and check runtimeSettings.SetServerPublicAccess(!origPublicAccess); mss.StopServer(); mss.StartServer(); Assert.IsTrue(mss.IsServerStarted()); yield return(null); UnityEngine.Assertions.Assert.AreEqual(runtimeSettings.GetServerPublicAccess(), mss.DoesServerAllowPublicAccess()); //Change back runtimeSettings.SetServerPublicAccess(origPublicAccess); UnityEngine.Assertions.Assert.AreEqual(origPublicAccess, runtimeSettings.GetServerPublicAccess()); }
public void CreateServer() { MeshSyncServerEditor.CreateMeshSyncServer(); //[TODO-sin: 2020-2-26] Add test to make sure that the StreamingAssets are populated Assert.True(true); }
public IEnumerator CheckServerSettings() { MeshSyncServer mss = MeshSyncServerEditor.CreateMeshSyncServer(true); MeshSyncRuntimeSettings runtimeSettings = MeshSyncRuntimeSettings.GetOrCreateSettings(); Assert.AreEqual(runtimeSettings.GetDefaultServerPort(), mss.GetServerPort()); yield return(null); }
public IEnumerator BlockServerRootTraversal() { EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects); MeshSyncServer mss = MeshSyncServerEditor.CreateMeshSyncServer(true); Assert.IsTrue(mss.IsServerStarted()); yield return(null); Assert.IsFalse(CanAccessFileOutsideServerRoot()); }
public IEnumerator CreateManualServer() { EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects); MeshSyncServer mss = MeshSyncServerEditor.CreateMeshSyncServer(false); Assert.IsFalse(mss.IsServerStarted()); yield return(null); Assert.IsFalse(mss.IsServerStarted()); //Still not started mss.StartServer(); yield return(null); Assert.IsTrue(mss.IsServerStarted()); }
public IEnumerator CreateAutoServer() { EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects); //Delete Server Root Path string serverRootPath = Path.Combine(Application.streamingAssetsPath, DeployStreamingAssets.SERVER_ROOT_DIR_NAME); if (Directory.Exists(serverRootPath)) { Directory.Delete(serverRootPath, true); } Assert.IsFalse(Directory.Exists(serverRootPath)); MeshSyncServer mss = MeshSyncServerEditor.CreateMeshSyncServer(true); Assert.IsTrue(mss.IsServerStarted()); yield return(null); //Make sure the server files have been deployed Assert.IsTrue(Directory.Exists(serverRootPath)); }