예제 #1
0
        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;
        }
예제 #2
0
 public void Stop()
 {
     LobbyBroadcastSession.Stop();
     LobbyScanSession.Stop();
 }
예제 #3
0
 public void Start()
 {
     Hosting = false;
     LobbyBroadcastSession.Start();
     LobbyScanSession.Start();
 }