summaryrefslogtreecommitdiff
path: root/client/multiplayer.gd
diff options
context:
space:
mode:
authormetamuffin <metamuffin@noreply.codeberg.org>2024-12-25 19:05:05 +0000
committermetamuffin <metamuffin@noreply.codeberg.org>2024-12-25 19:05:05 +0000
commitcc6b50debb9d5b740adbe6f803755413c972659a (patch)
treeb34a0a5669707992f1334f88a1959d5b1e120415 /client/multiplayer.gd
parent2ceeea0e5fc245602618ec47f6ff1f91a094e130 (diff)
parent53cf167c08986caf346957d1f357cefaee1bd6b5 (diff)
downloadhurrycurry-cc6b50debb9d5b740adbe6f803755413c972659a.tar
hurrycurry-cc6b50debb9d5b740adbe6f803755413c972659a.tar.bz2
hurrycurry-cc6b50debb9d5b740adbe6f803755413c972659a.tar.zst
Merge pull request 'Two-handed players' (#236) from two-handed into master
Reviewed-on: https://codeberg.org/hurrycurry/hurrycurry/pulls/236
Diffstat (limited to 'client/multiplayer.gd')
-rw-r--r--client/multiplayer.gd8
1 files changed, 5 insertions, 3 deletions
diff --git a/client/multiplayer.gd b/client/multiplayer.gd
index 57031221..5a9406ab 100644
--- a/client/multiplayer.gd
+++ b/client/multiplayer.gd
@@ -21,8 +21,8 @@ extends Node
signal packet(packet: Dictionary)
signal connection_closed()
-static var VERSION_MAJOR: int = 7
-static var VERSION_MINOR: int = 5
+static var VERSION_MAJOR: int = 8
+static var VERSION_MINOR: int = 0
var connected := false
var socket := WebSocketPeer.new()
@@ -66,6 +66,7 @@ func fix_packet_types(val):
if typeof(val[k]) == TYPE_ARRAY and val[k].size() == 2 and typeof(val[k][0]) == TYPE_FLOAT and typeof(val[k][1]) == TYPE_FLOAT:
if k in ["tile"]: newval[k] = Vector2i(val[k][0], val[k][1])
elif k in ["pos", "position"]: newval[k] = Vector2(val[k][0], val[k][1])
+ else: newval[k] = val[k]
# TODO reenable when fixed
# elif k in ["player", "id"] and typeof(val[k]) == TYPE_FLOAT:
# newval[k] = int(val[k])
@@ -106,11 +107,12 @@ func send_movement(player, pos: Vector2, direction: Vector2, boost: bool):
"boost": boost
})
-func send_tile_interact(player, pos: Vector2i, edge: bool):
+func send_tile_interact(player, pos: Vector2i, edge: bool, hand: int):
@warning_ignore("incompatible_ternary")
send_packet({
"type": "interact",
"player": player,
+ "hand": hand,
"pos": [pos.x, pos.y] if edge else null,
})