Add a way to set subscribed groups.

This commit is contained in:
Mr_Goldberg 2020-06-20 21:15:26 -04:00
parent beffb89bda
commit a0648d454c
No known key found for this signature in database
GPG Key ID: 8597D87419DEF278
5 changed files with 37 additions and 0 deletions

View File

@ -48,6 +48,10 @@ Depots:
This is pretty rare but some games might use depot ids to see if dlcs are installed. You can provide a list of installed depots to the game with a steam_settings\depots.txt file.
See the steam_settings.EXAMPLE folder for an example.
Subscribed Groups:
Some games like payday 2 check which groups you are subscribed in and unlock things based on that. You can provide a list of subscribed groups to the game with a steam_settings\subscribed_groups.txt file.
See steam_settings.EXAMPLE\subscribed_groups.EXAMPLE.txt for an example for payday 2.
App paths:
Some rare games might need to be provided one or more paths to app ids. For example the path to where a dlc is installed. This sets the paths returned by the Steam_Apps::GetAppInstallDir function.
See steam_settings.EXAMPLE\app_paths.EXAMPLE.txt for an example.

View File

@ -132,6 +132,9 @@ public:
std::map<std::string, Stat_config> getStats() { return stats; }
void setStatDefiniton(std::string name, struct Stat_config stat_config) {stats[name] = stat_config; }
//subscribed lobby/group ids
std::set<uint64> subscribed_groups;
//images
std::map<int, struct Image_Data> images;
int add_image(std::string data, uint32 width, uint32 height);

View File

@ -511,6 +511,28 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
}
}
{
std::string depots_config_path = Local_Storage::get_game_settings_path() + "subscribed_groups.txt";
std::ifstream input( depots_config_path );
if (input.is_open()) {
consume_bom(input);
for( std::string line; getline( input, line ); ) {
if (!line.empty() && line[line.length()-1] == '\n') {
line.pop_back();
}
if (!line.empty() && line[line.length()-1] == '\r') {
line.pop_back();
}
uint64 source_id = stoull(line);
settings_client->subscribed_groups.insert(source_id);
settings_server->subscribed_groups.insert(source_id);
PRINT_DEBUG("Added source %llu\n", source_id);
}
}
}
{
std::string mod_path = Local_Storage::get_game_settings_path() + "mods";
std::vector<std::string> paths = Local_Storage::get_filenames_path(mod_path);

View File

@ -502,6 +502,10 @@ bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource )
if (settings->get_lobby() == steamIDSource) {
return true;
}
if (settings->subscribed_groups.find(steamIDSource.ConvertToUint64()) != settings->subscribed_groups.end()) {
return true;
}
} else {
Friend *f = find_friend(steamIDUser);
if (!f) return false;

View File

@ -0,0 +1,4 @@
103582791433980119
103582791438562929
103582791441335905
103582791460014708