Esempio n. 1
0
    public void InvitedPlayerResponse(Player player, ClubInviteResponse inviteResponse)
    {
        if (!Members.Any(x => x.Player.CharacterId == player.CharacterId))
        {
            return;
        }

        ClubMember member = player.ClubMembers.FirstOrDefault(x => x.ClubId == Id);

        member.InviteResponse = inviteResponse;

        if (inviteResponse == ClubInviteResponse.Reject)
        {
            List <GameSession> memberSessions = GetSessions();
            foreach (GameSession session in memberSessions)
            {
                session.Send(ClubPacket.ClubProposalInviteResponse(Id, inviteResponse, player.Name));
                session.Send(ClubPacket.DeleteUnestablishedClub(Id));
                ClubMember membership = session.Player.ClubMembers.First(x => x.ClubId == Id);
                session.Player.ClubMembers.Remove(membership);
                session.Player.Clubs.Remove(this);
            }

            GameServer.ClubManager.RemoveClub(this);
            return;
        }
        EstablishClub(player);
    }