Compare commits

..

10 Commits

Author SHA1 Message Date
HaHaWTH e3c460e614 B42 release 2024-02-03 20:07:32 +08:00
HaHaWTH a1cb16dd3d Javadoc 2024-02-03 19:24:25 +08:00
HaHaWTH e9810c69f4 May fix 2024-02-03 19:07:48 +08:00
HaHaWTH 2b0bee198e May fix 2024-02-03 19:03:15 +08:00
HaHaWTH c31e009860 Ignore failed check 2024-02-01 17:11:50 +08:00
HaHaWTH 2b94776e71 Merge remote-tracking branch 'origin/master' 2024-01-31 21:14:05 +08:00
HaHaWTH fe2b877052 准丞相率三十万大军,择日启程,北伐曹魏! 2024-01-31 21:13:43 +08:00
DGun Otto efad796eb0 Merge pull request #98 from HaHaWTH/dependabot/maven/org.xerial-sqlite-jdbc-3.45.1.0
Bump org.xerial:sqlite-jdbc from 3.45.0.0 to 3.45.1.0
2024-01-31 13:47:02 +08:00
dependabot[bot] fe17b93bde Bump org.xerial:sqlite-jdbc from 3.45.0.0 to 3.45.1.0
Bumps [org.xerial:sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) from 3.45.0.0 to 3.45.1.0.
- [Release notes](https://github.com/xerial/sqlite-jdbc/releases)
- [Changelog](https://github.com/xerial/sqlite-jdbc/blob/master/CHANGELOG)
- [Commits](https://github.com/xerial/sqlite-jdbc/compare/3.45.0.0...3.45.1.0)

---
updated-dependencies:
- dependency-name: org.xerial:sqlite-jdbc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 05:00:09 +00:00
DGun Otto af9aa5c1cb [ci skip] Update README.md 2024-01-31 02:24:12 +08:00
7 changed files with 38 additions and 12 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ MCBBS Link: [Click Here](https://www.mcbbs.net/forum.php?mod=viewthread&tid=1471
15. Automatically login for Bedrock players(configurable)
16. Fix shulker box crash bug on legacy versions(MC 1.13-)
17. **H2 database support**
18. More......
18. **100% compatibility with original authme and extensions**
19. More......
**Download links:**
[Releases](https://github.com/HaHaWTH/AuthMeReReloaded/releases/latest)
+1 -1
View File
@@ -1122,7 +1122,7 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.45.0.0</version>
<version>3.45.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
+2 -4
View File
@@ -75,7 +75,7 @@ public class AuthMe extends JavaPlugin {
// Version and build number values
private static String pluginVersion = "5.6.0-Fork";
private static final String pluginBuild = "b";
private static String pluginBuildNumber = "41";
private static String pluginBuildNumber = "42";
// Private instances
private EmailService emailService;
private CommandHandler commandHandler;
@@ -426,9 +426,7 @@ public class AuthMe extends JavaPlugin {
} else {
getLogger().log(Level.INFO, "You are running the latest version.");
}
} catch (IOException e) {
String formattedException = ExceptionUtils.formatException(e);
getLogger().log(Level.WARNING, "Error occurred while checking updates from GitHub. Reason: " + formattedException);
} catch (IOException ignored) {
}
});
}
@@ -71,7 +71,7 @@ public class H2 extends AbstractSqlDataSource {
this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
this.col = new Columns(settings);
this.con = connection;
this.columnsHandler = AuthMeColumnsHandler.createForSqlite(con, settings);
this.columnsHandler = AuthMeColumnsHandler.createForH2(con, settings);
}
/**
@@ -167,7 +167,7 @@ public class H2 extends AbstractSqlDataSource {
if (isColumnMissing(md, col.EMAIL)) {
st.executeUpdate("ALTER TABLE " + tableName
+ " ADD COLUMN IF NOT EXISTS " + col.EMAIL + " VARCHAR(255);");
+ " ADD COLUMN IF NOT EXISTS " + col.EMAIL + " VARCHAR_IGNORECASE(255);");
}
if (isColumnMissing(md, col.IS_LOGGED)) {
@@ -51,6 +51,26 @@ public final class AuthMeColumnsHandler {
return new AuthMeColumnsHandler(sqlColHandler);
}
/**
* Creates a column handler for H2.
*
* @param connection the connection to the database
* @param settings plugin settings
* @return created column handler
*/
public static AuthMeColumnsHandler createForH2(Connection connection, Settings settings) {
ColumnContext columnContext = new ColumnContext(settings, false);
String tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
String nameColumn = settings.getProperty(DatabaseSettings.MYSQL_COL_NAME);
SqlColumnsHandler<ColumnContext, String> sqlColHandler = new SqlColumnsHandler<>(
forSingleConnection(connection, tableName, nameColumn, columnContext)
.setPredicateSqlGenerator(new PredicateSqlGenerator<>(columnContext, false))
);
return new AuthMeColumnsHandler(sqlColHandler);
}
/**
* Creates a column handler for MySQL.
*
@@ -76,6 +76,7 @@ public class GuiCaptchaHandler implements Listener {
String randomString = "";
Random randomItemSet = new Random();
Random howManyRandom = new Random();
private Material captchaMaterial = getRandomMaterial();
private boolean isPacketListenersActive = false;
@@ -108,11 +109,11 @@ public class GuiCaptchaHandler implements Listener {
if (event.getWhoClicked() instanceof Player) {
Player player = (Player) event.getWhoClicked();
ItemStack currentItem = event.getCurrentItem();
if (!authmeApi.isRegistered(player.getName()) && !closeReasonMap.containsKey(player)) {
if (!authmeApi.isRegistered(player.getName())) {
if (isBedrockPlayer(player.getUniqueId())) {
return;
}
if (currentItem != null && currentItem.getType().equals(Material.REDSTONE_BLOCK)) {
if (currentItem != null && currentItem.getType().equals(captchaMaterial)) {
event.setCancelled(true);
if (!closeReasonMap.containsKey(player)) {
closeReasonMap.put(player, "verified");
@@ -169,7 +170,7 @@ public class GuiCaptchaHandler implements Listener {
Random random_blockpos = new Random();
AtomicInteger random_num = new AtomicInteger(random_blockpos.nextInt(26));
Inventory menu = Bukkit.createInventory(playerunreg, 27, messages.retrieveSingle(playerunreg, MessageKey.GUI_CAPTCHA_WINDOW_NAME, randomString));
ItemStack item = new ItemStack(Material.REDSTONE_BLOCK);
ItemStack item = new ItemStack(captchaMaterial);
ItemMeta meta = item.getItemMeta();
try {
if (meta != null) {
@@ -314,6 +315,12 @@ public class GuiCaptchaHandler implements Listener {
closeReasonMap.remove(player);
}
}
private Material getRandomMaterial() {
Material[] allMaterials = Material.values();
Random random = new Random();
return allMaterials[random.nextInt(allMaterials.length)];
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ authors: [${pluginDescription.authors}]
website: http://github.com/HaHaWTH/AuthMeReReloaded/
description: A fork of AuthMeReloaded that contains bug fixes
main: ${pluginDescription.main}
version: 5.6.0-FORK-b41
version: 5.6.0-FORK-b42
api-version: 1.13
softdepend:
- Vault