Commit Graph

294 Commits

Author SHA1 Message Date
ljacqu 50dbbb8d87 #1254 Create command to see recently logged in players
- Create datasource method to fetch most recent players by last login date
- Add command to view last logged in players
2017-11-28 21:07:10 +01:00
ljacqu 5c40cb3b73 Insert null email as DEFAULT so column default may take effect
Ugly implementation to fit into AuthMe 5.4. If email on PlayerAuth is null, do not supply NULL as the email value but use DEFAULT instead so that the default value is used if present in the column configuration.
2017-11-04 11:29:21 +01:00
ljacqu c7ba06e2b9 Fix test / use new DataSource method / add space before keywords 2017-11-03 19:57:40 +01:00
Gabriele C 273c318e96 Cleanup 2017-11-02 11:24:17 +01:00
ljacqu e3dd719b0e #792 Migrate last IP column if is NOT NULL without default value (#1385)
- Move MySQL migrations into a separate class
- Add migration for last IP column to be nullable if it has a not null constraint without a default value
2017-10-29 07:52:11 +01:00
ljacqu d6e2369f36 #792 Force migration of SQLite when necessary (#1371)
- Detect if a migration is necessary
- Create a backup
- Perform the migration
2017-10-22 09:16:48 +02:00
ljacqu 58657f5d3f Merge branch 'master' of https://github.com/AuthMe/AuthMeReloaded into 792-add-registration-date-and-ip 2017-10-21 10:46:17 +02:00
ljacqu 1651a61063 #792 #814 Implement SQLite migration, allow last IP to be nullable in MySQL
- Old SQLite setups have the last IP column as NOT NULL but without a default value. With the new concept (where we don't set a last IP on player registration) it fails.
  - Create an /authme debug child that allows to migrate SQLite (tricky because SQLite does not support dropping or modifying columns)
  - Allow last IP column to be NOT NULL in MySQL as well (extend MySQL /authme debug child)
- Add TODO comments with follow-up issue to extend our commands with new registration IP field
2017-10-21 10:45:48 +02:00
ljacqu b5ea48085c #792 DataSource: when creating registrationDate column, set all rows to the current date 2017-10-20 21:31:58 +02:00
sgdc3 251eca9ccd Fix #1360 2017-10-20 00:11:42 +02:00
ljacqu 90073ef95d Merge branch 'master' of https://github.com/AuthMe/AuthMeReloaded into 792-registration-date-and-ip
Conflicts:
	src/main/java/fr/xephi/authme/command/executable/authme/RegisterAdminCommand.java
	src/main/java/fr/xephi/authme/datasource/Columns.java
	src/main/java/fr/xephi/authme/datasource/SQLite.java
	src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java
	src/main/java/fr/xephi/authme/service/SessionService.java
	src/main/java/fr/xephi/authme/settings/properties/DatabaseSettings.java
	src/test/java/fr/xephi/authme/service/SessionServiceTest.java
	src/test/resources/fr/xephi/authme/datasource/sql-initialize.sql
2017-10-15 23:45:41 +02:00
Gabriele C 22e95493de #1031 Introduce hasSession field in datasource (#1351)
* Introduce hasSession field in datasource

That makes isLogged more consistent as it will be '1' only when the player is online.

* Fixes

* Fix unit testing

* Update config doc

* Create SessionService

* Create test for SessionService, avoid DB operations if sessions are disabled

* Cleanup: remove outdated warning for session timeout = 0
- Remove outdated warning
- Encapsulate session enabled check in SessionService

* Fix failing SessionServiceTest, add data source integration tests for session methods
2017-10-15 18:32:51 +02:00
ljacqu ea58e20c3d #792 Include registration date into purging logic
- Take MAX(reg_date, login_date) as timestamp to compare against
- Remove the second "all" parameter to include entries with 0 registration date -> we expect registration date to always be set to the current date, so the parameter becomes obsolete
2017-10-15 18:29:01 +02:00
ljacqu 1df5308e56 #792 #814 Create command to remove NOT NULL constraints
- Create command under /authme debug that allows to change the 'nullable' status of MySQL columns (currently last date and email only)
   - We need to offer a default value for forum integrations that have a NOT NULL email column. Offering a command avoids us from force-migrating existing databases while still offering migrations in both directions
- Change in default value handling: lack of values are not handled by setting default values to the PlayerAuth anymore, and reading a default value from the database into a PlayerAuth will be translated into null by the PlayerAuth builder
- When a new database is created, email and lastlogin are now nullable and lack a default a value

Open points:
- Finish MySqlDefaultChangerTest
- Revise purging logic (#792)
- Allow to have more columns nullable (#814)
2017-10-15 12:56:13 +02:00
ljacqu 52d6476058 #792 Add columns for registration IP and registration date
- Add columns for reg date and IP
- Rename "ip" to "last IP"
2017-10-14 17:37:34 +02:00
ljacqu f1bed873d5 Minor - remove code duplication 2017-10-08 01:22:25 +02:00
Gabriele C e59df84a84 Fix session system (#1337)
* Old session system

* Actually check if sessions are enabled

* Cleanup

* Don't use cached isLogged value
2017-09-30 15:15:25 +02:00
sgdc3 920e65c4f4 Codestyle cleanup 2017-09-27 15:16:33 +02:00
ljacqu 8eceaa8cbb #1255 Simplify MySQL data source extensions
- Mostly oving the logic of getting the ID from the DB to the extensions superclass
2017-07-23 16:38:35 +02:00
ljacqu cbc794ba20 #1255 Extract forum-specific data source actions into separate extension classes 2017-07-23 14:19:28 +02:00
ljacqu f88350b06d Fix Checkstyle violations
- Mostly missing Javadoc on large methods
- CommandInitializer: split command building method into multiple methods
2017-07-16 23:07:13 +02:00
DNx 87b9bf140d Add database setting to configure HikariCP 'maxLifetime' #1279 2017-07-12 07:21:05 +07:00
Gabriele C 4e61117ef7 Add xf table prefix to config
#957
2017-07-06 18:46:24 +02:00
Gabriele C b24dcfed3c Try to fix #1261 2017-07-02 13:21:04 +02:00
Alexandre Vanhecke a167429fbc perf(datasource): Use try-with-resources when it's possible 2017-05-21 15:13:40 +02:00
ljacqu e5bfbf6304 #1023 LoginSecurity converter: fix last login conversion, extend test 2017-05-13 09:37:36 +02:00
ljacqu 2021113732 #1023 Create LoginSecurity converter 2017-05-10 19:45:20 +02:00
ljacqu 1f8307c8f6 Fix minor checkstyle issues
- Add JavaDoc where checkstyle expects it
- Fix line too long issues
- ...
2017-05-07 11:59:01 +02:00
ljacqu b7c35cb3a7 Merge branch 'master' of https://github.com/AuthMe/AuthMeReloaded into explicit-getters-from-db 2017-04-29 08:19:30 +02:00
ljacqu 82d74ca0a7 Move close methods out of sql datasource utils class
As noticed by @Gnat008
- We need two different implementations for MySQL and SQLite because SQLite uses an older version where #isClosed is not implemented
2017-04-29 08:18:43 +02:00
ljacqu d0dbc14358 Minor - fix some small todo's 2017-04-23 11:02:43 +02:00
ljacqu e56a3c0ab6 #815 Save yaw & pitch for last login in SQL data sources 2017-04-22 13:30:03 +02:00
ljacqu 07633a89c8 Create SQL data source utils class
- Extract logic used in SQLite and MySQL for logging and closing SQL objects
    - Decided to leave buildAuthFromResultSet methods individually as this might be more implementation-specific
- Rename DataSource#close to DataSource#closeConnection to fix conflict with static import
2017-04-18 22:55:39 +02:00
ljacqu 04ca36fe53 Use more specific query to get logged in players without email
- Reduces the amount of data returned from the DB and the work required to build objects
2017-04-18 22:30:54 +02:00
ljacqu 2f7ebc0ecb Remove static PlayerCache#getInstance 2017-04-18 21:57:20 +02:00
ljacqu b99cc3bada #1127 Create DataSource#getEmail 2017-04-18 21:07:31 +02:00
ljacqu a764598f88 Adjust repo links in code 2017-03-28 08:11:00 +02:00
ljacqu 32a664ef59 Update checkstyle config and CodeClimate exclusions
- Add new checkstyle checks: require Javadoc on large private methods, default in switch, declaration order & others
- Update path exclusions in CodeClimate config to match newly renamed classes (e.g. PHPBB -> PhpBB)
  - Create consistency check testing that excluded paths exist as classes
- Fix some trivial violations
2017-03-23 10:34:28 +01:00
ljacqu 8f197bbebf #1128 Rename converter classes to start with uppercase letter 2017-03-17 19:28:40 +01:00
ljacqu 8ebb3c6b5a Merge branch 'master' of https://github.com/AuthMe/AuthMeReloaded into 1128-camel-case-rename 2017-03-17 18:50:57 +01:00
ljacqu 731d085ccd #1128 Rename to camel case (PR #235)
* rename classes according to cammel case and make code reflect these updates

* rename according to cammel case

* rename to camel case more accuratley

* rename to camel case try 3; fix Ipb4 java doc

* retry rename camel case

* rename to camel case
2017-03-17 18:49:30 +01:00
Martin 5ca1c17771 Xenforo support
Added in-game xenforo support. User can register/login in-game, in
website only login. Register have issues i will try to fix it.
2017-03-08 01:21:29 +02:00
Martin 6d67b82860 Xenforo
Added Xenforo group
2017-03-06 06:31:51 +02:00
Martin 7f8b31f9d4 Merge remote-tracking branch 'refs/remotes/AuthMe/master' 2017-03-06 06:16:34 +02:00
Martin 648e71cf0f IPB4 Improve
IPB4 prefix, group, lastvisit support added.
2017-03-06 06:11:59 +02:00
ljacqu 8aa573b9ed Minor fixes as found by Checkstyle 2017-03-05 10:58:29 +01:00
ljacqu 009d82c0a9 #1120 Use empty "realname" when converting from flatfile
- FlatFile doesn't store the "realname" - all names are always in all-lowercase. Converting from flatfile to other data source should therefore not take over an auth's realname
- Adjust sample flatfile file to only have all-lowercase usernames
2017-03-04 17:52:08 +01:00
Gabriele C f0f2398e47 Incrase the auto poolSize value 2017-02-15 23:27:25 +01:00
ljacqu 666e242212 Delete CollectionUtils (unused) 2017-01-21 14:47:18 +01:00
Gabriele C 26194d676d #1063 Add useSSL option 2017-01-14 22:14:37 +01:00