示例#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)