예제 #1
0
        private void SlapperMethod(int playerNumber, int length)
        {
            Console.WriteLine(playerNumber);
            TeamspeakServerInterface tsi = new TeamspeakServerInterface("70.84.125.228");

            tsi.SuperAdminLogin(txtUsername.Text, txtPassword.Text);
            tsi.Query(Convert.ToInt32(this.txtPort.Text));
            tsi.Slap(playerNumber, length);
        }
예제 #2
0
        /// <summary>
        /// Queries the Teamspeak server and stores the results.
        /// </summary>
        public void Query()
        {
            TeamspeakServerInterface i = new TeamspeakServerInterface(this.host);

            try
            {
                i.Query(this.port);
                this.serverInfo = i.ServerInfo;
            }
            catch (Exception ex)
            {
                if (QueryFailed != null)
                {
                    QueryFailed(this, new QueryFailedEventArgs(ex));
                }
            }
        }
예제 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            int[] servers       = ts.GetServerPortList();
            int   maxPlayers    = 0;
            int   activePlayers = 0;

            foreach (int port in servers)
            {
                ts.Query(port);
                maxPlayers    += ts.ServerInfo.MaxPlayers;
                activePlayers += ts.ServerInfo.Players.Length;
            }
            MessageBox.Show(String.Format("There are currently {0} active players on the system.\r\n({1} total slots available on {2} servers)", activePlayers, maxPlayers, servers.Length));
        }