summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-08-07 19:01:32 -0300
committerJesusaves <cpntb1@ymail.com>2021-08-07 19:01:32 -0300
commitb8b823e1a26a8cd3b5b363ff370a912e1f91e1f6 (patch)
tree85f97dfd2c4b782c267b017bc4e7693aa2064521
parent7330988327b0ba5cf325f7de020eff97cefbd3ca (diff)
downloadclient-b8b823e1a26a8cd3b5b363ff370a912e1f91e1f6.tar.gz
client-b8b823e1a26a8cd3b5b363ff370a912e1f91e1f6.tar.bz2
client-b8b823e1a26a8cd3b5b363ff370a912e1f91e1f6.tar.xz
client-b8b823e1a26a8cd3b5b363ff370a912e1f91e1f6.zip
Protocol upgrade
-rw-r--r--game/03_init.rpy7
-rw-r--r--game/battle.rpy2
-rw-r--r--game/quest.rpy3
3 files changed, 7 insertions, 5 deletions
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):