예제 #1
0
파일: LiveSession.cs 프로젝트: rc183/igf
        /// <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
파일: Lobby.cs 프로젝트: doanhtdpl/karts
 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
파일: Network.cs 프로젝트: zzorn/Spike3D
 protected void GamerLeftEventHandler(object sender, GamerLeftEventArgs e)
 {
     networkErrorMessage = "No logic for GamerLeftEvent";
     //Remove the player and the associated ship from game
 }
예제 #21
0
파일: LTO.cs 프로젝트: rdgoetz/LessThanOk
 void SessionGamerLeftHandler(object sender, GamerLeftEventArgs e)
 {
     //throw new NotImplementedException();
 }
예제 #22
0
파일: Stage.cs 프로젝트: bigsassy/Maze-Game
 void networkSession_GamerLeft(object sender, GamerLeftEventArgs e)
 {
     if (m_players.ContainsKey(e.Gamer))
         m_players.Remove(e.Gamer);
 }