How do you forbid users from doing evil things in Groovy Scripts?

后端 未结 4 428
渐次进展
渐次进展 2021-01-22 06:17

I\'m planning to integrate Groovy Script Engine to my game so it will give the game nice moddability but how do you prevent players from writing evil scripts like deleting all f

4条回答
  •  太阳男子
    2021-01-22 06:43

    The Groovy Web Console appears to have already solved this problem, because it won't execute something like System.exit(1). The source code is available on GitHub, so you can see how they did it.

    If you're not sure where to start, I suggest getting in touch with the author, who should be able to point you in the right direction.

提交回复
热议问题