tempBan display message

ESC

Newbie Spellweaver
Joined
Jul 3, 2012
Messages
87
Reaction score
6
If player has been temp banned and trying to log-in, he will get a message which tells him when
the ban will over, wanted to know how can i display that message?
I made that check (MapleClient>Login method):
long tempBan = rs.getLong("tempban");
if (tempBan == 0) { //0000-00-00
loginok = X;
}
which type displays the temp ban message? and how can i use it? or maybe it doesnt work that way ?
 
Use broadcastmessage. Idk if it's still called that, but you can go to dropMessage in MapleCharacter and trace it back to CWvsContext or MaplePacketCreator to find out how to use it.
The ID would be 1, the string is up to you.
That won't work because the log-in method need to return int (loginOk) to send the current message by using the packet sendLoginFailed(int), and using a dropMessage won't return any type..
Also, im not sure that we can use that function in the client itself
 
Upvote 0
That won't work because the log-in method need to return int (loginOk) to send the current message by using the packet sendLoginFailed(int), and using a dropMessage won't return any type..
Also, im not sure that we can use that function in the client itself

Then post at the end to do somethign if loginok = tempbanvalue?
 
Upvote 0
Without an unpacked client the message itself cannot be altered, however the timestamp and reason may be altered. Check this Loginpacket method:
PHP:
public static final byte[] getTempBan(long timestampTill, byte reason) {
/* 123 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(17);
/*     */ 
/* 128 */     mplew.writeShort(SendPacketOpcode.LOGIN_STATUS.getValue());
/* 129 */     mplew.write(2);
/* 130 */     mplew.write(0);
/* 131 */     mplew.writeInt(0);
/* 132 */     mplew.write(reason);
/* 133 */     mplew.writeLong(timestampTill);
/*     */ 
/* 135 */     return mplew.getPacket();
/*     */   }

Do note that the reason is a byte.
 
Upvote 0
Then post at the end to do somethign if loginok = tempbanvalue?
Doesnt work, maybe did it wrong?
LoginPasswordHandler:
if (loginok < 9999) {
if (loginok != 0) {
c.getSession().write(MaplePacketCreator.getLoginFailed(loginok));
return;
}
} else
c.getPlayer().dropMessage(1, "text");
c.getSession().write(MaplePacketCreator.enableActions());
MapleClient:
long tempBan = rs.getLong("tempban");
if (tempBan != 0) {
loginok = 9999;

Without an unpacked client the message itself cannot be altered, however the timestamp and reason may be altered. Check this Loginpacket method:
PHP:
public static final byte[] getTempBan(long timestampTill, byte reason) {
/* 123 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(17);
/*     */ 
/* 128 */     mplew.writeShort(SendPacketOpcode.LOGIN_STATUS.getValue());
/* 129 */     mplew.write(2);
/* 130 */     mplew.write(0);
/* 131 */     mplew.writeInt(0);
/* 132 */     mplew.write(reason);
/* 133 */     mplew.writeLong(timestampTill);
/*     */ 
/* 135 */     return mplew.getPacket();
/*     */   }

Do note that the reason is a byte.
I dont know how to use packets, can you help me understand how it works?
 
Upvote 0
Don't use getPlayer.
What player is it supposed to get?
Lol didnt even notice that i wrote getPlayer !
In order to use "c.dropMessage()" i need to make a method (in MapleClient) that connects to the dropMessage in MapleCharacter,
but how can i do that?
Whats the problem with the next code?
public String dropMessage(int type, String message) {
return chr.dropMessage(type, message);
}
Thnx for the help,
and sorry for messing things up, im trying to learn java

Edit:
nvm, ill just use this in LoginPasswordHandler:
client.getSession().write(MaplePacketCreator.serverNotice(type, message));
Ill re-post here if it wont work
 
Last edited:
Upvote 0
Back