Exemplo n.º 1
0
        public static void ResetNetworkSystem()
        {
            NetworkConnection.ResetRequested = true;

            ClientConnection = new NetClient(Config);
            ClientConnection.Start();

            NetworkServerList.RefreshMasterServers();

            if (SendThread != null && !SendThread.IsCompleted)
            {
                SendThread?.Wait(1000);
            }
            if (ReceiveThread != null && !ReceiveThread.IsCompleted)
            {
                ReceiveThread?.Wait(1000);
            }

            NetworkConnection.ResetRequested = false;

            ReceiveThread = SystemBase.LongRunTaskFactory.StartNew(NetworkReceiver.ReceiveMain);
            SendThread    = SystemBase.LongRunTaskFactory.StartNew(NetworkSender.SendMain);

            NetworkServerList.RequestServers();
        }
Exemplo n.º 2
0
        public static void AwakeNetworkSystem()
        {
            Config.EnableMessageType(NetIncomingMessageType.ConnectionLatencyUpdated);
            Config.EnableMessageType(NetIncomingMessageType.NatIntroductionSuccess);
            Config.EnableMessageType(NetIncomingMessageType.UnconnectedData);

#if DEBUG
            Config.EnableMessageType(NetIncomingMessageType.DebugMessage);
            //Config.EnableMessageType(NetIncomingMessageType.VerboseDebugMessage);
#endif
            NetworkServerList.RequestServers();
        }
Exemplo n.º 3
0
        public static void StartNetworkSystem()
        {
            Config.EnableMessageType(NetIncomingMessageType.ConnectionLatencyUpdated);
            Config.EnableMessageType(NetIncomingMessageType.NatIntroductionSuccess);
            Config.EnableMessageType(NetIncomingMessageType.UnconnectedData);

            ClientConnection = new NetClient(Config);
            ClientConnection.Start();

            NetworkServerList.RefreshMasterServers();
            SendThread.Start(TaskScheduler.Default);
            ReceiveThread.Start(TaskScheduler.Default);
            NetworkServerList.RequestServers();
        }