示例#1
0
 def canAcceptInvite(self, invite):
     result = False
     if invite.alwaysAvailable is True:
         result = True
     elif invite.clientID in self.__invites:
         dispatcher = self.__loader.getDispatcher()
         if dispatcher:
             prbFunctional = dispatcher.getPrbFunctional()
             unitFunctional = dispatcher.getUnitFunctional()
             preQueueFunctional = dispatcher.getPreQueueFunctional()
             if invite.alreadyJoined:
                 return False
             if prbFunctional and prbFunctional.hasLockedState() or unitFunctional and unitFunctional.hasLockedState() or preQueueFunctional and preQueueFunctional.hasLockedState():
                 return False
         another = invite.anotherPeriphery
         if another:
             if g_preDefinedHosts.periphery(invite.peripheryID) is None:
                 LOG_ERROR('Periphery not found')
                 result = False
             elif g_lobbyContext.getCredentials() is None:
                 LOG_ERROR('Login info not found')
                 result = False
             elif g_preDefinedHosts.isRoamingPeriphery(invite.peripheryID) and not isRoamingEnabled(g_itemsCache.items.stats.attributes):
                 LOG_ERROR('Roaming is not supported')
                 result = False
             else:
                 result = invite.clientID > 0 and invite.isActive()
         else:
             result = invite.clientID > 0 and invite.isActive()
     return result
示例#2
0
 def canAcceptInvite(self, invite):
     result = False
     if invite.alwaysAvailable is True:
         result = True
     elif invite.clientID in self.__invites:
         dispatcher = self.__loader.getDispatcher()
         if dispatcher:
             prbFunctional = dispatcher.getPrbFunctional()
             unitFunctional = dispatcher.getUnitFunctional()
             preQueueFunctional = dispatcher.getPreQueueFunctional()
             if invite.alreadyJoined:
                 return False
             if prbFunctional and prbFunctional.hasLockedState(
             ) or unitFunctional and unitFunctional.hasLockedState(
             ) or preQueueFunctional and preQueueFunctional.hasLockedState(
             ):
                 return False
         another = invite.anotherPeriphery
         if another:
             if g_preDefinedHosts.periphery(invite.peripheryID) is None:
                 LOG_ERROR('Periphery not found')
                 result = False
             elif g_lobbyContext.getCredentials() is None:
                 LOG_ERROR('Login info not found')
                 result = False
             elif g_preDefinedHosts.isRoamingPeriphery(
                     invite.peripheryID) and not isRoamingEnabled(
                         g_itemsCache.items.stats.attributes):
                 LOG_ERROR('Roaming is not supported')
                 result = False
             else:
                 result = invite.clientID > 0 and invite.isActive()
         else:
             result = invite.clientID > 0 and invite.isActive()
     return result
示例#3
0
 def canAcceptInvite(self, invite):
     result = False
     if invite.id in self.__receivedInvites:
         from gui.prb_control.dispatcher import g_prbLoader
         dispatcher = g_prbLoader.getDispatcher()
         if dispatcher:
             prbFunctional = dispatcher.getPrbFunctional()
             unitFunctional = dispatcher.getUnitFunctional()
             return (prbFunctional and prbFunctional.hasLockedState()
                     or unitFunctional
                     and unitFunctional.hasLockedState()) and False
     another = invite.anotherPeriphery
     if another:
         if g_preDefinedHosts.periphery(invite.peripheryID) is None:
             LOG_ERROR('Periphery not found')
             result = False
         elif g_lobbyContext.getCredentials() is None:
             LOG_ERROR('Login info not found')
             result = False
         elif g_preDefinedHosts.isRoamingPeriphery(
                 invite.peripheryID) and not isRoamingEnabled(
                     g_itemsCache.items.stats.attributes):
             LOG_ERROR('Roaming is not supported')
             result = False
         elif invite.id > 0:
             result = invite.isActive()
         else:
             result = invite.id > 0 and invite.isActive()
     return result
示例#4
0
 def canAcceptInvite(self, invite):
     result = False
     if invite.id in self.__receivedInvites:
         from gui.prb_control.dispatcher import g_prbLoader
         dispatcher = g_prbLoader.getDispatcher()
         if dispatcher:
             prbFunctional = dispatcher.getPrbFunctional()
             unitFunctional = dispatcher.getUnitFunctional()
             return (prbFunctional and prbFunctional.hasLockedState() or unitFunctional and unitFunctional.hasLockedState()) and False
     another = invite.anotherPeriphery
     if another:
         if g_preDefinedHosts.periphery(invite.peripheryID) is None:
             LOG_ERROR('Periphery not found')
             result = False
         elif g_lobbyContext.getCredentials() is None:
             LOG_ERROR('Login info not found')
             result = False
         elif g_preDefinedHosts.isRoamingPeriphery(invite.peripheryID) and not isRoamingEnabled(g_itemsCache.items.stats.attributes):
             LOG_ERROR('Roaming is not supported')
             result = False
         elif invite.id > 0:
             result = invite.isActive()
         else:
             result = invite.id > 0 and invite.isActive()
     return result
示例#5
0
 def __init__(self, peripheryID):
     super(ConnectToPeriphery, self).__init__()
     self.__host = g_preDefinedHosts.periphery(peripheryID)
     self.__endTime = None
     self.__credentials = g_lobbyContext.getCredentials()
     return
示例#6
0
 def __init__(self, peripheryID):
     super(ConnectToPeriphery, self).__init__()
     self.__host = g_preDefinedHosts.periphery(peripheryID)
     self.__endTime = None
     self.__credentials = g_lobbyContext.getCredentials()
     return