Exemplo n.º 1
0
 /// <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;
 }
Exemplo n.º 2
0
        public ServerViewTabPage(Server server)
        {
            InitializeComponent();
            _server = server;
            Dock = DockStyle.Fill;

            gridPlayers.AutoGenerateColumns = true;
            gridAllies.AutoGenerateColumns = true;

            server.PlayerManager.OnNewPlayer += OnNewPlayer;
            server.AllyManager.OnNewAlliance += OnNewAlliance;
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        /// <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;
        }
Exemplo n.º 5
0
 public AllyManager(Server server)
 {
     Alliances = new Dictionary<int, Alliance>();
     Server = server;
 }