diff --git a/src/dao/mysql5/mysql5.xml b/src/dao/mysql5/mysql5.xml deleted file mode 100644 index 961c08bbe..000000000 --- a/src/dao/mysql5/mysql5.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/main/java/com/l2jserver/model/id/object/allocator/BitSetIDAllocator.java b/src/main/java/com/l2jserver/model/id/object/allocator/BitSetIDAllocator.java index b30d9d1bb..7f7e7be24 100644 --- a/src/main/java/com/l2jserver/model/id/object/allocator/BitSetIDAllocator.java +++ b/src/main/java/com/l2jserver/model/id/object/allocator/BitSetIDAllocator.java @@ -5,9 +5,15 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.l2jserver.util.PrimeFinder; public class BitSetIDAllocator implements IDAllocator { + private static final Logger log = LoggerFactory + .getLogger(BitSetIDAllocator.class); + /** * Lock to guarantee synchronization */ @@ -32,12 +38,15 @@ public class BitSetIDAllocator implements IDAllocator { freeIdCount = new AtomicInteger(ALLOCABLE_IDS); nextId = new AtomicInteger(ids.nextClearBit(0)); + log.info("BitSet IDAllocator initialized. Next available ID is {}", + nextId.get()); } @Override public void allocate(int id) { if (ids.get(id - FIRST_ID)) throw new IDAllocatorException("ID not allocated"); + log.debug("Allocating ID {}", id); lock.lock(); try { if (id < FIRST_ID) @@ -57,6 +66,9 @@ public class BitSetIDAllocator implements IDAllocator { ids.set(newID); freeIdCount.decrementAndGet(); + if (log.isDebugEnabled()) + log.debug("Allocated a new ID {}", newID + FIRST_ID); + int nextFree = ids.nextClearBit(newID); if (nextFree < 0) { @@ -66,12 +78,12 @@ public class BitSetIDAllocator implements IDAllocator { if (ids.size() < ALLOCABLE_IDS) { increaseBitSetCapacity(); } else { + log.error("ID exhaustion"); throw new IDAllocatorException("ID exhaustion"); } } nextId.set(nextFree); - return newID + FIRST_ID; } finally { lock.unlock(); @@ -86,6 +98,7 @@ public class BitSetIDAllocator implements IDAllocator { if (!ids.get(id - FIRST_ID)) throw new IDAllocatorException("ID not allocated"); + log.debug("Releasing allocated ID {}", id); lock.lock(); try { ids.clear(id - FIRST_ID); @@ -96,6 +109,7 @@ public class BitSetIDAllocator implements IDAllocator { } private void increaseBitSetCapacity() { + log.debug("Increasing BitSet capacity from {}", ids.size()); BitSet newBitSet = new BitSet( PrimeFinder.nextPrime((getAllocatedIDs() * 11) / 10)); newBitSet.or(ids); diff --git a/src/main/java/com/l2jserver/model/world/player/PlayerListener.java b/src/main/java/com/l2jserver/model/world/player/PlayerListener.java index fbd7ef079..e8937edd8 100644 --- a/src/main/java/com/l2jserver/model/world/player/PlayerListener.java +++ b/src/main/java/com/l2jserver/model/world/player/PlayerListener.java @@ -2,6 +2,8 @@ package com.l2jserver.model.world.player; import com.l2jserver.model.world.actor.ActorEvent; import com.l2jserver.model.world.actor.ActorListener; +import com.l2jserver.model.world.event.WorldEvent; +import com.l2jserver.model.world.event.WorldListener; public abstract class PlayerListener implements ActorListener { @Override @@ -12,11 +14,7 @@ public abstract class PlayerListener implements ActorListener { } /** - * Once the event call is dispatched, the listener WILL NOT be - * removed. You must manually remove it from the event object. - * - * @param e - * the event + * @see WorldListener#dispatch(WorldEvent) */ protected abstract boolean dispatch(PlayerEvent e); }