Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: [0.9.1a] SSMS Unlock [Tool] [Reflection] [FileAccess] [Mod Loading]  (Read 1695 times)

Razuhl

  • Ensign
  • *
  • Posts: 13
    • View Profile

SSMS Unlock
link removed - Alex

Installation
This is a tool for other mods to use and requires a manual installation. Please follow the instructions listed in the readme on github.

Features
Removes the restrictions on reflection and file acess so that other mods can leverage them.
Adds new properties for "mod_info.json" to expand mod loading functionality.
  • "loadAfter":["otherModsId"]
  • "loadBefore":["otherModsId"]
  • "dependencies":[{"id":"otherModsId","min":"0.5.0","max":"1"}]
  • "conflicts":[{"id":"otherModsId","min":"0.5.0","max":"1"}]
  • "versions":[{
       "gameVersionFilter": {"min":"0.9.0","max":"1.0.0"},
       "name": "Name for version 0.9 - 1.0",
       "conflicts":[{"id":"otherModsId"}]
    }]

The version filters min/max properties are always optional and if missing the respective boundary is unrestricted. Version strings must consist of only numbers and dots. The properties inside a "versions" block are copied into the root layer if the game version  matches the filter, this allows versioning of old and new properties. If the mod list has conflicting entries a message pops up informing the user about the conflict and mods are disabled to restore a valid mod list.
« Last Edit: May 06, 2020, 10:27:51 PM by Razuhl »
Logged

Nick XR

  • Admiral
  • *****
  • Posts: 713
    • View Profile
Re: [0.9.1a] SSMS Unlock [Tool] [Reflection] [FileAccess]
« Reply #1 on: April 15, 2020, 09:49:21 AM »

What's the use case for needing this?  The default security settings are there to prevent mods from doing unscrupulous things (although they can access the internet already, so...)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24151
    • View Profile
Re: [0.9.1a] SSMS Unlock [Tool] [Reflection] [FileAccess]
« Reply #2 on: April 15, 2020, 10:02:00 AM »

Hi - yeah, these restrictions are in place for a reason, so a mod or tool removing them is not going to be allowed. I've removed the link from the OP.

What's the use case for needing this?  The default security settings are there to prevent mods from doing unscrupulous things (although they can access the internet already, so...)

It's not so much about intentionally malicious things - those can't really be stopped. It's about preventing accidental damage.
Logged

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: [0.9.1a] SSMS Unlock [Tool] [Reflection] [FileAccess]
« Reply #3 on: April 15, 2020, 03:35:40 PM »

What's the use case for needing this?  The default security settings are there to prevent mods from doing unscrupulous things (although they can access the internet already, so...)
Mods can access the internet yes, but all they can really do with it is perform read operations within the Starsector folder so is safe. I am 99% sure on this, but someone please correct me if I am wrong.

Razuhl

  • Ensign
  • *
  • Posts: 13
    • View Profile
Re: [0.9.1a] SSMS Unlock [Tool] [Reflection] [FileAccess]
« Reply #4 on: April 16, 2020, 04:26:14 AM »

@MesoTroniK There is no security benefit to these restrictions. The most simplistic proof is to call Runtime.getRuntime().exec("notepad") - on windows - to open a seperate application from within a mod.

@Nick XR Reflection is a core concept of the java language and the classloader restrictions trigger even if you don't use it explicitly. In starsector you are encourage to use Serializable objects for saving data in a savegame,
but in order to make the data object versioned and allow migration between normally incompatible versions you want to define the methods that are used for custom handling of serialization(See javadoc of Serializable class).
But if you do javas runtime will trigger the restrictions and kill the application.

Let's say you wanted to monitor an objects method invocations so that you can implement prefix and suffix lifecycles. Thats done via the Proxy class but thats also part of reflection(Think of JPA's entity classes).
More in general you need it to work around the mistakes and missings in the vanilla code, to interface with foreign code(both from other mods and vanilla) and to process your own code with generalized rules that leave a
smaller footprint - which improves development speed. Essentially without reflection your capability to collaborate is severely hampered.
Logged

Razuhl

  • Ensign
  • *
  • Posts: 13
    • View Profile
Re: [0.9.1a] SSMS Unlock [Tool] [Reflection] [FileAccess]
« Reply #5 on: May 06, 2020, 07:49:44 PM »

Added new configuration options for mod loading.
Logged