Posts by Absalom

The next update will be available on Wednesday, December 18, in the early evening (GMT+1).

This update will not yet replace the Java version, instead it is the actual content update. We'll provide more information about the transition together with the update.

    [lua]database = getDatabase();[/lua] will create a database within your script folder called scriptDatabase.


    This is an example of how to create tables:


    [lua]database:queryupdate("CREATE TABLE IF NOT EXISTS 'areas' ('ID' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , 'name' VARCHAR, 'startChunkpositionX' INTEGER, 'startChunkpositionY' INTEGER, 'startChunkpositionZ' INTEGER, 'startBlockpositionX' INTEGER, 'startBlockpositionY' INTEGER, 'startBlockpositionZ' INTEGER,'endChunkpositionX' INTEGER, 'endChunkpositionY' INTEGER, 'endChunkpositionZ' INTEGER, 'endBlockpositionX' INTEGER, 'endBlockpositionY' INTEGER, 'endBlockpositionZ' INTEGER, 'playerID' INTEGER);");[/lua]


    This is an example of how to query the database:


    [lua] result = database:query("SELECT * FROM areas;");
    while result:next() do
    local area = {};
    area["areaID"] = result:getInt("ID");
    area["playerID"] = result:getInt("playerID");
    area["areaName"] = result:getString("name");
    area["startChunkpositionX"] = result:getInt("startChunkpositionX");
    area["startChunkpositionY"] = result:getInt("startChunkpositionY");
    area["startChunkpositionZ"] = result:getInt("startChunkpositionZ");
    area["startBlockpositionX"] = result:getInt("startBlockpositionX");
    area["startBlockpositionY"] = result:getInt("startBlockpositionY");
    area["startBlockpositionZ"] = result:getInt("startBlockpositionZ");


    area["endChunkpositionX"] = result:getInt("endChunkpositionX");
    area["endChunkpositionY"] = result:getInt("endChunkpositionY");
    area["endChunkpositionZ"] = result:getInt("endChunkpositionZ");
    area["endBlockpositionX"] = result:getInt("endBlockpositionX");
    area["endBlockpositionY"] = result:getInt("endBlockpositionY");
    area["endBlockpositionZ"] = result:getInt("endBlockpositionZ");


    area["rights"] = {};


    calculateGlobalAreaPosition(area);
    areas[result:getInt("ID")] = area;
    end[/lua]


    This all comes from the AreaProtection script provided by the devs.

    I am currently working on a web site where server hosters can register their servers and players can rate them. It will also show average uptime, etc. That will be a good compliment to the in-game server browser in that it will have a social side and rating system to it. Unfortunately it is a ways off and would be very useful right now. I am also building a Lua repository site where Lua scripts can be downloaded for this game, and when you download a script you are registered to be notified of updates. Hopefully I can also get a Lua script patch system going where the server can check for updates as it starts loading scripts. Lots of good ideas coming, so if you are hosting from a datacenter and want to colaberate on some of these developments, feel free to contact me as I may have bitten off more than I can chew. Lol!

    It's a bug. The server connection issues and server list issues are being worked on right now. They thought they had a fix this weekend for the connection issues but something else happened to cause on-going connection issues. You can see the convos in the other client and server threads.

    I have provided a few logs from both server side and client side. Tonight I will turn on debug in the config for the server and see if Iget any more robust logs. @red51 said they are looking at it. My server disappeared from the server list as soon as 3 other servers appeared there. Mine were the first two on the list, then 3 more appeared replacing mine, and mine has never been listed since. I messed with the two properties for the hive server and nothing changed. In addition, we still have connection issues.


    Red51 said they are looking at it. We just need to be patient and give them time and whatever logs they need.

    I did read that when a Lua module is loaded that there is a global module table somewhere. I was trying to takes that approach at one point but the default loading of scripts seemed to be alphabetical by directory name, where each script has a directory and a definition.xml. This wasn't working because the onEnable event seemed to be executed when the script was loaded, so not every script had been loaded yet, so certain things didn't exist from other scripts yet, like the scriptDatabase objects. This meant that I couldn't create a main script and have others tie into it.


    It's not a problem; to me it is just another challenge, and I love challenges, especially in programming. I may look into Lua events. I rebuilt luaj from source and ran that with the server and it appears that you all haven't modified your version. If I am correct, I think I will look into extending that a bit.

    For now I will just go with the way you pointed out. I am still learning about require, and modules, etc. I want the player to be able to place their scripts in the script directory and be automatically required by the main script when the server loads for the first time. However, my Lua knowledge is still limited (I am a java guy), so I may continue this on the 19th of December after reading some more.

    I think I may set up a global table containing the player command and function to execute. Then as players add their scripts, they just add their commands to the player command table.

    Doesn't make it any easier for the player to just plug their scripts in though. I guess I am just too used to Google's guava event bus. You can register multiple listeners to a single event. They all get notified when an event takes placed based on method signatures and a @Subscribe annotation within the registering listener. Even Lua itself allows multiple listeners to one event if I remember the manual correctly.

    Yeah I can't get them to show up. As soon as those other servers showed up, mine were pretty much squashed. You connected to the test server. I have my main server down currently. I guess I can bring it back up. I need to get to work on the AreaProtection. I meant to finish it this weekend, but have been spending all my time waiting for things to be resolved. Got some good gaming in though on This War of Mine. Great game!