Skip to content

Commit

Permalink
Made it so the transport only starts finding a match when available
Browse files Browse the repository at this point in the history
Which I should have done earlier really
  • Loading branch information
Squaresweets authored Jun 23, 2021
1 parent 9f0e846 commit 37e476e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BubbleTransport/BubbleTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ With an Invite (https://www.youtube.com/watch?v=e-RCPvUYxr4 [Example has 3 playe
/// </summary>
public void FindMatch()
{
if (!Available()) return;
if (Mirror.NetworkManager.singleton.maxConnections > 4)
{
Debug.LogError("Real time Game Center Matches support a max of 4 players");
Expand All @@ -140,7 +141,7 @@ public void FindMatch()
public override bool Available()
{
#if UNITY_IOS
return Application.platform == RuntimePlatform.IPhonePlayer && available && new System.Version(Device.systemVersion) >= new System.Version("13.0");
return available && new System.Version(Device.systemVersion) >= new System.Version("13.0");
#else
return false;
#endif
Expand Down Expand Up @@ -168,6 +169,7 @@ public override void Shutdown()
[AOT.MonoPInvokeCallback(typeof(OnInviteRecievedDelegate))]
static void OnInviteRecieved()
{
if (!instance.Available()) return;
//An invite has been recieved, we shutdown the network and then call FindMatch
if (NetworkManager.singleton.isNetworkActive)
{
Expand Down

0 comments on commit 37e476e

Please sign in to comment.