{"record":{"id":"008fd20f0d84e14b","repo":"Anuken/Mindustry","slug":"unknown-ui-entry-type","errorCode":null,"errorMessage":"Unknown UI entry type: ","messagePattern":"Unknown UI entry type: ","errorType":"exception","errorClass":"ArcRuntimeException","httpStatus":null,"severity":"error","filePath":"core/src/mindustry/io/TypeIO.java","lineNumber":342,"sourceCode":"        if(entries > MenuResult.maxTotalValues) throw new ArcRuntimeException(\"UI result entry count exceeds max entries: \" + entries);\n\n        for(int i = 0; i < entries; i++){\n            if(remainingChars <= 0) throw new ArcRuntimeException(\"Too many long strings in MenuResult, reduce your amount of elements/IDs.\");\n            String key = read.str(Math.min(remainingChars, MenuResult.maxValueLen));\n            remainingChars -= key.length();\n\n            byte type = read.b();\n\n            switch(type){\n                case 0 -> result.values.put(key, read.f());\n                case 1 ->  result.values.put(key, read.bool());\n                case 2 -> {\n                    if(remainingChars <= 0) throw new ArcRuntimeException(\"Too many long strings in MenuResult, reduce your amount of elements/IDs.\");\n                    String value = read.str(Math.min(remainingChars, MenuResult.maxValueLen));\n                    remainingChars -= value.length();\n                    result.values.put(key, value);\n                }\n                default -> throw new ArcRuntimeException(\"Unknown UI entry type: \" + type);\n            }\n        }\n        return result;\n    }\n\n    public static void writePayload(Writes writes, Payload payload){\n        Payload.write(payload, writes);\n    }\n\n    public static Payload readPayload(Reads read){\n        return Payload.read(read);\n    }\n\n    public static void writeMounts(Writes writes, WeaponMount[] mounts){\n        writes.b(mounts.length);\n        for(WeaponMount m : mounts){\n            writes.b((m.shoot ? 1 : 0) | (m.rotate ? 2 : 0));\n            writes.f(m.aimX);","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/Anuken/Mindustry/blob/f695ad7e60323ebced984fa26d0bcf0bc54296b4/core/src/mindustry/io/TypeIO.java#L324-L360","documentation":"readMenuResult()'s per-entry type switch accepts only 0 (float), 1 (boolean), and 2 (string). Any other type byte hits the default and throws ArcRuntimeException. An unknown type indicates a corrupt, incompatible, or malicious menu-result packet.","triggerScenarios":"A menu value entry's type byte is not 0, 1, or 2.","commonSituations":"Version mismatch in the menu-result format; packet corruption; fuzzing.","solutions":["Match client and server versions.","Server: catch ArcRuntimeException and kick the sender.","Only emit value types 0/1/2 from menu builder code."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { MenuResult r = TypeIO.readMenuResult(read); }\ncatch(ArcRuntimeException e){ Log.err(\"Bad menu result type\", e); con.kick(\"Protocol mismatch.\"); }","preventionTips":["Keep client and server versions matched.","Only emit value types 0 (float), 1 (boolean), 2 (string) from menu builders."],"tags":["network","ui","menu","version-mismatch","deserialization"],"backgroundTag":null,"analyzedSha":"f695ad7e60323ebced984fa26d0bcf0bc54296b4","analyzedAt":"2026-08-14T04:31:16.262Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}