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
|
|
@ -462,8 +462,8 @@ def init_game_directory(path):
|
|||
global SERVER_RESTART, PORTAL_RESTART
|
||||
global EVENNIA_VERSION
|
||||
|
||||
SERVER_PY_FILE = os.path.join(settings.SRC_DIR, "server/server.py")
|
||||
PORTAL_PY_FILE = os.path.join(settings.SRC_DIR, "portal/server.py")
|
||||
SERVER_PY_FILE = os.path.join(settings.LIB_DIR, "server/server.py")
|
||||
PORTAL_PY_FILE = os.path.join(settings.LIB_DIR, "portal/server.py")
|
||||
|
||||
SERVER_PIDFILE = os.path.join(GAMEDIR, SERVERDIR, "server.pid")
|
||||
PORTAL_PIDFILE = os.path.join(GAMEDIR, SERVERDIR, "portal.pid")
|
||||
|
|
@ -535,7 +535,7 @@ def create_superuser():
|
|||
def check_database(automigrate=False):
|
||||
# Check so a database exists and is accessible
|
||||
from django.db import DatabaseError
|
||||
from src.players.models import PlayerDB
|
||||
from evennia.players.models import PlayerDB
|
||||
try:
|
||||
PlayerDB.objects.get(id=1)
|
||||
except DatabaseError, e:
|
||||
|
|
@ -768,7 +768,7 @@ def error_check_python_modules():
|
|||
# cmdsets
|
||||
|
||||
deprstring = "settings.%s should be renamed to %s. If defaults are used, " \
|
||||
"their path/classname must be updated (see src/settings_default.py)."
|
||||
"their path/classname must be updated (see evennia/settings_default.py)."
|
||||
if hasattr(settings, "CMDSET_DEFAULT"):
|
||||
raise DeprecationWarning(deprstring % ("CMDSET_DEFAULT", "CMDSET_CHARACTER"))
|
||||
if hasattr(settings, "CMDSET_OOC"):
|
||||
|
|
@ -781,9 +781,9 @@ def error_check_python_modules():
|
|||
raise DeprecationWarning(deprstring % ("COMM_TYPECLASS_PATHS", "CHANNEL_TYPECLASS_PATHS"))
|
||||
if hasattr(settings, "CHARACTER_DEFAULT_HOME"):
|
||||
raise DeprecationWarning("settings.CHARACTER_DEFAULT_HOME should be renamed to DEFAULT_HOME. " \
|
||||
"See also settings.START_LOCATION (see src/settings_default.py).")
|
||||
"See also settings.START_LOCATION (see evennia/settings_default.py).")
|
||||
|
||||
from src.commands import cmdsethandler
|
||||
from evennia.commands import cmdsethandler
|
||||
if not cmdsethandler.import_cmdset(settings.CMDSET_UNLOGGEDIN, None): print "Warning: CMDSET_UNLOGGED failed to load!"
|
||||
if not cmdsethandler.import_cmdset(settings.CMDSET_CHARACTER, None): print "Warning: CMDSET_CHARACTER failed to load"
|
||||
if not cmdsethandler.import_cmdset(settings.CMDSET_PLAYER, None): print "Warning: CMDSET_PLAYER failed to load"
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ django.setup()
|
|||
from django.conf import settings
|
||||
|
||||
# Setup access of the evennia server itself
|
||||
SERVER_PY_FILE = os.path.join(settings.SRC_DIR, 'server/server.py')
|
||||
PORTAL_PY_FILE = os.path.join(settings.SRC_DIR, 'server/portal/portal.py')
|
||||
SERVER_PY_FILE = os.path.join(settings.LIB_DIR, 'server/server.py')
|
||||
PORTAL_PY_FILE = os.path.join(settings.LIB_DIR, 'server/portal/portal.py')
|
||||
|
||||
# Get logfile names
|
||||
SERVER_LOGFILE = settings.SERVER_LOG_FILE
|
||||
|
|
@ -315,6 +315,6 @@ def main():
|
|||
start_services(server_argv, portal_argv)
|
||||
|
||||
if __name__ == '__main__':
|
||||
from src.utils.utils import check_evennia_dependencies
|
||||
from evennia.utils.utils import check_evennia_dependencies
|
||||
if check_evennia_dependencies():
|
||||
main()
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ DOXYFILE_ENCODING = UTF-8
|
|||
PROJECT_NAME = "Evennia"
|
||||
PROJECT_NUMBER = Git-Beta
|
||||
PROJECT_BRIEF = Python MUD development system
|
||||
PROJECT_LOGO = ../../src/web/media/images/evennia_logo.png
|
||||
PROJECT_LOGO = ../../evennia/web/media/images/evennia_logo.png
|
||||
OUTPUT_DIRECTORY =
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class DefaultCmds(_EvContainer):
|
|||
"""
|
||||
This container holds direct shortcuts to all default commands in Evennia.
|
||||
|
||||
To access in code, do 'from ev import default_cmds' then
|
||||
To access in code, do 'from evennia import default_cmds' then
|
||||
access the properties on the imported default_cmds object.
|
||||
|
||||
"""
|
||||
|
|
@ -163,7 +163,7 @@ class DefaultCmds(_EvContainer):
|
|||
cmdlist = utils.variable_from_module(module, module.__all__)
|
||||
self.__dict__.update(dict([(c.__name__, c) for c in cmdlist]))
|
||||
|
||||
from src.commands.default import (admin, batchprocess,
|
||||
from commands.default import (admin, batchprocess,
|
||||
building, comms, general,
|
||||
player, help, system, unloggedin)
|
||||
add_cmds(admin)
|
||||
|
|
@ -195,11 +195,11 @@ class SystemCmds(_EvContainer):
|
|||
first command when a player connects to
|
||||
the server.
|
||||
|
||||
To access in code, do 'from ev import syscmdkeys' then
|
||||
To access in code, do 'from evennia import syscmdkeys' then
|
||||
access the properties on the imported syscmdkeys object.
|
||||
|
||||
"""
|
||||
from src.commands import cmdhandler
|
||||
from commands import cmdhandler
|
||||
CMD_NOINPUT = cmdhandler.CMD_NOINPUT
|
||||
CMD_NOMATCH = cmdhandler.CMD_NOMATCH
|
||||
CMD_MULTIMATCH = cmdhandler.CMD_MULTIMATCH
|
||||
|
|
|
|||
|
|
@ -2,13 +2,4 @@
|
|||
Makes it easier to import by grouping all relevant things already at this
|
||||
level.
|
||||
|
||||
You can henceforth import most things directly from src.comms
|
||||
Also, the initiated object manager is available as src.comms.msgmanager and
|
||||
src.comms.channelmanager.
|
||||
|
||||
"""
|
||||
|
||||
#from src.comms.models import *
|
||||
|
||||
#msgmanager = Msg.objects
|
||||
#channelmanager = ChannelDB.objects
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
#
|
||||
|
||||
from django.contrib import admin
|
||||
from src.comms.models import ChannelDB
|
||||
from src.typeclasses.admin import AttributeInline, TagInline
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.typeclasses.admin import AttributeInline, TagInline
|
||||
|
||||
|
||||
class ChannelAttributeInline(AttributeInline):
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ update() on the channelhandler. Or use Channel.objects.delete() which
|
|||
does this for you.
|
||||
|
||||
"""
|
||||
from src.comms.models import ChannelDB
|
||||
from src.commands import cmdset, command
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.commands import cmdset, command
|
||||
|
||||
|
||||
class ChannelCommand(command.Command):
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ Default Typeclass for Comms.
|
|||
|
||||
See objects.objects for more information on Typeclassing.
|
||||
"""
|
||||
from src.typeclasses.models import TypeclassBase
|
||||
from src.comms.models import Msg, TempMsg, ChannelDB
|
||||
from src.comms.managers import ChannelManager
|
||||
from src.utils import logger
|
||||
from src.utils.utils import make_iter
|
||||
from evennia.typeclasses.models import TypeclassBase
|
||||
from evennia.comms.models import Msg, TempMsg, ChannelDB
|
||||
from evennia.comms.managers import ChannelManager
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import make_iter
|
||||
|
||||
|
||||
class Channel(ChannelDB):
|
||||
|
|
@ -110,7 +110,7 @@ class Channel(ChannelDB):
|
|||
self.attributes.clear()
|
||||
self.aliases.clear()
|
||||
super(Channel, self).delete()
|
||||
from src.comms.channelhandler import CHANNELHANDLER
|
||||
from evennia.comms.channelhandler import CHANNELHANDLER
|
||||
CHANNELHANDLER.update()
|
||||
|
||||
def channel_prefix(self, msg=None, emit=False):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ These managers handles the
|
|||
|
||||
from django.db import models
|
||||
from django.db.models import Q
|
||||
from src.typeclasses.managers import (TypedObjectManager, TypeclassManager,
|
||||
from evennia.typeclasses.managers import (TypedObjectManager, TypeclassManager,
|
||||
returns_typeclass_list, returns_typeclass)
|
||||
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -48,11 +48,11 @@ def identify_object(inp):
|
|||
# load global stores
|
||||
global _PlayerDB, _ObjectDB, _ChannelDB
|
||||
if not _PlayerDB:
|
||||
from src.players.models import PlayerDB as _PlayerDB
|
||||
from evennia.players.models import PlayerDB as _PlayerDB
|
||||
if not _ObjectDB:
|
||||
from src.objects.models import ObjectDB as _ObjectDB
|
||||
from evennia.objects.models import ObjectDB as _ObjectDB
|
||||
if not _ChannelDB:
|
||||
from src.comms.models import ChannelDB as _ChannelDB
|
||||
from evennia.comms.models import ChannelDB as _ChannelDB
|
||||
|
||||
if not inp:
|
||||
return inp, None
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ be able to delete connections on the fly).
|
|||
from datetime import datetime
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from src.typeclasses.models import TypedObject
|
||||
from src.utils.idmapper.models import SharedMemoryModel
|
||||
from src.comms import managers
|
||||
from src.comms.managers import identify_object
|
||||
from src.locks.lockhandler import LockHandler
|
||||
from src.utils.utils import crop, make_iter, lazy_property
|
||||
from evennia.typeclasses.models import TypedObject
|
||||
from evennia.utils.idmapper.models import SharedMemoryModel
|
||||
from evennia.comms import managers
|
||||
from evennia.comms.managers import identify_object
|
||||
from evennia.locks.lockhandler import LockHandler
|
||||
from evennia.utils.utils import crop, make_iter, lazy_property
|
||||
|
||||
__all__ = ("Msg", "TempMsg", "ChannelDB")
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ class ChannelDB(TypedObject):
|
|||
objects = managers.ChannelDBManager()
|
||||
|
||||
_typeclass_paths = settings.CHANNEL_TYPECLASS_PATHS
|
||||
_default_typeclass_path = settings.BASE_CHANNEL_TYPECLASS or "src.comms.comms.Channel"
|
||||
_default_typeclass_path = settings.BASE_CHANNEL_TYPECLASS or "evennia.comms.comms.Channel"
|
||||
|
||||
class Meta:
|
||||
"Define Django meta options"
|
||||
|
|
|
|||
|
|
@ -1,11 +1 @@
|
|||
"""
|
||||
Makes it easier to import by grouping all relevant things already at this level.
|
||||
|
||||
You can henceforth import most things directly from src.help
|
||||
Also, the initiated object manager is available as src.help.manager.
|
||||
|
||||
"""
|
||||
|
||||
#from src.help.models import *
|
||||
#
|
||||
#manager = HelpEntry.objects
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ This defines how to edit help entries in Admin.
|
|||
"""
|
||||
from django import forms
|
||||
from django.contrib import admin
|
||||
from src.help.models import HelpEntry
|
||||
from evennia.help.models import HelpEntry
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Custom manager for HelpEntry objects.
|
||||
"""
|
||||
from django.db import models
|
||||
from src.utils import logger, utils
|
||||
from evennia.utils import logger, utils
|
||||
__all__ = ("HelpEntryManager",)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ game world, policy info, rules and similar.
|
|||
|
||||
"""
|
||||
from django.db import models
|
||||
from src.utils.idmapper.models import SharedMemoryModel
|
||||
from src.help.manager import HelpEntryManager
|
||||
from src.typeclasses.models import Tag, TagHandler
|
||||
from src.locks.lockhandler import LockHandler
|
||||
from src.utils.utils import lazy_property
|
||||
from evennia.utils.idmapper.models import SharedMemoryModel
|
||||
from evennia.help.manager import HelpEntryManager
|
||||
from evennia.typeclasses.models import Tag, TagHandler
|
||||
from evennia.locks.lockhandler import LockHandler
|
||||
from evennia.utils.utils import lazy_property
|
||||
__all__ = ("HelpEntry",)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,14 +82,14 @@ DefaultLock: Exits: controls who may traverse the exit to
|
|||
"""
|
||||
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
|
||||
_PERMISSION_HIERARCHY = [p.lower() for p in settings.PERMISSION_HIERARCHY]
|
||||
|
||||
|
||||
def _to_player(accessing_obj):
|
||||
"Helper function. Makes sure an accessing object is a player object"
|
||||
if utils.inherits_from(accessing_obj, "src.objects.objects.Object"):
|
||||
if utils.inherits_from(accessing_obj, "evennia.objects.objects.Object"):
|
||||
# an object. Convert to player.
|
||||
accessing_obj = accessing_obj.player
|
||||
return accessing_obj
|
||||
|
|
@ -158,7 +158,7 @@ def perm(accessing_obj, accessed_obj, *args, **kwargs):
|
|||
except (AttributeError, IndexError):
|
||||
return False
|
||||
|
||||
if utils.inherits_from(accessing_obj, "src.objects.objects.Object") and accessing_obj.player:
|
||||
if utils.inherits_from(accessing_obj, "evennia.objects.objects.Object") and accessing_obj.player:
|
||||
player = accessing_obj.player
|
||||
perms_player = [p.lower() for p in player.permissions.all()]
|
||||
is_quell = player.attributes.get("_quell")
|
||||
|
|
@ -503,7 +503,7 @@ def serversetting(accessing_obj, accessed_obj, *args, **kwargs):
|
|||
|
||||
Usage:
|
||||
serversetting(IRC_ENABLED)
|
||||
serversetting(BASE_SCRIPT_PATH, [game.gamesrc.scripts])
|
||||
serversetting(BASE_SCRIPT_PATH, ['types'])
|
||||
|
||||
A given True/False or integers will be converted properly.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ to any other identifier you can use.
|
|||
import re
|
||||
import inspect
|
||||
from django.conf import settings
|
||||
from src.utils import logger, utils
|
||||
from evennia.utils import logger, utils
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
__all__ = ("LockHandler", "LockException")
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ except ImportError:
|
|||
from django.test import TestCase
|
||||
|
||||
from django.conf import settings
|
||||
from src.locks import lockfuncs
|
||||
from src.utils import create
|
||||
from evennia.locks import lockfuncs
|
||||
from evennia.utils import create
|
||||
|
||||
#------------------------------------------------------------
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
"""
|
||||
Makes it easier to import by grouping all relevant things already at this level.
|
||||
|
||||
You can henceforth import most things directly from src.objects
|
||||
Also, the initiated object manager is available as src.objects.manager.
|
||||
|
||||
"""
|
||||
|
||||
#from src.objects.objects import *
|
||||
#from src.objects.models import ObjectDB
|
||||
#manager = ObjectDB.objects
|
||||
|
|
@ -6,8 +6,8 @@
|
|||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from src.typeclasses.admin import AttributeInline, TagInline
|
||||
from src.objects.models import ObjectDB
|
||||
from evennia.typeclasses.admin import AttributeInline, TagInline
|
||||
from evennia.objects.models import ObjectDB
|
||||
|
||||
|
||||
class ObjectAttributeInline(AttributeInline):
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ from itertools import chain
|
|||
from django.db.models import Q
|
||||
from django.conf import settings
|
||||
from django.db.models.fields import exceptions
|
||||
from src.typeclasses.managers import TypedObjectManager, TypeclassManager
|
||||
from src.typeclasses.managers import returns_typeclass, returns_typeclass_list
|
||||
from src.utils import utils
|
||||
from src.utils.utils import to_unicode, is_iter, make_iter, string_partial_matching
|
||||
from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
|
||||
from evennia.typeclasses.managers import returns_typeclass, returns_typeclass_list
|
||||
from evennia.utils import utils
|
||||
from evennia.utils.utils import to_unicode, is_iter, make_iter, string_partial_matching
|
||||
|
||||
__all__ = ("ObjectManager",)
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -124,7 +124,7 @@ class ObjectDBManager(TypedObjectManager):
|
|||
# We have to loop for safety since the referenced lookup gives deepcopy error if attribute value is an object.
|
||||
global _ATTR
|
||||
if not _ATTR:
|
||||
from src.typeclasses.models import Attribute as _ATTR
|
||||
from evennia.typeclasses.models import Attribute as _ATTR
|
||||
cands = list(self.filter(cand_restriction & type_restriction & Q(db_attributes__db_key=attribute_name)))
|
||||
results = [attr.objectdb_set.all() for attr in _ATTR.objects.filter(objectdb__in=cands, db_value=attribute_value)]
|
||||
return chain(*results)
|
||||
|
|
@ -164,7 +164,7 @@ class ObjectDBManager(TypedObjectManager):
|
|||
except exceptions.FieldError:
|
||||
return []
|
||||
except ValueError:
|
||||
from src.utils import logger
|
||||
from evennia.utils import logger
|
||||
logger.log_errmsg("The property '%s' does not support search criteria of the type %s." % (property_name, type(property_value)))
|
||||
return []
|
||||
|
||||
|
|
@ -374,8 +374,8 @@ class ObjectDBManager(TypedObjectManager):
|
|||
new_destination = original_object.destination
|
||||
|
||||
# create new object
|
||||
from src.utils import create
|
||||
from src.scripts.models import ScriptDB
|
||||
from evennia.utils import create
|
||||
from evennia.scripts.models import ScriptDB
|
||||
new_object = create.create_object(typeclass_path,
|
||||
key=new_key,
|
||||
location=new_location,
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ from django.db import models
|
|||
from django.conf import settings
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
||||
from src.typeclasses.models import TypedObject
|
||||
from src.objects.manager import ObjectDBManager
|
||||
from src.utils import logger
|
||||
from src.utils.utils import (make_iter, dbref)
|
||||
from evennia.typeclasses.models import TypedObject
|
||||
from evennia.objects.manager import ObjectDBManager
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import (make_iter, dbref)
|
||||
|
||||
|
||||
#------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -18,16 +18,16 @@ they control by simply linking to a new object's user property.
|
|||
import traceback
|
||||
from django.conf import settings
|
||||
|
||||
from src.typeclasses.models import TypeclassBase
|
||||
from src.typeclasses.attributes import NickHandler
|
||||
from src.objects.manager import ObjectManager
|
||||
from src.objects.models import ObjectDB
|
||||
from src.scripts.scripthandler import ScriptHandler
|
||||
from src.commands import cmdset, command
|
||||
from src.commands.cmdsethandler import CmdSetHandler
|
||||
from src.commands import cmdhandler
|
||||
from src.utils.logger import log_depmsg, log_trace, log_errmsg
|
||||
from src.utils.utils import (variable_from_module, lazy_property,
|
||||
from evennia.typeclasses.models import TypeclassBase
|
||||
from evennia.typeclasses.attributes import NickHandler
|
||||
from evennia.objects.manager import ObjectManager
|
||||
from evennia.objects.models import ObjectDB
|
||||
from evennia.scripts.scripthandler import ScriptHandler
|
||||
from evennia.commands import cmdset, command
|
||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||
from evennia.commands import cmdhandler
|
||||
from evennia.utils.logger import log_depmsg, log_trace, log_errmsg
|
||||
from evennia.utils.utils import (variable_from_module, lazy_property,
|
||||
make_iter, to_str, to_unicode)
|
||||
|
||||
MULTISESSION_MODE = settings.MULTISESSION_MODE
|
||||
|
|
@ -145,7 +145,7 @@ class DefaultObject(ObjectDB):
|
|||
cmdset - cmdset-handler. Use cmdset.add() to add new cmdsets to object
|
||||
nicks - nick-handler. New nicks with nicks.add().
|
||||
|
||||
* Helper methods (see src.objects.objects.py for full headers)
|
||||
* Helper methods (see evennia.objects.objects.py for full headers)
|
||||
|
||||
search(ostring, global_search=False, use_nicks=True,
|
||||
typeclass=None,
|
||||
|
|
@ -504,7 +504,7 @@ class DefaultObject(ObjectDB):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
|
||||
text = to_str(text, force_string=True) if text else ""
|
||||
|
||||
|
|
@ -772,7 +772,7 @@ class DefaultObject(ObjectDB):
|
|||
"""
|
||||
global _ScriptDB
|
||||
if not _ScriptDB:
|
||||
from src.scripts.models import ScriptDB as _ScriptDB
|
||||
from evennia.scripts.models import ScriptDB as _ScriptDB
|
||||
|
||||
if self.delete_iter > 0:
|
||||
# make sure to only call delete once on this object
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
"""
|
||||
Makes it easier to import by grouping all relevant things already at this
|
||||
level.
|
||||
|
||||
You can henceforth import most things directly from src.player
|
||||
Also, the initiated object manager is available as src.players.manager.
|
||||
|
||||
"""
|
||||
|
||||
#from src.players.player import *
|
||||
#from src.players.models import PlayerDB
|
||||
#
|
||||
#manager = PlayerDB.objects
|
||||
|
|
@ -8,9 +8,9 @@ from django.conf import settings
|
|||
from django.contrib import admin
|
||||
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
|
||||
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
||||
from src.players.models import PlayerDB
|
||||
from src.typeclasses.admin import AttributeInline, TagInline
|
||||
from src.utils import create
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.typeclasses.admin import AttributeInline, TagInline
|
||||
from evennia.utils import create
|
||||
|
||||
|
||||
# handle the custom User editor
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ Player that are controlled by the server.
|
|||
"""
|
||||
|
||||
from django.conf import settings
|
||||
from src.players.player import DefaultPlayer
|
||||
from src.scripts.scripts import Script
|
||||
from src.commands.command import Command
|
||||
from src.commands.cmdset import CmdSet
|
||||
from src.utils import search
|
||||
from evennia.players.player import DefaultPlayer
|
||||
from evennia.scripts.scripts import Script
|
||||
from evennia.commands.command import Command
|
||||
from evennia.commands.cmdset import CmdSet
|
||||
from evennia.utils import search
|
||||
|
||||
_IDLE_TIMEOUT = settings.IDLE_TIMEOUT
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ class BotStarter(Script):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
for session in _SESSIONS.sessions_from_player(self.player):
|
||||
session.update_session_counters(idle=True)
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ class IRCBot(Bot):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
|
||||
# if keywords are given, store (the BotStarter script
|
||||
# will not give any keywords, so this should normally only
|
||||
|
|
@ -186,7 +186,7 @@ class IRCBot(Bot):
|
|||
"channel": self.db.irc_channel ,
|
||||
"network": self.db.irc_network,
|
||||
"port": self.db.irc_port}
|
||||
_SESSIONS.start_bot_session("src.server.portal.irc.IRCBotFactory", configdict)
|
||||
_SESSIONS.start_bot_session("evennia.server.portal.irc.IRCBotFactory", configdict)
|
||||
|
||||
def msg(self, text=None, **kwargs):
|
||||
"""
|
||||
|
|
@ -229,7 +229,7 @@ class RSSBot(Bot):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
|
||||
if ev_channel:
|
||||
# connect to Evennia channel
|
||||
|
|
@ -247,7 +247,7 @@ class RSSBot(Bot):
|
|||
configdict = {"uid": self.dbid,
|
||||
"url": self.db.rss_url,
|
||||
"rate": self.db.rss_rate}
|
||||
_SESSIONS.start_bot_session("src.server.portal.rss.RSSBotFactory", configdict)
|
||||
_SESSIONS.start_bot_session("evennia.server.portal.rss.RSSBotFactory", configdict)
|
||||
|
||||
def execute_cmd(self, text=None, sessid=None):
|
||||
"""
|
||||
|
|
@ -277,7 +277,7 @@ class IMC2Bot(Bot):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
if ev_channel:
|
||||
# connect to Evennia channel
|
||||
channel = search.channel_search(ev_channel)
|
||||
|
|
@ -308,7 +308,7 @@ class IMC2Bot(Bot):
|
|||
"client_pwd": self.db.client_pwd,
|
||||
"server_pwd": self.db.server_pwd}
|
||||
|
||||
_SESSIONS.start_bot_session("src.server.portal.imc2.IMC2BotFactory", configdict)
|
||||
_SESSIONS.start_bot_session("evennia.server.portal.imc2.IMC2BotFactory", configdict)
|
||||
|
||||
def msg(self, text=None, **kwargs):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ The managers for the custom Player object and permissions.
|
|||
import datetime
|
||||
from django.contrib.auth.models import UserManager
|
||||
#from functools import update_wrapper
|
||||
from src.typeclasses.managers import (returns_typeclass_list, returns_typeclass,
|
||||
from evennia.typeclasses.managers import (returns_typeclass_list, returns_typeclass,
|
||||
TypedObjectManager, TypeclassManager)
|
||||
#from src.utils import logger
|
||||
#from evennia.utils import logger
|
||||
__all__ = ("PlayerManager",)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ from django.db import models
|
|||
from django.contrib.auth.models import AbstractUser
|
||||
from django.utils.encoding import smart_str
|
||||
|
||||
from src.players.manager import PlayerDBManager
|
||||
from src.typeclasses.models import TypedObject
|
||||
from src.utils.utils import make_iter
|
||||
from evennia.players.manager import PlayerDBManager
|
||||
from evennia.typeclasses.models import TypedObject
|
||||
from evennia.utils.utils import make_iter
|
||||
|
||||
__all__ = ("PlayerDB",)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,19 +13,19 @@ instead for most things).
|
|||
|
||||
import datetime
|
||||
from django.conf import settings
|
||||
from src.typeclasses.models import TypeclassBase
|
||||
from src.players.manager import PlayerManager
|
||||
from src.players.models import PlayerDB
|
||||
from src.comms.models import ChannelDB
|
||||
from src.commands import cmdhandler
|
||||
from src.scripts.models import ScriptDB
|
||||
from src.utils import logger
|
||||
from src.utils.utils import (lazy_property, to_str,
|
||||
from evennia.typeclasses.models import TypeclassBase
|
||||
from evennia.players.manager import PlayerManager
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.commands import cmdhandler
|
||||
from evennia.scripts.models import ScriptDB
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import (lazy_property, to_str,
|
||||
make_iter, to_unicode,
|
||||
variable_from_module)
|
||||
from src.typeclasses.attributes import NickHandler
|
||||
from src.scripts.scripthandler import ScriptHandler
|
||||
from src.commands.cmdsethandler import CmdSetHandler
|
||||
from evennia.typeclasses.attributes import NickHandler
|
||||
from evennia.scripts.scripthandler import ScriptHandler
|
||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
|
@ -135,14 +135,14 @@ class DefaultPlayer(PlayerDB):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
return _SESSIONS.session_from_player(self, sessid)
|
||||
|
||||
def get_all_sessions(self):
|
||||
"Return all sessions connected to this player"
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
return _SESSIONS.sessions_from_player(self)
|
||||
sessions = property(get_all_sessions) # alias shortcut
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
"""
|
||||
Makes it easier to import by grouping all relevant things already at this
|
||||
level.
|
||||
|
||||
You can henceforth import most things directly from src.scripts
|
||||
Also, the initiated object manager is available as src.scripts.manager.
|
||||
|
||||
"""
|
||||
|
||||
# Note - we MUST NOT import src.scripts.scripts here, or
|
||||
# proxy models will fall under Django migrations.
|
||||
#from src.scripts.scripts import *
|
||||
#from src.scripts.models import ScriptDB
|
||||
|
||||
#manager = ScriptDB.objects
|
||||
|
|
@ -2,9 +2,9 @@
|
|||
# This sets up how models are displayed
|
||||
# in the web admin interface.
|
||||
#
|
||||
from src.typeclasses.admin import AttributeInline, TagInline
|
||||
from evennia.typeclasses.admin import AttributeInline, TagInline
|
||||
|
||||
from src.scripts.models import ScriptDB
|
||||
from evennia.scripts.models import ScriptDB
|
||||
from django.contrib import admin
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ The custom manager for Scripts.
|
|||
"""
|
||||
|
||||
from django.db.models import Q
|
||||
from src.typeclasses.managers import TypedObjectManager, TypeclassManager
|
||||
from src.typeclasses.managers import returns_typeclass_list
|
||||
from src.utils.utils import make_iter
|
||||
from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
|
||||
from evennia.typeclasses.managers import returns_typeclass_list
|
||||
from evennia.utils.utils import make_iter
|
||||
__all__ = ("ScriptManager",)
|
||||
_GA = object.__getattribute__
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ class ScriptDBManager(TypedObjectManager):
|
|||
new_obj = new_obj if new_obj is not None else original_script.obj
|
||||
new_locks = new_locks if new_locks is not None else original_script.db_lock_storage
|
||||
|
||||
from src.utils import create
|
||||
from evennia.utils import create
|
||||
new_script = create.create_script(typeclass, key=new_key, obj=new_obj,
|
||||
locks=new_locks, autostart=True)
|
||||
return new_script
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ Common examples of uses of Scripts:
|
|||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from src.typeclasses.models import TypedObject
|
||||
from src.scripts.manager import ScriptDBManager
|
||||
from src.utils.utils import dbref, to_str
|
||||
from evennia.typeclasses.models import TypedObject
|
||||
from evennia.scripts.manager import ScriptDBManager
|
||||
from evennia.utils.utils import dbref, to_str
|
||||
|
||||
__all__ = ("ScriptDB",)
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -132,7 +132,7 @@ class ScriptDB(TypedObject):
|
|||
except AttributeError:
|
||||
pass
|
||||
if isinstance(value, (basestring, int)):
|
||||
from src.objects.models import ObjectDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
value = to_str(value, force_string=True)
|
||||
if (value.isdigit() or value.startswith("#")):
|
||||
dbid = dbref(value, reqhash=False)
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ An scripthandler is automatically added to all game objects. You
|
|||
access it through the property 'scripts' on the game object.
|
||||
"""
|
||||
|
||||
from src.scripts.models import ScriptDB
|
||||
from src.utils import create
|
||||
from src.utils import logger
|
||||
from evennia.scripts.models import ScriptDB
|
||||
from evennia.utils import create
|
||||
from evennia.utils import logger
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ It also defines a few common scripts.
|
|||
from twisted.internet.defer import Deferred, maybeDeferred
|
||||
from twisted.internet.task import LoopingCall
|
||||
from django.conf import settings
|
||||
from src.typeclasses.models import TypeclassBase
|
||||
from django.utils.translation import ugettext as _
|
||||
from src.scripts.models import ScriptDB
|
||||
from src.scripts.manager import ScriptManager
|
||||
from src.comms import channelhandler
|
||||
from src.utils import logger
|
||||
from evennia.typeclasses.models import TypeclassBase
|
||||
from evennia.scripts.models import ScriptDB
|
||||
from evennia.scripts.manager import ScriptManager
|
||||
from evennia.comms import channelhandler
|
||||
from evennia.utils import logger
|
||||
|
||||
__all__ = ["Script", "DoNothing", "CheckSessions",
|
||||
"ValidateScripts", "ValidateChannelHandler"]
|
||||
|
|
@ -555,7 +555,7 @@ class CheckSessions(Script):
|
|||
"called every 60 seconds"
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
#print "session check!"
|
||||
#print "ValidateSessions run"
|
||||
_SESSIONS.validate_sessions()
|
||||
|
|
@ -576,7 +576,7 @@ class ValidateIdmapperCache(Script):
|
|||
"Called every ~5 mins"
|
||||
global _FLUSH_CACHE
|
||||
if not _FLUSH_CACHE:
|
||||
from src.utils.idmapper.base import conditional_flush as _FLUSH_CACHE
|
||||
from evennia.utils.idmapper.base import conditional_flush as _FLUSH_CACHE
|
||||
_FLUSH_CACHE(_IDMAPPER_CACHE_MAX_MEMORY)
|
||||
|
||||
class ValidateScripts(Script):
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ server reloads and be started automaticall on boot.
|
|||
|
||||
Example:
|
||||
|
||||
from src.scripts.tickerhandler import TICKER_HANDLER
|
||||
from evennia.scripts.tickerhandler import TICKER_HANDLER
|
||||
|
||||
# tick myobj every 15 seconds
|
||||
TICKER_HANDLER.add(myobj, 15)
|
||||
|
|
@ -49,10 +49,10 @@ call the handler's save() and restore() methods when the server reboots.
|
|||
|
||||
"""
|
||||
from twisted.internet.defer import inlineCallbacks
|
||||
from src.scripts.scripts import ExtendedLoopingCall
|
||||
from src.server.models import ServerConfig
|
||||
from src.utils.logger import log_trace
|
||||
from src.utils.dbserialize import dbserialize, dbunserialize, pack_dbobj, unpack_dbobj
|
||||
from evennia.scripts.scripts import ExtendedLoopingCall
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.utils.logger import log_trace
|
||||
from evennia.utils.dbserialize import dbserialize, dbunserialize, pack_dbobj, unpack_dbobj
|
||||
|
||||
_GA = object.__getattribute__
|
||||
_SA = object.__setattr__
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
"""
|
||||
Makes it easier to import by grouping all relevant things already at this level.
|
||||
|
||||
You can henceforth import most things directly from src.server
|
||||
Also, the initiated object manager is available as src.server.manager.
|
||||
|
||||
"""
|
||||
|
||||
from src.server.models import *
|
||||
manager = ServerConfig.objects
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
|
||||
from django.contrib import admin
|
||||
from src.server.models import ServerConfig
|
||||
from evennia.server.models import ServerConfig
|
||||
|
||||
|
||||
class ServerConfigAdmin(admin.ModelAdmin):
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ except ImportError:
|
|||
from twisted.protocols import amp
|
||||
from twisted.internet import protocol
|
||||
from twisted.internet.defer import Deferred
|
||||
from src.utils.utils import to_str, variable_from_module
|
||||
from evennia.utils.utils import to_str, variable_from_module
|
||||
|
||||
# communication bits
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import os
|
|||
import threading
|
||||
from collections import defaultdict
|
||||
|
||||
from src.server.models import ServerConfig
|
||||
from src.utils.utils import uses_database, to_str, get_evennia_pids
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.utils.utils import uses_database, to_str, get_evennia_pids
|
||||
|
||||
_GA = object.__getattribute__
|
||||
_SA = object.__setattr__
|
||||
|
|
@ -79,7 +79,7 @@ def hashid(obj, suffix=""):
|
|||
# Cache callback handlers
|
||||
#------------------------------------------------------------
|
||||
|
||||
# callback to field pre_save signal (connected in src.server.server)
|
||||
# callback to field pre_save signal (connected in evennia.server.server)
|
||||
#def field_pre_save(sender, instance=None, update_fields=None, raw=False, **kwargs):
|
||||
# """
|
||||
# Called at the beginning of the field save operation. The save method
|
||||
|
|
|
|||
|
|
@ -8,12 +8,10 @@ Everything starts at handle_setup()
|
|||
|
||||
import django
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.utils.translation import ugettext as _
|
||||
from src.players.models import PlayerDB
|
||||
from src.server.models import ServerConfig
|
||||
from src.utils import create
|
||||
from src.utils.utils import class_from_module
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.utils import create
|
||||
|
||||
def create_config_values():
|
||||
"""
|
||||
|
|
@ -151,7 +149,7 @@ def create_system_scripts():
|
|||
Setup the system repeat scripts. They are automatically started
|
||||
by the create_script function.
|
||||
"""
|
||||
from src.scripts import scripts
|
||||
from evennia.scripts import scripts
|
||||
|
||||
print " Creating and starting global scripts ..."
|
||||
|
||||
|
|
@ -176,7 +174,7 @@ def start_game_time():
|
|||
(the uptime can also be found directly from the server though).
|
||||
"""
|
||||
print " Starting in-game time ..."
|
||||
from src.utils import gametime
|
||||
from evennia.utils import gametime
|
||||
gametime.init_gametime()
|
||||
|
||||
|
||||
|
|
@ -206,7 +204,7 @@ def reset_server():
|
|||
ones, particularly it cleans all caches for the special objects.
|
||||
It also checks so the warm-reset mechanism works as it should.
|
||||
"""
|
||||
from src.server.sessionhandler import SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS
|
||||
print " Initial setup complete. Restarting Server once."
|
||||
SESSIONS.server.shutdown(mode='reset')
|
||||
|
||||
|
|
@ -250,15 +248,15 @@ def handle_setup(last_step):
|
|||
setup_func()
|
||||
except Exception:
|
||||
if last_step + num == 2:
|
||||
from src.players.models import PlayerDB
|
||||
from src.objects.models import ObjectDB
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
|
||||
for obj in ObjectDB.objects.all():
|
||||
obj.delete()
|
||||
for profile in PlayerDB.objects.all():
|
||||
profile.delete()
|
||||
elif last_step + num == 3:
|
||||
from src.comms.models import ChannelDB
|
||||
from evennia.comms.models import ChannelDB
|
||||
ChannelDB.objects.all().delete()
|
||||
raise
|
||||
ServerConfig.objects.conf("last_initial_setup_step", last_step + num + 1)
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ except ImportError:
|
|||
import pickle
|
||||
|
||||
from django.db import models
|
||||
from src.utils.idmapper.models import WeakSharedMemoryModel
|
||||
from src.utils import logger, utils
|
||||
from src.server.manager import ServerConfigManager
|
||||
from evennia.utils.idmapper.models import WeakSharedMemoryModel
|
||||
from evennia.utils import logger, utils
|
||||
from evennia.server.manager import ServerConfigManager
|
||||
|
||||
|
||||
#------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -37,14 +37,12 @@ messages.
|
|||
from inspect import isfunction
|
||||
from twisted.internet.defer import inlineCallbacks
|
||||
from django.conf import settings
|
||||
from src.server.models import ServerConfig
|
||||
from src.server.sessionhandler import SESSIONS
|
||||
#from src.scripts.scripts import Script
|
||||
#from src.utils.create import create_script
|
||||
from src.scripts.tickerhandler import Ticker, TickerPool, TickerHandler
|
||||
from src.utils.dbserialize import dbserialize, dbunserialize, pack_dbobj, unpack_dbobj
|
||||
from src.utils import logger
|
||||
from src.utils.utils import all_from_module, make_iter, to_str
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.server.sessionhandler import SESSIONS
|
||||
from evennia.scripts.tickerhandler import Ticker, TickerPool, TickerHandler
|
||||
from evennia.utils.dbserialize import dbserialize, dbunserialize, pack_dbobj, unpack_dbobj
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import all_from_module, make_iter, to_str
|
||||
|
||||
_SA = object.__setattr__
|
||||
_GA = object.__getattribute__
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ from twisted.application import internet
|
|||
from twisted.internet import protocol
|
||||
from twisted.conch import telnet
|
||||
|
||||
from src.server.session import Session
|
||||
from src.utils import logger, utils
|
||||
from src.server.portal.imc2lib import imc2_ansi
|
||||
from src.server.portal.imc2lib import imc2_packets as pck
|
||||
from evennia.server.session import Session
|
||||
from evennia.utils import logger, utils
|
||||
from evennia.server.portal.imc2lib import imc2_ansi
|
||||
from evennia.server.portal.imc2lib import imc2_packets as pck
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
|
@ -337,7 +337,7 @@ class IMC2Bot(telnet.StatefulTelnetProtocol, Session):
|
|||
class IMC2BotFactory(protocol.ReconnectingClientFactory):
|
||||
"""
|
||||
Creates instances of the IMC2Protocol. Should really only ever
|
||||
need to create one connection. Tied in via src/server.py.
|
||||
need to create one connection. Tied in via evennia/server.py.
|
||||
"""
|
||||
initialDelay = 1
|
||||
factor = 1.5
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ This is a IMC2 complacent version.
|
|||
"""
|
||||
|
||||
import re
|
||||
from src.utils import ansi
|
||||
from evennia.utils import ansi
|
||||
|
||||
|
||||
class IMCANSIParser(ansi.ANSIParser):
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ more Evennia channels.
|
|||
from twisted.application import internet
|
||||
from twisted.words.protocols import irc
|
||||
from twisted.internet import protocol
|
||||
from src.server.session import Session
|
||||
from src.utils import logger
|
||||
from evennia.server.session import Session
|
||||
from evennia.utils import logger
|
||||
|
||||
|
||||
# IRC bot
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ etc.
|
|||
|
||||
"""
|
||||
import re
|
||||
from src.utils.utils import to_str
|
||||
from evennia.utils.utils import to_str
|
||||
|
||||
# MSDP-relevant telnet cmd/opt-codes
|
||||
MSDP = chr(69)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ active players and so on.
|
|||
|
||||
"""
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
|
||||
MSSP = chr(70)
|
||||
MSSP_VAR = chr(1)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ it when the size changes
|
|||
|
||||
"""
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
|
||||
NAWS = chr(31)
|
||||
IS = chr(0)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ if os.name == 'nt':
|
|||
# For Windows batchfile we need an extra path insertion here.
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
|
||||
os.path.dirname(os.path.abspath(__file__))))))
|
||||
from src.server.webserver import EvenniaReverseProxyResource
|
||||
from evennia.server.webserver import EvenniaReverseProxyResource
|
||||
from twisted.application import internet, service
|
||||
from twisted.internet import protocol, reactor
|
||||
from twisted.web import server
|
||||
|
|
@ -23,8 +23,8 @@ import django
|
|||
django.setup()
|
||||
|
||||
from django.conf import settings
|
||||
from src.utils.utils import get_evennia_version, mod_import, make_iter
|
||||
from src.server.portal.portalsessionhandler import PORTAL_SESSIONS
|
||||
from evennia.utils.utils import get_evennia_version, mod_import, make_iter
|
||||
from evennia.server.portal.portalsessionhandler import PORTAL_SESSIONS
|
||||
|
||||
PORTAL_SERVICES_PLUGIN_MODULES = [mod_import(module) for module in make_iter(settings.PORTAL_SERVICES_PLUGIN_MODULES)]
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ if AMP_ENABLED:
|
|||
# the portal and the mud server. Only reason to ever deactivate
|
||||
# it would be during testing and debugging.
|
||||
|
||||
from src.server import amp
|
||||
from evennia.server import amp
|
||||
|
||||
print ' amp (to Server): %s' % AMP_PORT
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ if TELNET_ENABLED:
|
|||
|
||||
# Start telnet game connections
|
||||
|
||||
from src.server.portal import telnet
|
||||
from evennia.server.portal import telnet
|
||||
|
||||
for interface in TELNET_INTERFACES:
|
||||
ifacestr = ""
|
||||
|
|
@ -203,7 +203,7 @@ if SSL_ENABLED:
|
|||
|
||||
# Start SSL game connection (requires PyOpenSSL).
|
||||
|
||||
from src.server.portal import ssl
|
||||
from evennia.server.portal import ssl
|
||||
|
||||
for interface in SSL_INTERFACES:
|
||||
ifacestr = ""
|
||||
|
|
@ -229,7 +229,7 @@ if SSH_ENABLED:
|
|||
# Start SSH game connections. Will create a keypair in
|
||||
# evennia/game if necessary.
|
||||
|
||||
from src.server.portal import ssh
|
||||
from evennia.server.portal import ssh
|
||||
|
||||
for interface in SSH_INTERFACES:
|
||||
ifacestr = ""
|
||||
|
|
@ -262,7 +262,7 @@ if WEBSERVER_ENABLED:
|
|||
webclientstr = ""
|
||||
if WEBCLIENT_ENABLED:
|
||||
# create ajax client processes at /webclientdata
|
||||
from src.server.portal.webclient import WebClient
|
||||
from evennia.server.portal.webclient import WebClient
|
||||
|
||||
webclient = WebClient()
|
||||
webclient.sessionhandler = PORTAL_SESSIONS
|
||||
|
|
@ -272,8 +272,8 @@ if WEBSERVER_ENABLED:
|
|||
if WEBSOCKET_CLIENT_ENABLED and not websocket_started:
|
||||
# start websocket client port for the webclient
|
||||
# we only support one websocket client
|
||||
from src.server.portal import websocket_client
|
||||
from src.utils.txws import WebSocketFactory
|
||||
from evennia.server.portal import websocket_client
|
||||
from evennia.utils.txws import WebSocketFactory
|
||||
|
||||
interface = WEBSOCKET_CLIENT_INTERFACE
|
||||
port = WEBSOCKET_CLIENT_PORT
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Sessionhandler for portal sessions
|
||||
"""
|
||||
import time
|
||||
from src.server.sessionhandler import SessionHandler, PCONN, PDISCONN, PSYNC, PCONNSYNC
|
||||
from evennia.server.sessionhandler import SessionHandler, PCONN, PDISCONN, PSYNC, PCONNSYNC
|
||||
|
||||
_MOD_IMPORT = None
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ class PortalSessionHandler(SessionHandler):
|
|||
|
||||
protocol_path - full python path to the class factory
|
||||
for the protocol used, eg
|
||||
'src.server.portal.irc.IRCClientFactory'
|
||||
'evennia.server.portal.irc.IRCClientFactory'
|
||||
config - dictionary of configuration options, fed as **kwarg
|
||||
to protocol class' __init__ method.
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ class PortalSessionHandler(SessionHandler):
|
|||
"""
|
||||
global _MOD_IMPORT
|
||||
if not _MOD_IMPORT:
|
||||
from src.utils.utils import variable_from_module as _MOD_IMPORT
|
||||
from evennia.utils.utils import variable_from_module as _MOD_IMPORT
|
||||
path, clsname = protocol_path.rsplit(".", 1)
|
||||
cls = _MOD_IMPORT(path, clsname)
|
||||
if not cls:
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ to the channel whenever the feed updates.
|
|||
|
||||
from twisted.internet import task, threads
|
||||
from django.conf import settings
|
||||
from src.server.session import Session
|
||||
from src.utils import logger
|
||||
from evennia.server.session import Session
|
||||
from evennia.utils import logger
|
||||
|
||||
RSS_ENABLED = settings.RSS_ENABLED
|
||||
#RETAG = re.compile(r'<[^>]*?>')
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ from twisted.internet import defer
|
|||
from twisted.conch import interfaces as iconch
|
||||
from twisted.python import components
|
||||
from django.conf import settings
|
||||
from src.server import session
|
||||
from src.players.models import PlayerDB
|
||||
from src.utils import ansi, utils
|
||||
from evennia.server import session
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.utils import ansi, utils
|
||||
|
||||
ENCODINGS = settings.ENCODINGS
|
||||
|
||||
|
|
@ -343,4 +343,4 @@ def makeFactory(configdict):
|
|||
|
||||
factory.portal.registerChecker(PlayerDBPasswordChecker(factory))
|
||||
|
||||
return factory
|
||||
return factory
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ except ImportError:
|
|||
print " SSL_ENABLED requires PyOpenSSL."
|
||||
sys.exit(5)
|
||||
|
||||
from src.server.portal.telnet import TelnetProtocol
|
||||
from evennia.server.portal.telnet import TelnetProtocol
|
||||
|
||||
|
||||
class SSLProtocol(TelnetProtocol):
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ sessions etc.
|
|||
|
||||
import re
|
||||
from twisted.conch.telnet import Telnet, StatefulTelnetProtocol, IAC, LINEMODE, GA, WILL, WONT, ECHO
|
||||
from src.server.session import Session
|
||||
from src.server.portal import ttype, mssp, msdp, naws
|
||||
from src.server.portal.mccp import Mccp, mccp_compress, MCCP
|
||||
from src.server.portal.mxp import Mxp, mxp_parse
|
||||
from src.utils import utils, ansi, logger
|
||||
from evennia.server.session import Session
|
||||
from evennia.server.portal import ttype, mssp, msdp, naws
|
||||
from evennia.server.portal.mccp import Mccp, mccp_compress, MCCP
|
||||
from evennia.server.portal.mxp import Mxp, mxp_parse
|
||||
from evennia.utils import utils, ansi, logger
|
||||
|
||||
_RE_N = re.compile(r"\{n$")
|
||||
_RE_LEND = re.compile(r"\n$|\r$", re.MULTILINE)
|
||||
|
|
@ -58,7 +58,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
self.sessionhandler.connect(self)
|
||||
|
||||
# timeout the handshakes in case the client doesn't reply at all
|
||||
from src.utils.utils import delay
|
||||
from evennia.utils.utils import delay
|
||||
delay(2, callback=self.handshake_done, retval=True)
|
||||
|
||||
def handshake_done(self, force=False):
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ from twisted.web import server, resource
|
|||
from django.utils.functional import Promise
|
||||
from django.utils.encoding import force_unicode
|
||||
from django.conf import settings
|
||||
from src.utils import utils, logger
|
||||
from src.utils.text2html import parse_html
|
||||
from src.server import session
|
||||
from evennia.utils import utils, logger
|
||||
from evennia.utils.text2html import parse_html
|
||||
from evennia.server import session
|
||||
|
||||
SERVERNAME = settings.SERVERNAME
|
||||
ENCODINGS = settings.ENCODINGS
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Websocket-webclient
|
|||
|
||||
This implements a webclient with WebSockets (http://en.wikipedia.org/wiki/WebSocket)
|
||||
by use of the txws implementation (https://github.com/MostAwesomeDude/txWS). It is
|
||||
used together with src/web/media/javascript/evennia_websocket_webclient.js.
|
||||
used together with evennia/web/media/javascript/evennia_websocket_webclient.js.
|
||||
|
||||
Thanks to Ricard Pillosu whose Evennia plugin inspired this module.
|
||||
|
||||
|
|
@ -29,10 +29,10 @@ Example of call from a javascript client:
|
|||
"""
|
||||
import json
|
||||
from twisted.internet.protocol import Protocol
|
||||
from src.server.session import Session
|
||||
from src.utils.logger import log_trace
|
||||
from src.utils.utils import to_str, make_iter
|
||||
from src.utils.text2html import parse_html
|
||||
from evennia.server.session import Session
|
||||
from evennia.utils.logger import log_trace
|
||||
from evennia.utils.utils import to_str, make_iter
|
||||
from evennia.utils.text2html import parse_html
|
||||
|
||||
|
||||
class WebSocketClient(Protocol, Session):
|
||||
|
|
|
|||
|
|
@ -23,23 +23,23 @@ django.setup()
|
|||
from django.db import connection
|
||||
from django.conf import settings
|
||||
|
||||
from src.players.models import PlayerDB
|
||||
from src.scripts.models import ScriptDB
|
||||
from src.server.models import ServerConfig
|
||||
from src.server import initial_setup
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.scripts.models import ScriptDB
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.server import initial_setup
|
||||
|
||||
from src.utils.utils import get_evennia_version, mod_import, make_iter
|
||||
from src.comms import channelhandler
|
||||
from src.server.sessionhandler import SESSIONS
|
||||
from evennia.utils.utils import get_evennia_version, mod_import, make_iter
|
||||
from evennia.comms import channelhandler
|
||||
from evennia.server.sessionhandler import SESSIONS
|
||||
|
||||
# setting up server-side field cache
|
||||
|
||||
from django.db.models.signals import post_save
|
||||
from src.server.caches import field_post_save
|
||||
from evennia.server.caches import field_post_save
|
||||
#pre_save.connect(field_pre_save, dispatch_uid="fieldcache")
|
||||
post_save.connect(field_post_save, dispatch_uid="fieldcache")
|
||||
|
||||
#from src.server.caches import post_attr_update
|
||||
#from evennia.server.caches import post_attr_update
|
||||
#from django.db.models.signals import m2m_changed
|
||||
|
||||
# connect to attribute cache signal
|
||||
|
|
@ -169,9 +169,9 @@ class Evennia(object):
|
|||
if len(mismatches): # can't use any() since mismatches may be [0] which reads as False for any()
|
||||
# we have a changed default. Import relevant objects and
|
||||
# run the update
|
||||
from src.objects.models import ObjectDB
|
||||
from src.comms.models import ChannelDB
|
||||
#from src.players.models import PlayerDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
from evennia.comms.models import ChannelDB
|
||||
#from evennia.players.models import PlayerDB
|
||||
for i, prev, curr in ((i, tup[0], tup[1]) for i, tup in enumerate(settings_compare) if i in mismatches):
|
||||
# update the database
|
||||
print " %s:\n '%s' changed to '%s'. Updating unchanged entries in database ..." % (settings_names[i], prev, curr)
|
||||
|
|
@ -225,8 +225,8 @@ class Evennia(object):
|
|||
"""
|
||||
Called every server start
|
||||
"""
|
||||
from src.objects.models import ObjectDB
|
||||
#from src.players.models import PlayerDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
#from evennia.players.models import PlayerDB
|
||||
|
||||
#update eventual changed defaults
|
||||
self.update_defaults()
|
||||
|
|
@ -238,10 +238,10 @@ class Evennia(object):
|
|||
with open(SERVER_RESTART, 'r') as f:
|
||||
mode = f.read()
|
||||
if mode in ('True', 'reload'):
|
||||
from src.server.oobhandler import OOB_HANDLER
|
||||
from evennia.server.oobhandler import OOB_HANDLER
|
||||
OOB_HANDLER.restore()
|
||||
|
||||
from src.scripts.tickerhandler import TICKER_HANDLER
|
||||
from evennia.scripts.tickerhandler import TICKER_HANDLER
|
||||
TICKER_HANDLER.restore()
|
||||
|
||||
# call correct server hook based on start file value
|
||||
|
|
@ -299,9 +299,9 @@ class Evennia(object):
|
|||
mode = self.set_restart_mode(mode)
|
||||
# call shutdown hooks on all cached objects
|
||||
|
||||
from src.objects.models import ObjectDB
|
||||
#from src.players.models import PlayerDB
|
||||
from src.server.models import ServerConfig
|
||||
from evennia.objects.models import ObjectDB
|
||||
#from evennia.players.models import PlayerDB
|
||||
from evennia.server.models import ServerConfig
|
||||
|
||||
if mode == 'reload':
|
||||
# call restart hooks
|
||||
|
|
@ -312,9 +312,9 @@ class Evennia(object):
|
|||
yield self.sessions.all_sessions_portal_sync()
|
||||
ServerConfig.objects.conf("server_restart_mode", "reload")
|
||||
|
||||
from src.server.oobhandler import OOB_HANDLER
|
||||
from evennia.server.oobhandler import OOB_HANDLER
|
||||
OOB_HANDLER.save()
|
||||
from src.scripts.tickerhandler import TICKER_HANDLER
|
||||
from evennia.scripts.tickerhandler import TICKER_HANDLER
|
||||
TICKER_HANDLER.save()
|
||||
|
||||
self.at_server_reload_stop()
|
||||
|
|
@ -337,7 +337,7 @@ class Evennia(object):
|
|||
self.at_server_cold_stop()
|
||||
|
||||
# stopping time
|
||||
from src.utils import gametime
|
||||
from evennia.utils import gametime
|
||||
gametime.save()
|
||||
|
||||
self.at_server_stop()
|
||||
|
|
@ -439,7 +439,7 @@ if AMP_ENABLED:
|
|||
ifacestr = "-%s" % AMP_INTERFACE
|
||||
print ' amp (to Portal)%s: %s' % (ifacestr, AMP_PORT)
|
||||
|
||||
from src.server import amp
|
||||
from evennia.server import amp
|
||||
|
||||
factory = amp.AmpServerFactory(EVENNIA)
|
||||
amp_service = internet.TCPServer(AMP_PORT, factory, interface=AMP_INTERFACE)
|
||||
|
|
@ -451,7 +451,7 @@ if WEBSERVER_ENABLED:
|
|||
# Start a django-compatible webserver.
|
||||
|
||||
from twisted.python import threadpool
|
||||
from src.server.webserver import DjangoWebRoot, WSGIWebServer
|
||||
from evennia.server.webserver import DjangoWebRoot, WSGIWebServer
|
||||
|
||||
# start a thread pool and define the root url (/) as a wsgi resource
|
||||
# recognized by Django
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@ are stored on the Portal side)
|
|||
import time
|
||||
from datetime import datetime
|
||||
from django.conf import settings
|
||||
#from src.scripts.models import ScriptDB
|
||||
from src.comms.models import ChannelDB
|
||||
from src.utils import logger, utils
|
||||
from src.utils.inlinefunc import parse_inlinefunc
|
||||
from src.utils.utils import make_iter
|
||||
from src.commands.cmdhandler import cmdhandler
|
||||
from src.commands.cmdsethandler import CmdSetHandler
|
||||
from src.server.session import Session
|
||||
#from evennia.scripts.models import ScriptDB
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.utils import logger, utils
|
||||
from evennia.utils.inlinefunc import parse_inlinefunc
|
||||
from evennia.utils.utils import make_iter
|
||||
from evennia.commands.cmdhandler import cmdhandler
|
||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||
from evennia.server.session import Session
|
||||
|
||||
IDLE_COMMAND = settings.IDLE_COMMAND
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -72,7 +72,7 @@ class ServerSession(Session):
|
|||
"""
|
||||
global _ObjectDB
|
||||
if not _ObjectDB:
|
||||
from src.objects.models import ObjectDB as _ObjectDB
|
||||
from evennia.objects.models import ObjectDB as _ObjectDB
|
||||
|
||||
if not self.logged_in:
|
||||
# assign the unloggedin-command set.
|
||||
|
|
@ -222,7 +222,7 @@ class ServerSession(Session):
|
|||
# handle oob instructions
|
||||
global _OOB_HANDLER
|
||||
if not _OOB_HANDLER:
|
||||
from src.server.oobhandler import OOB_HANDLER as _OOB_HANDLER
|
||||
from evennia.server.oobhandler import OOB_HANDLER as _OOB_HANDLER
|
||||
oobstruct = self.sessionhandler.oobstruct_parser(kwargs.pop("oob", None))
|
||||
#print "session.data_in: oobstruct:",oobstruct
|
||||
for (funcname, args, kwargs) in oobstruct:
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ There are two similar but separate stores of sessions:
|
|||
|
||||
import time
|
||||
from django.conf import settings
|
||||
from src.commands.cmdhandler import CMD_LOGINSTART
|
||||
from src.utils.utils import variable_from_module, is_iter, \
|
||||
from evennia.commands.cmdhandler import CMD_LOGINSTART
|
||||
from evennia.utils.utils import variable_from_module, is_iter, \
|
||||
to_str, to_unicode, strip_control_sequences
|
||||
try:
|
||||
import cPickle as pickle
|
||||
|
|
@ -57,11 +57,11 @@ def delayed_import():
|
|||
modulename, classname = settings.SERVER_SESSION_CLASS.rsplit(".", 1)
|
||||
_ServerSession = variable_from_module(modulename, classname)
|
||||
if not _PlayerDB:
|
||||
from src.players.models import PlayerDB as _PlayerDB
|
||||
from evennia.players.models import PlayerDB as _PlayerDB
|
||||
if not _ServerConfig:
|
||||
from src.server.models import ServerConfig as _ServerConfig
|
||||
from evennia.server.models import ServerConfig as _ServerConfig
|
||||
if not _ScriptDB:
|
||||
from src.scripts.models import ScriptDB as _ScriptDB
|
||||
from evennia.scripts.models import ScriptDB as _ScriptDB
|
||||
# including once to avoid warnings in Python syntax checkers
|
||||
_ServerSession, _PlayerDB, _ServerConfig, _ScriptDB
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ class ServerSessionHandler(SessionHandler):
|
|||
This method allows the server-side to force the Portal to create
|
||||
a new bot session using the protocol specified by protocol_path,
|
||||
which should be the full python path to the class, including the
|
||||
class name, like "src.server.portal.irc.IRCClient".
|
||||
class name, like "evennia.server.portal.irc.IRCClient".
|
||||
The new session will use the supplied player-bot uid to
|
||||
initiate an already logged-in connection. The Portal will
|
||||
treat this as a normal connection and henceforth so will the
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ except ImportError:
|
|||
|
||||
from django.conf import settings
|
||||
from django.test.simple import DjangoTestSuiteRunner
|
||||
from src.utils.utils import mod_import
|
||||
from evennia.utils.utils import mod_import
|
||||
|
||||
|
||||
class EvenniaTestSuiteRunner(DjangoTestSuiteRunner):
|
||||
"""
|
||||
This test runner only runs tests on the apps specified in src/ and game/ to
|
||||
This test runner only runs tests on the apps specified in evennia/ and game/ to
|
||||
avoid running the large number of tests defined by Django
|
||||
"""
|
||||
def build_suite(self, test_labels, extra_tests=None, **kwargs):
|
||||
|
|
@ -45,7 +45,7 @@ class EvenniaTestSuiteRunner(DjangoTestSuiteRunner):
|
|||
"""
|
||||
if not test_labels:
|
||||
test_labels = [applabel.rsplit('.', 1)[1] for applabel in settings.INSTALLED_APPS
|
||||
if (applabel.startswith('src.') or applabel.startswith('game.'))]
|
||||
if (applabel.startswith('evennia.') or applabel.startswith('game.'))]
|
||||
return super(EvenniaTestSuiteRunner, self).build_suite(test_labels, extra_tests=extra_tests, **kwargs)
|
||||
|
||||
|
||||
|
|
@ -54,9 +54,9 @@ def suite():
|
|||
This function is called automatically by the django test runner.
|
||||
This also collates tests from packages that are not formally django applications.
|
||||
"""
|
||||
from src.locks import tests as locktests
|
||||
from src.utils import tests as utiltests
|
||||
from src.commands.default import tests as commandtests
|
||||
from evennia.locks import tests as locktests
|
||||
from evennia.utils import tests as utiltests
|
||||
from evennia.commands.default import tests as commandtests
|
||||
|
||||
tsuite = unittest.TestSuite()
|
||||
tsuite.addTest(unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__]))
|
||||
|
|
@ -66,11 +66,11 @@ def suite():
|
|||
tsuite.addTest(unittest.defaultTestLoader.loadTestsFromModule(locktests))
|
||||
tsuite.addTest(unittest.defaultTestLoader.loadTestsFromModule(utiltests))
|
||||
|
||||
for path in glob.glob("../src/tests/test_*.py"):
|
||||
for path in glob.glob("../evennia/tests/test_*.py"):
|
||||
testmod = mod_import(path)
|
||||
tsuite.addTest(unittest.defaultTestLoader.loadTestsFromModule(testmod))
|
||||
|
||||
#from src.tests import test_commands_cmdhandler
|
||||
#from evennia.tests import test_commands_cmdhandler
|
||||
#tsuite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_commands_cmdhandler))
|
||||
|
||||
return tsuite
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ WEBSOCKET_INTERFACES = ['0.0.0.0']
|
|||
EVENNIA_ADMIN = True
|
||||
# The path to the root directory
|
||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
# Path to the src directory containing the bulk of the codebase's code.
|
||||
# Path to the lib directory containing the bulk of the codebase's code.
|
||||
EVENNIA_DIR = os.path.join(ROOT_DIR, 'evennia')
|
||||
# Path to the game directory (containing the database file if using sqlite).
|
||||
GAME_DIR = os.path.join(ROOT_DIR, 'game_template')
|
||||
|
|
@ -198,7 +198,7 @@ DATABASES = {
|
|||
######################################################################
|
||||
# Plugin modules extend Evennia in various ways. In the cases with no
|
||||
# existing default, there are examples of many of these modules
|
||||
# in game/gamesrc/conf/examples.
|
||||
# in contrib/examples.
|
||||
|
||||
# The command parser module to use. See the default module for which
|
||||
# functions it must implement
|
||||
|
|
@ -238,11 +238,11 @@ PORTAL_SERVICES_PLUGIN_MODULES = ["server.conf.portal_services_plugins"]
|
|||
MSSP_META_MODULE = ""
|
||||
# Tuple of modules implementing lock functions. All callable functions
|
||||
# inside these modules will be available as lock functions.
|
||||
LOCK_FUNC_MODULES = ("src.locks.lockfuncs", "server.conf.lockfuncs",)
|
||||
LOCK_FUNC_MODULES = ("evennia.locks.lockfuncs", "server.conf.lockfuncs",)
|
||||
# Module holding OOB (Out of Band) hook objects. This allows for customization
|
||||
# and expansion of which hooks OOB protocols are allowed to call on the server
|
||||
# protocols for attaching tracker hooks for when various object field change
|
||||
OOB_PLUGIN_MODULES = ["src.server.oob_cmds", "server.conf.oob_cmds"]
|
||||
OOB_PLUGIN_MODULES = ["evennia.server.oob_cmds", "server.conf.oob_cmds"]
|
||||
|
||||
######################################################################
|
||||
# Default command sets
|
||||
|
|
@ -251,11 +251,7 @@ OOB_PLUGIN_MODULES = ["src.server.oob_cmds", "server.conf.oob_cmds"]
|
|||
# stored anywhere in the databse), changing these paths will only affect
|
||||
# NEW created characters/objects, not those already in play. So if you plan to
|
||||
# change this, it's recommended you do it before having created a lot of objects
|
||||
# (or simply reset the database after the change for simplicity). Remember
|
||||
# that you should never edit things in src/. Instead copy out the examples
|
||||
# in game/gamesrc/commands/examples up one level and re-point these settings
|
||||
# to point to these copies instead - these you can then change as you please
|
||||
# (or copy/paste from the default modules in src/ if you prefer).
|
||||
# (or simply reset the database after the change for simplicity).
|
||||
|
||||
# Command set used on session before player has logged in
|
||||
CMDSET_UNLOGGEDIN = "commands.default_cmdsets.UnloggedinCmdSet"
|
||||
|
|
@ -273,7 +269,7 @@ CMDSET_PATHS = ["commands"]
|
|||
######################################################################
|
||||
|
||||
# Server-side session class used. #TODO
|
||||
SERVER_SESSION_CLASS = "src.server.serversession.ServerSession"
|
||||
SERVER_SESSION_CLASS = "server.serversession.ServerSession"
|
||||
|
||||
# Base paths for typeclassed object classes. These paths must be
|
||||
# defined relative evennia's root directory. They will be searched in
|
||||
|
|
@ -328,7 +324,7 @@ BASE_BATCHPROCESS_PATHS = ['world', 'contrib']
|
|||
######################################################################
|
||||
|
||||
# You don't actually have to use this, but it affects the routines in
|
||||
# src.utils.gametime.py and allows for a convenient measure to
|
||||
# evennia.utils.gametime.py and allows for a convenient measure to
|
||||
# determine the current in-game time. You can of course interpret
|
||||
# "week", "month" etc as your own in-game time units as desired.
|
||||
|
||||
|
|
@ -498,7 +494,7 @@ ADMINS = () #'Your Name', 'your_email@domain.com'),)
|
|||
MANAGERS = ADMINS
|
||||
# Absolute path to the directory that holds file uploads from web apps.
|
||||
# Example: "/home/media/media.lawrence.com"
|
||||
MEDIA_ROOT = os.path.join(GAME_DIR, "gamesrc", "web", "media")
|
||||
MEDIA_ROOT = os.path.join(GAME_DIR, "web", "media")
|
||||
# It's safe to dis-regard this, as it's a Django feature we only half use as a
|
||||
# dependency, not actually what it's primarily meant for.
|
||||
SITE_ID = 1
|
||||
|
|
@ -539,11 +535,11 @@ MEDIA_URL = '/media/'
|
|||
# STATIC_URL/admin.
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
STATIC_ROOT = os.path.join(GAME_DIR, "gamesrc", "web", "static")
|
||||
STATIC_ROOT = os.path.join(GAME_DIR, "web", "static")
|
||||
|
||||
# Directories from which static files will be gathered from.
|
||||
STATICFILES_DIRS = (
|
||||
os.path.join(GAME_DIR, "gamesrc", "web", "static_overrides"),
|
||||
os.path.join(GAME_DIR, "web", "static_overrides"),
|
||||
os.path.join(EVENNIA_DIR, "web", "static"),)
|
||||
# Patterns of files in the static directories. Used here to make sure that
|
||||
# its readme file is preserved but unused.
|
||||
|
|
@ -553,7 +549,7 @@ STATICFILES_IGNORE_PATTERNS = ('README.md',)
|
|||
ACTIVE_TEMPLATE = 'prosimii'
|
||||
# We setup the location of the website template as well as the admin site.
|
||||
TEMPLATE_DIRS = (
|
||||
os.path.join(GAME_DIR, "gamesrc", "web", "template_overrides"),
|
||||
os.path.join(GAME_DIR, "web", "template_overrides"),
|
||||
os.path.join(EVENNIA_DIR, "web", "templates", ACTIVE_TEMPLATE),
|
||||
os.path.join(EVENNIA_DIR, "web", "templates"),)
|
||||
# List of callables that know how to import templates from various sources.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# this is an optimized version only available in later Django versions
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
from src.scripts.models import ScriptDB, ObjectDoesNotExist
|
||||
from src.utils.create import create_script
|
||||
from src.scripts import DoNothing
|
||||
from evennia.scripts.models import ScriptDB, ObjectDoesNotExist
|
||||
from evennia.utils.create import create_script
|
||||
from evennia.scripts import DoNothing
|
||||
import unittest
|
||||
from django.conf import settings
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# test with game/manage.py test
|
||||
import unittest
|
||||
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
|
||||
class TestIsIter(unittest.TestCase):
|
||||
def test_is_iter(self):
|
||||
|
|
@ -33,13 +33,13 @@ class TestDedent(unittest.TestCase):
|
|||
self.assertEqual("TestDedent", utils.dedent(" TestDedent"))
|
||||
# Leading whitespace, multi line
|
||||
input_string = " hello\n world"
|
||||
expected_string = "hello\nworld"
|
||||
self.assertEqual(expected_string, utils.dedent(input_string))
|
||||
expected_string = "hello\nworld"
|
||||
self.assertEqual(expected_string, utils.dedent(input_string))
|
||||
|
||||
class TestListToString(unittest.TestCase):
|
||||
"""
|
||||
Default function header from utils.py:
|
||||
list_to_string(inlist, endsep="and", addquote=False)
|
||||
Default function header from utils.py:
|
||||
list_to_string(inlist, endsep="and", addquote=False)
|
||||
|
||||
Examples:
|
||||
no endsep:
|
||||
|
|
@ -55,7 +55,7 @@ class TestListToString(unittest.TestCase):
|
|||
self.assertEqual('"1", "2", "3"', utils.list_to_string([1,2,3], endsep="", addquote=True))
|
||||
self.assertEqual('1, 2 and 3', utils.list_to_string([1,2,3]))
|
||||
self.assertEqual('"1", "2" and "3"', utils.list_to_string([1,2,3], endsep="and", addquote=True))
|
||||
|
||||
|
||||
|
||||
class TestWildcardToRegexp(unittest.TestCase):
|
||||
def test_wildcard_to_regexp(self):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from django.contrib import admin
|
||||
from django.contrib.admin import ModelAdmin
|
||||
from django.core.urlresolvers import reverse
|
||||
from src.typeclasses.models import Attribute, Tag
|
||||
from evennia.typeclasses.models import Attribute, Tag
|
||||
|
||||
|
||||
class TagAdmin(admin.ModelAdmin):
|
||||
|
|
@ -65,4 +65,4 @@ class AttributeAdmin(ModelAdmin):
|
|||
return []
|
||||
|
||||
admin.site.register(Attribute, AttributeAdmin)
|
||||
admin.site.register(Tag, TagAdmin)
|
||||
admin.site.register(Tag, TagAdmin)
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ from django.db import models
|
|||
from django.conf import settings
|
||||
from django.utils.encoding import smart_str
|
||||
|
||||
from src.locks.lockhandler import LockHandler
|
||||
from src.utils.idmapper.models import SharedMemoryModel
|
||||
from src.utils.dbserialize import to_pickle, from_pickle
|
||||
from src.utils.picklefield import PickledObjectField
|
||||
from src.utils.utils import lazy_property, to_str, make_iter
|
||||
from evennia.locks.lockhandler import LockHandler
|
||||
from evennia.utils.idmapper.models import SharedMemoryModel
|
||||
from evennia.utils.dbserialize import to_pickle, from_pickle
|
||||
from evennia.utils.picklefield import PickledObjectField
|
||||
from evennia.utils.utils import lazy_property, to_str, make_iter
|
||||
|
||||
_TYPECLASS_AGGRESSIVE_CACHE = settings.TYPECLASS_AGGRESSIVE_CACHE
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ all Attributes and TypedObjects).
|
|||
"""
|
||||
from functools import update_wrapper
|
||||
from django.db.models import Q
|
||||
from src.utils import idmapper
|
||||
from src.utils.utils import make_iter, variable_from_module
|
||||
from evennia.utils import idmapper
|
||||
from evennia.utils.utils import make_iter, variable_from_module
|
||||
|
||||
__all__ = ("TypedObjectManager", )
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -160,7 +160,7 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager):
|
|||
# create a new tag
|
||||
global _Tag
|
||||
if not _Tag:
|
||||
from src.typeclasses.models import Tag as _Tag
|
||||
from evennia.typeclasses.models import Tag as _Tag
|
||||
tag = _Tag.objects.create(
|
||||
db_key=key.strip().lower() if key is not None else None,
|
||||
db_category=category.strip().lower() if category and key is not None else None,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import src.utils.picklefield
|
||||
import evennia.utils.picklefield
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
@ -16,7 +16,7 @@ class Migration(migrations.Migration):
|
|||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('db_key', models.CharField(max_length=255, verbose_name=b'key', db_index=True)),
|
||||
('db_value', src.utils.picklefield.PickledObjectField(help_text=b'The data returned when the attribute is accessed. Must be written as a Python literal if editing through the admin interface. Attribute values which are not Python literals cannot be edited through the admin interface.', null=True, verbose_name=b'value')),
|
||||
('db_value', evennia.utils.picklefield.PickledObjectField(help_text=b'The data returned when the attribute is accessed. Must be written as a Python literal if editing through the admin interface. Attribute values which are not Python literals cannot be edited through the admin interface.', null=True, verbose_name=b'value')),
|
||||
('db_strvalue', models.TextField(help_text=b'String-specific storage for quick look-up', null=True, verbose_name=b'strvalue', blank=True)),
|
||||
('db_category', models.CharField(max_length=128, blank=True, help_text=b'Optional categorization of attribute.', null=True, verbose_name=b'category', db_index=True)),
|
||||
('db_lock_storage', models.TextField(help_text=b'Lockstrings for this object are stored here.', verbose_name=b'locks', blank=True)),
|
||||
|
|
|
|||
|
|
@ -33,22 +33,22 @@ from django.core.exceptions import ObjectDoesNotExist
|
|||
from django.conf import settings
|
||||
from django.utils.encoding import smart_str
|
||||
|
||||
from src.typeclasses.attributes import Attribute, AttributeHandler, NAttributeHandler
|
||||
from src.typeclasses.tags import Tag, TagHandler, AliasHandler, PermissionHandler
|
||||
from evennia.typeclasses.attributes import Attribute, AttributeHandler, NAttributeHandler
|
||||
from evennia.typeclasses.tags import Tag, TagHandler, AliasHandler, PermissionHandler
|
||||
|
||||
from src.utils.idmapper.models import SharedMemoryModel
|
||||
from src.utils.idmapper.base import SharedMemoryModelBase
|
||||
from src.server.caches import get_prop_cache, set_prop_cache
|
||||
#from src.server.caches import set_attr_cache
|
||||
from evennia.utils.idmapper.models import SharedMemoryModel
|
||||
from evennia.utils.idmapper.base import SharedMemoryModelBase
|
||||
from evennia.server.caches import get_prop_cache, set_prop_cache
|
||||
#from evennia.server.caches import set_attr_cache
|
||||
|
||||
#from src.server.caches import call_ndb_hooks
|
||||
#from src.server.models import ServerConfig
|
||||
from src.typeclasses import managers
|
||||
from src.locks.lockhandler import LockHandler
|
||||
from src.utils.utils import (
|
||||
#from evennia.server.caches import call_ndb_hooks
|
||||
#from evennia.server.models import ServerConfig
|
||||
from evennia.typeclasses import managers
|
||||
from evennia.locks.lockhandler import LockHandler
|
||||
from evennia.utils.utils import (
|
||||
is_iter, inherits_from, lazy_property,
|
||||
class_from_module)
|
||||
from src.typeclasses.django_new_patch import patched_new
|
||||
from evennia.typeclasses.django_new_patch import patched_new
|
||||
|
||||
__all__ = ("Attribute", "TypeNick", "TypedObject")
|
||||
|
||||
|
|
@ -367,7 +367,7 @@ class TypedObject(SharedMemoryModel):
|
|||
# if we get to this point, the class is ok.
|
||||
|
||||
|
||||
if inherits_from(self, "src.scripts.models.ScriptDB"):
|
||||
if inherits_from(self, "evennia.scripts.models.ScriptDB"):
|
||||
if self.interval > 0:
|
||||
raise RuntimeError("Cannot use swap_typeclass on time-dependent " \
|
||||
"Script '%s'.\nStop and start a new Script of the " \
|
||||
|
|
@ -448,7 +448,7 @@ class TypedObject(SharedMemoryModel):
|
|||
"Cleaning up handlers on the typeclass level"
|
||||
global TICKER_HANDLER
|
||||
if not TICKER_HANDLER:
|
||||
from src.scripts.tickerhandler import TICKER_HANDLER
|
||||
from evennia.scripts.tickerhandler import TICKER_HANDLER
|
||||
TICKER_HANDLER.remove(self) # removes objects' all ticker subscriptions
|
||||
self.permissions.clear()
|
||||
self.attributes.clear()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ contains the respective handlers.
|
|||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from src.utils.utils import to_str, make_iter
|
||||
from evennia.utils.utils import to_str, make_iter
|
||||
|
||||
|
||||
_TYPECLASS_AGGRESSIVE_CACHE = settings.TYPECLASS_AGGRESSIVE_CACHE
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ user.
|
|||
|
||||
"""
|
||||
import re
|
||||
from src.utils import utils
|
||||
from src.utils.utils import to_str, to_unicode
|
||||
from evennia.utils import utils
|
||||
from evennia.utils.utils import to_str, to_unicode
|
||||
|
||||
# ANSI definitions
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ It seems the bottom of the box is a bit loose.
|
|||
# close the @drop command since it's the end of the file)
|
||||
-------------------------
|
||||
|
||||
An example batch file is game/gamesrc/commands/examples/batch_example.ev.
|
||||
An example batch file is contribs/examples/batch_example.ev.
|
||||
|
||||
|
||||
==========================================================================
|
||||
|
|
@ -144,8 +144,8 @@ Example batch.py file
|
|||
|
||||
import traceback
|
||||
from django.config import settings
|
||||
from src.utils import create
|
||||
from game.gamesrc.typeclasses import basetypes
|
||||
from evennia.utils import create
|
||||
from types import basetypes
|
||||
|
||||
GOLD = 10
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ import traceback
|
|||
import sys
|
||||
#from traceback import format_exc
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
#from game import settings as settings_module
|
||||
|
||||
ENCODINGS = settings.ENCODINGS
|
||||
|
|
@ -199,7 +199,7 @@ def read_batchfile(pythonpath, file_ending='.py'):
|
|||
"""
|
||||
|
||||
# open the file
|
||||
if pythonpath and not (pythonpath.startswith('src.') or pythonpath.startswith('game.')
|
||||
if pythonpath and not (pythonpath.startswith('evennia.') or pythonpath.startswith('game.')
|
||||
or pythonpath.startswith('contrib.')):
|
||||
abspaths = []
|
||||
for basepath in settings.BASE_BATCHPROCESS_PATHS:
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ Models covered:
|
|||
from django.conf import settings
|
||||
from django.db import IntegrityError
|
||||
from django.utils import timezone
|
||||
from src.utils import logger
|
||||
from src.utils.utils import make_iter, class_from_module, dbid_to_obj
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import make_iter, class_from_module, dbid_to_obj
|
||||
|
||||
# delayed imports
|
||||
_User = None
|
||||
|
|
@ -73,7 +73,7 @@ def create_object(typeclass=None, key=None, location=None,
|
|||
"""
|
||||
global _ObjectDB
|
||||
if not _ObjectDB:
|
||||
from src.objects.models import ObjectDB as _ObjectDB
|
||||
from evennia.objects.models import ObjectDB as _ObjectDB
|
||||
|
||||
|
||||
typeclass = typeclass if typeclass else settings.BASE_OBJECT_TYPECLASS
|
||||
|
|
@ -138,7 +138,7 @@ def create_script(typeclass, key=None, obj=None, player=None, locks=None,
|
|||
same key to all scripts of the same type). Set obj
|
||||
to tie this script to a particular object.
|
||||
|
||||
See src.scripts.manager for methods to manipulate existing
|
||||
See evennia.scripts.manager for methods to manipulate existing
|
||||
scripts in the database.
|
||||
|
||||
report_to is an obtional object to receive error messages.
|
||||
|
|
@ -148,7 +148,7 @@ def create_script(typeclass, key=None, obj=None, player=None, locks=None,
|
|||
"""
|
||||
global _ScriptDB
|
||||
if not _ScriptDB:
|
||||
from src.scripts.models import ScriptDB as _ScriptDB
|
||||
from evennia.scripts.models import ScriptDB as _ScriptDB
|
||||
|
||||
typeclass = typeclass if typeclass else settings.BASE_SCRIPT_TYPECLASS
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ def create_help_entry(key, entrytext, category="General", locks=None):
|
|||
"""
|
||||
global _HelpEntry
|
||||
if not _HelpEntry:
|
||||
from src.help.models import HelpEntry as _HelpEntry
|
||||
from evennia.help.models import HelpEntry as _HelpEntry
|
||||
|
||||
try:
|
||||
new_help = _HelpEntry()
|
||||
|
|
@ -250,7 +250,7 @@ def create_message(senderobj, message, channels=None,
|
|||
"""
|
||||
global _Msg
|
||||
if not _Msg:
|
||||
from src.comms.models import Msg as _Msg
|
||||
from evennia.comms.models import Msg as _Msg
|
||||
if not message:
|
||||
# we don't allow empty messages.
|
||||
return
|
||||
|
|
@ -342,7 +342,7 @@ def create_player(key, email, password,
|
|||
"""
|
||||
global _PlayerDB
|
||||
if not _PlayerDB:
|
||||
from src.players.models import PlayerDB as _PlayerDB
|
||||
from evennia.players.models import PlayerDB as _PlayerDB
|
||||
|
||||
typeclass = typeclass if typeclass else settings.BASE_PLAYER_TYPECLASS
|
||||
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ except ImportError:
|
|||
from django.db import transaction
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from src.server.models import ServerConfig
|
||||
from src.utils.utils import to_str, uses_database
|
||||
from src.utils import logger
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.utils.utils import to_str, uses_database
|
||||
from evennievenniautils import logger
|
||||
|
||||
__all__ = ("to_pickle", "from_pickle", "do_pickle", "do_unpickle")
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ os.environ["DJANGO_SETTINGS_MODULE"] = "game.settings"
|
|||
# del settings2
|
||||
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
|
||||
HELPTEXT = """
|
||||
|
||||
|
|
@ -299,7 +299,7 @@ if __name__ == '__main__':
|
|||
action_modpath = settings.DUMMYRUNNER_ACTIONS_MODULE
|
||||
except AttributeError:
|
||||
# use default
|
||||
action_modpath = "src.utils.dummyrunner.dummyrunner_actions"
|
||||
action_modpath = "evennia.utils.dummyrunner.dummyrunner_actions"
|
||||
actions = utils.variable_from_module(action_modpath, "ACTIONS")
|
||||
|
||||
print "Connecting %i dummy client(s) to port %i using a %i second timestep ... " % (nclients, port, timestep)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import time
|
|||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'game.settings'
|
||||
import ev
|
||||
from src.utils.idmapper import base as _idmapper
|
||||
from evennia.utils.idmapper import base as _idmapper
|
||||
|
||||
LOGFILE = "logs/memoryusage.log"
|
||||
INTERVAL = 30 # log every 30 seconds
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ if __name__ == "__main__":
|
|||
|
||||
setup_string = \
|
||||
"""
|
||||
from src.objects.models import ObjectDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
g = ObjectDB.objects.get(db_key="Griatch")
|
||||
"""
|
||||
exec_string = \
|
||||
|
|
|
|||
|
|
@ -131,9 +131,9 @@ form will raise an error.
|
|||
|
||||
import re
|
||||
import copy
|
||||
from src.utils.evtable import EvCell, EvTable
|
||||
from src.utils.utils import all_from_module, to_str, to_unicode
|
||||
from src.utils.ansi import ANSIString
|
||||
from evennia.utils.evtable import EvCell, EvTable
|
||||
from evennia.utils.utils import all_from_module, to_str, to_unicode
|
||||
from evennia.utils.ansi import ANSIString
|
||||
|
||||
# non-valid form-identifying characters (which can thus be
|
||||
# used as separators between forms without being detected
|
||||
|
|
@ -410,7 +410,7 @@ class EvForm(object):
|
|||
|
||||
def _test():
|
||||
"test evform"
|
||||
form = EvForm("src.utils.evform_test")
|
||||
form = EvForm("evennia.utils.evform_test")
|
||||
|
||||
# add data to each tagged form cell
|
||||
form.map(cells={1: "{gTom the Bouncer{n",
|
||||
|
|
|
|||
|
|
@ -103,8 +103,8 @@ eventual colour outside
|
|||
#from textwrap import wrap
|
||||
from textwrap import TextWrapper
|
||||
from copy import deepcopy, copy
|
||||
from src.utils.utils import to_unicode
|
||||
from src.utils.ansi import ANSIString
|
||||
from evennia.utils.utils import to_unicode
|
||||
from evennia.utils.ansi import ANSIString
|
||||
|
||||
def make_iter(obj):
|
||||
"Makes sure that the object is always iterable."
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue