mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-31 19:24:47 +02:00
Fix saving on name change
This commit is contained in:
@@ -8,6 +8,8 @@
|
|||||||
* Fix skin applies for third-party plugins
|
* Fix skin applies for third-party plugins
|
||||||
* Switch to mcapi.ca for uuid lookups
|
* Switch to mcapi.ca for uuid lookups
|
||||||
* Fix BungeeCord not setting an premium uuid
|
* Fix BungeeCord not setting an premium uuid
|
||||||
|
* Fix setting skin on Cauldron
|
||||||
|
* Fix saving on name change
|
||||||
|
|
||||||
######1.6.2
|
######1.6.2
|
||||||
|
|
||||||
|
@@ -155,12 +155,11 @@ public class Storage {
|
|||||||
con = dataSource.getConnection();
|
con = dataSource.getConnection();
|
||||||
|
|
||||||
UUID uuid = playerProfile.getUuid();
|
UUID uuid = playerProfile.getUuid();
|
||||||
if (playerProfile.getUserId() == -1) {
|
|
||||||
//User was authenticated with a premium authentication, so it's possible that the player is premium
|
|
||||||
if (uuid != null) {
|
if (uuid != null) {
|
||||||
|
//User was authenticated with a premium authentication, so it's possible that the player is premium
|
||||||
updateStmt = con.prepareStatement("UPDATE " + PREMIUM_TABLE
|
updateStmt = con.prepareStatement("UPDATE " + PREMIUM_TABLE
|
||||||
+ " SET NAME=?, LastIp=?, LastLogin=CURRENT_TIMESTAMP"
|
+ " SET NAME=?, LastIp=?, LastLogin=CURRENT_TIMESTAMP"
|
||||||
+ " WHERE UUID=? AND PREMIUM=1");
|
+ " WHERE UUID=?");
|
||||||
|
|
||||||
updateStmt.setString(1, playerProfile.getPlayerName());
|
updateStmt.setString(1, playerProfile.getPlayerName());
|
||||||
updateStmt.setString(2, playerProfile.getLastIp());
|
updateStmt.setString(2, playerProfile.getLastIp());
|
||||||
@@ -174,9 +173,9 @@ public class Storage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (playerProfile.getUserId() == -1) {
|
||||||
saveStmt = con.prepareStatement("INSERT INTO " + PREMIUM_TABLE
|
saveStmt = con.prepareStatement("INSERT INTO " + PREMIUM_TABLE
|
||||||
+ " (UUID, Name, Premium, LastIp) VALUES (?, ?, ?, ?) "
|
+ " (UUID, Name, Premium, LastIp) VALUES (?, ?, ?, ?) ", Statement.RETURN_GENERATED_KEYS);
|
||||||
, Statement.RETURN_GENERATED_KEYS);
|
|
||||||
|
|
||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
saveStmt.setString(1, null);
|
saveStmt.setString(1, null);
|
||||||
|
Reference in New Issue
Block a user