Click here to Skip to main content
16,005,389 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
EliottA28-Dec-08 14:08
EliottA28-Dec-08 14:08 
GeneralRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
DJMOH29-Dec-08 3:02
DJMOH29-Dec-08 3:02 
AnswerRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
Mycroft Holmes28-Dec-08 15:07
professionalMycroft Holmes28-Dec-08 15:07 
GeneralRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
EliottA28-Dec-08 15:26
EliottA28-Dec-08 15:26 
GeneralRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
Mycroft Holmes28-Dec-08 15:37
professionalMycroft Holmes28-Dec-08 15:37 
GeneralRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
EliottA28-Dec-08 15:57
EliottA28-Dec-08 15:57 
GeneralRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
Mycroft Holmes28-Dec-08 16:14
professionalMycroft Holmes28-Dec-08 16:14 
GeneralRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
DJMOH29-Dec-08 3:08
DJMOH29-Dec-08 3:08 
i just need a link for tutorial or so i can do it myself further on.
Not in a hurry or so...

well, i want to do some like this:

using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.Text.RegularExpressions;

namespace cssrcon
{
    public class rcon
    {
        public byte[] prepareCommand(string command)
        {
            byte[] bufferTemp = Encoding.ASCII.GetBytes(command);
            byte[] bufferSend = new byte[bufferTemp.Length + 4];

            //intial 5 characters as per standard
            bufferSend[0] = byte.Parse("255");
            bufferSend[1] = byte.Parse("255");
            bufferSend[2] = byte.Parse("255");
            bufferSend[3] = byte.Parse("255");

            //copying bytes from challenge rcon to send buffer
            int j = 4;

            for (int i = 0; i < bufferTemp.Length; i++)
            {
                bufferSend[j++] = bufferTemp[i];
            }
            return bufferSend;
        }

        public string sendRCON(string serverIp, int serverPort, string rconPassword, string rconCommand)
        {
            UdpClient client = new UdpClient();
            client.Connect(serverIp, serverPort);

            //sending challenge command to counter strike server 
            string getChallenge = "challenge rcon\n";
            byte[] bufferSend = this.prepareCommand(getChallenge);

            //send challenge command and get response
            IPEndPoint RemoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);
            client.Send(bufferSend, bufferSend.Length);
            byte[] bufferRec = client.Receive(ref RemoteIpEndPoint);

            //retrive number from challenge response 
            string challenge_rcon = Encoding.ASCII.GetString(bufferRec);
            challenge_rcon = string.Join(null, Regex.Split(challenge_rcon, "[^\\d]"));

            //preparing rcon command to send
            string command = "rcon \"" + challenge_rcon + "\" " + rconPassword + " " + rconCommand + "\n";
            bufferSend = this.prepareCommand(command);

            client.Send(bufferSend, bufferSend.Length);
            bufferRec = client.Receive(ref RemoteIpEndPoint);
            return Encoding.ASCII.GetString(bufferRec);

        }

    }

}


but in VB not more not less.
the only thing else is i need to get the variables from the reicived text
GeneralRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
DJMOH7-Jan-09 18:35
DJMOH7-Jan-09 18:35 
GeneralRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
DJMOH29-Dec-08 3:04
DJMOH29-Dec-08 3:04 
QuestionRe: Sending RCON commands tto a Counter-Strike: Source server. Pin
DJMOH29-Dec-08 3:01
DJMOH29-Dec-08 3:01 
Questionwallpaper problem Pin
onlyehtisham28-Dec-08 10:45
onlyehtisham28-Dec-08 10:45 
AnswerRe: wallpaper problem Pin
Colin Angus Mackay28-Dec-08 12:44
Colin Angus Mackay28-Dec-08 12:44 
AnswerRe: wallpaper problem Pin
Dave Kreskowiak28-Dec-08 19:44
mveDave Kreskowiak28-Dec-08 19:44 
QuestionDownloadQueue [modified] Pin
Noctris28-Dec-08 2:19
Noctris28-Dec-08 2:19 
AnswerRe: DownloadQueue Pin
Ben Fair29-Dec-08 9:20
Ben Fair29-Dec-08 9:20 
QuestionVB.NET application to login in Website Pin
shrekage27-Dec-08 17:30
shrekage27-Dec-08 17:30 
AnswerRe: VB.NET application to login in Website Pin
Tony Richards28-Dec-08 1:34
Tony Richards28-Dec-08 1:34 
AnswerRe: VB.NET application to login in Website Pin
Mycroft Holmes28-Dec-08 15:10
professionalMycroft Holmes28-Dec-08 15:10 
QuestionWindows Mobile Toolbar Pin
UniBond27-Dec-08 14:58
UniBond27-Dec-08 14:58 
QuestionVB.NET - OLEDB with Foxpro table Pin
iluha27-Dec-08 13:49
iluha27-Dec-08 13:49 
AnswerRe: VB.NET - OLEDB with Foxpro table Pin
CodingYoshi27-Dec-08 21:56
CodingYoshi27-Dec-08 21:56 
GeneralRe: VB.NET - OLEDB with Foxpro table Pin
iluha28-Dec-08 4:26
iluha28-Dec-08 4:26 
GeneralRe: VB.NET - OLEDB with Foxpro table Pin
CodingYoshi29-Dec-08 3:18
CodingYoshi29-Dec-08 3:18 
GeneralRe: VB.NET - OLEDB with Foxpro table Pin
Ben Fair29-Dec-08 8:54
Ben Fair29-Dec-08 8:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.