Beispiel #1
0
    def handleRequest(self, playerData: Player,
                      request: str) -> interactions.Response:
        if request.startswith('/'):
            if request == '/h' or request == '/help':
                return interactions.ResponseSuccess('Help not yet implemented',
                                                    playerData)

        return interactions.ResponseSuccess(
            None, playerData,
            (list(self.__players), f'{playerData.getPlayerName()}> {request}'))
Beispiel #2
0
 def joinPlayer(self, playerData: Player,
                otherRequestData: Optional[str]) -> interactions.Response:
     self.__players.add(playerData)
     return interactions.ResponseSuccess(
         'Joined successfully', playerData,
         (list(self.__players), f'{playerData.getPlayerName()} joined'))
 def joinPlayer(self, playerData: Player, otherRequestData: Optional[str]) -> interactions.Response:
     assert playerData not in self._players
     self._players.add(playerData)
     return interactions.ResponseSuccess('', playerData, (list(self._players), f'player joined: "{playerData.getPlayerName()}"'), None)
 def leavePlayer(self, playerData: Player) -> interactions.ResponseSuccess:
     if playerData in self._players:
         self._players.remove(playerData)
     return interactions.ResponseSuccess(None, playerData, None, None)
 def handleRequest(self, playerData: Player, request: str) -> interactions.Response:
     return interactions.ResponseSuccess('request was: '+ request, playerData, None, None)