Fix UI
This commit is contained in:
@@ -378,9 +378,36 @@ namespace MegaKoop.Steam
|
||||
|
||||
private void OnRichPresenceJoinRequestedCb(GameRichPresenceJoinRequested_t cb)
|
||||
{
|
||||
// Some Steamworks.NET versions expose only m_rgchConnect here.
|
||||
// We cannot reliably parse lobby id across versions; log and rely on GameLobbyJoinRequested_t for lobby joins.
|
||||
Debug.Log("[SteamLobbyService] RichPresence join requested - handle via GameLobbyJoinRequested or custom connect string.");
|
||||
// Parse steam://joinlobby/<appId>/<lobbyId>/<steamId> and join the lobby
|
||||
string conn = cb.m_rgchConnect;
|
||||
if (!string.IsNullOrEmpty(conn))
|
||||
{
|
||||
try
|
||||
{
|
||||
var s = conn.Trim();
|
||||
const string prefix = "steam://joinlobby/";
|
||||
if (s.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var rest = s.Substring(prefix.Length);
|
||||
var parts = rest.Split('/');
|
||||
// Expected: [appId, lobbyId, steamId]
|
||||
if (parts.Length >= 2)
|
||||
{
|
||||
if (ulong.TryParse(parts[1], out var lobbyId))
|
||||
{
|
||||
var lobby = new CSteamID(lobbyId);
|
||||
SteamMatchmaking.JoinLobby(lobby);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"[SteamLobbyService] Failed to parse rich presence connect '{conn}': {ex.Message}");
|
||||
}
|
||||
}
|
||||
Debug.LogWarning($"[SteamLobbyService] RichPresence join requested but could not parse connect '{conn}'.");
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user