Ejemplo n.º 1
0
        /// <summary>
        ///     Invoked when a super-peer gains control over a zone.
        /// </summary>
        /// <param name="zone">Zone that super peer gained control of.</param>
        /// <param name="superPeer">Super peer that gained control.</param>
        private void SuperPeerGainedControl(Zone zone, ZoneSuperPeer superPeer)
        {
            // Is this us thats gained control of a zone?
            if (superPeer.ClientID == m_clientID)
            {
                SuperPeer peer  = new SuperPeer(this, superPeer.ID, superPeer.ZoneID);
                peer.Initialize();

                m_superPeers.Add(peer);

                Logger.Info("Gained control of zone #{0} as SuperPeer #{0}", LoggerVerboseLevel.High, zone.ID, superPeer.ID);
            }
            
            foreach (SuperPeer peer in m_superPeers)
            {
                peer.SuperPeerGainedControl(zone, superPeer);
            }
        }
 /// <summary>
 ///     Constructs a new instance of this class.
 /// </summary>
 /// <param name="gameClient">Game client hosting this connection.</param>
 /// <param name="service">Superpeer a client is connected to..</param>
 /// <param name="connection">Connection used to communicate with the super peer.</param>
 public SuperPeerToClientConnection(GameClientService gameClient, SuperPeer superpeer, Connection connection)
 {
     m_superpeer = superpeer;
     m_connection = connection;
     m_gameClient = gameClient;
 }