Commit graph

63 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
c7cbc4854e Reworked object command tables.
Object commands used to require re-adding every call in the script parent's __init__ or factory functions, adding the commands to a new command table directly on the object. Since all other attributes can be set up in at_object_creation(), this was both inconsistent and a bit confusing to work with. There is now a method add_commands() directly defined on all objects. It takes the same arguments as the normal add_command()o but use a reserved attribute to create and update a command table on the object. This has the advantange of completely removing the __init__ call in the script parent, all definitions can now be kept in at_object_creation() and are, more importantly, persistent without having to be recreated every call.
- I updated the examine command to show all the commands defined on an object (if any).
- I updated gamesrc/parents/examples/red_button.py considerably using the new command methodology and also using the updated Events.
.
Griatch
2009-12-03 00:41:53 +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
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
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
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
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
929786638d Cleaning up erroneous commit. 2009-08-28 19:13:25 +00:00
Griatch
72ec7377b9 Added some changes to revision conttrol. 2009-08-28 19:07:25 +00:00
Griatch
2640bd057a Fixed some minor typos. 2009-08-23 09:30:09 +00:00
Griatch
6bbdde763d Minor fix of an argument typo as well as making an example more compacent with the wiki. 2009-08-16 09:09:55 +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
05791b3593 Two patches, courtesy of Ari:
* The startup script (evennia.py) will now take your PYTHONPATH environmental variable into account when starting. This may resolve potential issues with Twisted on Windows with certain combinations of Python.
* The INSTALL file still referred to startup.bat, which is now gone in favor of evennia.py.

Thanks Ari!
2009-07-06 02:55:25 +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
1314629a06 Minor bugfix of addcom command, some other cleanup. 2009-05-02 15:55:47 +00:00
Griatch
5bc1db70ed Added help/del to the state-help system, made some appearance tweaks on the examples. 2009-05-02 08:55:12 +00:00
Griatch
fd050f75ca Some adjustments of the formatting for auto_help. Added some colours to the state_example menu. 2009-05-02 08:25:37 +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
ba623af351 Took out some useless code and imports left in after testing this. 2009-05-01 06:42:37 +00:00
Greg Taylor
a5efca450d Looks like there's an import in here that doesn't exist. Commenting it out. Starkiel, was this supposed to do anything? 2009-05-01 05:03:52 +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
Griatch
b63bcc6132 Removed an unneeded debug logger entry from the example event to avoid spamming the log. 2009-04-26 11:04:54 +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
Greg Taylor
0ad8c88c22 Comment elaboration. 2009-04-25 06:32:47 +00:00
Greg Taylor
ffa03309fc Local object command tables are now in. See game/gamesrc/parents/examples/red_button.py for example. Note that local command matches will override global matches. Command handler short circuits on the first command match. This will typically be the object with the lowest ID. 2009-04-25 06:11:42 +00:00
Greg Taylor
ef371aaee2 Ah heck, why not one more? 2009-01-30 06:45:18 +00:00
Greg Taylor
001a698b19 URL update for documentation. 2009-01-30 06:41:54 +00:00
Greg Taylor
9c1dc0a62c Fix a path issue. 2009-01-30 06:35:50 +00:00
Greg Taylor
4cfe2b6bd9 First draft of example WSGI stuff. 2009-01-30 04:16:17 +00:00
Greg Taylor
f69252a490 Discontinuing the platform-dependent startup scripts in favor of cross-platform evennia.py. 2009-01-30 03:58:22 +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
a7ba0d0feb Adding example command module. 2009-01-27 16:34:21 +00:00
Greg Taylor
ee94da4bd8 Forgot to update the @cpattr help file with a minor syntax fix. 2009-01-24 20:48:57 +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
f2d4b3aba4 I have imported and dumped the MUX2 help files into a fixture in game/docs/help_files.json. These are now loaded on the first game's run. As we update help files and dumpdata/commit them, game admins may use the new 'update_help' manage.py command to update their copy of help files. For example: python manage.py update_helpfiles. Those with a current checkout of the source may want to do this now.
It is important to note that these are currently un-modified MUX2 help files. There are a lot of things that are not applicable, incorrect, or only partially correct. It will be an ongoing project to clean these up.
2009-01-24 03:06:18 +00:00
Greg Taylor
b646aa5093 As of Twisted 8.2, win32api is required for Windows. Try to import win32api before evennia.py hits Twisted and causes an un-friendly looking exception. If win32api isn't found, show an error message with the download URL. 2009-01-24 02:56:53 +00:00
Greg Taylor
6715f76847 Make helpentry topic names unique. Add a description to the cross-platform startup script. Added a util directory and a MUX/MUSH help file importer script. 2009-01-22 16:56:00 +00:00
Greg Taylor
214534a86f Fix the Auth section not showing up in automatic admin. 2009-01-22 04:01:54 +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
f5ba11e7e7 Clean up imports, done messing with this for a while. Please help test it. 2009-01-15 15:12:31 +00:00
Greg Taylor
f4b784cfa9 Use os.kill for shutting down the game instead of getting it through Popen. 2009-01-15 15:11:32 +00:00
Greg Taylor
2d746f617b Catch keyboard interrupts so they don't throw an error. 2009-01-15 15:07:06 +00:00
Greg Taylor
e1e974c196 This may actually knock out our settings problem for good. 2009-01-15 15:03:18 +00:00
Greg Taylor
6d93c4114f Latest iteration of the new cross-platform startup script, please test! 2009-01-15 03:50:47 +00:00
Greg Taylor
5bf1461d75 This should get all of the web stuff working peachy again. 2009-01-15 02:46:38 +00:00
Greg Taylor
abe17a2965 Re-designed the startup script to be more cross platform and robust. 2009-01-13 17:06:03 +00:00