MySQL JDBC Storage Method for WorldGuard Regions.#180
MySQL JDBC Storage Method for WorldGuard Regions.#180narthollis wants to merge 16 commits intoEngineHub:masterfrom narthollis:master
Conversation
|
can you run these commands: this way, you get a linear history without merge commits. I'll looking through the changes in a bit |
|
Thanks for that TomyLobo, I have fixed the commit timeline as requested. |
|
I went and asked GoMySQL about this and he had a few suggestions: zml2008, looks fine - though I'd ditch the UNIQUE INDEX.. on name and just define:: name varchar(##) NOT NULL UNIQUE, |
|
Thanks for the input zml2008. I have update the SQL to reflect the use of UNIQUE constraints rather than UNIQUE INDEX's. The one other thing I was wandering about with the SQL was the length of the various varchar fields. Is 64 characters long enough for the user name, group name, world name and more importantly region name? |
|
64 characters is fine for player, but the others can be longer |
|
Is there anything else that I can/need to do to make this patch acceptable for merge into WorldGuard? |
|
It looks fine, someone just needs to test it and merge it. I'll be busy for |
|
I've tested this on Bukkit 1.0, and I get a few errors creating new Regions. I'm looking at the actual database and it looks like the cuboid values are being inserted in the wrong columns (Except on the first region created). region_id min_z min_y min_x max_z max_y max_x Kitsilana was the first region I created, and it appears to have been created correctly, but all regions after are inserting the coordinates into the wrong columns. There is also a bug that frequently pops up, referring to the previously region created, saying: I can look in the database and sometimes the new region is created regardless of the error message - other times it isn't. Reloading WG gets rid of this error message, but the message comes back again after a few regions are created. |
|
Now I'm noticing another part of the problem with the cuboid table. I'm not sure when it happened, but a good few of the columns looked like they organized themselves back to normal (first noticed after doing /wg reload): But then, after defining a new region, the columns all shifted out of order again. May be a problem with the insert statements. |
|
It would seams that I was creating the Cuboid Region vector points wrong. I have fixed this up in the most recent patch. |
|
Awesome, going to try it out. Will let you know if I find any other glitches. :) Love this modification, and want it to get pulled. |
|
It worked, regions are created normally now. There is another small glitch I came across. When the plugin updates the config file with the new SQL options, it only adds: But doesn't add the other fields (I had to locate them within the sourcecode) |
|
How the config file was created was something I wasn't sure of before now. I have removed an if statement that will now allow these values to be populated with some defaults. |
|
Rebased my repository to orgin/master. |
|
we hang out in #sk-dev on espernet. join us there to discuss the pull request in a more instant fashion |
|
I have added some classes to deal with migrating too and from various region database backends. Presently i have implement YAML to MySQL and MySQL to YAML. There is the framework in place to quickly add more converters as needed. |
I have spent the past few days working on this patch to add MySQL as a storage method for WorldGuard.
It has been quite a while since I did any coding in Java, so I am not entirely convinced of my code quality, and would welcome feedback to get this patch up to scratch for inclusion into WorldGuard.
I think for the most part the code is commented where it needs to be and self explanatory otherwise. If you have any question, please ask.
Additionally I can normally be contacted on IRC between 0900 and 1700 UTC+10:30 as narthollis. (I am presently in #WorldGuard on Esper.Net)