Created the RelationalServerFactory, which is the SDB equivalent to ServerFactory

This commit is contained in:
Obique PSWG
2015-09-29 08:49:47 -05:00
parent cd763e1bf2
commit dbdfd59539
8 changed files with 71 additions and 32 deletions
+4 -5
View File
@@ -36,6 +36,7 @@ import resources.control.Service;
import resources.objects.SWGObject;
import resources.objects.building.BuildingObject;
import resources.server_info.RelationalServerData;
import resources.server_info.RelationalServerFactory;
import services.objects.ObjectManager;
public class StaticService extends Service {
@@ -51,12 +52,10 @@ public class StaticService extends Service {
this.databaseMutex = new Object();
this.objectManager = objectManager;
spawnDatabase = new RelationalServerData("serverdata/static/spawns.db");
if (!spawnDatabase.linkTableWithSdb("spawns", "serverdata/static/spawns.sdb") ||
!spawnDatabase.linkTableWithSdb("types", "serverdata/static/types.sdb")) {
spawnDatabase = RelationalServerFactory.getServerData("static/spawns.db", "spawns", "types");
if (spawnDatabase == null)
throw new main.ProjectSWG.CoreException("Unable to load sdb files for StaticService");
}
getSupportingStatement = spawnDatabase.prepareStatement(GET_SUPPORTING_SQL);
}