This commit is contained in:
Aaron Kimbre 2022-05-29 20:12:32 -05:00
parent f8332dc065
commit f7703abe5e
4 changed files with 135 additions and 160 deletions

View File

@ -167,7 +167,7 @@ class Activities(db.Model):
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -258,7 +258,7 @@ class ActivityText(db.Model):
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -1203,7 +1203,7 @@ class CelebrationParameters(db.Model):
backgroundObject = db.Column( backgroundObject = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Objects.id) db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -1224,7 +1224,7 @@ class CelebrationParameters(db.Model):
IconID = db.Column( IconID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID), db.ForeignKey("Icons.IconID"),
nullable=False nullable=False
) )
@ -1380,7 +1380,7 @@ class CollectibleComponent(db.Model):
requirement_mission = db.Column( requirement_mission = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Missions.id), db.ForeignKey("Missions.id"),
nullable=True nullable=True
) )
@ -1391,7 +1391,7 @@ class ComponentsRegistry(db.Model):
id = db.Column( id = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Objects.id) db.ForeignKey("Objects.id"),
nullable=False, nullable=False,
primary_key=True primary_key=True
) )
@ -1553,7 +1553,7 @@ class CurrencyDenominations(db.Model):
objectid = db.Column( objectid = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Objects.id) db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -1644,7 +1644,7 @@ class DeletionRestrictions(db.Model):
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -1661,7 +1661,7 @@ class DestructibleComponent(db.Model):
faction = db.Column( faction = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Factions.faction) db.ForeignKey("Factions.faction"),
nullable=True nullable=True
) )
@ -1791,7 +1791,7 @@ class Emotes(db.Model):
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -2335,37 +2335,37 @@ class ItemSets(db.Model):
kitImage = db.Column( kitImage = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID) db.ForeignKey("Icons.IconID"),
nullable=True nullable=True
) )
skillSetWith2 = db.Column( skillSetWith2 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(ItemSetSkills.id), db.ForeignKey("ItemSetSkills.SkillSetID"),
nullable=True nullable=True
) )
skillSetWith3 = db.Column( skillSetWith3 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(ItemSetSkills.id), db.ForeignKey("ItemSetSkills.SkillSetID"),
nullable=True nullable=True
) )
skillSetWith4 = db.Column( skillSetWith4 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(ItemSetSkills.id), db.ForeignKey("ItemSetSkills.SkillSetID"),
nullable=True nullable=True
) )
skillSetWith5 = db.Column( skillSetWith5 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(ItemSetSkills.id), db.ForeignKey("ItemSetSkills.SkillSetID"),
nullable=True nullable=True
) )
skillSetWith6 = db.Column( skillSetWith6 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(ItemSetSkills.id), db.ForeignKey("ItemSetSkills.SkillSetID"),
nullable=True nullable=True
) )
@ -2376,7 +2376,7 @@ class ItemSets(db.Model):
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
# ??? # ???
@ -2418,13 +2418,13 @@ class JetPackPadComponent(db.Model):
lotBlocker = db.Column( lotBlocker = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Objects.id), db.ForeignKey("Objects.id"),
nullable=True nullable=True
) )
lotWarningVolume = db.Column( lotWarningVolume = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Objects.id), db.ForeignKey("Objects.id"),
nullable=True nullable=True
) )
@ -2476,7 +2476,7 @@ class LUPExhibitModelData(db.Model):
LOT = db.Column( LOT = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Objects.id), db.ForeignKey("Objects.id"),
nullable=False, nullable=False,
primary_key=True primary_key=True
) )
@ -2513,7 +2513,7 @@ class LUPZoneIDs(db.Model):
zoneID = db.Column( zoneID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(ZoneTabe.zoneID) db.ForeignKey("ZoneTable.zoneID"),
nullable=False, nullable=False,
primary_key=True primary_key=True
) )
@ -2561,6 +2561,7 @@ class LootMatrix(db.Model):
__tablename__ = 'LootMatrix' __tablename__ = 'LootMatrix'
__bind_key__ = 'cdclient' __bind_key__ = 'cdclient'
# FK?
LootMatrixIndex = db.Column( LootMatrixIndex = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False, nullable=False,
@ -2606,7 +2607,7 @@ class LootMatrix(db.Model):
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -2694,7 +2695,7 @@ class MinifigComponent(db.Model):
legs = db.Column( legs = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(MinifigDecals_Legs.id), db.ForeignKey("MinifigDecals_Legs.ID"),
nullable=False nullable=False
) )
@ -2710,7 +2711,7 @@ class MinifigComponent(db.Model):
chestdecal = db.Column( chestdecal = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(MinifigDecals_Torsos.id), db.ForeignKey("MinifigDecals_Torsos.ID"),
nullable=False nullable=False
) )
@ -2731,19 +2732,19 @@ class MinifigComponent(db.Model):
eyebrowstyle = db.Column( eyebrowstyle = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(MinifigDecals_Eyebrows.id), db.ForeignKey("MinifigDecals_Eyebrows.ID"),
nullable=False nullable=False
) )
eyesstyle = db.Column( eyesstyle = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(MinifigDecals_Eyes.id), db.ForeignKey("MinifigDecals_Eyes.ID"),
nullable=False nullable=False
) )
mouthstyle = db.Column( mouthstyle = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(MinifigDecals_Mouths.id), db.ForeignKey("MinifigDecals_Mouths.ID"),
nullable=False nullable=False
) )
@ -2925,7 +2926,7 @@ class MissionEmail(db.Model):
missionID = db.Column( missionID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Missions.id), db.ForeignKey("Missions.id"),
nullable=False nullable=False
) )
@ -2933,7 +2934,7 @@ class MissionEmail(db.Model):
attachmentLOT = db.Column( attachmentLOT = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Objects.id), db.ForeignKey("Objects.id"),
nullable=True nullable=True
) )
@ -2951,7 +2952,7 @@ class MissionEmail(db.Model):
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -2968,7 +2969,7 @@ class MissionNPCComponent(db.Model):
missionID = db.Column( missionID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Missions.id), db.ForeignKey("Missions.id"),
nullable=False nullable=False
) )
@ -2984,7 +2985,7 @@ class MissionNPCComponent(db.Model):
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -3036,7 +3037,7 @@ class MissionTasks(db.Model):
IconID = db.Column( IconID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID), db.ForeignKey("Icons.IconID"),
nullable=False nullable=False
) )
@ -3059,7 +3060,7 @@ class MissionTasks(db.Model):
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -3091,7 +3092,7 @@ class MissionText(db.Model):
IconID = db.Column( IconID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID), db.ForeignKey("Icons.IconID"),
nullable=False nullable=False
) )
@ -3219,7 +3220,7 @@ class MissionText(db.Model):
turnInIconID = db.Column( turnInIconID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID), db.ForeignKey("Icons.IconID"),
nullable=False nullable=False
) )
@ -3237,7 +3238,7 @@ class MissionText(db.Model):
# FK # FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -3296,9 +3297,10 @@ class Missions(db.Model):
sqlite.BOOLEAN(), sqlite.BOOLEAN(),
nullable=False nullable=False
) )
# FK
reward_item1 = db.Column( reward_item1 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -3306,9 +3308,10 @@ class Missions(db.Model):
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
) )
# FK
reward_item2 = db.Column( reward_item2 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -3316,9 +3319,10 @@ class Missions(db.Model):
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
) )
# FK
reward_item3 = db.Column( reward_item3 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -3326,9 +3330,10 @@ class Missions(db.Model):
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
) )
# FK
reward_item4 = db.Column( reward_item4 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -3336,24 +3341,28 @@ class Missions(db.Model):
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
) )
# FK
reward_emote = db.Column( reward_emote = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Emotes.id"),
nullable=False nullable=False
) )
# FK
reward_emote2 = db.Column( reward_emote2 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Emotes.id"),
nullable=False nullable=False
) )
# FK
reward_emote3 = db.Column( reward_emote3 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Emotes.id"),
nullable=True nullable=True
) )
# FK
reward_emote4 = db.Column( reward_emote4 = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Emotes.id"),
nullable=True nullable=True
) )
@ -3396,9 +3405,10 @@ class Missions(db.Model):
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=True nullable=True
) )
# FK
reward_item1_repeatable = db.Column( reward_item1_repeatable = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -3406,9 +3416,10 @@ class Missions(db.Model):
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
) )
# FK
reward_item2_repeatable = db.Column( reward_item2_repeatable = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -3416,9 +3427,10 @@ class Missions(db.Model):
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
) )
# FK
reward_item3_repeatable = db.Column( reward_item3_repeatable = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -3426,9 +3438,10 @@ class Missions(db.Model):
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
) )
# FK
reward_item4_repeatable = db.Column( reward_item4_repeatable = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -3449,12 +3462,13 @@ class Missions(db.Model):
missionIconID = db.Column( missionIconID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID), db.ForeignKey("Icons.IconID"),
nullable=False nullable=False
) )
missionIcon = db.relationship("Icons") missionIcon = db.relationship("Icons")
# FK
# pipe SV of missions?
prereqMissionID = db.Column( prereqMissionID = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
nullable=True nullable=True
@ -3484,15 +3498,15 @@ class Missions(db.Model):
sqlite.TEXT(), sqlite.TEXT(),
nullable=True nullable=True
) )
# FK # FK ?
UIPrereqID = db.Column( UIPrereqID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=True nullable=True
) )
# FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -3550,6 +3564,7 @@ class ModularBuildComponent(db.Model):
createdLOT = db.Column( createdLOT = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -3777,9 +3792,10 @@ class NpcIcons(db.Model):
sqlite.FLOAT(), sqlite.FLOAT(),
nullable=False nullable=False
) )
# FK
LOT = db.Column( LOT = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False nullable=False
) )
@ -3902,12 +3918,14 @@ class ObjectSkills(db.Model):
objectTemplate = db.Column( objectTemplate = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("Objects.id"),
nullable=False, nullable=False,
primary_key=True primary_key=True
) )
# FK
skillID = db.Column( skillID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("SkillBehavior.skillID"),
nullable=False nullable=False
) )
@ -3956,7 +3974,7 @@ class Objects(db.Model):
sqlite.BOOLEAN(), sqlite.BOOLEAN(),
nullable=False nullable=False
) )
# FK?
npcTemplateID = db.Column( npcTemplateID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=True nullable=True
@ -3989,7 +4007,7 @@ class Objects(db.Model):
# FK # FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -4008,13 +4026,14 @@ class PackageComponent(db.Model):
nullable=False, nullable=False,
primary_key=True primary_key=True
) )
# FK
LootMatrixIndex = db.Column( LootMatrixIndex = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey("LootMatrix.LootMatrixIndex"),
nullable=False, nullable=False,
primary_key=True primary_key=True
) )
# Enum?
packageType = db.Column( packageType = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
@ -4122,6 +4141,7 @@ class PetComponent(db.Model):
nullable=True nullable=True
) )
# CSV of BuffDefinitions.ID's ?
buffIDs = db.Column( buffIDs = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
nullable=True nullable=True
@ -4275,10 +4295,10 @@ class PlayerStatistics(db.Model):
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
) )
# FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -4396,7 +4416,7 @@ class Preconditions(db.Model):
IconID = db.Column( IconID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID), db.ForeignKey("Icons.IconID"),
nullable=False nullable=False
) )
@ -4419,7 +4439,7 @@ class Preconditions(db.Model):
# FK # FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -4469,7 +4489,7 @@ class PropertyTemplate(db.Model):
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
) )
# FK ZoneTabe # FK ZoneTable
vendorMapID = db.Column( vendorMapID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
nullable=False nullable=False
@ -4557,7 +4577,7 @@ class PropertyTemplate(db.Model):
# FK # FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -4620,7 +4640,7 @@ class ProximityTypes(db.Model):
IconID = db.Column( IconID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID), db.ForeignKey("Icons.IconID"),
nullable=False nullable=False
) )
@ -4961,7 +4981,7 @@ class RenderComponent(db.Model):
IconID = db.Column( IconID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID), db.ForeignKey("Icons.IconID"),
nullable=False nullable=False
) )
@ -5215,7 +5235,7 @@ class RewardCodes(db.Model):
# FK # FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -5457,7 +5477,7 @@ class SkillBehavior(db.Model):
# FK # FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -5616,7 +5636,7 @@ class SpeedchatMenu(db.Model):
# FK # FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -5950,7 +5970,7 @@ class UGBehaviorSounds(db.Model):
# FK # FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -6555,7 +6575,7 @@ class WhatsCoolItemSpotlight(db.Model):
# FK # FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -6577,7 +6597,7 @@ class WhatsCoolNewsAndTips(db.Model):
IconID = db.Column( IconID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID), db.ForeignKey("Icons.IconID"),
nullable=False nullable=False
) )
@ -6595,7 +6615,7 @@ class WhatsCoolNewsAndTips(db.Model):
# FK # FK
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -7101,7 +7121,7 @@ class ZoneTable(db.Model):
gate_version = db.Column( gate_version = db.Column(
sqlite.TEXT(), sqlite.TEXT(),
db.ForeignKey(FeatureGating.featureName), db.ForeignKey("FeatureGating.featureName"),
nullable=True nullable=True
) )
@ -7238,7 +7258,7 @@ class mapIcon(db.Model):
IconID = db.Column( IconID = db.Column(
sqlite.INTEGER(), sqlite.INTEGER(),
db.ForeignKey(Icons.IconID), db.ForeignKey("Icons.IconID"),
nullable=False, nullable=False,
primary_key=True primary_key=True
) )

View File

@ -9,7 +9,11 @@ from flask import (
) )
from flask_user import login_required from flask_user import login_required
from app.models import CharacterInfo from app.models import CharacterInfo
from app.cdclient import Objects from app.cdclient import (
Objects,
Icons,
ItemSets
)
import glob import glob
import os import os
from wand import image from wand import image
@ -19,6 +23,7 @@ import json
import sqlite3 import sqlite3
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from sqlalchemy import or_
luclient_blueprint = Blueprint('luclient', __name__) luclient_blueprint = Blueprint('luclient', __name__)
locale = {} locale = {}
@ -104,11 +109,7 @@ def get_icon_lot(id):
@login_required @login_required
def get_icon_iconid(id): def get_icon_iconid(id):
filename = query_cdclient( filename = Icons.query.filter(Icons.IconID == id).first().IconPath
'select IconPath from Icons where IconID = ?',
[id],
one=True
)[0]
filename = filename.replace("..\\", "").replace("\\", "/") filename = filename.replace("..\\", "").replace("\\", "/")
@ -184,32 +185,6 @@ def unknown():
return send_file(pathlib.Path(cache).resolve()) return send_file(pathlib.Path(cache).resolve())
def get_cdclient():
"""Connect to CDClient from file system Relative Path
Args:
None
"""
cdclient = getattr(g, '_cdclient', None)
if cdclient is None:
cdclient = g._database = sqlite3.connect('app/luclient/res/cdclient.sqlite')
return cdclient
def query_cdclient(query, args=(), one=False):
"""Run sql queries on CDClient
Args:
query (string) : SQL query
args (list) : List of args to place in query
one (bool) : Return only on result or all results
"""
cur = get_cdclient().execute(query, args)
rv = cur.fetchall()
cur.close()
return (rv[0] if rv else None) if one else rv
def translate_from_locale(trans_string): def translate_from_locale(trans_string):
"""Finds the string translation from locale.xml """Finds the string translation from locale.xml
@ -322,11 +297,8 @@ def register_luclient_jinja_helpers(app):
return "Missing" return "Missing"
desc = translate_from_locale(f'Objects_{lot_id}_description') desc = translate_from_locale(f'Objects_{lot_id}_description')
if desc == f'Objects_{lot_id}_description': if desc == f'Objects_{lot_id}_description':
desc = query_cdclient( desc = Objects.query.filter(Objects.id == id).first().description
'select description from Objects where id = ?',
[lot_id],
one=True
)
if desc in ("", None): if desc in ("", None):
desc = None desc = None
else: else:
@ -341,11 +313,14 @@ def register_luclient_jinja_helpers(app):
def check_if_in_set(lot_id): def check_if_in_set(lot_id):
if not lot_id: if not lot_id:
return None return None
item_set = query_cdclient( item_set = ItemSets.query.filter(
'select * from ItemSets where itemIDs like ? or itemIDs like ? or itemIDs like ?', or_(
[f'{lot_id}%', f'%, {lot_id}%', f'%,{lot_id}%'], ItemSets.itemIDs.like(f'{lot_id}%'),
one=True ItemSets.itemIDs.like(f'%, {lot_id}%'),
) ItemSets.itemIDs.like(f'%,{lot_id}%')
)
).first()
if item_set in ("", None): if item_set in ("", None):
return None return None
else: else:
@ -377,14 +352,6 @@ def register_luclient_jinja_helpers(app):
return consolidate_stats(stats) return consolidate_stats(stats)
@app.template_filter('query_cdclient')
def jinja_query_cdclient(query, items):
print(query, items)
return query_cdclient(
query,
items,
one=True
)[0]
@app.template_filter('lu_translate') @app.template_filter('lu_translate')
def lu_translate(to_translate): def lu_translate(to_translate):

View File

@ -3,7 +3,8 @@ from flask_user import login_required, current_user
from app.models import Mail, CharacterInfo from app.models import Mail, CharacterInfo
from app.forms import SendMailForm from app.forms import SendMailForm
from app import gm_level, log_audit from app import gm_level, log_audit
from app.luclient import translate_from_locale, query_cdclient from app.luclient import translate_from_locale
from app.cdclient import Objects
import time import time
mail_blueprint = Blueprint('mail', __name__) mail_blueprint = Blueprint('mail', __name__)
@ -68,15 +69,12 @@ def send():
for character in recipients: for character in recipients:
form.recipient.choices.append((character.id, character.name)) form.recipient.choices.append((character.id, character.name))
items = query_cdclient( items = Objects.query.filter(Objects.type == "Loot").all()
'Select id, name, displayName from Objects where type = ?',
["Loot"]
)
for item in items: for item in items:
name = translate_from_locale(f'Objects_{item[0]}_name') name = translate_from_locale(f'Objects_{item[0]}_name')
if name == f'Objects_{item[0]}_name': if name == f'Objects_{item.id}_name':
name = (item[2] if (item[2] != "None" and item[2] != "" and item[2] is not None) else item[1]) name = (item.displayName if (item.displayName != "None" and item.displayName != "" and item.displayName is not None) else item.name)
form.attachment.choices.append( form.attachment.choices.append(
( (
item[0], item[0],

View File

@ -15,7 +15,7 @@ import time
from app.models import Property, db, UGC, CharacterInfo, PropertyContent, Account, Mail from app.models import Property, db, UGC, CharacterInfo, PropertyContent, Account, Mail
from app.schemas import PropertySchema from app.schemas import PropertySchema
from app import gm_level, log_audit from app import gm_level, log_audit
from app.luclient import query_cdclient from app.cdclient import ZoneTable
from app.forms import RejectPropertyForm from app.forms import RejectPropertyForm
import zlib import zlib
@ -49,11 +49,9 @@ def approve(id):
if property_data.mod_approved: if property_data.mod_approved:
message = f"""Approved Property message = f"""Approved Property
{property_data.name if property_data.name else query_cdclient( {property_data.name if property_data.name else ZoneTable.query.filter(
'select DisplayDescription from ZoneTable where zoneID = ?', ZoneTable.zoneID == property_data.zone_id
[property_data.zone_id], ).first().DisplayDescription}
one=True
)[0]}
from {CharacterInfo.query.filter(CharacterInfo.id==property_data.owner_id).first().name}""" from {CharacterInfo.query.filter(CharacterInfo.id==property_data.owner_id).first().name}"""
log_audit(message) log_audit(message)
flash( flash(
@ -62,11 +60,9 @@ def approve(id):
) )
else: else:
message = f"""Unapproved Property message = f"""Unapproved Property
{property_data.name if property_data.name else query_cdclient( {property_data.name if property_data.name else ZoneTable.query.filter(
'select DisplayDescription from ZoneTable where zoneID = ?', ZoneTable.zoneID == property_data.zone_id
[property_data.zone_id], ).first().DisplayDescription}
one=True
)[0]}
from {CharacterInfo.query.filter(CharacterInfo.id==property_data.owner_id).first().name}""" from {CharacterInfo.query.filter(CharacterInfo.id==property_data.owner_id).first().name}"""
log_audit(message) log_audit(message)
flash( flash(
@ -100,11 +96,9 @@ def reject(id):
if form.validate_on_submit(): if form.validate_on_submit():
char_name = CharacterInfo.query.filter(CharacterInfo.id == property_data.owner_id).first().name char_name = CharacterInfo.query.filter(CharacterInfo.id == property_data.owner_id).first().name
zone_name = query_cdclient( zone_name = ZoneTable.query.filter(
'select DisplayDescription from ZoneTable where zoneID = ?', ZoneTable.zoneID == property_data.zone_id
[property_data.zone_id], ).first().DisplayDescription
one=True
)[0]
property_data.mod_approved = False property_data.mod_approved = False
property_data.rejection_reason = form.rejection_reason.data property_data.rejection_reason = form.rejection_reason.data
message = f"""Rejected Property message = f"""Rejected Property
@ -251,11 +245,9 @@ def get(status="all"):
""" """
if property_data["4"] == "": if property_data["4"] == "":
property_data["4"] = query_cdclient( property_data["4"] = ZoneTable.query.filter(
'select DisplayDescription from ZoneTable where zoneID = ?', ZoneTable.zoneID == property_data.zone_id
[property_data["13"]], ).first().DisplayDescription
one=True
)
if property_data["6"] == 0: if property_data["6"] == 0:
property_data["6"] = "Private" property_data["6"] = "Private"
@ -272,11 +264,9 @@ def get(status="all"):
else: else:
property_data["7"] = '''<h2 class="far fa-check-square text-success"></h2>''' property_data["7"] = '''<h2 class="far fa-check-square text-success"></h2>'''
property_data["13"] = query_cdclient( property_data["13"] = ZoneTable.query.filter(
'select DisplayDescription from ZoneTable where zoneID = ?', ZoneTable.zoneID == property_data.zone_id
[property_data["13"]], ).first().DisplayDescription
one=True
)
return data return data