private MyPlayerInfo RemotePlayerToInfo(MyPlayerRemote player) { return new MyPlayerInfo() { DisplayName = player.GetDisplayName().ToString(), PlayerId = player.PlayerId, UserId = player.UserId, Faction = player.Faction, }; }
private void AddPlayer(MyPlayerRemote player, bool isFaction = false) { AddPlayer(player.GetDisplayName(), (int)(player.Connection.AverageRoundtripTime * 1000), player.Statistics.Deaths, player.Statistics.PlayersKilled, (byte)player.PlayerId, player.Faction, isFaction); }
void DisplayKillNotification(MyPlayerRemote deadPlayer, byte? killerId) { MyPlayerRemote killer; if (killerId == MyEntityIdentifier.CurrentPlayerId) { Notify(Localization.MyTextsWrapperEnum.MP_YouHaveKilledX, deadPlayer.GetDisplayName()); } else if (killerId == deadPlayer.PlayerId) { // Until entity ids fixed //Notify(Localization.MyTextsWrapperEnum.MP_XKilledHimself, deadPlayer.GetDisplayName()); Notify(Localization.MyTextsWrapperEnum.MP_XKilled, deadPlayer.GetDisplayName()); } else if (killerId.HasValue && killerId != 0 && Peers.TryGetPlayer(killerId.Value, out killer)) { Notify(Localization.MyTextsWrapperEnum.MP_XHasBeenKilledByY, deadPlayer.GetDisplayName(), killer.GetDisplayName()); } else { Notify(Localization.MyTextsWrapperEnum.MP_XKilled, deadPlayer.GetDisplayName()); } }