@Override
	protected void onTextMessage(CharBuffer text) throws IOException {
		Message message = new Message(text.toString());
		RoboBase robo_base = RoboBase.getInstance();
		String status;
		switch (message.getCommand()) {
			case LOGIN:
				if (robo_base.login(message.getRobotName(), this)) {
					status = "ok";
				} else {
					status = "error: duplicate login";
				}
				break;
			case LOGOUT:
				robo_base.logout(message.getRobotName());
				status = "ok";
				break;
			default:
				status = "error: unsupported command";
				break;
		}
		getWsOutbound().writeTextMessage(
				CharBuffer.wrap("<message><status>" + status + "</status></message>"));
	}