Made duplicate ID handling more efficient

Shouldn't create a new objectId each server run, by using a duplicateId
database that takes other things (such as planetcrc, templatecrc,
building, container, cell, coordinates)

Currently best solution I can see that doesn't consume a brand new lot
of 20,000 objectids each bootup.
This commit is contained in:
Treeku
2014-03-24 19:20:06 +00:00
parent e363b438ef
commit 94ae856f6f
4 changed files with 60 additions and 10 deletions
+6
View File
@@ -182,6 +182,7 @@ public class NGECore {
private ObjectDatabase mailODB;
private ObjectDatabase guildODB;
private ObjectDatabase objectIdODB;
private ObjectDatabase duplicateIdODB;
private BusConfiguration eventBusConfig = BusConfiguration.Default(1, new ThreadPoolExecutor(1, 4, 1, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>()));
@@ -231,6 +232,7 @@ public class NGECore {
mailODB = new ObjectDatabase("mails", true, false, true);
guildODB = new ObjectDatabase("guild", true, false, true);
objectIdODB = new ObjectDatabase("oids", true, false, false);
duplicateIdODB = new ObjectDatabase("doids", true, false, true);
// Services
loginService = new LoginService(this);
@@ -518,6 +520,10 @@ public class NGECore {
return objectIdODB;
}
public ObjectDatabase getDuplicateIdODB() {
return duplicateIdODB;
}
public int getActiveClients() {
int connections = 0;
for (Map.Entry<IoSession, Client> c : clients.entrySet()) {