Commit graph

9 commits

Author SHA1 Message Date
Greg Taylor
4bb00013ae Even more death and destruction. A lot more stuff moved to src/. A lot more bugs probably introduced. 2008-06-15 19:38:39 +00:00
loki77
ad009e20ab basicobject.py
---------------
  - Checks for NULL description on objects- if Null, it doesn't print the extra line any more.
  - Made the checks for contents a little less ambiguous

cmdhandler.py
--------------
  - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules.  Mostly complete, but could use some work on the edge cases.  Check out the docstring on the function- I tried to make it fairly well documented.
  - Changed the check for 'non-standard characters' to just return, rather than throw an Exception.  Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code.  Now it just fails silently.
  - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command'].  This then gets put into cdat['uinput'] at the end of handle() like before.  The old data in parsed_input is still there, this is just a new field.
  - Added cdat['raw_input'] to pass the full, untouched command string on.  This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not.

cmdtable.py
------------
  - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation.

apps/objects/models.py
-----------------------
  - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description.  This is used for the change mentioned above in basicobject.py
  - get_description now returns None if self.description is None
  - used defines_global in the comparison methods like is_player

functions_db.py
----------------
  - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know.
  - renamed player_search to player_name_search.  Removed the use of local_and_global_search inside of it.  local_and_global_search now calls it when it receives a search_string that starts with *.
  - alias_search now only looks at attributes with attr_name == ALIAS.  It used to just look at attr_value, which could match anything, it seemed.
  - added 'dbref_search'
  - local_and_global_search changes:
    - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively
    - Changed when it uses dbref_search to whenever the search_string is a dbref.  It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object.

commands/unloggedin.py
-----------------------
  - removed hardcoded object type #'s and started using defines_global instead
  - when creating a new account, made sure that no object with an alias matching the player name requested exists.  This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back.

commands/general.py
--------------------
  - Rewrote cmd_page:
    - New Features
      - Page by dbref
      - Page multiple people
      - pose (:) and no space pose (;) pages
      - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED
    - uses parse_command, made it a lot easier to work through the extra functionality added above
    - When there are multiple words in a page target, it first tries to find a player that matches the entire string.  If that fails, then it goes through each word, assuming each is a separate target, and works out paging them.

commands/objmanip.py
---------------------
  - I started to muck with cmd_name & cmd_page, but decided to hold off for now.  Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these.  I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
Greg Taylor
be05772713 Script methods will now take a dictionary with keys rather than hard arguments. This will hopefully allow for a bit more flexibility. 2007-07-17 15:58:19 +00:00
Greg Taylor
fadf3933af Move the presentation part of the 'look' command out to the new scripting system. You can now make different scripted objects appear vastly different by overriding basicobject's return_appearance (or any of its submethods). Also fixed word wrapping, and we are now wrapping descriptions to 78 characters by default. We'll see how gracefully it handles this, and we might eventually apply it to all output. 2007-07-17 14:39:10 +00:00
Greg Taylor
94779a86a5 Added new SCRIPT_ROOT variable to settings.py, you'll need to copy this over from settings.py.dist if you're running a test game. We also now have rudimentary support for default, enter, and use locks per the basicobject.py file. Take a look at the example locks in there. A returned boolean value determines whether the player passes. Make sure you emit an error message within the lock if you're going to return false. We will have simple in-game attribute or dbref locks via an @lock command similar to MUX/MUSH that override scripted behaviors. 2007-07-12 13:45:23 +00:00
Greg Taylor
679ef8dc74 Whoops, fixed some comment stuff. 2007-07-10 15:34:36 +00:00
Greg Taylor
9c57e1cf7a Adding some more script hooks. 2007-07-10 15:34:07 +00:00
Greg Taylor
94ceec3719 Scripting support is now in! See cmd_look (the end of it), scripthandler.py, and scripts/basicobject.py for very brief examples. I'm not sure how well this is going to scale, I had to kludge the import a bit due to some oddities with __import__. There has to be a better way to do this, hopefully I'll be able to figure it out. In any case, expect basicobject to start fleshing out. You'll be able to use it directly or sub-class it with your own stuff. 2007-06-04 20:01:03 +00:00
Greg Taylor
27c0e7a873 Really basic proof-of-concept scripthandler.py for review and discussion. This should illustrate my basic idea about script support. I think this will be a very elegant solution to the scripting situation. This will be filled out in the coming days and will hopefully make more and more sense as I tie it in. Database changes are likely, make sure to keep an eye on the commit logs. Also edited some svn:ignore props and added a placeholder for the basicobject script. 2007-06-04 17:33:31 +00:00