From 49a2e64551fad5ad969e1a643182891e6880f2e9 Mon Sep 17 00:00:00 2001 From: "Gabriele C." Date: Wed, 29 Jul 2015 01:25:39 +0200 Subject: [PATCH 001/139] Initial Home page --- Home.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Home.md diff --git a/Home.md b/Home.md new file mode 100644 index 0000000..89db471 --- /dev/null +++ b/Home.md @@ -0,0 +1 @@ +![](http://s21.postimg.org/g29wshw5h/Authme_Logo2.png)Welcome to the AuthMeReloaded wiki! From 842eb28e34199cb84286776680c183fda05a8230 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 23 Nov 2015 20:39:32 +0100 Subject: [PATCH 002/139] Created AuthMe Coding Styleguide (markdown) --- AuthMe-Coding-Styleguide.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 AuthMe-Coding-Styleguide.md diff --git a/AuthMe-Coding-Styleguide.md b/AuthMe-Coding-Styleguide.md new file mode 100644 index 0000000..c3134a6 --- /dev/null +++ b/AuthMe-Coding-Styleguide.md @@ -0,0 +1,26 @@ +## General coding guidelines +- Use indentation of four spaces +- Always wrap structures like `if`, `while` with braces (never `if (isTrue) doThis();`) +- Fields should not be public – use getters and setters where appropriate +- Max line width: 120 characters + +As usual in Java: +- Class names should be uppercase and in CamelCase +- Names of methods, fields and variables in lowercase and camelCase + +## JavaDoc +Use the imperative mood for verbs: "Get the player's name". JavaDoc should briefly explain what the method does and provide additional information to the developer. + +Put an empty line between the description and the first `@param`, and between the last `@param` and `@return`. + +Example: +```java + /** + * Add a permission node required to execute this command. + * + * @param permissionNode The permission node to add. + * + * @return True on success, false on failure. + */ + public boolean addPermissionNode(String permissionNode) +``` \ No newline at end of file From 188e9fb8d06fa6df5b9ca0ce6f50d5d3c799e64e Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 29 Nov 2015 09:24:32 +0100 Subject: [PATCH 003/139] Created Unit Testing (markdown) --- Unit-Testing.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Unit-Testing.md diff --git a/Unit-Testing.md b/Unit-Testing.md new file mode 100644 index 0000000..2cd8e20 --- /dev/null +++ b/Unit-Testing.md @@ -0,0 +1,59 @@ +# Unit Testing +## Principles +Unit tests are for testing a _unit_: a particular class' methods are tested (ideally) in isolation to ensure that the logic contained within the class corresponds to our expectations. In contrast, _integration tests_ would verify that two or more components interact correctly. + +Unit tests have no guaranteed order in which they are run – neither for the order of the methods within a class, nor for the order of the test classes themselves. Unit tests should _not_ rely on previous tests to be set up. This is typically the case if a test works fine while running all tests but fails when run in isolation. + +## Technologies +We use JUnit, Hamcrest and Mockito for unit testing. JUnit is the general test framework to set up and run tests with; Hamcrest provides powerful matchers to test results with; Mockito enables us to _mock_ a class, i.e. to use the same interface of a class but to provide it with custom functionality to simulate a certain situation. This facilitates _unit_ testing: we don't need to provide an actual implementation of another class that may be required. + +## Conventions +Tests for a particular class should be in a class with the class name and "Test" appended to it, e.g. to test the class `Player` create a class `PlayerTest`. JavaDoc is not required for tests that are (reasonably) self-explanatory. Start test methods with `should` and the expected behavior, e.g. `shouldKickPlayer()` if this is the expected end result. + +While we don't use behavior-driven development, the typical format of the tests are still suitable and convenient for us. Each test is made up of three parts, namely `given`, `when` and `then`: + +- `given` instantiates and defines the necessary objects and values to run the test (e.g. to produce the desired condition to test). +- `when` is the command to test. Typically one line with a method call of the class that is being tested. +- `then` verifies the result + +#### Example +Note that the following is a made up test and doesn't correspond to any existing classes in AuthMe. Given the following method: +```java +public static boolean isLoggedIn(CommandSender sender) { + if (sender == null || !(sender instanceof Player)) { + return false; + } + return Status.LOGGED_IN.equals(((Player) sender).getStatus()); +} +``` +You may want to test that the method returns `false` if the sender is not an instance of `Player`, e.g. if the instance is `Console`. +```java +@Test +public void shouldReturnFalseForNonPlayerSender() { + // given + CommandSender sender = Mockito.mock(Console.class); + + // when + boolean result = Verifier.isLoggedIn(sender); + + // then + assertThat(result, equalTo(false)); +} +``` + +Now we want to test that a player is considered logged in if it returns the correct `Status`. This example shows the power of Mockito: we don't need to instantiate an actual player, where we might encounter issues to set the status to the desired one (e.g. if there is no setter for that method). + +```java +@Test +public void shouldReturnTrueForLoggedInPlayer() { + // given + Player player = Mockito.mock(Player.class); + given(player.getStatus()).willReturn(Status.LOGGED_IN); + + // when + boolean result = Verifier.isLoggedIn(sender); + + // then + assertThat(result, equalTo(true)); +} +``` \ No newline at end of file From ff1a6f6e226f5f07aaa1872d555253239f378d39 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 29 Nov 2015 09:25:31 +0100 Subject: [PATCH 004/139] Created t (markdown) --- t.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 t.md diff --git a/t.md b/t.md new file mode 100644 index 0000000..32f64f4 --- /dev/null +++ b/t.md @@ -0,0 +1 @@ +t \ No newline at end of file From 586778cdcf324b35e77ae7a9e6e2223fb7d924bd Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 29 Nov 2015 09:25:40 +0100 Subject: [PATCH 005/139] Destroyed t (markdown) --- t.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 t.md diff --git a/t.md b/t.md deleted file mode 100644 index 32f64f4..0000000 --- a/t.md +++ /dev/null @@ -1 +0,0 @@ -t \ No newline at end of file From 9beac52aa949001001d395649a4f3573661e7c59 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 29 Nov 2015 09:34:35 +0100 Subject: [PATCH 006/139] Updated Unit Testing (markdown) --- Unit-Testing.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Unit-Testing.md b/Unit-Testing.md index 2cd8e20..d960322 100644 --- a/Unit-Testing.md +++ b/Unit-Testing.md @@ -16,7 +16,22 @@ While we don't use behavior-driven development, the typical format of the tests - `when` is the command to test. Typically one line with a method call of the class that is being tested. - `then` verifies the result -#### Example +The examples further below should illustrate how this works. + +## The Wrapper Class +Mockito cannot mock all classes and methods – classes and methods may not be `final`, and methods may not be `static`. Since we make heavy use of singletons in AuthMe which are retrieved from a static method, we use a Wrapper class to retrieve these entities. The Wrapper class is not static (i.e. it can be mocked) and simply delegates to `static` or `final` methods, such as in `getAuthMe()`: + +```java +public AuthMe getAuthMe() { + return AuthMe.getInstance(); +} +``` + +Classes getting the `AuthMe` instance through `new Wrapper().getAuthMe()` can then be unit tested without a real AuthMe instance. If classes retrieve `AuthMe` directly with `AuthMe.getInstance()`, unit testing is made a lot more difficult, to the point that we might require reflections to set a mock singleton. + +As an exception, we use static methods for our utility classes (as is usual) and don't mock the calls to them because utility methods should be stateless and should not execute anything _heavy_ like performing IO operations. + +## Examples Note that the following is a made up test and doesn't correspond to any existing classes in AuthMe. Given the following method: ```java public static boolean isLoggedIn(CommandSender sender) { From 5f9982b8b7f30dd0326d30b22890a49f7eea7713 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 29 Nov 2015 09:35:55 +0100 Subject: [PATCH 007/139] Updated Unit Testing (markdown) --- Unit-Testing.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Unit-Testing.md b/Unit-Testing.md index d960322..e6e419e 100644 --- a/Unit-Testing.md +++ b/Unit-Testing.md @@ -4,6 +4,8 @@ Unit tests are for testing a _unit_: a particular class' methods are tested (ide Unit tests have no guaranteed order in which they are run – neither for the order of the methods within a class, nor for the order of the test classes themselves. Unit tests should _not_ rely on previous tests to be set up. This is typically the case if a test works fine while running all tests but fails when run in isolation. +Needless to say, things inside of the test/ folder may not be used anywhere outside. Testing is an isolated scope and the project must be able to be built without any of the test resources. + ## Technologies We use JUnit, Hamcrest and Mockito for unit testing. JUnit is the general test framework to set up and run tests with; Hamcrest provides powerful matchers to test results with; Mockito enables us to _mock_ a class, i.e. to use the same interface of a class but to provide it with custom functionality to simulate a certain situation. This facilitates _unit_ testing: we don't need to provide an actual implementation of another class that may be required. From a388324b11855dd721643f0281661b2f208d4d41 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 5 Dec 2015 11:18:35 +0100 Subject: [PATCH 008/139] Created AuthMe Releases (markdown) --- AuthMe-Releases.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 AuthMe-Releases.md diff --git a/AuthMe-Releases.md b/AuthMe-Releases.md new file mode 100644 index 0000000..6a0d5ff --- /dev/null +++ b/AuthMe-Releases.md @@ -0,0 +1,10 @@ +# AuthMe Releases +The AuthMe project is _built_ after a change to the code, i.e. the code is wrapped into a .jar that you can use for your server. We use Jenkins to do this automatically for us: + +- [AuthMeReloaded-**Dev** Jenkins](http://ci.xephi.fr/job/AuthMeReloaded-Dev/) – run after every change +- [AuthMeReloaded Jenkins](http://ci.xephi.fr/job/AuthMeReloaded/) – run sporadically + +The panel "Build history" on the left shows the latest _builds_; if there is a blue circle next to the number, it means that the code could be successfully packaged to a .jar file. Clicking on the build number will allow you to download the JAR file that was generated, allowing you to take the latest changes (e.g. Click on #347 and download AuthMe-5.1-SNAPSHOT.jar under "Build artifacts"). + +Remember: the dev Jenkins runs after _every_ change, which means it may fix recent bugs but it may introduce new issues as well. + From 654441943ddf26bd5a629860a4e9c661e890d1c4 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 5 Dec 2015 11:19:19 +0100 Subject: [PATCH 009/139] Just realized the page title is right above the main title I keep setting in my pages --- Unit-Testing.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Unit-Testing.md b/Unit-Testing.md index e6e419e..2a5c529 100644 --- a/Unit-Testing.md +++ b/Unit-Testing.md @@ -1,4 +1,3 @@ -# Unit Testing ## Principles Unit tests are for testing a _unit_: a particular class' methods are tested (ideally) in isolation to ensure that the logic contained within the class corresponds to our expectations. In contrast, _integration tests_ would verify that two or more components interact correctly. From eb266622da826fc5f69bfe9c44499b1b8e9e08bf Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 5 Dec 2015 11:19:31 +0100 Subject: [PATCH 010/139] Just realized the page title is right above the main title I keep setting in my pages --- AuthMe-Releases.md | 1 - 1 file changed, 1 deletion(-) diff --git a/AuthMe-Releases.md b/AuthMe-Releases.md index 6a0d5ff..1b2e96d 100644 --- a/AuthMe-Releases.md +++ b/AuthMe-Releases.md @@ -1,4 +1,3 @@ -# AuthMe Releases The AuthMe project is _built_ after a change to the code, i.e. the code is wrapped into a .jar that you can use for your server. We use Jenkins to do this automatically for us: - [AuthMeReloaded-**Dev** Jenkins](http://ci.xephi.fr/job/AuthMeReloaded-Dev/) – run after every change From f2f210b855c0fc9675c5f759a3ccadc8560a97ba Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 5 Dec 2015 11:19:43 +0100 Subject: [PATCH 011/139] Just realized the page title is right above the main title I keep setting in my pages --- AuthMe-Coding-Styleguide.md | 1 - 1 file changed, 1 deletion(-) diff --git a/AuthMe-Coding-Styleguide.md b/AuthMe-Coding-Styleguide.md index c3134a6..6ff3670 100644 --- a/AuthMe-Coding-Styleguide.md +++ b/AuthMe-Coding-Styleguide.md @@ -1,4 +1,3 @@ -## General coding guidelines - Use indentation of four spaces - Always wrap structures like `if`, `while` with braces (never `if (isTrue) doThis();`) - Fields should not be public – use getters and setters where appropriate From 5a1ed8d34b5c45d8f523c14a9264643c7f48e822 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 6 Dec 2015 00:03:06 +0100 Subject: [PATCH 012/139] Updated AuthMe Releases (markdown) --- AuthMe-Releases.md => AuthMe-Releases-(Jenkins).md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename AuthMe-Releases.md => AuthMe-Releases-(Jenkins).md (50%) diff --git a/AuthMe-Releases.md b/AuthMe-Releases-(Jenkins).md similarity index 50% rename from AuthMe-Releases.md rename to AuthMe-Releases-(Jenkins).md index 1b2e96d..6c5211b 100644 --- a/AuthMe-Releases.md +++ b/AuthMe-Releases-(Jenkins).md @@ -1,9 +1,11 @@ -The AuthMe project is _built_ after a change to the code, i.e. the code is wrapped into a .jar that you can use for your server. We use Jenkins to do this automatically for us: +You can get the latest versions ("Dev versions") of AuthMe from Jenkins: - [AuthMeReloaded-**Dev** Jenkins](http://ci.xephi.fr/job/AuthMeReloaded-Dev/) – run after every change - [AuthMeReloaded Jenkins](http://ci.xephi.fr/job/AuthMeReloaded/) – run sporadically -The panel "Build history" on the left shows the latest _builds_; if there is a blue circle next to the number, it means that the code could be successfully packaged to a .jar file. Clicking on the build number will allow you to download the JAR file that was generated, allowing you to take the latest changes (e.g. Click on #347 and download AuthMe-5.1-SNAPSHOT.jar under "Build artifacts"). +The panel "Build history" on the left shows the latest _builds_; if there is a blue circle next to the number, it means that the code could be successfully converted to a .jar file that you can use for your server. + +Clicking on the build number will allow you to download the JAR file that was generated, allowing you to take the latest changes (e.g. Click on #347 and download AuthMe-5.1-SNAPSHOT.jar under "Build artifacts"). Remember: the dev Jenkins runs after _every_ change, which means it may fix recent bugs but it may introduce new issues as well. From 398c3a807e45a4f06923bb153636f200541fdcee Mon Sep 17 00:00:00 2001 From: ljacqu Date: Tue, 8 Dec 2015 21:35:50 +0100 Subject: [PATCH 013/139] Created Releases (markdown) --- Releases.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Releases.md diff --git a/Releases.md b/Releases.md new file mode 100644 index 0000000..4e210ec --- /dev/null +++ b/Releases.md @@ -0,0 +1,6 @@ +List of commits releasing a version. (Useful to clone the repo up to that commit to get the state of a given version.) + +Version | Commit hash +------- | ----------- +5.2 | [330a275](https://github.com/AuthMe-Team/AuthMeReloaded/commit/330a275725a9a962d7b8c8f716e2c7ba4255da7a) +5.1 | [b458547](https://github.com/AuthMe-Team/AuthMeReloaded/commit/b458547a176e90a28eee17ea7a95e70880c65864) \ No newline at end of file From 13a1171fce79ba59ce78749e1ad30650947447f0 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Tue, 8 Dec 2015 21:39:49 +0100 Subject: [PATCH 014/139] Updated Releases (markdown) --- Releases.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Releases.md b/Releases.md index 4e210ec..cdeca13 100644 --- a/Releases.md +++ b/Releases.md @@ -3,4 +3,5 @@ List of commits releasing a version. (Useful to clone the repo up to that commit Version | Commit hash ------- | ----------- 5.2 | [330a275](https://github.com/AuthMe-Team/AuthMeReloaded/commit/330a275725a9a962d7b8c8f716e2c7ba4255da7a) -5.1 | [b458547](https://github.com/AuthMe-Team/AuthMeReloaded/commit/b458547a176e90a28eee17ea7a95e70880c65864) \ No newline at end of file +5.1 | [b458547](https://github.com/AuthMe-Team/AuthMeReloaded/commit/b458547a176e90a28eee17ea7a95e70880c65864) +5.0 | [44bbd30](https://github.com/AuthMe-Team/AuthMeReloaded/commit/44bbd30fd2f580be9b4ee27beecece401d3b891d) \ No newline at end of file From 0931a11f30ee5ab9a8e4d17afe7304684bb779a1 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Tue, 8 Dec 2015 21:40:19 +0100 Subject: [PATCH 015/139] Updated Releases (markdown) --- Releases.md => Release-History.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Releases.md => Release-History.md (100%) diff --git a/Releases.md b/Release-History.md similarity index 100% rename from Releases.md rename to Release-History.md From f1b721086810c356119c91f07cbca870e03f624d Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 14 Dec 2015 17:11:34 +0100 Subject: [PATCH 016/139] Created Breaking Changes (markdown) --- Breaking-Changes.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Breaking-Changes.md diff --git a/Breaking-Changes.md b/Breaking-Changes.md new file mode 100644 index 0000000..c32831c --- /dev/null +++ b/Breaking-Changes.md @@ -0,0 +1,7 @@ +This page contains a list of _breaking changes_, i.e. of changes in AuthMe that may require plugin users to make adjustments. + +Change | Version +----------------------------- | ---------- +Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) | 5.1 ([2015-12-05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) +Configurable text sent in email moved from config.yml to email.html | 5.1 ([2015-12-04](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) +Bug fix: Using /authme register no longer changes the password to all lower-case | 5.1 ([2015-11-27](https://github.com/AuthMe-Team/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) \ No newline at end of file From 29c0e7014f558452fbc6b288a5c938876c2d680d Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 14 Dec 2015 17:19:26 +0100 Subject: [PATCH 017/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index c32831c..3e3489b 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -1,7 +1,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that may require plugin users to make adjustments. -Change | Version +Version | Description ----------------------------- | ---------- -Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) | 5.1 ([2015-12-05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) -Configurable text sent in email moved from config.yml to email.html | 5.1 ([2015-12-04](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) -Bug fix: Using /authme register no longer changes the password to all lower-case | 5.1 ([2015-11-27](https://github.com/AuthMe-Team/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) \ No newline at end of file +5.1 ([2015-12-05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) +5.1 ([2015-12-04](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) | Configurable text sent in email moved from config.yml to email.html +5.1 ([2015-11-27](https://github.com/AuthMe-Team/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case \ No newline at end of file From beac439ffb77e42a7191450e233b077e823f8591 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 14 Dec 2015 17:23:52 +0100 Subject: [PATCH 018/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 3e3489b..e223dbc 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -1,7 +1,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that may require plugin users to make adjustments. -Version | Description +Version | Description ----------------------------- | ---------- -5.1 ([2015-12-05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) +5.1 ([2015‑12‑05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) 5.1 ([2015-12-04](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) | Configurable text sent in email moved from config.yml to email.html 5.1 ([2015-11-27](https://github.com/AuthMe-Team/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case \ No newline at end of file From 9f9b3e63fecc2f38b3faf0d0ef0836ae267ea32d Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 14 Dec 2015 17:24:05 +0100 Subject: [PATCH 019/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index e223dbc..72b7683 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,6 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- -5.1 ([2015‑12‑05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) +5.1 ([2015‑12‑05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) 5.1 ([2015-12-04](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) | Configurable text sent in email moved from config.yml to email.html 5.1 ([2015-11-27](https://github.com/AuthMe-Team/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case \ No newline at end of file From 4846f6f2a60afbb222556566f554190cf02814cd Mon Sep 17 00:00:00 2001 From: ljacqu Date: Tue, 15 Dec 2015 08:25:24 +0100 Subject: [PATCH 020/139] Created please-verify Label (markdown) --- please-verify-Label.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 please-verify-Label.md diff --git a/please-verify-Label.md b/please-verify-Label.md new file mode 100644 index 0000000..b047881 --- /dev/null +++ b/please-verify-Label.md @@ -0,0 +1,3 @@ +We use a `please-verify` label on issues to communicate to the reporter of the issue that we think we have solved his bug or satisfied his question. It's an invitation for the bug reporter to _close_ the issue if it's done, or to tell us what is still missing or unclear. + +Issues with a `please-verify` label can be closed by a developer if the issue reporter doesn't give any feedback within 9 days. This helps us keeping track of which issues still require work. \ No newline at end of file From a5702b28c996f329fc139ca6155d29a89bda0de7 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Tue, 15 Dec 2015 08:25:42 +0100 Subject: [PATCH 021/139] Updated please verify Label (markdown) --- please-verify-Label.md => 'please-verify'-Label.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename please-verify-Label.md => 'please-verify'-Label.md (100%) diff --git a/please-verify-Label.md b/'please-verify'-Label.md similarity index 100% rename from please-verify-Label.md rename to 'please-verify'-Label.md From dce3a6e51ebbeab20777eccb5457f58debab9b01 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Tue, 15 Dec 2015 10:43:37 +0100 Subject: [PATCH 022/139] Updated Home (markdown) --- Home.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Home.md b/Home.md index 89db471..c9040a0 100644 --- a/Home.md +++ b/Home.md @@ -1 +1,11 @@ -![](http://s21.postimg.org/g29wshw5h/Authme_Logo2.png)Welcome to the AuthMeReloaded wiki! +Welcome to the AuthMeReloaded wiki! + +If you are using AuthMe on your server, the following pages might be of interest to you: +- [AuthMe releases (Jenkins)](https://github.com/AuthMe-Team/AuthMeReloaded/wiki/AuthMe-Releases-(Jenkins)) – how to get the latest version of AuthMe +- [Breaking changes](https://github.com/AuthMe-Team/AuthMeReloaded/wiki/Breaking-Changes) +- [Permission nodes](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md) +- ["please-verify" on issues](https://github.com/AuthMe-Team/AuthMeReloaded/wiki/'please-verify'-Label) + +The remaining Wiki pages are aimed at developers. + +![](http://s21.postimg.org/ko610uhol/Authme_Logo2.png) \ No newline at end of file From 5fa7dcc66b4ac94d1abf2d17564a9d1cc0a91155 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 20 Dec 2015 13:11:50 +0100 Subject: [PATCH 023/139] Created Command Handling (markdown) --- Command-Handling.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Command-Handling.md diff --git a/Command-Handling.md b/Command-Handling.md new file mode 100644 index 0000000..c88f0ba --- /dev/null +++ b/Command-Handling.md @@ -0,0 +1,28 @@ +This page is a technical description of how commands of AuthMe are registered and handled. + +### Overview +The following overview shows the most important players in the command handling process. + +![Command handling overview](http://s1.postimg.org/95aukee3z/cmd_handling.png) + +### Command registration +We use `CommandDescription` objects to define the commands available in AuthMe. These objects do not contain any logic of the command but contain all of the necessary information to invoke the command it describes: the labels to access the command (e.g. must use `/authme register` or `/authme reg`), the necessary number of arguments and a link to the actual command implementation. + +### Mapping of incoming commands +When a command is invoked, Bukkit (or Spigot) passes the information to the plugin with the arguments `String commandLabel, String[] args`. The Bukkit command label simply contains the first "word" of a command (e.g. `authme` in `/authme reload`) and the Bukkit arguments are the rest. + +In AuthMe, we call _labels_ any tokens at the beginning that lead to a command, so e.g. in `/authme register billy pass123` the labels are `authme, register` as they lead to the admin register command. In the beginning, we don't know what is a label and what is an argument yet, so we collectively refer to them as _command parts_. + +The first job is to determine which of the _parts_ are _labels_ and _arguments_. If the parts could be mapped to a command description and the number of arguments is valid according to the CommandDescription, we speak of a successful mapping. For example, `/authme register billy pass123` leads to the command description for the admin registration command and leaves us with the arguments `billy, pass123`. The command description defines two mandatory arguments, so the argument count matched and we have a successful mapping. + +**Safe assumption:** It is safe to assume while programming that there will be at most 2 labels. Any more would unnecessarily complicate our command structure and our code. There is a test verifying that no command description is initialized with more than two labels. Nevertheless, you are still encouraged to write logic related to labels generically if it is not a lot more complicated. + +### Permissions check +Permission-related logic is handled in the `permission` package. The CommandHandler class passes the command sender and the command description to the PermissionsManager to query whether the user may invoke the command. + +### Invocation of the command +If the permissions check is successful, the command can be invoked. Each command description has a subclass of `ExecutableCommand` linked to it which is the class for actually executing the command logic. The arguments are passed to it. + +An `ExecutableCommand` instance may call further objects, typically for asynchronous processing when database calls are involved. In such cases, the `ExecutableCommand` typically does as much validation as necessary which doesn't require I/O operations (e.g. does the password confirmation match?, is the player online?) and then passes the data on to an async task which handles interactions with the database. + +**Safe assumption:** Within an `ExecutableCommand`, it is safe to assume that all mandatory arguments defined in the corresponding command description(s) are present. The command handler will not execute a command if the argument count does not match. \ No newline at end of file From 03b8ed433a94c65924364b5b53cf61c608154905 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 20 Dec 2015 13:14:40 +0100 Subject: [PATCH 024/139] Updated Command Handling (markdown) --- Command-Handling.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Command-Handling.md b/Command-Handling.md index c88f0ba..8f0d971 100644 --- a/Command-Handling.md +++ b/Command-Handling.md @@ -1,4 +1,4 @@ -This page is a technical description of how commands of AuthMe are registered and handled. +This page is a technical description of how the commands of AuthMe are registered and handled. ### Overview The following overview shows the most important players in the command handling process. @@ -15,7 +15,7 @@ In AuthMe, we call _labels_ any tokens at the beginning that lead to a command, The first job is to determine which of the _parts_ are _labels_ and _arguments_. If the parts could be mapped to a command description and the number of arguments is valid according to the CommandDescription, we speak of a successful mapping. For example, `/authme register billy pass123` leads to the command description for the admin registration command and leaves us with the arguments `billy, pass123`. The command description defines two mandatory arguments, so the argument count matched and we have a successful mapping. -**Safe assumption:** It is safe to assume while programming that there will be at most 2 labels. Any more would unnecessarily complicate our command structure and our code. There is a test verifying that no command description is initialized with more than two labels. Nevertheless, you are still encouraged to write logic related to labels generically if it is not a lot more complicated. +**Safe assumption:** It is safe to assume while programming that there will be at most 2 labels to access a command (such as `/authme register`, whereas `/authme user register` – with three labels – cannot occur). Any more would unnecessarily complicate our command structure and our code. There is a test verifying that no command description is initialized with more than two labels. Nevertheless, you are still encouraged to write logic related to labels generically if it is not a lot more complicated. ### Permissions check Permission-related logic is handled in the `permission` package. The CommandHandler class passes the command sender and the command description to the PermissionsManager to query whether the user may invoke the command. From 9474c3cf6ad4e0136bd495454f81f88c2bf2bd1c Mon Sep 17 00:00:00 2001 From: ljacqu Date: Wed, 23 Dec 2015 12:00:42 +0100 Subject: [PATCH 025/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 72b7683..f71b90b 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,8 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2015-12-23](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` +5.2 ([2015-12-22](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe-Team/AuthMeReloaded/blob/8f098933371767130b2a533ec9ad0f6075c2522b/src/main/resources/email.html)) 5.1 ([2015‑12‑05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) 5.1 ([2015-12-04](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) | Configurable text sent in email moved from config.yml to email.html 5.1 ([2015-11-27](https://github.com/AuthMe-Team/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case \ No newline at end of file From 17c56efbef299ae95e33185005cb6d6a169e3f55 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 26 Dec 2015 21:52:41 +0100 Subject: [PATCH 026/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index f71b90b..67a1c38 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2015-12-26](https://github.com/AuthMe-Team/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_ flatfile no longer supported. Use Sqlite. 5.2 ([2015-12-23](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` 5.2 ([2015-12-22](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe-Team/AuthMeReloaded/blob/8f098933371767130b2a533ec9ad0f6075c2522b/src/main/resources/email.html)) 5.1 ([2015‑12‑05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) From 088ef8026b647440e1ef8ac3c941e7515005ab6d Mon Sep 17 00:00:00 2001 From: Alexandre Vanhecke Date: Mon, 28 Dec 2015 12:37:00 +0100 Subject: [PATCH 027/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 67a1c38..cc2aa41 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,8 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2015-12-28](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | +PlainText is automatically changed to SHA256 HashAlgorithm and all password are hashed 5.2 ([2015-12-26](https://github.com/AuthMe-Team/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_ flatfile no longer supported. Use Sqlite. 5.2 ([2015-12-23](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` 5.2 ([2015-12-22](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe-Team/AuthMeReloaded/blob/8f098933371767130b2a533ec9ad0f6075c2522b/src/main/resources/email.html)) From 481ac27af346a3c64b07d852c84240ccfbc5015c Mon Sep 17 00:00:00 2001 From: Alexandre Vanhecke Date: Mon, 28 Dec 2015 12:37:13 +0100 Subject: [PATCH 028/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index cc2aa41..6d582f4 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,8 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- -5.2 ([2015-12-28](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | -PlainText is automatically changed to SHA256 HashAlgorithm and all password are hashed +5.2 ([2015-12-28](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically changed to SHA256 HashAlgorithm and all password are hashed 5.2 ([2015-12-26](https://github.com/AuthMe-Team/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_ flatfile no longer supported. Use Sqlite. 5.2 ([2015-12-23](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` 5.2 ([2015-12-22](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe-Team/AuthMeReloaded/blob/8f098933371767130b2a533ec9ad0f6075c2522b/src/main/resources/email.html)) From 1ee9f9ddcb5619faa3a26066297448080e6fe7b8 Mon Sep 17 00:00:00 2001 From: Alexandre Vanhecke Date: Mon, 28 Dec 2015 12:38:01 +0100 Subject: [PATCH 029/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 6d582f4..445257a 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,7 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- -5.2 ([2015-12-28](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically changed to SHA256 HashAlgorithm and all password are hashed +5.2 ([2015-12-28](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically change to SHA256 HashAlgorithh 5.2 ([2015-12-26](https://github.com/AuthMe-Team/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_ flatfile no longer supported. Use Sqlite. 5.2 ([2015-12-23](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` 5.2 ([2015-12-22](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe-Team/AuthMeReloaded/blob/8f098933371767130b2a533ec9ad0f6075c2522b/src/main/resources/email.html)) From 9095879b521b96e96a6f82b46cebcc43f369337b Mon Sep 17 00:00:00 2001 From: Alexandre Vanhecke Date: Mon, 28 Dec 2015 12:38:36 +0100 Subject: [PATCH 030/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 445257a..f761bfa 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,8 +2,8 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- -5.2 ([2015-12-28](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically change to SHA256 HashAlgorithh -5.2 ([2015-12-26](https://github.com/AuthMe-Team/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_ flatfile no longer supported. Use Sqlite. +5.2 ([2015-12-28](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically change to SHA256 HashAlgorithm +5.2 ([2015-12-26](https://github.com/AuthMe-Team/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_/_from_ flatfile no longer supported. Use Sqlite. 5.2 ([2015-12-23](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` 5.2 ([2015-12-22](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe-Team/AuthMeReloaded/blob/8f098933371767130b2a533ec9ad0f6075c2522b/src/main/resources/email.html)) 5.1 ([2015‑12‑05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) From ffad9109921fe320b502d982795e0ea5c239835b Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 2 Jan 2016 10:52:28 +0100 Subject: [PATCH 031/139] Updated AuthMe Releases (Jenkins) (markdown) --- AuthMe-Releases-(Jenkins).md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/AuthMe-Releases-(Jenkins).md b/AuthMe-Releases-(Jenkins).md index 6c5211b..a1373e9 100644 --- a/AuthMe-Releases-(Jenkins).md +++ b/AuthMe-Releases-(Jenkins).md @@ -1,11 +1,10 @@ You can get the latest versions ("Dev versions") of AuthMe from Jenkins: -- [AuthMeReloaded-**Dev** Jenkins](http://ci.xephi.fr/job/AuthMeReloaded-Dev/) – run after every change -- [AuthMeReloaded Jenkins](http://ci.xephi.fr/job/AuthMeReloaded/) – run sporadically +- [AuthMeReloaded Dev Jenkins](http://ci.xephi.fr/job/AuthMeReloaded/) – run after every change The panel "Build history" on the left shows the latest _builds_; if there is a blue circle next to the number, it means that the code could be successfully converted to a .jar file that you can use for your server. Clicking on the build number will allow you to download the JAR file that was generated, allowing you to take the latest changes (e.g. Click on #347 and download AuthMe-5.1-SNAPSHOT.jar under "Build artifacts"). -Remember: the dev Jenkins runs after _every_ change, which means it may fix recent bugs but it may introduce new issues as well. +Remember: the Jenkins runs after _every_ change, which means it may fix recent bugs but it may introduce new issues as well. From 051a89be44185bf97453499f1057a3b9e71ab965 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 9 Jan 2016 22:59:47 +0100 Subject: [PATCH 032/139] Destroyed Release History (markdown) --- Release-History.md | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Release-History.md diff --git a/Release-History.md b/Release-History.md deleted file mode 100644 index cdeca13..0000000 --- a/Release-History.md +++ /dev/null @@ -1,7 +0,0 @@ -List of commits releasing a version. (Useful to clone the repo up to that commit to get the state of a given version.) - -Version | Commit hash -------- | ----------- -5.2 | [330a275](https://github.com/AuthMe-Team/AuthMeReloaded/commit/330a275725a9a962d7b8c8f716e2c7ba4255da7a) -5.1 | [b458547](https://github.com/AuthMe-Team/AuthMeReloaded/commit/b458547a176e90a28eee17ea7a95e70880c65864) -5.0 | [44bbd30](https://github.com/AuthMe-Team/AuthMeReloaded/commit/44bbd30fd2f580be9b4ee27beecece401d3b891d) \ No newline at end of file From edf4360d242f9758cea9a49be891cb53d0c43d58 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 9 Jan 2016 23:03:48 +0100 Subject: [PATCH 033/139] Updated Command Handling (markdown) --- Command-Handling.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Command-Handling.md b/Command-Handling.md index 8f0d971..55c3e64 100644 --- a/Command-Handling.md +++ b/Command-Handling.md @@ -25,4 +25,9 @@ If the permissions check is successful, the command can be invoked. Each command An `ExecutableCommand` instance may call further objects, typically for asynchronous processing when database calls are involved. In such cases, the `ExecutableCommand` typically does as much validation as necessary which doesn't require I/O operations (e.g. does the password confirmation match?, is the player online?) and then passes the data on to an async task which handles interactions with the database. -**Safe assumption:** Within an `ExecutableCommand`, it is safe to assume that all mandatory arguments defined in the corresponding command description(s) are present. The command handler will not execute a command if the argument count does not match. \ No newline at end of file +**Safe assumption:** Within an `ExecutableCommand`, it is safe to assume that all mandatory arguments defined in the corresponding command description(s) are present. The command handler will not execute a command if the argument count does not match. + +### Constructor graph +The following graph shows the dependencies of the command classes and in which order they are instantiated. + +![Command class constructor graph](http://s12.postimg.org/6unz23act/Untitled_Diagram_1_1_1_1.png) \ No newline at end of file From 41b3a5c11489eda9088ce6e656ef240a8f97bf13 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Fri, 12 Feb 2016 23:22:14 +0100 Subject: [PATCH 034/139] Add info about the different JAR artifacts we build --- AuthMe-Releases-(Jenkins).md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/AuthMe-Releases-(Jenkins).md b/AuthMe-Releases-(Jenkins).md index a1373e9..af3acf7 100644 --- a/AuthMe-Releases-(Jenkins).md +++ b/AuthMe-Releases-(Jenkins).md @@ -2,9 +2,17 @@ You can get the latest versions ("Dev versions") of AuthMe from Jenkins: - [AuthMeReloaded Dev Jenkins](http://ci.xephi.fr/job/AuthMeReloaded/) – run after every change +#### Which JAR file to choose +We build AuthMe in three different formats: +- AuthMe-...-**legacy**.jar — for Minecraft 1.7.10 and Cauldron (contains required version of Google Guava) +- AuthMe-...-**spigot**.jar – typically what you want if the _legacy_ JAR doesn't apply to you +- AuthMe-...-**noshade**.jar – for developers only; this is the project without any shaded dependencies + + +#### How to find the downloads The panel "Build history" on the left shows the latest _builds_; if there is a blue circle next to the number, it means that the code could be successfully converted to a .jar file that you can use for your server. -Clicking on the build number will allow you to download the JAR file that was generated, allowing you to take the latest changes (e.g. Click on #347 and download AuthMe-5.1-SNAPSHOT.jar under "Build artifacts"). +Clicking on the build number will allow you to download the JAR file that was generated, allowing you to take the latest changes (e.g. Click on #347 and download the appropriate .jar file under "Build artifacts"). Remember: the Jenkins runs after _every_ change, which means it may fix recent bugs but it may introduce new issues as well. From efcfeda153446b4a2a7f1b52d38992a664beb987 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 14 Feb 2016 16:46:59 +0100 Subject: [PATCH 035/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index f761bfa..bdf581a 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,10 +2,28 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2016-02-14](https://github.com/AuthMe-Team/AuthMeReloaded/commit/b3734f40102466ef145e5361b6125ed96360ddef)) | Some permissions have been moved outside of `authme.player`. Please see the list below. +5.2 ([2016-02-12](https://github.com/Xephi/AuthMeReloaded/issues/512)) | `Settings.delayJoinLeaveMessages` has been split up in more granular configurations. Your config file will update automatically, search for options with "delay" 5.2 ([2015-12-28](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically change to SHA256 HashAlgorithm 5.2 ([2015-12-26](https://github.com/AuthMe-Team/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_/_from_ flatfile no longer supported. Use Sqlite. 5.2 ([2015-12-23](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` 5.2 ([2015-12-22](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe-Team/AuthMeReloaded/blob/8f098933371767130b2a533ec9ad0f6075c2522b/src/main/resources/email.html)) 5.1 ([2015‑12‑05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) 5.1 ([2015-12-04](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) | Configurable text sent in email moved from config.yml to email.html -5.1 ([2015-11-27](https://github.com/AuthMe-Team/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case \ No newline at end of file +5.1 ([2015-11-27](https://github.com/AuthMe-Team/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case + +--- + +### Addendum + +##### Permissions change 2016-02-14 +A few permissions were moved outside of the `authme.player` group. The reason was that assigning `authme.player.*` to players also gave them VIP status (`authme.player.vip`), for instance, which was undesired. + +Old permission -> new permission +``` +authme.player.allow2accounts -> authme.allowmultipleaccounts +authme.player.bypassantibot -> authme.bypassantibot +authme.player.bypassforcesurvival -> authme.bypassforcesurvival +authme.player.seeotheraccounts -> authme.admin.seeotheraccounts +authme.player.vip -> authme.vip +``` \ No newline at end of file From 4ccf0b4e791792dbd9ecc4ec626b294c29744e95 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Fri, 19 Feb 2016 22:28:43 +0100 Subject: [PATCH 036/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index bdf581a..96bc401 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2016-02-19](https://github.com/AuthMe-Team/AuthMeReloaded/commit/715622826f1e67ec50c63fadab90ffdbef1c468f)) | Command /converter has been moved to /authme converter 5.2 ([2016-02-14](https://github.com/AuthMe-Team/AuthMeReloaded/commit/b3734f40102466ef145e5361b6125ed96360ddef)) | Some permissions have been moved outside of `authme.player`. Please see the list below. 5.2 ([2016-02-12](https://github.com/Xephi/AuthMeReloaded/issues/512)) | `Settings.delayJoinLeaveMessages` has been split up in more granular configurations. Your config file will update automatically, search for options with "delay" 5.2 ([2015-12-28](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically change to SHA256 HashAlgorithm From 1b286d05012c290d50bc92875fa69342021831d4 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 27 Feb 2016 16:12:06 +0100 Subject: [PATCH 037/139] Created Hooking into AuthMe (markdown) --- Hooking-into-AuthMe.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Hooking-into-AuthMe.md diff --git a/Hooking-into-AuthMe.md b/Hooking-into-AuthMe.md new file mode 100644 index 0000000..45c61a5 --- /dev/null +++ b/Hooking-into-AuthMe.md @@ -0,0 +1,16 @@ +# Hooking into AuthMe +A technical description for plugin developers on how to interact with AuthMe. + +### API +We offer an API for performing actions and queries in AuthMe, see [NewAPI](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/fr/xephi/authme/api/NewAPI.html). You can get the `NewAPI` object the following way: +```java +import fr.xephi.authme.api.NewAPI; +// ... +NewAPI authmeApi = NewAPI.getInstance(); +``` +The individual methods are described in the Javadoc (see link above). + +### Events +Before or after various actions, we throw an _Event_ you can listen to in your plugin. All AuthMe events extend the [CustomEvent class](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/fr/xephi/authme/events/CustomEvent.html). You can see a list of all events and their hierarchy [here](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/fr/xephi/authme/events/package-tree.html). All event classes are described with Javadoc. + +Note that not all events can be canceled—only the ones extending Bukkit's `Cancellable` interface. \ No newline at end of file From 22e289adcc18c7b60e0289d9f632de3f8889f5af Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 27 Feb 2016 16:12:19 +0100 Subject: [PATCH 038/139] Updated Hooking into AuthMe (markdown) --- Hooking-into-AuthMe.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Hooking-into-AuthMe.md b/Hooking-into-AuthMe.md index 45c61a5..ab9ae57 100644 --- a/Hooking-into-AuthMe.md +++ b/Hooking-into-AuthMe.md @@ -1,4 +1,3 @@ -# Hooking into AuthMe A technical description for plugin developers on how to interact with AuthMe. ### API From 1d127769c55ac52677353856dc9c30174f470762 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 18 Apr 2016 15:07:36 +0200 Subject: [PATCH 039/139] Remove mention of outdated Wrapper class --- Unit-Testing.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Unit-Testing.md b/Unit-Testing.md index 2a5c529..9e93165 100644 --- a/Unit-Testing.md +++ b/Unit-Testing.md @@ -1,12 +1,12 @@ ## Principles -Unit tests are for testing a _unit_: a particular class' methods are tested (ideally) in isolation to ensure that the logic contained within the class corresponds to our expectations. In contrast, _integration tests_ would verify that two or more components interact correctly. +Unit tests are for testing a _unit_: a particular class' methods are tested (ideally) in isolation to ensure that the logic contained within the class corresponds to our expectations. In contrast, _integration tests_ verify that two or more components interact correctly. Unit tests have no guaranteed order in which they are run – neither for the order of the methods within a class, nor for the order of the test classes themselves. Unit tests should _not_ rely on previous tests to be set up. This is typically the case if a test works fine while running all tests but fails when run in isolation. Needless to say, things inside of the test/ folder may not be used anywhere outside. Testing is an isolated scope and the project must be able to be built without any of the test resources. ## Technologies -We use JUnit, Hamcrest and Mockito for unit testing. JUnit is the general test framework to set up and run tests with; Hamcrest provides powerful matchers to test results with; Mockito enables us to _mock_ a class, i.e. to use the same interface of a class but to provide it with custom functionality to simulate a certain situation. This facilitates _unit_ testing: we don't need to provide an actual implementation of another class that may be required. +We use JUnit, Hamcrest and Mockito for unit testing. **JUnit** is the general test framework to set up and run tests with; **Hamcrest** provides powerful matchers to test results with; **Mockito** enables us to _mock_ a class, i.e. to use the same interface of a class but to provide it with custom functionality to simulate a certain situation. This facilitates _unit_ testing: we only want to test one piece and imitate (mock) the rest. ## Conventions Tests for a particular class should be in a class with the class name and "Test" appended to it, e.g. to test the class `Player` create a class `PlayerTest`. JavaDoc is not required for tests that are (reasonably) self-explanatory. Start test methods with `should` and the expected behavior, e.g. `shouldKickPlayer()` if this is the expected end result. @@ -19,18 +19,10 @@ While we don't use behavior-driven development, the typical format of the tests The examples further below should illustrate how this works. -## The Wrapper Class -Mockito cannot mock all classes and methods – classes and methods may not be `final`, and methods may not be `static`. Since we make heavy use of singletons in AuthMe which are retrieved from a static method, we use a Wrapper class to retrieve these entities. The Wrapper class is not static (i.e. it can be mocked) and simply delegates to `static` or `final` methods, such as in `getAuthMe()`: +## Static injections and methods +Mockito cannot mock all classes and methods – classes and methods may not be `final`, and methods may not be `static`. -```java -public AuthMe getAuthMe() { - return AuthMe.getInstance(); -} -``` - -Classes getting the `AuthMe` instance through `new Wrapper().getAuthMe()` can then be unit tested without a real AuthMe instance. If classes retrieve `AuthMe` directly with `AuthMe.getInstance()`, unit testing is made a lot more difficult, to the point that we might require reflections to set a mock singleton. - -As an exception, we use static methods for our utility classes (as is usual) and don't mock the calls to them because utility methods should be stateless and should not execute anything _heavy_ like performing IO operations. +Static methods are fine for lightweight utility classes (no state, no _heavy_ actions like performing I/O) and for the logger. ## Examples Note that the following is a made up test and doesn't correspond to any existing classes in AuthMe. Given the following method: From 77405abacf3f84453f896b88b49fea9f9adc7a29 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 18 Apr 2016 15:23:55 +0200 Subject: [PATCH 040/139] Created Translation Interface (markdown) --- Translation-Interface.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Translation-Interface.md diff --git a/Translation-Interface.md b/Translation-Interface.md new file mode 100644 index 0000000..c53e723 --- /dev/null +++ b/Translation-Interface.md @@ -0,0 +1,34 @@ +This page describes how a translation from [the AuthMe translation web interface](https://jalu.ch/ext/authme/) can be integrated into the project. + +### Import messages +You need to know the public link of the translation to include (something like `https://jalu.ch/ext/authme/?p=b256dee50`). By appending `&json` to the URL you get the output in JSON (e.g. `https://jalu.ch/ext/authme/?p=b256dee50&json`). + +**Run the tool task `importMessages`** and supply the URL with `&json`: +```shell +Please enter the task to run: +> importMessages +Enter URL to import from +> https://jalu.ch/ext/authme/?p=b256dee50&json +``` + +This will fetch the data and update the messages YML file with the new data. Verify the changes before committing. + +### Export messages +After importing and verifying the messages, export the messages so that the server has the most recent version of the messages. **Run the tool task `exportMessages`.** + +```shell +Please enter the task to run: +> exportMessages +Enter language code of messages to export: +> fr +``` + +--- + +### Running tool tasks +Tool tasks are located in `src/tools`. Execute the `ToolsRunner` class, which will prompt you for the task to run. + +If your IDE does not recognize the class as runnable (because src/tools is not marked as a source folder in pom.xml), in IntelliJ you can right-click src/tools and "Mark as test directory". In eclipse, you can select `Build Path > Use as Source Folder` on the folder. + +### Authorization to export messages to the server +Updating the messages on the server (i.e. doing `exportMessages`) is protected by an IP address whitelist. If your request is rejected, go to `https://jalu.ch/ext/authme/admin` (login prompt) and add your IP address. \ No newline at end of file From 2d1ee3bbd3a0edfb0bb4a731e7357c5f9e8745b7 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 8 May 2016 11:25:19 +0200 Subject: [PATCH 041/139] Update info on tool tasks - they now reside in the test folder --- Translation-Interface.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Translation-Interface.md b/Translation-Interface.md index c53e723..7a5b521 100644 --- a/Translation-Interface.md +++ b/Translation-Interface.md @@ -26,9 +26,7 @@ Enter language code of messages to export: --- ### Running tool tasks -Tool tasks are located in `src/tools`. Execute the `ToolsRunner` class, which will prompt you for the task to run. - -If your IDE does not recognize the class as runnable (because src/tools is not marked as a source folder in pom.xml), in IntelliJ you can right-click src/tools and "Mark as test directory". In eclipse, you can select `Build Path > Use as Source Folder` on the folder. +Tool tasks are located in `src/test/java/tools`. Execute the `ToolsRunner` class, which will prompt you for the name of the task to run. ### Authorization to export messages to the server Updating the messages on the server (i.e. doing `exportMessages`) is protected by an IP address whitelist. If your request is rejected, go to `https://jalu.ch/ext/authme/admin` (login prompt) and add your IP address. \ No newline at end of file From 65580880071448ee4566022fa1b7562ba15855fb Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 8 May 2016 11:26:38 +0200 Subject: [PATCH 042/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 96bc401..6a805e4 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2016-05-03](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0ea95fb93c5b8408d6cb34c8de381dbce06060d5)) | Force spawn settings are grouped together (settings should migrate automatically) 5.2 ([2016-02-19](https://github.com/AuthMe-Team/AuthMeReloaded/commit/715622826f1e67ec50c63fadab90ffdbef1c468f)) | Command /converter has been moved to /authme converter 5.2 ([2016-02-14](https://github.com/AuthMe-Team/AuthMeReloaded/commit/b3734f40102466ef145e5361b6125ed96360ddef)) | Some permissions have been moved outside of `authme.player`. Please see the list below. 5.2 ([2016-02-12](https://github.com/Xephi/AuthMeReloaded/issues/512)) | `Settings.delayJoinLeaveMessages` has been split up in more granular configurations. Your config file will update automatically, search for options with "delay" From a51391825a2130effc5054cbce7f3f8799de4e4c Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 8 May 2016 13:23:49 +0200 Subject: [PATCH 043/139] Created Dependency Injector (markdown) --- Dependency-Injector.md | 150 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 Dependency-Injector.md diff --git a/Dependency-Injector.md b/Dependency-Injector.md new file mode 100644 index 0000000..6519340 --- /dev/null +++ b/Dependency-Injector.md @@ -0,0 +1,150 @@ +This page contains some details about the AuthMe injector used to automatically instantiate classes while satisfying their dependency. + +## What it does + +To instantiate a class, we need to satisfy the class' constructor parameters. Consider the `SampleCommand` class below—it requires `UserService` and `PermissionsManager`: + +```java +public class SampleCommand { + + public SampleCommand(UserService userService, PermissionsManager permissionsManager) { + // do something with the parameters + } + +} +``` + +To create a `SampleCommand` instance, we need to locate the instance of `UserService` and `PermissionsManager` and pass them along: + +```java +SampleCommand cmd = new SampleCommand(userService, permissionsManager); +``` + +As the application grows, the number of classes and their dependencies grows and we end up with large chunks of code for initializing all classes of interest. + + +A dependency **injector** takes care of this for us. It detects the dependencies of a class at runtime and invokes the constructor for us: + +```java +AuthMeServiceInitializer initializer; // ... +SampleCommand command = initializer.newInstance(SampleCommand.class); +``` + +This way, we easily get an instance of the class we want and we don't have to worry about its dependencies (such as `UserService`) if we don't care about them directly. + +## How it works + +Classes whose dependencies can be injected are denoted with the `@Inject` (see [JSR-330 annotations](http://atinject.googlecode.com/svn/tags/1/javadoc/javax/inject/package-summary.html)). So, for example, SampleCommand can be annotated the following way: + +```java +public class SampleCommand { + + @Inject + public SampleCommand(UserService userService, PermissionsManager permissionsManager) { + // do something with the parameters + } + +} +``` + +Then, when invoking `initializer.newInstance(SampleCommand.class)`, the initializer looks for `@Inject`, reads the dependencies (i.e. `UserService`, `PermissionsManager`) and supplies them. Either it has already instantiated these classes and just passes the instance on, or it will instantiate these dependencies as well, using the same principle again (find what is annotated with `@Inject` and try to supply them). + +## Injection methods + +There are three possibilities to instantiate a class with the AuthMe injector. + +### Constructor injection +As seen above with `SampleCommand`, a constructor can be annotated with `@Inject`, telling the injector to invoke this constructor with the given dependencies. There may be multiple constructors but only one with `@Inject`. The inject constructor may have any visibility (including private). + +### Field injection +Alternatively, the fields of a class that should be injected can be annotated with `@Inject`: + +```java +public class SampleCommand { + + @Inject + private UserService userService; + @Inject + private PermissionsManager permissionsManager; + +} +``` + +Field injection requires that the class have a no-arguments constructor of any visibility (including private). The fields may have any visibility. There may be other fields without `@Inject`; they will simply be ignored by the injector. + +### Instantiation fallback + +As a fallback to make things running smoothly and avoid unnecessary empty constructors with `@Inject`, the injector also instantiates classes that have a no-arg constructor with no `@Inject` fields. + +### Method injection + +:warning: Not supported. + +## Scopes + +The AuthMe injector supports two scopes. :warning: Unlike the JSR-330 standard, the scope defaults to singleton. + +### Singleton + +When classes are instantiated in singleton scopes, the injector keeps track of the instance and will always re-use it. You can get instances in the singleton scope using the [get(Class)](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/fr/xephi/authme/initialization/AuthMeServiceInitializer.html#get-java.lang.Class-) method. In other words, invoking `initializer.get(Service.class)` multiple times will always return the same instance of the `Service` class. + +### Request + +The method [newInstance(Class)](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/fr/xephi/authme/initialization/AuthMeServiceInitializer.html#newInstance-java.lang.Class-) creates a new instance of the given class for each call. It also does not keep track of the instance, i.e. it creates a new instance, returns it and forgets about it. + +:warning: Note that all dependencies passed to the class are in singleton scope, e.g. calling `initializer.newInstance(SampleCommand.class)` repeatedly will always return a new instance of SampleCommand, but it will always receive the same `UserService` and `PermissionsManager` instance as dependency. + + + +## Providing custom instances + +You may want to provide some instances to the injector, e.g. classes you want to instantiate manually or certain parameter values, such as a `File` for the plugin folder. This can be done in two ways. + +### Registering an instance for a class + +After creating an `AuthMeServiceInitializer` instance, you can register an instance for the given class: + +```java +DataSource ds = initializeDataSource(); + +AuthMeServiceInitializer initializer; +initializer.register(DataSource.class, ds); +initializer.register(SomeService.class, someInstance); +``` + +The registered instances will be passed on to any classes with such dependencies. :warning: For dependencies on interfaces, it is important to provide an instance this way because the injector cannot deal with superclasses. So e.g. DataSource, which is an interface, _must_ be provided explicitly to the initializer or it won't be able to locate a DataSource instance. + +### Denote values by annotations + +Instances/values can also be identified with an annotation. This is the better approach for general classes or values (e.g. config values, environment properties) and allows us to distinguish multiple implementations of the same class (e.g. `File`) even in singleton scope: + +```java +@Retention(RUNTIME) // Do not forget to set retention to RUNTIME +public @interface PluginFolder { +} +``` + +A class which wants to get this `@PluginFolder` value as a dependency then also specifies the annotation either on the field or on the constructor parameter: + +```java +public class FolderManager { + @Inject + @PluginFolder + private File pluginFolder; + + // Or: public FolderManager(@PluginFolder file pluginFolder) { } +} +``` + +Register the value of the annotation with the initializer's [provide(Class, Object)](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/) method: + +```java +AuthMeServiceInitializer initializer; +initializer.provide(PluginFolder.class, new File("/plugins")); + +FolderManager mgr = initializer.get(FolderManager.class); +``` + +### @Qualifier, @Named + +:warning: Not supported—create a custom annotation. \ No newline at end of file From c29ad2a80eae2abe5b6ba9731384cc7a5d163254 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 8 May 2016 14:15:11 +0200 Subject: [PATCH 044/139] Instantiation fallback: specificy that constructor must be visible --- Dependency-Injector.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dependency-Injector.md b/Dependency-Injector.md index 6519340..564f12b 100644 --- a/Dependency-Injector.md +++ b/Dependency-Injector.md @@ -20,7 +20,7 @@ To create a `SampleCommand` instance, we need to locate the instance of `UserSer SampleCommand cmd = new SampleCommand(userService, permissionsManager); ``` -As the application grows, the number of classes and their dependencies grows and we end up with large chunks of code for initializing all classes of interest. +As the application grows, the number of classes and their dependencies increases and we end up with large chunks of code for initializing all classes of interest. A dependency **injector** takes care of this for us. It detects the dependencies of a class at runtime and invokes the constructor for us: @@ -74,7 +74,7 @@ Field injection requires that the class have a no-arguments constructor of any v ### Instantiation fallback -As a fallback to make things running smoothly and avoid unnecessary empty constructors with `@Inject`, the injector also instantiates classes that have a no-arg constructor with no `@Inject` fields. +As a fallback to make things running smoothly and avoid unnecessary empty constructors with `@Inject`, the injector also instantiates classes that have a no-arg constructor and no `@Inject` fields. :warning: Unlike the injection methods, the constructor must be public for this fallback! ### Method injection From 132eb0331ac734168159ac2268d643e0a2219a71 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 28 May 2016 12:08:04 +0200 Subject: [PATCH 045/139] Created Spawn handling (markdown) --- Spawn-handling.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Spawn-handling.md diff --git a/Spawn-handling.md b/Spawn-handling.md new file mode 100644 index 0000000..0d445bf --- /dev/null +++ b/Spawn-handling.md @@ -0,0 +1,55 @@ +This page describes how teleportation is handled and configured in AuthMe. + +## Settings +The following settings have an influence on the spawn feature, listed by priority: + +1. `settings.restrictions.noTeleport` — if set to true, AuthMe will _never_ teleport players +1. `settings.restrictions.spawnPriority` — list of spawns to consider by priority (supported: authme, essentials, multiverse, default) +1. `settings.restrictions.teleportUnAuthedToSpawn` — if set to true, teleports players to spawn when they join. Once they log in, they are teleported back to their original location +1. `settings.restrictions.ForceSpawnLocOnJoin.enabled` — if set to true, players are teleported to spawn _after_ having logged in successfully +1. `settings.restrictions.ForceSpawnLocOnJoin.worlds` — limits the above feature only to the given worlds (case-sensitive) + +-- +Related: `settings.restrictions.SaveQuitLocation` must be true for the quit location to be saved + +## Spawn priority +Spawn priority is defined in `settings.restrictions.spawnPriority` (see above), i.e. this setting defines from where the spawn definition should be taken. Possible values: + +- **authme** — Spawn points defined in spawn.yml (AuthMe folder). See below for details. +- **essentials** — Spawn as defined in Essentials' spawn.yml. Only applicable if Essentials is loaded on the server. +- **multiverse** — Gets the spawn point saved in Multiverse for the given world. Only possible if Multiverse is loaded and the world is a Multiverse handled world. +- **default** — Spawn location of the world (vanilla Minecraft) + +Example: +```yaml + spawnPriority: 'essentials,authme,default` +``` +If Essentials is available, the spawn defined in Essentials is used. If not, the AuthMe spawn is used as second choice. If this also fails, the default is taken. + +## AuthMe Spawn +The AuthMe spawnpoint is defined in spawn.yml of the AuthMe plugin folder. Example: + +```yaml +spawn: + world: world + x: -171.77925533614896 + y: 99.0 + z: 171.8600493294933 + yaw: -180.43475 + pitch: 13.7999935 +firstspawn: + world: world + x: -167.00317045444243 + y: 98.0 + z: 142.33661923798473 + yaw: -342.2848 + pitch: 11.849992 +``` + +Players who have never played on the server before are teleported to the **firstspawn**; otherwise they are teleported to the regular **spawn**. You can delete the `firstspawn` section to disable the feature. + +## AuthMe Spawn Commands +- `/authme spawn` teleports you to the AuthMe spawn point +- `/authme setspawn` sets the AuthMe spawn point +- `/authme firstspawn` teleports you to the AuthMe first spawn point +- `/authme setfirstspawn` sets the AuthMe first spawn point \ No newline at end of file From 33cb2fb98eaa93b071a1a783dcea77f34bcb1d92 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 28 May 2016 12:09:42 +0200 Subject: [PATCH 046/139] Updated Spawn handling (markdown) --- Spawn-handling.md => Spawn-Handling.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename Spawn-handling.md => Spawn-Handling.md (90%) diff --git a/Spawn-handling.md b/Spawn-Handling.md similarity index 90% rename from Spawn-handling.md rename to Spawn-Handling.md index 0d445bf..bc1e296 100644 --- a/Spawn-handling.md +++ b/Spawn-Handling.md @@ -12,7 +12,7 @@ The following settings have an influence on the spawn feature, listed by priorit -- Related: `settings.restrictions.SaveQuitLocation` must be true for the quit location to be saved -## Spawn priority +## Spawn Priority Spawn priority is defined in `settings.restrictions.spawnPriority` (see above), i.e. this setting defines from where the spawn definition should be taken. Possible values: - **authme** — Spawn points defined in spawn.yml (AuthMe folder). See below for details. @@ -22,7 +22,7 @@ Spawn priority is defined in `settings.restrictions.spawnPriority` (see above), Example: ```yaml - spawnPriority: 'essentials,authme,default` + spawnPriority: 'essentials,authme,default' ``` If Essentials is available, the spawn defined in Essentials is used. If not, the AuthMe spawn is used as second choice. If this also fails, the default is taken. @@ -52,4 +52,6 @@ Players who have never played on the server before are teleported to the **first - `/authme spawn` teleports you to the AuthMe spawn point - `/authme setspawn` sets the AuthMe spawn point - `/authme firstspawn` teleports you to the AuthMe first spawn point -- `/authme setfirstspawn` sets the AuthMe first spawn point \ No newline at end of file +- `/authme setfirstspawn` sets the AuthMe first spawn point + +Permission nodes for the commands are listed on the [command list page](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/docs/commands.md). \ No newline at end of file From 9b6933f97a053eea521c6d74d78428176158293e Mon Sep 17 00:00:00 2001 From: ljacqu Date: Wed, 1 Jun 2016 22:14:31 +0200 Subject: [PATCH 047/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 6a805e4..23aeeaf 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2016-05-29](https://github.com/AuthMe-Team/AuthMeReloaded/commit/52c0c7dd640217572d32587237abedb9cc35fca3)) | "Allow all commands if registration is optional" feature dropped 5.2 ([2016-05-03](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0ea95fb93c5b8408d6cb34c8de381dbce06060d5)) | Force spawn settings are grouped together (settings should migrate automatically) 5.2 ([2016-02-19](https://github.com/AuthMe-Team/AuthMeReloaded/commit/715622826f1e67ec50c63fadab90ffdbef1c468f)) | Command /converter has been moved to /authme converter 5.2 ([2016-02-14](https://github.com/AuthMe-Team/AuthMeReloaded/commit/b3734f40102466ef145e5361b6125ed96360ddef)) | Some permissions have been moved outside of `authme.player`. Please see the list below. From 63c001eee96eb7700469a693a19d1a24328aa66b Mon Sep 17 00:00:00 2001 From: ljacqu Date: Wed, 1 Jun 2016 22:57:12 +0200 Subject: [PATCH 048/139] Update command handling graph; remove constructor graph --- Command-Handling.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Command-Handling.md b/Command-Handling.md index 55c3e64..c9b0828 100644 --- a/Command-Handling.md +++ b/Command-Handling.md @@ -3,10 +3,11 @@ This page is a technical description of how the commands of AuthMe are registere ### Overview The following overview shows the most important players in the command handling process. -![Command handling overview](http://s1.postimg.org/95aukee3z/cmd_handling.png) +![Command handling overview](http://s33.postimg.org/t45b4jxbj/Untitled_Diagram.png) + ### Command registration -We use `CommandDescription` objects to define the commands available in AuthMe. These objects do not contain any logic of the command but contain all of the necessary information to invoke the command it describes: the labels to access the command (e.g. must use `/authme register` or `/authme reg`), the necessary number of arguments and a link to the actual command implementation. +We use `CommandDescription` objects to define the commands available in AuthMe. These objects do not contain any logic of the command but contain all of the necessary information to invoke the command it describes: the labels to access the command (e.g. must use `/authme register` or `/authme reg`), the necessary number of arguments and a reference to the actual command implementation. ### Mapping of incoming commands When a command is invoked, Bukkit (or Spigot) passes the information to the plugin with the arguments `String commandLabel, String[] args`. The Bukkit command label simply contains the first "word" of a command (e.g. `authme` in `/authme reload`) and the Bukkit arguments are the rest. @@ -25,9 +26,4 @@ If the permissions check is successful, the command can be invoked. Each command An `ExecutableCommand` instance may call further objects, typically for asynchronous processing when database calls are involved. In such cases, the `ExecutableCommand` typically does as much validation as necessary which doesn't require I/O operations (e.g. does the password confirmation match?, is the player online?) and then passes the data on to an async task which handles interactions with the database. -**Safe assumption:** Within an `ExecutableCommand`, it is safe to assume that all mandatory arguments defined in the corresponding command description(s) are present. The command handler will not execute a command if the argument count does not match. - -### Constructor graph -The following graph shows the dependencies of the command classes and in which order they are instantiated. - -![Command class constructor graph](http://s12.postimg.org/6unz23act/Untitled_Diagram_1_1_1_1.png) \ No newline at end of file +**Safe assumption:** Within an `ExecutableCommand`, it is safe to assume that all mandatory arguments defined in the corresponding command description(s) are present. The command handler will not execute a command if the argument count does not match. \ No newline at end of file From ae392c0dcfed915be617333c8860b88210e4aaeb Mon Sep 17 00:00:00 2001 From: ljacqu Date: Wed, 1 Jun 2016 23:19:07 +0200 Subject: [PATCH 049/139] Updated AuthMe Coding Styleguide (markdown) --- AuthMe-Coding-Styleguide.md | 43 +++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/AuthMe-Coding-Styleguide.md b/AuthMe-Coding-Styleguide.md index 6ff3670..c282659 100644 --- a/AuthMe-Coding-Styleguide.md +++ b/AuthMe-Coding-Styleguide.md @@ -1,4 +1,4 @@ -- Use indentation of four spaces +- Use indentation of four spaces (not tabs) - Always wrap structures like `if`, `while` with braces (never `if (isTrue) doThis();`) - Fields should not be public – use getters and setters where appropriate - Max line width: 120 characters @@ -7,19 +7,44 @@ As usual in Java: - Class names should be uppercase and in CamelCase - Names of methods, fields and variables in lowercase and camelCase -## JavaDoc -Use the imperative mood for verbs: "Get the player's name". JavaDoc should briefly explain what the method does and provide additional information to the developer. +## Exception handling +Do not "swallow" exceptions unless an exception is part of an expected scenario that is handled otherwise. Elsewhere you can log the exception with the `ConsoleLogger` easily: -Put an empty line between the description and the first `@param`, and between the last `@param` and `@return`. +```java +try { + Files.write(configFile, settings); +} catch (IOException e) { + ConsoleLogger.logException("Could not write to config file:", e); +} +``` + +This will output something like: `[WARN] Could not write to config file: [IOException] File is read-only` to the console and the log file. Logging exceptions tremendously helps debugging and helps detecting problems as they occur in the future. + +## Complexity +Try to create "bite-sized" elements: a method should do exactly one thing, and a class should solve one main problem. If too many things are done in one method too much brain power gets lost on understanding at what point you are in the method, and you lose a higher level overview that would allow you to find improvements or flaws in the logic. + +## Maintainability +Program for an audience – let others benefit from the effort you've spent in analyzing a problem by writing comments and JavaDoc for code that is not obvious: + +```java +// Schedule the task to run later so it doesn't interfere with the inventory process +scheduler.scheduleSyncTaskLater(new LoginTask()); +``` + +Similarly, create issues in the issue tracker for larger problems or improvements instead of just writing a TODO comment. TODO comments are guaranteed to get forgotten if they are not actively tended to. + +## JavaDoc +Use the third person ("Gets the player's name") or the imperative mood ("Get the player's name"); it should be consistent within a class. JavaDoc should briefly explain what the method does and provide additional information to the developer. + +Put an empty line between the description and the first `@param`. Example: ```java /** - * Add a permission node required to execute this command. + * Adds a permission node required to execute this command. * - * @param permissionNode The permission node to add. - * - * @return True on success, false on failure. + * @param permissionNode the permission node to add + * @return true on success, false on failure */ public boolean addPermissionNode(String permissionNode) -``` \ No newline at end of file +``` From 919d305df27a8929754b6fe0f82f1907fe69c458 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Wed, 1 Jun 2016 23:21:11 +0200 Subject: [PATCH 050/139] add mention of demo integration plugin --- Hooking-into-AuthMe.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Hooking-into-AuthMe.md b/Hooking-into-AuthMe.md index ab9ae57..45b4b45 100644 --- a/Hooking-into-AuthMe.md +++ b/Hooking-into-AuthMe.md @@ -12,4 +12,7 @@ The individual methods are described in the Javadoc (see link above). ### Events Before or after various actions, we throw an _Event_ you can listen to in your plugin. All AuthMe events extend the [CustomEvent class](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/fr/xephi/authme/events/CustomEvent.html). You can see a list of all events and their hierarchy [here](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/fr/xephi/authme/events/package-tree.html). All event classes are described with Javadoc. -Note that not all events can be canceled—only the ones extending Bukkit's `Cancellable` interface. \ No newline at end of file +Note that not all events can be canceled—only the ones extending Bukkit's `Cancellable` interface. + +### Demo Plugin +A functional plugin demonstrating AuthMe integration is hosted on the [ljacqu/AuthMe_demo_integration](https://github.com/ljacqu/AuthMe_integration_demo) repository. \ No newline at end of file From 49d1b7481580e12cfcaccc47e978109c834bc59f Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 12 Jun 2016 11:57:14 +0200 Subject: [PATCH 051/139] Change priority of "force spawn loc" and "teleport unauthed" --- Spawn-Handling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spawn-Handling.md b/Spawn-Handling.md index bc1e296..e3ea108 100644 --- a/Spawn-Handling.md +++ b/Spawn-Handling.md @@ -5,9 +5,9 @@ The following settings have an influence on the spawn feature, listed by priorit 1. `settings.restrictions.noTeleport` — if set to true, AuthMe will _never_ teleport players 1. `settings.restrictions.spawnPriority` — list of spawns to consider by priority (supported: authme, essentials, multiverse, default) -1. `settings.restrictions.teleportUnAuthedToSpawn` — if set to true, teleports players to spawn when they join. Once they log in, they are teleported back to their original location 1. `settings.restrictions.ForceSpawnLocOnJoin.enabled` — if set to true, players are teleported to spawn _after_ having logged in successfully 1. `settings.restrictions.ForceSpawnLocOnJoin.worlds` — limits the above feature only to the given worlds (case-sensitive) +1. `settings.restrictions.teleportUnAuthedToSpawn` — if set to true, teleports players to spawn when they join. Once they log in, they are teleported back to their original location -- Related: `settings.restrictions.SaveQuitLocation` must be true for the quit location to be saved From f59a4a8c42093e0e3af6fd395f70ae960b9eedcb Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Thu, 16 Jun 2016 19:42:33 +0200 Subject: [PATCH 052/139] Updated Home (markdown) --- Home.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Home.md b/Home.md index c9040a0..892d8c7 100644 --- a/Home.md +++ b/Home.md @@ -3,7 +3,7 @@ Welcome to the AuthMeReloaded wiki! If you are using AuthMe on your server, the following pages might be of interest to you: - [AuthMe releases (Jenkins)](https://github.com/AuthMe-Team/AuthMeReloaded/wiki/AuthMe-Releases-(Jenkins)) – how to get the latest version of AuthMe - [Breaking changes](https://github.com/AuthMe-Team/AuthMeReloaded/wiki/Breaking-Changes) -- [Permission nodes](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md) +- [Permission nodes](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/docs/permission_nodes.md) - ["please-verify" on issues](https://github.com/AuthMe-Team/AuthMeReloaded/wiki/'please-verify'-Label) The remaining Wiki pages are aimed at developers. From 5cca8863f594bb70e533aed8ace4885fba64f5c7 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 19 Jun 2016 15:57:25 +0200 Subject: [PATCH 053/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 23aeeaf..74abff0 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2016-06-19](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e1d697d386a1cd94fd09a02654cd7d9eaf854cfe)) | Allowed nickname regex pattern now case-sensitive 5.2 ([2016-05-29](https://github.com/AuthMe-Team/AuthMeReloaded/commit/52c0c7dd640217572d32587237abedb9cc35fca3)) | "Allow all commands if registration is optional" feature dropped 5.2 ([2016-05-03](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0ea95fb93c5b8408d6cb34c8de381dbce06060d5)) | Force spawn settings are grouped together (settings should migrate automatically) 5.2 ([2016-02-19](https://github.com/AuthMe-Team/AuthMeReloaded/commit/715622826f1e67ec50c63fadab90ffdbef1c468f)) | Command /converter has been moved to /authme converter From 3567211ffbd130dc53a7e962c1dc1d9f0571aef4 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 19 Jun 2016 21:47:55 +0200 Subject: [PATCH 054/139] add spawn handling to page list --- Home.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Home.md b/Home.md index 892d8c7..33b900e 100644 --- a/Home.md +++ b/Home.md @@ -4,6 +4,7 @@ If you are using AuthMe on your server, the following pages might be of interest - [AuthMe releases (Jenkins)](https://github.com/AuthMe-Team/AuthMeReloaded/wiki/AuthMe-Releases-(Jenkins)) – how to get the latest version of AuthMe - [Breaking changes](https://github.com/AuthMe-Team/AuthMeReloaded/wiki/Breaking-Changes) - [Permission nodes](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/docs/permission_nodes.md) +- [Spawn handling](https://github.com/AuthMe-Team/AuthMeReloaded/wiki/Spawn-Handling) (how AuthMe teleports users) - ["please-verify" on issues](https://github.com/AuthMe-Team/AuthMeReloaded/wiki/'please-verify'-Label) The remaining Wiki pages are aimed at developers. From 675023cbfc5111fa5a27a7d1aa42ab19df2bed19 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 19 Jun 2016 21:50:02 +0200 Subject: [PATCH 055/139] Updated Spawn Handling (markdown) --- Spawn-Handling.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spawn-Handling.md b/Spawn-Handling.md index e3ea108..2e8f16f 100644 --- a/Spawn-Handling.md +++ b/Spawn-Handling.md @@ -10,7 +10,7 @@ The following settings have an influence on the spawn feature, listed by priorit 1. `settings.restrictions.teleportUnAuthedToSpawn` — if set to true, teleports players to spawn when they join. Once they log in, they are teleported back to their original location -- -Related: `settings.restrictions.SaveQuitLocation` must be true for the quit location to be saved +Related: `settings.restrictions.SaveQuitLocation` must be true for the quit location to be saved in the database. If `false`, players are teleported back to the location in which they would have joined without changes from AuthMe. ## Spawn Priority Spawn priority is defined in `settings.restrictions.spawnPriority` (see above), i.e. this setting defines from where the spawn definition should be taken. Possible values: @@ -46,7 +46,7 @@ firstspawn: pitch: 11.849992 ``` -Players who have never played on the server before are teleported to the **firstspawn**; otherwise they are teleported to the regular **spawn**. You can delete the `firstspawn` section to disable the feature. +Players who have never played on the server before are teleported to the **firstspawn**; otherwise they are teleported to the regular spawnpoint as defined by the spawn priority. You can delete the `firstspawn` section to disable this feature. ## AuthMe Spawn Commands - `/authme spawn` teleports you to the AuthMe spawn point From 0fc5c98717b2469d7e83981a8d74dee4c3272532 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 25 Jun 2016 08:27:22 +0200 Subject: [PATCH 056/139] Initial setup page - intelliJ --- Development-Setup.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Development-Setup.md diff --git a/Development-Setup.md b/Development-Setup.md new file mode 100644 index 0000000..b34d45e --- /dev/null +++ b/Development-Setup.md @@ -0,0 +1,16 @@ +Some tips and recommendations for people who want to work on AuthMe. + +# IntelliJ +- Make sure you are running idea**64**.exe if on a 64-bit operating system (faster). + +- Maven: if asked to enable auto-import, select it. This will update your dependencies automatically when they are changed in the pom.xml + +- If `@Inject` fields are marked with the "never declared" warning, go to Settings > search "unused declaration," select the Java one and press the button "Configure annotations." Add `@Inject` and `@InjectDelayed`. + +- Make issue numbers in commit messages clickable by going to Settings > search "issue navigation", add a new rule: +``` +Issue ID: #(\d+) +Issue link: https://github.com/Xephi/AuthMeReloaded/issues/$1 +``` + +- Cannot run unit tests? Something about missing argLine? Go to settings > search "Running Tests" and uncheck "argLine" \ No newline at end of file From be3d1769df922eeb2b86b50096a194390e090b37 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 25 Jun 2016 09:04:20 +0200 Subject: [PATCH 057/139] Add fork section + debug link --- Development-Setup.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Development-Setup.md b/Development-Setup.md index b34d45e..c246daa 100644 --- a/Development-Setup.md +++ b/Development-Setup.md @@ -13,4 +13,15 @@ Issue ID: #(\d+) Issue link: https://github.com/Xephi/AuthMeReloaded/issues/$1 ``` -- Cannot run unit tests? Something about missing argLine? Go to settings > search "Running Tests" and uncheck "argLine" \ No newline at end of file +- Do you get an error message "missing argLine" when trying to run unit tests? Go to settings > search "Running Tests" and uncheck "argLine" + +# Forking AuthMe +- Please fork the [AuthMe-Team/AuthMeReloaded](https://github.com/AuthMe-Team/AuthMeReloaded) repo, NOT the one under Xephi's name. The AuthMe-Team repo is sometimes hundreds of commits ahead. + +- Tip: add the AuthMe-Team repository to Git. Execute in console: `git remote add upstream https://github.com/AuthMe-Team/AuthMeReloaded.git`. In IntelliJ use Ctrl+Shift+A > "fetch" and you will see the branches of your repository as well as of the AuthMe-Team. + +- Do not commit _any_ changes to your master. Use it only to keep in sync with the upstream repo. This way you can always pull new changes from the parent repo into your local master without any conflicts. Then you can merge your local master with your custom branches to keep them up to date. + - If you commit changes to your fork's master directly, you will generate a merge commit every time you pull new changes from AuthMe-Team/AuthMeReloaded into your local master. This creates unnecessary noise in the Git history and generates ugly pull requests. + +# Debugging AuthMe in IntelliJ +See _[Run Configuration to Debug Bukkit/Minecraft Plugin in IntelliJ IDEA](http://stackoverflow.com/a/29945539)_ on StackOverflow. \ No newline at end of file From c2009e3371ac979ec26aa09b0749d2e40e1406c4 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 25 Jun 2016 09:06:34 +0200 Subject: [PATCH 058/139] Updated Development Setup (markdown) --- Development-Setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Development-Setup.md b/Development-Setup.md index c246daa..73367ce 100644 --- a/Development-Setup.md +++ b/Development-Setup.md @@ -7,7 +7,7 @@ Some tips and recommendations for people who want to work on AuthMe. - If `@Inject` fields are marked with the "never declared" warning, go to Settings > search "unused declaration," select the Java one and press the button "Configure annotations." Add `@Inject` and `@InjectDelayed`. -- Make issue numbers in commit messages clickable by going to Settings > search "issue navigation", add a new rule: +- You can make issue numbers in commit messages clickable by going to Settings > search "issue navigation", add a new rule: ``` Issue ID: #(\d+) Issue link: https://github.com/Xephi/AuthMeReloaded/issues/$1 From 7ae43790ebfa115568b13f35ebfd8ae431268b47 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 27 Jun 2016 20:27:49 +0200 Subject: [PATCH 059/139] Created Build History (markdown) --- Build-History.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Build-History.md diff --git a/Build-History.md b/Build-History.md new file mode 100644 index 0000000..79a937d --- /dev/null +++ b/Build-History.md @@ -0,0 +1,8 @@ +History of build numbers and the commit that initiated the build on [Jenkins](http://ci.xephi.fr/job/AuthMeReloaded/), for future reference. + + +Build nr. | Commit +--------- | -------------- +1150 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/74095fec710acccec9b0aeaeb8a581dd53194322 +1140 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/c79857cc14e0630feea5d42d8a9eb0e46d8f547e +1130 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/5cbb83e15337a2c88ce4cdb52878f8e64f605ec6 \ No newline at end of file From 142abf2a194d7899ce0dfc9c5c5108ad2165058f Mon Sep 17 00:00:00 2001 From: ljacqu Date: Fri, 1 Jul 2016 18:27:27 +0200 Subject: [PATCH 060/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index 79a937d..500be7b 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1160 | https://github.com/AuthMe-Team/AuthMeReloaded/commit/23836cda6aaff3bd7300f34e00bec2eae42047a5 1150 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/74095fec710acccec9b0aeaeb8a581dd53194322 1140 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/c79857cc14e0630feea5d42d8a9eb0e46d8f547e 1130 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/5cbb83e15337a2c88ce4cdb52878f8e64f605ec6 \ No newline at end of file From 7672498cec53d9c7f483f40e78857e4a7f383058 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 2 Jul 2016 10:28:28 +0200 Subject: [PATCH 061/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index 500be7b..77c4791 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1170 | https://github.com/AuthMe-Team/AuthMeReloaded/commit/de3f3a42ab96a814feb32703df0fd4538861db42 1160 | https://github.com/AuthMe-Team/AuthMeReloaded/commit/23836cda6aaff3bd7300f34e00bec2eae42047a5 1150 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/74095fec710acccec9b0aeaeb8a581dd53194322 1140 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/c79857cc14e0630feea5d42d8a9eb0e46d8f547e From 180b8e144e274c79436b72da3cd40b0a5b48044b Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 3 Jul 2016 14:15:24 +0200 Subject: [PATCH 062/139] Add info + screenshot on including dependencies into JAR for debugging in IntelliJ --- Development-Setup.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Development-Setup.md b/Development-Setup.md index 73367ce..96ace24 100644 --- a/Development-Setup.md +++ b/Development-Setup.md @@ -24,4 +24,8 @@ Issue link: https://github.com/Xephi/AuthMeReloaded/issues/$1 - If you commit changes to your fork's master directly, you will generate a merge commit every time you pull new changes from AuthMe-Team/AuthMeReloaded into your local master. This creates unnecessary noise in the Git history and generates ugly pull requests. # Debugging AuthMe in IntelliJ -See _[Run Configuration to Debug Bukkit/Minecraft Plugin in IntelliJ IDEA](http://stackoverflow.com/a/29945539)_ on StackOverflow. \ No newline at end of file +See _[Run Configuration to Debug Bukkit/Minecraft Plugin in IntelliJ IDEA](http://stackoverflow.com/a/29945539)_ on StackOverflow. + +If you get `ClassDefNotFoundError`, make sure you extract all dependencies into the JAR. Right-click the dependencies on the right and select "Extract Into Output Root." Then move them inside the JAR file. + +![Screenshot dependencies setup](http://jalu.ch/ext/authme-docs/intellij_extracted_dependencies.png) \ No newline at end of file From 47fc6fe9fefb501cad28581aae6b63351e3917bc Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 3 Jul 2016 20:00:06 +0200 Subject: [PATCH 063/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index 77c4791..41fc3f3 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1180 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/8f5817883ea3fcc5b4b02e8636f83652e9453b7c 1170 | https://github.com/AuthMe-Team/AuthMeReloaded/commit/de3f3a42ab96a814feb32703df0fd4538861db42 1160 | https://github.com/AuthMe-Team/AuthMeReloaded/commit/23836cda6aaff3bd7300f34e00bec2eae42047a5 1150 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/74095fec710acccec9b0aeaeb8a581dd53194322 From 46c34ec911bcda2e46d73ad3ddcca99697189ced Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 3 Jul 2016 22:21:31 +0200 Subject: [PATCH 064/139] Created Auth events (markdown) --- Auth-events.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Auth-events.md diff --git a/Auth-events.md b/Auth-events.md new file mode 100644 index 0000000..96bdda9 --- /dev/null +++ b/Auth-events.md @@ -0,0 +1,34 @@ +List of events, happenings that are relevant for AuthMe. + + +## Join event +**Description:** Player connects to the server + +**Possible origin:** Player literally joins the server, bungeecord :question: + +**Activities:** Checks: valid name, antibot, kick for unregistered, account restriction, account unrestriction, name casing if registered, country, single session, if full & vip; create PlayerData object. Apply blind effect. Teleport to spawn / firstspawn. Hide inventory. + +## Register event +**Description:** Player issues a valid /register command + +**Possible origin:** /register or /authme register, API call + +**Activities:** Check password/email confirmation, check valid & allowed password/email. Register account. Log in if configured or send mail. Kick if configured / admin-registered. + +## Login event +**Description:** A request to log in a user + +**Possible origin:** /login, /authme forcelogin, active session (forwarded from join event), API call + +**Activities:** If not forced: check credentials against database / failed login -> captcha, temp ban manager. If successful: perform teleportation, restore PlayerData info, restore inventory. + +## Unregister event + +## Logout event + +## Quit event +**Description:** player quits the server + +**Possible origin:** Player literally exits the server, Bungeecord :question: + +**Activities:** Restore player properties from PlayerData \ No newline at end of file From 0e106ba18d8e6fdb565278f17fa32e2a67cb68be Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 10 Jul 2016 13:09:15 +0200 Subject: [PATCH 065/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index 41fc3f3..cdb810b 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1190 | http://github.com/AuthMe/AuthMeReloaded/commit/faddb3ffac0a64d8f82d41361e2c3d1dc537ed5a 1180 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/8f5817883ea3fcc5b4b02e8636f83652e9453b7c 1170 | https://github.com/AuthMe-Team/AuthMeReloaded/commit/de3f3a42ab96a814feb32703df0fd4538861db42 1160 | https://github.com/AuthMe-Team/AuthMeReloaded/commit/23836cda6aaff3bd7300f34e00bec2eae42047a5 From 5ee0c1ee6c6d4088f0859219a5a94b7a6d7ebc24 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 10 Jul 2016 13:15:55 +0200 Subject: [PATCH 066/139] Updated Build History (markdown) --- Build-History.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Build-History.md b/Build-History.md index cdb810b..ec1dee5 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,10 +3,14 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- -1190 | http://github.com/AuthMe/AuthMeReloaded/commit/faddb3ffac0a64d8f82d41361e2c3d1dc537ed5a -1180 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/8f5817883ea3fcc5b4b02e8636f83652e9453b7c -1170 | https://github.com/AuthMe-Team/AuthMeReloaded/commit/de3f3a42ab96a814feb32703df0fd4538861db42 -1160 | https://github.com/AuthMe-Team/AuthMeReloaded/commit/23836cda6aaff3bd7300f34e00bec2eae42047a5 -1150 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/74095fec710acccec9b0aeaeb8a581dd53194322 -1140 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/c79857cc14e0630feea5d42d8a9eb0e46d8f547e -1130 | http://github.com/AuthMe-Team/AuthMeReloaded/commit/5cbb83e15337a2c88ce4cdb52878f8e64f605ec6 \ No newline at end of file +1190 | [faddb3f](http://github.com/AuthMe/AuthMeReloaded/commit/faddb3ffac0a64d8f82d41361e2c3d1dc537ed5a) +1180 | [8f58178](http://github.com/AuthMe/AuthMeReloaded/commit/8f5817883ea3fcc5b4b02e8636f83652e9453b7c) +1170 | [de3f3a4](https://github.com/AuthMe/AuthMeReloaded/commit/de3f3a42ab96a814feb32703df0fd4538861db42) +1160 | [23836cd](https://github.com/AuthMe/AuthMeReloaded/commit/23836cda6aaff3bd7300f34e00bec2eae42047a5) +1150 | [74095fe](http://github.com/AuthMe/AuthMeReloaded/commit/74095fec710acccec9b0aeaeb8a581dd53194322) +1140 | [c79857c](http://github.com/AuthMe/AuthMeReloaded/commit/c79857cc14e0630feea5d42d8a9eb0e46d8f547e) +1130 | [5cbb83e](http://github.com/AuthMe/AuthMeReloaded/commit/5cbb83e15337a2c88ce4cdb52878f8e64f605ec6) + +Regex replacement for link (Notepad++): +- Find: ` (https?://.*?AuthMeReloaded/commit/([0-9a-f]{7})[0-9a-f]{33})` +- Replace: ` [\2]\(\1\)` \ No newline at end of file From e8616b0df4c4b3438b876997afe6e657826385fc Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 11 Jul 2016 21:32:48 +0200 Subject: [PATCH 067/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index ec1dee5..8764048 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1200 | http://github.com/AuthMe/AuthMeReloaded/commit/8d54557f3d45fac0d92e036b7feb24748df24693 1190 | [faddb3f](http://github.com/AuthMe/AuthMeReloaded/commit/faddb3ffac0a64d8f82d41361e2c3d1dc537ed5a) 1180 | [8f58178](http://github.com/AuthMe/AuthMeReloaded/commit/8f5817883ea3fcc5b4b02e8636f83652e9453b7c) 1170 | [de3f3a4](https://github.com/AuthMe/AuthMeReloaded/commit/de3f3a42ab96a814feb32703df0fd4538861db42) From c3aa67e43a8be4eb2d2e0de53893ac9a2c1b56ae Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Mon, 11 Jul 2016 21:42:44 +0200 Subject: [PATCH 068/139] Updated Build History (markdown) --- Build-History.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Build-History.md b/Build-History.md index 8764048..f0d22fe 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,14 +3,14 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- -1200 | http://github.com/AuthMe/AuthMeReloaded/commit/8d54557f3d45fac0d92e036b7feb24748df24693 -1190 | [faddb3f](http://github.com/AuthMe/AuthMeReloaded/commit/faddb3ffac0a64d8f82d41361e2c3d1dc537ed5a) -1180 | [8f58178](http://github.com/AuthMe/AuthMeReloaded/commit/8f5817883ea3fcc5b4b02e8636f83652e9453b7c) +1200 | [8d54557](https://github.com/AuthMe/AuthMeReloaded/commit/8d54557f3d45fac0d92e036b7feb24748df24693) +1190 | [faddb3f](https://github.com/AuthMe/AuthMeReloaded/commit/faddb3ffac0a64d8f82d41361e2c3d1dc537ed5a) +1180 | [8f58178](https://github.com/AuthMe/AuthMeReloaded/commit/8f5817883ea3fcc5b4b02e8636f83652e9453b7c) 1170 | [de3f3a4](https://github.com/AuthMe/AuthMeReloaded/commit/de3f3a42ab96a814feb32703df0fd4538861db42) 1160 | [23836cd](https://github.com/AuthMe/AuthMeReloaded/commit/23836cda6aaff3bd7300f34e00bec2eae42047a5) -1150 | [74095fe](http://github.com/AuthMe/AuthMeReloaded/commit/74095fec710acccec9b0aeaeb8a581dd53194322) -1140 | [c79857c](http://github.com/AuthMe/AuthMeReloaded/commit/c79857cc14e0630feea5d42d8a9eb0e46d8f547e) -1130 | [5cbb83e](http://github.com/AuthMe/AuthMeReloaded/commit/5cbb83e15337a2c88ce4cdb52878f8e64f605ec6) +1150 | [74095fe](https://github.com/AuthMe/AuthMeReloaded/commit/74095fec710acccec9b0aeaeb8a581dd53194322) +1140 | [c79857c](https://github.com/AuthMe/AuthMeReloaded/commit/c79857cc14e0630feea5d42d8a9eb0e46d8f547e) +1130 | [5cbb83e](https://github.com/AuthMe/AuthMeReloaded/commit/5cbb83e15337a2c88ce4cdb52878f8e64f605ec6) Regex replacement for link (Notepad++): - Find: ` (https?://.*?AuthMeReloaded/commit/([0-9a-f]{7})[0-9a-f]{33})` From dd10dcd00ae484bb9604c885a2b4736f3cc2e86b Mon Sep 17 00:00:00 2001 From: ljacqu Date: Fri, 15 Jul 2016 17:48:57 +0200 Subject: [PATCH 069/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index f0d22fe..bc39f44 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1210 | [724de1e](https://github.com/AuthMe/AuthMeReloaded/commit/724de1e1210ed6710efa0ff40c4dcd567ee6ef1b) 1200 | [8d54557](https://github.com/AuthMe/AuthMeReloaded/commit/8d54557f3d45fac0d92e036b7feb24748df24693) 1190 | [faddb3f](https://github.com/AuthMe/AuthMeReloaded/commit/faddb3ffac0a64d8f82d41361e2c3d1dc537ed5a) 1180 | [8f58178](https://github.com/AuthMe/AuthMeReloaded/commit/8f5817883ea3fcc5b4b02e8636f83652e9453b7c) From b54eed3ebe539e96f134f5c098a569c121765afb Mon Sep 17 00:00:00 2001 From: ljacqu Date: Wed, 20 Jul 2016 17:56:56 +0200 Subject: [PATCH 070/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index bc39f44..28ff422 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1220 | http://github.com/AuthMe/AuthMeReloaded/commit/674a051586d3b71f5b32f5dc5a4117d7fb0ff057 1210 | [724de1e](https://github.com/AuthMe/AuthMeReloaded/commit/724de1e1210ed6710efa0ff40c4dcd567ee6ef1b) 1200 | [8d54557](https://github.com/AuthMe/AuthMeReloaded/commit/8d54557f3d45fac0d92e036b7feb24748df24693) 1190 | [faddb3f](https://github.com/AuthMe/AuthMeReloaded/commit/faddb3ffac0a64d8f82d41361e2c3d1dc537ed5a) From 5b98321d6c7b65362eff7d4f6e77ba73ff6c2346 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Wed, 20 Jul 2016 22:41:22 +0200 Subject: [PATCH 071/139] Rewrite to consider purpose + use cases more --- Dependency-Injection.md | 114 ++++++++++++++++++++++++++++++ Dependency-Injector.md | 150 ---------------------------------------- 2 files changed, 114 insertions(+), 150 deletions(-) create mode 100644 Dependency-Injection.md delete mode 100644 Dependency-Injector.md diff --git a/Dependency-Injection.md b/Dependency-Injection.md new file mode 100644 index 0000000..ea9f3b6 --- /dev/null +++ b/Dependency-Injection.md @@ -0,0 +1,114 @@ +This page contains some details about the purpose of the `@Inject` annotations in AuthMe and how to use them. + +# Purpose +`@Inject` allows us to use inversion of control more easily. + +## Inversion of control +In a nutshell, inversion of control means that we _pass_ the services a class needs from the outside, instead of having the class instantiate or find (`getInstance()`) the service itself. This renders dependencies explicit (we are more aware of our service's dependencies), makes it easier to switch out a component in the future and facilitates unit testing. + +### Example +Consider the following class: +```java +public class MessageTask { + + public void setTask(String name) { + if (PlayerCache.getInstance().isAuthenticated(name) && LimboCache.getInstance().hasLimboPlayer(name)) { + LimboCache.getInstance().getLimboPlayer(name).initMessageTask(); + } + } +} +``` + +Applying inversion of control, the class could look as follows: +```java +public class MessageTask { + + private final PlayerCache playerCache; + private final LimboCache limboCache; + + public MessageTask(PlayerCache playerCache, LimboCache limboCache) { + this.playerCache = playerCache; + this.limboCache = limboCache; + } + + public void setTask(String name) { + if (playerCache.isAuthenticated(name) && limboCache.hasLimboPlayer(name)) { + limboCache.getLimboPlayer(name).initMessageTask(); + } + } +} +``` + +With the second version, we immediately see that `MessageTask` needs a `LimboCache` and `PlayerCache` instance. We can easily test the class by passing mock implementations, whereas in the first version we do not have the possibility to switch the implementation. + +## Dependency injection +### Without dependency injection +One disadvantage with the "inversion of control" variant in the above code is that initializing the class becomes more difficult as we have to explicitly know about its dependencies (and in turn, of _their_ dependencies). Consider the following code: + +```java + private CommandHandler initializeCommandHandler(PermissionsManager permissionsManager, Messages messages, + PasswordSecurity passwordSecurity, NewSetting settings) { + HelpProvider helpProvider = new HelpProvider(permissionsManager, settings.getProperty(HELP_HEADER)); + Set baseCommands = CommandInitializer.buildCommands(); + CommandMapper mapper = new CommandMapper(baseCommands, permissionsManager); + CommandService commandService = new CommandService( + this, mapper, helpProvider, messages, passwordSecurity, permissionsManager, settings); + return new CommandHandler(commandService); +} +``` +We want to instantiate a `CommandHandler`. We need to pass a `CommandService` to it, so we need to initialize this first. However, it requires a `CommandMapper`, a `HelpProvider`... and so forth. This forces us to deal with tons of classes (CommandService, CommandMapper, etc.) we do not care about directly—we just want to get a `CommandHandler`. + +### Purpose of dependency injection +Dependency injection allows us to avoid huge initialization blocks by _injecting_ dependencies for us. We can simply request a class from the injector: +```java +CommandHandler handler = injector.getSingleton(CommandHandler.class); +``` +The injector will scan the CommandHandler class for its dependencies, instantiate them and pass them to the class _for us_. Basically, it does the big code chunk from above for us automatically. We need to help the injector a little bit by annotating the dependencies with `@Inject` in order to tell the injector what to inject. + +# Injection methods +Dependencies can be passed to a class in different ways. It is important to only use one form per class. + +## Constructor injection +A constructor can be annotated with `@Inject`. This tells the injector that the parameters of that constructor need to be injected. Consider the `MessageTask` class from the first example. We only need to add an annotation to enable constructor injection: + +```java +public class MessageTask { + + private final PlayerCache playerCache; + private final LimboCache limboCache; + + @Inject + MessageTask(PlayerCache playerCache, LimboCache limboCache) { + this.playerCache = playerCache; + this.limboCache = limboCache; + } + + public void setTask(String name) { + if (playerCache.isAuthenticated(name) && limboCache.hasLimboPlayer(name)) { + limboCache.getLimboPlayer(name).initMessageTask(); + } + } +} +``` + +Now a MessageTask singleton can be gotten via `injector.getSingleton(MessageTask.class)`. The injector will notice that `PlayerCache` and `LimboCache` are required and will pass them to the constructor. + +## Field injection +Alternatively, fields can be annotated with `@Inject`: + +```java +public class MessageTask { + + @Inject + private PlayerCache playerCache; + @Inject + private LimboCache limboCache; + + public void setTask(String name) { + if (playerCache.isAuthenticated(name) && limboCache.hasLimboPlayer(name)) { + limboCache.getLimboPlayer(name).initMessageTask(); + } + } +} +``` +Again, the injector will see the annotations on the fields and will set the fields. The fields can be `private` or have any other visibility. Field injection requires a no-arg constructor to be present. \ No newline at end of file diff --git a/Dependency-Injector.md b/Dependency-Injector.md deleted file mode 100644 index 564f12b..0000000 --- a/Dependency-Injector.md +++ /dev/null @@ -1,150 +0,0 @@ -This page contains some details about the AuthMe injector used to automatically instantiate classes while satisfying their dependency. - -## What it does - -To instantiate a class, we need to satisfy the class' constructor parameters. Consider the `SampleCommand` class below—it requires `UserService` and `PermissionsManager`: - -```java -public class SampleCommand { - - public SampleCommand(UserService userService, PermissionsManager permissionsManager) { - // do something with the parameters - } - -} -``` - -To create a `SampleCommand` instance, we need to locate the instance of `UserService` and `PermissionsManager` and pass them along: - -```java -SampleCommand cmd = new SampleCommand(userService, permissionsManager); -``` - -As the application grows, the number of classes and their dependencies increases and we end up with large chunks of code for initializing all classes of interest. - - -A dependency **injector** takes care of this for us. It detects the dependencies of a class at runtime and invokes the constructor for us: - -```java -AuthMeServiceInitializer initializer; // ... -SampleCommand command = initializer.newInstance(SampleCommand.class); -``` - -This way, we easily get an instance of the class we want and we don't have to worry about its dependencies (such as `UserService`) if we don't care about them directly. - -## How it works - -Classes whose dependencies can be injected are denoted with the `@Inject` (see [JSR-330 annotations](http://atinject.googlecode.com/svn/tags/1/javadoc/javax/inject/package-summary.html)). So, for example, SampleCommand can be annotated the following way: - -```java -public class SampleCommand { - - @Inject - public SampleCommand(UserService userService, PermissionsManager permissionsManager) { - // do something with the parameters - } - -} -``` - -Then, when invoking `initializer.newInstance(SampleCommand.class)`, the initializer looks for `@Inject`, reads the dependencies (i.e. `UserService`, `PermissionsManager`) and supplies them. Either it has already instantiated these classes and just passes the instance on, or it will instantiate these dependencies as well, using the same principle again (find what is annotated with `@Inject` and try to supply them). - -## Injection methods - -There are three possibilities to instantiate a class with the AuthMe injector. - -### Constructor injection -As seen above with `SampleCommand`, a constructor can be annotated with `@Inject`, telling the injector to invoke this constructor with the given dependencies. There may be multiple constructors but only one with `@Inject`. The inject constructor may have any visibility (including private). - -### Field injection -Alternatively, the fields of a class that should be injected can be annotated with `@Inject`: - -```java -public class SampleCommand { - - @Inject - private UserService userService; - @Inject - private PermissionsManager permissionsManager; - -} -``` - -Field injection requires that the class have a no-arguments constructor of any visibility (including private). The fields may have any visibility. There may be other fields without `@Inject`; they will simply be ignored by the injector. - -### Instantiation fallback - -As a fallback to make things running smoothly and avoid unnecessary empty constructors with `@Inject`, the injector also instantiates classes that have a no-arg constructor and no `@Inject` fields. :warning: Unlike the injection methods, the constructor must be public for this fallback! - -### Method injection - -:warning: Not supported. - -## Scopes - -The AuthMe injector supports two scopes. :warning: Unlike the JSR-330 standard, the scope defaults to singleton. - -### Singleton - -When classes are instantiated in singleton scopes, the injector keeps track of the instance and will always re-use it. You can get instances in the singleton scope using the [get(Class)](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/fr/xephi/authme/initialization/AuthMeServiceInitializer.html#get-java.lang.Class-) method. In other words, invoking `initializer.get(Service.class)` multiple times will always return the same instance of the `Service` class. - -### Request - -The method [newInstance(Class)](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/fr/xephi/authme/initialization/AuthMeServiceInitializer.html#newInstance-java.lang.Class-) creates a new instance of the given class for each call. It also does not keep track of the instance, i.e. it creates a new instance, returns it and forgets about it. - -:warning: Note that all dependencies passed to the class are in singleton scope, e.g. calling `initializer.newInstance(SampleCommand.class)` repeatedly will always return a new instance of SampleCommand, but it will always receive the same `UserService` and `PermissionsManager` instance as dependency. - - - -## Providing custom instances - -You may want to provide some instances to the injector, e.g. classes you want to instantiate manually or certain parameter values, such as a `File` for the plugin folder. This can be done in two ways. - -### Registering an instance for a class - -After creating an `AuthMeServiceInitializer` instance, you can register an instance for the given class: - -```java -DataSource ds = initializeDataSource(); - -AuthMeServiceInitializer initializer; -initializer.register(DataSource.class, ds); -initializer.register(SomeService.class, someInstance); -``` - -The registered instances will be passed on to any classes with such dependencies. :warning: For dependencies on interfaces, it is important to provide an instance this way because the injector cannot deal with superclasses. So e.g. DataSource, which is an interface, _must_ be provided explicitly to the initializer or it won't be able to locate a DataSource instance. - -### Denote values by annotations - -Instances/values can also be identified with an annotation. This is the better approach for general classes or values (e.g. config values, environment properties) and allows us to distinguish multiple implementations of the same class (e.g. `File`) even in singleton scope: - -```java -@Retention(RUNTIME) // Do not forget to set retention to RUNTIME -public @interface PluginFolder { -} -``` - -A class which wants to get this `@PluginFolder` value as a dependency then also specifies the annotation either on the field or on the constructor parameter: - -```java -public class FolderManager { - @Inject - @PluginFolder - private File pluginFolder; - - // Or: public FolderManager(@PluginFolder file pluginFolder) { } -} -``` - -Register the value of the annotation with the initializer's [provide(Class, Object)](http://ci.xephi.fr/job/AuthMeReloaded/javadoc/) method: - -```java -AuthMeServiceInitializer initializer; -initializer.provide(PluginFolder.class, new File("/plugins")); - -FolderManager mgr = initializer.get(FolderManager.class); -``` - -### @Qualifier, @Named - -:warning: Not supported—create a custom annotation. \ No newline at end of file From b2f99a3c81a489b29eaaa0486834100da6870552 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Fri, 22 Jul 2016 22:51:34 +0200 Subject: [PATCH 072/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index 28ff422..ecf7688 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1230 | http://github.com/AuthMe/AuthMeReloaded/commit/0eb1890cf9f06eb4a2410bcd2f65ef150a76ac92 1220 | http://github.com/AuthMe/AuthMeReloaded/commit/674a051586d3b71f5b32f5dc5a4117d7fb0ff057 1210 | [724de1e](https://github.com/AuthMe/AuthMeReloaded/commit/724de1e1210ed6710efa0ff40c4dcd567ee6ef1b) 1200 | [8d54557](https://github.com/AuthMe/AuthMeReloaded/commit/8d54557f3d45fac0d92e036b7feb24748df24693) From 202d42ce47ee0ab607cd92973f2a4c8f2157b83e Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 23 Jul 2016 09:11:43 +0200 Subject: [PATCH 073/139] Created Plugins hooking into AuthMe (markdown) --- Plugins-hooking-into-AuthMe.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Plugins-hooking-into-AuthMe.md diff --git a/Plugins-hooking-into-AuthMe.md b/Plugins-hooking-into-AuthMe.md new file mode 100644 index 0000000..ef63ea4 --- /dev/null +++ b/Plugins-hooking-into-AuthMe.md @@ -0,0 +1,4 @@ +Plugin | Source code +----------- | --------- +ChatGuard | [Github](https://github.com/DenAbr/ChatGuard/tree/master/src/ru/Den_Abr/ChatGuard/Integration) +DungeonMaze | [Github](https://github.com/timvisee/DungeonMaze/tree/master/src/main/java/com/timvisee/dungeonmaze/plugin/authmereloaded) \ No newline at end of file From 902f97a388d203097658fa8f62428acf80e4f694 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Wed, 3 Aug 2016 20:20:36 +0200 Subject: [PATCH 074/139] Updated Build History (markdown) --- Build-History.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Build-History.md b/Build-History.md index ecf7688..2da9576 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,8 +3,10 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- -1230 | http://github.com/AuthMe/AuthMeReloaded/commit/0eb1890cf9f06eb4a2410bcd2f65ef150a76ac92 -1220 | http://github.com/AuthMe/AuthMeReloaded/commit/674a051586d3b71f5b32f5dc5a4117d7fb0ff057 +1250 | [80337f7](https://github.com/AuthMe/AuthMeReloaded/commit/80337f758b234c28af14e32fe1b33cc9eb3f8e8a) +1240 | [7fc1953](https://github.com/AuthMe/AuthMeReloaded/commit/7fc195336f9afde3f1baf4ca97eb94d4ad02c752) +1230 | [0eb1890](https://github.com/AuthMe/AuthMeReloaded/commit/0eb1890cf9f06eb4a2410bcd2f65ef150a76ac92) +1220 | [674a051](https://github.com/AuthMe/AuthMeReloaded/commit/674a051586d3b71f5b32f5dc5a4117d7fb0ff057) 1210 | [724de1e](https://github.com/AuthMe/AuthMeReloaded/commit/724de1e1210ed6710efa0ff40c4dcd567ee6ef1b) 1200 | [8d54557](https://github.com/AuthMe/AuthMeReloaded/commit/8d54557f3d45fac0d92e036b7feb24748df24693) 1190 | [faddb3f](https://github.com/AuthMe/AuthMeReloaded/commit/faddb3ffac0a64d8f82d41361e2c3d1dc537ed5a) From 8b0e46714592c658c23677ba11e19ee32f553d94 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Fri, 5 Aug 2016 19:37:08 +0200 Subject: [PATCH 075/139] Updated Dependency Injection (markdown) --- Dependency-Injection.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dependency-Injection.md b/Dependency-Injection.md index ea9f3b6..d71af24 100644 --- a/Dependency-Injection.md +++ b/Dependency-Injection.md @@ -111,4 +111,7 @@ public class MessageTask { } } ``` -Again, the injector will see the annotations on the fields and will set the fields. The fields can be `private` or have any other visibility. Field injection requires a no-arg constructor to be present. \ No newline at end of file +Again, the injector will see the annotations on the fields and will set the fields. The fields can be `private` or have any other visibility. Field injection requires a no-arg constructor to be present. + +## @Inject gets singletons +No matter if you use constructor injection or field injection, it's important to understand that singletons will be passed, i.e. the injector will always pass the same implementation of the class. For example, if you have `@Inject private LimboCache limboCache` in some class and another `@Inject private LimboCache limboCache` in another class, both fields will have the same `LimboCache` object. \ No newline at end of file From 2f34a8902b90c33a3af21fb7e59f0d6b021dd09b Mon Sep 17 00:00:00 2001 From: ljacqu Date: Fri, 5 Aug 2016 19:37:59 +0200 Subject: [PATCH 076/139] Updated Dependency Injection (markdown) --- Dependency-Injection.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dependency-Injection.md b/Dependency-Injection.md index d71af24..7a40eba 100644 --- a/Dependency-Injection.md +++ b/Dependency-Injection.md @@ -1,5 +1,13 @@ This page contains some details about the purpose of the `@Inject` annotations in AuthMe and how to use them. +- [Purpose](#purpose) + - [Inversion of control](#inversion-of-control) + - [Dependency injection](#dependency-injection) +- [Injection methods](#injection-methods) + - [Constructor injection](#constructor-injection) + - [Field injection](#field-injection) + - [@Inject gets singletons](#inject-gets-singletons) + # Purpose `@Inject` allows us to use inversion of control more easily. From 51c58b7ee85048e4c96c51d704c17c45ed9b44ee Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 13 Aug 2016 16:40:29 +0200 Subject: [PATCH 077/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 74abff0..5250664 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2016-08-11](https://github.com/AuthMe/AuthMeReloaded/commit/67d53d0c3c98282b645894a0e7eadaf8cbedcbc7)) | In messages_xx.yml files, `&n` is now the regular format code and `%nl%` is replaced to new line 5.2 ([2016-06-19](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e1d697d386a1cd94fd09a02654cd7d9eaf854cfe)) | Allowed nickname regex pattern now case-sensitive 5.2 ([2016-05-29](https://github.com/AuthMe-Team/AuthMeReloaded/commit/52c0c7dd640217572d32587237abedb9cc35fca3)) | "Allow all commands if registration is optional" feature dropped 5.2 ([2016-05-03](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0ea95fb93c5b8408d6cb34c8de381dbce06060d5)) | Force spawn settings are grouped together (settings should migrate automatically) From 05fbbb2f91dea9b59abde83ea8eb1ef3784a00d6 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 13 Aug 2016 16:41:18 +0200 Subject: [PATCH 078/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 5250664..ddad7ec 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -3,19 +3,19 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- 5.2 ([2016-08-11](https://github.com/AuthMe/AuthMeReloaded/commit/67d53d0c3c98282b645894a0e7eadaf8cbedcbc7)) | In messages_xx.yml files, `&n` is now the regular format code and `%nl%` is replaced to new line -5.2 ([2016-06-19](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e1d697d386a1cd94fd09a02654cd7d9eaf854cfe)) | Allowed nickname regex pattern now case-sensitive -5.2 ([2016-05-29](https://github.com/AuthMe-Team/AuthMeReloaded/commit/52c0c7dd640217572d32587237abedb9cc35fca3)) | "Allow all commands if registration is optional" feature dropped -5.2 ([2016-05-03](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0ea95fb93c5b8408d6cb34c8de381dbce06060d5)) | Force spawn settings are grouped together (settings should migrate automatically) -5.2 ([2016-02-19](https://github.com/AuthMe-Team/AuthMeReloaded/commit/715622826f1e67ec50c63fadab90ffdbef1c468f)) | Command /converter has been moved to /authme converter -5.2 ([2016-02-14](https://github.com/AuthMe-Team/AuthMeReloaded/commit/b3734f40102466ef145e5361b6125ed96360ddef)) | Some permissions have been moved outside of `authme.player`. Please see the list below. +5.2 ([2016-06-19](https://github.com/AuthMe/AuthMeReloaded/commit/e1d697d386a1cd94fd09a02654cd7d9eaf854cfe)) | Allowed nickname regex pattern now case-sensitive +5.2 ([2016-05-29](https://github.com/AuthMe/AuthMeReloaded/commit/52c0c7dd640217572d32587237abedb9cc35fca3)) | "Allow all commands if registration is optional" feature dropped +5.2 ([2016-05-03](https://github.com/AuthMe/AuthMeReloaded/commit/0ea95fb93c5b8408d6cb34c8de381dbce06060d5)) | Force spawn settings are grouped together (settings should migrate automatically) +5.2 ([2016-02-19](https://github.com/AuthMe/AuthMeReloaded/commit/715622826f1e67ec50c63fadab90ffdbef1c468f)) | Command /converter has been moved to /authme converter +5.2 ([2016-02-14](https://github.com/AuthMe/AuthMeReloaded/commit/b3734f40102466ef145e5361b6125ed96360ddef)) | Some permissions have been moved outside of `authme.player`. Please see the list below. 5.2 ([2016-02-12](https://github.com/Xephi/AuthMeReloaded/issues/512)) | `Settings.delayJoinLeaveMessages` has been split up in more granular configurations. Your config file will update automatically, search for options with "delay" -5.2 ([2015-12-28](https://github.com/AuthMe-Team/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically change to SHA256 HashAlgorithm -5.2 ([2015-12-26](https://github.com/AuthMe-Team/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_/_from_ flatfile no longer supported. Use Sqlite. -5.2 ([2015-12-23](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` -5.2 ([2015-12-22](https://github.com/AuthMe-Team/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe-Team/AuthMeReloaded/blob/8f098933371767130b2a533ec9ad0f6075c2522b/src/main/resources/email.html)) -5.1 ([2015‑12‑05](https://github.com/AuthMe-Team/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe-Team/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) -5.1 ([2015-12-04](https://github.com/AuthMe-Team/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) | Configurable text sent in email moved from config.yml to email.html -5.1 ([2015-11-27](https://github.com/AuthMe-Team/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case +5.2 ([2015-12-28](https://github.com/AuthMe/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically change to SHA256 HashAlgorithm +5.2 ([2015-12-26](https://github.com/AuthMe/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_/_from_ flatfile no longer supported. Use Sqlite. +5.2 ([2015-12-23](https://github.com/AuthMe/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` +5.2 ([2015-12-22](https://github.com/AuthMe/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe/AuthMeReloaded/blob/8f098933371767130b2a533ec9ad0f6075c2522b/src/main/resources/email.html)) +5.1 ([2015‑12‑05](https://github.com/AuthMe/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) +5.1 ([2015-12-04](https://github.com/AuthMe/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) | Configurable text sent in email moved from config.yml to email.html +5.1 ([2015-11-27](https://github.com/AuthMe/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case --- From 183c294304048b15c21acd94867518d1cd931a84 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 13 Aug 2016 16:43:11 +0200 Subject: [PATCH 079/139] Updated Build History (markdown) --- Build-History.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Build-History.md b/Build-History.md index 2da9576..67a6425 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,9 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1280 | http://github.com/AuthMe/AuthMeReloaded/commit/87d36f69cf4469b6b654769a4972d36eb20a7dce +1270 | http://github.com/AuthMe/AuthMeReloaded/commit/168186321c08c443440035678c91cb201cdc08a4 +1260 | http://github.com/AuthMe/AuthMeReloaded/commit/af48c2fc2aa66c00bb319e1a128d8b431d8ea03e 1250 | [80337f7](https://github.com/AuthMe/AuthMeReloaded/commit/80337f758b234c28af14e32fe1b33cc9eb3f8e8a) 1240 | [7fc1953](https://github.com/AuthMe/AuthMeReloaded/commit/7fc195336f9afde3f1baf4ca97eb94d4ad02c752) 1230 | [0eb1890](https://github.com/AuthMe/AuthMeReloaded/commit/0eb1890cf9f06eb4a2410bcd2f65ef150a76ac92) From 1b8342914b172bdb29c50db3e07b4abfc9969a81 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 4 Sep 2016 13:31:04 +0200 Subject: [PATCH 080/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index ddad7ec..858094c 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2016-09-04](https://github.com/AuthMe/AuthMeReloaded/commit/7deb75ab856250ef84934d578960b4850a313ec8)) | Permissions: support for GroupManager (not via Vault) removed. 5.2 ([2016-08-11](https://github.com/AuthMe/AuthMeReloaded/commit/67d53d0c3c98282b645894a0e7eadaf8cbedcbc7)) | In messages_xx.yml files, `&n` is now the regular format code and `%nl%` is replaced to new line 5.2 ([2016-06-19](https://github.com/AuthMe/AuthMeReloaded/commit/e1d697d386a1cd94fd09a02654cd7d9eaf854cfe)) | Allowed nickname regex pattern now case-sensitive 5.2 ([2016-05-29](https://github.com/AuthMe/AuthMeReloaded/commit/52c0c7dd640217572d32587237abedb9cc35fca3)) | "Allow all commands if registration is optional" feature dropped From 0a9338b6720f6a7d03e26b57a74f9a64fa26f8f9 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 4 Sep 2016 15:08:00 +0200 Subject: [PATCH 081/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 858094c..c62d0fa 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2016-09-04](https://github.com/AuthMe/AuthMeReloaded/commit/5efed1b697e03785bba5f96dbc3af69f82b0a28a)) | Dropped support for Java 7 5.2 ([2016-09-04](https://github.com/AuthMe/AuthMeReloaded/commit/7deb75ab856250ef84934d578960b4850a313ec8)) | Permissions: support for GroupManager (not via Vault) removed. 5.2 ([2016-08-11](https://github.com/AuthMe/AuthMeReloaded/commit/67d53d0c3c98282b645894a0e7eadaf8cbedcbc7)) | In messages_xx.yml files, `&n` is now the regular format code and `%nl%` is replaced to new line 5.2 ([2016-06-19](https://github.com/AuthMe/AuthMeReloaded/commit/e1d697d386a1cd94fd09a02654cd7d9eaf854cfe)) | Allowed nickname regex pattern now case-sensitive From 07a42778ccd3c57c4cb4cd1953801d3da9b6fd97 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 4 Sep 2016 15:12:13 +0200 Subject: [PATCH 082/139] Updated Build History (markdown) --- Build-History.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Build-History.md b/Build-History.md index 67a6425..05ff480 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,9 +3,12 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- -1280 | http://github.com/AuthMe/AuthMeReloaded/commit/87d36f69cf4469b6b654769a4972d36eb20a7dce -1270 | http://github.com/AuthMe/AuthMeReloaded/commit/168186321c08c443440035678c91cb201cdc08a4 -1260 | http://github.com/AuthMe/AuthMeReloaded/commit/af48c2fc2aa66c00bb319e1a128d8b431d8ea03e +1310 | [945c9e9](https://github.com/AuthMe/AuthMeReloaded/commit/945c9e9587e5b58ddef33ecedd4f25662ae0f206) +1300 | [b07e60a](https://github.com/AuthMe/AuthMeReloaded/commit/b07e60a807aa7ebccc0d06ba6d8a86f8a0b237c4) +1290 | [14900d8](https://github.com/AuthMe/AuthMeReloaded/commit/14900d84fa403d2b9dcdb300ba5bf059af60fdef) +1280 | [87d36f6](https://github.com/AuthMe/AuthMeReloaded/commit/87d36f69cf4469b6b654769a4972d36eb20a7dce) +1270 | [1681863](https://github.com/AuthMe/AuthMeReloaded/commit/168186321c08c443440035678c91cb201cdc08a4) +1260 | [af48c2f](https://github.com/AuthMe/AuthMeReloaded/commit/af48c2fc2aa66c00bb319e1a128d8b431d8ea03e) 1250 | [80337f7](https://github.com/AuthMe/AuthMeReloaded/commit/80337f758b234c28af14e32fe1b33cc9eb3f8e8a) 1240 | [7fc1953](https://github.com/AuthMe/AuthMeReloaded/commit/7fc195336f9afde3f1baf4ca97eb94d4ad02c752) 1230 | [0eb1890](https://github.com/AuthMe/AuthMeReloaded/commit/0eb1890cf9f06eb4a2410bcd2f65ef150a76ac92) From b1eea372baf4018575f8e94f3ad4b718b0a08976 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 19 Sep 2016 18:18:10 +0200 Subject: [PATCH 083/139] Updated Build History (markdown) --- Build-History.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Build-History.md b/Build-History.md index 05ff480..85751cf 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,12 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1380 | http://github.com/AuthMe/AuthMeReloaded/commit/ff9f50f63f1a80f9f555234d5ee18689cf8a8bff +1370 | http://github.com/AuthMe/AuthMeReloaded/commit/0aa02b70f0f6d46344d9c703dccb700a662e9c6f +1360 | http://github.com/AuthMe/AuthMeReloaded/commit/71c289f2f366ba84c311cb32a316c393cf58a986 +1350 | - +1340 | - +1330 | http://github.com/AuthMe/AuthMeReloaded/commit/8327421dd41ea730bcc1fe76d0f9ea6c41d5bcf4 1310 | [945c9e9](https://github.com/AuthMe/AuthMeReloaded/commit/945c9e9587e5b58ddef33ecedd4f25662ae0f206) 1300 | [b07e60a](https://github.com/AuthMe/AuthMeReloaded/commit/b07e60a807aa7ebccc0d06ba6d8a86f8a0b237c4) 1290 | [14900d8](https://github.com/AuthMe/AuthMeReloaded/commit/14900d84fa403d2b9dcdb300ba5bf059af60fdef) From 2d605e9b48f696092d1803a5287f88488950f18c Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 19 Sep 2016 18:19:49 +0200 Subject: [PATCH 084/139] Updated Build History (markdown) --- Build-History.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Build-History.md b/Build-History.md index 85751cf..2b4ac4b 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,12 +3,13 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- -1380 | http://github.com/AuthMe/AuthMeReloaded/commit/ff9f50f63f1a80f9f555234d5ee18689cf8a8bff -1370 | http://github.com/AuthMe/AuthMeReloaded/commit/0aa02b70f0f6d46344d9c703dccb700a662e9c6f -1360 | http://github.com/AuthMe/AuthMeReloaded/commit/71c289f2f366ba84c311cb32a316c393cf58a986 +1380 | [ff9f50f](https://github.com/AuthMe/AuthMeReloaded/commit/ff9f50f63f1a80f9f555234d5ee18689cf8a8bff) +1370 | [0aa02b7](https://github.com/AuthMe/AuthMeReloaded/commit/0aa02b70f0f6d46344d9c703dccb700a662e9c6f) +1360 | [71c289f](https://github.com/AuthMe/AuthMeReloaded/commit/71c289f2f366ba84c311cb32a316c393cf58a986) 1350 | - 1340 | - -1330 | http://github.com/AuthMe/AuthMeReloaded/commit/8327421dd41ea730bcc1fe76d0f9ea6c41d5bcf4 +1330 | [8327421](https://github.com/AuthMe/AuthMeReloaded/commit/8327421dd41ea730bcc1fe76d0f9ea6c41d5bcf4) +1320 | [bc9d67a](https://github.com/AuthMe/AuthMeReloaded/commit/bc9d67abbd7f2d42c028ead9f5a9d9ad73c31d85) 1310 | [945c9e9](https://github.com/AuthMe/AuthMeReloaded/commit/945c9e9587e5b58ddef33ecedd4f25662ae0f206) 1300 | [b07e60a](https://github.com/AuthMe/AuthMeReloaded/commit/b07e60a807aa7ebccc0d06ba6d8a86f8a0b237c4) 1290 | [14900d8](https://github.com/AuthMe/AuthMeReloaded/commit/14900d84fa403d2b9dcdb300ba5bf059af60fdef) From 97e8e5f053c51e8fae2a119aee90faba1ab2150a Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 1 Oct 2016 11:45:33 +0200 Subject: [PATCH 085/139] Destroyed Auth events (markdown) --- Auth-events.md | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 Auth-events.md diff --git a/Auth-events.md b/Auth-events.md deleted file mode 100644 index 96bdda9..0000000 --- a/Auth-events.md +++ /dev/null @@ -1,34 +0,0 @@ -List of events, happenings that are relevant for AuthMe. - - -## Join event -**Description:** Player connects to the server - -**Possible origin:** Player literally joins the server, bungeecord :question: - -**Activities:** Checks: valid name, antibot, kick for unregistered, account restriction, account unrestriction, name casing if registered, country, single session, if full & vip; create PlayerData object. Apply blind effect. Teleport to spawn / firstspawn. Hide inventory. - -## Register event -**Description:** Player issues a valid /register command - -**Possible origin:** /register or /authme register, API call - -**Activities:** Check password/email confirmation, check valid & allowed password/email. Register account. Log in if configured or send mail. Kick if configured / admin-registered. - -## Login event -**Description:** A request to log in a user - -**Possible origin:** /login, /authme forcelogin, active session (forwarded from join event), API call - -**Activities:** If not forced: check credentials against database / failed login -> captcha, temp ban manager. If successful: perform teleportation, restore PlayerData info, restore inventory. - -## Unregister event - -## Logout event - -## Quit event -**Description:** player quits the server - -**Possible origin:** Player literally exits the server, Bungeecord :question: - -**Activities:** Restore player properties from PlayerData \ No newline at end of file From fced0c0d95dd9039933c12dfd7a99fc48e9f04cc Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 9 Oct 2016 10:01:02 +0200 Subject: [PATCH 086/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index 2b4ac4b..860f01a 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1400 | [7394e00](https://github.com/AuthMe/AuthMeReloaded/commit/7394e004ce3c40da5624f551b2b6390e0ad4fabf) 1380 | [ff9f50f](https://github.com/AuthMe/AuthMeReloaded/commit/ff9f50f63f1a80f9f555234d5ee18689cf8a8bff) 1370 | [0aa02b7](https://github.com/AuthMe/AuthMeReloaded/commit/0aa02b70f0f6d46344d9c703dccb700a662e9c6f) 1360 | [71c289f](https://github.com/AuthMe/AuthMeReloaded/commit/71c289f2f366ba84c311cb32a316c393cf58a986) From 7df051b31635034a85e43e66345368d7cbb97f3e Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 9 Oct 2016 10:16:24 +0200 Subject: [PATCH 087/139] Created Contents (markdown) --- Contents.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Contents.md diff --git a/Contents.md b/Contents.md new file mode 100644 index 0000000..8318c86 --- /dev/null +++ b/Contents.md @@ -0,0 +1 @@ +Test \ No newline at end of file From e2889a561c1158af8da1508d3e954614da4837e9 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 9 Oct 2016 10:16:44 +0200 Subject: [PATCH 088/139] Destroyed Contents (markdown) --- Contents.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Contents.md diff --git a/Contents.md b/Contents.md deleted file mode 100644 index 8318c86..0000000 --- a/Contents.md +++ /dev/null @@ -1 +0,0 @@ -Test \ No newline at end of file From 003f62e631b52f82d752547dc5aaaf991d9e423e Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 9 Oct 2016 10:16:55 +0200 Subject: [PATCH 089/139] Created _Sidebar (markdown) --- _Sidebar.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 _Sidebar.md diff --git a/_Sidebar.md b/_Sidebar.md new file mode 100644 index 0000000..3d72be6 --- /dev/null +++ b/_Sidebar.md @@ -0,0 +1,3 @@ +Contents + +Test \ No newline at end of file From 8f346dbd8bb7a8e61ef361c0680c6ba8d3926831 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 9 Oct 2016 10:18:16 +0200 Subject: [PATCH 090/139] Updated _Sidebar (markdown) --- _Sidebar.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_Sidebar.md b/_Sidebar.md index 3d72be6..0966622 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -1,3 +1,3 @@ -Contents - -Test \ No newline at end of file +# Contents +For plugin users +- [Breaking changes](Breaking-Changes) \ No newline at end of file From 85b6ab70719b231b648156d516a08e19a7d833c1 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 9 Oct 2016 10:23:54 +0200 Subject: [PATCH 091/139] Updated _Sidebar (markdown) --- _Sidebar.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/_Sidebar.md b/_Sidebar.md index 0966622..8ff4a1c 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -1,3 +1,15 @@ -# Contents -For plugin users -- [Breaking changes](Breaking-Changes) \ No newline at end of file +- For plugin users + - [AuthMe releases (Jenkins)](AuthMe-Releases-(Jenkins)) + - [Breaking changes](Breaking-Changes) + - [Spawn handling](Spawn-Handling) +- For developers using AuthMe + - [Hooking into AuthMe](Hooking-into-AuthMe) + - [Plugins hooking into AuthMe](Plugins-hooking-into-AuthMe) +- For developers + - [Coding styleguide](AuthMe-Coding-Styleguide) + - [Build history](Build-History) + - [Command handling](Command-Handling) + - [Dependency injection](Dependency-Injection) + - [Development setup](Development-Setup) + - [Translation interface](Translation-Interface) + - [Unit testing](Unit-Testing) \ No newline at end of file From cfa5478c23b5d6741f0e7a07a7f14fa59dfcd426 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 13 Nov 2016 10:55:51 +0100 Subject: [PATCH 092/139] Updated Build History (markdown) --- Build-History.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Build-History.md b/Build-History.md index 860f01a..dca85da 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,8 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1440 | [b3e276d](https://github.com/AuthMe/AuthMeReloaded/commit/b3e276d277765ca4fd2f007236caf7b08e9e8b6e) +1420 | [3dab5cd](https://github.com/AuthMe/AuthMeReloaded/commit/3dab5cd70ce6e391381ac3244f00540f303d9b3e) 1400 | [7394e00](https://github.com/AuthMe/AuthMeReloaded/commit/7394e004ce3c40da5624f551b2b6390e0ad4fabf) 1380 | [ff9f50f](https://github.com/AuthMe/AuthMeReloaded/commit/ff9f50f63f1a80f9f555234d5ee18689cf8a8bff) 1370 | [0aa02b7](https://github.com/AuthMe/AuthMeReloaded/commit/0aa02b70f0f6d46344d9c703dccb700a662e9c6f) From db66bc363f195e0eb301cb31aa0090dc741df675 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 13 Nov 2016 10:57:53 +0100 Subject: [PATCH 093/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index c62d0fa..3327d1d 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2016-11-13](https://github.com/AuthMe/AuthMeReloaded/commit/bb89a59a8a3db9be6a2c0a0f8eab5a22f1b10abb)) | To support old hashes, you now need to list the hashes in the setting `legacyHashes` 5.2 ([2016-09-04](https://github.com/AuthMe/AuthMeReloaded/commit/5efed1b697e03785bba5f96dbc3af69f82b0a28a)) | Dropped support for Java 7 5.2 ([2016-09-04](https://github.com/AuthMe/AuthMeReloaded/commit/7deb75ab856250ef84934d578960b4850a313ec8)) | Permissions: support for GroupManager (not via Vault) removed. 5.2 ([2016-08-11](https://github.com/AuthMe/AuthMeReloaded/commit/67d53d0c3c98282b645894a0e7eadaf8cbedcbc7)) | In messages_xx.yml files, `&n` is now the regular format code and `%nl%` is replaced to new line From 729ae4d302caa8e24dc22c03f05f6eb67699560c Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 13 Nov 2016 11:08:18 +0100 Subject: [PATCH 094/139] Updated Plugins hooking into AuthMe (markdown) --- Plugins-hooking-into-AuthMe.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Plugins-hooking-into-AuthMe.md b/Plugins-hooking-into-AuthMe.md index ef63ea4..5d2d067 100644 --- a/Plugins-hooking-into-AuthMe.md +++ b/Plugins-hooking-into-AuthMe.md @@ -1,4 +1,5 @@ Plugin | Source code ----------- | --------- ChatGuard | [Github](https://github.com/DenAbr/ChatGuard/tree/master/src/ru/Den_Abr/ChatGuard/Integration) +ChestShop | [Github](https://github.com/Acrobot/ChestShop-3/blob/master/src/main/java/com/Acrobot/ChestShop/Listeners/AuthMeChestShopListener.java) DungeonMaze | [Github](https://github.com/timvisee/DungeonMaze/tree/master/src/main/java/com/timvisee/dungeonmaze/plugin/authmereloaded) \ No newline at end of file From 5684cbaf8be9660537834d63fd5cbaf2f41ffaa7 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 13 Nov 2016 11:57:13 +0100 Subject: [PATCH 095/139] Created Name restrictions (markdown) --- Name-restrictions.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Name-restrictions.md diff --git a/Name-restrictions.md b/Name-restrictions.md new file mode 100644 index 0000000..430a4f8 --- /dev/null +++ b/Name-restrictions.md @@ -0,0 +1,36 @@ +# Name Restrictions and Unrestrictions +AuthMe supports restrictions and so-called _unrestrictions_ for usernames. + +## Name Restrictions +Names can be restricted to IP addresses or host names. An example in config.yml: +```yaml + # To activate the restricted user feature you need + # to enable this option and configure the AllowedRestrictedUser field. + AllowRestrictedUser: true + # The restricted user feature will kick players listed below + # if they don't match the defined IP address. + AllowedRestrictedUser: + - admin;127.0.0.1 + - admin;123.45.67.89 + - billy;34.56.78.90 +``` + +This means that someone may only join as `admin` if he has the IP address 127.0.0.1 or 123.45.67.89. Attempts to join as `admin` from any other IP address will be refused. This setting is case-insensitive, i.e. the restrictions also apply for `ADMIN`, `Admin`, etc. + +## Name Unrestrictions +Contrarily, name unrestrictions define usernames that AuthMe will ignore entirely. Example for config.yml: + +```yaml + # Below you can list all account names that + # AuthMe will ignore for registration or login, configure it + # at your own risk!! Remember that if you are going to add + # nickname with [], you have to delimit name with ' '. + # this option add compatibility with BuildCraft and some + # other mods. + # It is case-sensitive! + UnrestrictedName: + - npcplayer + - othernpc +``` + +This setting is also case-insensitive. If a player with such a name joins (e.g. `npcplayer`, or `NpcPlayer`), AuthMe won't ask the player to log in or register and won't block any commands or actions. This is typically a useful feature for plugins that add NPC players to the game. \ No newline at end of file From 81f15da8c6a2d13592505175ab4bcc782044b391 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 13 Nov 2016 11:57:28 +0100 Subject: [PATCH 096/139] Updated Name restrictions (markdown) --- Name-restrictions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Name-restrictions.md b/Name-restrictions.md index 430a4f8..566220d 100644 --- a/Name-restrictions.md +++ b/Name-restrictions.md @@ -1,4 +1,3 @@ -# Name Restrictions and Unrestrictions AuthMe supports restrictions and so-called _unrestrictions_ for usernames. ## Name Restrictions From 7f15a5926e4427824b7267d49b97749e36c0d09f Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 13 Nov 2016 12:10:26 +0100 Subject: [PATCH 097/139] Updated Name restrictions (markdown) --- Name-restrictions.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Name-restrictions.md b/Name-restrictions.md index 566220d..312c311 100644 --- a/Name-restrictions.md +++ b/Name-restrictions.md @@ -7,7 +7,7 @@ Names can be restricted to IP addresses or host names. An example in config.yml: # to enable this option and configure the AllowedRestrictedUser field. AllowRestrictedUser: true # The restricted user feature will kick players listed below - # if they don't match the defined IP address. + # if they don't match the defined IP address. Names are case-insensitive. AllowedRestrictedUser: - admin;127.0.0.1 - admin;123.45.67.89 @@ -16,17 +16,16 @@ Names can be restricted to IP addresses or host names. An example in config.yml: This means that someone may only join as `admin` if he has the IP address 127.0.0.1 or 123.45.67.89. Attempts to join as `admin` from any other IP address will be refused. This setting is case-insensitive, i.e. the restrictions also apply for `ADMIN`, `Admin`, etc. +To "disable" certain usernames, you can add entries with an impossible address, e.g. "player;8.8.8.8" to refuse anyone joining as `Player`. + ## Name Unrestrictions -Contrarily, name unrestrictions define usernames that AuthMe will ignore entirely. Example for config.yml: +Conversely, name unrestrictions define usernames that AuthMe will ignore entirely. Example for config.yml: ```yaml - # Below you can list all account names that - # AuthMe will ignore for registration or login, configure it - # at your own risk!! Remember that if you are going to add - # nickname with [], you have to delimit name with ' '. - # this option add compatibility with BuildCraft and some - # other mods. - # It is case-sensitive! + # Below you can list all account names that AuthMe will ignore + # for registration or login. Configure it at your own risk!! + # This option adds compatibility with BuildCraft and some other mods. + # It is case-insensitive! UnrestrictedName: - npcplayer - othernpc From 482e2e322b9bec9673e136f4b1fec0ced23857a5 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 13 Nov 2016 12:11:28 +0100 Subject: [PATCH 098/139] Updated Name restrictions (markdown) --- Name-restrictions.md => Name-Restrictions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Name-restrictions.md => Name-Restrictions.md (100%) diff --git a/Name-restrictions.md b/Name-Restrictions.md similarity index 100% rename from Name-restrictions.md rename to Name-Restrictions.md From c3c68edbffc8f3d4adef54ca6b54196a05646df9 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 13 Nov 2016 12:12:13 +0100 Subject: [PATCH 099/139] Updated _Sidebar (markdown) --- _Sidebar.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_Sidebar.md b/_Sidebar.md index 8ff4a1c..9497b40 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -1,7 +1,9 @@ +- [Home](Home) - For plugin users - [AuthMe releases (Jenkins)](AuthMe-Releases-(Jenkins)) - [Breaking changes](Breaking-Changes) - [Spawn handling](Spawn-Handling) + - [Name restrictions](Name-Restrictions) - For developers using AuthMe - [Hooking into AuthMe](Hooking-into-AuthMe) - [Plugins hooking into AuthMe](Plugins-hooking-into-AuthMe) From b122cd22126c01929ab1b6cc12a13e8055ab31f3 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 13 Nov 2016 15:12:28 +0100 Subject: [PATCH 100/139] Updated Plugins hooking into AuthMe (markdown) --- Plugins-hooking-into-AuthMe.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Plugins-hooking-into-AuthMe.md b/Plugins-hooking-into-AuthMe.md index 5d2d067..d3abaf8 100644 --- a/Plugins-hooking-into-AuthMe.md +++ b/Plugins-hooking-into-AuthMe.md @@ -1,5 +1,34 @@ +### Plugins with recent commits (< 1 year) Plugin | Source code ----------- | --------- +AuthMeBridge | [Github](https://github.com/CryLegend/AuthMeBridge/blob/master/authmebridge-authme/src/main/java/com/crylegend/authmebridge/AuthMeBridge.java) ChatGuard | [Github](https://github.com/DenAbr/ChatGuard/tree/master/src/ru/Den_Abr/ChatGuard/Integration) ChestShop | [Github](https://github.com/Acrobot/ChestShop-3/blob/master/src/main/java/com/Acrobot/ChestShop/Listeners/AuthMeChestShopListener.java) -DungeonMaze | [Github](https://github.com/timvisee/DungeonMaze/tree/master/src/main/java/com/timvisee/dungeonmaze/plugin/authmereloaded) \ No newline at end of file +DungeonMaze | [Github](https://github.com/timvisee/DungeonMaze/tree/master/src/main/java/com/timvisee/dungeonmaze/plugin/authmereloaded) +FactionChat | [Github](https://github.com/James137137/FactionChat/blob/master/src/main/java/nz/co/lolnet/james137137/FactionChat/API/AuthMeAPI.java) +FastLogin | [Github](https://github.com/games647/FastLogin/blob/master/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java) +ResourcePacksPlugins | [Github](https://github.com/Phoenix616/ResourcepacksPlugins/blob/master/bukkit/src/main/java/de/themoep/resourcepacksplugin/bukkit/listeners/AuthmeLoginListener.java) +Scavenger | [Github](https://github.com/cnaude/Scavenger/blob/master/src/main/java/com/cnaude/scavenger/Scavenger.java) + +### Further plugins +Plugins with recent commits (< 1 year) that are very specific or that are lacking a description. + +Plugin | Source code +----------- | ----------- +CreativeLimiter | [Github](https://github.com/Shevchik/CreativeLimiter/blob/master/src/creativeLimiter/misc/JoinGamemodeChanger.java) +Elementals | [Github](https://github.com/nicuch/Elementals/blob/master/src/ro/nicuch/elementals/hook/NCPHookListener.java) +NoMult | [Github](https://github.com/Korvinius/NoMult/blob/master/src/net/wealth_mc/nomult/NoMultList.java) +ProtocolSupportPremiumLogin | [Github](https://github.com/ProtocolSupport/ProtocolSupportPremiumLogin/blob/master/src/premiumlogin/plugins/AuthMeNewHook.java) +RPGGame-Plugin | [Github](https://github.com/AngelAZO/RPGGame-Plugin/blob/master/src/com/minephoenix/legacy/PlayerEvents.java) +SinkBans | [Github](https://github.com/Static-Interface/SinkBans) +UniversalChat | [Github](https://github.com/Phosphorus15/UniversalChat) + +### Abandoned plugins +Plugins whose last commit was over a year ago. + +Plugin | Source code +--------- | ------------ +NewTrans | [Github](https://github.com/BAI1/NewTrans/blob/master/me/bai1/NewTrans/NewTrans.java) +RealMotd | [Github](https://github.com/tomsik68/RealMotd/blob/master/src/sk/tomsik68/realmotd/RealMotd.java) +WAddon | [Github](https://github.com/ShadowDevelopment/WAddon/tree/master/src/me/wiedzmin137/waddon/listener) +WHeroesAddon | [Github](https://github.com/ShadowDevelopment/WHeroesAddon/blob/master/src/me/Wiedzmin137/wheroesaddon/addons/WEventListener.java) \ No newline at end of file From 5f3203a5b71fb1931ec9bd08d3251ad6f65979a9 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 19 Nov 2016 12:42:28 +0100 Subject: [PATCH 101/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index dca85da..761e957 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1460 | [e9f274a](https://github.com/AuthMe/AuthMeReloaded/commit/e9f274aa89550de98e0fcd119b732185790c6d64) 1440 | [b3e276d](https://github.com/AuthMe/AuthMeReloaded/commit/b3e276d277765ca4fd2f007236caf7b08e9e8b6e) 1420 | [3dab5cd](https://github.com/AuthMe/AuthMeReloaded/commit/3dab5cd70ce6e391381ac3244f00540f303d9b3e) 1400 | [7394e00](https://github.com/AuthMe/AuthMeReloaded/commit/7394e004ce3c40da5624f551b2b6390e0ad4fabf) From 2a945b69476a81536d390c7308421c886fdb9f18 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 26 Nov 2016 22:06:36 +0100 Subject: [PATCH 102/139] Created 5.2 Changelog (markdown) --- 5.2-Changelog.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 5.2-Changelog.md diff --git a/5.2-Changelog.md b/5.2-Changelog.md new file mode 100644 index 0000000..0816a39 --- /dev/null +++ b/5.2-Changelog.md @@ -0,0 +1,45 @@ +This page lists all major changes introduced in AuthMe 5.2. It's a summarized list of all [closed issues in the 5.2 milestone](https://github.com/Xephi/AuthMeReloaded/milestone/1?closed=1). To see which changes may require an action form your side, please see [Breaking Changes](Breaking-Changes). + + +**Shiny new features** +- Temp ban IP after too many wrong logins ([#192](https://github.com/Xephi/AuthMeReloaded/issues/192)) +- Block tab auto completion for unlogged players ([#390](https://github.com/Xephi/AuthMeReloaded/issues/390)) +- Bypass the purge with a permission ([#674](https://github.com/Xephi/AuthMeReloaded/issues/674)) +- /logout invalidates a player's session ([#816](https://github.com/Xephi/AuthMeReloaded/issues/816)) +- Allow AuthMe to run in sync or async (configurable) ([#937](https://github.com/Xephi/AuthMeReloaded/issues/937)) +- Show one's own alts on login ([#423](https://github.com/Xephi/AuthMeReloaded/issues/423)) +- Translatable help section ([#293](https://github.com/Xephi/AuthMeReloaded/issues/293)) +- Run a custom command when more than x alts are detected ([#459](https://github.com/Xephi/AuthMeReloaded/issues/459)) +- Support specific legacy hashes ([#850](https://github.com/Xephi/AuthMeReloaded/issues/850)) +- MySQL to SQLite converter ([[#933](https://github.com/Xephi/AuthMeReloaded/issues/933)](https://github.com/Xephi/AuthMeReloaded/issues/933)) +- Command for updating the messages file ([#768](https://github.com/Xephi/AuthMeReloaded/issues/768)) +- Deprecate flat file: use SQLite instead ([#344](https://github.com/Xephi/AuthMeReloaded/issues/344)) + +**Improve email recovery** +- Confirm email recovery before resetting user's password ([#472](https://github.com/Xephi/AuthMeReloaded/issues/472)) +- Create /email show command ([#922](https://github.com/Xephi/AuthMeReloaded/issues/922)) +- Fix display of Chinese characters ([#269](https://github.com/Xephi/AuthMeReloaded/issues/269)) +- Add support for oAuth2 ([#260](https://github.com/Xephi/AuthMeReloaded/issues/260)) + +**Improve AntiBot** +- Make startup time of Antibot configurable ([#970](https://github.com/Xephi/AuthMeReloaded/issues/970)) +- Update AntiBot configuration on /authme reload ([#896](https://github.com/Xephi/AuthMeReloaded/issues/896)) +- Show AntiBot message only to players with permission ([#904](https://github.com/Xephi/AuthMeReloaded/issues/904)) +- Technical: better implementation of user count in time span ([#938](https://github.com/Xephi/AuthMeReloaded/issues/938)) + +**Password storage** +- Add support for phpBB 3.1.5 ([#150](https://github.com/Xephi/AuthMeReloaded/issues/611)) +- Fix broken hash algorithms ([#369](https://github.com/Xephi/AuthMeReloaded/issues/369), [#685](https://github.com/Xephi/AuthMeReloaded/issues/685)) + +**Other improvements** +- Improve behavior of AuthMe for optional registration ([#611](https://github.com/Xephi/AuthMeReloaded/issues/611)) + +**Technical issues** +- SQL: always use prepared statements ([#308](https://github.com/Xephi/AuthMeReloaded/issues/308)) +- refactor command handling ([#305](https://github.com/Xephi/AuthMeReloaded/issues/305), [#306](https://github.com/Xephi/AuthMeReloaded/issues/306)) +- redesign and test hash algorithm interfaces ([#358](https://github.com/Xephi/AuthMeReloaded/issues/358), [#364](https://github.com/Xephi/AuthMeReloaded/issues/364)) +- new configuration management ([#347](https://github.com/Xephi/AuthMeReloaded/issues/347)) -> birth of ConfigMe ([#927](https://github.com/Xephi/AuthMeReloaded/issues/927)) +- distribute workload during purge process better ([#696](https://github.com/Xephi/AuthMeReloaded/issues/696)) +- apply dependency injection ([#432](https://github.com/Xephi/AuthMeReloaded/issues/432)) +- integration tests for SQLite and MySQL ([#392](https://github.com/Xephi/AuthMeReloaded/issues/392)) +- improve how /authme reload works ([#704](https://github.com/Xephi/AuthMeReloaded/issues/704)) From a5bc1c6ee35a1423416ee6fcce5d96b2931843f2 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 26 Nov 2016 22:07:08 +0100 Subject: [PATCH 103/139] Updated _Sidebar (markdown) --- _Sidebar.md | 1 + 1 file changed, 1 insertion(+) diff --git a/_Sidebar.md b/_Sidebar.md index 9497b40..9f31c9f 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -4,6 +4,7 @@ - [Breaking changes](Breaking-Changes) - [Spawn handling](Spawn-Handling) - [Name restrictions](Name-Restrictions) + - [5.2 changelog](5.2-Changelog) - For developers using AuthMe - [Hooking into AuthMe](Hooking-into-AuthMe) - [Plugins hooking into AuthMe](Plugins-hooking-into-AuthMe) From 1938d6383c0449caeff8128b0fed166371d91940 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 4 Dec 2016 10:48:54 +0100 Subject: [PATCH 104/139] Updated 5.2 Changelog (markdown) --- 5.2-Changelog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/5.2-Changelog.md b/5.2-Changelog.md index 0816a39..2bd201b 100644 --- a/5.2-Changelog.md +++ b/5.2-Changelog.md @@ -9,6 +9,7 @@ This page lists all major changes introduced in AuthMe 5.2. It's a summarized li - Allow AuthMe to run in sync or async (configurable) ([#937](https://github.com/Xephi/AuthMeReloaded/issues/937)) - Show one's own alts on login ([#423](https://github.com/Xephi/AuthMeReloaded/issues/423)) - Translatable help section ([#293](https://github.com/Xephi/AuthMeReloaded/issues/293)) +- Integration with IPB4 ([#483](https://github.com/Xephi/AuthMeReloaded/issues/483)) - Run a custom command when more than x alts are detected ([#459](https://github.com/Xephi/AuthMeReloaded/issues/459)) - Support specific legacy hashes ([#850](https://github.com/Xephi/AuthMeReloaded/issues/850)) - MySQL to SQLite converter ([[#933](https://github.com/Xephi/AuthMeReloaded/issues/933)](https://github.com/Xephi/AuthMeReloaded/issues/933)) @@ -28,7 +29,7 @@ This page lists all major changes introduced in AuthMe 5.2. It's a summarized li - Technical: better implementation of user count in time span ([#938](https://github.com/Xephi/AuthMeReloaded/issues/938)) **Password storage** -- Add support for phpBB 3.1.5 ([#150](https://github.com/Xephi/AuthMeReloaded/issues/611)) +- Add support for phpBB 3.1.5 ([#150](https://github.com/Xephi/AuthMeReloaded/issues/150)) - Fix broken hash algorithms ([#369](https://github.com/Xephi/AuthMeReloaded/issues/369), [#685](https://github.com/Xephi/AuthMeReloaded/issues/685)) **Other improvements** From bda90e0e500a7d4ccc8f578dba60bae339ff4d7a Mon Sep 17 00:00:00 2001 From: ljacqu Date: Fri, 16 Dec 2016 21:40:53 +0100 Subject: [PATCH 105/139] Created Tool tasks (markdown) --- Tool-tasks.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Tool-tasks.md diff --git a/Tool-tasks.md b/Tool-tasks.md new file mode 100644 index 0000000..9affe71 --- /dev/null +++ b/Tool-tasks.md @@ -0,0 +1,20 @@ +_Tool tasks_ are tasks that can be run from the AuthMe codebase for various purposes, e.g. to generate docs pages or to verify messages tasks. All tool tasks are started from the same runner, the ToolsRunner, located test/tools/ToolsRunner.java. Tip: you can save the run configuration for the ToolsRunner so that you can always easily run a tool task. + +Once you start the ToolsRunner, a list of all available tools will be displayed. After entering the tool name the corresponding tool will be run. + +### Available tasks +Name | Description +---- | ----------------------------- +- addJavaDocToMessageEnum | +- checkTestMocks | +- createCommandPage | +- describeHashAlgos | +- drawDependencyGraph | +- generateCommandsYml | +- generatePluginYml | +- updateConfigPage | +- updateDocs | +- updateTranslations | +- verifyHelpTranslations | +- verifyMessages | +- writePermissionsList | \ No newline at end of file From 9ecd2f9a3832e1434a7adeb9aad967cd1754bf71 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 17 Dec 2016 10:31:27 +0100 Subject: [PATCH 106/139] Destroyed Translation Interface (markdown) --- Translation-Interface.md | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 Translation-Interface.md diff --git a/Translation-Interface.md b/Translation-Interface.md deleted file mode 100644 index 7a5b521..0000000 --- a/Translation-Interface.md +++ /dev/null @@ -1,32 +0,0 @@ -This page describes how a translation from [the AuthMe translation web interface](https://jalu.ch/ext/authme/) can be integrated into the project. - -### Import messages -You need to know the public link of the translation to include (something like `https://jalu.ch/ext/authme/?p=b256dee50`). By appending `&json` to the URL you get the output in JSON (e.g. `https://jalu.ch/ext/authme/?p=b256dee50&json`). - -**Run the tool task `importMessages`** and supply the URL with `&json`: -```shell -Please enter the task to run: -> importMessages -Enter URL to import from -> https://jalu.ch/ext/authme/?p=b256dee50&json -``` - -This will fetch the data and update the messages YML file with the new data. Verify the changes before committing. - -### Export messages -After importing and verifying the messages, export the messages so that the server has the most recent version of the messages. **Run the tool task `exportMessages`.** - -```shell -Please enter the task to run: -> exportMessages -Enter language code of messages to export: -> fr -``` - ---- - -### Running tool tasks -Tool tasks are located in `src/test/java/tools`. Execute the `ToolsRunner` class, which will prompt you for the name of the task to run. - -### Authorization to export messages to the server -Updating the messages on the server (i.e. doing `exportMessages`) is protected by an IP address whitelist. If your request is rejected, go to `https://jalu.ch/ext/authme/admin` (login prompt) and add your IP address. \ No newline at end of file From ceb4ab6878d9b0fcbfa67a5d6d5787dae129b085 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 17 Dec 2016 10:32:14 +0100 Subject: [PATCH 107/139] Updated _Sidebar (markdown) --- _Sidebar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_Sidebar.md b/_Sidebar.md index 9f31c9f..e92c0c2 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -14,5 +14,5 @@ - [Command handling](Command-Handling) - [Dependency injection](Dependency-Injection) - [Development setup](Development-Setup) - - [Translation interface](Translation-Interface) + - [Tool tasks](Tool-tasks) - [Unit testing](Unit-Testing) \ No newline at end of file From 0a7ad01e73ddedb63f81446dce5ee15aa79a7873 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 17 Dec 2016 13:12:14 +0100 Subject: [PATCH 108/139] Add description & categorization for tasks --- Tool-tasks.md | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/Tool-tasks.md b/Tool-tasks.md index 9affe71..9376e83 100644 --- a/Tool-tasks.md +++ b/Tool-tasks.md @@ -2,19 +2,31 @@ _Tool tasks_ are tasks that can be run from the AuthMe codebase for various purp Once you start the ToolsRunner, a list of all available tools will be displayed. After entering the tool name the corresponding tool will be run. -### Available tasks -Name | Description ----- | ----------------------------- -- addJavaDocToMessageEnum | -- checkTestMocks | -- createCommandPage | -- describeHashAlgos | -- drawDependencyGraph | -- generateCommandsYml | -- generatePluginYml | -- updateConfigPage | -- updateDocs | -- updateTranslations | -- verifyHelpTranslations | -- verifyMessages | -- writePermissionsList | \ No newline at end of file +_Tool tasks_ are tasks that can be run from the AuthMe codebase for various purposes, e.g. to generate docs pages or to verify messages tasks. All tool tasks are started from the same runner, the ToolsRunner, located test/tools/ToolsRunner.java. Tip: you can save the run configuration for the ToolsRunner so that you can always easily run a tool task. + +Once you start the ToolsRunner, a list of all available tools will be displayed. After entering the tool name the corresponding tool will be run. + +## Available tasks +Cat | Name | Description +------------ | ----------------------- | ----------- +:paperclip: | addJavaDocToMessageEnum | Adds a JavaDoc comment to each MessageKey entry with the according English message. +:paperclip: | checkTestMocks | Checks that test classes' `@Mock` fields correspond to the tested class' `@Inject` fields. +:green_book: | createCommandPage | Updates the docs/commands.md page. +:green_book: | describeHashAlgos | Updates the docs/hash_algorithms.md page. +:paperclip: | drawDependencyGraph | Generates AuthMe's dependency graph as .dot file - requires GraphWiz to render. +:pencil2: | generateCommandsYml | Creates the commands.yml config file with default data. +:pencil2: | generatePluginYml | Generates the plugin.yml with up-to-date command and permission info. +:green_book: | updateConfigPage | Updates the docs/config.md page. +:green_book: | updateDocs | Updates all files in the docs/ folder. +:green_book: | updateTranslations | Updates the docs/translations.md page. +:flashlight: | verifyHelpTranslations | Verifies all or a specific help translation file in resources/messages. +:flashlight: | verifyMessages | Verifies all or a specific messages file in resources/messages. +:green_book: | writePermissionsList | Updates the docs/permission_nodes.md page. + +### Categories +Icon | Category +------------ | -------- +:green_book: | Docs/ page generation +:flashlight: | Verification task +:pencil2: | Project file udpate +:paperclip: | Technical task \ No newline at end of file From ce56b70108158063171aed9fa7ed1c71ae886092 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 17 Dec 2016 13:30:10 +0100 Subject: [PATCH 109/139] update description --- Tool-tasks.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Tool-tasks.md b/Tool-tasks.md index 9376e83..e1b9ec4 100644 --- a/Tool-tasks.md +++ b/Tool-tasks.md @@ -1,10 +1,6 @@ -_Tool tasks_ are tasks that can be run from the AuthMe codebase for various purposes, e.g. to generate docs pages or to verify messages tasks. All tool tasks are started from the same runner, the ToolsRunner, located test/tools/ToolsRunner.java. Tip: you can save the run configuration for the ToolsRunner so that you can always easily run a tool task. +_Tool tasks_ are tasks that can be run from the AuthMe codebase for various purposes, e.g. to generate docs pages or to verify the completeness of translation files. All tool tasks are started from the same runner, the ToolsRunner, located under `test/tools/ToolsRunner.java`. Tip: you can save the run configuration for the ToolsRunner so that you can easily run a tool task at any time. -Once you start the ToolsRunner, a list of all available tools will be displayed. After entering the tool name the corresponding tool will be run. - -_Tool tasks_ are tasks that can be run from the AuthMe codebase for various purposes, e.g. to generate docs pages or to verify messages tasks. All tool tasks are started from the same runner, the ToolsRunner, located test/tools/ToolsRunner.java. Tip: you can save the run configuration for the ToolsRunner so that you can always easily run a tool task. - -Once you start the ToolsRunner, a list of all available tools will be displayed. After entering the tool name the corresponding tool will be run. +Once you start the ToolsRunner, a list of all available tools will be displayed. After entering the name the corresponding task will be run. ## Available tasks Cat | Name | Description From 5da83e610f4f9fdddc3911f03f065f795883eb4c Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 17 Dec 2016 14:30:43 +0100 Subject: [PATCH 110/139] Add info about tag replacements --- Tool-tasks.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/Tool-tasks.md b/Tool-tasks.md index e1b9ec4..46a5b80 100644 --- a/Tool-tasks.md +++ b/Tool-tasks.md @@ -24,5 +24,54 @@ Icon | Category ------------ | -------- :green_book: | Docs/ page generation :flashlight: | Verification task -:pencil2: | Project file udpate -:paperclip: | Technical task \ No newline at end of file +:pencil2: | Project file update +:paperclip: | Technical task + +## Tag replacements +Markdown pages in the docs/ folder are created based on a template file. This template file may contain tags which are replaced with data during the generation process. For example: +```txt +A total of {total} commands are available: + +[#commands] +- {name}[perm], requires {perm}[/perm] +[/#commands] +``` + +Three types of tags are available: +- Replacement: `{total}`-like tags will be replaced with the value associated with "total" +- Conditional: `[perm]...[/perm]`-like tags are conditional tags. The text inside of the tags is only considered if the value associated with "perm" is not empty (empty string / empty collection) +- Repeating: tags like `[#commands]...[/#commands]` will make us iterate over all entries in "commands" and apply replacements to the text within + +Values can be associated to tag names with a `TagValueHolder`. Example: +```java +List commands = Arrays.asList( + new Command("/home", ""), new Command("/help", "permission.help")); + +NestedTagValue commandsInfo = new NestedTagValue(); +for (Command command : commands) { + TagValueHolder commandValues = TagValueHolder.create() + .put("name", command.getName()) + .put("permission", command.getPermission()); + commandsInfo.add(commandValues); +} + +TagValueHolder tagValues = TagValueHolder.create() + .put("total", commands.size()) + .put("commands", commandsInfo); + +// Generate MD file +FileIoUtils.generateFileFromTemplate("commands.tpl.md", "commands.md", tagValues); +``` + +The generated file would look like the following: +```md +A total of 2 commands are available: + +- /home +- /help, requires permission.help +``` + +The following predefined tags are at your disposal: +- `{gen_date}`: generation date (i.e. current date) +- `{gen_warning}`: comment warning not to edit the output file directly +- `{gen_footer}`: info footer with a link to the repo and the generation date \ No newline at end of file From 41dfc44df52c7b3a62bf29391eeae1398514ae90 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 17 Dec 2016 14:31:32 +0100 Subject: [PATCH 111/139] Updated Tool tasks (markdown) --- Tool-tasks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tool-tasks.md b/Tool-tasks.md index 46a5b80..158c3fa 100644 --- a/Tool-tasks.md +++ b/Tool-tasks.md @@ -51,7 +51,7 @@ NestedTagValue commandsInfo = new NestedTagValue(); for (Command command : commands) { TagValueHolder commandValues = TagValueHolder.create() .put("name", command.getName()) - .put("permission", command.getPermission()); + .put("perm", command.getPermission()); commandsInfo.add(commandValues); } From 59ae5f41e0e3c249f2f6cdc38057a12f9eda8755 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 18 Dec 2016 11:05:49 +0100 Subject: [PATCH 112/139] Update AuthMe-Team/AuthMeReloaded links to AuthMe/AuthMeReloaded --- Development-Setup.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Development-Setup.md b/Development-Setup.md index 96ace24..75f73ac 100644 --- a/Development-Setup.md +++ b/Development-Setup.md @@ -16,12 +16,12 @@ Issue link: https://github.com/Xephi/AuthMeReloaded/issues/$1 - Do you get an error message "missing argLine" when trying to run unit tests? Go to settings > search "Running Tests" and uncheck "argLine" # Forking AuthMe -- Please fork the [AuthMe-Team/AuthMeReloaded](https://github.com/AuthMe-Team/AuthMeReloaded) repo, NOT the one under Xephi's name. The AuthMe-Team repo is sometimes hundreds of commits ahead. +- Please fork the [AuthMe/AuthMeReloaded](https://github.com/AuthMe/AuthMeReloaded) repo, NOT the one under Xephi's name. The AuthMe/AuthMeReloaded repo is sometimes hundreds of commits ahead. -- Tip: add the AuthMe-Team repository to Git. Execute in console: `git remote add upstream https://github.com/AuthMe-Team/AuthMeReloaded.git`. In IntelliJ use Ctrl+Shift+A > "fetch" and you will see the branches of your repository as well as of the AuthMe-Team. +- Tip: add the AuthMe repository to Git. Execute in console: `git remote add upstream https://github.com/AuthMe/AuthMeReloaded.git`. In IntelliJ use Ctrl+Shift+A > "fetch" and you will see the branches of your repository as well as of the AuthMe-Team. - Do not commit _any_ changes to your master. Use it only to keep in sync with the upstream repo. This way you can always pull new changes from the parent repo into your local master without any conflicts. Then you can merge your local master with your custom branches to keep them up to date. - - If you commit changes to your fork's master directly, you will generate a merge commit every time you pull new changes from AuthMe-Team/AuthMeReloaded into your local master. This creates unnecessary noise in the Git history and generates ugly pull requests. + - If you commit changes to your fork's master directly, you will generate a merge commit every time you pull new changes from AuthMe/AuthMeReloaded into your local master. This creates unnecessary noise in the Git history and generates ugly pull requests. # Debugging AuthMe in IntelliJ See _[Run Configuration to Debug Bukkit/Minecraft Plugin in IntelliJ IDEA](http://stackoverflow.com/a/29945539)_ on StackOverflow. From 4ddbf1d3a3d87ff5083d646359f114b2d55821e7 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 24 Dec 2016 10:33:16 +0100 Subject: [PATCH 113/139] Created Translators (markdown) --- Translators.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Translators.md diff --git a/Translators.md b/Translators.md new file mode 100644 index 0000000..c4e2673 --- /dev/null +++ b/Translators.md @@ -0,0 +1,27 @@ +Language | Translators +-------- | ------------ +bg | @[JunkyBulgaria](https://github.com/JunkyBulgaria) +br | @[DeathrushW](https://github.com/DeathrushW) @[RoinujNosde](https://github.com/RoinujNosde) @[nathampa0909](https://github.com/nathampa0909) @[evernife](https://github.com/evernife) +cz | ? +de | @[Platinteufel](https://github.com/Platinteufel) @[EvilOlaf](https://github.com/EvilOlaf) @[irobin591](https://github.com/irobin591) +en | — +es | @[jeremy100](https://github.com/jeremy100) +eu | galaipa on Bukkit Dev (see commit `2119523`) +fi | ? +fr | @[Twonox](https://github.com/Twonox) +gl | ? +hu | @[rErEaT](https://github.com/rErEaT) +id | @[DNx5](https://github.com/DNx5) +it | @[Maxetto](https://github.com/Maxetto) +ko | @[wolfwork](https://github.com/wolfwork) +lt | ? +nl | @[timvisee](https://github.com/timvisee) +pl | @[RikoDEV](https://github.com/RikoDEV) +pt | @[ice41](https://github.com/ice41) +ro | @[nicuch](https://github.com/nicuch) +ru | @[DardBrinza](https://github.com/DardBrinza) @[DenPim](https://github.com/DenPim) @[Bodyash](https://github.com/Bodyash) +sk | ? +tr | @[smt287](https://github.com/smt287) +uk | @[Kixot14](https://github.com/Kixot14) @[Bodyash](https://github.com/Bodyash) +vn | @[tuanjr](https://github.com/tuanjr) kythuat on Bukkit dev +zh* | @[lifehome](https://github.com/lifehome) @[i998979](https://github.com/i998979) \ No newline at end of file From a100a04236543f2f8e719091b9b0fc469748a06b Mon Sep 17 00:00:00 2001 From: ljacqu Date: Mon, 26 Dec 2016 14:59:35 +0100 Subject: [PATCH 114/139] Updated Translators (markdown) --- Translators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Translators.md b/Translators.md index c4e2673..19e6e7a 100644 --- a/Translators.md +++ b/Translators.md @@ -2,7 +2,7 @@ Language | Translators -------- | ------------ bg | @[JunkyBulgaria](https://github.com/JunkyBulgaria) br | @[DeathrushW](https://github.com/DeathrushW) @[RoinujNosde](https://github.com/RoinujNosde) @[nathampa0909](https://github.com/nathampa0909) @[evernife](https://github.com/evernife) -cz | ? +cz | @[koca2000](https://github.com/koca2000) de | @[Platinteufel](https://github.com/Platinteufel) @[EvilOlaf](https://github.com/EvilOlaf) @[irobin591](https://github.com/irobin591) en | — es | @[jeremy100](https://github.com/jeremy100) From 7cd020cd518cd2a216f565b7b95d0fc65cfb35d5 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Tue, 27 Dec 2016 15:52:57 +0100 Subject: [PATCH 115/139] Updated Build History (markdown) --- Build-History.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Build-History.md b/Build-History.md index 761e957..b1b4a98 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,8 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1500 | [3604c70](https://github.com/AuthMe/AuthMeReloaded/commit/3604c70a54e6eee8c1230c0a7aad55e1f4b57637) +1480 | [2bd5fcd](https://github.com/AuthMe/AuthMeReloaded/commit/2bd5fcde3c981ca35d730f78feae3898d8646351) 1460 | [e9f274a](https://github.com/AuthMe/AuthMeReloaded/commit/e9f274aa89550de98e0fcd119b732185790c6d64) 1440 | [b3e276d](https://github.com/AuthMe/AuthMeReloaded/commit/b3e276d277765ca4fd2f007236caf7b08e9e8b6e) 1420 | [3dab5cd](https://github.com/AuthMe/AuthMeReloaded/commit/3dab5cd70ce6e391381ac3244f00540f303d9b3e) From c150370e7d28a7afdd1dd47088d9cc9d06e216bb Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 31 Dec 2016 15:49:32 +0100 Subject: [PATCH 116/139] Updated 5.2 Changelog (markdown) --- 5.2-Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/5.2-Changelog.md b/5.2-Changelog.md index 2bd201b..5d49007 100644 --- a/5.2-Changelog.md +++ b/5.2-Changelog.md @@ -14,6 +14,7 @@ This page lists all major changes introduced in AuthMe 5.2. It's a summarized li - Support specific legacy hashes ([#850](https://github.com/Xephi/AuthMeReloaded/issues/850)) - MySQL to SQLite converter ([[#933](https://github.com/Xephi/AuthMeReloaded/issues/933)](https://github.com/Xephi/AuthMeReloaded/issues/933)) - Command for updating the messages file ([#768](https://github.com/Xephi/AuthMeReloaded/issues/768)) +- Registering with password and email is possible (/register [pass] [email]) ([#427](https://github.com/Xephi/AuthMeReloaded/issues/427)) - Deprecate flat file: use SQLite instead ([#344](https://github.com/Xephi/AuthMeReloaded/issues/344)) **Improve email recovery** From 820871f7fd7a034d6d496e1edbb85e3e1e67b92a Mon Sep 17 00:00:00 2001 From: ljacqu Date: Thu, 5 Jan 2017 21:11:55 +0100 Subject: [PATCH 117/139] Updated _Sidebar (markdown) --- _Sidebar.md | 1 + 1 file changed, 1 insertion(+) diff --git a/_Sidebar.md b/_Sidebar.md index e92c0c2..ff0aa8b 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -4,6 +4,7 @@ - [Breaking changes](Breaking-Changes) - [Spawn handling](Spawn-Handling) - [Name restrictions](Name-Restrictions) + - [Translators](Translators) - [5.2 changelog](5.2-Changelog) - For developers using AuthMe - [Hooking into AuthMe](Hooking-into-AuthMe) From 8372ca721b143d502ed787841b48d06a7fcd6bbb Mon Sep 17 00:00:00 2001 From: ljacqu Date: Thu, 5 Jan 2017 21:13:04 +0100 Subject: [PATCH 118/139] Updated Translators (markdown) --- Translators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Translators.md b/Translators.md index 19e6e7a..6aa355a 100644 --- a/Translators.md +++ b/Translators.md @@ -24,4 +24,4 @@ sk | ? tr | @[smt287](https://github.com/smt287) uk | @[Kixot14](https://github.com/Kixot14) @[Bodyash](https://github.com/Bodyash) vn | @[tuanjr](https://github.com/tuanjr) kythuat on Bukkit dev -zh* | @[lifehome](https://github.com/lifehome) @[i998979](https://github.com/i998979) \ No newline at end of file +zh* | @[lifehome](https://github.com/lifehome) @[i998979](https://github.com/i998979); zhhk/zhmc: @[tsangsiuki12](https://github.com/tsangsiuki12) \ No newline at end of file From 616ef25269c83d1de50f4622871bc49a0c2aa2fb Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 7 Jan 2017 10:53:38 +0100 Subject: [PATCH 119/139] Created Registration (markdown) --- Registration.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Registration.md diff --git a/Registration.md b/Registration.md new file mode 100644 index 0000000..27c4fa3 --- /dev/null +++ b/Registration.md @@ -0,0 +1,10 @@ +AuthMe supports different types of registration. + +## Password Registration +The default registration: the user provides the password he wants to use to `/register`. The account is registered with the given password. + +## Email Registration +The user provides his email address to `/register`. AuthMe will generate a password for the account and email it to the given email address. + +## Two Factor Registration +:warning: **Work in progress** -- allows users to register with an authenticator app, i.e. each time they log in they have to enter a number generated by the app. \ No newline at end of file From f6ca47ff42883a3141609bf727cd44c58b5a6055 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 7 Jan 2017 12:00:52 +0100 Subject: [PATCH 120/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 3327d1d..3e43028 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.2 ([2017-01-07](https://github.com/AuthMe/AuthMeReloaded/commit/385f7d6b1d13cba58d7446cf6b7e9762fca88e09)) | In the messages file, `reg_email_msg` no longer exists. Update `reg_msg` with the proper arguments. 5.2 ([2016-11-13](https://github.com/AuthMe/AuthMeReloaded/commit/bb89a59a8a3db9be6a2c0a0f8eab5a22f1b10abb)) | To support old hashes, you now need to list the hashes in the setting `legacyHashes` 5.2 ([2016-09-04](https://github.com/AuthMe/AuthMeReloaded/commit/5efed1b697e03785bba5f96dbc3af69f82b0a28a)) | Dropped support for Java 7 5.2 ([2016-09-04](https://github.com/AuthMe/AuthMeReloaded/commit/7deb75ab856250ef84934d578960b4850a313ec8)) | Permissions: support for GroupManager (not via Vault) removed. From 1cc635fae8c60f25cf1e444d1a380a49149204da Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 7 Jan 2017 12:03:04 +0100 Subject: [PATCH 121/139] Updated 5.2 Changelog (markdown) --- 5.2-Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/5.2-Changelog.md b/5.2-Changelog.md index 5d49007..f1e17a3 100644 --- a/5.2-Changelog.md +++ b/5.2-Changelog.md @@ -11,6 +11,7 @@ This page lists all major changes introduced in AuthMe 5.2. It's a summarized li - Translatable help section ([#293](https://github.com/Xephi/AuthMeReloaded/issues/293)) - Integration with IPB4 ([#483](https://github.com/Xephi/AuthMeReloaded/issues/483)) - Run a custom command when more than x alts are detected ([#459](https://github.com/Xephi/AuthMeReloaded/issues/459)) +- Allow to change the message when a player joins ([#1044](https://github.com/Xephi/AuthMeReloaded/issues/1044)) - Support specific legacy hashes ([#850](https://github.com/Xephi/AuthMeReloaded/issues/850)) - MySQL to SQLite converter ([[#933](https://github.com/Xephi/AuthMeReloaded/issues/933)](https://github.com/Xephi/AuthMeReloaded/issues/933)) - Command for updating the messages file ([#768](https://github.com/Xephi/AuthMeReloaded/issues/768)) From f50266fbb1fe7bea94774b54143353179b7bf61d Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 22 Jan 2017 12:58:38 +0100 Subject: [PATCH 122/139] Updated _Sidebar (markdown) --- _Sidebar.md | 1 + 1 file changed, 1 insertion(+) diff --git a/_Sidebar.md b/_Sidebar.md index ff0aa8b..5b55d52 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -4,6 +4,7 @@ - [Breaking changes](Breaking-Changes) - [Spawn handling](Spawn-Handling) - [Name restrictions](Name-Restrictions) + - [Registration](Registration) - [Translators](Translators) - [5.2 changelog](5.2-Changelog) - For developers using AuthMe From 8d78419665edab3a14e263db4292442406804af7 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 22 Jan 2017 13:01:27 +0100 Subject: [PATCH 123/139] Updated Build History (markdown) --- Build-History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build-History.md b/Build-History.md index b1b4a98..93e374b 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,7 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1520 | [fe86299](https://github.com/AuthMe/AuthMeReloaded/commit/fe86299c7dada3a1c492789b926ca1f54429e345) 1500 | [3604c70](https://github.com/AuthMe/AuthMeReloaded/commit/3604c70a54e6eee8c1230c0a7aad55e1f4b57637) 1480 | [2bd5fcd](https://github.com/AuthMe/AuthMeReloaded/commit/2bd5fcde3c981ca35d730f78feae3898d8646351) 1460 | [e9f274a](https://github.com/AuthMe/AuthMeReloaded/commit/e9f274aa89550de98e0fcd119b732185790c6d64) From 13cc54c018badcf9e51c966f177397f3d2b0d5db Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 22 Jan 2017 13:31:24 +0100 Subject: [PATCH 124/139] Updated Registration (markdown) --- Registration.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Registration.md b/Registration.md index 27c4fa3..062911b 100644 --- a/Registration.md +++ b/Registration.md @@ -1,8 +1,13 @@ -AuthMe supports different types of registration. +AuthMe supports different types of registration. You can configure the type of registration by changing the `type` setting under `registration` in your config.yml. ## Password Registration The default registration: the user provides the password he wants to use to `/register`. The account is registered with the given password. +You can disable passwords from being used in `unsafePasswords` and length restrictions can be configured with `minPasswordLength` and `passwordMaxLength` in config.yml. + +**Example:** +> Player "Bobby" uses `/register s3cret s3cret` -> AuthMe registers "Bobby" with password "s3cret" + ## Email Registration The user provides his email address to `/register`. AuthMe will generate a password for the account and email it to the given email address. From f83fc876b8b254e42ef7286df4811fc598a7723a Mon Sep 17 00:00:00 2001 From: Alexandre Vanhecke Date: Sun, 29 Jan 2017 14:41:09 +0100 Subject: [PATCH 125/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 3e43028..b983be2 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -16,7 +16,7 @@ Version | Description 5.2 ([2015-12-28](https://github.com/AuthMe/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically change to SHA256 HashAlgorithm 5.2 ([2015-12-26](https://github.com/AuthMe/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_/_from_ flatfile no longer supported. Use Sqlite. 5.2 ([2015-12-23](https://github.com/AuthMe/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` -5.2 ([2015-12-22](https://github.com/AuthMe/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe/AuthMeReloaded/blob/8f098933371767130b2a533ec9ad0f6075c2522b/src/main/resources/email.html)) +5.2 ([2015-12-22](https://github.com/AuthMe/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](hhttps://github.com/AuthMe/AuthMeReloaded/blob/master/src/main/resources/email.html)) 5.1 ([2015‑12‑05](https://github.com/AuthMe/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) 5.1 ([2015-12-04](https://github.com/AuthMe/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) | Configurable text sent in email moved from config.yml to email.html 5.1 ([2015-11-27](https://github.com/AuthMe/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case From 7f23380ec8ad2ed52719ab36b6d14be284db15f0 Mon Sep 17 00:00:00 2001 From: Alexandre Vanhecke Date: Sun, 29 Jan 2017 14:41:47 +0100 Subject: [PATCH 126/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index b983be2..8759958 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -16,7 +16,7 @@ Version | Description 5.2 ([2015-12-28](https://github.com/AuthMe/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically change to SHA256 HashAlgorithm 5.2 ([2015-12-26](https://github.com/AuthMe/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_/_from_ flatfile no longer supported. Use Sqlite. 5.2 ([2015-12-23](https://github.com/AuthMe/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` -5.2 ([2015-12-22](https://github.com/AuthMe/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](hhttps://github.com/AuthMe/AuthMeReloaded/blob/master/src/main/resources/email.html)) +5.2 ([2015-12-22](https://github.com/AuthMe/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe/AuthMeReloaded/blob/master/src/main/resources/email.html)) 5.1 ([2015‑12‑05](https://github.com/AuthMe/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) 5.1 ([2015-12-04](https://github.com/AuthMe/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) | Configurable text sent in email moved from config.yml to email.html 5.1 ([2015-11-27](https://github.com/AuthMe/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case From 35ecfa10974307a510125cab06cd868f58870ae7 Mon Sep 17 00:00:00 2001 From: Alexandre Vanhecke Date: Sun, 29 Jan 2017 14:43:04 +0100 Subject: [PATCH 127/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 8759958..69a5f04 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -16,7 +16,7 @@ Version | Description 5.2 ([2015-12-28](https://github.com/AuthMe/AuthMeReloaded/commit/0688a8645a31e61f2055227e1bd63d2b5bb8859a)) | PlainText is automatically change to SHA256 HashAlgorithm 5.2 ([2015-12-26](https://github.com/AuthMe/AuthMeReloaded/commit/41e400e9dd9c6a5194bb739d022d81d004a4159d)) | Flatfile data source and converters _to_/_from_ flatfile no longer supported. Use Sqlite. 5.2 ([2015-12-23](https://github.com/AuthMe/AuthMeReloaded/commit/8bfb56f34e010a96107bd435b94ce7bd7fc527fd)) | Setting `settings.restrictions.enablePasswordVerifier` renamed to `enablePasswordConfirmation` -5.2 ([2015-12-22](https://github.com/AuthMe/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe/AuthMeReloaded/blob/master/src/main/resources/email.html)) +5.2 ([2015-12-22](https://github.com/AuthMe/AuthMeReloaded/commit/8f098933371767130b2a533ec9ad0f6075c2522b)) | email.html: Placeholders are like ``, not `` or `%playername%`. ([Template](https://github.com/AuthMe/AuthMeReloaded/blob/18dbcfde890ac2c756c3d3ff387007ae00733f52/src/main/resources/email.html)) 5.1 ([2015‑12‑05](https://github.com/AuthMe/AuthMeReloaded/commit/f1c3eed0699e15640731c4cd06f5feb198ef6553)) | Changed permission nodes ([up-to-date list](https://github.com/AuthMe/AuthMeReloaded/blob/master/src/tools/docs/permission_nodes.md)) 5.1 ([2015-12-04](https://github.com/AuthMe/AuthMeReloaded/commit/e781115d7cf66db57a436de8d21693aa05d50be3)) | Configurable text sent in email moved from config.yml to email.html 5.1 ([2015-11-27](https://github.com/AuthMe/AuthMeReloaded/commit/67244d5e7bf45b58323fdd9808afe5d245d67c66)) | Bug fix: Using /authme register no longer changes the password to all lower-case From c1fc2fea66cdb1fc3f72b6aa45a0a6c161e2a7a7 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 26 Feb 2017 11:58:01 +0100 Subject: [PATCH 128/139] Updated 5.2 Changelog (markdown) --- 5.2-Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.2-Changelog.md b/5.2-Changelog.md index f1e17a3..79814eb 100644 --- a/5.2-Changelog.md +++ b/5.2-Changelog.md @@ -1,4 +1,4 @@ -This page lists all major changes introduced in AuthMe 5.2. It's a summarized list of all [closed issues in the 5.2 milestone](https://github.com/Xephi/AuthMeReloaded/milestone/1?closed=1). To see which changes may require an action form your side, please see [Breaking Changes](Breaking-Changes). +This page lists all major changes introduced in AuthMe 5.2. It's a summarized list of all [closed issues in the 5.2 milestone](https://github.com/Xephi/AuthMeReloaded/milestone/1?closed=1). To see which changes may require an action on your side, please see [Breaking Changes](Breaking-Changes). **Shiny new features** From 1bdd8c93af658bf39a6c6d0b0e6d9892bc936b54 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 26 Feb 2017 14:30:07 +0100 Subject: [PATCH 129/139] Updated Development Setup (markdown) --- Development-Setup.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Development-Setup.md b/Development-Setup.md index 75f73ac..5cb984c 100644 --- a/Development-Setup.md +++ b/Development-Setup.md @@ -1,5 +1,10 @@ Some tips and recommendations for people who want to work on AuthMe. +# Maven +If the `org.bukkit` classes are not available as a dependency, ensure that the Maven profile "spigot" is enabled. This adds the Spigot API as dependency to the project. Alternatively, you can enable the "bukkit" profile (be sure to disable "spigot" then). This allows us to easily verify that our code compiles against both APIs. + +For local development, you can enable the profile "skipLongHashTests". This disables some of the hash algorithm tests and shaves off a substantial amount of time from the build time. + # IntelliJ - Make sure you are running idea**64**.exe if on a 64-bit operating system (faster). From a9c7c1dbffbb3cf0f49164b786091fe7691a7d4f Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 4 Mar 2017 18:17:41 +0100 Subject: [PATCH 130/139] Created Configuring logging (markdown) --- Configuring-logging.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Configuring-logging.md diff --git a/Configuring-logging.md b/Configuring-logging.md new file mode 100644 index 0000000..1ec6c7a --- /dev/null +++ b/Configuring-logging.md @@ -0,0 +1,7 @@ +The configuration file config.yml contains two settings that influence the logging that AuthMe will perform. + +#### Security.console.logConsole (true / false) +If set to `true`, everything that AuthMe logs to the console will also be saved in authme.log. If a technical error occurs (called _Exception_ in Java), the full stacktrace is logged (= more details). If such an error occurs, it's very interesting for us to know about these details in authme.log. + +#### settings.logLevel (INFO / FINE / DEBUG) +We recommend `FINE`. This logs, additionally to the INFO ones, some finer details which are still relevant and interesting to keep in a log. Use `DEBUG` if you're interested in seeing a lot of information from AuthMe. This is typically only used when you're trying to find the cause of an issue with AuthMe. From 440949aa9b214d6f24424082d6021d75b454e652 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 4 Mar 2017 18:18:03 +0100 Subject: [PATCH 131/139] Updated _Sidebar (markdown) --- _Sidebar.md | 1 + 1 file changed, 1 insertion(+) diff --git a/_Sidebar.md b/_Sidebar.md index 5b55d52..a677a4a 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -5,6 +5,7 @@ - [Spawn handling](Spawn-Handling) - [Name restrictions](Name-Restrictions) - [Registration](Registration) + - [Logging](Configuring-logging) - [Translators](Translators) - [5.2 changelog](5.2-Changelog) - For developers using AuthMe From 185f4d59231f70413e2eb098aae1751df538f25c Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 4 Mar 2017 18:19:07 +0100 Subject: [PATCH 132/139] Updated Configuring logging (markdown) --- Configuring-logging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configuring-logging.md b/Configuring-logging.md index 1ec6c7a..1ef558f 100644 --- a/Configuring-logging.md +++ b/Configuring-logging.md @@ -1,7 +1,7 @@ The configuration file config.yml contains two settings that influence the logging that AuthMe will perform. #### Security.console.logConsole (true / false) -If set to `true`, everything that AuthMe logs to the console will also be saved in authme.log. If a technical error occurs (called _Exception_ in Java), the full stacktrace is logged (= more details). If such an error occurs, it's very interesting for us to know about these details in authme.log. +If set to `true`, everything that AuthMe logs to the console will also be saved in authme.log. If a technical error occurs (called _Exception_ in Java), the full stacktrace is logged. This provides more technical details about the error, which are very interesting for us developers to know about. #### settings.logLevel (INFO / FINE / DEBUG) We recommend `FINE`. This logs, additionally to the INFO ones, some finer details which are still relevant and interesting to keep in a log. Use `DEBUG` if you're interested in seeing a lot of information from AuthMe. This is typically only used when you're trying to find the cause of an issue with AuthMe. From 8ac9c0ccbdf2a13612ec697486d5aeb8122f4d80 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 4 Mar 2017 18:21:43 +0100 Subject: [PATCH 133/139] Updated Translators (markdown) --- Translators.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Translators.md b/Translators.md index 6aa355a..68cb393 100644 --- a/Translators.md +++ b/Translators.md @@ -1,6 +1,6 @@ Language | Translators -------- | ------------ -bg | @[JunkyBulgaria](https://github.com/JunkyBulgaria) +bg | @[JunkyBulgaria](https://github.com/JunkyBulgaria) @[Krokit](https://github.com/Krokit) br | @[DeathrushW](https://github.com/DeathrushW) @[RoinujNosde](https://github.com/RoinujNosde) @[nathampa0909](https://github.com/nathampa0909) @[evernife](https://github.com/evernife) cz | @[koca2000](https://github.com/koca2000) de | @[Platinteufel](https://github.com/Platinteufel) @[EvilOlaf](https://github.com/EvilOlaf) @[irobin591](https://github.com/irobin591) @@ -21,7 +21,7 @@ pt | @[ice41](https://github.com/ice41) ro | @[nicuch](https://github.com/nicuch) ru | @[DardBrinza](https://github.com/DardBrinza) @[DenPim](https://github.com/DenPim) @[Bodyash](https://github.com/Bodyash) sk | ? -tr | @[smt287](https://github.com/smt287) +tr | @[smt287](https://github.com/smt287) @[Twonox](https://github.com/Twonox) uk | @[Kixot14](https://github.com/Kixot14) @[Bodyash](https://github.com/Bodyash) vn | @[tuanjr](https://github.com/tuanjr) kythuat on Bukkit dev -zh* | @[lifehome](https://github.com/lifehome) @[i998979](https://github.com/i998979); zhhk/zhmc: @[tsangsiuki12](https://github.com/tsangsiuki12) \ No newline at end of file +zh* | @[lifehome](https://github.com/lifehome) @[i998979](https://github.com/i998979); zhhk/zhmc: @[tsangsiuki12](https://github.com/tsangsiuki12); zhcn: @[Playhi](https://github.com/Playhi) \ No newline at end of file From 6887fa1b5ced8dbb5cfe793d6c9482e766509fe7 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 5 Mar 2017 11:18:16 +0100 Subject: [PATCH 134/139] Add Checkstyle integration --- Development-Setup.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Development-Setup.md b/Development-Setup.md index 5cb984c..453cb4b 100644 --- a/Development-Setup.md +++ b/Development-Setup.md @@ -20,6 +20,15 @@ Issue link: https://github.com/Xephi/AuthMeReloaded/issues/$1 - Do you get an error message "missing argLine" when trying to run unit tests? Go to settings > search "Running Tests" and uncheck "argLine" +### Checkstyle +IntelliJ has a checkstyle plugin that nicely couples with our use of [Code Climate](https://codeclimate.com/github/AuthMe/AuthMeReloaded/issues). With the plugin you can perform the same validations in your IDE as is done on remotely on Code Climate. + +- Ctrl+Shift+A, type "Plugins" and search for "Checkstyle". If it doesn't appear click on "Search repositories." +- Install Checkstyle-IDEA +- In File > Settings > Other Settings > Checkstyle, add the configuration file (.checkstyle.xml). Don't forget to check the "Active" checkbox. + +After this, checkstyle will automatically run on your IDE and rule violations will be shown as warnings. + # Forking AuthMe - Please fork the [AuthMe/AuthMeReloaded](https://github.com/AuthMe/AuthMeReloaded) repo, NOT the one under Xephi's name. The AuthMe/AuthMeReloaded repo is sometimes hundreds of commits ahead. From 4ffd23a6f26b3a9126e3db1b7aedc0a8ddac6bba Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 12 Mar 2017 12:00:41 +0100 Subject: [PATCH 135/139] add new pt translator --- Translators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Translators.md b/Translators.md index 68cb393..56e4967 100644 --- a/Translators.md +++ b/Translators.md @@ -17,7 +17,7 @@ ko | @[wolfwork](https://github.com/wolfwork) lt | ? nl | @[timvisee](https://github.com/timvisee) pl | @[RikoDEV](https://github.com/RikoDEV) -pt | @[ice41](https://github.com/ice41) +pt | @[ice41](https://github.com/ice41) @[rafael59r2](https://github.com/rafael59r2) ro | @[nicuch](https://github.com/nicuch) ru | @[DardBrinza](https://github.com/DardBrinza) @[DenPim](https://github.com/DenPim) @[Bodyash](https://github.com/Bodyash) sk | ? From 1b9e73dbc5167a7f8d273c2255abde258a5cfec3 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 19 Mar 2017 12:06:08 +0100 Subject: [PATCH 136/139] Updated Build History (markdown) --- Build-History.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Build-History.md b/Build-History.md index 93e374b..5f7199d 100644 --- a/Build-History.md +++ b/Build-History.md @@ -3,6 +3,10 @@ History of build numbers and the commit that initiated the build on [Jenkins](ht Build nr. | Commit --------- | -------------- +1600 | https://github.com/AuthMe/AuthMeReloaded/commit/1da74cb987c0c8c472d0373f2a730eea549c430a +1580 | https://github.com/AuthMe/AuthMeReloaded/commit/c079f5f3d56ace12f5592693450ca8cb9d7fd625 +1560 | https://github.com/AuthMe/AuthMeReloaded/commit/ef1d006cdfa01eee9c3c835247598976d89be06a +1540 | https://github.com/AuthMe/AuthMeReloaded/commit/12566f03ef4a4541a5e5ab7e46834581895518f7 1520 | [fe86299](https://github.com/AuthMe/AuthMeReloaded/commit/fe86299c7dada3a1c492789b926ca1f54429e345) 1500 | [3604c70](https://github.com/AuthMe/AuthMeReloaded/commit/3604c70a54e6eee8c1230c0a7aad55e1f4b57637) 1480 | [2bd5fcd](https://github.com/AuthMe/AuthMeReloaded/commit/2bd5fcde3c981ca35d730f78feae3898d8646351) From 4c9c03412bc69297104b0f20cb83e27aadca8a5b Mon Sep 17 00:00:00 2001 From: ljacqu Date: Thu, 23 Mar 2017 23:09:20 +0100 Subject: [PATCH 137/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 69a5f04..6b1d81d 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.3 ([2017-03-12](https://github.com/AuthMe/AuthMeReloaded/commit/8557621c02c13c9b172302f547ad0180d9fe64ac)) | `SaveQuitLocation: false` no longer restores the quit location for players (as the setting would suggest) 5.2 ([2017-01-07](https://github.com/AuthMe/AuthMeReloaded/commit/385f7d6b1d13cba58d7446cf6b7e9762fca88e09)) | In the messages file, `reg_email_msg` no longer exists. Update `reg_msg` with the proper arguments. 5.2 ([2016-11-13](https://github.com/AuthMe/AuthMeReloaded/commit/bb89a59a8a3db9be6a2c0a0f8eab5a22f1b10abb)) | To support old hashes, you now need to list the hashes in the setting `legacyHashes` 5.2 ([2016-09-04](https://github.com/AuthMe/AuthMeReloaded/commit/5efed1b697e03785bba5f96dbc3af69f82b0a28a)) | Dropped support for Java 7 From 4027b376d546c9e2cfcf954099ed84afb6187569 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Fri, 24 Mar 2017 21:32:53 +0100 Subject: [PATCH 138/139] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 6b1d81d..a2fa0f4 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -2,6 +2,7 @@ This page contains a list of _breaking changes_, i.e. of changes in AuthMe that Version | Description ----------------------------- | ---------- +5.3 ([2017-03-24](https://github.com/AuthMe/AuthMeReloaded/commit/2f90a45f4351d80c4b04d5ca9d07f3ebf2ed62d6)) | `removeSpeed` option no longer exists; speed is removed from unauthenticated players if `allowMovement` is `false` 5.3 ([2017-03-12](https://github.com/AuthMe/AuthMeReloaded/commit/8557621c02c13c9b172302f547ad0180d9fe64ac)) | `SaveQuitLocation: false` no longer restores the quit location for players (as the setting would suggest) 5.2 ([2017-01-07](https://github.com/AuthMe/AuthMeReloaded/commit/385f7d6b1d13cba58d7446cf6b7e9762fca88e09)) | In the messages file, `reg_email_msg` no longer exists. Update `reg_msg` with the proper arguments. 5.2 ([2016-11-13](https://github.com/AuthMe/AuthMeReloaded/commit/bb89a59a8a3db9be6a2c0a0f8eab5a22f1b10abb)) | To support old hashes, you now need to list the hashes in the setting `legacyHashes` From 9a8143192c1aaf0742e04bdc1abd36a627e33599 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Fri, 24 Mar 2017 23:10:08 +0100 Subject: [PATCH 139/139] Add entry for task 'checkMessageUses' --- Tool-tasks.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Tool-tasks.md b/Tool-tasks.md index 158c3fa..be0cc24 100644 --- a/Tool-tasks.md +++ b/Tool-tasks.md @@ -6,6 +6,7 @@ Once you start the ToolsRunner, a list of all available tools will be displayed. Cat | Name | Description ------------ | ----------------------- | ----------- :paperclip: | addJavaDocToMessageEnum | Adds a JavaDoc comment to each MessageKey entry with the according English message. +:flashlight: | checkMessageUses | Finds message keys which aren't used anywhere :paperclip: | checkTestMocks | Checks that test classes' `@Mock` fields correspond to the tested class' `@Inject` fields. :green_book: | createCommandPage | Updates the docs/commands.md page. :green_book: | describeHashAlgos | Updates the docs/hash_algorithms.md page.