예제 #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
예제 #2
0
파일: ctx.py 프로젝트: kusaku/wot_scripts
 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 = ''
예제 #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
예제 #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 = ''
예제 #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
예제 #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
예제 #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)
예제 #9
0
 def setComment(self, comment):
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
예제 #10
0
 def setComment(self, comment):
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
예제 #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
예제 #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)
예제 #13
0
파일: prb_ctx.py 프로젝트: webiumsk/WoT
 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
예제 #14
0
파일: prb_ctx.py 프로젝트: webiumsk/WoT
 def __init__(self, comment, waitingID = ''):
     super(ChangeCommentCtx, self).__init__(waitingID=waitingID)
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
예제 #15
0
 def __init__(self, comment, waitingID = ''):
     super(ChangeCommentUnitCtx, self).__init__(waitingID=waitingID)
     self.__comment = truncate_utf8(comment, prb_settings.UNIT_COMMENT_MAX_LENGTH)
예제 #16
0
 def __init__(self, comment, waitingID=''):
     super(ChangeCommentUnitCtx, self).__init__(waitingID)
     self.__comment = truncate_utf8(comment,
                                    prb_settings.UNIT_COMMENT_MAX_LENGTH)
예제 #17
0
 def __init__(self, comment, waitingID=''):
     super(ChangeCommentCtx, self).__init__(waitingID)
     self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
예제 #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)
예제 #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)