Commit graph

117 commits

Author SHA1 Message Date
Griatch
46e2cd3ecb Added FuncKeys - locking of objects depending on the result from an arbitrary function.
Added AttrKeys and FlagKeys - locks depending on the value of the unlocker's attribute or if they have a flag set.
Finally I updated @lock to handle all these lock types. There are a large amount of possible configurations though, so more testing is needed.
/Griatch
2009-10-12 20:58:15 +00:00
Griatch
42254355a0 Cleaned up @link, @open and @dig, making these commands more useful and less buggy with strange input. Also made them work not only with #dbrefs but with any unique game object (possibly one should limit this to e.g. room's); if there's a multiple match a list of the relevant dbrefs are shown. You can also now inspect links/home settins using this command.
@open also supports script_parents when creating exits.
/Griatch
2009-10-05 23:06:57 +00:00
Griatch
66095a0b16 Implemented locks.
The main command to use is @lock, which accept three types of locks at the moment, and three types of keys:
 Locks: DefaultLock, UseLock, EnterLock
 Keys: ObjectIDs, Groups, Permissions
This offers the most useful functionality - stopping people from picking up things, blocking exits and stopping
anyone from using an object.
If the attributes lock_msg, use_lock_msg and enter_lock_msg are defined on the locked object, these will be used
as error messages instead of a standard one (so "the door is locked" instead of "you cannot traverse that exit").

Behind the scenes, there is a new module, src/locks.py that defines Keys and Locks. A Locks object is a collection
of Lock types. This is stored in the LOCKS attribute on objects. Each Lock contains a set of Keys that might be
of mixed type and which the player must match in order to pass the lock.
/Griatch
2009-10-05 20:04:15 +00:00
Griatch
7f7306a6e4 - Implemented permission system management inside the game
- changed @chperm to @setperm to avoid confusion with channel commands
- added @setgroup command for adding user group permissions
- Moved permissions/group setup into settings file to allow admins to tweak without going into evennia engine.
- Add all new players to default permission group (defined in settings)
- Defined a basic group hierarchy, removed permission 'genperms.builder' in favour of a group named builders instead, containing all relevant permissions.
- Filtered out all django's automatic permissions in @setperm/list to make permission system more controlled by admin.
- Probably fixed bug that caused new users to not be signed up to channels (more testing needed)
- Added Exception handler in unloggedin method create, this was killing tracebacks upon user creation.
/Griatch
2009-10-03 14:40:34 +00:00
Griatch
77f2186d9a Implemented the @chgroup command for adding/deleting users to/from permission groups.
You can also view all groups and their permissions. At the moment groups have no permissions assigned to them from the onset though, so groups are not very useful out of the box.
.
Griatch
2009-10-02 20:51:56 +00:00
Griatch
fc35cffb98 A commit activating the auto_help for @chperm. 2009-10-01 23:33:57 +00:00
Griatch
e05eabe5ef * Implemented @chperm - a command for viewing and setting individual permissions on a user without using the admin interface. I consider expanding this later with a group handling method as well (@chgroup). The command supports viewing all permissions available in the game, viewing those set on a user, add and delete a permission. No refactoring of the permission models (moving them into their respective application) has been done yet.
* Added del_event() to scheduler, allowing to remove events from the event queue. This allows for creating e.g. one-time events.
.
Griatch
2009-10-01 23:28:58 +00:00
Griatch
6d45c98b8e Fixed bug that allowed addcom to set the same alias to two different channels.
/Griatch
2009-09-28 17:08:18 +00:00
Griatch
0e46a61c85 * Added copy_object() to the object manager
* Added @copy command (builders only)
* Moved the greeting for first-time logins into a hook in basicplayer
* Fixed bug in @set to handle whitespace better
* Added the /drop switch to @create
/Griatch
2009-09-27 10:05:47 +00:00
Griatch
ee1b891ef4 * Refactored the structure of the code a bit, for easier plugin expansion. The create_object() function now handles all the basic aspects of setting up an object, instead of relying on @create/@dig to set up things like parents, default descs etc. This also calls the creation hook on_object_creation() now. As part of this, the set-script-parent mechanism changed a bit under the hood - the engine itself is calling the set_script_parent() method on Object now instead of setting it up on its own and/or trusting @create and @dig to do it. Also set up the default descs for different object classes into the defaults_global file for easier administration.
The @dig command now accepts the specification of parents for all entries (room and all exits). In principle it also supports ALIASes for each exit, but the ALIAS attribute does not seem to be operational at the moment.
/Griatch
2009-09-26 23:37:52 +00:00
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
afc463f975 Adding more feedback if giving wrong filename to @batchprocess. 2009-09-05 21:19:53 +00:00
Griatch
5e8a047111 Cleaned spammy output to IMC users from IRC and evennia channels, where channel names tended to be added
after one another several times. IMC is not seeing the IRC channel name anymore, output should be on the standard
simple name@MUD: msg format as far as IMC is concerned.
/Griatch
2009-09-05 07:24:04 +00:00
Griatch
eebfa0d387 Added a command batch processor to Evennia. The @batchprocess is a super-user only command that reads normal Evennia-commands
from a special-format batchfile. It is intended for large-scale offline world creation (especially things like room descriptions),
where a real text editor is often easier to use than online alternatives. The @batchprocess also has an /interactive mode which allows
stepping through the batch script, allowing to only execute selected entries; e.g. for editing/updating/debugging etc.  There is
an example batchfile in the gamesrc/commands/examples directory.
/Griatch
2009-09-04 08:01:43 +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
c5c8505582 Registering IRC as an Evennia Service, can now be controlled with @service/start/stop.
At the moment this only works with the initial IRC channel (the one set in preferences),
those channels you add later with @ircjoin does not add as Services; when setting it up
they add just fine, but the bot does not connect - I don't know why (code is commented out
in src/commands/irc.py).
/Griatch
2009-08-30 17:28:56 +00:00
Griatch
cb7ee081f5 Added info from @reload (Issue 70) and @service (Issue 71) to MUDInfo channel.
@reload only adds full info to the logger; normally just brief info to game unless
there is a traceback.
2009-08-30 15:35:29 +00:00
Griatch
811bdc623f Implemented @cchown as per MUX specifications (Issue 53). 2009-08-30 13:02:25 +00:00
Griatch
cdd4770330 Implemented clearcom as per MUX specifications (Issue 48).
Added a 'clear' argument to addcom as a shortcut to clearcom.
Changed addcom to now change the alias to a new one if giving the command on an already subscribed channel.
Added the exception in command handler so that giving the channel alias without argument gives an error instead
of sending None to the channel.
/Griatch
2009-08-30 12:28:38 +00:00
Griatch
117207e3ca Implemented allcom as per MUX specifications (Issue 47). Added some more functionality to it, such as giving allcom without an
argument makes it work as comlist. Also cleaned up some of the channel listing commands to make their output more consistent.
2009-08-30 10:07:15 +00:00
Griatch
ceaf7d2a2f Implements @cboot as per MUX specifications (Issue 20). Some code cleanup. 2009-08-29 22:29:19 +00:00
Griatch
69cb8e5655 Implemented @cpattr functionality as per MUX specification (Issue 26). 2009-08-29 19:15:32 +00:00
Griatch
bd2f7a845c Added @mvattr command as per MUX (Issue 25). Cleaned up @set to give better feedback. Some minor cleanups. 2009-08-29 17:41:00 +00:00
Griatch
e39537dc04 Fixed traceback in @irc2chan when channel not known. 2009-08-28 18:54:41 +00:00
Griatch
72e55f417a Added the command/irc.py directory that was not committed properly.
Added some more helper commands and changed a bit under the hood on those
previously committed for mapping irc/imc channels to each other.

There seems to be an issue with IMC2 users seeing an echo back to themselves when talking. Investigating.
/Griatch
2009-08-28 18:13:07 +00:00
Griatch
4bd567386f Some code cleanup and clarification in comments. 2009-08-28 01:33:15 +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
d29c6340fc Finally transition away from those horrid channel attributes for tracking channel memberships. We'll see about doing away with them altogether if it's possible efficiently.
NOTE: MAKE SURE YOU SYNCDB. A new model was added to track channel memberships.
2009-06-04 03:42:19 +00:00
Greg Taylor
acbfa1be6a Re-arrange line breaks for the examine command to match MUX/MUSH. 2009-06-04 02:14:15 +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
9bf3e48def Fixed a bug in @dig for handling if no arguments where supplied. 2009-05-03 17:10:10 +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
1314629a06 Minor bugfix of addcom command, some other cleanup. 2009-05-02 15:55:47 +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
Greg Taylor
9b8f1cf3ea Handle IMC ice-destroy packets. 2009-04-30 04:05:19 +00:00
Greg Taylor
181133d917 Add tracking of IMC2 channels and the new 'imcchanlist' command. 2009-04-30 03:56:52 +00:00
Greg Taylor
76f14b4779 Clean up send_cmessage() a bit. Changed noheader keyword arg to show_header and defaulted it to True. This should read a little better. Also updated some of the various function calls. More importantly, check to see if the channel argument is a string or unicode object and find the correct channel object as needed, which was the previous behavior. However, if it's not a string or unicode object, assume it's a CommChannel object and avoid querying for it again. This may be a performance win in some cases down the road. 2009-04-30 03:13:46 +00:00
Greg Taylor
9954700bdd Fixed formatting on @clist. 2009-04-29 01:03:26 +00:00
Greg Taylor
566a02b848 We now have the ability via @service to list, start, and stop Twisted services. In this case, this just lets us start/stop IMC2 right now. As people write more services to plug in in the future, this may expand.
@service/list will show you the service names. If you see that your IMC has died due to an error, @service/start IMC2 will get it up and running again. I've also added an 'imcstatus' command to show more detailed information about your IMC2 connection.
2009-04-28 23:49:49 +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
9d199032b0 Modifications to the @create and @parent commands, to safeguard against erroneous scriptlink names as well as allowing to define parent upon @creation. The @parent command calls at_object_creation(), seems that behaviour is the intuitive one. 2009-04-25 17:41:58 +00:00
Greg Taylor
9abde7b60f End all 'say' messages with a 'normal' ansi character to prevent bleedage. Also, added the beginnings of an IMC2 ansi parser. 2009-04-25 07:13:19 +00:00
Greg Taylor
2cc3d98810 @scriptcache is now just for displaying the contents of the script cache. After changing a script parent, you may now @reload/script to apply any changes. @reload with no arguments will now show you all of the possible switches. Also added an 'all' switch that will reload everything in one fell swoop. 2009-04-25 06:30:18 +00:00
Greg Taylor
723cdab4aa Make @clist actually show channel descriptions instead of 'No description' all the time. 2009-04-25 04:34:29 +00:00
Greg Taylor
a8434e3c97 Alphabetize imclist output. 2009-04-25 04:32:47 +00:00
Greg Taylor
c18937d3ba Fix page to use the new return value from get_attribute_value. 2009-04-20 22:29:54 +00:00