diff --git a/Assets/Talo Game Services/Talo/Runtime/APIs/PlayersAPI.cs b/Assets/Talo Game Services/Talo/Runtime/APIs/PlayersAPI.cs index 89c50074..b6bbc2a1 100644 --- a/Assets/Talo Game Services/Talo/Runtime/APIs/PlayersAPI.cs +++ b/Assets/Talo Game Services/Talo/Runtime/APIs/PlayersAPI.cs @@ -16,7 +16,7 @@ public enum DebouncedOperation Update } - public event Action OnIdentified; + public event Action OnIdentified; public event Action OnIdentificationStarted; public event Action OnIdentificationFailed; public event Action OnIdentityCleared; @@ -43,10 +43,10 @@ private async void OnConnectionRestored() public void InvokeIdentifiedEvent() { - OnIdentified?.Invoke(Talo.CurrentPlayer); + OnIdentified?.Invoke(Talo.CurrentAlias); } - private async Task HandleIdentifySuccess(PlayerAlias alias, string socketToken = "") + private async Task HandleIdentifySuccess(PlayerAlias alias, string socketToken = "") { if (!Talo.IsOffline() && Talo.Socket.IsIdentified()) { @@ -61,10 +61,10 @@ private async Task HandleIdentifySuccess(PlayerAlias alias, string socke InvokeIdentifiedEvent(); - return alias.player; + return alias; } - public async Task Identify(string service, string identifier) + public async Task Identify(string service, string identifier) { OnIdentificationStarted?.Invoke(); @@ -92,27 +92,24 @@ public async Task Identify(string service, string identifier) } } - public async Task IdentifySteam(string ticket, string identityClient = "") + public async Task IdentifySteam(string ticket, string identityClient = "") { if (string.IsNullOrEmpty(identityClient)) { - await Identify("steam", ticket); + return await Identify("steam", ticket); } else { - await Identify("steam", $"{identityClient}:{ticket}"); + return await Identify("steam", $"{identityClient}:{ticket}"); } - - return Talo.CurrentPlayer; } - public async Task IdentifyGooglePlayGames(string authCode) + public async Task IdentifyGooglePlayGames(string authCode) { - await Identify("google_play_games", authCode); - return Talo.CurrentPlayer; + return await Identify("google_play_games", authCode); } - public async Task IdentifyGameCenter( + public async Task IdentifyGameCenter( string publicKeyUrl, byte[] signature, byte[] salt, @@ -132,8 +129,7 @@ string playerId var identifier = Uri.EscapeDataString(JsonUtility.ToJson(payload)); - await Identify("game_center", identifier); - return Talo.CurrentPlayer; + return await Identify("game_center", identifier); } protected override async Task ExecuteDebouncedOperation(DebouncedOperation operation) @@ -203,7 +199,7 @@ public async Task Find(string playerId) return res.player; } - private async Task IdentifyOffline(string service, string identifier) + private async Task IdentifyOffline(string service, string identifier) { PlayerAlias offlineAlias; try diff --git a/Assets/Talo Game Services/Talo/Samples/AuthenticationDemo/Scripts/GameUIController.cs b/Assets/Talo Game Services/Talo/Samples/AuthenticationDemo/Scripts/GameUIController.cs index 09f6eb1f..8d70daa2 100644 --- a/Assets/Talo Game Services/Talo/Samples/AuthenticationDemo/Scripts/GameUIController.cs +++ b/Assets/Talo Game Services/Talo/Samples/AuthenticationDemo/Scripts/GameUIController.cs @@ -19,9 +19,9 @@ private void OnDisable() Talo.Players.OnIdentified -= OnIdentified; } - private void OnIdentified(Player player) + private void OnIdentified(PlayerAlias alias) { - root.Q