Perf boost for first-time logins.
This commit is contained in:
parent
25a3e8101e
commit
50d670a93c
|
|
@ -492,14 +492,8 @@ public class DatabaseDataStore extends DataStore
|
|||
Statement statement = this.databaseConnection.createStatement();
|
||||
ResultSet results = statement.executeQuery("SELECT * FROM griefprevention_playerdata WHERE name='" + playerID.toString() + "';");
|
||||
|
||||
//if there's no data for this player, create it with defaults
|
||||
if(!results.next())
|
||||
{
|
||||
this.savePlayerData(playerID, playerData);
|
||||
}
|
||||
|
||||
//otherwise, just read from the database
|
||||
else
|
||||
//if data for this player exists, use it
|
||||
if(results.next())
|
||||
{
|
||||
playerData.lastLogin = results.getTimestamp("lastlogin");
|
||||
playerData.accruedClaimBlocks = results.getInt("accruedblocks");
|
||||
|
|
|
|||
|
|
@ -462,15 +462,8 @@ public class FlatFileDataStore extends DataStore
|
|||
PlayerData playerData = new PlayerData();
|
||||
playerData.playerID = playerID;
|
||||
|
||||
//if it doesn't exist as a file
|
||||
if(!playerFile.exists())
|
||||
{
|
||||
//create a file with defaults
|
||||
this.savePlayerData(playerID, playerData);
|
||||
}
|
||||
|
||||
//otherwise, read the file
|
||||
else
|
||||
//if it exists as a file, read the file
|
||||
if(playerFile.exists())
|
||||
{
|
||||
BufferedReader inStream = null;
|
||||
try
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user