Commit graph

34 commits

Author SHA1 Message Date
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
ea88ace9fa Updating some models to use max_length instead of the deprecated maxlength. 2008-02-09 02:35:28 +00:00
Michael King
74a3a01429 Moved object and exit clearing to the destroy method instead of
the delete method.  This may change later, but for simplicity's sake,
this is how we're doing it for now.
2007-09-14 14:09:25 +00:00
Michael King
684ae521b7 Added @boot.
Currently, @boot will boot the first username match it comes across, if connected.

It will not boot non-player objects, and it will not allow staff to boot other staff.
2007-08-07 19:19:31 +00:00
Michael King
7f3a8870f0 I learned something I didn't know about Django:
Apparently, if you retrieve the same model instance with two different references,
they don't equate with is or ==, you need to compare the id's.  I could be misreading the
symptoms, but this is what I had to do to get it to recognize that the home of the object in
question was its current (going away) location, and act appropriately.
2007-08-07 17:08:31 +00:00
Michael King
0c2648edaa Removed DEFAULT_HOME from settings.py into a server configuration directive via the confg app.
Changed clear_objects to reflect default home changes.
2007-08-07 16:52:47 +00:00
Michael King
8b8099a9db Added DEFAULT_HOME value of 2 to settings.py.dist
Added import of DEFAULT_HOME from settings into defines_global
Removed clear_players()
Removed clear_things()
Created a more general clear_objects():
  * obj.clear_objects()
    * Everything with obj as its location will be moved
      to its home.
    * If the home is the obj, then said objects will be
      moved to DEFAULT_HOME, if it exists.
    * If the said objects do not have a home, they will
      also be moved to DEFAULT_HOME.
2007-08-07 16:28:22 +00:00
Michael King
5f962b69a0 Added clear_things, clear_players and clear_exits to Object class.
* obj.clear_things() relocates all things contained by obj
 * obj.clear_players() relocates all players contained by obj
 * obj.clear_exits() destroys all exits to and from obj
2007-08-06 20:00:41 +00:00
Greg Taylor
a3ac4ff17c Word wrap is messing things up a bit. Disabling it for now until we have more time to check this out. 2007-07-26 12:48:44 +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
357ef3a250 Added two new channels: Errors and Info. These will now emit stuff that is sent via log_infomsg and log_errmsg. 2007-07-16 18:49:57 +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
f7d58f16ae Possible MySQL fix. 2007-05-27 20:45:40 +00:00
Michael King
d2115991f8 * Merged in wipe-command branch into trunk (mking) 2007-05-25 17:31:29 +00:00
Greg Taylor
c7f32f904d Lots of re-arranging of the comsys and near completion of comsys player commands. I'm going to halt further progres on this long enough for me to take a second look at my code and re-factor some things, then go on to work on some of the lesser-used commands. New in this revision: on, off, last, who for channels (pub who, etc.). Make sure you nuke all of your comsys-related tables and re-sync. 2007-05-25 03:24:23 +00:00
Greg Taylor
49b6a0ba57 Minor fix to accomodate some database re-organization. 2007-05-25 00:21:08 +00:00
Greg Taylor
e1dbdba951 We don't really need a members field on the channel object. 2007-05-24 20:20:00 +00:00
Greg Taylor
485204e979 Create a Public channel by default, make a channel's name and ansi_name the same thing on initial creation. 2007-05-24 19:53:36 +00:00
Greg Taylor
bb0ff9f6ff Implement @wipe as per MUX. NOTE: THIS REVISION REQUIRES YOU TO RE-SYNC YOUR objects_attribute TABLE. The best way to do this is to drop your attribute table and your comsys tables, then re-sync via syncdb. This was needed due to some conflicts in namespace that I didn't want to get around with disorganized work-arounds. 2007-05-24 17:44:17 +00:00
Greg Taylor
f9f24f6616 Don't return attribute matches if said attribute is in the hidden attribute list. 2007-05-24 03:22:11 +00:00
Greg Taylor
39b640e948 Add the ability to examine obj/attr with wildcards. 2007-05-24 02:58:59 +00:00
Greg Taylor
1a996bbf7e Added a HIDDEN_ATTRIBS list to defines_global.py containing a list of attributes that shouldn't show up on examined objects. 2007-05-22 15:22:25 +00:00
Greg Taylor
204ef6d4c5 Big commit. We now have a respectable command table with built in permission checking. I've commented this pretty well, so see cmdtable.py and cmdhandler.py for more details. There is also some assorted cleanup and an unrelated fix or two resulting from the new Twisted back-end. Note that for the permissions, you will eventually be able to override the codebase's permissions via the web interface for each command. 2007-05-22 15:11:56 +00:00
Greg Taylor
531fbbacaa Fixing @open to be a bit more robust. Also handle exit name matching a lot more gracefully. 2007-05-18 15:20:24 +00:00
Greg Taylor
9e5c297faa Don't return the ansi-fied version of the Object's name on its __str__() method as this is used in the admin interface and makes nasty looking garbage appear. 2007-05-18 14:07:57 +00:00
Greg Taylor
9221f889e3 Attribute names are no longer case-sensitive, as per MUX/MUSH. Also added LAST and LASTSITE to the protected attribute list. 2007-05-18 13:39:57 +00:00
Greg Taylor
ac32ab05c1 Finally caved in and created a command table. It's just going to get too messy with @-commands doing straight module lookups, plus the dict is probably a little faster. Feel free to start moving non-privved @-commands to commands_general and vice-versa since we now have the ability to do so. 2007-05-11 15:23:27 +00:00
Greg Taylor
2fc06adcfa Adding the first bit of permissions checking as an example. See cmd_who and the Object class's user_has_perm method for examples. We'll need to start fleshing this stuff out before adding many more new commands. For existing games, remove your auth_permissions table and re-sync your DB. 2007-05-09 15:53:53 +00:00
Greg Taylor
32fa9e419a Committing the first draft of the comm channel and channel message classes. 2007-05-08 15:06:48 +00:00
Greg Taylor
4fd5a20e2c Added a @reload command to reload most of the modules. This currently only seems to work for the stuff outside of the apps directory, and doesn't include the server, session_mgr, or events modules, as they have variables in them that we can't have reset. So basically, changes to the functions_ and commands_ modules can be applied with @reload, but little else. Hopefully this will improve with time. Also fixed a bug with @name'ing players but not updating their account's username to reflect it. 2007-04-30 17:51:55 +00:00
Greg Taylor
7012960a70 Remove get_ansiname() by condensing functionality into get_name(). Removed session debug statements I had in for testing. 2007-04-26 20:32:56 +00:00
Greg Taylor
3292405fcb Adding initial data via Django's syncdb facility. We will no longer distribute a SQLite DB in the near future in favor of this cross-platform alternative. Also in this commit is a crash fix for @dig with SQLite. 2007-04-25 14:47:33 +00:00
Greg Taylor
9e587bd4e3 Important update: Fixed two crash bugs in attribute getting/setting. Less importantly, the money value shown in 'inventory' now pluralizes properly. 2007-04-23 15:22:40 +00:00
Greg Taylor
5421ab7f6e Re-organization. 2007-04-03 13:42:51 +00:00