2017-06-16 21:00:01 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2017-07-22 19:27:41 +00:00
|
|
|
|
namespace SockScape {
|
2017-08-31 20:59:57 +00:00
|
|
|
|
class ServerList {
|
|
|
|
|
public static Dictionary<int, Server> Servers { get; }
|
|
|
|
|
= new Dictionary<int, Server>();
|
2017-06-16 21:00:01 +00:00
|
|
|
|
|
2017-08-31 20:59:57 +00:00
|
|
|
|
public Server this[int i] {
|
|
|
|
|
get => Servers.ContainsKey(i) ? Servers[i] : null;
|
|
|
|
|
set => Servers[i] = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool HasId(int id)
|
|
|
|
|
=> Servers.ContainsKey(id);
|
|
|
|
|
|
|
|
|
|
public void Clear()
|
|
|
|
|
=> Servers.Clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Server {
|
|
|
|
|
public ushort Id { get; set; }
|
|
|
|
|
public ushort UserCount { get; set; }
|
|
|
|
|
public IPEndPoint Address { get; set; }
|
|
|
|
|
public IPEndPoint Owner { get; set; }
|
2017-06-16 21:00:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|