Commit Graph

1022 Commits

Author SHA1 Message Date
Alexandre Vanhecke
8b08b1a7dd Merge pull request #278 from Bodyash/master
Color Codes change in messages_ru
2015-11-30 19:06:47 +01:00
DNx
ea932712c3 Fix constants setup. 2015-11-30 10:57:02 +07:00
DNx
406c58f585 Remove build time from plugin version. 2015-11-30 10:24:33 +07:00
Gabriele C
109c85f4dd Auto build number + helpHeader config 2015-11-29 14:27:44 +01:00
ljacqu
da0c5d1ea2 Split command management into initializer and handler
- Create Initializer class that only initializes AuthMe commands
- Move remaining method to CommandHandler
- Deprecate constructors on CommandDescription in favor of the builder
- Various cleanups and comments
2015-11-29 12:51:11 +01:00
ljacqu
d7513ecc7b Fix nullpointer when command requires no permissions
- Add test to verify connections among the command initialization
2015-11-29 12:04:01 +01:00
ljacqu
7c652feac2 Fix failing command tests
- Detailed description missing period
- Fix twice defined /authme delete
- Add executable command to HelpSyntaxHelperTest initializations
- Remove unneeded constructors in CommandDescription
2015-11-29 10:56:01 +01:00
ljacqu
6a94135f64 Commands - fix child not being registered in parent via Builder
- Create test to ensure that commands don't define the same binding
- Create stricter attribute validation in builder: throw an error if required field was not initialized
2015-11-29 10:24:32 +01:00
ljacqu
a124e8f283 Refine CommandDescription builder; add/fix JavaDoc; add tests
- Add tests to check the integrity of the commands that are defined in the CommandManager
- Convert some more commands registrations to the new Builder format
2015-11-29 01:21:48 +01:00
ljacqu
faf9a2c8ac Create builder for command description; refactor command classes
- Create builder class for CommandDescription
- Remove redundant methods in command registration classes (e.g. certain validation is superfluous because we only instantiate the classes internally)
- Replace multiple occurrences where a field is directly instantiated e.g. with a list and then its value is overwritten by a constructor = redundant instantiation of objects
2015-11-28 23:59:04 +01:00
ljacqu
364583e7db Change use of String permissions to the permission enums 2015-11-28 21:59:29 +01:00
ljacqu
e519906dc5 Create enum classes for permission nodes 2015-11-28 21:26:07 +01:00
ljacqu
a1a14aa760 Add methods to Reflection utils; test ChangePasswordCommand fully 2015-11-28 20:40:02 +01:00
ljacqu
c02bf7db76 Testing - initialize data folder in WrapperMock; create ReflectionUtils
- Change AuthMeMockUtils (reflection-based test setup) to ReflectionUtils: service providing reflection functionalities for particular tests where it is appropriate;

- Initialize the data folder (required as soon as the Settings class is loaded) immediately in WrapperMock. Some tests did not set it up that required it and it goes unnoticed if the test is not run individually. This will hopefully fix the tests from failing in the Jenkins build.
2015-11-28 19:10:01 +01:00
ljacqu
b916a38d80 Fix UtilsTest and replace the last test setups not to use reflections 2015-11-28 17:13:33 +01:00
DNx5
67244d5e7b Fix admin register command lowercase the password. 2015-11-28 04:01:51 +07:00
games647
401f438211 Lower event priority of PlayerInteractEvent in order to notify other
plugins (e.g. ServerSigns) that this event is canceled. 

Fixes Xephi/AuthMeReloaded#283
2015-11-27 19:02:21 +01:00
ljacqu
8ed672e89d Remove old methods in Messages and add StringUtils tests
StringUtils - merge the two join methods to one common implementation with two interface; add tests

Messages - remove the methods taking a String as code after the kind refactoring by @DNx5
2015-11-26 23:21:19 +01:00
ljacqu
210b691353 Testing - change to non-reflection WrapperMock test setup
Replaced many classes to use Wrapper to get singletons and replaced the test setups to use the WrapperMock instead of setting fields through reflection
2015-11-26 22:53:12 +01:00
ljacqu
77f2f80eaf Testing - start change to non-reflection WrapperMock test setup 2015-11-26 22:25:02 +01:00
Gabriele C
38e3bda406 revert other maven broken features 2015-11-26 22:15:05 +01:00
Gabriele C
7bb3da2fc3 Merge branch 'master' of https://github.com/AuthMe-Team/AuthMeReloaded 2015-11-26 22:14:37 +01:00
Gabriele C
594d4f7b30 revert broken maven features 2015-11-26 22:14:31 +01:00
ljacqu
d2db59f597 Ignore ChangePasswordCommandTest for now 2015-11-26 21:46:09 +01:00
ljacqu
93cddb7a5c Merge enum branch into master 2015-11-26 21:45:06 +01:00
Tim Visée
eb07d9787d Fixed duplicate code, removed warning suppresion, reformatted code 2015-11-26 21:04:19 +01:00
Gabriele C
84c3b44f82 try to fix auto version code 2015-11-26 19:32:40 +01:00
Gabriele C
db67c77b33 auto build number 2015-11-26 19:20:25 +01:00
Tim Visée
1b30139ded Added note for possible invalid permission nodes in plugin configuration 2015-11-26 18:51:23 +01:00
Tim Visée
e37ddfdca2 Removed invalid permission node from plugin configuration 2015-11-26 18:49:18 +01:00
DNx5
fc87ea4eef Makes only authenticated players chat recipients that will be filtered 2015-11-27 00:40:17 +07:00
DNx5
30cdf6b1e0 Run database check async
* reduce lag if unlogged in player spamming the chat while cache is disabled
2015-11-27 00:40:14 +07:00
DNx5
e80c098e3d Fix unauthenticated recipients removed even chat is allowed. 2015-11-27 00:40:10 +07:00
Gabriele C
34e81b518f clean imports 2015-11-26 18:35:22 +01:00
DNx5
b6f6599779 Cleanup maven transitive dependencies
test to add jenkins build number in plugin version
2015-11-26 23:55:57 +07:00
Xephi
06b39dafd2 Add a way to serialize/unserialize a PlayerAuth 2015-11-26 12:07:33 +01:00
DNx5
d7ae2a96e3 Fix test unit 2015-11-26 11:04:12 +07:00
DNx5
7a78b321e7 refactor all class to use the message key for sending messages. 2015-11-26 10:18:53 +07:00
DNx5
2de0e0e819 Set classes to use Messages getter in plugin instance. 2015-11-26 08:17:19 +07:00
DNx5
0601ab0e40 Remove unauthenticated chat recipients
only authenticated players can see the chat
2015-11-26 07:03:22 +07:00
DNx5
25ed44f801 Added unregister method to AuthMeInventoryPacketAdapter class.
more reload compatibility.
2015-11-26 05:40:57 +07:00
DNx5
2162a4abe4 Cleanup some listener code. 2015-11-26 05:40:53 +07:00
ljacqu
a462780059 Create tests for StringUtils#getStackTrace and StringUtils#getDifference
- Create tests
- Make StringUtils final with private constructor (utility class)
2015-11-25 23:22:43 +01:00
ljacqu
920a982794 Merge branch 'master' of https://github.com/AuthMe-Team/AuthMeReloaded into us_enum 2015-11-25 23:06:56 +01:00
ljacqu
c83e983dea Close opened resources
- Add BufferedReader instantiation into try-with-resources statement
- Close scanner that was opened
- Create utility class to format a caught exception
2015-11-25 23:05:13 +01:00
ljacqu
498c3342f2 Create Wrapper as singleton; fix UtilsTest 2015-11-25 22:34:27 +01:00
ljacqu
43a60dc091 Change lost in merge 2015-11-25 22:21:37 +01:00
ljacqu
644f7e8541 Merge origin/enum into local branch 2015-11-25 22:18:21 +01:00
Lucas Jacques
5f9ba208de Merge branch 'master' of https://github.com/AuthMe-Team/AuthMeReloaded into enums 2015-11-25 19:52:15 +01:00
DNx5
7767ae6c0e revert to boolean 2015-11-26 01:43:27 +07:00
Lucas Jacques
37a615fa03 Create test that AntiBot is not enabled if Settings disable it 2015-11-25 19:39:16 +01:00
Gabriele C
ae3cf02c06 fix new version of hikari 2015-11-25 18:27:03 +01:00
Gabriele C
939462786f other parameters 2015-11-25 18:18:23 +01:00
Gabriele C
c3ed771939 WIP new hikari parameters 2015-11-25 17:06:00 +01:00
Gabriele C
f6e9347e1e cleanup 2015-11-25 15:39:15 +01:00
Gabriele C
6dc4119d0c cleanup 2015-11-25 15:37:06 +01:00
Gabriele C
ea0e65df55 continue 2015-11-25 15:13:45 +01:00
Gabriele C
f8ec474534 start fixing language 2015-11-25 15:11:01 +01:00
Tim Visée
d7328466b8 Improved and updated the custom configuration class 2015-11-25 01:32:11 +01:00
Tim Visée
2c2dd8e0d5 Disabled NPC check in player quit event 2015-11-25 01:13:06 +01:00
ljacqu
0065a6a827 Merge branch 'master' of https://github.com/AuthMe-Team/AuthMeReloaded into enums 2015-11-24 23:32:54 +01:00
ljacqu
d2b3d416a9 Change calls to Messages to use the MessageKey enum 2015-11-24 23:27:28 +01:00
Gabriele C
2c0d140da9 Try to fix NPC issues 2015-11-24 23:23:51 +01:00
ljacqu
cb11ae9610 Deprecate Messages#send(String) in favor of the MessageKey enum 2015-11-24 23:11:14 +01:00
DNx
be1eb9392a ugh 2015-11-25 05:10:13 +07:00
DNx
da390530e9 Update AuthMePlayerListener.java 2015-11-25 05:05:41 +07:00
DNx
9f199b1a5a Update AuthMePlayerListener.java 2015-11-25 05:04:38 +07:00
ljacqu
cf4e47488b Start refactoring for Messages class 2015-11-24 22:54:54 +01:00
ljacqu
2e5b7ecf29 Merge branch 'master' of https://github.com/AuthMe-Team/AuthMeReloaded into enums 2015-11-24 22:21:53 +01:00
ljacqu
72fe710b8c Fix UtilsTest, create MessageKeyTest 2015-11-24 22:21:36 +01:00
Gabriele C
a983253384 better names 2015-11-24 22:08:06 +01:00
ljacqu
e4c82e04ff Merge upstream/master into ljacqu/enums 2015-11-24 21:59:55 +01:00
Gabriele C
e9b2517188 enhance the removespeed feature 2015-11-24 21:55:55 +01:00
Gabriele C
43b9462ddc cleanup 2015-11-24 21:13:09 +01:00
Gabriele C
28e742e42f cleanup 2015-11-24 19:04:18 +01:00
Gabriele C
cc8401e841 Move the antibot management 2015-11-24 18:51:09 +01:00
DNx5
489708b206 i forgot about the hotbar. 2015-11-25 00:44:38 +07:00
DNx5
ea420ab05f set protect inventory to false in config file if protocol lib is not found. 2015-11-25 00:43:55 +07:00
DNx5
25c23e144c - send blank inventory on logout if protect inventory is enabled.
- added reload support for protect inventory option.
2015-11-25 00:14:45 +07:00
Gabriele C
fb6ddb4b59 Cleanup 2015-11-24 17:47:10 +01:00
DNx5
bc223b04f9 shouldn't allow movement event noTeleport enabled. 2015-11-24 22:14:14 +07:00
DNx5
e39ab8a644 removed old GeoIP data check. 2015-11-24 22:08:09 +07:00
DNx5
5be476e2d6 ignore yaw changes in player move event. 2015-11-24 21:55:55 +07:00
Bogdan
8933c55de4 Change some Color Codes in messages_ru.yml 2015-11-24 10:35:10 +02:00
DNx5
8e9bfc6299 update playerloginevent and some listener.
i hope it will fix the lag issues.
2015-11-24 07:15:58 +07:00
DNx5
b4b92e5a93 reordering local variable scope in captcha command 2015-11-24 05:46:28 +07:00
ljacqu
16a69d4126 Merge upstream/master into ljacqu/enums 2015-11-23 23:31:26 +01:00
ljacqu
6422f90114 Create Wrapper for instances / revise MockUtils
- Add test resources folder
- Create basic test for Messages (todo: add concrete tests)
- Create WrapperMock
- Change UtilsTest (todo: make it work)
2015-11-23 23:25:03 +01:00
DNx5
d7f9b602c7 update some Utils method 2015-11-24 04:43:29 +07:00
Tim Visée
09067ddbd1 Removed redundant code, fixed some warnings, other minor fixes 2015-11-23 22:18:04 +01:00
Tim Visée
82bf0f45ca Finalized some fields, removed redundant code, various other fixes 2015-11-23 22:14:03 +01:00
Tim Visée
83e5d726af Improved various code bits 2015-11-23 22:12:01 +01:00
Tim Visée
1dd540b9c0 Fixed some redundant casts and definitions 2015-11-23 22:09:15 +01:00
Tim Visée
47b1d00ccf Fixed various spelling and grammar issues 2015-11-23 22:07:32 +01:00
Tim Visée
36c50c4507 Reformatted code with new code style 2015-11-23 21:46:34 +01:00
Tim Visée
b2db25d16c Improved JavaDocs code style, some minor improvements 2015-11-23 21:45:23 +01:00
Tim Visée
f15eaae67f Some minor automatic fixes and changes 2015-11-23 21:43:40 +01:00
Tim Visée
53117928f5 Reformatted all files once again 2015-11-23 21:40:11 +01:00
Tim Visée
2e868c7492 Reformatted all code files, cleaned up the project 2015-11-23 21:33:08 +01:00
ljacqu
8719cce334 Create enum for message keys in Messages 2015-11-23 21:13:12 +01:00
Gabriele C
10435657c5 Fix enableBackup option 2015-11-23 20:59:25 +01:00
Gabriele C
614aa9d5e5 Fix noTeleport in the PlayerListener 2015-11-23 20:59:13 +01:00
AuthMe-Team
9ec2d6d059 Stuff from the common floobits workspace
Author:    AuthMe-Team <AuthMeTeam@123NoEmail.com>
2015-11-23 20:23:52 +01:00
Gabriele C
69a09aec17 cleanup 2015-11-22 21:06:08 +01:00
Tim Visée
da662afcf4 Created method to get an exception stack trace as a string 2015-11-22 21:01:31 +01:00
ljacqu
215fedc585 Minor refactoring in CustomConfiguration / Messages
- CustomConfiguration should be abstract
- Reduce visibility of internal method
- Fix typo in English messages
- Remove or replace unnecessary javadoc
2015-11-22 02:02:49 +01:00
ljacqu
e456203fc6 Refactor Utils#getOnlinePlayers and add background info 2015-11-22 01:30:07 +01:00
ljacqu
fc3f685de0 Create UtilsTest
Had to create a getGameServer() method in AuthMe in order to be able to catch this call in tests and replace it with a mock implementation of the actual server. The supertype method getServer() is declared as final, which makes it impossible to mock with Mockito.

While there are frameworks that manipulate the bytecode to mock final calls, it is much easier and less risky to simply delegate the server retrieval through another method.
2015-11-21 23:09:04 +01:00
ljacqu
cd728b569e Create test for CommandManager; fix javadoc in CommandDescription 2015-11-21 22:32:16 +01:00
Tim Visée
1ba18439e9 Fixed invalid method arguments 2015-11-21 21:08:07 +01:00
Tim Visée
ada991904b Improved purgePermissions method 2015-11-21 21:07:32 +01:00
Tim Visée
e45aa88504 Fixed result not being returned 2015-11-21 21:03:50 +01:00
Tim Visée
18af8f3171 Fixed addLimboPlayer method 2015-11-21 21:02:53 +01:00
Tim Visée
0a5c081732 Added method to permissions manager to get primary group of player 2015-11-21 20:59:23 +01:00
Tim Visée
89b5444d69 Fixed addNormal method, updated it's JavaDocs 2015-11-21 20:50:12 +01:00
Tim Visée
7902cd87bb Added return statement for setGroup method, updated it's JavaDocs 2015-11-21 20:47:56 +01:00
Gabriele C
579c51f4a2 Remove the old Vault group management system. (THIS COMMIT BREAKS THE COMPILATION) 2015-11-21 20:16:07 +01:00
ljacqu
7f049616c6 Attempt to fix dubious isUuidInstance in vAuthFileReader 2015-11-21 20:06:31 +01:00
ljacqu
efb57989ed Start tests for email commands
- Removed randomStringGenerator from Management as it is unused
2015-11-21 19:51:49 +01:00
ljacqu
2922d04aa0 Merge branch 'unit-tests' of https://github.com/ljacqu/AuthMeReloaded into unit-tests 2015-11-21 19:39:26 +01:00
ljacqu
f06f7d8c77 Merge remote-tracking branch 'origin/unit-tests' into unit-tests
Conflicts:
	src/main/java/fr/xephi/authme/command/executable/changepassword/ChangePasswordCommand.java
	src/test/java/fr/xephi/authme/AuthMeMockUtil.java
2015-11-21 19:36:48 +01:00
Tim Visée
579b7e7b97 Improved some grammar and variable names 2015-11-21 19:24:25 +01:00
Tim Visée
a176aba350 Fixed horrible typo, implemented dynamic plugin name 2015-11-21 19:22:23 +01:00
Tim Visée
30b4cfe44e Added notice to legacy permissions instance in main class 2015-11-21 19:18:56 +01:00
ljacqu
b3d0a71dec Merge ListUtil into StringUtil; refactor HelpSyntaxHelper + create test
The HelpSyntaxHelper had suppressed warnings for string concatenation within StringBuilder - the point of the StringBuilder is that it is faster when you use it to concatenate many elements. If you still use string concatenation with + within these calls it beats the purpose.
2015-11-21 17:19:11 +01:00
ljacqu
a3f24bcb9a Create test for HelpSyntaxHelperTest 2015-11-21 17:18:58 +01:00
ljacqu
58dc15123c Add tests for LogoutCommand and RegisterCommand. Add more generic mockUtil 2015-11-21 17:18:45 +01:00
ljacqu
4e8614fdf7 Add test for LoginCommand; create AuthMe mock test util
Had to create a getter for the Management instance in the AuthMe class for mocking, but fields should generally not be accessed globally. Hopefully soon we will be able to make the field private.
2015-11-21 17:18:28 +01:00
ljacqu
d81ef3168e Command refactor - remove unused fields, reduce variable "scope"
Minor refactorings in the command section for familiarization.

1. Removed suppressWarning("Deprecated") - the method is deprecated for a reason and we should be made aware of that.
2. Removed same javadoc on ExecutableCommand implementation that just had the same as the interface (this is just clutter; @Override signals that it's an implementing class and a developer can view the superclass javadoc)
3. In places where the AuthMe instance was retrieved at the top but used at the very bottom, moved it to the bottom to reduce its "scope"
2015-11-21 17:18:14 +01:00
Tim Visée
8387924c64 Merge pull request #68 from ljacqu/master
Revert certain JavaDoc changes
2015-11-21 16:57:17 +01:00
Tim Visée
8181bda762 Minor update to hasGroupSupport method in permissions manager 2015-11-21 16:26:05 +01:00
Tim Visée
bb22daab33 Added some missing support for Nijikokun's Permissions in permissions manager 2015-11-21 16:21:38 +01:00
Tim Visée
6dc4066563 Added group support check to setGroups method in Utils class 2015-11-21 16:08:41 +01:00
Tim Visée
eaba2765fa Created hasGroupSupport method in permissions manager 2015-11-21 16:07:02 +01:00
Tim Visée
69d6518b30 Improved setGroup method in Utils class, to replace legacy permissions code 2015-11-21 16:03:00 +01:00
Tim Visée
973c683c90 Minor fix for PermissionsBukkit support in permissions manager 2015-11-21 15:47:59 +01:00
Tim Visée
cfaece3eae Simplefied some code 2015-11-21 15:46:10 +01:00
Tim Visée
f8cf9e2e48 Created inGroup method in permissions manager 2015-11-21 15:44:57 +01:00
Tim Visée
a05a97a0a6 Fixed setGroup method in permissions manager 2015-11-21 15:38:20 +01:00
Tim Visée
1091db0e15 Created removeAllGroups method in permissions manager 2015-11-21 15:34:38 +01:00
Tim Visée
f7f455a56a Created setGroups method in permissions manager 2015-11-21 15:24:53 +01:00
Tim Visée
a84e219899 Fixed minor Essentials Group Manager issue in addGroup method of permissions manager 2015-11-21 15:18:01 +01:00
Tim Visée
462a2e9878 Created removeGroups method in permissions manager 2015-11-21 15:16:19 +01:00
Tim Visée
bcf4eeab00 Created removeGroup method in permissions manager 2015-11-21 15:15:04 +01:00
Tim Visée
b07e4b62cc Created addGroups method in permissions manager 2015-11-21 15:07:46 +01:00
Tim Visée
a6fe728d79 Fixed addGroup method for PermissionsBukkit in permissions manager 2015-11-21 15:00:14 +01:00
Tim Visée
f4da63fee6 Added note to getGroups method in permissions manager for PermissionsBukkit 2015-11-21 14:57:34 +01:00
Tim Visée
42dee2e101 Created addGroup method in permissions manager 2015-11-21 14:44:43 +01:00
Tim Visée
400d014e7b Fixed setGroup in PermissionsManager for Essentials Group Manager and zPermissions 2015-11-21 14:41:14 +01:00
ljacqu
b633b9a005 Create test for change password command 2015-11-21 13:23:18 +01:00