* @param client the client that the string was sent by
	 * @return the original string with any name references within resolved to numbers
	 */
	public String nameref_eval(String input, Client client) {
		StringBuilder sb = new StringBuilder(input); // local, stringbuilder copy of original
		StringBuilder refString = new StringBuilder(); // where we'll store the ref. string as we find the characters

		Character ch = null; // the character we'll pull out of the input stringbuffer
		Integer refNum = 0;  // the retrieved number the ref. string refers to

		int index = 0; // current position in sb
		int begin = 0; // beginning of ref. string
		int end = 0;   // end of ref. string

		boolean check = false;   // have we found the beginning of a potential refrence
		boolean replace = false; // do we need to perform a replace operation
		boolean eval = false;    // are we ready to evaluate a complete reference

		while (sb.indexOf("$") != -1) {
			debug("Index: " + index);

			ch = sb.charAt(index); /* get a character */

			if (check) {
				if (Character.isLetter(ch)) {
					debug("" + ch);
					debug("Is a Letter!");

					refString.append(ch);

					if (index == sb.length() - 1) {
						end = index;
						check = false;
						eval = true;
					}
				}
				else {
					end = index;
					check = false;
					eval = true;
				}
			}
			else {
				if (ch == '$') {
					debug("found a nameref");

					begin = index;
					check = true;

					if (!replace) {
						replace = true;
					}
				}
			}

			if (!check && eval) {
				String reference = refString.toString();

				debug("");
				debug("Game> (argument eval) reference: " + reference);

				// try to get number from nameref table
				if (client != null) {
					if (getPlayer(client).getConfigOption("global-nameref-table")) {
						refNum = getNameRef(reference);
					}
					else {
						refNum = getPlayer(client).getNameRef(reference);
					}
				}
				else {
					refNum = getNameRef(reference);
				}

				debug("refNum: " + refNum);
				debug("DB size: " + objectDB.getSize());

				// modify string, if we got a valid reference (i.e. could be in
				// database, a NULLObject is a valid reference
				if (refNum != null && refNum < objectDB.getSize()) {
					debug("Game> (argument eval) tempI: " + refNum); // report number

					debug("");
					debug("Begin: " + begin + " End: " + end + " Original: " + sb.substring(begin, end + 1) + " Replacement: " + refNum.toString());
					debug("");

					sb.replace(begin, end + 1, refNum.toString());

					debug("BUFFER: " + sb.toString());
					debug("");
				} else { // modify string to remove potential name reference if not valid
					sb.replace(begin, end + 1, "");
				}

				// clear variables
				refString.delete(0, refString.length());
				ch = ' ';
				refNum = 0;
				index = -1;
				begin = 0;
				end = 0;

				eval = false;
			}

			index++;
		}

		if (replace) {
			debug("Game> (argument eval) result: " + sb.toString());

			// change argument to reflect replacements (trim to clear extra
			// space at end)
			return sb.toString();
		}
		else {
			return input;
		}
	}