private void Awake()
        {
            if (instance != null)
            {
                Destroy(gameObject);
            }

            instance = this;

            DontDestroyOnLoad(gameObject);

            StartServer();
        }
        void Awake()
        {
            if (instance != null)
            {
                Destroy(gameObject);
            }

            instance = this;

            DontDestroyOnLoad(gameObject);

            Debug.Log("Starting Console Pro Server on port : " + port);
            listener.Prefixes.Add("http://*:" + port + "/");
            listener.Start();
            listener.BeginGetContext(ListenerCallback, null);
        }
Example #3
0
        void Awake()
        {
            if (instance != null)
            {
                Destroy(gameObject);
            }

            instance = this;

            DontDestroyOnLoad(gameObject);

            Debug.Log("Starting Console Pro Server on port : " + port);

            _dataWriter = new NetDataWriter();
            _netServer  = new NetManager(this, 100, "ConsolePro");
            _netServer.Start(port);
            _netServer.DiscoveryEnabled = true;
            _netServer.UpdateTime       = 15;
            _netServer.MergeEnabled     = true;
            _netServer.NatPunchEnabled  = useNATPunch;
        }