Ejemplo n.º 1
0
def packPascalString(s):
    if isinstance(s, unicode):
        s = s.encode('utf8')
    s = truncate_utf8(s, MAX_PASCAL_STRING_LEN)
    buffer = struct.pack('<H', len(s))
    buffer += s
    return buffer
Ejemplo n.º 2
0
 def __init__(self, databaseIDs, comment, waitingID = ''):
     super(SendInvitesUnitCtx, self).__init__(waitingID=waitingID)
     self.__databaseIDs = databaseIDs[:300]
     if comment:
         self.__comment = truncate_utf8(comment, INVITE_COMMENT_MAX_LENGTH)
     else:
         self.__comment = ''
Ejemplo n.º 3
0
def packPascalString(s):
    if isinstance(s, unicode):
        s = s.encode('utf8')
    s = truncate_utf8(s, MAX_PASCAL_STRING_LEN)
    buffer = struct.pack('<H', len(s))
    buffer += s
    return buffer
Ejemplo n.º 4
0
 def __init__(self, databaseIDs, comment, waitingID=""):
     super(SendInvitesCtx, self).__init__(waitingID=waitingID)
     self.__databaseIDs = databaseIDs[:300]
     if comment:
         self.__comment = truncate_utf8(comment, INVITE_COMMENT_MAX_LENGTH)
     else:
         self.__comment = ""
 def __init__(self, playerIDs, comment='', waitingID=''):
     super(SendInvitesCtx, self).__init__(waitingID=waitingID)
     self.__playerIDs = playerIDs[:300]
     if comment:
         self.__comment = truncate_utf8(
             comment, prb_settings.INVITE_COMMENT_MAX_LENGTH)
     else:
         self.__comment = ''
Ejemplo n.º 6
0
 def __init__(self,
              waitingID='',
              isOpened=True,
              comment='',
              isRequestToCreate=True,
              funcExit=prb_settings.FUNCTIONAL_EXIT.PREBATTLE):
     super(TeamSettingsCtx, self).__init__(waitingID=waitingID,
                                           funcExit=funcExit)
     self.__isOpened = isOpened
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
     self.__isForced = False
     self._isRequestToCreate = isRequestToCreate
Ejemplo n.º 7
0
 def __init__(self,
              prbType,
              waitingID='',
              isOpened=True,
              comment='',
              isRequestToCreate=True,
              flags=_FUNCTIONAL_FLAG.UNDEFINED):
     super(TeamSettingsCtx, self).__init__(entityType=prbType,
                                           waitingID=waitingID,
                                           flags=flags)
     self.__isOpened = isOpened
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
     self._isRequestToCreate = isRequestToCreate
Ejemplo n.º 8
0
 def __init__(self,
              clubDbID,
              minWinRate=0,
              minBattleCount=0,
              description='',
              waitingID='',
              confirmID=''):
     super(SetApplicantsRequirements, self).__init__(clubDbID,
                                                     waitingID=waitingID,
                                                     confirmID=confirmID)
     self.__minWinRate = minWinRate
     self.__minBattleCount = minBattleCount
     self.__description = truncate_utf8(description,
                                        CLUB_LIMITS.MAX_SHORT_DESC_LENGTH)
Ejemplo n.º 9
0
 def setComment(self, comment):
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
Ejemplo n.º 10
0
 def setComment(self, comment):
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
Ejemplo n.º 11
0
 def __init__(self, prbType, waitingID = '', isOpened = True, comment = '', isRequestToCreate = True, flags = _FUNCTIONAL_FLAG.UNDEFINED):
     super(_TeamSettingsCtx, self).__init__(entityType=prbType, waitingID=waitingID, flags=flags)
     self.__isOpened = isOpened
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
     self._isRequestToCreate = isRequestToCreate
Ejemplo n.º 12
0
 def __init__(self, comment, waitingID = ''):
     super(ChangeCommentCtx, self).__init__(entityType=prb_getters.getPrebattleType(), waitingID=waitingID)
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
Ejemplo n.º 13
0
 def __init__(self, waitingID = '', isOpened = True, comment = '', isRequestToCreate = True, funcExit = prb_settings.FUNCTIONAL_EXIT.PREBATTLE):
     super(TeamSettingsCtx, self).__init__(waitingID=waitingID, funcExit=funcExit)
     self.__isOpened = isOpened
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
     self.__isForced = False
     self._isRequestToCreate = isRequestToCreate
Ejemplo n.º 14
0
 def __init__(self, comment, waitingID = ''):
     super(ChangeCommentCtx, self).__init__(waitingID=waitingID)
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
Ejemplo n.º 15
0
 def __init__(self, comment, waitingID = ''):
     super(ChangeCommentUnitCtx, self).__init__(waitingID=waitingID)
     self.__comment = truncate_utf8(comment, prb_settings.UNIT_COMMENT_MAX_LENGTH)
Ejemplo n.º 16
0
 def __init__(self, comment, waitingID=''):
     super(ChangeCommentUnitCtx, self).__init__(waitingID)
     self.__comment = truncate_utf8(comment,
                                    prb_settings.UNIT_COMMENT_MAX_LENGTH)
Ejemplo n.º 17
0
 def __init__(self, comment, waitingID=''):
     super(ChangeCommentCtx, self).__init__(waitingID)
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
Ejemplo n.º 18
0
 def __init__(self, comment, waitingID=''):
     super(ChangeCommentCtx, self).__init__(entityType=prb_getters.getPrebattleType(), waitingID=waitingID)
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
Ejemplo n.º 19
0
 def __init__(self, clubDbID, minWinRate = 0, minBattleCount = 0, description = '', waitingID = '', confirmID = ''):
     super(SetApplicantsRequirements, self).__init__(clubDbID, waitingID=waitingID, confirmID=confirmID)
     self.__minWinRate = minWinRate
     self.__minBattleCount = minBattleCount
     self.__description = truncate_utf8(description, CLUB_LIMITS.MAX_SHORT_DESC_LENGTH)