diff --git a/lovely.toml b/lovely.toml index 434d27c..a330237 100644 --- a/lovely.toml +++ b/lovely.toml @@ -79,3 +79,22 @@ sendInfoMessage("Attempting to register the Walled Garden ruleset...", "WalledGa end)() """ match_indent = true + +[[patches]] +[patches.pattern] +target = '=[SMODS Multiplayer "networking/action_handlers.lua"]' +pattern = 'local parsedAction = json.decode(msg)' +position = "at" +payload = """local garden, parsedAction = pcall(function() + return json.decode(msg) +end) + +if not garden or type(parsedAction) ~= "table" then + return sendErrorMessage( + "# **DESYNC MAY HAVE OCCURED!!!** | We don't know how to parse this! " .. + tostring(garden) .. + ": " .. + tostring(parsedAction), "MULTIPLAYER" + ) +end""" +match_indent = true diff --git a/manifest.json b/manifest.json index 74de195..47ee7a6 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "priority": 10000001, - "version": "1.0.2", + "version": "1.0.3", "id": "WalledGarden", "name": "WalledGarden", "icon_path": "icon.png",