예제 #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:
             if invite.alreadyJoined:
                 return False
             if dispatcher.getEntity().hasLockedState():
                 return False
         another = invite.anotherPeriphery
         if another:
             if g_preDefinedHosts.periphery(invite.peripheryID) is None:
                 LOG_ERROR('Periphery not found')
                 result = False
             elif self.lobbyContext.getCredentials() is None:
                 LOG_ERROR('Login info not found')
                 result = False
             elif g_preDefinedHosts.isRoamingPeriphery(
                     invite.peripheryID) and not isRoamingEnabled(
                         self.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.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
예제 #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 isPeripheryAvailable(self, peripheryID):
     result = True
     if g_preDefinedHosts.periphery(peripheryID) is None:
         LOG_ERROR('Periphery not found', peripheryID)
         result = False
     elif self.__credentials is None:
         LOG_ERROR('Login info not found', peripheryID)
         result = False
     elif g_preDefinedHosts.isRoamingPeriphery(peripheryID) and not isRoamingEnabled(g_itemsCache.items.stats.attributes):
         LOG_ERROR('Roaming is not supported', peripheryID)
         result = False
     return result
예제 #5
0
 def isPeripheryAvailable(self, peripheryID):
     result = True
     if _isSkipPeripheryChecking():
         LOG_NOTE('Skip periphery checking in standalone mode')
         return result
     else:
         if g_preDefinedHosts.periphery(peripheryID) is None:
             LOG_ERROR('Periphery not found', peripheryID)
             result = False
         elif self.__credentials is None:
             LOG_ERROR('Login info not found', peripheryID)
             result = False
         elif g_preDefinedHosts.isRoamingPeriphery(peripheryID) and not isRoamingEnabled(g_itemsCache.items.stats.attributes):
             LOG_ERROR('Roaming is not supported', peripheryID)
             result = False
         return result
예제 #6
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