Adding metrics support via shading caused a unexpected break due to versions of shade being incompatible with older versions of maven. In theory, everyone should update to maven3 if possible. However, I would like to retain compatiblity for our older CI servers.
This commit adds localizations for the languages French, Korean, and Norwegian. Portuguese, Hungarian, and Polish are still a work-in-progress but they have been added. The languages German, Spanish, and Russian have been updated also.
War now collects statistics from servers running the plugin. The statistics are minimal. The goal is so the developers of the plugin can tell what areas they need to do more work in.
In addition to the default statistics collected by PluginMetrics, War sends the number of warzones and if certain plugins that War interfaces with are enabled.
To prevent your server from sending statistical data, set "opt-out" to "true" in plugins/PluginMetrics/config.yml.
Closes#716.
Warzones that previously used blockheads:false during the preview to get a properly colored hat now need to switch to blockheads:true for a hat. Old warzones that have blockheads:true will now have colored helmets instead of block heads.
Closes#528.
returns the code after the leaving of the zone. Not sure if it works.
Don't think it returns under all cases
Conflicts:
war/src/main/java/com/tommytony/war/Warzone.java
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.
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
- 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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Added the following events for other plugins to hook into:
WarPlayerDeathEvent, WarPlayerKillEvent, WarPlayerLeaveEvent,
WarPlayerThiefEvent, WarScoreCapEvent, WarTeamWinEvent,
WarThiefDeathEvent
Players are no longer silently kicked out of their team if they try to join
a non-existant team with /join. Fix an inconsistency with the format of the
team join notification message.
War now logs kills and deaths to a MySQL database. Records are created for
every player at the end of each round with the current date and amount of
times the player killed and was killed for the entire round. It has built
in support for automatic & configurable log clearing past a certain date
(default is 1 week).
Killstreak rewards can be configured in the set.war.killstreak section of
war.yml. Rewards will only be applied to players if the team/warzone has
KILLSTREAK set to true.
The configuration section will get populated on generation of war.yml, or
may be manually added to older configurations.
Currently the system supports messaging the entire warzone and just the
attacker. It only supports rewards of items and health at the moment; more
are expected to arrive.
This commit also moves XPKILLMETER into the team-specific section of the
config.
The killstreak counter shows a message if the player has more than 5
kills. I have also added an example reward system with points, but did not
enable it yet (needs discussion).
Through the warzone option xpkillmeter the XP level will get updated with
your current kill streak amount. This gets reset every time you die and
is added to every time you kill a player. If this option is enabled,
players cannot gain XP in the warzone.
With the new warzone configuration property "scoreboard", zone makers can
set the type of scoreboard to be used. This may be "none", "points", or
"lifepool". If the scoreboard type is not "none", then a scoreboard will
be shown on the right side of the screen in the warzone. The shown
scoreboard will display the configured option.
Also, 3-year-old feature request COMPLETED! Use the command
/zone <warzone-name> scoreboard to view a scoreboard from anywhere.
If a zone has the property autojoin & autoassign set to true, then
players will be directly assigned to a team when they go through the
Warhub portal for the zone and brought back to the Warhub when they
leave the zone.
TeamKind has been changed to store colors in a DyeColor object instead
of using a byte value store. This improves readability and makes the
code future-proof.
All listeners are now unregistered when the plugin gets unloaded. This
removes the need for listeners to check if War is loaded and prevents
duplicate registration. I would prefer if the ability to unload and load
the War plugin was completely removed, however, as there are plugins out
there such as PlugMan that are dedicated to cleanly reloading plugins.
The main purpose of this was to clean up all issues and problems
reported by the eclipse java IDE. 0 warnings are shown by the IDE now.
/setteam <color> now will add an additional spawn point if the team already
exists.
When a player joins a team in a warzone, they will be sent to any one of
their teams spawn points, picked at random.
This change required major modifications to the underlying teams subsystem
in order to support multiple spawn points for the team.
This test task is incompatible with additions to War regarding teams.
This method of preventing players of receiving spawn protection is
currently extremely buggy and there has to be a better way to fix the issue
at hand.
@taoneill please email me if there is any serious reason this task is
needed, otherwise it just deteoriates from the War experience. Numerous
times I have played War, I have been bumped out of a warzone even due to
this. There seems to be no need for it. I can revert this commit if needed.
One possible solution could be disabling all protections for anyone who
returns to their spawn, such as like how loadout switching is prevented
after leaving spawn. Another solution could be preventing multiple teams
from taking a flag while another flag is on the run.
Please leave your ideas in the comments or email me.
Update health references to use double-precision floating point numbers instead
of integers due to minecraft spec change. Update Java to 1.6. Update bukkit
version.
The WorldEdit API is utilized to allow the use of WorldEdit selections
when creating or modifying a warzone. If the current player has a
WorldEdit selection when the /setzone command is used, this selection will
be used for the zone's corners.
War saved a player's state before they were teleported into the warzone.
This causes issues if the lobby is in another world and the server is
using plugins to manage per-world inventories. Essentially, the player is
getting their inventory from world A saved, teleported to warzone in world
B, their state being restored in B, then teleported to A. Per-world
inventory plugins save and restore inventories on every
cross-world-teleport. This causes blank inventories when a player joins a
warzone and the player gets the items from the zone when they leave.
This issue is easily fixed by teleporting players to the warzone's world
before saving their state. This is merely a standardization of state
save/restore order.
permission specific loadouts.
Loadouts can be defined with a permission which can limit who can access
the loadout, in mostly the same manner as I did in the zone-permissions
commits. The permission can be used to only allow say VIP and above to get
a certain loadout (for donation benefits) or to allow the server's lower
ranks a class only (to allow lower ranks to survive faced with the server's
experienced players).
This is controlled by an additional argument to /zonecfg.
Example: /zonecfg loadout:vip:server.ranks.VIP - allow only VIP players
access to the vip loadout.
To remove the permission, re-make the loadout without the permission
parameter.
Example: /zonecfg loadout:vip - remove the permission requirement for the
vip loadout.
To allow a lower rank access to a loadout only, you can use your permission
manager's feature of negating a permission (if supported by the plugin).
Example: /pex group recruit add server.loadout.noob, /pex group builder add
-server.loadout.noob - allow only recruits to have access to a loadout
which requires the permission "server.loadout.noob" (with PermissionsEX).