mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-28 23:15:53 -04:00
Synchronized objectId generation
Not sure if it helps, but a few of the problems seemed to look like lack of synchronization. Easy to reverse later.
This commit is contained in:
@@ -106,6 +106,8 @@ public class ObjectService implements INetworkDispatch {
|
||||
|
||||
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
|
||||
|
||||
protected final Object objectMutex = new Object();
|
||||
|
||||
public ObjectService(final NGECore core) {
|
||||
this.core = core;
|
||||
databaseConnection = core.getDatabase1();
|
||||
@@ -458,7 +460,12 @@ public class ObjectService implements INetworkDispatch {
|
||||
|
||||
return objectID;*/
|
||||
|
||||
long newId = highestId.incrementAndGet();
|
||||
long newId;
|
||||
|
||||
synchronized(objectMutex) {
|
||||
newId = highestId.incrementAndGet();
|
||||
}
|
||||
|
||||
PreparedStatement ps2;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user