mudpy.git
18 years agoImported from archive.
Jeremy Stanley [Thu, 25 Aug 2005 02:25:34 +0000 (02:25 +0000)]
Imported from archive.

* lib/menus/active: Merged into lib/menus/miscellaneous and removed.

* lib/menus/miscellaneous (choose_gender, choose_name)
(main_utility): Added menus to enter/exit the game, select gender
and pick a randomly-generated avatar name from a list.

* lib/muff/muffcmds.py: Changed user state names to employ
underscores instead of spaces.
(command_show): New admin command to ease debugging of data
relationships.
(generic_menu_handler): New function abstract out common routines
from typical menu state handlers.
(handle_user_input): For aesthetics, user input is now followed by a
blank line of output if we expect the client isn't echoing.

* lib/muff/muffmain.py (main): The main loop is now followed by a
muffiniv.universe.save during shutdown, in case any changes have
occurred since the last save.

* lib/muff/muffmenu.py
(get_menu): Refactored to be more modular, and broke out a lot of
its pieces into additional functions.
(get_choice_action, get_choice_branch, get_default_action)
(get_default_branch, get_default_menu_choice)
(get_formatted_default_menu_choice, get_formatted_menu_choices)
(get_menu_actions, get_menu_branches, get_menu_choices)
(get_menu_description, get_menu_prompt): New functions abstracted
out of the previously spaghetti-like get_menu function.
(get_echo_message, get_echo_sequence, menu_echo_on): New functions
to take care of enabling and disabling echo for password prompts.

* lib/muff/muffmisc.py (replace_macros): Implemented gender-specific
pronoun replacement macros, to make English-language messages less
awkward.

* lib/muff/muffuniv.py: New module implementing DataFile, Element
and Universe classes, for a more object-oriented approach.

* muff: Renamed to mud.py.

* muff.conf: Renamed to mudpy.conf.

18 years agoImported from archive.
Jeremy Stanley [Fri, 5 Aug 2005 15:54:48 +0000 (15:54 +0000)]
Imported from archive.

* lib/menus/login (disconnecting duplicates), lib/menus/miscellaneous
(disconnecting), lib/muff/muffcmds.py (handler_checking_password):
Messages are now colored in ANSI red.

* lib/muff/muffcmds.py (command_halt): Added a reason message
parameter which gets logged and broadcast to all connected users.
(command_reload): Now gets logged when run.
(command_say): Disallowed replacement macro sequences and refactored
the correction routines, abstracting the punctuation and typo maps
out into configuration.
(command_time): New admin command to report current world time in
elapsed increments.
(handle_user_input): Switched to a generic caller based dynamically
based on the user state names.
(handler_disconnecting, handler_disconnecting_duplicates): Added
code to handle disconnecting an existing socket for a user who
successfully authenticates on a new socket.
(handler_entering_account_name): Now adds a log entry when a user
logs into an account.
(handler_fallthrough): Removed.

* lib/muff/muffconf.py: Refactored the initial config file finding
routines to be more robust.
(get, getfloat, getint, set): New convenience
functions for calling the corresponding Data class methods.

* lib/muff/muffmain.py (main): Ammended the loop to continue, giving
the next pulse an opportunity to more courteously disconnect active
user sockets.

* lib/muff/muffmain.py (main), lib/muff/muffmisc.py (on_pulse):
Relocated more loop content.

* lib/muff/muffmisc.py (broadcast): For aesthetics, an additional
blank line is now prepended to output.
(getlong, repr_long, setlong): Additional functions implemented to
deal with Python's long integer representation format.
(reload_data): New function allowing the admin reload command to
refreshe already instantiated objects by migrating their contents to
new ones and deleting the originals.

* lib/muff/muffuser.py (User.save): The account file is now
unconditionally set to 0600 permissions for additional protection of
the MD5 password hashes.

18 years agoImported from archive.
Jeremy Stanley [Sat, 30 Jul 2005 17:04:00 +0000 (17:04 +0000)]
Imported from archive.

* lib/muff/muffcmds.py (command_quit): Replaced with a disconnecting
state.
(handle_user_input): Reorganized the user state handlers.
(handler_entering_account_name): Fixed a race condition where empty
accounts would be created even if the user never got around to
entering a password before disconnecting.

* lib/muff/muffmisc.py (log): New function to abstract logging of
arbitrary information, for later flexibility.
(random_name, weighted_choice): Added a random name generator
function for later use.

18 years agoImported from archive.
Jeremy Stanley [Thu, 21 Jul 2005 20:19:02 +0000 (20:19 +0000)]
Imported from archive.

* bin/muff, lib/muff: Replaced the embedded license copies with
pointers to the LICENSE file. Added lots of in-line code commentary
and docstrings. Refactored some blocks of code for improved
readability.

* bin/muff, etc/mudpy.conf: Moved to the top-level directory.

* doc/license: Renamed to LICENSE and moved it to the top-level
directory.

* lib/muff/muffcmds.py (command_null): Removed.
(command_say): Additional output cleanup.

* lib/muff/muffmain.py (main): More robust handling for variable
files.

* lib/muff/muffmisc.py (wrap_ansi_text): Minor word-wrapping fix.
(User.__init__): Added tracking of last login address.

18 years agoImported from archive.
Jeremy Stanley [Mon, 18 Jul 2005 22:24:29 +0000 (22:24 +0000)]
Imported from archive.

* Initial commit of working project files.

18 years agoImported from archive.
Jeremy Stanley [Sat, 16 Jul 2005 22:22:13 +0000 (22:22 +0000)]
Imported from archive.

* New project.