Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
        void Reset()
        {
            MeshSyncRuntimeSettings runtimeSettings = MeshSyncRuntimeSettings.GetOrCreateSettings();

            m_config     = MeshSyncRuntimeSettings.CreatePlayerConfig(MeshSyncPlayerType.SERVER);
            m_serverPort = runtimeSettings.GetDefaultServerPort();
        }