Resolve merge conflict
This commit is contained in:
commit
0185420659
4 changed files with 36 additions and 5 deletions
|
|
@ -23,3 +23,4 @@ class UnloggedinCmdSet(CmdSet):
|
||||||
self.add(unloggedin.CmdUnconnectedHelp())
|
self.add(unloggedin.CmdUnconnectedHelp())
|
||||||
self.add(unloggedin.CmdUnconnectedEncoding())
|
self.add(unloggedin.CmdUnconnectedEncoding())
|
||||||
self.add(unloggedin.CmdUnconnectedScreenreader())
|
self.add(unloggedin.CmdUnconnectedScreenreader())
|
||||||
|
self.add(unloggedin.CmdUnconnectedInfo())
|
||||||
|
|
|
||||||
|
|
@ -14,16 +14,17 @@ main test suite started with
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import types
|
import types
|
||||||
|
import datetime
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from mock import Mock, mock
|
from mock import Mock, mock
|
||||||
|
|
||||||
from evennia.commands.default.cmdset_character import CharacterCmdSet
|
from evennia.commands.default.cmdset_character import CharacterCmdSet
|
||||||
from evennia.utils.test_resources import EvenniaTest
|
from evennia.utils.test_resources import EvenniaTest
|
||||||
from evennia.commands.default import help, general, system, admin, account, building, batchprocess, comms
|
from evennia.commands.default import help, general, system, admin, account, building, batchprocess, comms, unloggedin
|
||||||
from evennia.commands.default.muxcommand import MuxCommand
|
from evennia.commands.default.muxcommand import MuxCommand
|
||||||
from evennia.commands.command import Command, InterruptCommand
|
from evennia.commands.command import Command, InterruptCommand
|
||||||
from evennia.utils import ansi, utils
|
from evennia.utils import ansi, utils, gametime
|
||||||
from evennia.server.sessionhandler import SESSIONS
|
from evennia.server.sessionhandler import SESSIONS
|
||||||
from evennia import search_object
|
from evennia import search_object
|
||||||
from evennia import DefaultObject, DefaultCharacter
|
from evennia import DefaultObject, DefaultCharacter
|
||||||
|
|
@ -494,3 +495,12 @@ class TestInterruptCommand(CommandTest):
|
||||||
def test_interrupt_command(self):
|
def test_interrupt_command(self):
|
||||||
ret = self.call(CmdInterrupt(), "")
|
ret = self.call(CmdInterrupt(), "")
|
||||||
self.assertEqual(ret, "")
|
self.assertEqual(ret, "")
|
||||||
|
|
||||||
|
|
||||||
|
class TestUnconnectedCommand(CommandTest):
|
||||||
|
def test_info_command(self):
|
||||||
|
expected = "## BEGIN INFO 1.1\nName: %s\nUptime: %s\nConnected: %d\nVersion: Evennia %s\n## END INFO" % (
|
||||||
|
settings.SERVERNAME,
|
||||||
|
datetime.datetime.fromtimestamp(gametime.SERVER_START_TIME).ctime(),
|
||||||
|
SESSIONS.account_count(), utils.get_evennia_version())
|
||||||
|
self.call(unloggedin.CmdUnconnectedInfo(), "", expected)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ Commands that are available from the connect screen.
|
||||||
"""
|
"""
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
import datetime
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from random import getrandbits
|
from random import getrandbits
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
@ -11,8 +12,9 @@ from evennia.accounts.models import AccountDB
|
||||||
from evennia.objects.models import ObjectDB
|
from evennia.objects.models import ObjectDB
|
||||||
from evennia.server.models import ServerConfig
|
from evennia.server.models import ServerConfig
|
||||||
from evennia.comms.models import ChannelDB
|
from evennia.comms.models import ChannelDB
|
||||||
|
from evennia.server.sessionhandler import SESSIONS
|
||||||
|
|
||||||
from evennia.utils import create, logger, utils
|
from evennia.utils import create, logger, utils, gametime
|
||||||
from evennia.commands.cmdhandler import CMD_LOGINSTART
|
from evennia.commands.cmdhandler import CMD_LOGINSTART
|
||||||
|
|
||||||
COMMAND_DEFAULT_CLASS = utils.class_from_module(settings.COMMAND_DEFAULT_CLASS)
|
COMMAND_DEFAULT_CLASS = utils.class_from_module(settings.COMMAND_DEFAULT_CLASS)
|
||||||
|
|
@ -516,6 +518,24 @@ class CmdUnconnectedScreenreader(COMMAND_DEFAULT_CLASS):
|
||||||
self.session.sessionhandler.session_portal_sync(self.session)
|
self.session.sessionhandler.session_portal_sync(self.session)
|
||||||
|
|
||||||
|
|
||||||
|
class CmdUnconnectedInfo(COMMAND_DEFAULT_CLASS):
|
||||||
|
"""
|
||||||
|
Provides MUDINFO output, so that Evennia games can be added to Mudconnector
|
||||||
|
and Mudstats. Sadly, the MUDINFO specification seems to have dropped off the
|
||||||
|
face of the net, but it is still used by some crawlers. This implementation
|
||||||
|
was created by looking at the MUDINFO implementation in MUX2, TinyMUSH, Rhost,
|
||||||
|
and PennMUSH.
|
||||||
|
"""
|
||||||
|
key = "info"
|
||||||
|
locks = "cmd:all()"
|
||||||
|
|
||||||
|
def func(self):
|
||||||
|
self.caller.msg("## BEGIN INFO 1.1\nName: %s\nUptime: %s\nConnected: %d\nVersion: Evennia %s\n## END INFO" % (
|
||||||
|
settings.SERVERNAME,
|
||||||
|
datetime.datetime.fromtimestamp(gametime.SERVER_START_TIME).ctime(),
|
||||||
|
SESSIONS.account_count(), utils.get_evennia_version()))
|
||||||
|
|
||||||
|
|
||||||
def _create_account(session, accountname, password, permissions, typeclass=None, email=None):
|
def _create_account(session, accountname, password, permissions, typeclass=None, email=None):
|
||||||
"""
|
"""
|
||||||
Helper function, creates an account of the specified typeclass.
|
Helper function, creates an account of the specified typeclass.
|
||||||
|
|
|
||||||
|
|
@ -1088,7 +1088,7 @@ class CmdMask(RPCommand):
|
||||||
if self.cmdstring == "mask":
|
if self.cmdstring == "mask":
|
||||||
# wear a mask
|
# wear a mask
|
||||||
if not self.args:
|
if not self.args:
|
||||||
caller.msg("Usage: (un)wearmask sdesc")
|
caller.msg("Usage: (un)mask sdesc")
|
||||||
return
|
return
|
||||||
if caller.db.unmasked_sdesc:
|
if caller.db.unmasked_sdesc:
|
||||||
caller.msg("You are already wearing a mask.")
|
caller.msg("You are already wearing a mask.")
|
||||||
|
|
@ -1111,7 +1111,7 @@ class CmdMask(RPCommand):
|
||||||
del caller.db.unmasked_sdesc
|
del caller.db.unmasked_sdesc
|
||||||
caller.locks.remove("enable_recog")
|
caller.locks.remove("enable_recog")
|
||||||
caller.sdesc.add(old_sdesc)
|
caller.sdesc.add(old_sdesc)
|
||||||
caller.msg("You remove your mask and is again '%s'." % old_sdesc)
|
caller.msg("You remove your mask and are again '%s'." % old_sdesc)
|
||||||
|
|
||||||
|
|
||||||
class RPSystemCmdSet(CmdSet):
|
class RPSystemCmdSet(CmdSet):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue