Results 1 to 4 of 4
  1. #1
    Yevano is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default Implementing Scripting

    I am currently making a scripting system for Minecraft. It works by taking a script that a user has made and then compiling and loading it at runtime. An instance of the script is created and gets an instance of the API passed to it. This all works very well so far, but I need to "sandbox" the script. I want the script to only have access to the API and a few basic classes like String and Array. Someone has told me that you can use ProtectionDomain to do this, but so far I haven't been able to figure it out. I've done some google searches on it, and haven't really found anything.

    Thanks in advance.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default Re: Implementing Scripting

    I need to "sandbox" the script.
    What is the "script" you are talking about?

  3. #3
    Yevano is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default Re: Implementing Scripting

    The script is a class that is loaded after compiling some source code created by a user of the system. I think I may have actually found the answer to this problem, though. classloader - Java security: Sandboxing plugins loaded via URLClassLoader - Stack Overflow

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default Re: Implementing Scripting

    Also look at the SecurityManager class.

    classloader - Java security: Sandboxing plugins loaded via URLClassLoader - Stack Overflow
    Looks like it has a lot of useful info.
    Last edited by Norm; 01-22-2012 at 11:50 PM.

Similar Threads

  1. Ant Scripting Issue
    By ant_qa in forum XML
    Replies: 0
    Last Post: 09-30-2010, 01:42 AM
  2. The Sleep Scripting Project 2.1-b23
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-24-2008, 06:44 PM
  3. The Sleep Scripting Project 2.1-b22
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-17-2008, 06:55 PM
  4. The Sleep Scripting Project 2.1-b21
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 03-29-2008, 01:00 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •