예제 #1
0
        //-----------------------------------------------------------------------------
        public string evUpdate(IEbEvent ev)
        {
            int before_connected_count = 0;

            for (int i = 0; i < mServerNode.ListPeerBefore.Count; i++)
            {
                PhotonServerPeerC peer = mServerNode.ListPeerBefore[i];
                //peer.Service();

                //if (peer.PeerState == PeerStateValue.Disconnected)
                //{
                //    string s = peer.RemoteServerNodeInfo.ip;
                //    s += ":";
                //    s += peer.RemoteServerNodeInfo.port.ToString();
                //    peer.Connect(s, peer.RemoteServerNodeInfo.app_name);
                //}
                //else if (peer.PeerState == PeerStateValue.Connected)
                //{
                //    before_connected_count++;
                //}
            }

            // 等待后置连接,并统计连接信息
            if (mServerNode.ListPeerBefore.Count == before_connected_count &&
                mServerNode.getServerNode().vec_after.Count == mServerNode.ListPeerAfter.Count)
            {
                return("ServerNodeStateRun");
            }

            return("");
        }
예제 #2
0
        //---------------------------------------------------------------------
        protected override ServerPeerBase CreateServerPeer(InitResponse initResponse, object state)
        {
            byte           remote_node_type = (byte)state;
            ServerPeerBase peer             = new PhotonServerPeerC(initResponse.Protocol, initResponse.PhotonPeer,
                                                                    mEntityMgr, remote_node_type, (RpcSessionListener)this);

            return(peer);
        }
예제 #3
0
        //-----------------------------------------------------------------------------
        public string evUpdate(IEbEvent ev)
        {
            for (int i = 0; i < mServerNode.ListPeerBefore.Count; i++)
            {
                PhotonServerPeerC peer = mServerNode.ListPeerBefore[i];
                //peer.Service();
            }

            return("");
        }
예제 #4
0
        //---------------------------------------------------------------------
        public override void enter()
        {
            mLog.Info("ServerNodeStateStop.enter()");

            for (int i = 0; i < mServerNode.ListPeerBefore.Count; i++)
            {
                PhotonServerPeerC peer = mServerNode.ListPeerBefore[i];
                peer.Disconnect();
                //peer.Service();
            }
        }