RCON Protocol on PB

Just starting out? Need help? Post your questions and find answers here.
registrymechanic22
Enthusiast
Enthusiast
Posts: 176
Joined: Sun Jun 28, 2009 7:07 pm
Location: RUS

Post by registrymechanic22 »

infratec wrote:Hi, my last favour for you:
thanks, cool
registrymechanic22
Enthusiast
Enthusiast
Posts: 176
Joined: Sun Jun 28, 2009 7:07 pm
Location: RUS

Post by registrymechanic22 »

Hi all
Please Give:
how to send Russian text of the server, and then on to the server come scribble ... ((
???
cas
Enthusiast
Enthusiast
Posts: 597
Joined: Mon Nov 03, 2008 9:56 pm

Post by cas »

registrymechanic22 wrote:Hi all
Please Give:
how to send Russian text of the server, and then on to the server come scribble ... ((
???
Maybe unicode switch (and possibly some tweaks in code) should help.
registrymechanic22
Enthusiast
Enthusiast
Posts: 176
Joined: Sun Jun 28, 2009 7:07 pm
Location: RUS

Post by registrymechanic22 »

cas wrote:
registrymechanic22 wrote:Hi all
Please Give:
how to send Russian text of the server, and then on to the server come scribble ... ((
???
Maybe unicode switch (and possibly some tweaks in code) should help.
thanks, found the solution:
PrintN(SendText$) 'bad text'
CharToOem_(SendText$,SendText$)
PrintN(SendText$) 'good text'
roleg
User
User
Posts: 51
Joined: Wed Feb 24, 2010 2:07 pm

Re: RCON Protocol on PB

Post by roleg »

I try to implement this code to my communication with server program, but it's work wrong. After it connected, server print in stdout: "Disconnected: Invalid Password" but passwords is OK and after that my program crashed with that error: "[08:51:30] [ERROR] rcon.pb (Line: 45) [08:51:30] [ERROR] Invalid memory access. (read error at address 20)".

Program crashes in:

Code: Select all

Procedure RConReceive(Con, *ID, *CommandResponse, *Str1, *Str2, MaxWait)

 Result = -1
 
 *Buffer = AllocateMemory(8192)                         ;<<<--------

ProtocolExamples: https://developer.valvesoftware.com/wik ... _Libraries

P.S. after i disable unicode executable, Authorization for now WORK FINE, but commands don't execute and reached "Receive timeout!"

P.S.S. after debug in sniffer I found that SERVERDATA_AUTH_RESPONSE dont sended to Client, so we dont need to check that.... ALL WORKED !!!
infratec
Always Here
Always Here
Posts: 7581
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: RCON Protocol on PB

Post by infratec »

Hi,

I changed all my code to send and receive ASCII.
It should work now independent from the compiler settings.

According to your link:
When the server receives an auth request, it will respond with an empty SERVERDATA_RESPONSE_VALUE, followed immediately by a SERVERDATA_AUTH_RESPONSE indicating whether authentication succeeded or failed
Bernd
roleg
User
User
Posts: 51
Joined: Wed Feb 24, 2010 2:07 pm

Re: RCON Protocol on PB

Post by roleg »

Thanks Bernd for your code!
I use this constants:

Code: Select all

#SERVERDATA_AUTH = 3
#SERVERDATA_AUTH_RESPONSE = 0
#SERVERDATA_EXECCOMMAND = 2
#SERVERDATA_RESPONSE_VALUE = 4
work fine for me (RUST dedicated server)
Post Reply