public void updateClan(Clan c) { foreach (ClanUser cu in c.getUserList()) { Player p = cu.getClanMember(); if (p != null) { p.getPackets().updateClan(c); } } }
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); } } }
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); } }
public void updateClan(Clan c) { foreach(ClanUser cu in c.getUserList()) { Player p = cu.getClanMember(); if (p != null) p.getPackets().updateClan(c); } }
public void updateClan(Clan c) { PacketBuilder pb = new PacketBuilder(); pb.setId(55).setSize(Packet.Size.VariableShort); pb.addLong(misc.playerNameToLong(c.getClanOwner())); pb.addLong(misc.playerNameToLong(c.getClanName())); pb.addByte((byte)c.getKickRights()); pb.addByte((byte)c.getUserList().Count); foreach (ClanUser list in c.getUserList()) { Player p = list.getClanMember(); pb.addLong(p.getLoginDetails().getLongName()); pb.addUShort(p.getWorld()); int rights = Convert.ToInt32(list.getClanRights()); pb.addByte((byte)rights); pb.addString("Server " + p.getWorld()); } connection.SendPacket(pb.toPacket()); }