/*
Copyright (C) 2005 David Green <green@couchpotato.net>
All Rights Reserved.

This file is part of Aelfengard.

Aelfengard is proprietary software. You may not redistribute it without
prior written permission from the copyright holder.
*/

package server.command;

import server.Player;
import server.SyntaxException;

public class AFKCommand extends Command {

    public AFKCommand() {
        super(CommandCategory.ADMIN, "Sets you as AFK and makes you invisible to non-administrators.");
    }
    
    @Override
    public void run(Player player) throws SyntaxException {
        if (CommandProcessor.nextToken() != null) {
            throw new SyntaxException();
        }
        if (player.isAFK()) {
            player.setAFK(false);
            player.sendText(true, "You're no longer marked AFK (away from keyboard).");
        }
        else {
            player.setAFK(true);
            player.sendText(true, "You're now marked AFK (away from keyboard).");
        }
    }

    @Override
    public String[] getSyntax(Player player) {
        return new String[] { "" };
    }

}