Some Questions

Discussion in 'Plugin Development' started by Jalau, Aug 28, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Jalau

    So I'm not new to coding but i wonder what are the best ways to handle this stuff:

    - Auto restart of the server and getting automatic updates of the world and plugins from a "database" or folder so I don't need to upload the plugin to every single server/lobby, deetect crashes of a server etc

    - Arena join, cross servers. So I have more then 1 arena running on a server and currently I use a database system to add the player to the arena, but is there an easier way? (Is pinging a server more resource intensive then getting the data from the database? At moment I save the playercount etc of each arena to the database)

    - Last one: The Core Plugin of a server, that provides api etc, that is the same on every server, should i put it in other plugins, or in a standalone plugin? At the moment I'm using the Ebean Database API and if i connect to the same database on one server with two plugins, it gives me wierd errors, I'll see if I can find them...
     
  2. Offline

    Gerov

    Jalau Well to restart it, check when the round is over, kick everyone, and then reload the server.
     
  3. Offline

    TheMintyMate

    Gerov Jalau

    Here is a nice server startup script designed by TnT. Please note that it requires version 3+ of PowerShell (select windows version and follow installation instructions provided by Microsoft TechNet. This page applies to installation or upgrading to PowerShell version 3 and 4. TnT provides detailed instructions of how to use his script.
    This script will auto-restart the server if it is stopped, and will also provide backups every time it is stopped. This script is also good against combating server lag.

    Hope this helped,
    - Minty

    Edit: Please first check if you have PowerShell installed. You can do this simply by opening up Command Prompt and enter:
    Code:
    powershell
    
    If PowerShell is installed, it should return with something like the following:
    Code:
    C:\Users\User>powershell
    Windows PowerShell
    Copyright (C) 2013 Microsoft Corporation. All rights reserved.
     
    PS C:\Users\User>
    
    If not, you will need to install PowerShell. Otherwise, now just type:
    Code:
    PS C:\Users\User>exit
    C:\Users\User>exit
    
    This will exit you out of PowerShell safely. If you do have PowerShell installed, you will need to get your version of PowerShell before continuing. You can check your PowerShell version in the console with:
    Code:
    get-host|Select-Object version‏
    
    If you version is 3+, then you can head over to TnT 's tutorial to get the script and continue from there. Otherwise, you will need to go over to Microsoft TechNet and follow their instructions to obtain the correct version of PowerShell.
     
    Jalau likes this.
  4. Offline

    Jalau

    TheMintyMate
    Thanks but I need one for Linux Debian :/ Should have added that to the topic! But thank you for your help :)
    Gerov
    Reload is the worst way for that because that will after like 3 times fail, often after the first one because I use big custom plugin :)
     
    TheMintyMate likes this.
  5. Offline

    TheMintyMate

    Shame, I had been in my element.... :p

    Edit: Il see if there are any linux scripts out there.... cant promise though :/
     
  6. Offline

    Jalau

    TheMintyMate

    Thanks, but it should work with linux shouldn't it? Again thanks for helping me!! :)
     
  7. Offline

    TheMintyMate

    Jalau
    Did some looking around, and found some of these scripts which target backup of servers. I do believe some also do auto-restarting (when server crashes/stopped). Here:
    1.
    http://www.minecraftforum.net/forum...ux-backup-and-minecraft-server-restart-script - links to script here: https://github.com/Nahaz/Minecraft-Backup-Bash-Script
    2.
    http://minecraft.gamepedia.com/Tutorials/Server_startup_script - works for Linux
    3.
    http://www.minecraftforum.net/forum...-restart-script-linux-bukkit-maintenance-cron
    4.
    https://github.com/Sindern/rtb - This script is designed for FTP Servers, but may aid you if edited.

    Of course, if you want to have plugins automatically distributed, you would need to include this into the startup script of your choice. Alternatively you will have to make a plugin, which I believe was your original choice.

    Edit: the script designed by TnT focuses only on Windows, so no, I do not believe it would work on Linux.
     
    Jalau likes this.
  8. Offline

    Jalau

    TheMintyMate
    Thanks man, I'll probably combine these scripts to one so it offers what i want :)
     
  9. Offline

    TheMintyMate

    Ok :) And to answer your 2nd original question: I believe it would be resource intensive to be pinging the server constantly. Keep it to the database, and don't try to incorporate it into a single file, as the file could lose data from possibly being open in more than one stream - though i should imagine you know this already :)
    Hope I helped,
    - Minty
     
    Jalau likes this.
  10. Offline

    Jalau

  11. Offline

    TheMintyMate

    Oh I mean that if you saved players to a single file instead of a database, issues could arise :)
    Basically, your setup with using a database is fine; leave it that way.
     
  12. Offline

    Zupsub

    Lol, why should issues arise if you use a "single file"? A database is a file, too!
     
  13. Offline

    Jalau

    Because you use filestream to access it and database is not handled this way :)
     
    TheMintyMate likes this.
  14. Offline

    TheMintyMate

    Simple inconvenience;
    A normal file can be write/read protection which cant be changed (with a plugin), instead of user/pass - therefore more insecure
    Cannot append data from multiple plugins during the same load session.
    A database is set into tables, where a normal file may end up requiring extra chars/strings to break up content (like in a config file)

    It is generally just better to use a Database when working with potentially recurring data (data continuously being changed/appended to location)
     
    Jalau likes this.
Thread Status:
Not open for further replies.

Share This Page