mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-01 02:16:15 -04:00
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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user