@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.
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.
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.
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.
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. 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)
@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.
Following a pattern something like this I would say: https://developer.valvesoftware.com/wiki/Server_queries#Request_Format It's probably better to properly parse the return values though, rather than exploding by NULL and trusting array parameter numbers to not change.
@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.
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.
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.
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.
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.
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.
It's a WebHoster and not a dedicated server, which would have more rights, as like a home Wamp/Xamp ...