Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Assets/Talo Game Services/Talo/Runtime/APIs/PlayersAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void InvokeIdentifiedEvent()

private async Task<Player> HandleIdentifySuccess(PlayerAlias alias, string socketToken = "")
{
if (!Talo.IsOffline())
if (!Talo.IsOffline() && Talo.Socket.IsIdentified())
{
await Talo.Socket.ResetConnection();
}
Expand Down
11 changes: 11 additions & 0 deletions Assets/Talo Game Services/Talo/Runtime/TaloSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public class TaloSocket : MonoBehaviour
private void Awake()
{
socket = gameObject.AddComponent<WebSocketConnection>();
socket.DesiredConfig = new WebSocketConfig
{
PingInterval = TimeSpan.FromSeconds(30),
PingMessage = new WebSocketMessage("v1.heartbeat")
};

socket.MessageReceived += HandleMessage;
socket.StateChanged += HandleStateChange;
}
Expand Down Expand Up @@ -139,5 +145,10 @@ public async Task ResetConnection()
await OpenConnection();
}
}

public bool IsIdentified()
{
return identified;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_PanelSettings: {fileID: 11400000, guid: c2e8d45d57e604cc78799650d215a02e, type: 2}
m_ParentUI: {fileID: 0}
sourceAsset: {fileID: 9197481963319205126, guid: d64908c7074e542a99b96c8605858371, type: 3}
sourceAsset: {fileID: 9197481963319205126, guid: 924337217d43d4ce2a336af8402ec3dc, type: 3}
m_SortingOrder: 0
m_WorldSpaceSizeMode: 1
m_WorldSpaceWidth: 1920
Expand Down
4 changes: 2 additions & 2 deletions unity.slnx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Solution>
<Project Path="asset-store-tools-editor.csproj" />
<Project Path="Talo.Runtime.csproj" />
<Project Path="Assembly-CSharp.csproj" />
<Project Path="asset-store-tools-editor.csproj" />
<Project Path="Talo.Tests.csproj" />
<Project Path="MikeSchweitzer.WebSocket.csproj" />
<Project Path="Talo.Tests.csproj" />
</Solution>