* This file is part of Aion-Lightning
*
* Aion-Lightning is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Aion-Lightning is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
* along with Aion-Lightning.
* If not, see
*/
package admincommands;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.network.aion.serverpackets.SM_MOTION;
import com.aionemu.gameserver.network.aion.serverpackets.SM_PLAYER_INFO;
import com.aionemu.gameserver.utils.PacketSendUtility;
import com.aionemu.gameserver.utils.audit.GMService;
import com.aionemu.gameserver.utils.chathandlers.AdminCommand;
/**
* @author
*/
public class
public
}
@Override
public void execute(Player
if
PacketSendUtility.
}
if (params.length != 1) {
onFail(admin, null);
return;
}
if (params[0].toLowerCase().equals("on")) {
if (!admin.isGmMode()) {
admin.setGmMode(true);
admin.setWispable();
GMService.getInstance().onPlayerLogin(admin); // put gm into
// gmlist
GMService.getInstance().onPlayerAvailable(admin); // send
// available
// message
admin.clearKnownlist();
PacketSendUtility.sendPacket(admin, new SM_PLAYER_INFO(admin, false));
PacketSendUtility.sendPacket(admin, new SM_MOTION(admin.getObjectId(), admin.getMotions().getActiveMotions()));
admin.updateKnownlist();
PacketSendUtility.sendMessage(admin, "you are now Available and Wispable by players");
}
}
if (admin.isGmMode()) {
admin.setGmMode(false);
admin.setUnWispable();
GMService.getInstance().onPlayerLogedOut(admin); // remove gm
// into
// gmlist
GMService.getInstance().onPlayerUnavailable(admin); // send
// unavailable
// message
admin.clearKnownlist();
PacketSendUtility.
player.setCoolDownZero(true);
PacketSendUtility.sendPacket(admin, new SM_MOTION(admin.getObjectId(), admin.getMotions().getActiveMotions()));
admin.updateKnownlist();
PacketSendUtility.sendMessage(admin, "you are now Unavailable and Unwispable by players");
}
}
}
@Override
public void onFail(Player
PacketSendUtility.sendMessage(admin, syntax);