Commit graph

2866 commits

Author SHA1 Message Date
Greg Taylor
af19724bb2 Make sure player input is valid unicode. If an un-decodable character is encountered, replace it with question marks. We'll need to test this with a more unicode capable client than I have. 2009-10-27 20:18:01 +00:00
Greg Taylor
b57608cf55 Set the default encoding to UTF-8. UTF-8 support in new codebases is pretty much expected, especially given that MUX/MUSH now have excellent support. This should alleviate some of those encoding errors, and allows us to get rid of that ascii error checker in session.py. 2009-10-27 20:03:03 +00:00
Griatch
eb6f82fea0 Added an at_obj_receive hook to basic player/object script parents. This allows
e.g. room parents to react when a player enters them.
2009-10-25 15:25:15 +00:00
Greg Taylor
d06ac3e239 Not sure how we ended up with bold cyan as the default object name color, reverting that to bold white as per MUX/MUSH. 2009-10-24 03:54:03 +00:00
Greg Taylor
239af1593d Fix issue #77, dealing with clearing objects out of a room being @dest'd. 2009-10-24 03:49:14 +00:00
Greg Taylor
4125c93c8b @dest shouldn't use a global search for object. The only time this is global is when a player specifies a dbref, which is a very specific query. 2009-10-24 03:42:42 +00:00
Griatch
3be514ffdc Added high/low dbref limits to @find (Issue 59).
/Griatch
2009-10-22 20:59:19 +00:00
Griatch
3614960471 Protected the server against non-standard characters on input line; this would give traceback or weird results before.
/Griatch
2009-10-22 20:10:31 +00:00
Griatch
656ecd9f97 Added VisibleKey, allowing objects to be locked so they are not visible by normal look command.
Fixed bug in create_object that sometimes caused rooms to be created with a location !=None
Expanded @destroy to better handle names and not just dbrefs.
/Griatch
2009-10-22 19:44:16 +00:00
Griatch
557c4eb07b Fixed bug in destroy command; cleaned up @dig a bit. 2009-10-22 14:30:57 +00:00
Griatch
9b6bd7125f Made several admin commands handle multi-word global searching; defined a new search function on objects.model for global name searching.
/Griatch
2009-10-21 18:42:52 +00:00
Griatch
d8787bfc70 Minor cleanup in batchprocessor messaging. 2009-10-20 22:27:06 +00:00
Griatch
a6ae6e936a Patched the batch-processor's interactive mode so it will not abort if it processes an object/script parent that changes the player's state. Also added a variable BATCH_IMPORT_PATH to config so one can keep all batch scripts in one location and don't have to write the full path to get them. Default is the new directory game/gamesrc/world.
Added the permission genperms.admin_nostate so that builders can avoid entering a state when working on a room with a state-changing parent. Superusers have to set the flag ADMIN_NOSTATE on themselves to achieve the same effect (this is necessary since superusers always have all permissions, so they would otherwise never be able to enter states).
/Griatch
2009-10-20 22:21:01 +00:00
Griatch
c4114938cc Many small but useful bug fixes in various modules.
/Griatch
2009-10-20 20:38:24 +00:00
Greg Taylor
615cb51b33 Check the user's location for commands after checking neighboring objects. 2009-10-20 15:24:33 +00:00
Griatch
a711e07b80 Added the capability of evennia commands to consist of more than one word. So the examples.red_button parent can now be pressed with the command 'push button' instead of 'pushbutton' as before. The variable COMMAND_MAXLEN in the config defines how many words your commands may maximum contain (don't set it higher than needed for efficiency reasons).
The main drawback of multi-word commands are that they can not have any switches; they are intended for in-game use (in states and on objects). Use normal one-word commands for administration and more complex commands with many options.
/Griatch
2009-10-18 19:29:18 +00:00
Griatch
0c29d359f6 Added @setcmdalias for creating aliases for commands (l -> look etc). Also moved the hard-coded defaults to settings.py instead. 2009-10-16 21:04:07 +00:00
Griatch
a286841030 Added mentions of the ;-style aliasing when creating and naming objects to all relevant help entries. 2009-10-15 20:38:32 +00:00
Griatch
c575d098a0 Expanded @emit with more functionality.
Implemented @pemit (Issue 19)
Implemented @remit, @fsay and @fpose.
/Griatch
2009-10-15 17:31:44 +00:00
Griatch
45bf3374a1 Implemented @cdesc as per Issue 65. 2009-10-15 14:01:48 +00:00
Griatch
3a40bf5241 Changed the name of the default state-help command 'info' to 'statehelp' to avoid clashing with the standard info channel. 2009-10-15 11:30:44 +00:00
Griatch
df4ede7229 Added fix to statetable that has it not add a state-help entry if there is no __doc__ string.
This is useful if one overwrites a global command but wants to retain its original help entry.
/Griatch
2009-10-15 11:09:40 +00:00
Griatch
84aeabb272 Some cleanup. Fixed all examples to match the changes in the states and help systems, also
ran them through pylint to pretty them up.
/Griatch
2009-10-15 09:43:34 +00:00
Griatch
8074617285 Largely rewrote and refactored the help system.
The help entry database structure has changed! You have to resync or purge
your database or your will get problems!

New features:
* Help entry access now fully controlled by evennia permissions
* Categories for each help entry
* All entries are created dynamically, with a See also: footer calculated
  after the current state of the database.
* Indexes and topic list calculated on the fly (alphabetically/after category)
* Added auto-help help entries for all default commands.
* Only shows commands _actually implemented_ - MUX help db moved into 'MUX' category
  which is not shown by default.
* More powerful auto-help markup - supports categories and permissions (and inheritance).
* Global on/off switch for auto-help, when entering production
* Auto_help_override switch for selectively activating auto-help when developing
  new commands (like the old system).
* Refactored State help system; no more risk of overwriting global help entries.
* State help now defers to main help db when no match found; makes system more transparent.
* State help entries also support categories/permissions (state categories are not
  used much though).

Other updates:
* Added more commands to the batch processor
* Many bug-fixes.

/Griatch
2009-10-14 18:15:15 +00:00
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
82fe65f31f * Fixed bug in @reload that had modules reload in random order (causing custom user modules to not overwrite default ones properly).
* Added more info to multiple match search results, to show which matches are in inventory or not.
/Griatch
2009-09-28 20:45:36 +00:00
Griatch
f99614346d Made the StateSystem example commands in gamesrc/commands/examples/state_example more elaborate and informative. These
are the commands:
 entermenu (shows a simple menu system)
 enterstate (enters one of six different states with descriptions and hints of usage)
Leave all states with @exit.
/Griatch
2009-09-28 19:27:35 +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
35676b7660 Fixed bug in drop command, giving error log messages since it was trying to force non-player objects to execute a look when dropped. 2009-09-27 21:11:34 +00:00
Griatch
45ba9ea73c Fixed bug that had recycled objects not properly forget flags set on them before they were destroyed.
/Griatch
2009-09-27 16:36:03 +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
a5a0d92985 Added some more information to the move-announcement hooks; these also know from where the object is coming from (this can be useful for admins wanting to produce e.g. 'player arrives from <foo>' messages insteda of the default uninformative 'player arrives.'. )
/Griatch
2009-09-20 00:02:57 +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
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
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
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
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