CS2Browser / cs2-server-browser

GNU General Public License v3.0
26 stars 0 forks source link

Some info/ideas for integrating CS2Browser with Valve's server browser #54

Open cow1337killer3 opened 2 weeks ago

cow1337killer3 commented 2 weeks ago

I spent some time looking at Valve's server browser and I wanted to suggest a way you could maybe integrate it with CS2Browser. I'm also just writing down everything I found for reference in case someone else ends up Googling for things similar to this.

Notes:

For Windows, Valve's server browser stores the favorites and history here: C:\Program Files (x86)\Steam\userdata\<your Steam AccountID>\7\remote\serverbrowser_hist.vdf

It's formatted like this:

"Filters"
{
    "favorites"
    {
        "1"
        {
            "name"      "169.150.232.56:26461"
            "address"       "169.150.232.56:26461"
            "LastPlayed"        "0"
            "appid"     "0"
            "accountid"     "0"
        }
        "2"
        {
            "name"      "121.127.40.184:26951"
            "address"       "121.127.40.184:26951"
            "LastPlayed"        "0"
            "appid"     "0"
            "accountid"     "0"
        }
    }
    "history"
    {
        "1"
        {
            "name"      "169.150.232.56:26461"
            "address"       "169.150.232.56:26461"
            "LastPlayed"        "0"
            "appid"     "0"
            "accountid"     "0"
        }
        "2"
        {
            "name"      "121.127.40.184:26951"
            "address"       "121.127.40.184:26951"
            "LastPlayed"        "0"
            "appid"     "0"
            "accountid"     "0"
        }
        "3"
        {
            "name"      "108.181.55.215:27017"
            "address"       "108.181.55.215:27017"
            "LastPlayed"        "0"
            "appid"     "0"
            "accountid"     "0"
        }
    }
}

There's also a config file that saves some of the state for the server browser filters here, it's pretty simple: C:\Program Files (x86)\Steam\userdata\<your Steam AccountID>\config\serverbrowser_ui.vdf

Then there's also what seems to be config files (some for specific screen resolutions) for the state of the visible columns and column sortings (under the Servers key): C:\Program Files (x86)\Steam\config\DialogConfig.vdf

That looks like the default one, and the resolution specific ones are in the same folder. I've tried making edits to these files but the server browser just seems to ignore all of my changes so far. Column visibility seems to be reset every time Steam starts, and might not be able to be changed through the UI or the config files. Would be nice to have "Bots" be visible by default.

Exporting to Steam:

So an obvious idea would be to have the CS2Browser website have an "Export" or "Download" button for either a performed server search, or for your favorited servers. It'd just take all the IP addresses and format them into a serverbrowser_hist.vdf file.

Importing from Steam

Basically, show the user where their serverbrowser_hist.vdf file should be, have them upload it, parse all the IP addresses, match them against existing ones in CS2Browser, and favorite them for the user.


Just some ideas and information I wanted to get out there. Might not be that feasible/practical, but here's all the info in case anyone wants to try to do something with it... since Valve seems to not care about the server browser whatsoever.

JMorell commented 2 weeks ago

thanks for your contribution, one of the problems I see with this is that you would lose all previously played servers and it is also unclear to me if Steam updates this file internally with the Steam Cloud.