haxball / haxball-issues

115 stars 43 forks source link

Map that breaks the room (unhandled exception) #1533

Closed alpheratz0 closed 1 year ago

alpheratz0 commented 2 years ago

Hi, there's a map when loaded breaks completely the room (freezes) and you cant change the map anymore and makes every client to quit and the host itself to crash, I know that you shouldnt give admin privileges to people you dont trust but people sometimes do.

Expand to see map content

```json { "name": "rip host", "width": 500, "height": 300, "bg": { "type": "grass" }, "vertexes": [ { "x": -40, "y": 22, "cMask": ["wall"] }, { "x": 35, "y": 22, "cMask": ["wall"] }, { "x": -70, "y": 65, "cMask": ["red"] }, { "x": 70, "y": 65, "cMask": ["red"] }, { "x": 70, "y": 170, "cMask": ["red"] }, { "x": -70, "y": 170, "cMask": ["red"] }, { "x": -68, "y": 68, "cMask": ["red"] }, { "x": 68, "y": 68, "cMask": ["red"] }, { "x": 68, "y": 168, "cMask": ["red"] }, { "x": -68, "y": 168, "cMask": ["red"] }, { "x": -66, "y": 70, "cMask": ["red"] }, { "x": 66, "y": 70, "cMask": ["red"] }, { "x": 66, "y": 166, "cMask": ["red"] }, { "x": -66, "y": 166, "cMask": ["red"] }, { "x": 0, "y": 145, "cMask": ["red"] }, { "x": 0, "y": 100, "cMask": ["red"] }, { "x": -15, "y": 115, "cMask": ["red"] }, { "x": -15, "y": 145, "cMask": ["red"] }, { "x": 15, "y": 145, "cMask": ["red"] }, { "x": -210, "y": 102, "cMask": ["red"] }, { "x": -70, "y": 102, "cMask": ["red"] }, { "x": -70, "y": 170, "cMask": ["red"] }, { "x": -210, "y": 170, "cMask": ["red"] }, { "x": -208, "y": 105, "cMask": ["red"] }, { "x": -72, "y": 105, "cMask": ["red"] }, { "x": -72, "y": 168, "cMask": ["red"] }, { "x": -208, "y": 168, "cMask": ["red"] }, { "x": -206, "y": 107, "cMask": ["red"] }, { "x": -74, "y": 107, "cMask": ["red"] }, { "x": -74, "y": 166, "cMask": ["red"] }, { "x": -206, "y": 166, "cMask": ["red"] }, { "x": -145.5, "y": 128, "cMask": ["red"] }, { "x": -127.5, "y": 132, "cMask": ["red"] }, { "x": -148, "y": 155, "cMask": ["red"] }, { "x": -125, "y": 155, "cMask": ["red"] } ], "segments": [ { "v0": 0, "v1": 1, "curve": 71.0048451488344, "curveF": 1.4018229166666665, "cMask": ["wall"] }, { "v0": 2, "v1": 3, "cMask": ["red"] }, { "v0": 3, "v1": 4, "cMask": ["red"] }, { "v0": 2, "v1": 5, "cMask": ["red"] }, { "v0": 5, "v1": 4, "cMask": ["red"] }, { "v0": 6, "v1": 7, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 7, "v1": 8, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 6, "v1": 9, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 9, "v1": 8, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 10, "v1": 11, "cMask": ["red"] }, { "v0": 11, "v1": 12, "cMask": ["red"] }, { "v0": 10, "v1": 13, "cMask": ["red"] }, { "v0": 13, "v1": 12, "cMask": ["red"] }, { "v0": 14, "v1": 15, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 16, "v1": 15, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 17, "v1": 18, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 19, "v1": 20, "cMask": ["red"] }, { "v0": 19, "v1": 22, "cMask": ["red"] }, { "v0": 22, "v1": 21, "cMask": ["red"] }, { "v0": 23, "v1": 24, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 23, "v1": 26, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 26, "v1": 25, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 27, "v1": 28, "cMask": ["red"] }, { "v0": 27, "v1": 30, "cMask": ["red"] }, { "v0": 30, "v1": 29, "cMask": ["red"] }, { "v0": 31, "v1": 32, "curve": -159.90130282375026, "curveF": -0.17721518987341756, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 32, "v1": 33, "cMask": ["red"], "color": "FFFFFF" }, { "v0": 33, "v1": 34, "cMask": ["red"], "color": "FFFFFF" } ], "planes": [ { "normal": [0, 1], "dist": -294, "bCoef": 0 }, { "normal": [0, -1], "dist": -293, "bCoef": 0 }, { "normal": [1, 0], "dist": -494, "bCoef": 0 }, { "normal": [-1, 0], "dist": -493, "bCoef": 0 } ], "goals": [], "discs": [], "playerPhysics": {}, "ballPhysics": "disc0", "spawnDistance": 277.5 } ```

Screenshot

Here is a screenshot of the console after the map is loaded and the Start Game button is pressed \ console-screenshot

thenorthstar commented 2 years ago

Hi, there's a map when loaded breaks completely the room (freezes) and you cant change the map anymore and makes every client to quit and the host itself to crash, I know that you shouldnt give admin privileges to people you dont trust but people sometimes do.

Expand to see map content

Screenshot

Here is a screenshot of the console after the map is loaded and the Start Game button is pressed console-screenshot

@alpheratz0 Duplicate of #1473.

alpheratz0 commented 2 years ago

@thenorthstar oh I didn't notice, anyway basro didn't fix it and your solution doesnt prevent the 'bug' from happening. It would be better if haxball detects the map as invalid.

thenorthstar commented 2 years ago

@thenorthstar oh I didn't notice, anyway basro didn't fix it and your solution doesnt prevent the 'bug' from happening. It would be better if haxball detects the map as invalid.

@alpheratz0 Already I had shared a temporary solution, this job is up to @basro.

basro commented 1 year ago

This is now fixed in the latest headless.js