Commit graph

49 commits

Author SHA1 Message Date
Griatch
4cee971169 Fixed some bugs in move reporting. Made feedback from default commands a bit more informative and consistent. Added some more text and error handling to the login commands. 2009-09-19 20:48:06 +00:00
Griatch
8fbeea99dc Moved the last hard-wired emits from objects/models.py into scriptparent hooks. This allows the admin to customize this without having to mess with the engine.
Other small bugfixes, fixes to @dig to properly call creation hooks of all newly created objects (it was not setting anything before). Also fixed some of the annoying bugs around using several of the building commands that didn't properly handle spaces around the separator = symbol.
/Griatch
2009-09-19 15:18:42 +00:00
Griatch
b95d45e251 Added option to local_and_global_search() for matching against the value
of any desired attribute. Default is searching by name, as before. This
makes it easy for admins to search for objects and also for using other
attributes than names as primary identifiers (short descriptions comes to
mind).
/Griatch
2009-09-05 21:59:12 +00:00
Griatch
41365074fd Further fuzzy matching improvement, with integer list selection of multiple matches.
This uses exact-match-first fuzzy matching as discussed in previous commits. It also
use the match order to present a list of options to narrow the selection down - the user can
then specify the choice by appending the correct number to the query.
Example: objects: [box,box]; searching for "box" gives a multiple match error, which presents
a list looking like "1-box, 2-box". The user can now just write "2-box" to choose the second
box. Showing dbrefs is perhaps even more universal, but revealing the underlying data structure
to the normal user is not really good practice - dbrefs is only something builders and admins
should have to know about ... (IMHO).
/Griatch
2009-09-02 22:04:14 +00:00
Griatch
2aae4a0105 Cleaner implementation of the fuzzy matching fix I did; this also handels "true" multiple matches (such that there really are
>1 thing named "box" in the room); the previous implementation just picked the first occurence instead of giving a
multiple match error.
/Griatch
2009-09-02 17:57:54 +00:00
Griatch
68217072a6 Fixed an issue with "Fuzzy" pattern matching that would not find names at certain times.
For example, before the fix, you could face the following issue: Create a bunch of boxes with @create:
box, box1, box2, box3 ... Now try to examine 'box'. This would not work - the game would tell you that there
were multiple matches - it just found "box" in all entries and went with that. So despite there only being one
thing named solely "box", you could not target it! This fix resolves this by giving precedence to exact matches
whenever they exist. I have only done it for the support routine behind local_and_global_search() though, there
are other search functions that uses django directly for fuzzy __in searches. I don't know how to add a similar
functionality to them.
/Griatch
2009-08-30 20:18:56 +00:00
Griatch
1d4f075ca7 * Updated and expanded the State system; the API changed a bit. You now have to first *create* the state using
GLOBAL_STATE_TABLE.add_state() before adding commands to it. The state can now be much more configured by including as much or as
little of the normal default commands into it as wanted (so you can now have states which are almost as normal, except some
commands are missing or change their behaviour ... illness or darkness comes to mind). The possibilities here are limitless.
* States now also optionally allow traversing exits as well as using command tables defined on objects.
* States now better handle error messages (so if you try 'look' in a state which does not contain a look command you will no
longer get the 'Huh?' but will be told that the command is not available at the moment).
* All examples in commands/examples/ have been updated to use the new State system. Also added a @test_state function for trying out
the functionality.
* Added hooks at_before_move() and at_after_move(), useful for character based move-restrictions and checks (e.g. movement speed)
* Minor tweaks to the event system; avoiding the counters to go negative should they hit an uncaught traceback.
* Small fixes of typos and minor extra safety checks.
/Griatch
2009-08-16 01:18:58 +00:00
Greg Taylor
ddfd479ba9 Fix a really obscure bug with adding default channels. Had a string substitution that didn't match up and wasn't throwing an exception (for some weird reason).
Also add CommChannelMembershipAdmin.
2009-06-04 04:03:16 +00:00
Griatch
c339c1f6f6 Changed the input format of the create_object() function as suggested in the code. A more normal function now, no more strange dictionary input. 2009-05-03 18:21:12 +00:00
Griatch
05554e290a Moved the object's 'description' into an attribute, as suggested in the code. This means that get_description() and set_description() should no longer be used; instead use set_attribute('desc',value) and get_attribute('desc') as you would any attribute. 'desc' is used by the default look command, but apart from that, desc has no special status anymore.
/Griatch
2009-05-03 16:55:42 +00:00
Griatch
e7d7284d5c Added pickle'able attributes. The attribute.get_attr(), object.set_attribute and object.get_attribute_value() have been updated to accept and return values of any type. If the value is a string, it will be stored normally, other types will be pickled. Possibly we could choose to save also single numbers as strings, but not sure it's any faster to convert from string than it is from cPickle ...
To use these, you need to either start over with a fresh database or change the changed fields manually.
2009-05-02 19:02:36 +00:00
Griatch
cafbdf720e Minor typo-fixes as well as making some variable names more intuitive. 2009-05-01 15:56:19 +00:00
Griatch
0efe2c3095 Created a state system. See
http://groups.google.com/group/evennia/browse_thread/thread/66a7ff6cce5303b7
for more detailed description.

Created a new folder gamesrc/commands/examples and moved all examples in there.
/Griatch
2009-05-01 15:34:43 +00:00
Griatch
cae925c29b Made so the local_and_global_search strips the query of surrounding whitespace. Many calling functions don't do this properly, making it a source of bugs. E.g. "@desc obj = text" did not locate obj but "@desc obj= text" did. 2009-05-01 07:16:44 +00:00
Griatch
3eb4cddf42 - implemented @destroy as per the MUX help specifications. As part of this, fixed the object recycling routines to actually properly replace GARBAGE-flagged objects (it crashed before).
- Set up a global cleaner event to clean all @destroyed objects every 30 minutes (makes their dbrefs available).
- Added the @recover command for recovering @destroyed objects up until the point that the cleaner runs and actually destroys them. This can recover @destroyed objects, rooms and exits to the same state as before @destroy. It could easily be made to recover player objects too, but I'm thinking this would be a security issue.
- Added to @dig in order to allow for creating rooms with a particular parent. Also auto-creates exits in each room if desired. The only things that is not implemented is the aliases of the exits, I don't really know how to do that.
- Changed the @create command format to match the @dig (it uses : to mark the parent instead of = now, since MUX' @dig reserve = to the exit list.)
- Added extra security in the example event to guard against the bug that causes the whole scheduler to freak out if the event_function() gives a traceback.
- Changed many instances of type to point to the defines_global.OTYPE instead of giving the integer explicitly.
/Starkiel
2009-04-30 15:01:59 +00:00
Griatch
8799a0fd55 Added example of how to handle event errors gracefully without them taking down the server with with unhandled exceptions (this should be handled somewhere above exception too, but it's hard to tell when to do it since twisted is raising them). /Starkiel 2009-04-30 08:23:54 +00:00
Greg Taylor
70602efaa7 Remove an unneeded import that was causing a deprecation warning. 2009-04-30 02:52:16 +00:00
Griatch
a9dbac8aae - Made many small bugfixes to the @parent and @create functions as well as their underlying methods.
- Made it so user #1 is also affected by the on_player_creation() function.
- Added an event folder for custom events, including a working example
- Expanded the example commands and parents to include the changes to how they should be initialized.
- Added an optional ansi scheme (not active by default)
2009-04-25 20:51:12 +00:00
Griatch
a32840002c This change to set_script_parent() is also needed to get the previous @parent fixes to work, sorry for the omission. 2009-04-25 18:05:46 +00:00
Greg Taylor
9f86a4c586 I've been meaning to do this for a while as well. Break CommChannel and CommChannelMessage out into a separate app. I had them lumped in with objects/models.py due to some funkage with the admin site registering that is now resolved.
NOTE: You will need to syncdb and re-create any channels you may have had. Sorry for the inconvenience, we're still early enough in development where breakages like this may happen once in a blue moon.
2009-04-17 04:15:54 +00:00
Greg Taylor
573d1b6e88 Finally got around to creating admin.py files for all of the apps. This will prevent some really weird import errors and fixes an issue with the Attribute model's admin display. May also cut resource usage slightly for MUD server instances. Needs more testing! 2009-04-17 03:08:18 +00:00
Greg Taylor
36e23bfd4a Modularizing ANSI parsing. This may break stuff. It's not quite where I want it just yet. 2009-04-13 22:44:44 +00:00
Greg Taylor
65d8ac8bdc Disallow re-naming and re-aliasing duplicates. 2009-04-06 22:24:49 +00:00
Greg Taylor
b3c386a2c3 Clean up some of the methods on the script parent system. I have no idea why I was being silly and passing things around through dictionaries. Yick. Also added a at_player_creation method to basicplayer.py that is triggered after player objects are created and ready to go, but before they are logged in. 2009-03-30 00:54:05 +00:00
Greg Taylor
4af854271a Fix clearing attributes via @set. 2009-03-30 00:37:24 +00:00
Greg Taylor
4426f776fd Fixed an annoying problem with player creation. It only affected the first player created after the server was started for the first time. 2009-03-26 14:12:30 +00:00
Greg Taylor
71a76cd1fb Trap some more odd errors to assist in my tracking down their origin. 2009-03-26 14:03:41 +00:00
Greg Taylor
51edc17d59 Command revamp broke the create command in a funky way. Fixed. 2009-02-04 18:14:25 +00:00
Greg Taylor
df69011134 Working on getting command tables implemented on individual objects. It's probably not a good idea to update to this revision in a 'production' environment yet. 2009-01-30 03:28:41 +00:00
Greg Taylor
7ff97599be Move standard_objsearch to Objects.search_for_object. Also make sure @alias only accepts alphanumeric strings. 2009-01-25 03:11:52 +00:00
Greg Taylor
9407eb0ee4 Huge overhaul in the way objects and sessions are used with commands. We now pass all commands through objects (aside from unlogged commands), which means session.msg() is now deprecated for any use other than unlogged out.
As a side-effect of all of this, logging in more than once acts as behaves now. Also, this will allow things/rooms/exits (IE: not players) or un-logged in players to run commands or be forced to run them via @fo. All of this will bring us more in-line with MUX behavior.
2009-01-24 20:30:46 +00:00
Greg Taylor
cbd5fd9faa Flag list displaying 'None' fixed. 2009-01-22 15:22:32 +00:00
Greg Taylor
377844f1c6 @search is working now, aside from the flag search. 2009-01-22 14:49:58 +00:00
Greg Taylor
a7a3a33334 Add a builder override to object.controls_other function. Also refine what is shown when examining based on ownership and permissions. 2009-01-22 04:20:55 +00:00
Greg Taylor
f0c129f730 Fixes to player creation that may not actually do anything. Also add default flagged channels with the default alias being the first three characters of the channel's name. 2009-01-22 03:50:16 +00:00
Greg Taylor
4c562cd6ce Work on the comsys. @cwho is working now. 2009-01-22 03:19:40 +00:00
Greg Taylor
0169c52442 Fix the admin displays for most of the models. ConfigValue is being weird for some reason, though. 2009-01-18 04:54:05 +00:00
Greg Taylor
f6ee697e04 Move away from fixtures in favor of src/initial_setup.py, which makes it a little easier to change stuff like this. It also avoids over-writing stuff when syncdb is ran. This commit features database layout changes to ConnectScreen and CommChannel. It is recommended that you drop your database and re-sync. If this is not acceptable, talk to me about a migration plan. We will be investigating schema evolution down the road. 2009-01-18 04:22:58 +00:00
Greg Taylor
c0ebbc3967 Part 1 of initial database population re-factor, along with a comsys model change. DO NOT UPDATE TO THIS IN PRODUCTION ENVIRONMENTS YET! Wait for the all-clear. 2009-01-18 03:14:52 +00:00
Greg Taylor
8ebea8c22e Add MUX-style @chzone. 2009-01-18 02:40:57 +00:00
Greg Taylor
1a3942edac MUX-style @chown implemented. 2009-01-18 02:34:50 +00:00
Greg Taylor
462628ab55 Builders start seeing dbrefs for the most part. 2009-01-15 16:24:52 +00:00
Greg Taylor
914628d385 Fixed an issue with Object manager's is_dbref. Paging should be a lot more sound now too. 2009-01-15 05:11:55 +00:00
Greg Taylor
8a8891f63d Protect against a really weird emit problem. 2009-01-15 03:55:48 +00:00
Greg Taylor
51a648ddab Fixes a few more command errors in commands without args. Create from the login screen now works without errors again. 2009-01-15 03:48:42 +00:00
Greg Taylor
9a166ba024 Moving script_parent to a field on the object model. This is critical enough to warrant it being there instead of in an attribute. Minor changes here and there.
NOTE: This update adds a field, delete your evennia.db3 or manually add a NOT NULL 'script_link' charfield(255).
2008-12-16 04:28:57 +00:00
Greg Taylor
122bf4e3ff Splitting the scripted parent system out into the gamesrc directory. There will be more explanation of this later. 2008-12-15 05:55:04 +00:00
Greg Taylor
5249f27074 Things should be working again, minus the web stuff. 2008-12-15 04:35:00 +00:00
Greg Taylor
837f1152c6 Starting here, trunk is broken pending re-organizations. Check out the previous revision if you'd like to tinker. 2008-12-15 04:00:25 +00:00