From b8b823e1a26a8cd3b5b363ff370a912e1f91e1f6 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 7 Aug 2021 19:01:32 -0300 Subject: Protocol upgrade --- game/03_init.rpy | 7 ++++--- game/battle.rpy | 2 +- game/quest.rpy | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'game') diff --git a/game/03_init.rpy b/game/03_init.rpy index 90639c4..3c71874 100644 --- a/game/03_init.rpy +++ b/game/03_init.rpy @@ -43,11 +43,12 @@ init python: }""" % (w, q, p) - def battledata(u, s): + def battledata(u, s, a): return """{ "unit": %s, - "sphere": %s - }""" % (json.dumps(u), json.dumps(s)) + "sphere": %s, + "action": %s + }""" % (json.dumps(u), json.dumps(s), json.dumps(a)) def square_composite(cid, path, ei=False): # We need to try to get rarity diff --git a/game/battle.rpy b/game/battle.rpy index 8f5b8eb..6a0bea2 100644 --- a/game/battle.rpy +++ b/game/battle.rpy @@ -108,7 +108,7 @@ label combat: # Maybe we error'ed out and should relog if (response in [FAILUREMSG, OFFLINEMSG, ERR_JSONDECODER, ERR_LOGIN_DEFAULT]): $ renpy.call_screen("msgbox", "Error:\n\n%s" % response) - # Try again (x2) + # Try again (x2) (FIXME: If packet was malformated, might be a bad idea) $ response=loadbattle(Battle["party"]) # Maybe we error'ed out and should relog if (response in [FAILUREMSG, OFFLINEMSG, ERR_JSONDECODER, ERR_LOGIN_DEFAULT]): diff --git a/game/quest.rpy b/game/quest.rpy index b3a5155..2185450 100644 --- a/game/quest.rpy +++ b/game/quest.rpy @@ -28,7 +28,8 @@ init python: return bt def loadbattle(new_arrange): - raw=send_packet("battle", battledata(new_arrange, use_sphere)) + global Battle + raw=send_packet("battle", battledata(new_arrange, Battle["spheres"], use_sphere)) bt=json_decode(raw) if (bt == ERR_JSONDECODER): -- cgit v1.2.3-70-g09d2