L2JDP Revision: 9976
Hi there,
I'm currently having several scripts, that basically enable the player to have certain additional settings e.g. script-specific settings, that are created for every player, who has activated that script.
Currently I have a configurations-script, which is a central point for loading and saving additional settings.
However, I have several problems:
- configurations-script is loaded by a different? class-loader (in-memory class-loader, default L2Script-loader) and thus cannot see other scripts (unless it creates another instance of those script, but this is not an option)
- all other scripts can access the configurations-script, but they create a new instance each time, even though the configuration-script is built as a singleton; it seems the singletons are not real singletons, because different class-loaders load or try to access the class(es)
- reflections in scripts do not work
I do know of a way to do so, but I want to avoid having to code it all into the Config-class or similar. I'd like to have a script if possible, because scripts are "optional". Is there a way to implement something like a "true singleton" in order to keep player- and script-specific settings available and adjustable to/by all scripts?
Perhaps I should learn more about the scripting engine and how it's built, but I'm afraid, that I'll end up recognizing, that it uses different class-loaders and hence the only solution would be to make the additional configuration available before any scripts are loaded - which would involve modifying the core.