util command to get mission/ach awards that aren't in honor accollade

This commit is contained in:
aronwk-aaron 2024-05-26 22:49:32 -05:00
parent f3e2254330
commit 823ec2008f
2 changed files with 42 additions and 2 deletions

View File

@ -19,7 +19,8 @@ from app.commands import (
gen_image_cache,
gen_model_cache,
fix_clone_ids,
remove_buffs
remove_buffs,
find_missing_commendation_items
)
from app.models import Account, AccountInvitation, AuditLog
@ -96,6 +97,7 @@ def create_app():
app.cli.add_command(gen_model_cache)
app.cli.add_command(fix_clone_ids)
app.cli.add_command(remove_buffs)
app.cli.add_command(find_missing_commendation_items)
register_logging(app)
register_settings(app)

View File

@ -4,7 +4,7 @@ import random
import string
import datetime
from flask_user import current_app
from app import db
from app import db, luclient
from app.models import Account, PlayKey, CharacterInfo, Property, PropertyContent, UGC, Mail, CharacterXML
import pathlib
import zlib
@ -281,3 +281,41 @@ def find_or_create_account(name, email, password, gm_level=9):
db.session.add(play_key)
db.session.commit()
return # account
@click.command("find_missing_commendation_items")
@with_appcontext
def find_missing_commendation_items():
data = dict()
lots = set()
reward_items = luclient.query_cdclient("Select reward_item1 from Missions;")
for reward_item in reward_items:
lots.add(reward_item[0])
reward_items = luclient.query_cdclient("Select reward_item2 from Missions;")
for reward_item in reward_items:
lots.add(reward_item[0])
reward_items = luclient.query_cdclient("Select reward_item3 from Missions;")
for reward_item in reward_items:
lots.add(reward_item[0])
reward_items = luclient.query_cdclient("Select reward_item4 from Missions;")
for reward_item in reward_items:
lots.add(reward_item[0])
lots.remove(0)
lots.remove(-1)
for lot in lots:
itemcompid = luclient.query_cdclient(
"Select component_id from ComponentsRegistry where component_type = 11 and id = ?;",
[lot],
one=True
)[0]
itemcomp = luclient.query_cdclient(
"Select commendationLOT, commendationCost from ItemComponent where id = ?;",
[itemcompid],
one=True
)
if itemcomp[0] is None or itemcomp[1] is None:
data[lot] = {"name": luclient.get_lot_name(lot)}
print(data)