Exemplo n.º 1
0
        public void updateClan(Clan c)
        {
            foreach (ClanUser cu in c.getUserList())
            {
                Player p = cu.getClanMember();

                if (p != null)
                {
                    p.getPackets().updateClan(c);
                }
            }
        }
Exemplo n.º 2
0
        public void newClanMessage(Clan c, ChatMessage m)
        {
            Player p = m.getPlayer();

            if (!c.getClanOwner().Equals(p.getLoginDetails().getUsername()))
            {
                if (c.getTalkRights() != Clan.ClanRank.NO_RANK)
                {
                    if (c.getTalkRights() == 0)
                    {
                        if (!c.isFriendOfOwner(p) && !c.userHasRank(p.getLoginDetails().getUsername()))
                        {
                            p.getPackets().sendMessage("You do not have a high enough rank to talk in this clan chat.");
                            return;
                        }
                    }
                    else
                    {
                        foreach (KeyValuePair <string, Clan.ClanRank> u in c.getUsersWithRank())
                        {
                            if (u.Key.Equals(p.getLoginDetails().getUsername()))
                            {
                                if (u.Value < c.getTalkRights())
                                {
                                    p.getPackets().sendMessage("You do not have a high enough rank to talk in this clan chat.");
                                    return;
                                }
                            }
                        }
                    }
                }
            }

            //Send the clan chat message to all clan members.
            foreach (ClanUser cu in c.getUserList())
            {
                p = cu.getClanMember();
                if (p != null)
                {
                    p.getPackets().newClanMessage(c, m);
                }
            }
        }