def __init__(self, itemHash, itemInstanceId, sockets=None, displayProperties=None, inventory=None, categories=None, stats=None, manifestId=None): self.itemHash = itemHash self.itemInstanceId = itemInstanceId self.manifestId = manifestId if manifestId else Manifest.HashtoID( itemHash) self.displayProperties = displayProperties self.inventory = inventory self.categories = categories self.stats = stats if isinstance(stats, dict) else dict() self.sockets = [] if sockets: for a in sockets: if isinstance(a, SocketSet): self.sockets.append(a) else: sockets.append(SocketSet(**a)) if not all((self.manifestId, self.displayProperties, self.inventory, self.categories)): self.queryManifest()
def __init__(self, plugHash, manifestId=None, displayProperties=None): self.plugHash = plugHash self.manifestId = manifestId self.displayProperties = displayProperties if not all((self.manifestId, self.displayProperties)): self.manifestId = Manifest.HashtoID(plugHash) self.queryManifest()
def getCharacterInfo(session, membershiptype, membershipid, characters): WCP = Manifest.getDatabaseConnection() charIDs = characters characterinfo = CharacterList() for char in charIDs: a = Character(char) result = getCharacter(session, membershiptype, membershipid, char, '200') a.emblemBackgroundPath = result['character']['data'][ 'emblemBackgroundPath'] a.light = result['character']['data']['light'] classid = Manifest.HashtoID(result['character']['data']['classHash']) a.classname = WCP.selectQuery( classid, 'DestinyClassDefinition')['displayProperties']['name'] raceid = Manifest.HashtoID(result['character']['data']['raceHash']) a.racename = WCP.selectQuery( raceid, 'DestinyRaceDefinition')['displayProperties']['name'] genderid = Manifest.HashtoID(result['character']['data']['genderHash']) a.gendername = WCP.selectQuery( genderid, 'DestinyGenderDefinition')['displayProperties']['name'] characterinfo.chars.append(a) return characterinfo