forked from MagicBane/Server
MagicBot
8 months ago
3 changed files with 49 additions and 25 deletions
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
package engine.net.client.handlers; |
||||
|
||||
import engine.exception.MsgSendException; |
||||
import engine.net.client.ClientConnection; |
||||
import engine.net.client.msg.ClientNetMsg; |
||||
import engine.net.client.msg.ErrorPopupMsg; |
||||
import engine.net.client.msg.WhoRequestMsg; |
||||
import engine.net.client.msg.WhoResponseMsg; |
||||
import engine.objects.PlayerCharacter; |
||||
|
||||
public class WhoRequestMsgHandler extends AbstractClientMsgHandler { |
||||
|
||||
public WhoRequestMsgHandler() { |
||||
super(WhoRequestMsg.class); |
||||
} |
||||
|
||||
@Override |
||||
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException { |
||||
|
||||
|
||||
WhoRequestMsg msg = (WhoRequestMsg) baseMsg; |
||||
|
||||
// Handle /who request
|
||||
PlayerCharacter player = origin.getPlayerCharacter(); |
||||
|
||||
if (player == null) |
||||
return true; |
||||
|
||||
if (player.getTimeStamp("WHO") > System.currentTimeMillis()) { |
||||
ErrorPopupMsg.sendErrorMsg(player, "Who too fast! Please wait 3 seconds."); |
||||
return true; |
||||
} |
||||
|
||||
WhoResponseMsg.HandleResponse(msg.getSet(), msg.getFilterType(), msg.getFilter(), origin); |
||||
player.getTimestamps().put("WHO", System.currentTimeMillis() + 3000); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue