Suggestion to easier join Servers

Discussion in 'Hosting Help' started by redapg, Jun 11, 2023.

  1. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    @Coutie (i did add only you, because i don't know better Person to directly add here :))
    The Problem is this:
    Because i never did see all available Server in the in Game and Steam Server Lists, i did make my own one, by using the Steam API a long Time ago.
    But there is 1 Problem.
    Because the Steam API (for a good Reason of course) doesn't read out the Server Password, if there is one,
    i can not join the Server directly from my Server List, that only has the IP and Port in the Link.
    When the Server has a Password and i click the direct Connection Link in my List, i end on the Site in Game, where i get the Error Message "invalid Password" shown and the Options to leave the Game (no, i don't want to leave, i want to play :)) or to go to the main Menu, which is useless, if the Server, to that i want to join is not shown in the in Game Server List.
    My Suggestion is to lead the Client to the Site where he can enter a Password to be able to proceed, instead to the Site with the mentioned useless Options.
    The below Video shows what i mean.
     
    Last edited: Jun 11, 2023
    Hazi and DJCruicky like this.
  2. DJCruicky

    DJCruicky Registered

    Joined:
    Jan 25, 2012
    Messages:
    1,595
    Likes Received:
    1,156
    Yes Please.
     
    Hazi likes this.
  3. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,782
    Likes Received:
    2,243
    I'll ask if it's possible to send that data to steam(that the server is passworded, I know other games do it). Probably easier than opening a website.
    Edit: Wait, it does, your issue is something else, could be a steam issue, I'll need to ask the programmers.
     
    redapg likes this.
  4. DanRZ

    DanRZ Registered

    Joined:
    Aug 22, 2021
    Messages:
    723
    Likes Received:
    222
    I also did some try on the Steam API and it looks like they don't send the information of lock at all.
    An extract of the json from a request ...

    Code:
    {
        "response":{
            "servers":[
                {
                    "addr":"147.156.215.16:64299"
                    "gameport":64297
                    "steamid":"90172757897808911"
                    "name":"RJTM"
                    "appid":365960
                    "gamedir":"rFactor 2"
                    "version":"11133"
                    "product":"rFactor 2"
                    "region":-1
                    "players":0
                    "max_players":46
                    "bots":0
                    "map":"Barcelona F1 2023"
                    "secure":false
                    "dedicated":false
                    "os":"w"
                }
    I noticed the fields dedicated and os are not properly filled too.
     
  5. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    I did add a separate Button on my Site, with that you could find out if a Server did have a Password or not.
    BUT, for whatever Reason, that didn't work for all Servers when i did create my Site (some Years ago) and now, it doesn't seem to work at all anymore. :D
     
  6. DanRZ

    DanRZ Registered

    Joined:
    Aug 22, 2021
    Messages:
    723
    Likes Received:
    222
    Did you find a way to ask directly the server ? Maybe the REST API can do that ...
     
  7. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    To be honest, i don't remember exactly how i did "put it together", but as said, it worked for some Servers back then.
    But i don't understand the Code anymore. :D
    I use php.
    When you click on the Link to the Password Check, i "transfer" the IP and Port of the Server for that the Check is.
    And then, i use this php Code to check it:

    $ip = "".$_GET['ip']."";
    $queryport = $_GET['port'];
    $socket = @fsockopen("udp://".$ip, $queryport , $errno, $errstr, 1);
    stream_set_timeout($socket, 1);
    stream_set_blocking($socket, TRUE);
    fwrite($socket, "\xFF\xFF\xFF\xFF\x54Source Engine Query\x00");
    $response = fread($socket, 4096);
    @fclose($socket);
    $packet = explode("\x00", substr($response, 6), 5);
    $server = array();
    $server['name'] = $packet[0];
    $inner = $packet[4];
    $server['password'] = ord(substr($inner, 7, 1));

    In the End you did get $server['password'] == '1' (has a Password) or $server['password'] == '0' (has no Password)
     
  8. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    @DanRZ
    Short Update: it still works :)
    But still only for a few Server.
    You can try it out.
    Open my Server Site and click on the green and red Locks with the Question Mark in their Middle, of the Server "3 Stooges RF2 Fun Server"
    You get a closed red Lock shown in a small Pop up Window and the Server has a Password.
    But most Servers can not be accessed.
     
  9. DanRZ

    DanRZ Registered

    Joined:
    Aug 22, 2021
    Messages:
    723
    Likes Received:
    222
    Would be curious to know what you use in the pwcheck ...Some kind of wizardry ? :D
     
  10. DanRZ

    DanRZ Registered

    Joined:
    Aug 22, 2021
    Messages:
    723
    Likes Received:
    222
    Are you using the WebUI port ?
     
  11. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,388
    Likes Received:
    6,602
  12. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    Last edited: Jun 11, 2023
    DanRZ likes this.
  13. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    @Lazza I'm no Programmer.
    What is a bit strange with this whole Password Check Thing, is, that it works properly on my Localhost (XAMP), but not on the lima-city Server

    EDIT And in the End it doesn't really matters, the real Problem appears, when it comes to joining the Server after clicking the direct Connection Link on the Server Site.
    Read the opening Post.
     
  14. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,388
    Likes Received:
    6,602
    I did. I'm not saying it'll help the issue, and it may not make the password value more consistent, but it would be more reliable either way. I was more responding to what Dan was asking.
     
  15. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    I think i've found the Problem.
    The Server Site is on lima-city and uses fsockopen with udp, to check if a Server has a Password.
    But lima-city has limited the udp Ports for that it works, what explains, why it works for a few Server only.
     
  16. DanRZ

    DanRZ Registered

    Joined:
    Aug 22, 2021
    Messages:
    723
    Likes Received:
    222
    Sorry, didn't see your post.
    I'll try and see ...
     
  17. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    As said, i've found out why my Password Check doesn't work for all Server, on the lima-city Server.
    lima-city has limited the usable Ports, that can be used for fsockopen, to only these few:
    • 7777
    • 9987
    • 14567
    • 15567
    • 16567
    • 25565
    • 25575
    • 25588
    • 27015
    • 27016
    • 27115
    • 27215
    • 27315
    • 27415
    • 28960
    • 30033
    and when a Server uses one of them, my Password Check works.
     
  18. DanRZ

    DanRZ Registered

    Joined:
    Aug 22, 2021
    Messages:
    723
    Likes Received:
    222
    I tried on my site and got worst :

    Notice
    : fwrite() [function.fwrite]: send of 25 bytes failed with errno=1 Operation not permitted in /home/danrazor/www/rF2_servers/index2.php on line 155

    It looks like i can't send udp messages at all on my hosting.
     
  19. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,008
    Likes Received:
    2,876
    Is that an own Server or a Server from a Webhoster?
    It can be that Things like fopen and fsockopen are not allowed.
    Check the php Info (phpinfo()) of the Server.
    Do you maybe have XAMPP installed on your PC at Home?
    With that, it works as it has to here, because i "allow" these Things.
     
  20. DanRZ

    DanRZ Registered

    Joined:
    Aug 22, 2021
    Messages:
    723
    Likes Received:
    222
    It's a WebHoster and not a dedicated server, which would have more rights, as like a home Wamp/Xamp ...
     

Share This Page