Пример #1
0
        /// <summary>
        /// Raised when a player leaves
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnLivePlayerLeft(object sender, GamerLeftEventArgs e)
        {
            IdentifiedPlayer identifiedPlayer = null;

            if (e.Gamer.IsLocal)
            {
                SignedInGamer signedInGamer = ((LocalNetworkGamer) e.Gamer).SignedInGamer;
                _localPlayers.ForEach(action =>
                                          {
                                              if (action.UniqueId == signedInGamer.Gamertag)
                                              {
                                                  identifiedPlayer = action;
                                                  _localPlayers.Remove(action);
                                                  _allPlayers.Remove(action);
                                              }
                                          });
            }
            else
            {
                _remotePlayers.ForEach(action =>
                                           {
                                               if (action.UniqueId == e.Gamer.Gamertag)
                                               {
                                                   identifiedPlayer = action;
                                                   _remotePlayers.Remove(action);
                                                   _allPlayers.Remove(action);
                                               }
                                           });
            }

            OnPlayerLeft(identifiedPlayer);
        }
Пример #2
0
 /// <summary>
 /// Handle a player leaving the game.
 /// </summary>
 void networkSession_GamerLeft(object sender, GamerLeftEventArgs e)
 {
     PlayerData playerData = e.Gamer.Tag as PlayerData;
     if ((playerData != null) && (playerData.Ship != null))
     {
         playerData.Ship.Die(null, true);
     }
 }
Пример #3
0
 void session_GamerLeft(object sender, GamerLeftEventArgs e)
 {
     message = "Gamer " + e.Gamer.Tag + " left the session!";
 }
Пример #4
0
 void session_GamerLeft(object sender, GamerLeftEventArgs p)
 {
     Console.Write("Gamer Left: " + p.Gamer.Gamertag);
 }
Пример #5
0
 public static void Session_GamerLeft(object sender, GamerLeftEventArgs args)
 {
     Console.WriteLine("Player:" + args.Gamer.Gamertag + " has left the game.");
 }
Пример #6
0
 private void GamerLeft(object sender, GamerLeftEventArgs args)
 {
     //Console.WriteLine(args.Gamer.Gamertag + " left the game");
 }
Пример #7
0
 /// <summary>
 /// Handles a player leaving.  Any entities belongong to that player must
 /// have authority transferred to another player (this is the responsiblity
 /// of the host)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void GamerLeftEventHandler(object sender, GamerLeftEventArgs e)
 {
     if (session.IsHost)
     {
         // TODO: Transfer authority for the remote player's entities
         // to another player
     }
 }
Пример #8
0
 /// <summary>
 /// Handle a player leaving the game.
 /// </summary>
 void networkSession_GamerLeft(object sender, GamerLeftEventArgs e)
 {
     PlayerData playerData = e.Gamer.Tag as PlayerData;
     if ((playerData != null) )
     {
         //TODO delete the player's units
     }
 }
Пример #9
0
        void NetworkSession_GamerLeft( object p_Sender,
			GamerLeftEventArgs p_Args )
        {
            if( !p_Args.Gamer.IsLocal )
            {
                System.Diagnostics.Debug.WriteLine( "Gamer: " +
                    p_Args.Gamer.Gamertag + " left" );
            }
        }
Пример #10
0
        /// <summary>
        /// Called when a gamer leaves the session
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void session_GamerLeft(object sender, GamerLeftEventArgs e)
        {
            if (gameState == GameState.Calibrating)
            {
                foreach (PlayerInfo player in activePlayers)
                {
                    if (player.PlayerName == e.Gamer.Gamertag)
                    {
                        Console.WriteLine(e.Gamer.Gamertag + " has left the match");
                        if (gameMode == GameMode.Network_Multiplayer)
                        {
                            lob.RemovePlayerFromLobby(e.Gamer.Gamertag);
                            activePlayers.Remove(player);
                        }
                        return;
                    }
                }
            }
            else if (gameState == GameState.In_Game)
            {

            }
        }
Пример #11
0
 /* Event handler for gamer left; forward to the game if it's listening.
  */
 void session_GamerLeft(object sender, GamerLeftEventArgs e)
 {
     Trace.WriteLine(String.Format("Gamer left: {0}", e.Gamer.Gamertag));
       joinedGamers.Remove(e.Gamer);
       if (GamerLeft != null)
       {
     gea.Gamer = e.Gamer;
     gea.Joined = false;
     GamerLeft(this, gea);
       }
 }
Пример #12
0
 void networkSession_GamerLeft(object sender, GamerLeftEventArgs e)
 {
     NetworkSession.Dispose();
     NetworkSession = null;
     _currentNetworkState = NetworkState.FindSession;
 }
Пример #13
0
 private void GamerLeft(object sender, GamerLeftEventArgs e)
 {
 }
Пример #14
0
 /// <summary>
 /// Mid-game player leaving code.
 /// </summary>
 void gameLeave(object o, GamerLeftEventArgs glea)
 {
     if (glea.Gamer.IsHost)
     {
         StateManager.ScreenState = CoreTypes.ScreenType.NetworkSelectScreen;
     }
     for (int i = 0; i < StateManager.EnemyShips.Count; i++)
     {
         BaseAllyShip sh = StateManager.EnemyShips[i] as BaseAllyShip;
         if (sh != null && sh.Controller != null && sh.Controller.Id == glea.Gamer.Id)
         {
             sh.CurrentHealth = 0;
             StateManager.EnemyShips.RemoveAt(i);
             return;
         }
     }
 }
Пример #15
0
 void CurrentSession_GamerLeft(object sender, GamerLeftEventArgs e)
 {
     if (Visible && GamerInfos.Count > 0)
     {
         GamerInfos[e.Gamer.Id].Visible = false;
         SelectedShips.Remove(e.Gamer.Id);
         bool isHost = false;
         foreach (LocalNetworkGamer lng in StateManager.NetworkData.CurrentSession.LocalGamers)
         {
             if (lng.IsHost)
             {
                 isHost = true;
             }
         }
         if (AllGamersHaveShips && isHost)
         {
             StartButton.Visible = true;
             StartLabel.Visible = true;
         }
     }
 }
        void GamerLeft(object sender, GamerLeftEventArgs e)
        {
            // Dispose of the network session, set it to null.
            // Stop the soundtrack and go
            // back to searching for sessions.
            networkSession.Dispose();
            networkSession = null;

            trackInstance.Stop();

            currentGameState = GameState.FindSession;
        }
 /// <summary>
 /// Event handler called when a gamer leaves the session.
 /// Displays a notification message.
 /// </summary>
 void GamerLeft(object sender, GamerLeftEventArgs e)
 {
     if (notifyWhenPlayersJoinOrLeave)
     {
         messageDisplay.ShowMessage(Resources.MessageGamerLeft,
                                    e.Gamer.Gamertag);
     }
 }
Пример #18
0
 public void GamerLeftEventHandler(object sender, GamerLeftEventArgs e)
 {
     OnGamerLeft(e.Gamer, GetGamerIndex(e.Gamer));
 }
Пример #19
0
 void session_GamerLeft(object sender, GamerLeftEventArgs p)
 {
     menu.RemoveAll();
     for (int i = 0; i < session.AllGamers.Count; ++i)
     {
         menu.AddComponent(new TextComponent(100, 100 * (i + 1), session.AllGamers[i].Gamertag, "KartsFont"));
     }
 }
Пример #20
0
 protected void GamerLeftEventHandler(object sender, GamerLeftEventArgs e)
 {
     networkErrorMessage = "No logic for GamerLeftEvent";
     //Remove the player and the associated ship from game
 }
Пример #21
0
 void SessionGamerLeftHandler(object sender, GamerLeftEventArgs e)
 {
     //throw new NotImplementedException();
 }
Пример #22
0
 void networkSession_GamerLeft(object sender, GamerLeftEventArgs e)
 {
     if (m_players.ContainsKey(e.Gamer))
         m_players.Remove(e.Gamer);
 }