See extended.

[fixed] Characters could sometimes walk through buildings due to
unsigned object Ids
[fixed] Critical networking bugs
[fixed] Client crash whenever an object was destroyed
[added] Loading of client objects is now multithreaded.
[updated] Reworked awareness system(engine).
[fixed] lots of other small engine fixes.
This commit is contained in:
Light2
2013-08-15 21:45:50 +02:00
parent fa79a8b41c
commit aab87280d2
11 changed files with 89 additions and 38 deletions
+25 -4
View File
@@ -23,7 +23,10 @@ package services;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import engine.resources.scene.Planet;
@@ -115,16 +118,34 @@ public class TerrainService {
public void loadSnapShotObjects() {
for(Planet planet : planets) {
Map<Planet, Thread> threadMap = new HashMap<Planet, Thread>();
for(final Planet planet : planets) {
if(planet.getSnapshotVisitor() != null) {
core.objectService.loadSnapshotObjects(planet);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
core.objectService.loadSnapshotObjects(planet);
}
});
thread.start();
threadMap.put(planet, thread);
}
}
// wait for threads to finish loading
for(Planet planet : planets) {
try {
threadMap.get(planet).join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}