mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-26 02:57:52 +01:00
Fixed UserInfoTable being cleared on V8->10 transfer
This commit is contained in:
parent
d7e26f03bc
commit
63f8482c4b
@ -299,7 +299,8 @@ public class SessionsTable extends UserIDTable {
|
||||
columnServerID +
|
||||
" FROM " + tableName +
|
||||
" WHERE " + columnSessionStart + ">?" +
|
||||
" AND " + columnUserID + "=" + usersTable.statementSelectID);
|
||||
" AND " + columnUserID + "=" + usersTable.statementSelectID +
|
||||
" GROUP BY " + columnServerID);
|
||||
statement.setLong(1, afterDate);
|
||||
statement.setString(2, uuid.toString());
|
||||
set = statement.executeQuery();
|
||||
|
@ -54,6 +54,7 @@ public class Version8TransferTable extends Table {
|
||||
|
||||
copyTPS();
|
||||
|
||||
execute(dropTableSql("plan_user_info"));
|
||||
copyUsers();
|
||||
|
||||
execute(dropTableSql("plan_ips"));
|
||||
@ -62,10 +63,10 @@ public class Version8TransferTable extends Table {
|
||||
execute(dropTableSql("plan_worlds"));
|
||||
db.getWorldTable().createTable();
|
||||
db.getWorldTimesTable().createTable();
|
||||
execute(dropTableSql("plan_user_info"));
|
||||
|
||||
execute(dropTableSql("plan_actions"));
|
||||
db.getActionsTable().createTable();
|
||||
db.getUserInfoTable().createTable();
|
||||
|
||||
execute(dropTableSql("plan_gamemodetimes"));
|
||||
execute(dropTableSql("temp_nicks"));
|
||||
execute(dropTableSql("temp_kills"));
|
||||
|
@ -63,8 +63,13 @@ public class InspectPageParser extends PageParser {
|
||||
addValue("version", MiscUtils.getPlanVersion());
|
||||
addValue("timeZone", MiscUtils.getTimeZoneOffsetHours());
|
||||
|
||||
addValue("playerName", userInfo.getName());
|
||||
addValue("registered", FormatUtils.formatTimeStampYear(userInfo.getRegistered()));
|
||||
if (userInfo != null) {
|
||||
addValue("playerName", userInfo.getName());
|
||||
addValue("registered", FormatUtils.formatTimeStampYear(userInfo.getRegistered()));
|
||||
} else {
|
||||
addValue("playerName", "Error occurred.");
|
||||
addValue("registered", "Error occurred.");
|
||||
}
|
||||
long lastSeen = sessionsTable.getLastSeen(uuid);
|
||||
if (lastSeen != 0) {
|
||||
addValue("lastSeen", FormatUtils.formatTimeStampYear(lastSeen));
|
||||
@ -171,6 +176,7 @@ public class InspectPageParser extends PageParser {
|
||||
|
||||
return HtmlUtils.replacePlaceholders(FileUtil.getStringFromResource("player.html"), placeHolders);
|
||||
} catch (Exception e) {
|
||||
Log.toLog(this.getClass().getName(), e);
|
||||
throw new ParseException(e);
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +166,11 @@ public abstract class WebAPI {
|
||||
}
|
||||
|
||||
protected Response fail(String reason) {
|
||||
return PageCache.loadPage("fail", () -> new NotFoundResponse(reason));
|
||||
return PageCache.loadPage("fail", () -> {
|
||||
NotFoundResponse notFoundResponse = new NotFoundResponse("");
|
||||
notFoundResponse.setContent(reason);
|
||||
return notFoundResponse;
|
||||
});
|
||||
}
|
||||
|
||||
protected Response badRequest(String error) {
|
||||
|
Loading…
Reference in New Issue
Block a user