Fixed GemHunter in StaffServer and added offline stat increment :)
This commit is contained in:
parent
66457ded60
commit
bf11635616
@ -73,6 +73,7 @@ public class StatsManager extends MiniClientPlugin<PlayerStats>
|
||||
}
|
||||
|
||||
_statUploadQueue.get(uuidString).put(statName, value);
|
||||
System.out.println("added to stat upload queue.");
|
||||
}
|
||||
|
||||
protected void saveStats()
|
||||
@ -80,8 +81,6 @@ public class StatsManager extends MiniClientPlugin<PlayerStats>
|
||||
if (_statUploadQueue.isEmpty())
|
||||
return;
|
||||
|
||||
PreparedStatement preparedStatement = null;
|
||||
|
||||
try
|
||||
{
|
||||
NautHashMap<String, NautHashMap<Integer, Integer>> uploadQueue = new NautHashMap<String, NautHashMap<Integer, Integer>>();
|
||||
@ -108,20 +107,6 @@ public class StatsManager extends MiniClientPlugin<PlayerStats>
|
||||
{
|
||||
exception.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (preparedStatement != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
preparedStatement.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -70,6 +70,7 @@ public class StatsRepository extends RepositoryBase
|
||||
|
||||
public void saveStats(NautHashMap<String, NautHashMap<Integer, Integer>> uploadQueue)
|
||||
{
|
||||
System.out.println("saving stats.");
|
||||
PreparedStatement preparedStatement = null;
|
||||
|
||||
try
|
||||
@ -80,6 +81,7 @@ public class StatsRepository extends RepositoryBase
|
||||
{
|
||||
for (Integer statId : uploadQueue.get(uuid).keySet())
|
||||
{
|
||||
System.out.println("saving stat : uuid=" + uuid + " " + statId + "=" + uploadQueue.get(uuid).get(statId));
|
||||
preparedStatement.setInt(1, statId);
|
||||
preparedStatement.setInt(2, uploadQueue.get(uuid).get(statId));
|
||||
preparedStatement.setString(3, uuid);
|
||||
|
@ -48,7 +48,6 @@ public class StaffServer extends JavaPlugin
|
||||
|
||||
new NpcManager(this, new Creature(this));
|
||||
ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, clientManager));
|
||||
new PlayerTracker(this, serverStatusManager.getCurrentServerName(), serverStatusManager.getUs());
|
||||
PreferencesManager preferenceManager = new PreferencesManager(this, clientManager, donationManager);
|
||||
preferenceManager.GiveItem = false;
|
||||
|
||||
|
@ -25,7 +25,7 @@ public class GemHunterCommand extends CommandBase<SalesPackageManager>
|
||||
int amount = Integer.parseInt(args[1]);
|
||||
|
||||
Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, "Gem Hunter Level " + amount, false, 0, false);
|
||||
Plugin.getStatsManager().incrementStat(UUIDFetcher.getUUIDOf(playerName).toString(), "Global.GemsEarned", amount);
|
||||
Plugin.getStatsManager().incrementStat(UUIDFetcher.getUUIDOf(playerName).toString(), "Global.GemsEarned", 5000 + (amount * 5000));
|
||||
caller.sendMessage(F.main(Plugin.GetName(), "Added Level " + amount + " Gem Hunter to " + playerName + "'s account!"));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user