Commit graph

30 commits

Author SHA1 Message Date
Griatch
df29defbcd Added gamesrc/utils.py as a convenient shorthand for often-used methods from the engine
Added a @deluser command and gave it and @boot an option to give a reason for booting/deleting a player
Fixed a bug in @dig that confused exit directions in text
Small bug fixes
/Griatch
2009-12-20 20:51:26 +00:00
Griatch
81bec61d7d Added the apropos command for broader help searching (uses icontains).
The suggestions: footer used in help gave too narrow results, now using apropos-style search instead.
Bug fix of state-help command to make it accept switches.
Added several new example commands and cleaned up old ones to be more user-friendly.
Added protection in @delevent to make it harder to delete system events.
Some small bug fixes and other cleanup.
2009-12-20 12:39:08 +00:00
Griatch
5e866c6b73 Added more stable events.
- added PIDs to all events, so they can be deleted safely.
- scheduler.del_event(pid) cleanly deletes events from the scheduler
- added @delevent for deleting events based on PID (@ps shows this now)
- Events has a self.repeat property allowing them to only be repeated a certain time (default is infinitely many times). After the set number of repeats, the event deletes itself from the scheduler.

Events are currently not persistently stored; this is left for future commits.
.
Griatch
2009-11-18 20:10:35 +00:00
Griatch
642932a403 * Implemented a non-persistent cache in src/cache.py. The cache is lost when restarting the server but it has the advantage of not hitting the database, and so is useful for implementing things that should be remembered over time but does not need to be persistently saved in the database at every point, like fast-updating combat systems, timers etc. Using the cache can substantially cut down on database access at the cost of memory comsumption. It is easiest accessed through the object model using normal dot notation. So to store a variable in volatile memory e.g. from your script parent, you can do things like self.scripted_obj.cache.myvariable = variable and be sure that later (unless there was a reboot) doing self.scripted_obj.cache.myvariable will return the value you stored there.
* OBS - doing e.g. self.scripted_obj.myvariable = variable was always iffy and since a few revisions back this will NOT work - this is because the objects are now consistently synced with the database (in the past this was not done consistently which caused strange behaviour).
* Fixed some bugs in the multi-word command handler. It can handle multi-word exits as well now.
2009-11-01 15:12:38 +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
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
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
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
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
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
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
899136760e Add the home command. 2009-04-06 22:07:41 +00:00
Greg Taylor
867fb47be7 alias, aliases, same thing. 2009-04-06 22:00:29 +00:00
Greg Taylor
48204c5dec Adding @reload/aliases. 2009-04-06 22:00:08 +00:00
Greg Taylor
5c5d2249bd Command reloading ended up being really super easy. @reload now rebuilds and re-imports all of the command modules. This should make development a lot easier. 2009-01-27 16:16:43 +00:00
Greg Taylor
4ca5a4a7bf Revamp how commands are loaded. This will now allow for easy addition of custom commands and over-riding existing Evennia-supplied commands. 2009-01-27 15:21:15 +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
156e409bda Fix channel history to yank the broadcasting of 'last', also added a "To be implemented" notice to @reload. 2009-01-15 04:18:23 +00:00
Greg Taylor
18e2eca2c5 Removed some retarded uses of 'server' reference variables. 2008-12-16 03:17:45 +00:00
Greg Taylor
5249f27074 Things should be working again, minus the web stuff. 2008-12-15 04:35:00 +00:00
Greg Taylor
d58f4eb517 Looking through our command code after a long hiatus, I realized that it was pretty much awful. So here's part 1 of the command interpreter overhaul.
- The command handler has been drastically simplified. We were doing way too much processing in the handler that should have been done in the individual command functions themselves.
- The 'cdat' dict we were previously passing around has been replaced with a Command object that has useful methods for performing some of the parsing command functions will probably want to do from time to time.
- All commands were updated to use the new Command object, tested, and cleaned up in general.
- A lot of formatting was cleaned up.
- A lot of previously un-found bugs and limitations were fixed.
- The 'page' command has been broken out into its own file, since it's going to have a number of functions that would otherwise clutter commands/general.py.

Expect a commit (probably later today) that will clean up the second half of cmdhandler.py.
2008-12-14 20:21:02 +00:00
Greg Taylor
a954069776 Finished moving stuff around, things should be in mostly working order now. 2008-06-15 20:31:25 +00:00
Greg Taylor
5064d0cacc Moved defines_globals to src/ 2008-06-15 20:04:06 +00:00
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
Renamed from commands/privileged.py (Browse further)