multiplayer refactor
This commit is contained in:
@@ -24,8 +24,10 @@ namespace RebootKit.Engine.Steam {
|
||||
}
|
||||
|
||||
IsInitialized = true;
|
||||
|
||||
|
||||
await UniTask.Yield(cancellationToken);
|
||||
|
||||
SteamFriends.OnGameRichPresenceJoinRequested += OnJoinRequested;
|
||||
}
|
||||
|
||||
internal static void Shutdown() {
|
||||
@@ -36,9 +38,19 @@ namespace RebootKit.Engine.Steam {
|
||||
|
||||
s_Logger.Info("Shutting down Steam Manager...");
|
||||
|
||||
SteamFriends.OnGameRichPresenceJoinRequested -= OnJoinRequested;
|
||||
SteamClient.Shutdown();
|
||||
|
||||
IsInitialized = false;
|
||||
}
|
||||
|
||||
static void OnJoinRequested(Friend friend, string key) {
|
||||
s_Logger.Info($"Join request received from {friend.Name} with key: {key}");
|
||||
|
||||
if (string.IsNullOrEmpty(key)) {
|
||||
s_Logger.Warning("Join request key is empty. Cannot process join request.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user