コード例 #1
0
        /// <summary>
        /// Starts the server. If the server is already running, it will be restarted.
        /// </summary>
        public void StartServer()
        {
#if UNITY_STANDALONE
            StopServer();

#if UNITY_EDITOR
            //Deploy HTTP assets to StreamingAssets
            DeployStreamingAssets.Deploy();
#endif
            MeshSyncProjectSettings projectSettings = MeshSyncProjectSettings.GetOrCreateSettings();


            m_serverSettings.port = (ushort)m_serverPort;
            m_serverSettings.zUpCorrectionMode = (ZUpCorrectionMode)m_config.ZUpCorrection;

            m_server = Server.Start(ref m_serverSettings);
            m_server.fileRootPath = GetServerDocRootPath();
            m_server.AllowPublicAccess(projectSettings.GetServerPublicAccess());

            m_handler = HandleRecvMessage;

#if UNITY_EDITOR
            EditorApplication.update += PollServerEvents;
#endif
            if (m_config.Logging)
            {
                Debug.Log("[MeshSync] Server started (port: " + m_serverSettings.port + ")");
            }

            m_serverStarted = true;
#else
            Debug.LogWarning("[MeshSync] Server functions are not supported in non-Standalone platform");
#endif //UNITY_STANDALONE
        }
コード例 #2
0
        internal void StartServer()
        {
            StopServer();

#if UNITY_EDITOR
            //Deploy HTTP assets to StreamingAssets
            DeployStreamingAssets.Deploy();
#endif
            MeshSyncRuntimeSettings runtimeSettings = MeshSyncRuntimeSettings.GetOrCreateSettings();


            m_serverSettings.port = (ushort)m_serverPort;
            m_serverSettings.zUpCorrectionMode = (ZUpCorrectionMode)m_config.ZUpCorrection;

            m_server = Server.Start(ref m_serverSettings);
            m_server.fileRootPath = GetServerDocRootPath();
            m_server.AllowPublicAccess(runtimeSettings.GetServerPublicAccess());

            m_handler = OnServerMessage;

#if UNITY_EDITOR
            EditorApplication.update += PollServerEvents;
#endif
            if (m_config.Logging)
            {
                Debug.Log("MeshSync: server started (port: " + m_serverSettings.port + ")");
            }

            m_serverStarted = true;
        }
コード例 #3
0
        internal void StartServer()
        {
            StopServer();

#if UNITY_EDITOR
            //Deploy HTTP assets to StreamingAssets
            DeployStreamingAssets.Deploy();
#endif

            m_serverSettings.port = (ushort)m_serverPort;
            m_serverSettings.zUpCorrectionMode = m_zUpCorrection;
            m_server = Server.Start(ref m_serverSettings);
            m_server.fileRootPath = httpFileRootPath;
            m_handler             = OnServerMessage;
#if UNITY_EDITOR
            EditorApplication.update += PollServerEvents;
#endif
            if (m_logging)
            {
                Debug.Log("MeshSync: server started (port: " + m_serverSettings.port + ")");
            }

            m_serverStarted = true;
        }
コード例 #4
0
ファイル: MeshSyncServer.cs プロジェクト: kyapp69/MeshSync
        void Awake()
        {
#if UNITY_EDITOR
            DeployStreamingAssets.Deploy();
#endif
        }