mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-21 11:03:00 -04:00
Fixed duplicate id issue(workaround) should fix some of the crashing, disabled vehicles for now(causing crashes), disabled some of the getObject spam
This commit is contained in:
@@ -91,9 +91,7 @@ public class DevService implements INetworkDispatch {
|
||||
if (creature.getClient().isGM()) {
|
||||
suiOptions.put((long) 120, "House Deeds");
|
||||
suiOptions.put((long) 125, "Crafting Tools");
|
||||
}
|
||||
suiOptions.put((long) 130, "Vehicle Deeds");
|
||||
if (creature.getClient().isGM()) {
|
||||
suiOptions.put((long) 130, "Vehicle Deeds");
|
||||
suiOptions.put((long) 121, "Sandbox City");
|
||||
if(creature.getPlayerObject().getProfession().equals("trader_0a") || creature.getPlayerObject().getProfession().equals("trader_0b") || creature.getPlayerObject().getProfession().equals("trader_0c") || creature.getPlayerObject().getProfession().equals("trader_0d"))
|
||||
suiOptions.put((long) 177, "REing");
|
||||
|
||||
@@ -200,8 +200,8 @@ public class PlayerService implements INetworkDispatch {
|
||||
long[] ids = creature.getAwareObjects().stream().mapToLong(SWGObject::getObjectID).toArray();
|
||||
for(int i = 0; i < ids.length; i++) {
|
||||
for(int j = 0; j < ids.length; j++) {
|
||||
if(ids[i] == ids[j] && i != j)
|
||||
System.err.println("Detected duplicate ids");
|
||||
if(ids[i] == ids[j] && i != j)
|
||||
System.err.println("Detected duplicate ids, Template " + core.objectService.getObject(ids[i]).getTemplate());
|
||||
}
|
||||
}
|
||||
}, 0, 5000, TimeUnit.MILLISECONDS));
|
||||
|
||||
@@ -138,8 +138,8 @@ public class StaticService implements INetworkDispatch {
|
||||
cellNumber = ((BuildingObject) cell.getContainer()).getCellNumberByObjectId(cellId);
|
||||
}
|
||||
|
||||
long objectId = core.objectService.getDOId(planetName, template, 0, buildingId, cellNumber, x, y, z);
|
||||
|
||||
//long objectId = core.objectService.getDOId(planetName, template, 0, buildingId, cellNumber, x, y, z);
|
||||
long objectId = 0;
|
||||
SWGObject object = null;
|
||||
|
||||
MobileTemplate mobileTemplate = core.spawnService.getMobileTemplate(template);
|
||||
|
||||
@@ -239,6 +239,15 @@ public class ObjectService implements INetworkDispatch {
|
||||
|
||||
boolean isSnapshot = false;
|
||||
|
||||
if(objectID != 0 && objectList.containsKey(objectID)) {
|
||||
System.err.println("Trying to create object with duplicate Id");
|
||||
try {
|
||||
throw new Exception();
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if(objectID == 0)
|
||||
objectID = generateObjectID();
|
||||
else
|
||||
@@ -472,7 +481,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
if (objectList.containsKey(objectID)) {
|
||||
System.err.println("getObject(): object is null but objectList contains objectID key");
|
||||
} else {
|
||||
System.err.println("getObject(): object is null");
|
||||
//System.err.println("getObject(): object is null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user