Jump to content
Divine-X

Fixed Clanchat

Recommended Posts

I know most of the 562 developers have moved onto RE/Matrix and like 600+ servers. But this is for the people who actually use 562 Rs2hd still.

[code] public void sendClanChat(Player p2, String from, String clanName, String message) {
int id = messageCounter;
if(id > 16000000) {
id = 1;
}
byte[] bytes = new byte[256];
bytes[0] = (byte) message.length();
int len = Misc.encryptPlayerChat(bytes, 0, 1, message.length(), message.getBytes())+1;
StaticPacketBuilder spb = new StaticPacketBuilder().setId(137).setSize(Size.VariableByte);
spb.addByte((byte) 1);
spb.addString(Misc.upper(from).replaceAll("_", " "));
spb.addString(Misc.upper(from).replaceAll("_", " "));
spb.addLong(Misc.stringToLong(clanName));
spb.addShort(p2.getIndex());
spb.addByte((byte) ((id << 16) & 0xFF));
spb.addByte((byte) ((id << 8) & 0xFF));
spb.addByte((byte) ((id) & 0xFF));;
spb.addByte((byte) p2.getRights());
spb.addBytes(bytes, 0, len);
messageCounter++;
player.getSession().write(spb.toPacket());
}[/code]


Replace your sendClanChat code with the one above.

Share this post


Link to post
Share on other sites
Still the one who is working on rs2hd ;) Thanks, will take a look at it.

Share this post


Link to post
Share on other sites
Helps little newbs like me thanks

Share this post


Link to post
Share on other sites
[quote name='Exotiic']Helps little newbs like me thanks[/QUOTE]

You're welcome!

Share this post


Link to post
Share on other sites

×