MCore update, bug fix and some debug output that should be removed not just yet.

This commit is contained in:
Olof Larsson
2013-06-18 09:07:05 +02:00
parent 66991fba02
commit 677a9f1a86
9 changed files with 137 additions and 89 deletions

View File

@ -20,45 +20,6 @@ public class UPlayerColl extends SenderColl<UPlayer>
super(name, UPlayer.class, MStore.getDb(ConfServer.dburi), Factions.get());
}
// -------------------------------------------- //
// OVERRIDE: COLL
// -------------------------------------------- //
@Override
protected synchronized String attach(UPlayer entity, Object oid, boolean noteChange)
{
String ret = super.attach(entity, oid, noteChange);
// If inited ...
if (!this.inited()) return ret;
if (!Factions.get().isDatabaseInitialized()) return ret;
// ... update the index.
Faction faction = entity.getFaction();
faction.uplayers.add(entity);
return ret;
}
@Override
public UPlayer detachId(Object oid)
{
UPlayer ret = this.get(oid);
if (ret == null) return null;
// If inited ...
if (this.inited())
{
// ... update the index.
Faction faction = ret.getFaction();
faction.uplayers.remove(ret);
}
super.detachId(oid);
return ret;
}
// -------------------------------------------- //
// EXTRAS
// -------------------------------------------- //