1. Hi folks

    I've tried a couple of libraries but it seems that the rust rcon protocol and the source ds rcon protocol still use different implementations. This annoyed me so I went to write the rcon class myself up to the point where it worked.

    Example use:
    http://pastebin.com/TY1H3mTh

    This class is quickly hacked together. I expect this to break with every other Rust update or even fail to handle certain commands.

    I use this class to send announcements to my vanilla server, to call airdrops every n minutes with a minimum amount of players and to announce when admins joined the server.

    NOTE that this script should not be used for user interaction (it's slow and it sucks, but it does the job).
    Edit: It's a lot faster now, pretty sure this can be used for user interaction.

    To see a live use of this script, join rust.bloodisgood.org:28200

    Download:
    BETTER C# VERSION: https://github.com/Gachl/RustRcon
    http://pastebin.com/vQqmx6bR (v 1.1)

    License:
    Creative Commons BY-NC-SA 4.0

    Talkback
    http://facepunch.com/showthread.php?t=1384264
     
    Last edited by a moderator: Jul 22, 2014
  2. I'm currently modifying this version to make a more performant one. Still not planning to fix the double buffer bug as that is not really a problem with packet ids.
    The changes will be:
    - Don't Read when Sending, the reading and packet assignment has to be done manually (speed up sending commands)
    - Don't Read when Authing, authentication errors will be thrown with the first couple of Reads (speed up connecting)
    - Responses (Reading) come in a class RustRconResponse now to keep response body and id

    I will also put up a lite version of the server extension I wrote for the rcon class. It will have cron and commands just to demonstrate the capabilities of this class.

    Currently, this class in in use on my server to make it a modded vanilla server. There are static and dynamic announcements, join and quit messages (and first welcome), automated airdrops and commands (help, kit, admin, ...). This works very well and, with the new version of the class, runs fairly fast and does not drop player commands.

    The class and server extension is rewritten but untested, I will put these changes up once they are tested (and fixed) in around 4-6 hours.
     
  3. If you need any help with either testing or the PHP-side of things, let me know :)
     
  4. Thanks iScripters, very much appreciated.
    I only had minor issues while testing and I think I resolved all of them.
    New version is up.
     
  5. Any updates on this ? I get a can not connect...
    Fatal error: Uncaught exception 'Exception' with message 'Could not connect to rust server: Error(111) Connection refused.' in /home/content/85/10873985/html/rust/rust.rcon.php:34 Stack trace: #0 /home/content/85/10873985/html/rust/rust.rcon.php(23): RustRcon->connect(
     
  6. royalrust this is not an issue with the sdcript, you simply have the wrong port or IP or a network restriction. read the error: Error(111) Connection refused.

    edit: there is now a C# version also available which has multi-package recognition and is not so dumb to deal with like in PHP. https://github.com/Gachl/RustRcon
     
    Last edited by a moderator: Jul 22, 2014
  7. Or you can use the node not package for rcon
     
  8. Is there working version for rust experimental? Php and if possible - python (2.7). Idk what is difference between normal source rcon protocol and rust one. Because there exists for examply valve-python rcon liblary and it can send commands to server, but can't get response at all. So i can see that command is executed but can't get response.

    http://python-valve.readthedocs.org/en/latest/

    ps csharp version isn't variant to me because i need this for linux, python is best option. But php is still needed for web things.
     
  9. Any information? Really need this for php/python... if i could understand difference and fix it myself...
     
  10. Hy, im running a local server, and im want to run 1 command in the server console, when I hit a button on my webpage, so can i do it somehow in PHP?
    I looked the classes but it cant connect, and I dont know why.