Skip to content

Commit

Permalink
added endpoint to add classic money
Browse files Browse the repository at this point in the history
  • Loading branch information
GDcheeriosYT committed Nov 5, 2024
1 parent 33b6b4c commit 96cc418
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crap/gentrys_quest_crap/GQManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ def add_item(item_type: str, data, is_classic: bool, owner: int):
def gift_item(item_type: str, data, is_classic: bool, owner: int):
return Item.gift_item(item_type, data, is_classic, owner)

@staticmethod
def classic_add_money(id, amount):
DB.do("UPDATE gentrys_quest_classic_data SET new_money = new_money + %s where id = %s", params=(amount, id))
return amount

@staticmethod
@ranking
def remove_item(id: int):
Expand Down
6 changes: 6 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ async def update_classic_data(id):
return "Bad token"


@app.route("/api/gqc/add-money/<id>+<amount>+<secret>")
async def classic_add_money(id, amount, secret):
if secret == client.secret:
return GQManager.classic_add_money(id, amount)


@app.route("/api/gqc/get-data/<id>", methods=['GET'])
async def classic_get_data(id):
return GQManager.get_data(id, True)
Expand Down

0 comments on commit 96cc418

Please sign in to comment.