コード例 #1
0
ファイル: rfcruncher.py プロジェクト: rohdef/skycave-support
    def test_homecommand(self, client_socket):
        self.logger.info("Testing home command")
        req = get_method_template("player-execute", "HomeCommand", lstr("nothing"))
        client_socket.send(req)

        response = client_socket.recv(4096)
        test_response(self.logger, response, "(0,0,0)", [])
コード例 #2
0
ファイル: rfcruncher.py プロジェクト: rohdef/skycave-support
    def test_player_get_position(self, client_socket):
        self.logger.info("Testing get position")
        req = get_method_template("player-get-position", "", lstr())
        client_socket.send(req)

        response = client_socket.recv(4096)
        test_response(self.logger, response, "(0,0,0)", [])
コード例 #3
0
ファイル: rfcruncher.py プロジェクト: rohdef/skycave-support
    def test_two_commands(self, client_socket):
        self.logger.info("Trying to send two commands first with improper line eding")
        req = get_method_template("player-execute", "HomeCommand", lstr("nothing"))
        client_socket.send(req+req)

        response = client_socket.recv(4096)
        test_response(self.logger, response, "(0,0,0)", [])
コード例 #4
0
ファイル: rfcruncher.py プロジェクト: rohdef/skycave-support
    def test_logout(self, client_socket):
        self.logger.info("Logging out")
        req = get_method_template("cave-logout", "", lstr())
        client_socket.send(req)

        response = client_socket.recv(4096)
        test_response(self.logger, response, "SUCCESS", [])
コード例 #5
0
ファイル: rfcruncher.py プロジェクト: rohdef/skycave-support
    def test_player_move(self, client_socket):
        self.logger.info("Testing player move")
        req = get_method_template("player-move", "DOWN", lstr())
        client_socket.send(req)

        response = client_socket.recv(4096)
        test_response(self.logger, response, "false", [])
コード例 #6
0
ファイル: rfcruncher.py プロジェクト: rohdef/skycave-support
    def test_player_get_exit_set(self, client_socket):
        self.logger.info("Testing get exit set")
        req = get_method_template("player-get-exit-set", "", lstr())
        client_socket.send(req)

        response = client_socket.recv(4096)
        test_response(self.logger, response, "notused", ["NORTH", "EAST", "WEST", "UP"])
コード例 #7
0
ファイル: rfcruncher.py プロジェクト: rohdef/skycave-support
    def test_player_get_long_description(self, client_socket):
        self.logger.info("Testing get long room description")
        req = get_method_template("player-get-long-room-description", "", lstr())
        client_socket.send(req)

        response = client_socket.recv(4096)
        test_response(self.logger, response, "You are standing at the end of a road before a small brick building.\nThere are exits in directions:\n  NORTH   EAST   WEST   UP \nYou see other players:\n  [0]", [])
コード例 #8
0
ファイル: rfcruncher.py プロジェクト: rohdef/skycave-support
    def test_player_get_short_description(self, client_socket):
        self.logger.info("Testing get short room description")
        req = get_method_template("player-get-short-room-description", "", lstr())
        client_socket.send(req)

        response = client_socket.recv(4096)
        test_response(self.logger, response, "You are standing at the end of a road before a small brick building.", [])
コード例 #9
0
ファイル: rfcruncher.py プロジェクト: rohdef/skycave-support
    def test_login(self, client_socket):
        self.logger.info("Logging in")
        req = get_method_template("cave-login", player_login, lstr(player_pass))
        client_socket.send(req)

        response = client_socket.recv(4096)
        test_response(self.logger, response, "LOGIN_SUCCESS", ["55e45169e4b067dd3c8fa56e", "rohdef"])
        res = json.loads(response.decode("utf-8"))
        set_user_details(res['reply-tail'])