diff --git a/src/resources/objects/building/BuildingObject.java b/src/resources/objects/building/BuildingObject.java index 482e9cb2..b45d8be7 100644 --- a/src/resources/objects/building/BuildingObject.java +++ b/src/resources/objects/building/BuildingObject.java @@ -23,6 +23,8 @@ package resources.objects.building; import java.util.concurrent.atomic.AtomicReference; import resources.objects.cell.CellObject; +import resources.objects.tangible.TangibleObject; + import com.sleepycat.persist.model.Entity; import com.sleepycat.persist.model.NotPersistent; import engine.clients.Client; @@ -32,8 +34,8 @@ import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Entity -public class BuildingObject extends SWGObject { +@Entity(version=0) +public class BuildingObject extends TangibleObject { @NotPersistent private BuildingMessageBuilder messageBuilder; @@ -44,7 +46,7 @@ public class BuildingObject extends SWGObject { } public BuildingObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) { - super(objectID, planet, position, orientation, Template); + super(objectID, planet, Template, position, orientation); messageBuilder = new BuildingMessageBuilder(this); } diff --git a/src/resources/objects/cell/CellMessageBuilder.java b/src/resources/objects/cell/CellMessageBuilder.java index 1eb04f0c..ba4b3d14 100644 --- a/src/resources/objects/cell/CellMessageBuilder.java +++ b/src/resources/objects/cell/CellMessageBuilder.java @@ -26,7 +26,6 @@ import java.nio.ByteOrder; import org.apache.mina.core.buffer.IoBuffer; import resources.objects.ObjectMessageBuilder; -import resources.objects.building.BuildingObject; public class CellMessageBuilder extends ObjectMessageBuilder { diff --git a/src/resources/objects/cell/CellObject.java b/src/resources/objects/cell/CellObject.java index bf8670b8..51d4aa3e 100644 --- a/src/resources/objects/cell/CellObject.java +++ b/src/resources/objects/cell/CellObject.java @@ -22,17 +22,17 @@ package resources.objects.cell; import protocol.swg.UpdateCellPermissionMessage; +import resources.objects.object.BaseObject; import com.sleepycat.persist.model.NotPersistent; import com.sleepycat.persist.model.Persistent; import engine.clients.Client; -import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Persistent -public class CellObject extends SWGObject { +@Persistent(version=0) +public class CellObject extends BaseObject { private int cellNumber = 0; @NotPersistent diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index a0b73027..ff1d67b9 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; -import java.util.Stack; import java.util.concurrent.ScheduledFuture; import org.apache.mina.core.buffer.IoBuffer; @@ -57,7 +56,7 @@ import engine.resources.scene.Quaternion; import resources.objects.tangible.TangibleObject; import resources.objects.weapon.WeaponObject; -@Entity(version=9) +@Entity(version=0) public class CreatureObject extends TangibleObject implements IPersistent { @NotPersistent diff --git a/src/resources/objects/factorycrate/FactoryCrateObject.java b/src/resources/objects/factorycrate/FactoryCrateObject.java index 5c5737ad..8e7d3c75 100644 --- a/src/resources/objects/factorycrate/FactoryCrateObject.java +++ b/src/resources/objects/factorycrate/FactoryCrateObject.java @@ -21,6 +21,11 @@ ******************************************************************************/ package resources.objects.factorycrate; -public class FactoryCrateObject { +import com.sleepycat.persist.model.Persistent; + +import resources.objects.tangible.TangibleObject; + +@Persistent(version=0) +public class FactoryCrateObject extends TangibleObject { } diff --git a/src/resources/objects/group/GroupObject.java b/src/resources/objects/group/GroupObject.java index e87a0950..ec9b215c 100644 --- a/src/resources/objects/group/GroupObject.java +++ b/src/resources/objects/group/GroupObject.java @@ -23,13 +23,14 @@ package resources.objects.group; import java.util.Vector; +import resources.objects.universe.UniverseObject; + import engine.clients.Client; import engine.resources.objects.SWGObject; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; - -public class GroupObject extends SWGObject { +public class GroupObject extends UniverseObject { private Vector memberList = new Vector(); private int memberListUpdateCounter; diff --git a/src/resources/objects/guild/GuildObject.java b/src/resources/objects/guild/GuildObject.java index 504a10e6..f064a19f 100644 --- a/src/resources/objects/guild/GuildObject.java +++ b/src/resources/objects/guild/GuildObject.java @@ -36,6 +36,7 @@ import resources.guild.Guild; import resources.objects.SWGList; import resources.objects.SWGMap; import resources.objects.SWGMultiMap; +import resources.objects.universe.UniverseObject; import services.collections.ServerFirst; import com.sleepycat.je.Environment; @@ -50,8 +51,8 @@ import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Entity -public class GuildObject extends SWGObject implements IPersistent { +@Entity(version=0) +public class GuildObject extends UniverseObject implements IPersistent { protected NGECore core; @NotPersistent diff --git a/src/resources/objects/harvester/HarvesterObject.java b/src/resources/objects/harvester/HarvesterObject.java index 1f7c48eb..b31b40cf 100644 --- a/src/resources/objects/harvester/HarvesterObject.java +++ b/src/resources/objects/harvester/HarvesterObject.java @@ -21,6 +21,11 @@ ******************************************************************************/ package resources.objects.harvester; -public class HarvesterObject { +import com.sleepycat.persist.model.Persistent; + +import resources.objects.installation.InstallationObject; + +@Persistent(version=0) +public class HarvesterObject extends InstallationObject { } diff --git a/src/resources/objects/installation/InstallationObject.java b/src/resources/objects/installation/InstallationObject.java index 7b31ff63..728de4a9 100644 --- a/src/resources/objects/installation/InstallationObject.java +++ b/src/resources/objects/installation/InstallationObject.java @@ -21,6 +21,11 @@ ******************************************************************************/ package resources.objects.installation; -public class InstallationObject { +import com.sleepycat.persist.model.Persistent; + +import resources.objects.tangible.TangibleObject; + +@Persistent(version=0) +public class InstallationObject extends TangibleObject { } diff --git a/src/resources/objects/intangible/IntangibleObject.java b/src/resources/objects/intangible/IntangibleObject.java index 1d23fe40..a1f5e897 100644 --- a/src/resources/objects/intangible/IntangibleObject.java +++ b/src/resources/objects/intangible/IntangibleObject.java @@ -21,18 +21,17 @@ ******************************************************************************/ package resources.objects.intangible; - +import resources.objects.object.BaseObject; import com.sleepycat.persist.model.Persistent; import engine.clients.Client; -import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Persistent -public class IntangibleObject extends SWGObject { +@Persistent(version=0) +public class IntangibleObject extends BaseObject { private int genericInt; diff --git a/src/resources/objects/manufacture/ManufactureSchematicObject.java b/src/resources/objects/manufacture/ManufactureSchematicObject.java new file mode 100644 index 00000000..35e558de --- /dev/null +++ b/src/resources/objects/manufacture/ManufactureSchematicObject.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package resources.objects.manufacture; + +import com.sleepycat.persist.model.Persistent; + +import resources.objects.intangible.IntangibleObject; + +@Persistent(version=0) +public class ManufactureSchematicObject extends IntangibleObject { + +} diff --git a/src/resources/objects/mission/MissionObject.java b/src/resources/objects/mission/MissionObject.java index 635da311..69562ef6 100644 --- a/src/resources/objects/mission/MissionObject.java +++ b/src/resources/objects/mission/MissionObject.java @@ -23,21 +23,19 @@ package resources.objects.mission; import com.sleepycat.je.Environment; import com.sleepycat.je.Transaction; -import com.sleepycat.persist.model.Entity; import com.sleepycat.persist.model.NotPersistent; import com.sleepycat.persist.model.Persistent; -import resources.objects.tangible.TangibleObject; +import resources.objects.intangible.IntangibleObject; import resources.objects.waypoint.WaypointObject; import engine.clients.Client; import engine.resources.objects.IPersistent; -import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Persistent(version=1) -public class MissionObject extends SWGObject implements IPersistent { +@Persistent(version=0) +public class MissionObject extends IntangibleObject implements IPersistent { private float missionDestinationX; private float missionDestinationY; diff --git a/src/resources/objects/object/BaseObject.java b/src/resources/objects/object/BaseObject.java new file mode 100644 index 00000000..fb88ce01 --- /dev/null +++ b/src/resources/objects/object/BaseObject.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package resources.objects.object; + +import com.sleepycat.persist.model.Persistent; + +import engine.clients.Client; +import engine.resources.objects.SWGObject; +import engine.resources.scene.Planet; +import engine.resources.scene.Point3D; +import engine.resources.scene.Quaternion; + +@Persistent(version=0) +public class BaseObject extends SWGObject { + + public BaseObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) { + super(objectID, planet, position, orientation, Template); + } + + public BaseObject() { + super(); + } + + @Override + public void sendBaselines(Client arg0) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/resources/objects/player/PlayerObject.java b/src/resources/objects/player/PlayerObject.java index dce9f5b2..2a56fe85 100644 --- a/src/resources/objects/player/PlayerObject.java +++ b/src/resources/objects/player/PlayerObject.java @@ -28,6 +28,7 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import resources.objects.intangible.IntangibleObject; import resources.objects.waypoint.WaypointObject; import com.sleepycat.persist.model.NotPersistent; @@ -36,13 +37,12 @@ import com.sleepycat.persist.model.Persistent; import engine.clients.Client; import engine.resources.objects.DraftSchematic; import engine.resources.objects.Quest; -import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Persistent(version=2) -public class PlayerObject extends SWGObject { +@Persistent(version=0) +public class PlayerObject extends IntangibleObject { // PLAY 3 diff --git a/src/resources/objects/resource/ResourceContainerObject.java b/src/resources/objects/resource/ResourceContainerObject.java index cea47b84..1e4299a9 100644 --- a/src/resources/objects/resource/ResourceContainerObject.java +++ b/src/resources/objects/resource/ResourceContainerObject.java @@ -21,6 +21,11 @@ ******************************************************************************/ package resources.objects.resource; -public class ResourceContainerObject { +import com.sleepycat.persist.model.Persistent; + +import resources.objects.tangible.TangibleObject; + +@Persistent(version=0) +public class ResourceContainerObject extends TangibleObject { } diff --git a/src/resources/objects/ship/ShipObject.java b/src/resources/objects/ship/ShipObject.java index b27be2fa..62d4d6a4 100644 --- a/src/resources/objects/ship/ShipObject.java +++ b/src/resources/objects/ship/ShipObject.java @@ -21,6 +21,11 @@ ******************************************************************************/ package resources.objects.ship; -public class ShipObject { +import com.sleepycat.persist.model.Persistent; + +import resources.objects.tangible.TangibleObject; + +@Persistent(version=0) +public class ShipObject extends TangibleObject { } diff --git a/src/resources/objects/staticobject/StaticObject.java b/src/resources/objects/staticobject/StaticObject.java index 28b9d797..3ee2ab23 100644 --- a/src/resources/objects/staticobject/StaticObject.java +++ b/src/resources/objects/staticobject/StaticObject.java @@ -21,17 +21,18 @@ ******************************************************************************/ package resources.objects.staticobject; +import resources.objects.object.BaseObject; + import com.sleepycat.persist.model.NotPersistent; import com.sleepycat.persist.model.Persistent; import engine.clients.Client; -import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Persistent -public class StaticObject extends SWGObject { +@Persistent(version=0) +public class StaticObject extends BaseObject { @NotPersistent private StaticMessageBuilder messageBuilder; diff --git a/src/resources/objects/tangible/TangibleObject.java b/src/resources/objects/tangible/TangibleObject.java index 256c4415..51f7cca5 100644 --- a/src/resources/objects/tangible/TangibleObject.java +++ b/src/resources/objects/tangible/TangibleObject.java @@ -33,21 +33,19 @@ import protocol.swg.UpdatePVPStatusMessage; import protocol.swg.objectControllerObjects.ShowFlyText; import resources.common.RGB; +import resources.objects.object.BaseObject; import resources.objects.creature.CreatureObject; - import com.sleepycat.persist.model.NotPersistent; import com.sleepycat.persist.model.Persistent; import engine.clients.Client; -import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; - -@Persistent -public class TangibleObject extends SWGObject { +@Persistent(version=0) +public class TangibleObject extends BaseObject { // TODO: Thread safety diff --git a/src/resources/objects/universe/UniverseObject.java b/src/resources/objects/universe/UniverseObject.java new file mode 100644 index 00000000..021082ef --- /dev/null +++ b/src/resources/objects/universe/UniverseObject.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package resources.objects.universe; + +import com.sleepycat.persist.model.Persistent; + +import engine.resources.scene.Planet; +import engine.resources.scene.Point3D; +import engine.resources.scene.Quaternion; +import resources.objects.object.BaseObject; + +@Persistent(version=0) +public class UniverseObject extends BaseObject { + + public UniverseObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) { + super(objectID, planet, position, orientation, Template); + } + + public UniverseObject() { + super(); + } + +} diff --git a/src/resources/objects/waypoint/WaypointObject.java b/src/resources/objects/waypoint/WaypointObject.java index 9b027381..32d73e1b 100644 --- a/src/resources/objects/waypoint/WaypointObject.java +++ b/src/resources/objects/waypoint/WaypointObject.java @@ -21,16 +21,17 @@ ******************************************************************************/ package resources.objects.waypoint; +import resources.objects.intangible.IntangibleObject; + import com.sleepycat.persist.model.Persistent; import engine.clients.Client; -import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Persistent -public class WaypointObject extends SWGObject { +@Persistent(version=0) +public class WaypointObject extends IntangibleObject { private int cellId; // ??? private long locationNetworkId;