diff --git a/core/itch_client.gd b/core/itch_client.gd index eb5f1de..38c2397 100644 --- a/core/itch_client.gd +++ b/core/itch_client.gd @@ -323,7 +323,12 @@ func _rpc_call(method: String, params: Dictionary = {}) -> Dictionary: var id := _next_id _next_id += 1 var req := {"jsonrpc": "2.0", "id": id, "method": method, "params": params} - _send_line(JSON.stringify(req)) + # Params can carry game dicts that went through a JSON cache roundtrip + # (Godot's JSON.parse_string decodes every number as a float), so an id + # like 936521 comes back as 936521.0 and butlerd's int64 fields reject it + # with RPC error -32700. Normalizing before serializing guarantees every + # integral number is sent as an int, mirroring the inbound normalization. + _send_line(JSON.stringify(_normalize_json(req))) var out: Array = [-1, null, null] while out[0] != id: diff --git a/plugin.json b/plugin.json index 293ce98..40ae027 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "plugin.id": "itch", "plugin.name": "itch.io", - "plugin.version": "0.1.6", + "plugin.version": "0.1.7", "plugin.min-api-version": "1.1.0", "plugin.link": "https://github.com/YOUR_USERNAME/OpenGamepadUI-itch", "plugin.source": "https://github.com/YOUR_USERNAME/OpenGamepadUI-itch",