Added duplicateId debugging

This commit is contained in:
Treeku
2014-07-14 04:12:53 +01:00
parent a7d354fbe0
commit ec55f0c33e
3 changed files with 110 additions and 5 deletions
+9 -2
View File
@@ -137,7 +137,8 @@ import services.sui.SUIWindow.Trigger;
@SuppressWarnings("unused")
public class ObjectService implements INetworkDispatch {
private Map<Long, SWGObject> objectList = new ConcurrentHashMap<Long, SWGObject>();
//private Map<Long, SWGObject> objectList = new ConcurrentHashMap<Long, SWGObject>();
private Map<Long, SWGObject> objectList = new ObjectList<Long, SWGObject>();
private NGECore core;
private DatabaseConnection databaseConnection;
private AtomicLong highestId = new AtomicLong();
@@ -426,7 +427,13 @@ public class ObjectService implements INetworkDispatch {
loadServerTemplateTasks.add(() -> loadServerTemplate(pointer));
}
objectList.put(objectID, object);
SWGObject ret = objectList.put(objectID, object);
//if (ret != null && !ret.getTemplate().equals(object.getTemplate())) {
if (ret == null) {
//System.err.println("ObjectService: Detected duplicate Id. Assigning new one.")
object = createObject(Template, objectID, planet, position, orientation, customServerTemplate, overrideSnapshot, loadServerTemplate);
}
return object;
}