Commit graph

94 commits

Author SHA1 Message Date
Griatch
16affc284b Allow for changing the home location of new characters by changing a setting. The given location must exist and is given as a dbref. If one wants more advanced control over start locations, one needs to customize the unloggedin/create command to match the particular game. Resolves issue 178. 2011-08-06 19:39:06 +00:00
Griatch
ddfd8120bb Made scripts and typeclassed objects remember db_typeclass_path at all times - a temporarily faulty typeclass will no longer mess up things forever after. Refined and optimized the way typeclasses are cached and loaded, minimizing db hits. The default result when trying to create an object or script with a typeclass that is faulty/not found is now to fail. The previous way, to create an entity anyway using defaults was hard to debug and caused confusion. Resolves issue 175. 2011-08-06 18:15:04 +00:00
Griatch
8770a263ac Fixes, cleanups and bugfixes in various systems. 2011-06-26 22:03:09 +00:00
Griatch
95d672763b Multiple fixes and cleanups - command parser excludes inaccessible commands already at parse level now. Fixed the functionality of a few of the lock functions to be more intuitive. Added functionality to the examine command to better show the commands available to an object. 2011-06-26 14:35:02 +00:00
Griatch
d2400a8a6b Added the ability to give multiple typeclass search-paths to config file. This way you can add a path to your custom directory and don't have to write so much when creating typeclassed objects using e.g. @create. 2011-05-13 22:26:08 +00:00
Griatch
b8a13a2389 Migrate. Made Exits work differently, by use of commands directly instead of an exithandler assigning commands on-the-fly. This solution is a lot cleaner and also solves an issue where @reload would kill typeclasses in situations where an exit was painting to an object whose typeclass was reloaded (same issue occured if the exit typeclass itself was reloaded). As part of these fixes I cleaned up the merging of cmdsets to now merge in strict priority order, as one would expect them to do. Many small bug-fixes and cleanups all over. Resolves issue 164. Resolves issue 163. 2011-05-01 18:04:15 +00:00
Griatch
9c5f662196 Added the "raw" switch to examine, to allow for viewing attributes and properties without parsing markup first. 2011-04-25 20:13:15 +00:00
Griatch
27809694d7 Migrate. Added the "view" access restriction (to make objects invisible). Also changed the input of ObjectDB.objects.object_search() to not require a caller as an argument (this makes it consistent with other search methods). All default systems should have updated to the new call, but if you have custom calls, you need to change them to fit the new syntax (this is only important if explicitly use ObjectDB.objects.object_search; if you just use caller.search you should be fine) 2011-04-24 11:26:51 +00:00
Griatch
28fe2ad3f4 Run Migrate. Implemented a full separation between Player and Character - Players (OOC entities) can now also hold cmdsets and execute commands. This means that "disconnecting" from a Character becomes possible, putting the Player in an "OOC" state outside the game. This overall makes the game much more stable since there used to be issues if the character was destroyed. Having an OOC set also avoids the previous problem of @puppeting into an object that didn't have any cmdset of its own - you couldn't get back out! A new default OOC-Cmdset handles commands available to a player while OOC. Commands in this set are applied with a low priority, allowing "IC" mode to give precedence if desired.
This change meant several changes to the lock and permission functionality, since it becomes important if permissions are assigned on the Player or on their Character (lock functions pperm() and pid() etc check on Player rather than Character). This has the boon of allowing Admins to switch and play/test the game as a "Low access" character as they like.

Plenty of bug fixes and adjustments. Migrations should make sure to move over all data properly.
2011-04-23 11:54:08 +00:00
Griatch
6f0d21802b Debugged and added @cpattr and @mvattr. Added unittest cases for all default commands for which they are suitable. Many small bug fixes as part of that. 2011-04-21 16:45:18 +00:00
Griatch
7f9f21f45e Migration needed. Refactored the config.configValue model into server.ServerConfig (that's what the config model were used for anyway). The new model can handle arbitrary data structures through pickle. Run ./manage.py migrate to sync your database with the new setup.
Moved Connect screens (the text screen first seen when connecting) away from the database and into a module in gamesrc/world. This module allows for conveniently adding new connect screens on the fly. More than one screen in the given module will mean a random screen is used.
2011-04-12 21:43:57 +00:00
Griatch
6c53ec2bdb OBS: Run migrate! Made exit's destination into a database field for performance. Fixed a too greedy @reload that caused ContentTypes to loose information. Resolves issue 157.
Migrate with: "python manage.py migrate"
2011-04-08 23:10:04 +00:00
Griatch
695317e699 Resolves issue 155. Cleaned up the copy functionality and a few minor bugs at the same time. Copying an active character is somewhat confusing though (and deleting a character will currently make the player unable to log back in). 2011-04-07 22:10:51 +00:00
Griatch
126e2ea61f OBS: You need to resync your database! Moved cmdsets into the database rather than being dependent on scripts. Moved the creation of the cmdset- and cmdset-handlers into ObjectDB.__init__ rather than bootstrapping it from the typeclass. Added some more script functionality for testing, includong the @script command for assigning a script to an object. 2011-03-20 19:45:56 +00:00
Griatch
08b3de9e5e OBS: You'll need to resync/rebuild your database!
- This implements an updated, clearer and more robust access system. The policy is now to lock that which is not explicitly left open.
- Permission strings -> Lock strings. Separating permissions and locks makes more sense security-wise
- No more permissiongroup table; permissions instead use a simple tuple PERMISSIONS_HIERARCHY to define an access hierarchy
- Cleaner lock-definition syntax, all based on function calls.
- New objects/players/channels get a default security policy during creation (set through typeclass)

As part of rebuilding and testing the new lock/permission system I got into testing and debugging several other systems, fixing some
outstanding issues:
- @reload now fully updates the database asynchronously. No need to reboot server when changing cmdsets
- Dozens of new test suites added for about 30 commands so far
- Help for channels made more clever and informative.
2011-03-15 16:08:32 +00:00
Griatch
c2030c2c0c Resolves issue 139. 2011-03-14 08:41:47 +00:00
Griatch
9dcfea5971 Resolves issue 133. Added the location keyword to the ObjectDB.search() method for easier customizable object searches. 2011-02-27 22:55:42 +00:00
Griatch
2bdaf034c8 OBS: You need to resync your database! The Nickname system is now a separate database model with the result that also channel nicks are more robust. Also nickname replacement has been adjusted to fix some exceptional circumstances. Fixed a host of issues in the channel and nick handlers and adjoining commands that caused the channel-syscommands to fail in some situations. Resolves issue131. Resolves issue 132. Resolves issue 134. 2011-02-27 22:27:56 +00:00
Griatch
923b9ac2ec Added hooks at_pre_cmd() and at_post_cmd() for easy implementation of stuff like prompts.
Added obj.exit property to objects for easily finding all exits from a room.
2011-02-14 17:18:31 +00:00
Griatch
251f94aa7a Evennia now runs on its own Twisted webserver (no need for testserver or Apache if you don't want to). Evennia now also has an ajax long-polling web client running from Twisted. The web client requires no extra dependencies beyond jQuery which is included. The src/server structure has been r
cleaned up and rewritten to make it easier to add new protocols in the future - all new protocols need to inherit from server.session.Session, whi
ch implements a set of hooks that Evennia uses to communicate. The current web client protocol is functional but does not implement any of rcaskey
's suggestions as of yet - it uses a separate data object passed through msg() to communicate between the server and the various protocols. Also the client itself could probably need cleanup and 'prettification'. The fact that the system runs a hybrid of Django and Twisted, getting the best of both worlds should allow for many possibilities in the future. /Griatch
2010-12-07 02:34:59 +00:00
Griatch
7fb6362dc4 Added optional support for database migrations with south. The game/migrate.py program is a simple wrapper that runs the suitable commands for setting up a database and updating it, respectively. 2010-10-31 18:21:23 +00:00
Griatch
3f703efc2d Made changes to idmapper that might help alleviate issue101 (more people need to run it to make sure). Moved around default command modules to be more logically named and distributed. 2010-10-31 08:10:02 +00:00
Griatch
19dd476115 Changed object and alias search methods to be more effective. Made aliases a separate model to avoid overhead with large searches. The change of aliases meand you need to resync your database. 2010-10-30 18:42:37 +00:00
Griatch
547eb53b32 Made search(*playername) commands correctly return a Player typeclass and not a character. Initial startup/character creation: Default permissions are now assigned on player level rather than character level (this gives more safety to @puppet operations). Made @puppet command work only on Character objects. 2010-10-21 18:58:47 +00:00
Griatch
9459178c43 Fixed character swap mechanisms. Created an example command @puppet for switching control between characters (note that it does not currently check permissions, nor make sure the target has the appropriate cmdsets). 2010-10-18 21:07:26 +00:00
Griatch
745df8356f Added comprehensive encoding handling to support both player-level encoding choices as well as global multiple encodings through the settings file. 2010-10-03 19:11:43 +00:00
Griatch
8bedd4d793 Fixed and debugged object_search to more generically search for any attribute name except 'key' (issue110). Also included alias-search as a last-resort if normal searches fail. This is now also working for global searches (issue106). 2010-09-12 15:07:12 +00:00
Griatch
d90c2909a2 Fixed a lacking implementation in the Msg API. You need to re-sync the database since Msg now relies on three fields that where commented out before. 2010-09-04 12:18:00 +00:00
Griatch
4d8fc05157 Cleaned up the batch processors (both cmd- and code processor) and homogenized their interfaces and APIs. Also test-ran the example codes and fixed some bugs. 2010-09-02 11:39:01 +00:00
Griatch
f83c2bddf8 Trunk: Merged the Devel-branch (branches/griatch) into /trunk. This constitutes a major refactoring of Evennia. Development will now continue in trunk. See the wiki and the past posts to the mailing list for info. /Griatch 2010-08-29 18:46:58 +00:00
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
4d9081d710 Various cleanups in the recent modifications, and improvements to how time is handled and displayed.
.
Griatch
2009-11-25 19:27:32 +00:00
Griatch
1ea7e69821 Implemented persistent cache, events and gametime counter.
OBS - there is a new data table (for the persistent cache) so you need to sync or restart with your database.

* Persistent cache (pcache)- this works the same as the volatile cache, except it is regularly saved to disk and recovered upon restart. How often the pcache is backed up is set in preferences. This was heck of a tricky thing to get right due to the intricacies of pickle; for example it turns out there is a bug in cPickle, so only normal pickle works to store the cache objects.
* Persistent events - this makes use of the pcache to re-load the scheduled events every reload. Only events with the property "persistent" will be saved this way (if not set, events will get lost upon reboot, just like now). All the main system events have been implemented as persistent events, including a new event to regularly save the pcache to disk.
* In order to track persistent event timers across reboots, there is also a global "game time" defined now. This is saved in cache and counts seconds only when the server is running. Event timers are adjusted with an offset when restarting (otherwise they will be confused by the real time jumping forward after a downtime). There are also a small set of helpful routines in src/gametime.py to help convert from real time to game time (for easy creation of new events).
* Various info commands have been updated to incoorporate the time stamp and the cache sync information.
* There are a few test commands commented out in commands/general.py that I used for testing; I left them in if you want to test things quickly. It works here, but as always more people testing is needed.
/Griatch
2009-11-22 21:18:55 +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
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
239af1593d Fix issue #77, dealing with clearing objects out of a room being @dest'd. 2009-10-24 03:49:14 +00:00
Griatch
3be514ffdc Added high/low dbref limits to @find (Issue 59).
/Griatch
2009-10-22 20:59:19 +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
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
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
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
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
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