예제 #1
0
파일: tests.py 프로젝트: phantummm/evennia
 def test_exit_commands(self):
     self.call(building.CmdOpen(), "TestExit1=Room2",
               "Created new Exit 'TestExit1' from Room to Room2")
     self.call(building.CmdLink(), "TestExit1=Room",
               "Link created TestExit1 > Room (one way).")
     self.call(building.CmdUnLink(), "TestExit1",
               "Former exit TestExit1 no longer links anywhere.")
예제 #2
0
    def at_cmdset_creation(self):
        "Populates the cmdset"

        # The general commands
        self.add(general.CmdLook())
        self.add(general.CmdMove())
        # self.add(general.CmdHome())
        self.add(general.CmdInventory())
        # self.add(general.CmdPose())
        # self.add(general.CmdNick())
        # self.add(general.CmdSetDesc())
        self.add(general.CmdGet())
        self.add(general.CmdDrop())
        # self.add(general.CmdGive())
        # self.add(general.CmdSay())
        # self.add(general.CmdWhisper())
        # self.add(general.CmdAccess())

        # The help system
        self.add(help.CmdHelp())
        self.add(help.CmdSetHelp())

        # System commands
        self.add(system.CmdPy())
        self.add(system.CmdScripts())
        self.add(system.CmdObjects())
        self.add(system.CmdAccounts())
        self.add(system.CmdService())
        self.add(system.CmdAbout())
        self.add(system.CmdTime())
        self.add(system.CmdServerLoad())
        # self.add(system.CmdPs())
        self.add(system.CmdTickers())

        # Admin commands
        self.add(admin.CmdBoot())
        self.add(admin.CmdBan())
        self.add(admin.CmdUnban())
        self.add(admin.CmdEmit())
        self.add(admin.CmdPerm())
        self.add(admin.CmdWall())
        self.add(admin.CmdForce())

        # Building and world manipulation
        self.add(building.CmdTeleport())
        self.add(building.CmdSetObjAlias())
        self.add(building.CmdListCmdSets())
        self.add(building.CmdWipe())
        self.add(building.CmdSetAttribute())
        self.add(building.CmdName())
        self.add(building.CmdDesc())
        self.add(building.CmdCpAttr())
        self.add(building.CmdMvAttr())
        self.add(building.CmdCopy())
        self.add(building.CmdFind())
        self.add(building.CmdOpen())
        self.add(building.CmdLink())
        self.add(building.CmdUnLink())
        self.add(building.CmdCreate())
        self.add(building.CmdDig())
        self.add(building.CmdTunnel())
        self.add(building.CmdDestroy())
        self.add(building.CmdExamine())
        self.add(building.CmdTypeclass())
        self.add(building.CmdLock())
        self.add(building.CmdScript())
        self.add(building.CmdSetHome())
        self.add(building.CmdTag())
        self.add(building.CmdSpawn())

        # Batchprocessor commands
        self.add(batchprocess.CmdBatchCommands())
        self.add(batchprocess.CmdBatchCode())
예제 #3
0
 def at_cmdset_creation(self):
     # The help system
     self.add(help.CmdSetHelp())
     # System commands
     self.add(overrides.CmdArxScripts())
     self.add(system.CmdObjects())
     self.add(system.CmdAccounts())
     self.add(system.CmdService())
     self.add(system.CmdAbout())
     self.add(system.CmdTime())
     self.add(system.CmdServerLoad())
     # Admin commands
     self.add(admin.CmdBoot())
     self.add(admin.CmdBan())
     self.add(admin.CmdUnban())
     self.add(admin.CmdPerm())
     self.add(admin.CmdWall())
     # Building and world manipulation
     self.add(overrides.CmdTeleport())
     self.add(building.CmdSetObjAlias())
     self.add(building.CmdListCmdSets())
     self.add(building.CmdWipe())
     self.add(building.CmdName())
     self.add(building.CmdCpAttr())
     self.add(building.CmdMvAttr())
     self.add(building.CmdCopy())
     self.add(building.CmdFind())
     self.add(building.CmdOpen())
     self.add(building.CmdLink())
     self.add(building.CmdUnLink())
     self.add(building.CmdCreate())
     self.add(overrides.CmdDig())
     self.add(building.CmdTunnel())
     self.add(overrides.CmdArxDestroy())
     self.add(overrides.CmdArxExamine())
     self.add(building.CmdTypeclass())
     self.add(overrides.CmdArxLock())
     self.add(building.CmdScript())
     self.add(building.CmdSetHome())
     self.add(overrides.CmdArxTag())
     # Batchprocessor commands
     self.add(batchprocess.CmdBatchCommands())
     self.add(batchprocess.CmdBatchCode())
     # more recently implemented staff commands
     self.add(staff_commands.CmdGemit())
     self.add(staff_commands.CmdWall())
     self.add(staff_commands.CmdHome())
     self.add(staff_commands.CmdResurrect())
     self.add(staff_commands.CmdKill())
     self.add(staff_commands.CmdForce())
     self.add(staff_commands.CmdCcolor())
     self.add(staff_commands.CmdGMDisguise())
     self.add(staff_commands.CmdGMEvent())
     self.add(staff_commands.CmdRelocateExit())
     self.add(staff_commands.CmdAdminKey())
     self.add(staff_commands.CmdAdminPropriety())
     self.add(extended_room.CmdExtendedDesc())
     self.add(xp.CmdAdjustSkill())
     self.add(xp.CmdAwardXP())
     self.add(maps.CmdMapCreate())
     self.add(maps.CmdMapRoom())
     self.add(combat.CmdObserveCombat())
     self.add(combat.CmdAdminCombat())
     self.add(combat.CmdCreateAntagonist())
     self.add(combat.CmdStandYoAssUp())
     self.add(domcommands.CmdSetRoom())
     self.add(condition_commands.CmdModifiers())
     # home commands
     self.add(home.CmdAllowBuilding())
     self.add(home.CmdBuildRoom())
     self.add(home.CmdManageRoom())
예제 #4
0
    def test_exit_commands(self):
        self.call(building.CmdOpen(), "TestExit1=Room2",
                  "Created new Exit 'TestExit1' from Room to Room2")
        self.call(building.CmdLink(), "TestExit1=Room",
                  "Link created TestExit1 -> Room (one way).")
        self.call(building.CmdUnLink(), "", "Usage: ")
        self.call(building.CmdLink(), "NotFound", "Could not find 'NotFound'.")
        self.call(building.CmdLink(), "TestExit",
                  "TestExit1 is an exit to Room.")
        self.call(building.CmdLink(), "Obj",
                  "Obj is not an exit. Its home location is Room.")
        self.call(building.CmdUnLink(), "TestExit1",
                  "Former exit TestExit1 no longer links anywhere.")

        self.char1.location = self.room2
        self.call(building.CmdOpen(), "TestExit2=Room",
                  "Created new Exit 'TestExit2' from Room2 to Room.")
        self.call(
            building.CmdOpen(),
            "TestExit2=Room",
            "Exit TestExit2 already exists. It already points to the correct place.",
        )

        # ensure it matches locally first
        self.call(building.CmdLink(), "TestExit=Room2",
                  "Link created TestExit2 -> Room2 (one way).")
        self.call(
            building.CmdLink(),
            "/twoway TestExit={}".format(self.exit.dbref),
            "Link created TestExit2 (in Room2) <-> out (in Room) (two-way).",
        )
        self.call(
            building.CmdLink(),
            "/twoway TestExit={}".format(self.room1.dbref),
            "To create a two-way link, TestExit2 and Room must both have a location ",
        )
        self.call(
            building.CmdLink(),
            "/twoway {}={}".format(self.exit.dbref, self.exit.dbref),
            "Cannot link an object to itself.",
        )
        self.call(building.CmdLink(), "", "Usage: ")
        # ensure can still match globally when not a local name
        self.call(building.CmdLink(), "TestExit1=Room2", "Note: TestExit1")
        self.call(building.CmdLink(), "TestExit1=",
                  "Former exit TestExit1 no longer links anywhere.")