Ejemplo n.º 1
0
 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")
Ejemplo n.º 2
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):
Ejemplo n.º 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):