Forum

> > CS2D > Scripts > Send RCON remotely
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Send RCON remotely

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Send RCON remotely

Quattro
GAME BANNED Off Offline

Zitieren
Is it possible to send rcon command to server without opening CS2D? For example send rcon command using python?

It would make life so much easier while updating lua scripts on dedicated server...

alt Re: Send RCON remotely

DC
Admin Off Offline

Zitieren
It is possible and even documented in the CS2D in-game help under "RCon". All you have to do is sending a correctly encoded message via an UDP socket. This is possible with many programming languages, including Python.

Also note that external RCon can be a security risk and that it only works when the server is configured correctly. Features like cs2d cmd sv_rconusers disable external RCon.

alt Re: Send RCON remotely

Quattro
GAME BANNED Off Offline

Zitieren
Could you guys give an example sending bytes? I am new to this and trying different things but cant figure out the correct way:

1
data = bytearray([1,0,242,4,'test',12,'sv_name test'])

This format one doesn't work

Edit:

1
2
MESSAGE = "1.0.242.4.test.12.sv_name test"
data = MESSAGE.encode('utf-8')

This one sends the line but server doesn't execute the command
1× editiert, zuletzt 04.07.18 09:15:17

alt Re: Send RCON remotely

Quattro
GAME BANNED Off Offline

Zitieren
IMG:https://i.imgur.com/a8qsL5x.jpg


I am on correct path already but I am stuck with converting password string to bytes + ascii

1
2
3
4
5
6
7
8
9
10
11
12
13
14
password = 'test'
command = 'sv_name test'

first = (1).to_bytes(1, byteorder='big')
second = (0).to_bytes(1, byteorder='big')
third = (242).to_bytes(1, byteorder='big')
fourth = (4).to_bytes(1, byteorder='big')
fifth = ????

msg = first + second + third + fourth
print('message: ', msg)

///Output:
message: b'\x01\x00\xf2\x04'

alt Re: Send RCON remotely

Yates
Reviewer Off Offline

Zitieren
If you're doing this on the same server you are hosting it on (Windows), you can send commands via the dedicated executable when it's running. I wouldn't remember how though, this was waayy back. But it is/was possible, so maybe something to look in to

alt Re: Send RCON remotely

Quattro
GAME BANNED Off Offline

Zitieren
I'm doing this from my pc, server is windows.

Btw if there was a working example line it would be much easier for a noob like me to send that line

I made this but have no idea if server can accept it:

b'\x01\x00\xf2\x04test\x0c\x00sv_name test'


Ok I tried this line just for the sake of it and it works

Success in something you have no idea at feels good
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht