示例#1
0
        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());
        }
示例#2
0
        public IEnumerator CheckServerSettings()
        {
            MeshSyncServer          mss             = MeshSyncMenu.CreateMeshSyncServer(true);
            MeshSyncProjectSettings projectSettings = MeshSyncProjectSettings.GetOrCreateInstance();

            Assert.AreEqual(projectSettings.GetDefaultServerPort(), mss.GetServerPort());
            yield return(null);
        }
示例#3
0
        public IEnumerator CheckServerSettings()
        {
            MeshSyncServer          mss             = MeshSyncMenu.CreateMeshSyncServer(true);
            MeshSyncRuntimeSettings runtimeSettings = MeshSyncRuntimeSettings.GetOrCreateSettings();

            Assert.AreEqual(runtimeSettings.GetDefaultServerPort(), mss.GetServerPort());
            yield return(null);
        }
示例#4
0
        public IEnumerator BlockServerRootTraversal()
        {
            EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects);

            MeshSyncServer mss = MeshSyncMenu.CreateMeshSyncServer(true);

            Assert.IsTrue(mss.IsServerStarted());

            yield return(null);

            Assert.IsFalse(CanAccessFileOutsideServerRoot());
        }
示例#5
0
        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());
        }
示例#6
0
        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));
        }