public IEnumerator SetServerPublicAccess() { EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects); MeshSyncProjectSettings projectSettings = MeshSyncProjectSettings.GetOrCreateSettings(); MeshSyncServer mss = MeshSyncMenu.CreateMeshSyncServer(true); Assert.IsTrue(mss.IsServerStarted()); yield return(null); //Check the original public access bool origPublicAccess = projectSettings.GetServerPublicAccess(); UnityEngine.Assertions.Assert.AreEqual(origPublicAccess, mss.DoesServerAllowPublicAccess()); yield return(null); //Change the public access and check projectSettings.SetServerPublicAccess(!origPublicAccess); mss.StopServer(); mss.StartServer(); Assert.IsTrue(mss.IsServerStarted()); yield return(null); UnityEngine.Assertions.Assert.AreEqual(projectSettings.GetServerPublicAccess(), mss.DoesServerAllowPublicAccess()); //Change back projectSettings.SetServerPublicAccess(origPublicAccess); UnityEngine.Assertions.Assert.AreEqual(origPublicAccess, projectSettings.GetServerPublicAccess()); }
public IEnumerator CheckServerSettings() { MeshSyncServer mss = MeshSyncMenu.CreateMeshSyncServer(true); MeshSyncProjectSettings projectSettings = MeshSyncProjectSettings.GetOrCreateInstance(); Assert.AreEqual(projectSettings.GetDefaultServerPort(), mss.GetServerPort()); yield return(null); }
public IEnumerator CheckServerSettings() { MeshSyncServer mss = MeshSyncMenu.CreateMeshSyncServer(true); MeshSyncRuntimeSettings runtimeSettings = MeshSyncRuntimeSettings.GetOrCreateSettings(); Assert.AreEqual(runtimeSettings.GetDefaultServerPort(), mss.GetServerPort()); yield return(null); }
public IEnumerator BlockServerRootTraversal() { EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects); MeshSyncServer mss = MeshSyncMenu.CreateMeshSyncServer(true); Assert.IsTrue(mss.IsServerStarted()); yield return(null); Assert.IsFalse(CanAccessFileOutsideServerRoot()); }
public IEnumerator CreateManualServer() { EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects); MeshSyncServer mss = MeshSyncMenu.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 = MeshSyncMenu.CreateMeshSyncServer(true); Assert.IsTrue(mss.IsServerStarted()); yield return(null); //Make sure the server files have been deployed Assert.IsTrue(Directory.Exists(serverRootPath)); }