Commit Graph

581 Commits

Author SHA1 Message Date
cmastudios
84a5750063 Store warzone structures in main zone database
Instead of storing strutures in /dat/warzone-x/volume-y.sl3 anymore, they are stored in the main database file created for the warzone in /dat/warzone-x/volume-x.sl3. Tables is created for each structure, with the prefix being structure_HASH_. The HASH is a string hashCode run through a bitwise AND with Integer.MAX_VALUE, to prevent negative values from showing.

This is a step on the road to storing everything in a single database for the warzone. My plan is to eventually store warzone configuration in the database as well. In the ideal setup, there would be a table for teams, structure definitions, loadouts, and materials. Sadly, for configuration, we would most likely have to store teamcfg & zonecfg rules in a key-value table, unless @taoneill or @grinning has another idea.

I still need to do testing to make sure everything is backward-compatible. This conversion happens properly for nimitz-format zones and zones in the process of converting from degaulle format. When messing around earlier, I found that .txt configurations were broken due to numbered teams. I need to take a look at that. Most likely it is due to WarzoneTxtMapper not being maintained. The loader will probably have to be modified to load the new volumes and teams properly.
2013-12-08 01:46:26 -06:00
cmastudios
034b51ae03 Prevent using chests while capturing flag
Stops duplication of wool.
2013-12-07 20:49:25 -06:00
cmastudios
300f2e383b Don't reopen the file during a batch reset
Connections to the SQLite warzones are now kept open when iterating a batch reset.
2013-12-07 20:34:59 -06:00
cmastudios
346fd25955 Prevent joining zone during reset 2013-12-07 19:23:12 -06:00
cmastudios
df871c1c5b Allow disabling of automatic warzone block reset
Configuration key: RESETBLOCKS
2013-12-07 16:38:48 -06:00
cmastudios
67bb509735 Stop saving Air blocks to the database
War now skips over saving Air blocks. Instead, the plugin loads all solid blocks back into the world and then sets each block to air that was not changed.

Benchmarks:
Warzone molecule
Block count 2,487,555
Speed 50,000 blocks per tick
Intel Core i7 @ 3.6 GHz * 8

Before:
File size 70 MB
Reset 23 seconds
Save 16 seconds

After:
File size 54 MB
Save 5 seconds
(no changes)
Reset 4.9 seconds
(set to air)
Reset 31.17 seconds
(set to stone)
Reset 18.23 seconds
2013-12-07 16:22:50 -06:00
cmastudios
7ef61af277 Fix logger format arguments not being applied 2013-12-07 16:15:41 -06:00
cmastudios
78ef1dd4fc Merge branch 'no-save-air' into nimitz-v2
Conflicts:
	war/src/main/java/com/tommytony/war/mapper/ZoneVolumeMapper.java
2013-12-07 03:19:36 -06:00
cmastudios
60b62c8b71 Merge branch 'master' into nimitz-v2 2013-12-07 02:44:01 -06:00
cmastudios
d040edcc4e Attempt at some slight saver speed ups 2013-12-07 02:31:11 -06:00
cmastudios
21f91a00fc Configuration setting to allow ender chests 2013-12-07 00:48:03 -06:00
taoneill
6eed5bbe19 Coalesce many metadata columns in warzone blocks table into one.
- Container, sign, skulls, and more are not just a single column
- Compacting each warzone database after migration from schema v1 to v2 (to get disk space savings, but might take a while for large zones)
- Showing a few decimals on time value in zone reset messages instead of just showing "Reset in 0 seconds" all the time
2013-12-01 00:48:11 -05:00
cmastudios
5c2474cb70 Don't modify block type/data if it has not changed 2013-11-24 16:41:26 -06:00
cmastudios
cc2b13633c Only update twice if we are changing tile data
War originally modified each block twice when loading, even if there was no metadata. Now it will only update once if there is no metadata.
2013-11-24 16:35:56 -06:00
taoneill
99bfbc5e58 Allow for concurrent zone resets without breaking reset notification.
- I'm an idiot I should've thought of this on the first go around, thanks @cmastudios
- Used a synchronized map, just in case
2013-11-19 19:26:55 -05:00
cmastudios
77b943ce5e German&Spanish translations. Thanks GatuCrafter, McServerExpertDe 2013-11-19 17:00:01 -06:00
cmastudios
2926387ee4 Add warcfg language parameter. Closes #686.
Allows for dynamic language switching.
2013-11-19 16:55:40 -06:00
cmastudios
0f35c4dc4c I have sinned a great sin.
Forgot to switch IntelliJ to use tabs.
2013-11-19 15:53:30 -06:00
cmastudios
66158ae44b Toggleable team chat. Closes gh-317.
Sorry @grinning, I tried to cherry pick your stuff but it did not work _at all_.
2013-11-19 15:47:01 -06:00
taoneill
d4d5778175 Don't notify the command sender twice if he's in the lobby or on a team while resetting zone. 2013-11-19 00:01:38 -05:00
taoneill
31a2deef0f Add zone reset complete message.
- Also, notify command sender with progress report, not just people in teams or in lobby
2013-11-18 23:53:43 -05:00
taoneill
df85b176b7 Remove broken getZoneByTeam logic
- Replaced with warzone getter on Team objects
- Should close #704
2013-11-17 23:34:31 -05:00
taoneill
97646becc3 Prevent ConcurrentModificationException while deleting a loadout.
- Closes #703
- Don't loop on an array while deleting items from it
2013-11-17 22:49:09 -05:00
Connor
b0fadd4459 Fix null string bug
Thanks @smurfofsmurf
2013-11-04 21:20:08 -06:00
cmastudios
c7e33dd1ca Fix message formatting and CS problems. Closes #700 2013-11-03 18:58:14 -06:00
cmastudios
c6d2c6cbcc Configurable war zone max size
This war config option, MAXSIZE, can be used to change the limit on war zone size. Some reasons for using this could be to have a very long war zone or to limit the size from being abused by your zone makers. Thanks to @Delgado804 for the idea.
2013-11-03 15:58:27 -06:00
cmastudios
ceeea15794 Subroutines for join/leave zone boilerplate & thief removal
Warzone now contains a few new methods to make adding and removing players from the zone easier. This was made in response to every join mechanism having to rewrite the same ~25 lines of code to handle adding players to a team. This was also done to replace the even more bulky code used to return stolen structures.

This also removes a few unused jobs as I am trying to transition away from them, as they don't really help if they are not being used for async tasks, batches, or timers.

A better way of managing teleports at the end of a game or when leaving normally has been added.
2013-11-01 18:05:02 -05:00
cmastudios
3791a027a0 Clear import warnings 2013-11-01 16:15:57 -05:00
cmastudios
13a6f8ba79 Warzone teleport signs 2013-10-27 17:23:43 -05:00
cmastudios
a4e8a4be83 Make sure output health is in bounds. 2013-10-27 16:59:53 -05:00
cmastudios
c44d18f8f8 Ends war in middle east. Closes #693. 2013-10-27 16:15:45 -05:00
cmastudios
215551ec15 Don't allow non-entites to damage players in spawn. Fixes #696 2013-10-27 16:10:34 -05:00
cmastudios
a039e65a8a Don't burn important blocks. Fixes #697 2013-10-27 16:03:28 -05:00
cmastudios
9e6b0d9f17 Fix color after custom item names 2013-10-27 15:59:39 -05:00
taoneill
df6f47907f Merge pull request #684 from taoneill/nimitz-file-format-r3
Nimitz file format. Support for custom blocks. Old warzone volume files get converted to .sl3 when you first run your server with these changes - this may take a while if you have many warzones.

Thanks @cmastudios for all the hard work on these changes.
2013-10-23 21:45:41 -07:00
cmastudios
f814f71cf3 Updated russian localization from @AlexMerser21.
Closes #692. Had to add manually because I have to convert the messages to a encoded format or they do not work in game.
Cyrillic diff: http://paste.ubuntu.com/6254326/
English diff (google translate 'rough'): http://paste.ubuntu.com/6254303/
2013-10-17 20:20:21 -05:00
cmastudios
dd6f425368 Fix for infinite exploding TNT near warzone edges. 2013-10-16 19:43:23 -05:00
cmastudios
7621bdd321 Fix some issues uncovered in review, add block features.
This fixes some issues found during @taoneill's review of the code. It
also adds a few features with blocks, such as a modify block whitelist.
KDR updates are now stored at the end of each battle in a warzone.
Closes #681, closes #672, closes #682, closes #683, closes #689, ping
#688.
2013-10-16 18:55:07 -05:00
cmastudios
f44c2528e7 Fix war format speed regression with metadata
Found you could still get the raw data value by converting to an ItemStack, so I am using that now to reduce the lag caused by reading the serialized form of the metadata class.
2013-10-12 21:58:38 -05:00
cmastudios
ac12c2af29 Fix nasty mass destruction volume bug when volume is moved
Have to experience it first hand yourself with your own work. Bugs suck.
2013-10-09 23:15:07 -05:00
cmastudios
60e74eff99 Load war zone blocks in batches to prevent server hangs
War zone blocks are now loaded from the database at a configurable speed of blocks per tick. This prevents an entire server from hanging whenever a war zone is reset. The speed can be increased or decreased based on your server's performance.
2013-10-06 13:31:56 -05:00
cmastudios
aacd93b960 Add new volume format. Closes #527, closes #510, closes #500, closes #255
Block items are stored as their Material name. Block data is stored with the bukkit configuration serializer. This supports custom blocks. Tested with MCPC-Plus server.
Currently supports saving some tile entity data, such as sign text, all containers, note blocks, juke boxes, skulls/heads, command blocks, and basic mob spawners. The database is easily extensible for future blocks.
2013-10-05 16:21:25 -05:00
cmastudios
1722c86a71 Remove deprecated BlockInfo in favor of Location/BlockState
BlockInfo kept making me cringe every time I had to look at the code. More importantly it only had support for storing item IDs and no data. It was way obsolete versus new API.
2013-10-05 02:04:28 -05:00
cmastudios
6e9efc7a8a Closes gh-679 - Load chest data for trapped chests 2013-10-04 23:38:07 -05:00
cmastudios
3c80815428 Fixes gh-677 - Fix for bukkit chest inventory change 2013-10-02 15:57:46 -05:00
cmastudios
5913f73fcb Internationalized player interface, Russian locale
Most player-interfaced features such as event responders, signs, and
some player commands now have their messages stored externally in a
resource bundle. This allows for easy localization of the plugin by
copying the main messages.properties file and translating all the
messages into the language of choice.

Also thanks to @AlexMerser21 for the partial russian localization of the
plugin. This means that War servers can now show messages in the russian
language simply by starting the minecraft server with the flag
-Duser.language=ru.
2013-09-29 00:42:35 -05:00
cmastudios
a7458bf261 Fixes gh-640 - Glassify a list of block types
Other block types than AIR and WATER are now automatically "glassified" by
the warzone wall guard.
2013-09-27 18:12:18 -05:00
cmastudios
39b0ead3bd Using more bukkit interfaces rather than IDs
Item/damage/anything ID's have now become deprecated in bukkit presumedly
in preparation for any sort of official server modding API. This switches
war from using IDs in most cases to bukkit-provided classes such as
ItemStack.
2013-09-27 18:11:09 -05:00
cmastudios
e38b2aa62b Add event when battle ends
Actually no, I just forgot to stage this.
2013-09-20 16:15:05 -05:00
cmastudios
a4f1b29922 Properly implement War event API, some cleaning.
I changed some of the new event API code from @BenMenking to use more
Bukkit provided frameworks like Player and use basic java structures
instead of checking integers.
2013-09-20 16:11:44 -05:00