예제 #1
0
 def __init__(self, site, uid, auth, explain):
     server.Session.__init__(self, site, uid)
     self._log = log.getChild(self.__class__.__name__)
     self.auth = auth
     self.avatar = site.resource.service.createAvatar()
     self.explain_default = explain
     self.avatar.queuePackets()
     self.avatar.setDistributedArgs(uid, auth)
     if self.explain_default:
         self.avatar.setExplain(PacketPokerExplain.ALL)
     self.avatar.roles.add(PacketPokerRoles.PLAY)
     self.expired = False
예제 #2
0
 def __init__(self, settings, resource, **kwargs):
     server.Site.__init__(self, resource, **kwargs)
     self._log = log.getChild(self.__class__.__name__)
     cookieTimeout = settings.headerGetInt("/server/@cookie_timeout")
     if cookieTimeout > 0:
         self.cookieTimeout = cookieTimeout
     else:
         self.cookieTimeout = 1200
     sessionTimeout = settings.headerGetInt("/server/@session_timeout")
     if sessionTimeout > 0:
         self.sessionFactory.sessionTimeout = sessionTimeout
     self.memcache = None
     self.pipes = []
     for path in settings.header.xpathEval("/server/rest_filter"):
         module = imp.load_source("poker_pipe", path.content)
         self.pipes.append(getattr(module, "rest_filter"))
     resthost = settings.headerGetProperties("/server/resthost")
     if resthost:
         resthost = resthost[0]
         self.resthost = ( resthost['host'], int(resthost['port']), resthost['path'] )
     else:
         self.resthost = None
예제 #3
0
 def __init__(self, service):
     resource.Resource.__init__(self)
     self._log = log.getChild(self.__class__.__name__)
     self.service = service
     self.deferred = defer.succeed(None)
     self.isLeaf = True
예제 #4
0
 def __init__(self, service):
     self._log = log.getChild(self.__class__.__name__)
     resource.Resource.__init__(self)
     self.service = service
     self.isLeaf = True