Posts by Minotorious

A new update is now available, introducing a lot of new content!
Latest hotfix: 0.7.5.2 (2024-09-10)

    There in lies an issue if I access some third party plug in. The name is likely to be similar to all the others since many use the world name and on my commercial server the World Database is pingperfect.db and many other plugins are pingperfect.db.

    The name we are referring to is the name of the plugin not the name of the database of the plugin. i.e. if you are using my Portals plugin to access it you can use portalsPlugin = getPluginByName("Portals") and the name of the database my plugin should create is portals_pingperfect.db

    If you're an actual admin on your server (i.e. if your UID was added to the server.properties file next to the "admins" field), the server overrides your permissions by default. In this case you could try to open the server.properties file in your server directory and set settings_admins_allpermissions to false, then save the file and restart the server. If you now assign you to the "admin" group, does the issue still persist?

    hope this helps :)

    oh ok I see your point. I am not a fan of many small plugins, I prefer to have a big one that takes care of everything.


    But your point to keep the classes and the plugin easy to bugfix and readable is really important as well. Thus you can split your classes into smaller classes with more specific names and even put them into subpackages in your main package to keep things separate and easy to find bugfix ;)


    For example my ServerTools plugin has a main package called ServerTools then two subpackages Listeners which includes all the different listeners one class for each of them (i.e. one class Commands, other class Player Interactions, other class GuiClicks) and GuiComponents which includes all my Gui classes i.e. one class for the main panel, and one class for each tab of that panel. (you can see it all on my github)


    This way I have a big plugin doing everything but it is structured as to help me bugfix and read/develop it clearly ;)

    Yes RED warned in another thread about double threading to a DB

    yep unless you are using MySQL then you can have as many threads as you want (with some realistic limits ofc don't go and open 1000000 connections because I said it is possible :D)

    I dont like the thousands of DBs concept for the same function .. storing one thing here and one thing there is not very good for performance and interconnectability/useability in functions for a server.

    I don't really understand this, why do you have more than one database for the same function to begin with? which plugins are you using that have the same function and are storing things in different databases? and tbh if both plugins have the same function then why not just get rid of one of them?


    From my point of view every server "should" have:
    1) its World database
    2) an Area Protection Database separate from any other to make sure it doesn't crash and anyone can destroy other people's stuff
    3) one extra database for each plugin they are using that requires one unless you home build all your plugins thus needing only one big database for it

    One idea, I have on the sketching block would require this method involved your Lulascript Area protection routine database was providing an ingame way to add Shoppers to a common area without the need for a Admin or Owner. This can be triggered by either a group permission or a physical action by the player in game. <patent pending >. A simple read and update to the database directly is all that is needed similar to a manual update to the DB by the server admins when a correction is needed. There is no need to tie into or use the plugin routines which seems very complicated to me.

    This is true and would be really nice as a consept, but you need to be careful, as most plugins use SQLite databases that means that only one thread can edit them at any one time, in a scenario as described by you above if two players enter the area at the same time and your plugin tries to write to the database for both that would crash the database and sever the plugin's connection to it. Thus a server restart or a reinitialisation of the database in the plugin would be needed to access it again.

    I was hoping the SQL routines in Rising World could handle wild cards like a tilde~/plugin/datab.db or something like to find the DB by unique name instead of the full path like, C:\Pingperfect\Users\RJ233\190000/plugins/routine/database.db needed on this commercial server, I am using. (Notice the shift in slashes needed which I don't understand - btw.). I do have an issue with Pingperfect like to name all the DBs similarly which this, I believe, is a because I opted in for the advertisement of their service for a discount. Even if I could change it I am not going to now unless it is a problem.

    in your java class that extends plugin you need to use the getPath() method to get the path to your plugin's directory automatically thus no hard coding of paths is necessary. The you just extend the path with + "database.db".


    The shift in slashes is probably caused because the initial partition is using windows while the server partition is using linux.

    as @Miwarre said if you know all the paths and how the other plugin handles its database hard coding the relative path should be the easiest solution i.e. getPluginByName(Name_Of_Plugin).getPath() + "Path_To_Database_From_That_Plugin's_Directory"


    Then if you are talking about a back end plugin then these usually have in built public methods to get you access to their database. I think Miwarre's Bank plugin is written this way and I am pretty sure iConomy has such a method too but I would have to check. Then you would get the database with something like getPluginByName(Name_Of_Plugin).getDatabase() or getPluginByName(Name_Of_Plugin).addMoney(float Amount) etc. you would need to check the exact description of the other plugin for this.

    how exactly are you getting the Tick? something like float tick = myTimer.getTick(); should give you the right value.


    I personally am using it a bit differently to get an int value i.e. int tick = (int) myTimer.getTick();


    But I think you shoud only call the getTick method from outside the timer's Runnable task, else I think it always returns 0

    Do you have any screen recording or other similar software running on your computer? Do you have any game overlays running (e.g. steam, discord, GeForce Experience, etc.)?


    could you please turn the debug console on and post the log here? To do that you need to open the config.properties file (found in the game files under /steam/steramapps/common/RisingWorld) with a text editor and change the value "game_debug_console=false" to "true". Then open the game wait until the main menu appears and the cursor disappears, then wait 10 seconds and close the game. The newly created log can be found in the Logs folder in the game files (same path as indicated above)


    PS: you can just press Alt+F4 to close the game without using the task manager ;)

    if you initialise your timer like this, (240F,0F,0,()-> { then the getTick method should return all values between 0 and 240


    Edit: 239.999999 (many nines :D) in fact as at 240 the Runnable is executed and your timer stop as the repetitions are set to 0 (i.e. execute only once).

    A point I would raise, though, is if you really need to store each of hundreds of GuiElements as a separate player attribute; I would expect them to combine into larger GUI units (dialogue boxes, windows, menus, ..), which would be possibly more reasonable to store as player attributes.

    hmm how do you mean that, sounds like a good solution but I don't fully understand it in practice? To explain a bit better what exactly I am doing so that you have some more information to help me with.


    I have:
    1 GuiPanel
    8 Clickable GuiLabel/GuiImage combinations for a button like appearance (GuiImage has a border of set size and GuiLabel has the Text in the middle of the bordered square)
    Each of the 8 Image/Labels refers to a different Tab of my Gui so in practice you click the first Label the first Tab appears you click the second Label the second Tab appears and so on
    Each Tab is comprised of a number of GuiElements (not panels just Images, Labels, and TextFields)
    Currently I have it so as when you click one Tab Label all the Elements of that Tab appear and all the elements of the previous Tab you were on disappear.


    If I understand your solution quoted above right I should:
    1) make 8 GuiPanels one for each tab and add all the Elements as children to each Panel
    2) store the 8 GuiPanels as 8 distinct attributes for the Player object
    3) when switching from one Tab to another do a getAttribute on the GuiPanel to be shown and have a for loop getting and showing all of its children.


    From my understanding this way I will only have 8 Attributes and will be able to have individual GuiElements for every Player Object just not stored as Attributes but saved as children of the Attribute GuiPanels.


    But then the question how do I distinguish between all my child elements since they don't have an individual attribute name anymore :/

    I am in the process of building a rather complex Gui for one of my plugins as a test and if it works out I plan to go on and build Guis for all of my plugins. Thus I have come up with a question regarding Gui Elements and holding them as attributes so that each player has their own Gui.


    Question: Can storing multiple GuiElements be they panels, labels, images, etc. as Attributes on the Player object of every player reduce server performance, player connection, fps, or anything else or not? Just to clarify I am not referring here to 5-10-20 elements I am referring to 100-500 elements each stored as its own Attribute on the Player object.

    And there is currently no way to know in which order plugins get the event right?


    A plugin load/execution order list for servers at least would be very convenient for such cases but still wouldn't solve the problem in every possible case, especially when considering n plugins. :/

    Hmm sorry got a bit sidetracked as I was concentrating on something else at the time of writting my previous reply :D


    What I have done for a similar case (Specialty Chests plugin on my github) is the following:


    This way I get the chest ID as a chat message when I access a chest only if I have typed my command first. Then I can use that ID in further commands for example.

    I wanted to ask if there is any way one plugin can override the decisions of another plugin.


    For example we have one plugin that cancels the PlayerMountNpcEvent is there any way I can force allow the event through another plugin or if one plugin cancels it, the event cannot happen? (I know the other plugins will still receive the event to do whatever they want with it but will they be able to force "uncancel" it?)

    hmm I see no this wouldn't work very well, as in it would work but it is a super awkward solution for a much simpler problem.


    Why not just have a separate table in your Area Protection database called CommunityChests or something like that. Then in that table you add the IDs of the chests you want to be accessible by everyone, e.g. via command /ap commchest add 156 or GUI text field to add chest 156 to the community chests.


    Then you can have a for loop over the community chest ID numbers every time someone opens a chest to compare the ID of the chest that was just opened to the ones in the list, if the one is in the list then you allow the event else you check further e.g. if the chest is in an area the player has chest access rights in.

    Why not just trigger whatever you want to do in the chest access event?


    E.g.


    • set a boolean attribute to the players named DoMyThing
    • create a simple command (e.g. /a) that changes the value of that boolean

      • if the boolean is true accessing the chest triggers whatever you want to do and cancels the chest access event in the process.
      • if the boolean is false the player can access their chest as normal



    In general for all objects you could use the object interaction event too

    Maybe it would work if we implement a flag that certain GUI elements should be ignored when it comes to mouse clicks, then the click event will be forwarded to the parent. Basically that's how the game handles it own GUI elements. However, button elements are planned for the API GUI anyway

    perfect because my current solution needs 2 elements for each button and I will soon get lost in label and image names :D (i.e. only the borders without an actual image in them)