/// <summary> /// Initializes a new instance of the <see cref="ClientManager" /> /// class. /// </summary> public ClientManager(Server server) { AllClients = new List<HttpClient>(); Clients = new Dictionary<string, HttpClient>(); TravianClients = new Dictionary<string, TravianClient>(); Server = server; }
public ServerViewTabPage(Server server) { InitializeComponent(); _server = server; Dock = DockStyle.Fill; gridPlayers.AutoGenerateColumns = true; gridAllies.AutoGenerateColumns = true; server.PlayerManager.OnNewPlayer += OnNewPlayer; server.AllyManager.OnNewAlliance += OnNewAlliance; }
public void OnServerAdded(Server server) { if (InvokeRequired) { Invoke(new ServerEventHandler(OnServerAdded), server); return; } TabPage tabPage = new TabPage(server.Name); tabPage.Controls.Add(new ServerViewTabPage(server)); svTabs.TabPages.Add(tabPage); }
/// <summary> /// Adds a new server to the server. /// </summary> /// <param name="host">Host address.</param> /// <param name="realm">Server domain.</param> /// <param name="speed">Server speed.</param> /// <param name="name">Server name.</param> /// <returns>Created server.</returns> public Server CreateServer( string host, string realm, int speed, string name = "default") { var fullAddress = string.Format("{0}/{1}/", host, realm); var s = new Server(name, speed, fullAddress); Servers.Add(s); if (OnNewServerAdded != null) { OnNewServerAdded.Invoke(s); } return s; }
public AllyManager(Server server) { Alliances = new Dictionary<int, Alliance>(); Server = server; }