mirror of
https://github.com/DarkflameUniverse/NexusDashboard.git
synced 2024-11-25 15:07:18 +00:00
util command to get mission/ach awards that aren't in honor accollade
This commit is contained in:
parent
f3e2254330
commit
823ec2008f
@ -19,7 +19,8 @@ from app.commands import (
|
|||||||
gen_image_cache,
|
gen_image_cache,
|
||||||
gen_model_cache,
|
gen_model_cache,
|
||||||
fix_clone_ids,
|
fix_clone_ids,
|
||||||
remove_buffs
|
remove_buffs,
|
||||||
|
find_missing_commendation_items
|
||||||
)
|
)
|
||||||
from app.models import Account, AccountInvitation, AuditLog
|
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(gen_model_cache)
|
||||||
app.cli.add_command(fix_clone_ids)
|
app.cli.add_command(fix_clone_ids)
|
||||||
app.cli.add_command(remove_buffs)
|
app.cli.add_command(remove_buffs)
|
||||||
|
app.cli.add_command(find_missing_commendation_items)
|
||||||
|
|
||||||
register_logging(app)
|
register_logging(app)
|
||||||
register_settings(app)
|
register_settings(app)
|
||||||
|
@ -4,7 +4,7 @@ import random
|
|||||||
import string
|
import string
|
||||||
import datetime
|
import datetime
|
||||||
from flask_user import current_app
|
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
|
from app.models import Account, PlayKey, CharacterInfo, Property, PropertyContent, UGC, Mail, CharacterXML
|
||||||
import pathlib
|
import pathlib
|
||||||
import zlib
|
import zlib
|
||||||
@ -281,3 +281,41 @@ def find_or_create_account(name, email, password, gm_level=9):
|
|||||||
db.session.add(play_key)
|
db.session.add(play_key)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return # account
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user