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
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 = ''
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
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 = ''
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
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
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)
def setComment(self, comment): self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
def setComment(self, comment): self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
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
def __init__(self, comment, waitingID = ''): super(ChangeCommentCtx, self).__init__(entityType=prb_getters.getPrebattleType(), waitingID=waitingID) self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
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
def __init__(self, comment, waitingID = ''): super(ChangeCommentCtx, self).__init__(waitingID=waitingID) self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
def __init__(self, comment, waitingID = ''): super(ChangeCommentUnitCtx, self).__init__(waitingID=waitingID) self.__comment = truncate_utf8(comment, prb_settings.UNIT_COMMENT_MAX_LENGTH)
def __init__(self, comment, waitingID=''): super(ChangeCommentUnitCtx, self).__init__(waitingID) self.__comment = truncate_utf8(comment, prb_settings.UNIT_COMMENT_MAX_LENGTH)
def __init__(self, comment, waitingID=''): super(ChangeCommentCtx, self).__init__(waitingID) self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
def __init__(self, comment, waitingID=''): super(ChangeCommentCtx, self).__init__(entityType=prb_getters.getPrebattleType(), waitingID=waitingID) self.__comment = truncate_utf8(comment, PREBATTLE_COMMENT_MAX_LENGTH)
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)