private void handlePublicChat(Player player, Packet packet) {
		    int colour = packet.readByte();
		    int effects  = packet.readByte();
		    byte[] packedChatData = packet.getRemainingData();
		    string unpacked = misc.textUnpack(packedChatData);
            ChatMessage message;

		    if (unpacked.StartsWith("/") && player.getClan() != null) {
                packedChatData = misc.textPack(unpacked.Substring(1));
			    message = new ChatMessage(colour, unpacked.Substring(1), effects, player, packedChatData);
			    Server.getClanManager().newClanMessage(player.getClan(), message);
			    return;
		    }
		    message = new ChatMessage(colour, unpacked, effects, player, packedChatData);
		    player.setLastChatMessage(message);
	    }
	    public void enterChannel(Player p, string owner) {
		    if (p.getClan() != null) {
			    return;
		    }
		    p.getPackets().sendMessage("Attempting to join channel...:clan:");
		    if (owner.Equals(p.getLoginDetails().getUsername())) {
			    Clan newClan = new Clan(p, owner, owner);
			    addChannel(newClan);
		    }
            Event enterChannelEvent = new Event(700);
            enterChannelEvent.setAction(() => {
				enterChannelEvent.stop();
				foreach(Clan c in clans) {
					if (c != null) {
						if (c.getClanOwner().Equals(owner)) {
							if(c.getUserList().Count >= 100) {
								p.getPackets().sendMessage("The channel is full.");
								return;
							}
							if (!owner.Equals(p.getLoginDetails().getUsername())) {
								if (c.getEnterRights() != Clan.ClanRank.NO_RANK) {
									if (c.getEnterRights() == Clan.ClanRank.FRIEND) {
										if (!c.isFriendOfOwner(p) && !c.userHasRank(p.getLoginDetails().getUsername())) {
											p.getPackets().sendMessage("You do not have a high enough rank to enter this clan chat.");
											return;
										}
									} else {
										bool canEnter = true;
										foreach (KeyValuePair<string, Clan.ClanRank> u in c.getUsersWithRank()) {
											if(u.Key.Equals(p.getLoginDetails().getUsername())) {
												if (u.Value < c.getEnterRights()) {
													canEnter = false;
													break;
												}
											}
										}
										if (!canEnter) {
											p.getPackets().sendMessage("You do not have a high enough rank to enter this clan chat.");
											return;
										}
									}
								}
							}
							c.addUser(p);
							updateClan(c);
							p.getPackets().sendMessage("Now talking in channel : " + misc.formatPlayerNameForDisplay(c.getClanName() + ":clan:"));
							p.getPackets().sendMessage("To talk, start each line of chat with the / symbol. :clan:");
							return;
						}
					}
				}
				p.getPackets().sendMessage("The channel you tried to join does not exist. :clan:");
		    });
            Server.registerEvent(enterChannelEvent);
	    }