Visual Basic.NET - Remote Admin Console Works with CS, CSS, ET, RTCW, Q3, JK ++

This is something that I coded for my application ETTools.
image: etttooool1

This will allow a user to remotely connect to a game server using the IP, PORT and RCON PASSWORD. Once the user connects they will automatically query the server for the status.

The user can then send commands from the application to the remote server and receive the data as an output in txtOutput.Text.

This is a simple application to do, you can work out everything by the pic.


CODE
Imports System.IO
Imports System.Net
Public Class Form1
Inherits System.Windows.Forms.Form
Dim HostIp As String, Rcon As String, Port As String
Dim Command As String
Dim Say As String
Dim Kick As String, ClientKick As String
Dim strData As String



Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnect.Click
'error handle
On Error Resume Next

'we get the input
HostIp = txtHostIp.Text
Rcon = txtRcon.Text
Port = txtPort.Text

'here is the main part, we connect to the server
AxWinsock1.RemoteHost = HostIp
AxWinsock1.RemotePort = Port
AxWinsock1.Connect()

'we send the first command in the begging, being status. THe Chr(255) have to be there.
'This line just makes sure that we get the status automatically that is all.
AxWinsock1.SendData(Chr(255) & Chr(255) & Chr(255) & Chr(255) & "rcon " & Rcon & " " & "status")
End Sub

Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuery.Click
Send("status")
End Sub


Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
'we store the text to variable
Say = txtCommand.Text
'send the command
Send(Say)
'and we clean up
txtCommand.Text = ""
'and prepare for new say message
txtCommand.Focus()
End Sub

Private Sub cmdKickClient_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdKickClient.Click
Kick = InputBox("Enter name of the player to be kicked: ")
Send("kick " & Kick)
End Sub

Private Sub cmdKickClientByID_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdKickClientByID.Click
ClientKick = InputBox("Enter the client number of the player to be kicked: ")
Send("clientkick " & ClientKick)
End Sub
Private Sub txtcmd_KeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer)
'if we press enter in the command line textbox, we want to check if it is enter
If KeyCode = Keys.Enter Then
'and then execute the command
Command = txtCommand.Text
Send(Command)
txtCommand.Text = ""
End If
End Sub
Private Sub AxWinsock1_DataArrival(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles AxWinsock1.DataArrival
'the meat of the program
'when you send a command to server, it responds back and this is where it goes
On Error Resume Next

'we get the data
AxWinsock1.GetData(strData, vbString, 2000000)


'if user wishes to hide the funny names, colors and stuff
If cbHideColour.Checked = True Then
strData = Replace(strData, "^0", "")
strData = Replace(strData, "^1", "")
strData = Replace(strData, "^2", "")
strData = Replace(strData, "^3", "")
strData = Replace(strData, "^4", "")
strData = Replace(strData, "^5", "")
strData = Replace(strData, "^6", "")
strData = Replace(strData, "^7", "")
strData = Replace(strData, "^8", "")
strData = Replace(strData, "^9", "")
strData = Replace(strData, "^-", "")
strData = Replace(strData, "^=", "")
strData = Replace(strData, "^q", "")
strData = Replace(strData, "^w", "")
strData = Replace(strData, "^e", "")
strData = Replace(strData, "^r", "")
strData = Replace(strData, "^t", "")
strData = Replace(strData, "^y", "")
strData = Replace(strData, "^u", "")
strData = Replace(strData, "^i", "")
strData = Replace(strData, "^o", "")
strData = Replace(strData, "^p", "")
strData = Replace(strData, "^[", "")
strData = Replace(strData, "^]", "")
strData = Replace(strData, "^a", "")
strData = Replace(strData, "^s", "")
strData = Replace(strData, "^d", "")
strData = Replace(strData, "^f", "")
strData = Replace(strData, "^g", "")
strData = Replace(strData, "^h", "")
strData = Replace(strData, "^j", "")
strData = Replace(strData, "^k", "")
strData = Replace(strData, "^l", "")
strData = Replace(strData, "^;", "")
strData = Replace(strData, "^'", "")
strData = Replace(strData, "^#", "")
strData = Replace(strData, "^\", "")
strData = Replace(strData, "^z", "")
strData = Replace(strData, "^x", "")
strData = Replace(strData, "^c", "")
strData = Replace(strData, "^v", "")
strData = Replace(strData, "^b", "")
strData = Replace(strData, "^n", "")
strData = Replace(strData, "^m", "")
strData = Replace(strData, "^,", "")
strData = Replace(strData, "^.", "")
strData = Replace(strData, "^/", "")
strData = Replace(strData, "^!", "")
strData = Replace(strData, "^@", "")
strData = Replace(strData, "^£", "")
strData = Replace(strData, "^$", "")
strData = Replace(strData, "^%", "")
strData = Replace(strData, "^^", "")
strData = Replace(strData, "^&", "")
strData = Replace(strData, "^*", "")
strData = Replace(strData, "^(", "")
strData = Replace(strData, "^)", "")
strData = Replace(strData, "^_", "")
strData = Replace(strData, "^+", "")
strData = Replace(strData, "^{", "")
strData = Replace(strData, "^}", "")
strData = Replace(strData, "^:", "")
strData = Replace(strData, "^~", "")
strData = Replace(strData, "^|", "")
strData = Replace(strData, "^<", "")
strData = Replace(strData, "^>", "")
strData = Replace(strData, "^?", "")

End If


strData = Replace(strData, Chr(255) & Chr(255) & Chr(255) & Chr(255) & "print" & vbLf, "")
strData = Replace(strData, vbLf, vbCrLf)



'we Output the received filtered text!
txtOutput.Text = txtOutput.Text & vbCrLf & vbCrLf & strData

'we make sure the output window is at the end. The scroller is always in the end
txtOutput.Selectionstart = Len(txtOutput.Text)

End Sub

Sub Send(ByVal cmd As String)
'the send section. we call Send when we want to send something to the server and this does the
'trick
On Error Resume Next

AxWinsock1.SendData(Chr(255) & Chr(255) & Chr(255) & Chr(255) & "rcon " & Rcon & " " & cmd)
End Sub



End Class

/ CODE
Comments
7
not any tutorial at all just a wall of code
I didn't say it was a tutorial :/... I guess people here have no coding experience at all. If you want to look at my tutorials you need to know atleast the basics :/... I don't understand why retards are moaning when the code is so fricking simple :/ I don't know why you would need code commenting :/....

Learn VB.NET then come to my code, you won't be saying anything then :(.
Parent
QuoteI didn't say it was a tutorial :/

why posting it to xfire tutorial section then...
QuoteIf you want to look at my tutorials...

:D?

seriously, stop posting these walls of code on xfire, what do you want to do with posting this? Teach someone? PLEASE...
do u think it's okay to "study" visual basic( :D o hai secondary school compulsory subject!) on XFIRE? If i had wanted to study it i'd have gone to other websites or buy books or whatever else but not xfire.
I wouldnt mind if it was a single tutorial with basics how to write programs in some language with some links on books, soft, examples etc but posting every single simple shit program you write is just bullshit
noone is moaning here coz it's hard or they need comments or smth, no. it's just useless.
and as for anyone knowing vb your code isn't really useful or smth, noone gives a fuck
Parent
If you visit my website you will see that it has code highlighting, so this is so much easier to understand. If you look at the code you will see it's commented and this is explaining step by step what does what. What more do you want from a tutorial? FFS if you don't want to look at it don't, no need to reply to me or comment if you don't like it. I guess if you didn't like some guy in the street you wouldn't say you don't like him or his clothes. You would get a slap.
Parent
man are you rly that retarded?
i.dont.give.a.fuck.about.highlighting.or.the.ease.to.understand.
i dont just get how these millions of topics full of random bullshit you made can be counted as xfire tutorials.

If i see a man wearing clown clothes in the army where everyone wears military ones why wouldnt i say it?
read the window heading, it says "Crossfire 3.0 - A Gaming Community". not "Crossfire 3.0 - LOL GUYS LOOK I WROTE A RANDOM PROGRAM SO I POST IT HERE! :PPPP Community"
Parent
Stop being such a retard tbh. Like I said why does it even bother you? You're just a prick who acts tough on the internet because you have a small penis, only ever got pussy once and still count yourself as a man.

.RU says it all tbh, pussy. Russians think they're the best and think they're tough when they're a shitty country who can't afford to keep the birth rate down but manage to share the fucking aids everyone has over there.

You don't even talk on vent because you're scared and paranoid about your own voice.

image: poster-1941b
Parent
where to download this
Parent
Back to top