123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html><head><title>Python: mudsys</title>
- </head><body bgcolor="#f0f0f8">
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
- <tr bgcolor="#7799ee">
- <td valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>mudsys</strong></big></big></font></td
- ><td align=right valign=bottom
- ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br>(built-in)</font></td></tr></table>
- <p><tt>The mudsys module, for all MUD system utils.</tt></p>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#eeaa77">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
-
- <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
- <td width="100%"><dl><dt><a name="-account_creating"><strong>account_creating</strong></a>(...)</dt><dd><tt><a href="#-account_creating">account_creating</a>(name)<br>
- <br>
- returns whether an account with the name is creating.</tt></dd></dl>
- <dl><dt><a name="-account_exists"><strong>account_exists</strong></a>(...)</dt><dd><tt><a href="#-account_exists">account_exists</a>(name)<br>
- <br>
- Returns whether an account with the name exists.</tt></dd></dl>
- <dl><dt><a name="-add_acct_method"><strong>add_acct_method</strong></a>(...)</dt><dd><tt><a href="#-add_acct_method">add_acct_method</a>(name, method)<br>
- <br>
- Adds a function or property to the Account class.</tt></dd></dl>
- <dl><dt><a name="-add_char_method"><strong>add_char_method</strong></a>(...)</dt><dd><tt>Same as add_acct_method for characters.</tt></dd></dl>
- <dl><dt><a name="-add_cmd"><strong>add_cmd</strong></a>(...)</dt><dd><tt><a href="#-add_cmd">add_cmd</a>(name, shorthand, cmd_func, user_group, interrupts_action)<br>
- <br>
- Add a new command to the master command table. If a preferred shorthand<br>
- exists, e.g., 'n' for 'north', it can be specified. Otherwise, shorthand<br>
- should be None. Command functions take three arguments: a character<br>
- issuing the command, the command name, and a string argument supplied<br>
- to the command. Commands must be tied to a specific user group, and they<br>
- can optionally interupt character actions.</tt></dd></dl>
- <dl><dt><a name="-add_cmd_check"><strong>add_cmd_check</strong></a>(...)</dt><dd><tt><a href="#-add_cmd_check">add_cmd_check</a>(name, check_func)<br>
- <br>
- Add a new command check to a registered command. Check functions take<br>
- two arguments: the character issuing the command, and the command name.<br>
- If a check fails, it should return False and send the character a<br>
- message why.</tt></dd></dl>
- <dl><dt><a name="-add_exit_method"><strong>add_exit_method</strong></a>(...)</dt><dd><tt>Same as add_acct_method for exits.</tt></dd></dl>
- <dl><dt><a name="-add_help"><strong>add_help</strong></a>(...)</dt><dd><tt><a href="#-add_help">add_help</a>(keywords, info, user_groups='', related='')<br>
- <br>
- Add a new, non-persistent helpfile to the mud's help database.</tt></dd></dl>
- <dl><dt><a name="-add_obj_method"><strong>add_obj_method</strong></a>(...)</dt><dd><tt>Same as add_acct_method for objects.</tt></dd></dl>
- <dl><dt><a name="-add_room_method"><strong>add_room_method</strong></a>(...)</dt><dd><tt>Same as add_acct_method for rooms.</tt></dd></dl>
- <dl><dt><a name="-add_sock_method"><strong>add_sock_method</strong></a>(...)</dt><dd><tt>Same as add_acct_method for sockets.</tt></dd></dl>
- <dl><dt><a name="-add_worn_type"><strong>add_worn_type</strong></a>(...)</dt><dd><tt><a href="#-add_worn_type">add_worn_type</a>(type, postypes)<br>
- <br>
- Register a new type of worn item. Postypes is a comma-separated list of<br>
- body position types this object must be equipped to e.g., <br>
- shirt : torso, arm, arm.</tt></dd></dl>
- <dl><dt><a name="-attach_account_socket"><strong>attach_account_socket</strong></a>(...)</dt><dd><tt><a href="#-attach_account_socket">attach_account_socket</a>(acct, sock)<br>
- <br>
- Link a loaded account to a connected socket.</tt></dd></dl>
- <dl><dt><a name="-attach_char_socket"><strong>attach_char_socket</strong></a>(...)</dt><dd><tt><a href="#-attach_char_socket">attach_char_socket</a>(ch, sock)<br>
- <br>
- Link a loaded character to a connected socket.</tt></dd></dl>
- <dl><dt><a name="-can_edit_zone"><strong>can_edit_zone</strong></a>(...)</dt><dd><tt><a href="#-can_edit_zone">can_edit_zone</a>(ch, zone)<br>
- <br>
- True or False if a character has permission to edit a zone.</tt></dd></dl>
- <dl><dt><a name="-create_account"><strong>create_account</strong></a>(...)</dt><dd><tt><a href="#-create_account">create_account</a>(acctname)<br>
- <br>
- Returns a new account by the specified name, or None if an account by.<br>
- the specified name is already registered or creating. After the accountgeneration process is complete, mudsys.<a href="#-do_register">do_register</a>(acct) must be called.</tt></dd></dl>
- <dl><dt><a name="-create_bit"><strong>create_bit</strong></a>(...)</dt><dd><tt><a href="#-create_bit">create_bit</a>(bitvector, bit)<br>
- <br>
- Creates a new bit on the specified bitvector.</tt></dd></dl>
- <dl><dt><a name="-create_bitvector"><strong>create_bitvector</strong></a>(...)</dt><dd><tt>Not yet implemented.</tt></dd></dl>
- <dl><dt><a name="-create_player"><strong>create_player</strong></a>(...)</dt><dd><tt>Same as mudsys.create_account for player characters.</tt></dd></dl>
- <dl><dt><a name="-detach_char_socket"><strong>detach_char_socket</strong></a>(...)</dt><dd><tt><a href="#-detach_char_socket">detach_char_socket</a>(ch)<br>
- <br>
- Unlink a character from its attached socket.</tt></dd></dl>
- <dl><dt><a name="-do_copyover"><strong>do_copyover</strong></a>(...)</dt><dd><tt><a href="#-do_copyover">do_copyover</a>()<br>
- <br>
- performs a copyover on the mud.</tt></dd></dl>
- <dl><dt><a name="-do_disconnect"><strong>do_disconnect</strong></a>(...)</dt><dd><tt><a href="#-do_disconnect">do_disconnect</a>(ch)<br>
- <br>
- call detach_char_socket, then close the socket.</tt></dd></dl>
- <dl><dt><a name="-do_quit"><strong>do_quit</strong></a>(...)</dt><dd><tt><a href="#-do_quit">do_quit</a>(ch)<br>
- <br>
- Extract a character from game.</tt></dd></dl>
- <dl><dt><a name="-do_register"><strong>do_register</strong></a>(...)</dt><dd><tt><a href="#-do_register">do_register</a>(char_or_account)<br>
- <br>
- Register a PC or account for the first time. Should be called after creation.</tt></dd></dl>
- <dl><dt><a name="-do_save"><strong>do_save</strong></a>(...)</dt><dd><tt><a href="#-do_save">do_save</a>(char_or_account)<br>
- <br>
- Save a character or account's information.</tt></dd></dl>
- <dl><dt><a name="-do_shutdown"><strong>do_shutdown</strong></a>(...)</dt><dd><tt><a href="#-do_shutdown">do_shutdown</a>()<br>
- <br>
- shuts the mud down.</tt></dd></dl>
- <dl><dt><a name="-get_help"><strong>get_help</strong></a>(...)</dt><dd><tt><a href="#-get_help">get_help</a>(keyword)<br>
- <br>
- Returns a tuple of a helpfile's keywords, info, user_groups, and related<br>
- or None if the helpfile does not exist.</tt></dd></dl>
- <dl><dt><a name="-get_player"><strong>get_player</strong></a>(...)</dt><dd><tt><a href="#-get_player">get_player</a>(name)<br>
- <br>
- Return a saved character of specified name, or None.</tt></dd></dl>
- <dl><dt><a name="-handle_cmd_input"><strong>handle_cmd_input</strong></a>(...)</dt><dd><tt><a href="#-handle_cmd_input">handle_cmd_input</a>(sock, cmd)<br>
- <br>
- Equivalent to char.Char.act(cmd)</tt></dd></dl>
- <dl><dt><a name="-item_add_type"><strong>item_add_type</strong></a>(...)</dt><dd><tt><a href="#-item_add_type">item_add_type</a>(name, type_data)<br>
- <br>
- Register a new item type and its data.</tt></dd></dl>
- <dl><dt><a name="-list_help"><strong>list_help</strong></a>(...)</dt><dd><tt><a href="#-list_help">list_help</a>(keyword='')<br>
- <br>
- Returns a list of helpfiles that match the specified keyword. If no<br>
- keywordi s supplied, return all helpfiles.</tt></dd></dl>
- <dl><dt><a name="-list_zone_contents"><strong>list_zone_contents</strong></a>(...)</dt><dd><tt><a href="#-list_zone_contents">list_zone_contents</a>(zone, type)<br>
- <br>
- Returns a list of the content keys of the given type, for the specified<br>
- zone.</tt></dd></dl>
- <dl><dt><a name="-load_account"><strong>load_account</strong></a>(...)</dt><dd><tt><a href="#-load_account">load_account</a>(name)<br>
- <br>
- Return a saved account of specified name, or None.</tt></dd></dl>
- <dl><dt><a name="-load_char"><strong>load_char</strong></a>(...)</dt><dd><tt>Alias for mudsys.<a href="#-get_player">get_player</a>(name).</tt></dd></dl>
- <dl><dt><a name="-next_uid"><strong>next_uid</strong></a>(...)</dt><dd><tt><a href="#-next_uid">next_uid</a>()<br>
- <br>
- Returns the next available universal identification number.</tt></dd></dl>
- <dl><dt><a name="-password_matches"><strong>password_matches</strong></a>(...)</dt><dd><tt><a href="#-password_matches">password_matches</a>(acct, psswd)<br>
- <br>
- Returns True or False if the given password matches the account's password.</tt></dd></dl>
- <dl><dt><a name="-player_creating"><strong>player_creating</strong></a>(...)</dt><dd><tt><a href="#-player_creating">player_creating</a>(name)<br>
- <br>
- returns whether a player with the name is creating.</tt></dd></dl>
- <dl><dt><a name="-player_exists"><strong>player_exists</strong></a>(...)</dt><dd><tt><a href="#-player_exists">player_exists</a>(name)<br>
- <br>
- Returns whether a player with the name exists.</tt></dd></dl>
- <dl><dt><a name="-register_char_cansee"><strong>register_char_cansee</strong></a>(...)</dt><dd><tt><a href="#-register_char_cansee">register_char_cansee</a>(check_function(observer, observee))<br>
- <br>
- Register a new check of whether one character can see another.</tt></dd></dl>
- <dl><dt><a name="-register_dflt_move_cmd"><strong>register_dflt_move_cmd</strong></a>(...)</dt><dd><tt><a href="#-register_dflt_move_cmd">register_dflt_move_cmd</a>(cmdname)<br>
- <br>
- registers a new default movement command, e.g., north</tt></dd></dl>
- <dl><dt><a name="-register_exit_cansee"><strong>register_exit_cansee</strong></a>(...)</dt><dd><tt>Same as register_char_cansee for exits.</tt></dd></dl>
- <dl><dt><a name="-register_move_check"><strong>register_move_check</strong></a>(...)</dt><dd><tt><a href="#-register_move_check">register_move_check</a>(check_func)<br>
- <br>
- Register a check to perform movement commands. See mudsys.add_cmd_check<br>
- for information about command checks.</tt></dd></dl>
- <dl><dt><a name="-register_obj_cansee"><strong>register_obj_cansee</strong></a>(...)</dt><dd><tt>Same as register_char_cansee for objects.</tt></dd></dl>
- <dl><dt><a name="-remove_cmd"><strong>remove_cmd</strong></a>(...)</dt><dd><tt><a href="#-remove_cmd">remove_cmd</a>(name)<br>
- <br>
- Removes a command from the master command table.</tt></dd></dl>
- <dl><dt><a name="-set_cmd_move"><strong>set_cmd_move</strong></a>(...)</dt><dd><tt><a href="#-set_cmd_move">set_cmd_move</a>(cmd_func)<br>
- <br>
- Register a player command for handling all default movement commands.<br>
- See mudsys.add_cmd for information about commands.</tt></dd></dl>
- <dl><dt><a name="-set_password"><strong>set_password</strong></a>(...)</dt><dd><tt><a href="#-set_password">set_password</a>(acct, passwd)<br>
- <br>
- Set an account's password.</tt></dd></dl>
- <dl><dt><a name="-show_prompt"><strong>show_prompt</strong></a>(...)</dt><dd><tt><a href="#-show_prompt">show_prompt</a>(sock)<br>
- <br>
- Display the default game prompt to the socket. Can be replaced in Python<br>
- by assigning a new function to show_prompt.</tt></dd></dl>
- <dl><dt><a name="-sys_getval"><strong>sys_getval</strong></a>(...)</dt><dd><tt><a href="#-sys_getval">sys_getval</a>(name)<br>
- <br>
- returns a value registered in the system settings.</tt></dd></dl>
- <dl><dt><a name="-sys_getvar"><strong>sys_getvar</strong></a>(...)</dt><dd><tt>Alias to mudsys.sys_getval</tt></dd></dl>
- <dl><dt><a name="-sys_setval"><strong>sys_setval</strong></a>(...)</dt><dd><tt>set_sysval(name, val)<br>
- <br>
- sets a value registered in the system settings.</tt></dd></dl>
- <dl><dt><a name="-sys_setvar"><strong>sys_setvar</strong></a>(...)</dt><dd><tt>Alias to mudsys.sys_setval</tt></dd></dl>
- <dl><dt><a name="-try_enter_game"><strong>try_enter_game</strong></a>(...)</dt><dd><tt><a href="#-try_enter_game">try_enter_game</a>(ch)<br>
- <br>
- Tries to add a character the game world.</tt></dd></dl>
- <dl><dt><a name="-world_add_type"><strong>world_add_type</strong></a>(...)</dt><dd><tt><a href="#-world_add_type">world_add_type</a>(typename, class_data)<br>
- <br>
- Registers a new type to the world database. Like, e.g., mob, obj, and<br>
- room prototypes. Assumes class has a store and setKey method. Init<br>
- method should take one optional argument: a storage set to parse the<br>
- type data from, when loaded.</tt></dd></dl>
- <dl><dt><a name="-world_get_type"><strong>world_get_type</strong></a>(...)</dt><dd><tt><a href="#-world_get_type">world_get_type</a>(typename, key)<br>
- <br>
- Returns registered entry of the specified type from the world database.<br>
- Assumes it is a python type, and not a C type. If no type exists<br>
- return None.</tt></dd></dl>
- <dl><dt><a name="-world_put_type"><strong>world_put_type</strong></a>(...)</dt><dd><tt><a href="#-world_put_type">world_put_type</a>(typename, key, data)<br>
- <br>
- Put and save an entry of the specified type to the world database.</tt></dd></dl>
- <dl><dt><a name="-world_remove_type"><strong>world_remove_type</strong></a>(...)</dt><dd><tt><a href="#-world_remove_type">world_remove_type</a>(typename, key)<br>
- <br>
- Remove and return an entry from the world database, or None.</tt></dd></dl>
- <dl><dt><a name="-world_save_type"><strong>world_save_type</strong></a>(...)</dt><dd><tt><a href="#-world_save_type">world_save_type</a>(typename, key)<br>
- <br>
- Saves an entry in the world database if it exists.</tt></dd></dl>
- </td></tr></table>
- </body></html>
|