You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: BubbleTransport/BubbleTransport.cs
+22-10Lines changed: 22 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,8 @@ public MessageBuffer(ArraySegment<byte> data, int channelId, int connId)
97
97
boolconnected=false;
98
98
99
99
boolneedToDisconnectFlag=false;
100
+
//Check if it was the transport that started the game
101
+
staticboolstartFlag=false;
100
102
101
103
/* Structure of the transport
102
104
@@ -159,8 +161,20 @@ public override bool Available()
159
161
160
162
//~~~~~~~~~~ These two functions are all sorted out by game center, and these should not be called by anything other than the transport, if you want to start a game use FindMatch(); ~~~~~~~~~~
161
163
162
-
publicoverridevoidServerStart(){}
163
-
publicoverridevoidClientConnect(stringaddress){}
164
+
publicoverridevoidServerStart()
165
+
{
166
+
if(startFlag)
167
+
startFlag=false;
168
+
else
169
+
Debug.LogError("BubbleTransport | Don't call ServerStart() as matchmaking is random, call FindMatch() instead :D");
170
+
}
171
+
publicoverridevoidClientConnect(stringaddress)
172
+
{
173
+
if(startFlag)
174
+
startFlag=false;
175
+
else
176
+
Debug.LogError("BubbleTransport | Don't call ClientConnect() as matchmaking is random, call FindMatch() instead :D");
0 commit comments