All pastes #4036 Raw Edit

Anonymous

public java v1 · immutable
#4036 ·published 2005-01-11 08:22 UTC
rendered paste body
public final static int TRADE = 8;	public final static int GM_MESSAGE = 9;	public final static int ANNOUNCEMENT = 10;        private String gobalChatState = "ON";		/**	 * packet type id 0x38	 * format:		cSd (S)	 * @param decrypt	 */	public Say2(byte[] decrypt, ClientThread client) throws IOException	{		super(decrypt);		String text = readS();		int type = readD();		String target = null;		if (type == TELL)		{			target = readS();		}				_log.fine("Say type:"+type);				L2PcInstance activeChar = client.getActiveChar();		Connection con = client.getConnection();                Properties p = new Properties();        if (p.getProperty("GlobalChat") != null)        {            gobalChatState = p.getProperty("GlobalChat");        }		CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);			if (type == TELL)		{			L2PcInstance receiver = L2World.getInstance().getPlayer(target);			if (receiver != null)			{				receiver.sendPacket(cs);				activeChar.sendPacket(cs);			}			else			{				SystemMessage sm = new SystemMessage(SystemMessage.S1_IS_NOT_ONLINE);				sm.addString(target);				activeChar.sendPacket(sm);			}		} 		else if ((type == SHOUT || type == TRADE)                &&                 (gobalChatState.equalsIgnoreCase("on") ||                        (gobalChatState.equalsIgnoreCase("gm") && activeChar.isGM())))		// For those who want Global chat to be GM only		// else if (activeChar.isGM() && (type == SHOUT || type == TRADE))		{