/// <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); }
/// <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); } }
void session_GamerLeft(object sender, GamerLeftEventArgs e) { message = "Gamer " + e.Gamer.Tag + " left the session!"; }
void session_GamerLeft(object sender, GamerLeftEventArgs p) { Console.Write("Gamer Left: " + p.Gamer.Gamertag); }
public static void Session_GamerLeft(object sender, GamerLeftEventArgs args) { Console.WriteLine("Player:" + args.Gamer.Gamertag + " has left the game."); }
private void GamerLeft(object sender, GamerLeftEventArgs args) { //Console.WriteLine(args.Gamer.Gamertag + " left the game"); }
/// <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 } }
/// <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 } }
void NetworkSession_GamerLeft( object p_Sender, GamerLeftEventArgs p_Args ) { if( !p_Args.Gamer.IsLocal ) { System.Diagnostics.Debug.WriteLine( "Gamer: " + p_Args.Gamer.Gamertag + " left" ); } }
/// <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) { } }
/* 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); } }
void networkSession_GamerLeft(object sender, GamerLeftEventArgs e) { NetworkSession.Dispose(); NetworkSession = null; _currentNetworkState = NetworkState.FindSession; }
private void GamerLeft(object sender, GamerLeftEventArgs e) { }
/// <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; } } }
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); } }
public void GamerLeftEventHandler(object sender, GamerLeftEventArgs e) { OnGamerLeft(e.Gamer, GetGamerIndex(e.Gamer)); }
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")); } }
protected void GamerLeftEventHandler(object sender, GamerLeftEventArgs e) { networkErrorMessage = "No logic for GamerLeftEvent"; //Remove the player and the associated ship from game }
void SessionGamerLeftHandler(object sender, GamerLeftEventArgs e) { //throw new NotImplementedException(); }
void networkSession_GamerLeft(object sender, GamerLeftEventArgs e) { if (m_players.ContainsKey(e.Gamer)) m_players.Remove(e.Gamer); }