コード例 #1
0
ファイル: controller.py プロジェクト: Maillol/werewolf
 def _initialize(self, session: ISession, details):  # pylint: disable=unused-argument
     self._session = session
     session.register(self.create_game, "com.werewolf.create_game")
     session.register(self.join_game, "com.werewolf.join_game")
     session.register(self.start_game, "com.werewolf.start_game")
     session.register(self.select_player, "com.werewolf.select_player")
     session.register(self.player_listen_topic,
                      "com.werewolf.player_listen_topic")
コード例 #2
0
ファイル: protocol.py プロジェクト: BanzaiMan/AutobahnPython
         if msg.kwargs:
            if msg.args:
               exc = exception.ApplicationError(msg.error, *msg.args, **msg.kwargs)
            else:
               exc = exception.ApplicationError(msg.error, **msg.kwargs)
         else:
            if msg.args:
               exc = exception.ApplicationError(msg.error, *msg.args)
            else:
               exc = exception.ApplicationError(msg.error)

      return exc



ISession.register(BaseSession)



class ApplicationSession(BaseSession):
   """
   WAMP endpoint session. This class implements

   * :class:`autobahn.wamp.interfaces.IPublisher`
   * :class:`autobahn.wamp.interfaces.ISubscriber`
   * :class:`autobahn.wamp.interfaces.ICaller`
   * :class:`autobahn.wamp.interfaces.ICallee`
   * :class:`autobahn.wamp.interfaces.ITransportHandler`
   """

   def __init__(self, config = None):
コード例 #3
0
         if msg.kwargs:
            if msg.args:
               exc = exception.ApplicationError(msg.error, *msg.args, **msg.kwargs)
            else:
               exc = exception.ApplicationError(msg.error, **msg.kwargs)
         else:
            if msg.args:
               exc = exception.ApplicationError(msg.error, *msg.args)
            else:
               exc = exception.ApplicationError(msg.error)

      return exc



ISession.register(BaseSession)



class ApplicationSession(BaseSession):
   """
   WAMP endpoint session. This class implements

   * :class:`autobahn.wamp.interfaces.IPublisher`
   * :class:`autobahn.wamp.interfaces.ISubscriber`
   * :class:`autobahn.wamp.interfaces.ICaller`
   * :class:`autobahn.wamp.interfaces.ICallee`
   * :class:`autobahn.wamp.interfaces.ITransportHandler`
   """

   def __init__(self, config = None):