def _get_checked_character(self, guid): """ Get the character data associated to that GUID, but only if this character belongs to the connected account, else return None. """ try: character = CharacterData.get( CharacterData.guid == guid and CharacterData.account == self.conn.account) return character except CharacterData.DoesNotExist: return None
def _get_checked_character(self, guid): """ Get the character data associated to that GUID, but only if this character belongs to the connected account, else return None. """ try: character = CharacterData.get( CharacterData.guid == guid and CharacterData.account == self.conn.account ) return character except CharacterData.DoesNotExist: return None
def _delete_char(guid): character = CharacterData.get(CharacterData.guid == guid) _CharacterDestructor._delete_char_skills(character) _CharacterDestructor._delete_char_spells(character) features = character.features stats = character.stats position = character.position character.delete_instance() features.delete_instance() stats.delete_instance() position.delete_instance() LOG.debug("Character " + str(guid) + " deleted.") return 0
def get_char_data(guid): """ Get the CharacterData associated to that GUID, or None. """ try: return CharacterData.get(CharacterData.guid == guid) except CharacterData.DoesNotExist: return None