Beispiel #1
0
        private void ConnectButton_Click(object sender, EventArgs e)
        {
            try
            {
                
                IPAddress ipa = IPAddress.Parse(IpInputField.Text);
                if (ipa == null)
                    Log("Error: enter valid ip");
                int port = Int32.Parse(PortInputField.Text);
                if (port == 0)
                    Log("Error: enter valid port");

                Log(String.Format("Connecting to {0}:{1}", ipa, port));

                if (NameInputField.Text == null || NameInputField.Text == "")
                    NameInputField.Text = "uPraTe6";
                if (SpraynameInputField.Text == null || SpraynameInputField.Text == "")
                    SpraynameInputField.Text = "unrealsoftware.bmp";

                Client new_client = new Client(ipa, port, NameInputField.Text, PortInputField.Text, 0, SpraynameInputField.Text, this);
                clientList.Add(new_client);                
            }
            catch (Exception ex)
            {
                Log(ex.Message);
            }
        }
        public PacketHandler(ConnectionHandler ch, Form1 f, PlayerObject local, PlayerObject[] pl, Client client)
        {
            this.packetNumber = 0;
            this.ch = ch;
            this.form = f;
            this.local_player = local;
            players = pl;
            known_table = new KnownHandler[255];
            cl = client;

            known_table[1] = handshake;
            known_table[2] = failed_handshake;
            known_table[7] = fire;
            known_table[8] = advancedfire;
            known_table[9] = weaponchange;
            known_table[10] = positionUpdate;
            known_table[11] = positionUpdate;
            known_table[12] = rotationUpdate;
            known_table[13] = positionRotationUpdate;
            known_table[14] = positionRotationUpdate;
            known_table[15] = setpos;
            known_table[16] = reload;
            known_table[17] = hit;
            known_table[19] = killmsg;
            known_table[20] = teamchange;
            known_table[21] = spawnmsg;
            known_table[22] = roundstart;
            known_table[23] = weaponbuy;
            known_table[24] = weapondrop;
            known_table[25] = weaponpickup;
            known_table[26] = usepress;
            known_table[27] = projectile;
            known_table[28] = spray;
            known_table[30] = bomb;
            known_table[32] = specpos;
            known_table[33] = spawnitem;

            known_table[41] = unknown1;

            known_table[43] = vote;
            known_table[52] = flare;
            known_table[238] = newname;
            known_table[240] = chatmsg;
            known_table[247] = pinglist;
            known_table[248] = playerjoin;
            known_table[249] = pingstuff;
            known_table[252] = joinroutine_known;
            known_table[253] = playerleave;
        }
Beispiel #3
0
 private void connectToAll_Click(object sender, EventArgs e)
 {
     if (svl != null)
     {
         foreach (ServerInformation svi in svl.getServerList())
         {
             Client cl = new Client(svi.getIp(), svi.getPort(), "UPRATE6 WATCHES YOU", "", 0, "bladiebla.bmp", this);
             clientList.Add(cl);
         }
     }
     else
     {
         Log("No serverlist loaded yet!");
     }
 }