Cloning works now, changed object list to hash map (significant performance increase)

This commit is contained in:
Light2
2013-09-21 19:02:35 +02:00
parent b676dffdec
commit c7bfc890bd
13 changed files with 145 additions and 59 deletions
+8 -9
View File
@@ -103,7 +103,7 @@ public class SimulationService implements INetworkDispatch {
quadTrees.put(terrainService.getPlanetList().get(i).getName(), new QuadTree<SWGObject>(-8192, -8192, 8192, 8192));
}
List<SWGObject> objectList = new ArrayList<SWGObject>(core.objectService.getObjectList());
List<SWGObject> objectList = new ArrayList<SWGObject>(core.objectService.getObjectList().values());
for(SWGObject obj : objectList) {
if(obj.getParentId() == 0 && obj.isInSnapshot()) {
core.objectService.loadServerTemplate(obj);
@@ -550,8 +550,8 @@ public class SimulationService implements INetworkDispatch {
}
}
public void transferToPlanet(SWGObject object, Planet planet, Point3D newPos, Quaternion newOrientation) {
public void transferToPlanet(SWGObject object, Planet planet, Point3D newPos, Quaternion newOrientation, SWGObject newParent) {
Client client = object.getClient();
@@ -582,12 +582,8 @@ public class SimulationService implements INetworkDispatch {
synchronized(object.getMutex()) {
Iterator<SWGObject> it = object.getAwareObjects().iterator();
object.getAwareObjects().removeAll(object.getAwareObjects());
while(it.hasNext()) {
it.remove();
}
}
object.setPlanet(planet);
@@ -595,6 +591,9 @@ public class SimulationService implements INetworkDispatch {
object.setPosition(newPos);
object.setOrientation(newOrientation);
if(newParent != null && newParent instanceof CellObject)
newParent._add(object);
HeartBeatMessage heartBeat = new HeartBeatMessage();
session.write(heartBeat.serialize());
@@ -604,8 +603,8 @@ public class SimulationService implements INetworkDispatch {
handleZoneIn(client);
object.makeAware(object);
}
public void openContainer(SWGObject requester, SWGObject container) {