public void Leave(Player player)
        {
            RemovePlayer(player);

            Packets.SendChatCommand(player, Player.ChatCommand.GROUPLEFT, player.FLPlayerID);

            foreach (var member in Members)
            {
                Packets.SendChatCommand(member, Player.ChatCommand.GROUPMEMBERLEFT, player.FLPlayerID);
            }
        }
        public void InviteAccepted(Player playerJoined, Player playerInviter)
        {
            Packets.SendChatCommand(playerJoined, Player.ChatCommand.GROUPJOINED, playerInviter.FLPlayerID);

            foreach (Player member in Members)
            {
                Packets.SendChatCommand(member, Player.ChatCommand.NEWGROUPMEMBER, playerJoined.FLPlayerID);

                if (member != playerInviter)
                {
                    Packets.SendChatCommand(playerJoined, Player.ChatCommand.NEWGROUPMEMBER, member.FLPlayerID);
                }
            }

            AddPlayer(playerJoined);
        }
        public void OnCharacterSelected(bool sameChar, bool firstLogin)
        {
            Packets.SendCompletePlayerList(this);

            if (sameChar || firstLogin)
            {
                Packets.SendPlayerListJoin(this, this, false);
                foreach (DPGameRunner.PlayerListItem playerListItem in DPGameRunner.Playerlist.Values)
                {
                    Packets.SendPlayerListJoin(playerListItem.Player, this, playerListItem.FlPlayerID == FLPlayerID);
                }
            }
            else
            {
                foreach (DPGameRunner.PlayerListItem playerListItem in DPGameRunner.Playerlist.Values)
                {
                    if (FLPlayerID != playerListItem.FlPlayerID)
                    {
                        Packets.SendPlayerListDepart(playerListItem.Player, this);
                    }
                    Packets.SendPlayerListJoin(playerListItem.Player, this, false);
                }
            }

            Packets.SendSetVisitedState(this);

            Packets.SendSetMissionLog(this);
            Packets.SendSetInterfaceState(this);
            SendWeaponGroup(); // dunno if position is right
            Packets.SendInitSetReputation(this);
            Packets.SendCharSelectVerified(this);
            Packets.SendMiscObjUpdate(this, MiscObjUpdateType.UNK2, 0);
            SetState(DPCInBaseState.Instance());


            if ((Runner.Server.IntroMsg != null) && firstLogin)
            {
                Packets.SendInfocardUpdate(this, 500000, "Welcome to Discovery");

                string intro = Runner.Server.IntroMsg.Replace("$$player$$", Name);
                Packets.SendInfocardUpdate(this, 500001, intro);

                Packets.SendPopupDialog(this, new FLFormatString(500000), new FLFormatString(500001),
                                        PopupDialogButtons.POPUPDIALOG_BUTTONS_CENTER_OK);
            }
        }