Core Utility Help

$player_db

Database of Players

-------------------

This is an instance of the Generic Database ($generic_db) that

holds the {name/alias,#objectid} pairs for every

name and alias of every player in the MOO.

Verbs supplied include

:find(string) => player or $ambiguous_match or $failed_match

:find_exact(string) => player or $failed_match (does not do partial matches)

:find_all(string) => list of all matching players

:insert(string,player)

records that string is now a name or alias of player

:delete(string)

removes string from the db

:available(string)

returns 1 if string is available as a player name or alias,

an object if string is in use, or 0 if string is otherwise unavailable.

:load()

resets the db, inserting all current player names and aliases.

The internal representation and all of the above verbs (except :load() and

:available()) are as described for $generic_db.

It should be noted that for any application that involves resolving a player name from a command line, you should be using $string_utils:match_player() rather than $player_db:find(), since the former will deal correctly with other ways of referring to players apart from their names and aliases (e.g., literal object numbers, "me", "$no_one"...).

:load() needs to be done periodically as it is possible for the player db

to get out of synch with reality. In particular, there is currently no way

to block someone writing his own player :recycle() verb that neglects to

remove his names from the player db.

While a :load() is in progress the .frozen property is set to 1 to indicate that any results of :find*() are not to be trusted.