mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-12-28 03:57:44 +01:00
Reintroduced logging.
This commit is contained in:
parent
5e7287d03f
commit
48acd00d47
BIN
MobArena.jar
BIN
MobArena.jar
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
name: MobArena
|
||||
author: garbagemule
|
||||
main: com.garbagemule.MobArena.MobArena
|
||||
version: 0.94.4.57
|
||||
version: 0.94.4.58
|
||||
softdepend: [Spout,MultiVerse,XcraftGate,Towny,Heroes,MagicSpells,Vault]
|
||||
commands:
|
||||
ma:
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.garbagemule.MobArena;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.PriorityBlockingQueue;
|
||||
@ -29,6 +30,11 @@ import org.bukkit.potion.PotionEffect;
|
||||
import com.garbagemule.MobArena.events.*;
|
||||
import com.garbagemule.MobArena.framework.Arena;
|
||||
import com.garbagemule.MobArena.leaderboards.Leaderboard;
|
||||
import com.garbagemule.MobArena.log.ArenaLog;
|
||||
import com.garbagemule.MobArena.log.LogSessionBuilder;
|
||||
import com.garbagemule.MobArena.log.LogTotalsBuilder;
|
||||
import com.garbagemule.MobArena.log.YMLSessionBuilder;
|
||||
import com.garbagemule.MobArena.log.YMLTotalsBuilder;
|
||||
import com.garbagemule.MobArena.region.ArenaRegion;
|
||||
import com.garbagemule.MobArena.repairable.*;
|
||||
import com.garbagemule.MobArena.spout.Spouty;
|
||||
@ -49,6 +55,7 @@ public class ArenaImpl implements Arena
|
||||
private MobArena plugin;
|
||||
private String name;
|
||||
private World world;
|
||||
private File dir;
|
||||
|
||||
// Settings section of the config-file for this arena.
|
||||
private ConfigSection settings;
|
||||
@ -92,10 +99,14 @@ public class ArenaImpl implements Arena
|
||||
private SheepBouncer sheepBouncer;
|
||||
private Map<Integer,List<ItemStack>> everyWaveMap, afterWaveMap;
|
||||
|
||||
// Logging
|
||||
private ArenaLog log;
|
||||
private LogSessionBuilder sessionBuilder;
|
||||
private LogTotalsBuilder totalsBuilder;
|
||||
|
||||
// Misc
|
||||
private ArenaListener eventListener;
|
||||
private List<ItemStack> entryFee;
|
||||
//private ArenaLog log;
|
||||
private TimeStrategy timeStrategy;
|
||||
|
||||
/**
|
||||
@ -158,6 +169,12 @@ public class ArenaImpl implements Arena
|
||||
String timeString = settings.getString("player-time-in-arena", "world");
|
||||
Time time = Enums.getEnumFromString(Time.class, timeString);
|
||||
this.timeStrategy = (time != null ? new TimeStrategyLocked(time) : new TimeStrategyNull());
|
||||
|
||||
this.dir = new File(plugin.getDataFolder() + File.separator + "arenas" + File.separator + name);
|
||||
this.sessionBuilder = new YMLSessionBuilder(new File(dir, "log_session.yml"));
|
||||
this.totalsBuilder = new YMLTotalsBuilder(new File(dir, "log_totals.yml"));
|
||||
|
||||
this.log = new ArenaLog(this, sessionBuilder, totalsBuilder);
|
||||
}
|
||||
|
||||
|
||||
@ -284,11 +301,6 @@ public class ArenaImpl implements Arena
|
||||
return waveManager;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public ArenaLog getLog() {
|
||||
return log;
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public Location getPlayerEntry(Player p) {
|
||||
PlayerData mp = playerData.get(p);
|
||||
@ -355,6 +367,11 @@ public class ArenaImpl implements Arena
|
||||
return monsterManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArenaLog getLog() {
|
||||
return log;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -419,8 +436,7 @@ public class ArenaImpl implements Arena
|
||||
|
||||
// Start logging
|
||||
rewardManager.reset();
|
||||
//log = new ArenaLog(plugin, this);
|
||||
//log.start();
|
||||
log.start();
|
||||
|
||||
// Initialize leaderboards and start displaying info.
|
||||
leaderboard.initialize();
|
||||
@ -455,12 +471,7 @@ public class ArenaImpl implements Arena
|
||||
leaderboard.update();
|
||||
|
||||
// Finish logging
|
||||
//log.end();
|
||||
/*if (logging != null) { TODO: FIX LOGGING!
|
||||
log.saveSessionData();
|
||||
log.updateArenaTotals();
|
||||
}*/
|
||||
//log.clearSessionData();
|
||||
log.end();
|
||||
|
||||
// Stop spawning.
|
||||
stopSpawner();
|
||||
@ -568,6 +579,9 @@ public class ArenaImpl implements Arena
|
||||
removeClassPermissions(p);
|
||||
removePotionEffects(p);
|
||||
|
||||
ArenaPlayer ap = arenaPlayerMap.get(p);
|
||||
if (ap != null) log.playerLeave(ap);
|
||||
|
||||
if (inLobby(p) || inArena(p)) {
|
||||
inventoryManager.clearInventory(p);
|
||||
inventoryManager.restoreInventory(p);
|
||||
@ -594,6 +608,9 @@ public class ArenaImpl implements Arena
|
||||
ArenaPlayerDeathEvent event = new ArenaPlayerDeathEvent(p, this);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
ArenaPlayer ap = arenaPlayerMap.get(p);
|
||||
if (ap != null) log.playerLeave(ap);
|
||||
|
||||
arenaPlayers.remove(p);
|
||||
|
||||
if (!settings.getBoolean("auto-respawn", true)) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.garbagemule.MobArena;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@ -39,6 +40,11 @@ public class RewardManager
|
||||
players.get(p).add(stack);
|
||||
}
|
||||
|
||||
public List<ItemStack> getRewards(Player p) {
|
||||
List<ItemStack> rewards = players.get(p);
|
||||
return (rewards == null ? new ArrayList<ItemStack>(1) : Collections.unmodifiableList(rewards));
|
||||
}
|
||||
|
||||
public void grantRewards(Player p) {
|
||||
if (rewarded.contains(p)) return;
|
||||
|
||||
|
@ -18,6 +18,7 @@ import com.garbagemule.MobArena.MobArena;
|
||||
import com.garbagemule.MobArena.MonsterManager;
|
||||
import com.garbagemule.MobArena.RewardManager;
|
||||
import com.garbagemule.MobArena.leaderboards.Leaderboard;
|
||||
import com.garbagemule.MobArena.log.ArenaLog;
|
||||
import com.garbagemule.MobArena.region.ArenaRegion;
|
||||
import com.garbagemule.MobArena.repairable.Repairable;
|
||||
import com.garbagemule.MobArena.util.config.ConfigSection;
|
||||
@ -101,6 +102,8 @@ public interface Arena
|
||||
|
||||
public void revivePlayer(Player p);
|
||||
|
||||
public ArenaLog getLog();
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user