| 220 | namespace CloudIntercept { |
| 221 | |
| 222 | void InitLinux() { |
| 223 | bool expected = false; |
| 224 | if (!g_initDone.compare_exchange_strong(expected, true)) return; |
| 225 | |
| 226 | g_homePath = GetHome(); |
| 227 | |
| 228 | // Detect Steam path |
| 229 | { |
| 230 | std::lock_guard<std::mutex> lock(g_mutex); |
| 231 | g_steamPath = DetectSteamPath(); |
| 232 | } |
| 233 | LOG("[Linux] Steam path: %s", g_steamPath.c_str()); |
| 234 | |
| 235 | // Bootstrap account ID from loginusers.vdf |
| 236 | uint32_t accountId = LoadAccountIdFromLoginUsers(); |
| 237 | if (accountId != 0) { |
| 238 | g_accountId.store(accountId, std::memory_order_release); |
| 239 | } |
| 240 | |
| 241 | // Load namespace apps from SLSsteam config and watch for changes. |
| 242 | std::string watchedPath = LoadNamespaceAppsFromSLSsteam(); |
| 243 | if (!watchedPath.empty()) { |
| 244 | std::thread(WatchSLSsteamConfig, watchedPath).detach(); |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | bool IsNamespaceApp(uint32_t appId) { |
| 249 | std::lock_guard<std::mutex> lock(g_nsMutex); |
no test coverage detected