Ich versuche grad dabei, einzelne Pakete auf den Weg zu schicken. Als Ausganglage dafür nehme ich folgenden Code:
Code: Alles auswählen
# Client program
from socket import *
# Set the socket parameters
host = "localhost"
port = 21567
buf = 1024
addr = (host,port)
# Create socket
UDPSock = socket(AF_INET,SOCK_DGRAM)
def_msg = "===Enter message to send to server===";
print "\n",def_msg
# Send messages
while (1):
data = raw_input('>> ')
if not data:
break
else:
if(UDPSock.sendto(data,addr)):
print "Sending message '",data,"'....."
# Close socket
UDPSock.close()
Code: Alles auswählen
©255255255- RCon -
RCon stands for "Remote Control". It allows you to control dedicated servers.
©255255255- Server Setup -
Before you can use remote control you have to set an rcon password.
©255000000Servers without rcon password cannot be remotely controlled!
To set an rcon password you can use the server menu or the command "sv_rcon" followed by the password.
©255255255- Using RCon as Client -
After setting the rcon password you have to do the following:
- Join your server
- open the console
- type: rcon_password YOURPW
- type: rcon YOURCOMMANDS
You have to replace "YOURPW" with the rcon password you set before.
"YOURCOMMANDS" has to be replaced with one or more commands
you want to execute on your server.
Please note: You only have to use "rcon_password" ONE time after joining the server!
Afterwards you can use "rcon" as often as you like.
©255255255- Using external RCon -
It is also possible to use RCon without joining the server.
You either need an application which does this or you have to write your own one.
This is what you have to send by UDP:
1 Byte: 0
1 Byte: 0
1 Byte: 242
1 Byte: length of password string (X)
X Bytes: password string, each char one byte
2 Bytes (unsigned short): length of command string (X)
X Bytes: command string, each char one byte
"password string" has to contain the rcon password and "command string" the command(s) you want to execute.
©255000000Warning: External Rcon is a security risk. Password and commands are not encrypted.
The transmission is not reliable because plain UDP is used.
»Return«
Kann mir wer auf die Sprünge helfen?