public LobbyManager(Game game) { var localIp = game.Configuration.LanIpAddress; if (localIp == IPAddress.Any) { var selfAdresses = Dns.GetHostAddresses(Dns.GetHostName()); localIp = selfAdresses.FirstOrDefault(x => x.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork); } Unicast = GetLocalAdapter(localIp); LobbyBroadcastSession = new LobbyBroadcastSession(this); LobbyScanSession = new LobbyScanSession(this); Players = new Dictionary <IPEndPoint, LobbyPlayer>(); Username = Environment.MachineName; Hosting = false; Updated = true; }
public void Stop() { LobbyBroadcastSession.Stop(); LobbyScanSession.Stop(); }
public void Start() { Hosting = false; LobbyBroadcastSession.Start(); LobbyScanSession.Start(); }