/**
 * <p>
 * Copyright © 2009-2010, Bruce-Robert Pocock
 * </p>
 * <p>
 * This program 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.
 * </p>
 * <p>
 * This program 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.
 * </p>
 * <p>
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 * </p>
 * 
 * @author brpocock
 */

package org.starhope.appius.via;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

import org.json.JSONException;
import org.json.JSONObject;
import org.starhope.appius.except.GameLogicException;
import org.starhope.appius.except.NotFoundException;
import org.starhope.appius.except.PrivilegeRequiredException;
import org.starhope.appius.except.UserDeadException;
import org.starhope.appius.game.*;
import org.starhope.appius.game.inventory.ClothingItem;
import org.starhope.appius.game.inventory.HomeDecorItem;
import org.starhope.appius.game.inventory.InventoryItem;
import org.starhope.appius.types.AbstractZone;
import org.starhope.appius.types.Colour;
import org.starhope.appius.types.RoomAndZone;
import org.starhope.appius.user.AbstractUser;
import org.starhope.appius.user.AvatarClass;

/**
 * 
 * TODO: The documentation for this type (RemoteUser) is incomplete.
 * (brpocock, Nov 5, 2009)
 * 
 * @author brpocock
 * 
 */
public class RemoteUser implements AbstractUser,
ViaMunita <AbstractUser> {

	/**
	 * TODO: document this field (brpocock, Nov 5, 2009)
	 * 
	 * serialVersionUID (long)
	 */
	private static final long serialVersionUID = 598368859513291706L;
	/**
	 * WRITEME: document this field (brpocock, Jan 13, 2010) id
	 * (RemoteUser)
	 */
	private final int id;
	/**
	 * WRITEME: document this field (brpocock, Jan 13, 2010) viaHostname
	 * (RemoteUser)
	 */
	private final String viaHostname;
	/**
	 * WRITEME: document this field (brpocock, Jan 13, 2010) viaPort
	 * (RemoteUser)
	 */
	private final int viaPort;

	/**
	 * WRITEME
	 * 
	 * @param host remote hostname or address
	 * @param port remote server port number
	 * @param userID user ID number
	 * @throws DoNotCrossTheRubicon if the remote object can't be
	 *             fetched
	 */
	public RemoteUser (final String host, final int port,
			final int userID) throws DoNotCrossTheRubicon {
		viaHostname = host;
		viaPort = port;
		id = userID;
		Via.connect (this);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#acceptAdminMessage(org.starhope.appius.game.AbstractRoom,
	 *      java.lang.String)
	 */
	public void acceptAdminMessage (final AbstractRoom room,
			final String string) {
		Via.rpc (this, "acceptAdminMessage", room, string);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#acceptAdminMessage(java.lang.Integer,
	 *      java.lang.String)
	 */
	public void acceptAdminMessage (final Integer room,
			final String string) {
		Via.rpc (this, "acceptAdminMessage", room, string);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#acceptAdminMessage(java.lang.String,
	 *      java.lang.String, java.lang.String)
	 */
	public void acceptAdminMessage (final String content,
			final String title, final String label) {
		Via.rpc (this, "acceptAdminMessage", content, title, label);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#acceptErrorReply(java.lang.String,
	 *      java.lang.String, org.json.JSONObject,
	 *      org.starhope.appius.game.AbstractRoom)
	 */
	public void acceptErrorReply (final String command,
			final String error, final JSONObject result,
			final AbstractRoom userCurrentRoomInZone) {
		Via.rpc (this, "acceptErrorReply", command, error, result,
				userCurrentRoomInZone);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.game.RoomListener#acceptGameAction(org.starhope.appius.user.AbstractUser,
	 *      org.json.JSONObject)
	 */
	public void acceptGameAction (final AbstractUser u,
			final JSONObject action) {
		Via.rpc (this, "acceptGameAction", u, action);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.game.RoomListener#acceptGameStateChange(org.starhope.appius.game.GameEvent,
	 *      org.starhope.appius.game.GameStateFlag)
	 */
	public void acceptGameStateChange (final GameEvent gameCode,
			final GameStateFlag gameState) {
		Via.rpc (this, "acceptGameStateChange", gameCode, gameState);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#acceptMessage(java.lang.String,
	 *      java.lang.String, java.lang.String)
	 */
	public void acceptMessage (final String string,
			final String string2, final String string3) {
		Via.rpc (this, "acceptMessage", string, string2, string3);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.game.RoomListener#acceptObjectJoinRoom(org.starhope.appius.game.AbstractRoom,
	 *      org.starhope.appius.game.RoomListener)
	 */
	public void acceptObjectJoinRoom (final AbstractRoom room,
			final RoomListener object) {
		Via.rpc (this, "acceptObjectJoinRoom", room, object);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.game.RoomListener#acceptObjectPartRoom(org.starhope.appius.game.AbstractRoom,
	 *      org.starhope.appius.game.RoomListener)
	 */
	public void acceptObjectPartRoom (final AbstractRoom room,
			final RoomListener thing) {
		Via.rpc (this, "acceptObjectPartRoom", room, thing);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.game.RoomListener#acceptOutOfBandMessage(org.starhope.appius.user.AbstractUser,
	 *      org.starhope.appius.game.AbstractRoom, org.json.JSONObject)
	 */
	public void acceptOutOfBandMessage (final AbstractUser sender,
			final AbstractRoom room, final JSONObject body) {
		Via.rpc (this, "acceptOutOfBandMessage", sender, room, body);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.game.RoomListener#acceptPublicMessage(org.starhope.appius.user.AbstractUser,
	 *      org.starhope.appius.game.AbstractRoom, java.lang.String)
	 */
	public void acceptPublicMessage (final AbstractUser sender,
			final AbstractRoom room, final String message) {
		Via.rpc (this, "acceptPublicMessage", sender, room, message);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.game.RoomListener#acceptPublicMessage(org.starhope.appius.user.AbstractUser,
	 *      java.lang.String)
	 */
	public void acceptPublicMessage (final AbstractUser from,
			final String message) {
		Via.rpc (this, "acceptPublicMessage", from, message);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#acceptSuccessReply(org.starhope.appius.types.AbstractZone,
	 *      org.starhope.appius.game.AbstractRoom, java.lang.String,
	 *      org.json.JSONObject)
	 */
	@Deprecated
	public void acceptSuccessReply (final AbstractZone zone,
			final AbstractRoom room, final String command,
			final JSONObject jsonData) {
		Via.rpc (this, "acceptSuccessReply", zone, room, command,
				jsonData);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#acceptSuccessReply(java.lang.String,
	 *      org.json.JSONObject, org.starhope.appius.game.AbstractRoom)
	 */
	public void acceptSuccessReply (final String command,
			final JSONObject jsonData, final AbstractRoom room) {
		Via.rpc (this, "acceptSuccessReply", command, jsonData, room);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#addBuddy(org.starhope.appius.user.AbstractUser)
	 */
	public void addBuddy (final AbstractUser buddy) {
		Via.rpc (this, "addBuddy", buddy);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#addGiftSubscription(int,
	 *      int)
	 */
	public void addGiftSubscription (final int i, final int days) {
		Via.rpc (this, "addGiftSubscription", i, days);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#addItem(int)
	 */
	public void addItem (final int parseInt) {
		Via.rpc (this, "addItem", parseInt);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#assertStaffLevel(int)
	 */
	public void assertStaffLevel (final int staffLevelStaffMember)
	throws PrivilegeRequiredException {
		Via.rpc (this, "assertStaffLevel", staffLevelStaffMember);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#attend(org.starhope.appius.user.AbstractUser)
	 */
	public void attend (final AbstractUser byLogin) {
		Via.rpc (this, "attend", byLogin);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#ban(org.starhope.appius.user.AbstractUser,
	 *      java.lang.String)
	 */
	public void ban (final AbstractUser u, final String banReason)
	throws PrivilegeRequiredException {
		Via.rpc (this, "ban", u, banReason);
	}

	/**
	 * This is an overriding method.
	 *
	 * @see org.starhope.appius.user.AbstractUser#cancelEvent(int)
	 */
	@Override
	public void cancelEvent (final int eventID) {
		Via.rpc(this,"cancelEvent", eventID);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#canTalk()
	 */
	public boolean canTalk () {
		return ((Boolean) Via.rpc (this, "canTalk")).booleanValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#doffClothes()
	 */
	public void doffClothes () {
		Via.rpc (this, "doffClothes");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#doTransport()
	 */
	public void doTransport () {
		Via.rpc (this, "doTransport");
	}

	/**
	 * This is an overriding method.
	 *
	 * @see org.starhope.appius.user.AbstractUser#endEvent(int, java.lang.String, java.math.BigDecimal, java.lang.String)
	 */
	@Override
	public JSONObject endEvent (final int eventID, final String moniker,
			final BigDecimal score, final String medal) throws JSONException {
		return (JSONObject)Via.rpc (this, "endEvent", eventID, moniker, score, medal);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#endMultiplayerEvent(java.lang.Integer,
	 *      java.lang.String, java.lang.String, java.math.BigDecimal,
	 *      java.util.LinkedHashMap)
	 */
	public JSONObject endMultiplayerEvent (final Integer eventID,
			final String gameMoniker, final String string,
			final BigDecimal playerScoreDecimal,
			final LinkedHashMap <Integer, Integer> sortedScores)
	throws JSONException {
		return (JSONObject) Via.rpc (this, "endMultiplayerEvent",
				eventID, gameMoniker, string, playerScoreDecimal,
				sortedScores);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getActiveDecorations(int)
	 */
	@SuppressWarnings ("unchecked")
	public Collection <HomeDecorItem> getActiveDecorations (
			final int roomInHouse) throws NotFoundException {
		return (Collection <HomeDecorItem>) Via.rpc (this,
				"getActiveDecorations", roomInHouse);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getAge()
	 */
	public int getAge () {
		return ((Integer) Via.rpc (this, "getAge")).intValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getApprovedDateString()
	 */
	public String getApprovedDateString () {
		return (String) Via.rpc (this, "getApprovedDateString");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getAvatarClass()
	 */
	public AvatarClass getAvatarClass () {
		return (AvatarClass) Via.rpc (this, "getAvatarClass");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getAvatarLabel()
	 */
	public String getAvatarLabel () {
		return (String) Via.rpc (this, "getAvatarLabel");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getBuddyListNames()
	 */
	@SuppressWarnings ("unchecked")
	public Collection <String> getBuddyListNames () {
		return (Collection <String>) Via
		.rpc (this, "getBuddyListNames");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getDialect()
	 */
	public String getDialect () {
		return (String) Via.rpc (this, "getDialect");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getDisplayName()
	 */
	public String getDisplayName () {
		return (String) Via.rpc (this, "getDisplayName");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getFacing()
	 */
	public String getFacing () {
		return (String) Via.rpc (this, "getFacing");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getFurnitureBySlot(int)
	 */
	public HomeDecorItem getFurnitureBySlot (final int int1)
	throws NotFoundException {
		return (HomeDecorItem) Via.rpc (this, "getFurnitureBySlot",
				int1);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getIPAddress()
	 */
	public String getIPAddress () {
		return (String) Via.rpc (this, "getIPAddress");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getItemsByType(java.lang.String)
	 */
	@SuppressWarnings ("unchecked")
	public Collection <InventoryItem> getItemsByType (
			final String typeString) {
		return (Collection <InventoryItem>) Via.rpc (this,
				"getItemsByType", typeString);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getKickedByUserID()
	 */
	public int getKickedByUserID () {
		return ((Integer) Via.rpc (this, "getKickedByUserID"))
		.intValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getKickedMessage()
	 */
	public String getKickedMessage () {
		return (String) Via.rpc (this, "getKickedMessage");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getKickedReasonCode()
	 */
	public String getKickedReasonCode () {
		return (String) Via.rpc (this, "getKickedReasonCode");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getKickedUntil()
	 */
	public Timestamp getKickedUntil () {
		return (Timestamp) Via.rpc (this, "getKickedUntil");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getLanguage()
	 */
	public String getLanguage () {
		return (String) Via.rpc (this, "getLanguage");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.game.RoomListener#getLocation()
	 */
	public RoomAndZone getLocation () {
		return (RoomAndZone) Via.rpc (this, "getLocation");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getMail()
	 */
	public String getMail () {
		return (String) Via.rpc (this, "getMail");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getNameApprovedAt()
	 */
	public Date getNameApprovedAt () {
		return (Date) Via.rpc (this, "getNameApprovedAt");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getNameRequestedAt()
	 */
	public Date getNameRequestedAt () {
		return (Date) Via.rpc (this, "getNameRequestedAt");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getPublicInfo()
	 */
	public JSONObject getPublicInfo () {
		return (JSONObject) Via.rpc (this, "getPublicInfo");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getRegisteredDateString()
	 */
	public String getRegisteredDateString () {
		return (String) Via.rpc (this, "getRegisteredDateString");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getResponsibleMail()
	 */
	public String getResponsibleMail () {
		return (String) Via.rpc (this, "getResponsibleMail");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.game.RoomListener#getRoom()
	 */
	public AbstractRoom getRoom () {
		return (AbstractRoom) Via.rpc (this, "getRoom");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getRoomNumber()
	 */
	public int getRoomNumber () {
		return ((Integer) Via.rpc (this, "getRoomNumber")).intValue ();
	}

	/**
	 * Always returns null.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getServerThread()
	 */
	public AppiusClaudiusCaecus getServerThread () {
		return null;
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getStaffLevel()
	 */
	public int getStaffLevel () {
		return ((Integer) Via.rpc (this, "getStaffLevel")).intValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getTargetX()
	 */
	public double getTargetX () {
		return ((Double) Via.rpc (this, "getTargetX")).doubleValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getTargetY()
	 */
	public double getTargetY () {
		return ((Double) Via.rpc (this, "getTargetY")).doubleValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getTravelRate()
	 */
	public double getTravelRate () {
		return ((Double) Via.rpc (this, "getTravelRate"))
		.doubleValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getTravelStart()
	 */
	public long getTravelStart () {
		return ((Long) Via.rpc (this, "getTravelStart")).longValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getUserID()
	 */
	public int getUserID () {
		return id;
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getUserVariables()
	 */
	@SuppressWarnings ("unchecked")
	public Map <String, String> getUserVariables () {
		return (Map <String, String>) Via
		.rpc (this, "getUserVariables");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getVariable(java.lang.String)
	 */
	public String getVariable (final String string) {
		return (String) Via.rpc (this, "getVariable", string);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.via.ViaMunita#getViaAppiaHostname()
	 */
	public String getViaAppiaHostname () {
		return viaHostname;
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.via.ViaMunita#getViaAppiaRemoteEndpointID()
	 */
	public String getViaAppiaRemoteEndpointID () {
		return "User/" + id;
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.via.ViaMunita#getViaAppiaServerPort()
	 */
	public int getViaAppiaServerPort () {
		return viaPort;
	}

	/**
	 * @see org.starhope.appius.via.ViaMunita#getViaPeerClass()
	 */
	public Class <AbstractUser> getViaPeerClass () {
		return AbstractUser.class;
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getX()
	 */
	public double getX () {
		return ((Double) Via.rpc (this, "getX")).doubleValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#getY()
	 */
	public double getY () {
		return ((Double) Via.rpc (this, "getY")).doubleValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.game.RoomListener#getZone()
	 */
	public AbstractZone getZone () {
		return (AbstractZone) Via.rpc (this, "getZone");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#hasStaffLevel(int)
	 */
	public boolean hasStaffLevel (final int i) {
		return ((Boolean) Via.rpc (this, "hasStaffLevel", i))
		.booleanValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#hasVariable(java.lang.String)
	 */
	public boolean hasVariable (final String string) {
		return ((Boolean) Via.rpc (this, "hasVariable", string))
		.booleanValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#ignore(org.starhope.appius.user.AbstractUser)
	 */
	public void ignore (final AbstractUser byLogin) {
		Via.rpc (this, "ignore", byLogin);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#isBanned()
	 */
	public boolean isBanned () {
		return ((Boolean) Via.rpc (this, "isBanned")).booleanValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#isCanceled()
	 */
	public boolean isCanceled () {
		return ((Boolean) Via.rpc (this, "isCanceled")).booleanValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#isKicked()
	 */
	public boolean isKicked () {
		return ((Boolean) Via.rpc (this, "isKicked")).booleanValue ();

	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#isNPC()
	 */
	public boolean isNPC () {
		return ((Boolean) Via.rpc (this, "isNPC")).booleanValue ();

	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#isOnline()
	 */
	public boolean isOnline () {
		// XXX if we have a RemoteUser instance, are they always online?
		// BRP — let's do the RPC and check our results, for now.
		final boolean online = ((Boolean) Via.rpc (this, "isOnline"))
		.booleanValue ();
		if ( !online) {
			AppiusClaudiusCaecus
			.reportBug ("RemoteUser exists for offline user");
		}
		return online;
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#isPaidMember()
	 */
	public boolean isPaidMember () {
		return ((Boolean) Via.rpc (this, "isPaidMember"))
		.booleanValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#kick(org.starhope.appius.user.AbstractUser,
	 *      java.lang.String, int)
	 */
	public void kick (final AbstractUser u, final String kickReason,
			final int duration) throws PrivilegeRequiredException {
		Via.rpc (this, "kick", u, kickReason, duration);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#liftBan(AbstractUser
	 *      u)
	 */
	public void liftBan (final AbstractUser u)
	throws PrivilegeRequiredException {
		Via.rpc (this, "liftBan", u);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#notifyFurnitureInventory(org.starhope.appius.game.AbstractRoom)
	 */
	public void notifyFurnitureInventory (final AbstractRoom room) {
		Via.rpc (this, "notifyFurnitureInventory", room);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#removeBuddy(org.starhope.appius.user.AbstractUser)
	 */
	public void removeBuddy (final AbstractUser byLogin) {
		Via.rpc (this, "removeBuddy", byLogin);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#reportedToModeratorBy(org.starhope.appius.user.AbstractUser)
	 */
	public void reportedToModeratorBy (final AbstractUser u) {
		Via.rpc (this, "reportedToModeratorBy", u);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#sendEarnings(org.starhope.appius.game.AbstractRoom,
	 *      java.lang.String)
	 */
	public void sendEarnings (final AbstractRoom room,
			final String string) {
		Via.rpc (this, "sendEarnings", room, string);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#sendMigrate(org.starhope.appius.types.AbstractZone)
	 */
	public void sendMigrate (final AbstractZone refugeeZone)
	throws UserDeadException {
		Via.rpc (this, "sendMigrate", refugeeZone);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#sendOops()
	 */
	public void sendOops () {
		Via.rpc (this, "sendOops");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#sendResponse(org.json.JSONObject)
	 */
	public void sendResponse (final JSONObject result) {
		Via.rpc (this, "sendResponse", result);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#sendUserLists()
	 */
	public void sendUserLists () {
		Via.rpc (this, "sendUserLists");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#sendWardrobe()
	 */
	public void sendWardrobe () {
		Via.rpc (this, "sendWardrobe");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setAgeGroupToSystem()
	 */
	public void setAgeGroupToSystem () {
		Via.rpc (this, "setAgeGroupToSystem");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setBaseColor(org.starhope.appius.types.Colour)
	 */
	public void setBaseColor (final Colour colour) {
		Via.rpc (this, "setBaseColor", colour);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setCanTalk(boolean)
	 */
	public void setCanTalk (final boolean b) {
		Via.rpc (this, "setCanTalk", b);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setExtraColor(org.starhope.appius.types.Colour)
	 */
	public void setExtraColor (final Colour colour) {
		Via.rpc (this, "setExtraColor", colour);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setLastActive()
	 */
	public void setLastActive () {
		Via.rpc (this, "setLastActive");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setMail(java.lang.String)
	 */
	public void setMail (final String email) throws GameLogicException {
		Via.rpc (this, "setMail", email);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setRoom(org.starhope.appius.game.AbstractRoom)
	 */
	public int setRoom (final AbstractRoom room) {
		return ((Integer) Via.rpc (this, "setRoom", room)).intValue ();
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setStartT(long)
	 */
	public void setStartT (final long when) {
		Via.rpc (this, "setStartT", when);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setStructure(org.starhope.appius.game.inventory.HomeDecorItem)
	 */
	public void setStructure (final HomeDecorItem item) {
		Via.rpc (this, "setStructure", item);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setTravelRate(double)
	 */
	public void setTravelRate (final double rate) {
		Via.rpc (this, "setTravelRate", rate);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setVariable(java.lang.String,
	 *      java.lang.String)
	 */
	public void setVariable (final String varName, final String varValue) {
		Via.rpc (this, "setVariable", varName, varValue);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setX(double)
	 */
	public void setX (final double x2) {
		Via.rpc (this,"setX",x2);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#setY(double)
	 */
	public void setY (final double y2) {
		Via.rpc (this, "setY", y2);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#speak(org.starhope.appius.game.AbstractRoom,
	 *      java.lang.String)
	 */
	public void speak (final AbstractRoom room, final String string) {
		Via.rpc (this, "speak", room, string);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#startEvent(java.lang.String)
	 */
	public JSONObject startEvent (final String gameMoniker) {
		return (JSONObject) Via.rpc (this, "startEvent", gameMoniker);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#toJSON()
	 */
	public JSONObject toJSON () {
		return (JSONObject) Via.rpc (this, "toJSON");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#toSFSXML()
	 */
	public String toSFSXML () {
		return (String) Via.rpc (this, "toSFSXML");
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#wear(org.starhope.appius.game.inventory.ClothingItem)
	 */
	public void wear (final ClothingItem asClothing) {
		Via.rpc (this, "wear", asClothing);
	}

	/**
	 * This is an overriding method.
	 * 
	 * @see org.starhope.appius.user.AbstractUser#wear(org.starhope.appius.game.inventory.ClothingItem,
	 *      org.starhope.appius.types.Colour)
	 */
	public void wear (final ClothingItem asClothing, final Colour colour) {
		Via.rpc (this, "wear", asClothing, colour);
	}

}
