Easy fix but here..
Iron Man icons in PM. (you can change the ints 99 and 100 to whatever. I decided on 99 and 100 because if i want to add more actual ranks I won't have to skip two ints.)
EDIT: I guess 12 and 13 are already used elsewhere. Would make more sense to use those then.
Replace the method and the case. You can just add what I've changed. Rip it out yourself if you don't want to replace
Server Side
Code:
public void message(Player friend, byte[] message, int size) {
if (friend == null || message == null) {
this.player.getPacketSender().sendMessage("This player is currently offline.");
return;
}
if (friend.getRelations().status.equals(PrivateChatStatus.FRIENDS_ONLY) && !friend.getRelations().friendList.contains(player.getLongUsername()) || friend.getRelations().status.equals(PrivateChatStatus.OFF)) {
this.player.getPacketSender().sendMessage("This player is currently offline.");
return;
}
if (status == PrivateChatStatus.OFF) {
setStatus(PrivateChatStatus.FRIENDS_ONLY, true);
}
int rights = player.getRights().ordinal();
if (player.getGameMode() == GameMode.IRONMAN && rights == 0) {
rights = 99;
} else if (player.getGameMode() == GameMode.HARDCORE_IRONMAN && rights == 0) {
rights = 98;
}
friend.getPacketSender().sendPrivateMessage(player.getLongUsername(), rights, message, size);
}
Client Side
Code:
case 196:
long l5 = inStream.readQWord();
inStream.readDWord();
int playerRights = inStream.readUnsignedByte();
boolean flag5 = false;
if (playerRights <= 1) {
for (int l29 = 0; l29 < ignoreCount; l29++) {
if (ignoreListAsLongs[l29] != l5) {
continue;
}
flag5 = true;
}
}
if (!flag5) {
try {
String pMessage = TextInput.decodeToString(pktSize - 13,
inStream);
int ironMan = 0;
if (playerRights == 99 || playerRights == 100){
ironMan = playerRights - 98;
playerRights = 0;
}
if (playerRights > 0 || ironMan > 0) {
pushMessage(
pMessage,
7,
getPrefix(playerRights, ironMan)
+ TextClass.fixName(TextClass
.nameForLong(l5)));
} else {
pushMessage(pMessage, 3, TextClass.fixName(TextClass
.nameForLong(l5)));
}
} catch (Exception exception1) {
System.out.println("cde1");
}
}
opCode = -1;
return true;
EDIT:
Forgot, you will need to replace the this declaration (really only one parameter)
Code:
public PacketSender sendPrivateMessage(long name, int rights, byte[] message, int size) {