public override void Update(FlowNode_MultiPlayEnterLobby self) { MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance; if (!((Behaviour)self).get_enabled()) { return; } switch (instance.CurrentState) { case MyPhoton.MyState.CONNECTING: break; case MyPhoton.MyState.LOBBY: if (!instance.IsRoomListUpdated) { break; } self.Success(); break; default: if (!instance.IsDisconnected() || this.ReqConnect(self, true)) { break; } self.Failure(); break; } }
public bool ReqConnect(FlowNode_MultiPlayEnterLobby self, bool autoJoin = false) { if (this.ReqCnt++ > this.MAX_RETRY_CNT) { return(false); } MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance; DebugUtility.Log("start connect:" + GlobalVars.SelectedMultiPlayPhotonAppID); instance.ResetLastError(); return(!instance.IsDisconnected() || instance.StartConnect(GlobalVars.SelectedMultiPlayPhotonAppID, autoJoin, "1.0")); }
public void OnApplicationFocus(bool hasFocus) { MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance; if (hasFocus) { if (!Object.op_Inequality((Object)instance, (Object)null) || !instance.IsDisconnected() || !GlobalVars.VersusRoomReuse) { return; } FlowNode_TriggerLocalEvent.TriggerLocalEvent((Component)this, "RECONNECT"); } else { if (!GlobalVars.VersusRoomReuse || !instance.IsConnected()) { return; } FlowNode_TriggerLocalEvent.TriggerLocalEvent((Component)this, "REUSE_ROOM"); } }