mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-30 00:15:57 -04:00
Refactored odb system (read extended), added implementation of Dynamic World Spawns
ODB no longer uses DPL layer of Berkeley DB, persistent classes have to implement the Serializable interface, annotations are no longer used, use transient modifier for variables that should not be persistent. Entity reference errors will no longer occur, however it is better to use ids if the entity that is being referenced is stored in the db too! (or you will have two different objects). DB is cached for 5 minutes then it will write its log/cache to disk, transactions are no longer used.
This commit is contained in:
@@ -53,6 +53,7 @@ import engine.resources.common.Event;
|
||||
import engine.resources.common.Mesh3DTriangle;
|
||||
import engine.resources.common.Ray;
|
||||
import engine.resources.container.Traverser;
|
||||
import engine.resources.database.ODBCursor;
|
||||
import engine.resources.objects.SWGObject;
|
||||
import engine.resources.scene.Planet;
|
||||
import engine.resources.scene.Point3D;
|
||||
@@ -186,13 +187,11 @@ public class SimulationService implements INetworkDispatch {
|
||||
}
|
||||
|
||||
public void insertPersistentBuildings() {
|
||||
EntityCursor<BuildingObject> cursor = core.getBuildingODB().getCursor(Long.class, BuildingObject.class);
|
||||
ODBCursor cursor = core.getSWGObjectODB().getCursor();
|
||||
|
||||
Iterator<BuildingObject> it = cursor.iterator();
|
||||
|
||||
while(it.hasNext()) {
|
||||
final BuildingObject building = (BuildingObject) core.objectService.getObject(it.next().getObjectID());
|
||||
if(building == null)
|
||||
while(cursor.hasNext()) {
|
||||
SWGObject building = core.objectService.getObject(((SWGObject) cursor.next()).getObjectID());
|
||||
if(building == null || !(building instanceof BuildingObject))
|
||||
continue;
|
||||
if(building.getAttachment("hasLoadedServerTemplate") == null)
|
||||
core.objectService.loadServerTemplate(building);
|
||||
|
||||
Reference in New Issue
Block a user