Skip to content

Robustness issue in get-xxx and/or save-xxx socket commands #171

Description

@Omikhleia

Version: checked on 4.x (but probably applicable to 3.x too)

Steps to reproduce:

  • eval someobject.crashTest = Verb("crashme");
  • Ctrl-P and edit the newly created verb
  • Break the function code (i.e. either empty the whole file, or just garble the function declaration to be incorrect, etc.)
  • Save and close editor
  • Ctrl-P and try to open the verb

Observed behavior:

Game engine crashes and terminates:

SyntaxError: Unexpected token )
    at Deserializer.deserialize (...room.js-server\src\lib\deserializer.js...)
    at Handler.get (D:\dev\room.js-server\src\lib\world-object-proxy-builder.js...)
    at ProgrammerController.onGetVerb (...room.js-server\src\controllers\programmer-controller.js...)
    at SocketController.onGetVerb (...room.js-server\src\controllers\socket-controller.js...)

Only workaround is to fix the offending file on-disk before relaunching the game engine.

There ought to be some robustness checks:

  • so that programmers can't that easily crash the engine due to programming mistakes.
  • Additionally, to also prevent mis-behaving clients from crashing the engine (e.g. not sending the expected JSON payload, due to bugs etc. Err... that's initially how I stumbled on that issue ^^)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions