cleaning up, adding party debug
This commit is contained in:
3
app.py
3
app.py
@@ -62,14 +62,17 @@ def party():
|
||||
# generate page
|
||||
print('about to gen response')
|
||||
response = make_response(render_template("party.html", adv_party=adv_party, count=count, level=level, cache=cache))
|
||||
print(response)
|
||||
# make a cookie for each character
|
||||
# this took a while to figure out, json was too large, b64 encoded json was too large, but it turns out you can compress json as a cookie
|
||||
for character in adv_party.adventurers:
|
||||
print('in char for loop')
|
||||
cookie_string = character.identifier
|
||||
char_json = json.dumps(character.get_json())
|
||||
compressed = zlib.compress(char_json.encode())
|
||||
cookie_data = base64.urlsafe_b64encode(compressed).decode()
|
||||
response.set_cookie(cookie_string, cookie_data)
|
||||
print('returning response')
|
||||
return response
|
||||
|
||||
@app.route('/character', methods = ["GET","POST"])
|
||||
|
||||
Reference in New Issue
Block a user