Commit graph

63 commits

Author SHA1 Message Date
Griatch
5b8906e08a Added a trivial check for ImportErrors inside a module imported by utils.mod_import. Resolves Issue 319. 2012-11-03 20:47:55 +01:00
Griatch
20d6de5104 Made a better check for cleaning module names, should resolve Issue 319. 2012-10-28 14:38:17 +01:00
Griatch
4dff822764 Fixed bug in @batchcommand (Resolves Issue 287). Also updated @dig to again handle deleting ranges of dbrefs (with or without # in front). 2012-10-14 16:24:21 +02:00
Griatch
8b582c9d3f Added a delay() function to src.utils.utils, useful for simple delays without needing a script. 2012-10-14 11:54:26 +02:00
Griatch
592bc26b99 Added remote function call abilities to AMP protocol, courtesy of patch by user Shell.
This allows for Server to call functions on Portal and vice-versa. Some rewrites and
cleanup done before applying /Griatch.
2012-10-14 11:53:34 +02:00
Griatch
0b102bb07b Fixed @batchcommand access, automatically disabling procpool under SQLite3. 2012-09-27 20:51:06 +02:00
Griatch
93d95377ce Shifting ProcPool out of src and into a contrib, using the service plugin system. 2012-09-22 20:40:30 +02:00
Griatch
0dae03156c Some optimizations, cleanup and a few bugfixes. Just changing a spurious property retrieval in the typeclass removed an extra, pointless database query. 2012-09-18 01:03:35 +02:00
Griatch
c53a9b5770 Changed how Objects are searched, using proper Django Q objects instead of hack-y evals to build queries. This has lead to a number of changes to the ObjectDB manager search. Notably there is now no way to supply a "location" to either of the manager search methods anymore. Instead you can now supply the keyword "candidates", a list of objects which should be used to limit the search. This is much more generic than giving location. The higher-level search (like caller.search, reached from commands) have not changed its API, so commands should work the same unless you are using the manager backbone directly. This search function is now using location to create the "candidates" list. Some other things, like matching for "me" and "here" have also been moved up to a level were it can be easily overloaded. "me" and "here" etc were also moved under i18n.
As part of this overhaul I implemented the partial_matching algorithm originally asked for by user "Adam_ASE" over IRC. This will allow for (local-only) partial matching of objects. So "big black sword" will now be matched by "bi", "sword", "bi bla" and so on. The partial matcher sits in src.utils.utils.py if one wants to use it for something else.
2012-09-17 15:31:50 +02:00
Griatch
cc6fa079b6 Added some more functionality to the copy method of objects, as well as some minor fixes. 2012-09-11 23:47:29 +02:00
Griatch
81dfeb6788 Added per-process timeout capability to run_async. Also changed contrib/evlang to use run_async 2012-09-03 21:16:54 +02:00
Griatch
ffcf4b3c2f Added cache-resyncing to ProcPool. This makes sure to update all affected object caches
whenever the subprocess returns (this is potentially not good enough for long-running scripts,
will have to ponder that one). Made ProcPool work with MySQL (where it works much better). Tested and fixed many
small bugs.
2012-09-03 01:11:14 +02:00
Griatch
275d00d4db Some more usability additions to the ProcPool system. Also made it default
to turned off when SQLite3 is used - SQLite3 doesn't support multiple
processes.
2012-09-02 18:57:25 +02:00
Griatch
575d7a86fa Made run_async also handle function calls through the ProcPool. 2012-09-02 16:54:07 +02:00
Griatch
e25ac1e46b Changed run_async to properly relay remote error messages to the user-supplied errback. 2012-09-02 16:14:08 +02:00
Griatch
056fee5c70 Changing all text files to explicitly have .txt endings. This helps online code browsers to properly identify the files. 2012-09-02 13:05:47 +02:00
Griatch
af99a80b4b Added procpool functionality for sending arbitrary data over the wire (including
nested databaseobjects). Rules are similar to Attribute saving.
Adding a missing component to the procpool setup.
2012-09-02 12:53:11 +02:00
Griatch
f5a889e40c Added new process-pool runner based on AMPoule (integrated into Evennia).
This allows e.g. utils.utils.run_async to offload long-running functions
to a completely different subprocess entirely, offering real parallelism.

Implementation is still experimental, notably not all objects can be
transferred safely across the wire; also there is no concept of
updating caches yet - so adding an object from the subprocess side
will not be known in the main thread yet (since caches cannot yet tell
the underlying database has changed).
2012-09-02 10:10:22 +02:00
Griatch
dcc7f29a91 OBS: run migrations! This changes the Msg model to work with ManyToManyFields rather than with custom string representations for storing multiple receivers or channels. It also expands the Msg object with a "title" field and various filter options. This should make it easier to implement mail-like operations using the comms system. 2012-08-30 00:05:00 +02:00
Griatch
f5caab093e Fixed a spurious error messages from the location setter when logging out (need to check None location) 2012-08-19 21:36:01 +02:00
Griatch
9e2ad59663 Added a fix for running with postgresql-psycopg2. This does not actually resolve the problem as much as circumvent it, so I'm not marking Issue 115 as closed just yet. 2012-06-16 14:51:22 +02:00
Griatch
96e95ca525 Raised Python requirement to 2.6+. Some spurious work on the mdsp support. 2012-05-05 23:52:13 +02:00
Griatch
14ed95ebfe Removed with statement, it's not well supported (without future import) in python 2.5. 2012-05-04 09:20:30 +00:00
Griatch
c49fbd7d99 Removed 'with' statement; it's available in Python2.5, but one needs to use the future import to do that, so easiest to remove it. Resolves issue 230. 2012-05-04 10:03:41 +02:00
Griatch
3091587e33 Added a timeout to the attribute caching; the system will now clean cache at regular intervals once it pass a certain size defined in settings. 2012-04-28 00:37:36 +02:00
Griatch
a8373c685f Some optimizations in one of the most expensive bits of the server, namely the command handler. 2012-04-25 18:47:03 +02:00
Griatch
3fba0bdbe3 Changed suggestion system to give more suggestions also if the help entry catches the exact match. 2012-04-22 21:54:28 +02:00
Griatch
0c292b5ff2 Changed how command not found errors are handled by default: Implemented a cos-likeness algorithm (Coling 2008) for comparing strings, which allows for decent suggestions and speed. 2012-04-22 16:36:31 +02:00
Griatch
4678234e9a Multiple fixes to ev and utils:
Made utils.variable_from_module more generic (it can now load pretty much any form of module it's given and also supports searching and returning multiple variables).

Removed the variable-load functionality from utils.load_module; this is now purely a loader - use variable_from_module instead.

I found out that one couldn't import from src.commands.default due to the __init__ file being restrictive for the sake of the ev API. Removed that and instead imported the default commands into ev.py with the help of utils.variable_from_module instead. Some more fixes in ev followed on this.
2012-04-22 12:23:42 +02:00
Griatch
6501f30cbc Fixed an elusive bug in utils.get_variable_from_module() that caused the connection screen to sometimes not load properly, due to the imported modules being erroneously extracted and used. 2012-04-15 19:05:50 +02:00
Griatch
75cc8bf1ad Added an initial brainstorm for a more fully-featured tutorial multiplayer game "Battle for Evennia". The idea is to use this as a basis for a series of tutorials on building a relatively complete game in Evennia. The details will probably change, so putting it up for comments from the community. 2012-03-31 21:10:34 +02:00
Griatch
c0322c9eae Cleaning some unnecessary whitespace, overall cleanup of various source codes. 2012-03-30 23:47:22 +02:00
Griatch
e042366f31 Removed the conf/ modules, putting them into conf/examples instead, in line with other API changes. The gamesrc/ folder is now completely empty and all new modules have to be added explicitly. 2012-03-25 19:52:51 +02:00
Griatch
88c0087fbd Updated game/ for the ev API. There will likely be some changes happening in the game/folder, in the way new objects are inherited. This should use the API rather than inherit from the basecommand/baseobject modules (these will probably into the example folders as vanilla templates instead). 2012-03-25 13:09:17 +02:00
Griatch
5beee55149 Added ability of @set command to actually store real Python types, not just strings. 2012-03-13 23:56:19 +01:00
Griatch
1fa5791e19 Added aggressive caching for common typeclassed variables. 2012-02-25 23:37:50 +01:00
Griatch
a0a205c945 Did some additions to the MSDP implementation. Added a first test for implementing MSDP commands, but it is not working yet. 2012-02-25 21:14:48 +01:00
Griatch
d36a79b2cc Went over the Command class' basic methods, cleaning up and optimizing while still trying to keep things clean, such as using cleverer loops and try...except instead of if statements. Also cleaned up the way attributes are retrieved. Results in roughly a halving of the time that the code spends in the command.py module. 2012-02-06 00:59:41 +01:00
Griatch
1d40f688e5 Added the @ban and @unban commands to the default command sets, allowing an admin to filter access from users without outright deleting their accounts. The ban list is stored in the database, but the checking is not hard-coded in the server/portal, but done in the normal login command(s), meaning it can be customized easily. Also contrib/menu_login has been updated to check for banned connections. 2012-01-27 23:53:03 +01:00
Griatch
fb78758356 Implemented working MCCP (data compression) and MSSP (mud-listing crawler support). Moved all user-level customization modules from gamesrc/world to gamesrc/conf to reduce clutter. 2011-11-20 11:52:01 +01:00
Griatch
bced571805 Added api functions for implementing protocols sending out-of-band data between server and portal (e.g. like GMCP) 2011-11-08 22:54:02 +01:00
Griatch
2b2d27ed39 Changed the way unloggedin commands work. Rather than the cmdhander having a special state for unlogged-in commands, the session itself simply stores the cmdset from settings.CMDSET_UNLOGGEDIN. Clean and efficient and also gives a lot more freedom for creating custom login mechanisms (notably it opens the door to using menu systems). 2011-11-06 17:38:29 +01:00
Griatch
f13e8cdf7c Trunk: Merged griatch-branch. This implements a new reload mechanism - splitting Evennia into two processes: Server and Portal with different tasks. Also cleans and fixes several bugs in script systems as well as introduces i18n (courtesy of raydeejay). 2011-09-03 10:22:19 +00:00
Griatch
2059fd9701 Fixed a bug that had global scripts think they were already running. Resolves issue 176. Made the @time command a tad more useful by having it report uptime also in seconds. 2011-08-06 18:56:05 +00:00
Griatch
b9c1921a0b Added a new 'contrib' folder for optional code snippets not suitable for the server core. Added contrib/menusystem for implementing a multi-choice menu system. Added contrib/lineeditor - a powerful line editor with commands mimicking VI. Also added an example NPC class using the menu system to allow for a conversation. As part of creating these contributions, lots of bugs were found and fixed. A new and more powerful cmdparser was intruduced as a result - this one is much easier to understand than the old one, while being more efficient and versatile. All testsuites were updated. Also: Resolves issue 165. 2011-05-12 21:51:11 +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
7b43c4a608 Added @cset command for changing a channel's access restriction settings. Added @cboot and a few more missing channel commands. Cleaned out the utils commands and fixed formatting on a few default commands. 2011-04-21 10:29:24 +00:00
Griatch
7f7016ad7d Run Migrate. Implemented @search functionality with limits as per MUX (as part of the @find command). Added some more channel-related commands and changed locks for channels to have a "control" lock type rather than "admin". The migration converts this in existing channels.. 2011-04-20 22:40:27 +00:00
Griatch
1ced5ee8f2 Added more compatibility checks for twisted.words in case IRC is activated. IMC2 implementation is cleaned up and converted to new comm system, but it's not working correctly and not usable. 2011-04-18 22:09:29 +00:00
Griatch
7d30b337d9 Cleanups and bug fixes. Fixed the @unlink command and also made it overally more stable. Resolves issue 161. Added more string conversion routines to handle non-ascii variables being stored in an Attribute. Resolves issue 160. 2011-04-16 22:26:22 +00:00