Commit Graph

609 Commits

Author SHA1 Message Date
Connor Monahan
c6c93ba44f Set helmets on players instead of blocks 2014-01-07 19:49:22 -06:00
Connor Monahan
20068cbb15 Fix player list spacing issue 2014-01-07 18:37:33 -06:00
Connor Monahan
b011d3a46f New active sign, gets random warzone with players 2014-01-07 17:59:08 -06:00
Connor Monahan
bc07a60b51 Only randomly teleport to zones that are enabled 2014-01-07 17:51:49 -06:00
Connor Monahan
dc764de258 Restore maven2 compatibility
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.
2014-01-04 17:40:49 -06:00
Connor Monahan
a45a833e68 Merge branch 'metrics' 2014-01-04 17:08:41 -06:00
Connor Monahan
fdc4e90635 [Lang] Add FR HU KO NO PL PT localizations
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.
2014-01-03 20:16:28 -06:00
Connor Monahan
0805a04cad Collect metrics statistics from servers
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.
2013-12-27 18:13:30 -06:00
Connor Monahan
ca03c96173 [Behavior] Blockheads:true now gives leather hat
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.
2013-12-27 15:31:11 -06:00
cmastudios
0af348f2cb Merge branch 'master' into nimitz-v2
Conflicts:
	war/src/main/java/com/tommytony/war/Warzone.java
2013-12-24 20:40:35 -06:00
grinning
c16bc6ca5f Maybe closes gh-517
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
2013-12-24 20:31:40 -06:00
cmastudios
228ec2299b Prevent block duplication
Closes #722, closes #723. War prevents thieves from messing with their inventory and anyone from messing with their block head.
2013-12-24 17:11:29 -06:00
cmastudios
a120393060 Fix unbreakable regression
Closes #721. Zonemakers can modify blocks in an unbreakable zone when outside of it again.
2013-12-24 16:31:51 -06:00
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
Ben Menking
e2f6e02ae7 Added events for various gameplay events
Added the following events for other plugins to hook into:
WarPlayerDeathEvent, WarPlayerKillEvent, WarPlayerLeaveEvent,
WarPlayerThiefEvent, WarScoreCapEvent, WarTeamWinEvent,
WarThiefDeathEvent
2013-09-16 11:47:37 -04:00
cmastudios
2bddae16a2 Restore saturation and tweak some soup pvp actions 2013-09-10 19:14:39 -05:00
Nicholasntp
d94b7b3e78 Soup PvP Added
Soup PvP is now a part of warzone config.
Refer to Issue 651.
2013-09-10 19:12:02 -05:00
cmastudios
f1ce78907e Fix issues with joining a team.
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.
2013-09-10 18:57:58 -05:00
cmastudios
12b5f8350f Handle deaths after they have been counted and rewarded.
This prevents a problem where players could be rewarded after the game ends
2013-09-10 18:11:21 -05:00
cmastudios
dbac21aa44 Add MySQL kill/death logging support. Closes gh-658
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).
2013-09-10 17:51:30 -05:00
cmastudios
0dc7ac837f Added configurable airstrikes, based on work from @grinning. 2013-09-10 17:51:03 -05:00
cmastudios
26ec11f46c Allow the use of multiple items in rewards.
This also allows the use of XP and points as rewards.
2013-09-10 17:51:02 -05:00
cmastudios
17aef5e162 Add base for configurable KS rewards. Fixes gh-506
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.
2013-09-10 17:51:02 -05:00
cmastudios
c66120c4fa Fixes gh-611, gh-612 - Add kill count system and kill meters with XP.
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.
2013-09-10 17:50:40 -05:00
cmastudios
2738d2e358 Add scoreboard features and configuration options. Fixes gh-623, gh-45
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.
2013-09-10 17:27:05 -05:00
cmastudios
b367cc53ad Add ability to bypass warzone lobby. Fixes gh-669
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.
2013-09-07 18:10:23 -05:00
cmastudios
890e78fd5d TeamKind cleanup, warning fixes, closes gh-631
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.
2013-09-04 23:27:27 -05:00
cmastudios
ea0df4f22b Store loadouts using bukkit stack seriliazer. 2013-08-09 18:45:27 -05:00
cmastudios
5a571e7329 Add support for multiple spawn points. Closes gh-628.
/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.
2013-08-08 23:27:09 -05:00
cmastudios
200ae92e0f Remove "Can't re-enter spawn" task.
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.
2013-08-08 23:19:00 -05:00
cmastudios
c56fac6c34 Make invisible spawns hidden. Closes gh-627 2013-08-08 17:25:15 -05:00
cmastudios
bf3795ded1 Minecraft 1.6 compatibility.
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.
2013-07-26 22:22:27 -10:00
cmastudios
fb375002de Fixes gh-239. Add joinmidbattle zonecfg option.
With this option set to false, new players cannot join the zone if the
zone already has enough players on all teams necessary to play.
2013-07-13 17:00:56 -05:00
cmastudios
ebd95a4e16 Fixes gh-410. Prevent /join in autoassign zones. 2013-07-13 16:32:21 -05:00
taoneill
756ca37a82 Merge pull request #641 from cmastudios/weselection
Create zones with WorldEdit cuboid selections. Closes #411. Thanks @cmastudios!
2013-07-01 10:41:54 -07:00
cmastudios
13396f85a4 Fixes gh-645, gh-643 - Load player armor when using playerloadoutasdefault 2013-06-29 23:31:01 -05:00
cmastudios
c4b268910b Refresh player tags anytime players leave a zone
This fixes a bug where player tags are not reset when a zone ends normally
or when the zone is reset.
2013-06-11 23:28:26 -05:00
cmastudios
5c954a19b4 Make sure the selection is a cuboid 2013-06-11 23:11:25 -05:00
cmastudios
21688ba4d0 Create zones with WorldEdit cuboid selections
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.
2013-06-08 22:55:35 -05:00
cmastudios
728111217e Fix game end TP bugs caused by a5cd846
Remove players from team before teleporting them back to lobby or
rallypoint.
2013-05-31 17:03:36 -05:00
cmastudios
3b0b0c6720 Fixes gh-630. Close open inventories before reset.
This fixes issues with item smuggling via crafting inventories. The
player's inventory is closed before they are kicked from the zone or a
respawn.
2013-05-30 19:09:10 -05:00
cmastudios
a5cd846b2a Fixes gh-533
Prevents players from teleporting or moving out of a warzone in play.
2013-05-18 16:49:53 -05:00
cmastudios
423654d21e Fix incompabilities with per-world inventories.
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.
2013-05-18 16:47:21 -05:00
taoneill
e3e20fc704 Merge pull request #610 from cmastudios/colored-names
Add TagAPI support to War
2013-05-04 10:07:47 -07:00
taoneill
856d697d79 Merge pull request #587 from cmastudios/fix-colored-armor
Fix loadout issues + permission-restricted loadouts, thanks @cmastudios!!!
2013-05-04 10:02:49 -07:00
taoneill
4317b2fc8c Merge pull request #579 from cmastudios/zone-permissions
Add team-based permission requirement
2013-05-04 09:53:39 -07:00
taoneill
2d91b3cf90 Updating version to 1.8-PREVIEW (Nimitz) 2013-05-04 12:48:56 -04:00
cmastudios
d724f5a382 Closes gh-617, gh-609, gh-514, gh-319, tag gh-589. Add support for
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).
2013-03-22 22:33:38 -05:00
cmastudios
e6c1e64fef Add support for new loadout system to base classes and configuration
subsystem.
2013-03-22 22:09:29 -05:00
cmastudios
dd88a5ccbe Add new loadout class support to the existing loadout subsystem. 2013-03-22 22:01:02 -05:00
cmastudios
0955df7503 Added new classes to manage loadouts instead of the hashmap method. 2013-03-22 21:59:03 -05:00