This commit is contained in:
xianyi
2025-10-15 11:03:14 +08:00
parent bd63a8a006
commit f357a9c3a1
2 changed files with 92 additions and 18 deletions

View File

@@ -63,7 +63,7 @@ namespace TcgEngine.Client
match_timer += Time.deltaTime;
//Send periodic request
if (IsConnected() && timer > 2f)
if (IsConnected() && TcgNetwork.Get().ClientID != 0 && timer > 2f)
{
timer = 0f;
SendMatchRequest(true, matchmaking_group, matchmaking_players);
@@ -118,7 +118,7 @@ namespace TcgEngine.Client
{
Connect(NetworkData.Get().url, NetworkData.Get().port, (bool success) =>
{
if(success)
if (success)
SendMatchmakingListRequest();
});
}
@@ -132,10 +132,10 @@ namespace TcgEngine.Client
});
}
public void Connect(string url, ushort port, UnityAction<bool> callback=null)
public void Connect(string url, ushort port, UnityAction<bool> callback = null)
{
//Must be logged in to API to connect
if(!Authenticator.Get().IsSignedIn())
if (!Authenticator.Get().IsSignedIn())
{
callback?.Invoke(false);
return;