mirror of
https://github.com/alex47exe/gse_fork.git
synced 2026-02-04 05:41:18 +01:00
Merge pull request #420 from Detanup01/lobby-connect-stuff
Lobby-Connect fix & qol
This commit is contained in:
@@ -251,6 +251,7 @@ static std::filesystem::path factory_default_cloud_dir(CSimpleIniA *ini, class S
|
||||
// app::cloud_save
|
||||
void parse_cloud_save(CSimpleIniA *ini, class Settings *settings_client, class Settings *settings_server, class Local_Storage *local_storage)
|
||||
{
|
||||
#ifndef LOBBY_CONNECT
|
||||
constexpr static bool DEFAULT_CREATE_DEFAULT_DIR = true;
|
||||
constexpr static bool DEFAULT_CREATE_SPECIFIC_DIRS = true;
|
||||
constexpr static const char SPECIFIC_INI_KEY[] =
|
||||
@@ -317,4 +318,5 @@ void parse_cloud_save(CSimpleIniA *ini, class Settings *settings_client, class S
|
||||
PRINT_DEBUG(" [X] cloud save dir has unprocessed identifiers, skipping");
|
||||
}
|
||||
}
|
||||
#endif // LOBBY_CONNECT
|
||||
}
|
||||
|
||||
@@ -64,41 +64,32 @@ int main() {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
}
|
||||
|
||||
title();
|
||||
|
||||
int friend_count = SteamFriends()->GetFriendCount(k_EFriendFlagAll);
|
||||
|
||||
/*
|
||||
std::cout << "People on the network: " << friend_count << "\n";
|
||||
for (int i = 0; i < friend_count; ++i) {
|
||||
CSteamID id = SteamFriends()->GetFriendByIndex(i, k_EFriendFlagAll);
|
||||
const char *name = SteamFriends()->GetFriendPersonaName(id);
|
||||
|
||||
FriendGameInfo_t friend_info = {};
|
||||
SteamFriends()->GetFriendGamePlayed(id, &friend_info);
|
||||
std::cout << name << " is playing: " << friend_info.m_gameID.AppID() << std::endl;
|
||||
}
|
||||
*/
|
||||
|
||||
title();
|
||||
|
||||
std::vector<std::pair<std::string, uint32>> arguments;
|
||||
for (int i = 0; i < friend_count; ++i) {
|
||||
CSteamID id = SteamFriends()->GetFriendByIndex(i, k_EFriendFlagAll);
|
||||
const char *name = SteamFriends()->GetFriendPersonaName(id);
|
||||
const char *connect = SteamFriends()->GetFriendRichPresence( id, "connect");
|
||||
FriendGameInfo_t friend_info = {};
|
||||
SteamFriends()->GetFriendGamePlayed(id, &friend_info);
|
||||
bool isSuccess = SteamFriends()->GetFriendGamePlayed(id, &friend_info);
|
||||
auto appid = friend_info.m_gameID.AppID();
|
||||
|
||||
if (strlen(connect) > 0) {
|
||||
std::cout << arguments.size() << " - " << name << " is playing " << appid << " (" << connect << ").\n";
|
||||
arguments.emplace_back(connect, appid);
|
||||
} else {
|
||||
if (friend_info.m_steamIDLobby != k_steamIDNil) {
|
||||
} else if (isSuccess && friend_info.m_steamIDLobby != k_steamIDNil) {
|
||||
std::string connect = "+connect_lobby " + std::to_string(friend_info.m_steamIDLobby.ConvertToUint64());
|
||||
std::cout << arguments.size() << " - " << name << " is playing " << appid << " (" << connect << ").\n";
|
||||
arguments.emplace_back(connect, appid);
|
||||
}
|
||||
}
|
||||
} else if (isSuccess) {
|
||||
std::cout << name << " is playing " << appid << std::endl;
|
||||
} else {
|
||||
std::cout << name << " is found in network " << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << arguments.size() << " - Refresh.\n\n";
|
||||
|
||||
Reference in New Issue
Block a user