BeardedManStudios.Network.Networking.NetworkingReset C# (CSharp) Метод

NetworkingReset() публичный статический Метод

To reset the network by clearing the sockets and disconnecting them if possible
public static NetworkingReset ( ) : void
Результат void
		public static void NetworkingReset()
		{
			if (Sockets == null)
				return;

			ushort[] keys = new ushort[Sockets.Keys.Count];
			Sockets.Keys.CopyTo(keys, 0);
			foreach (ushort key in keys)
			{
				if (Sockets[key] != null && Sockets[key].Connected)
				{
					Sockets[key].Disconnect();
					Sockets[key] = null;
				}
			}

			Sockets.Clear();

			PrimarySocket = null;
			SimpleNetworkedMonoBehavior.ResetAll();

			if (networkResetInvoker != null)
				networkResetInvoker();

			networkResetInvoker = null;
		}