Changed all src/ and ev references to evennia
This commit is contained in:
parent
3ff937a6fd
commit
ad3f19896c
118 changed files with 565 additions and 661 deletions
|
|
@ -12,7 +12,7 @@ Modules in this folder is distributed under the same licence as
|
|||
Evennia unless noted differently in the individual module.
|
||||
|
||||
If you want to edit, tweak or expand on this code you should copy the
|
||||
things you want from here into game/gamesrc and change them there.
|
||||
things you want from here into your game folder and change them there.
|
||||
|
||||
* Evennia MenuSystem (Griatch 2011) - A base set of classes and
|
||||
cmdsets for creating in-game multiple-choice menus in
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ in-game.
|
|||
|
||||
"""
|
||||
|
||||
from ev import Command, Script, CmdSet
|
||||
from evennia import Command, Script, CmdSet
|
||||
|
||||
TRADE_TIMEOUT = 60 # timeout for B to accept trade
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ while puppeting a Character already before.
|
|||
|
||||
Installation:
|
||||
|
||||
Read the instructions in game/gamesrc/commands/examples/cmdset.py in
|
||||
Read the instructions in contrib/examples/cmdset.py in
|
||||
order to create a new default cmdset module for Evennia to use (copy
|
||||
the template up one level, and change the settings file's relevant
|
||||
variables to point to the cmdsets inside). If you already have such
|
||||
|
|
@ -32,8 +32,8 @@ following line to the end of OOCCmdSet's at_cmdset_creation():
|
|||
"""
|
||||
|
||||
from django.conf import settings
|
||||
from ev import Command, create_object, utils
|
||||
from ev import default_cmds, managers
|
||||
from evennia import Command, create_object, utils
|
||||
from evennia import default_cmds, managers
|
||||
|
||||
CHARACTER_TYPECLASS = settings.BASE_CHARACTER_TYPECLASS
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ class CmdOOCLook(default_cmds.CmdLook):
|
|||
|
||||
# making sure caller is really a player
|
||||
self.character = None
|
||||
if utils.inherits_from(self.caller, "src.objects.objects.Object"):
|
||||
if utils.inherits_from(self.caller, "evennia.objects.objects.Object"):
|
||||
# An object of some type is calling. Convert to player.
|
||||
#print self.caller, self.caller.__class__
|
||||
self.character = self.caller
|
||||
|
|
@ -149,7 +149,7 @@ class CmdOOCCharacterCreate(Command):
|
|||
|
||||
# making sure caller is really a player
|
||||
self.character = None
|
||||
if utils.inherits_from(self.caller, "src.objects.objects.Object"):
|
||||
if utils.inherits_from(self.caller, "evennia.objects.objects.Object"):
|
||||
# An object of some type is calling. Convert to player.
|
||||
#print self.caller, self.caller.__class__
|
||||
self.character = self.caller
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ After a reload the dice (or roll) command will be available in-game.
|
|||
|
||||
import re
|
||||
from random import randint
|
||||
from ev import default_cmds, CmdSet
|
||||
from evennia import default_cmds, CmdSet
|
||||
|
||||
|
||||
def roll_dice(dicenum, dicetype, modifier=None, conditional=None, return_tuple=False):
|
||||
|
|
|
|||
|
|
@ -24,24 +24,21 @@ That's it. Reload the server and try to log in to see it.
|
|||
|
||||
The initial login "graphic" will still not mention email addresses
|
||||
after this change. The login splash screen is taken from strings in
|
||||
the module given by settings.CONNECTION_SCREEN_MODULE. You will want
|
||||
to copy the template file in game/gamesrc/conf/examples up one level
|
||||
and re-point the settings file to this custom module. The "MUX_SCREEN"
|
||||
example in that file is the recommended one to use with this module.
|
||||
the module given by settings.CONNECTION_SCREEN_MODULE.
|
||||
|
||||
"""
|
||||
import re
|
||||
import traceback
|
||||
from django.conf import settings
|
||||
from src.players.models import PlayerDB
|
||||
from src.objects.models import ObjectDB
|
||||
from src.server.models import ServerConfig
|
||||
from src.comms.models import ChannelDB
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.comms.models import ChannelDB
|
||||
|
||||
from src.commands.cmdset import CmdSet
|
||||
from src.utils import create, logger, utils, ansi
|
||||
from src.commands.default.muxcommand import MuxCommand
|
||||
from src.commands.cmdhandler import CMD_LOGINSTART
|
||||
from evennia.commands.cmdset import CmdSet
|
||||
from evennia.utils import create, logger, utils, ansi
|
||||
from evennia.commands.default.muxcommand import MuxCommand
|
||||
from evennia.commands.cmdhandler import CMD_LOGINSTART
|
||||
|
||||
# limit symbol import for API
|
||||
__all__ = ("CmdUnconnectedConnect", "CmdUnconnectedCreate",
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ time comes.
|
|||
|
||||
An updated @desc command allows for setting seasonal descriptions.
|
||||
|
||||
The room uses the src.utils.gametime.GameTime global script. This is
|
||||
The room uses the evennia.utils.gametime.GameTime global script. This is
|
||||
started by default, but if you have deactivated it, you need to
|
||||
supply your own time keeping mechanism.
|
||||
|
||||
|
|
@ -69,10 +69,10 @@ Installation/testing:
|
|||
|
||||
import re
|
||||
from django.conf import settings
|
||||
from ev import Room
|
||||
from ev import gametime
|
||||
from ev import default_cmds
|
||||
from ev import utils
|
||||
from evennia import Room
|
||||
from evennia import gametime
|
||||
from evennia import default_cmds
|
||||
from evennia import utils
|
||||
|
||||
# error return function, needed by Extended Look command
|
||||
_AT_SEARCH_RESULT = utils.variable_from_module(*settings.SEARCH_AT_RESULT.rsplit('.', 1))
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ module. To use it just import and add it to your default cmdset.
|
|||
"""
|
||||
|
||||
import re
|
||||
from ev import Command, CmdSet, utils
|
||||
from ev import syscmdkeys
|
||||
from evennia import Command, CmdSet, utils
|
||||
from evennia import syscmdkeys
|
||||
from contrib.menusystem import prompt_yesno
|
||||
|
||||
CMD_NOMATCH = syscmdkeys.CMD_NOMATCH
|
||||
|
|
|
|||
|
|
@ -20,23 +20,18 @@ CMDSET_UNLOGGEDIN = "contrib.menu_login.UnloggedInCmdSet"
|
|||
That's it. Reload the server and try to log in to see it.
|
||||
|
||||
The initial login "graphic" is taken from strings in the module given
|
||||
by settings.CONNECTION_SCREEN_MODULE. You will want to copy the
|
||||
template file in game/gamesrc/conf/examples up one level and re-point
|
||||
the settings file to this custom module. you can then edit the string
|
||||
in that module (at least comment out the default string that mentions
|
||||
commands that are not available) and add something more suitable for
|
||||
the initial splash screen.
|
||||
by settings.CONNECTION_SCREEN_MODULE.
|
||||
|
||||
"""
|
||||
|
||||
import re
|
||||
import traceback
|
||||
from django.conf import settings
|
||||
from ev import managers
|
||||
from ev import utils, logger, create_player
|
||||
from ev import Command, CmdSet
|
||||
from ev import syscmdkeys
|
||||
from src.server.models import ServerConfig
|
||||
from evennia import managers
|
||||
from evennia import utils, logger, create_player
|
||||
from evennia import Command, CmdSet
|
||||
from evennia import syscmdkeys
|
||||
from evennia.server.models import ServerConfig
|
||||
|
||||
from contrib.menusystem import MenuNode, MenuTree
|
||||
|
||||
|
|
|
|||
|
|
@ -18,20 +18,14 @@ There is also a simple Yes/No function supplied. This will create a
|
|||
one-off Yes/No question and executes a given code depending on which
|
||||
choice was made.
|
||||
|
||||
To test, make sure to follow the instructions in
|
||||
game/gamesrc/commands/examples/cmdset.py (copy the template up one level
|
||||
and change settings to point to the relevant cmdsets within). If you
|
||||
already have such a module, you can of course use that. Next you
|
||||
import and add the CmdTestMenu command to the end of the default cmdset in
|
||||
this custom module.
|
||||
The test command is also a good example of how to use this module in code.
|
||||
To test, add this to the default cmdset
|
||||
|
||||
"""
|
||||
from types import MethodType
|
||||
from ev import syscmdkeys
|
||||
from evennia import syscmdkeys
|
||||
|
||||
from ev import Command, CmdSet, utils
|
||||
from ev import default_cmds, logger
|
||||
from evennia import Command, CmdSet, utils
|
||||
from evennia import default_cmds, logger
|
||||
|
||||
# imported only to make it available during execution of code blocks
|
||||
import ev
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ python_procpool.py - this implements a way to execute arbitrary python
|
|||
code on the procpool. Import run_async() from this
|
||||
module in order to use this functionality in-code
|
||||
(this is a replacement to the in-process run_async
|
||||
found in src.utils.utils).
|
||||
found in evennia.utils.utils).
|
||||
python_procpool_plugin.py - this is a plugin module for the python
|
||||
procpool, to start and add it to the server. Adding it
|
||||
is a single line in your settings file - see the header
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ down the line.
|
|||
|
||||
Changes made by Evennia are minor - it's mainly limiting spam to the
|
||||
log and an added ability to turn this on/off through settings. Most
|
||||
Evennia related code are found in src/server/procpool.py and
|
||||
src/server/server.py.
|
||||
Evennia related code are found in evennia/server/procpool.py and
|
||||
evennia/server/server.py.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ The python_process pool is a service activated with the instructions
|
|||
in python_procpool_plugin.py.
|
||||
|
||||
To use, import run_async from this module and use instead of the
|
||||
in-process version found in src.utils.utils. Note that this is a much
|
||||
in-process version found in evennia.utils.utils. Note that this is a much
|
||||
more complex function than the default run_async, so make sure to read
|
||||
the header carefully.
|
||||
|
||||
|
|
@ -31,10 +31,10 @@ _return statement, to test it really is asynchronous.
|
|||
from twisted.protocols import amp
|
||||
from twisted.internet import threads
|
||||
from contrib.procpools.ampoule.child import AMPChild
|
||||
from src.utils.dbserialize import to_pickle, from_pickle, do_pickle, do_unpickle
|
||||
from src.utils.idmapper.base import PROC_MODIFIED_OBJS
|
||||
from src.utils.utils import clean_object_caches, to_str
|
||||
from src.utils import logger
|
||||
from evennia.utils.dbserialize import to_pickle, from_pickle, do_pickle, do_unpickle
|
||||
from evennia.utils.idmapper.base import PROC_MODIFIED_OBJS
|
||||
from evennia.utils.utils import clean_object_caches, to_str
|
||||
from evennia.utils import logger
|
||||
|
||||
|
||||
#
|
||||
|
|
@ -250,7 +250,7 @@ def run_async(to_execute, *args, **kwargs):
|
|||
|
||||
if _PPOOL is None:
|
||||
# Try to load process Pool
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
try:
|
||||
_PPOOL = _SESSIONS.server.services.namedServices.get(procpool_name).pool
|
||||
except AttributeError:
|
||||
|
|
|
|||
|
|
@ -12,11 +12,6 @@ SERVER_SERVICES_PLUGIN_MODULES.append("contrib.procpools.python_procpool_plugin"
|
|||
|
||||
Next reboot the server and the new service will be available.
|
||||
|
||||
If you want to adjust the defaults, copy this file to
|
||||
game/gamesrc/conf/ and re-point
|
||||
settings.SERVER_SERVICES_PLUGINS_MODULES to that file instead. This
|
||||
is to avoid clashes with eventual upstream modifications to this file.
|
||||
|
||||
It is not recommended to use this with an SQLite3 database, at least
|
||||
if you plan to do many out-of-process database writes. SQLite3 does
|
||||
not work very well with a high frequency of off-process writes due to
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ cmdset - this way you can often re-use the commands too.
|
|||
"""
|
||||
|
||||
import random
|
||||
from ev import Command, CmdSet
|
||||
from evennia import Command, CmdSet
|
||||
|
||||
# Some simple commands for the red button
|
||||
|
||||
|
|
@ -312,8 +312,8 @@ class BlindCmdSet(CmdSet):
|
|||
|
||||
def at_cmdset_creation(self):
|
||||
"Setup the blind cmdset"
|
||||
from src.commands.default.general import CmdSay
|
||||
from src.commands.default.general import CmdPose
|
||||
from evennia.commands.default.general import CmdSay
|
||||
from evennia.commands.default.general import CmdPose
|
||||
self.add(CmdSay())
|
||||
self.add(CmdPose())
|
||||
self.add(CmdBlindLook())
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ Create this button with
|
|||
Note that you must drop the button before you can see its messages!
|
||||
"""
|
||||
import random
|
||||
from ev import Object
|
||||
from game.gamesrc.scripts.examples import red_button_scripts as scriptexamples
|
||||
from game.gamesrc.commands.examples import cmdset_red_button as cmdsetexamples
|
||||
from evennia import Object
|
||||
from contrib.examples import red_button_scripts as scriptexamples
|
||||
from contrib.examples import cmdset_red_button as cmdsetexamples
|
||||
|
||||
#
|
||||
# Definition of the object itself
|
||||
|
|
@ -23,7 +23,7 @@ from game.gamesrc.commands.examples import cmdset_red_button as cmdsetexamples
|
|||
class RedButton(Object):
|
||||
"""
|
||||
This class describes an evil red button. It will use the script
|
||||
definition in game/gamesrc/events/example.py to blink at regular
|
||||
definition in contrib/examples/red_button_scripts to blink at regular
|
||||
intervals. It also uses a series of script and commands to handle
|
||||
pushing the button and causing effects when doing so.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
Example of scripts.
|
||||
|
||||
These are scripts intended for a particular object - the
|
||||
red_button object type in gamesrc/types/examples. A few variations
|
||||
red_button object type in contrib/examples. A few variations
|
||||
on uses of scripts are included.
|
||||
|
||||
"""
|
||||
from ev import Script
|
||||
from game.gamesrc.commands.examples import cmdset_red_button as cmdsetexamples
|
||||
from evennia import Script
|
||||
from contrib.examples import cmdset_red_button as cmdsetexamples
|
||||
|
||||
#
|
||||
# Scripts as state-managers
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ TickerHandler might be better.
|
|||
|
||||
"""
|
||||
|
||||
from ev import Exit, utils, Command
|
||||
from evennia import Exit, utils, Command
|
||||
|
||||
MOVE_DELAY = {"stroll": 6,
|
||||
"walk": 4,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ mob implementation.
|
|||
|
||||
"""
|
||||
|
||||
from ev import Object, CmdSet, default_cmds
|
||||
from evennia import Object, CmdSet, default_cmds
|
||||
from contrib import menusystem
|
||||
|
||||
|
||||
|
|
@ -122,4 +122,4 @@ class TalkingNPC(Object):
|
|||
self.db.conversation = CONV
|
||||
self.db.desc = "This is a talkative NPC."
|
||||
# assign the talk command to npc
|
||||
self.cmdset.add_default(TalkingCmdSet, permanent=True)
|
||||
self.cmdset.add_default(TalkingCmdSet, permanent=True)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ object based on that mobile class.
|
|||
import random, time
|
||||
from django.conf import settings
|
||||
|
||||
from ev import search_object, utils, Script
|
||||
from evennia import search_object, utils, Script
|
||||
from contrib.tutorial_world import objects as tut_objects
|
||||
from contrib.tutorial_world import scripts as tut_scripts
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ WeaponRack
|
|||
import time
|
||||
import random
|
||||
|
||||
from ev import create_object
|
||||
from ev import DefaultObject, DefaultExit, Command, CmdSet, Script
|
||||
from evennia import create_object
|
||||
from evennia import DefaultObject, DefaultExit, Command, CmdSet, Script
|
||||
|
||||
#------------------------------------------------------------
|
||||
#
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ Room Typeclasses for the TutorialWorld.
|
|||
"""
|
||||
|
||||
import random
|
||||
from ev import CmdSet, Script, Command, DefaultRoom
|
||||
from ev import utils, create_object, search_object
|
||||
from evennia import CmdSet, Script, Command, DefaultRoom
|
||||
from evennia import utils, create_object, search_object
|
||||
from contrib.tutorial_world import scripts as tut_scripts
|
||||
from contrib.tutorial_world.objects import LightSource, TutorialObject
|
||||
|
||||
|
|
@ -210,8 +210,8 @@ class CmdDarkHelp(Command):
|
|||
|
||||
# the nomatch system command will give a suitable error when we cannot find
|
||||
# the normal commands.
|
||||
from src.commands.default.syscommands import CMD_NOMATCH
|
||||
from src.commands.default.general import CmdSay
|
||||
from evennia.commands.default.syscommands import CMD_NOMATCH
|
||||
from evennia.commands.default.general import CmdSay
|
||||
|
||||
|
||||
class CmdDarkNoMatch(Command):
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ This defines some generally useful scripts for the tutorial world.
|
|||
"""
|
||||
|
||||
import random
|
||||
from ev import Script
|
||||
from evennia import Script
|
||||
|
||||
|
||||
#------------------------------------------------------------
|
||||
|
|
@ -111,4 +111,4 @@ class FastIrregularEvent(IrregularEvent):
|
|||
# try:
|
||||
# obj.scriptlink.reset()
|
||||
# except:
|
||||
# logger.log_errmsg(traceback.print_exc())
|
||||
# logger.log_errmsg(traceback.print_exc())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue