Esempio n. 1
0
 public void Shutdown()
 {
     if (_Peer != null)
     {
         _Peer.Disconnect();
         _Peer = null;
     }
 }
Esempio n. 2
0
 public void Launch()
 {
     if (_Peer != null)
     {
         _Peer.Disconnect();
     }
     _Peer = new Regulus.Remoting.PhotonExtension.ClientPeer(this, ExitGames.Client.Photon.ConnectionProtocol.Udp);
     _Peer.Connect(_Config.Address, _Config.Name);
     _Core = new AgentCore(_Peer);
 }
Esempio n. 3
0
            void ExitGames.Client.Photon.IPhotonPeerListener.OnStatusChanged(ExitGames.Client.Photon.StatusCode statusCode)
            {
                if (statusCode == ExitGames.Client.Photon.StatusCode.Connect)
                {
                    if (_LinkState.LinkSuccess != null)
                    {
                        _LinkState.LinkSuccess.Invoke();
                    }
                    _Core.Initial();
                }
                else if (statusCode == ExitGames.Client.Photon.StatusCode.QueueOutgoingReliableWarning)
                {
                }
                else if (statusCode == ExitGames.Client.Photon.StatusCode.QueueIncomingReliableWarning)
                {
                }
                else if (statusCode == ExitGames.Client.Photon.StatusCode.QueueOutgoingAcksWarning)
                {
                }
                else if (statusCode == ExitGames.Client.Photon.StatusCode.QueueSentWarning)
                {
                }
                else if (statusCode == ExitGames.Client.Photon.StatusCode.SendError)
                {
                }
                else
                {
                    if (_Core != null)
                    {
                        _Core.Finial();
                    }
                    if (_LinkState.LinkFail != null)
                    {
                        _LinkState.LinkFail(statusCode.ToString() + ":" + ((_Peer != null) ? _Peer.PeerState.ToString() : "peer == null"));
                    }
                    _Peer = null;
                }

                //System.Diagnostics.Debug.WriteLine(statusCode.ToString());
            }