Sign in to follow this  
Friya

[alpha] MySQL for Wurm Unlimited

Recommended Posts

Download: http://www.filterbubbles.com/wurm-unlimited/mysql-for-wurm-unlimited.zip

 

The mod configuration file in the zip contain most of the useful information (pasted below).


 

#
# WHO IS THIS FOR?
# """"""""""""""""
# Sqlite is a fine piece of software, hands down. If you do not know why you
# would want MySQL in place of it, this is most likely NOT something you
# should install on your server.
#
# I started this project because we had around a dozen million objects in our
# item database, so I got grand plans to make Zenath handle that kind of
# database comfortably. But yes, ... plans ... WTB time and money for hobby
# projects. :)
#
# Note that this definitely has its uses without additional tweaks to Wurm.
#
# It comes without warranty.
#
#              -- Friya 2017, you can maybe reach me on Discord as Friya#7934
#
#
# INSTALLATION
# """"""""""""
# 1.    In the game world's wurm.ini file:
#        Enter connection settings to your MySQL server. The fields are:
#            DB_HOST=<probably 127.0.0.1 or localhost>
#            DB_PORT=<probably 3306>
#            DB_USER=<a username>
#            DB_PASS=<that username's password>
#
# 2.    This is probably already set to true, but verify that this setting
#        is indeed true when you install the mod:
#            CREATE_TEMPORARY_DATABASE_INDICES_AT_STARTUP=true
#
#        You probably want to change to false at subsequent restarts or you
#        will get some (harmless) errors saying indices already exists.
#
#        Save and close wurm.ini
#
# 3.    Copy .jar files in lib into /Wurm Unlimited/WurmServerLauncher/lib/
#
# 4.    Other than that, install like any other server mod:
#        - Copy folder mysql into mods
#        - Copy file mysql.properties into mods
#
# 5.    Make sure you check the settings below before starting the server.
#
#
# OPTIMIZING
# """"""""""
# Optimizing your MySQL install and databases is beyond the scope of this
# mod. Note that chances are it is a bit slower than Sqlite by default.
#
# What you get is a lot more options to optimize things (especially larger
# databases). Personally I want to use MySQL to get more logging,
# transparency and not have to worry about filelocks. A nice bonus is
# naturally that I can have external applications fetch data from the game
# a bit easier.
#
#
# CHANGING A LIVE DATABASE
# """"""""""""""""""""""""
# In 99% of all cases you will not be able to write to a live database and
# have the changes propagate into the game properly, simply because your
# Wurm server put a lot of data into memory when it starts up. You'd still
# need to restart your server if you make changes (or have MySQL trigger a
# reload of the data in the game, but that's a whole different can of worms).
#
# IMPORTING AN EXISTING WORLD
# """""""""""""""""""""""""""
# This is actually beyond the scope of this mod as there are plenty of
# tools out there that can help you with this.
#
# You can simply google "sqlite to MySQL" or have a look at this if you
# are comfortable with getting your hands dirty:
# http://stackoverflow.com/questions/18671/quick-easy-way-to-migrate-sqlite3-to-MySQL
#
# Setting insertDefaultDataInNewDatabases=true in the settings below
# will create a fully working world, though (Creative or Adventure).
#
classname=com.friya.wurmonline.server.mysql.Mod
classpath=mysql.jar


# Description:    Whether this mod uses a shared class loader
# Notes:        
# Recommended:    Must be true.
sharedClassLoader=true


# Description:    Set to false to completely disable this mod.
# Notes:        
# Recommended:    true
enabled=true


# Description:    The name of the folder your game map and database recide in.
# Notes:        You MUST fill this in to a value of your own.
#                This is the folder we will place the modsupport.db and where
#                we will load database scripts from.
# Recommended:    (e.g. Creative, Adventure, ...)
gameName=Creative_org


# Description:    Create MySQL databases if they do not exist.
# Notes:        Have to be set to true when you first install the mod. Keeping
#                it at true at subsequent restarts will not do any harm as it
#                will only create databases if they did not exist.
# Recommended:    true
createDatabasesIfTheyDoNotExist=true


# Description:    When MySQL databases are created, should we create the tables?
# Notes:        Must be true when you first install the mod. Keeping it at
#                true will not do any harm as this will only happen if a
#                database was created.
# Recommended:    true
createTablesOnDatabaseCreation=true


# Description:    Insert default data into new MySQL databases.
# Notes:        This will only happen to databases that were just created.
#                 If you are importing an existing world, set to false.
#                 If you are creating a world from scratch, set to true.
# Recommended:    true
insertDefaultDataInNewDatabases=true


# Description:    Import world "gameName" into MySQL
# Notes:        Set this OR insertDefaultDataInNewDatabases to true to create
#                a world in MySQL. If both of importExistingWorld and
#                insertDefaultDataInNewDatabases are set to false you have to
#                have data in your database or the server will not start up.
# Recommended:    n/a
#
# NOT IMPLEMENTED, SEE "IMPORTING AN EXISTING WORLD" AT THE TOP OF THIS FILE!
#
importExistingWorld=false


# Description:    Name of modsupport database.
# Notes:        Ago's modloader creates a Sqlite database. We will keep it
#                intact and USE, you can specify the name of that database
#                here. It is probably recommended that you do not use the
#                default name of 'modsupport.db' in case something goes wrong
#                in the transition from Sqlite.
#                If you are importing a world into MySQL, a copy will be made
#                from modsupport.db to this name.
#                Individual mods can of course choose to use MySQL, but by
#                default they will use Sqlite.
# Recommended:    modsupport-with-MySQL.db
modSupportDbName=modsupport-with-mysql.db


# Description:    Delete all Wurm related data, tables and databases in MySQL.
# Notes:        Use if you want a new world or something went wrong with
#                creating your old world. I use this mostly for testing.
# WARNING:        You probably don't want to change this to true unless you are
#                sure what you are doing.
# Recommended:    false (really, keep at false)
deleteDatabasesIfTheyExist=false

 

Edited by Friya
Made it a little bit more readable.
  • Like 6

Share this post


Link to post
Share on other sites

Interesting, but I'd rather keep my important world files server-side and not accessible by brute-forcers.

The weakest part of MySQL is its username and password being stored in plain text. If someone really wanted to, they could ruin your day and your wurm world.

Not with Sqlite -- Still nice to see the expansion of capabilities though, I'm sure lots of nifty things could be done with this. I have a MySQL server and know how to use it, but don't find myself needing this at the moment.

 

Good work.

Share this post


Link to post
Share on other sites

There are many caveats with installing this on a live server and security should definitely be one of your concerns, as is the case when you host *anything* on this lovely network we call Internet.

 

MySQL is not the first DBMS I will go to, but why would you have your MySQL server listening on a public interface? Over the last few decades I don't think I've *ever* had a MySQL server listening on a fully public interface. Bind it to loopback and it's as local as any other files on your filesystem.

 

Or do you mean that you have to have the login and password stored unencrypted so that your game can communicate with MySQL?

 

But yes, think of security folks! :)

 

Share this post


Link to post
Share on other sites

nice mod, if it would work for me i would use to show automatically the ingame team, value of deeds and so on, on my website

 

realy interesting =)

 

Eject

 

Share this post


Link to post
Share on other sites
On 1/10/2017 at 9:51 PM, Friya said:

There are many caveats with installing this on a live server and security should definitely be one of your concerns, as is the case when you host *anything* on this lovely network we call Internet.

 

MySQL is not the first DBMS I will go to, but why would you have your MySQL server listening on a public interface? Over the last few decades I don't think I've *ever* had a MySQL server listening on a fully public interface. Bind it to loopback and it's as local as any other files on your filesystem.

 

Or do you mean that you have to have the login and password stored unencrypted so that your game can communicate with MySQL?

 

But yes, think of security folks! :)

 

 

Some people host their own servers for others, which means that MySQL needs to be remotely accessible for others to access with their username and edit their databases for their forums/chats/etc.

But yes, generally a local server should stay on local interface.

Share this post


Link to post
Share on other sites

I think I fail to see how this makes MySQL inherently insecure. The setup you choose is what makes it insecure.

  • Like 4

Share this post


Link to post
Share on other sites

Pretty simple to secure a login beyond the user/password. Just restrict remote access of that username to that db to two access point's. The server access and your ip/range. If its locally hosted with the server and you have local access to it than its even easier as Friya suggested. The security as how you setup the the interface and not mysql alone. 

Share this post


Link to post
Share on other sites

I actually don't know, I have not tested it. Considering they changed a bit around databases in 1.3 and Ago's modloader also changed, I have my doubts.

 

But feel free to drop a line in this thread if it doesn't and you have an interest in having it fixed (I'm not sure if anyone's actually using this thing -- since it's very ... test-ish).

Share this post


Link to post
Share on other sites

I've flirted with the idea several times as I much prefer the power of a full SQL platform so I could develop my own query tools in a manner I'm used to to find and relate information faster. I might have to do some experiments on a test box as I am very interested in restoring the game back to the way it was originally for databases.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this