Skip to content

Commit

Permalink
util command to get mission/ach awards that aren't in honor accollade
Browse files Browse the repository at this point in the history
  • Loading branch information
aronwk-aaron committed May 27, 2024
1 parent f3e2254 commit 823ec20
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
gen_image_cache,
gen_model_cache,
fix_clone_ids,
remove_buffs
remove_buffs,
find_missing_commendation_items
)
from app.models import Account, AccountInvitation, AuditLog

Expand Down Expand Up @@ -96,6 +97,7 @@ def numberFormat(value):
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)
Expand Down
40 changes: 39 additions & 1 deletion app/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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
Expand Down Expand Up @@ -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)


0 comments on commit 823ec20

Please sign in to comment.