diff --git a/ngengine_public.jar b/ngengine_public.jar index 4af51f67..9ea7466c 100644 Binary files a/ngengine_public.jar and b/ngengine_public.jar differ diff --git a/scripts/radial/item/tunable.py b/scripts/radial/item/tunable.py index 78b65b15..94709256 100644 --- a/scripts/radial/item/tunable.py +++ b/scripts/radial/item/tunable.py @@ -54,7 +54,8 @@ def handleSUI(owner, window, eventType, returnList): main.NGECore.getInstance().lootService.tuneProcess(tunableObject) time.sleep(0.5) - tunableObject.setCustomName2( "\\#00FF00" + tunableObject.getTrueName() + " (tuned)") + #tunableObject.setCustomName( "\\#00FF00" + tunableObject.getObjectName().getStfValue() + " (tuned)") + tunableObject.setCustomName( "\\#00FF00" + "Color Crystal" + " (tuned)") owner.sendSystemMessage('@jedi_spam:crystal_tune_success',1) return \ No newline at end of file diff --git a/src/resources/objects/SWGList.java b/src/resources/objects/SWGList.java index 620ca3f6..0a7e2d0d 100644 --- a/src/resources/objects/SWGList.java +++ b/src/resources/objects/SWGList.java @@ -35,8 +35,6 @@ import java.util.function.Predicate; import java.util.function.UnaryOperator; import java.util.stream.Stream; -import main.NGECore; - import org.apache.mina.core.buffer.IoBuffer; import org.python.google.common.collect.Lists; @@ -53,7 +51,6 @@ public class SWGList implements List, Serializable { private List list = new CopyOnWriteArrayList(); private transient int updateCounter = 0; - private long objectId; private byte viewType; private short updateType; private boolean addByte; @@ -63,17 +60,26 @@ public class SWGList implements List, Serializable { public SWGList() { } public SWGList(SWGObject object, int viewType, int updateType, boolean addByte) { - this.objectId = object.getObjectID(); this.viewType = (byte) viewType; this.updateType = (short) updateType; this.addByte = addByte; this.object = object; } - public void init() { + public void init(SWGObject object) { objectMutex = new Object(); updateCounter = 0; - object = NGECore.getInstance().objectService.getObject(objectId); + this.object = object; + + for (Object item : list) { + try { + if (item instanceof IDelta) { + item.getClass().getMethod("init", new Class[] {}).invoke(item, new Object[] { }); + } + } catch (Exception e) { + e.printStackTrace(); + } + } } public boolean add(E e) { diff --git a/src/resources/objects/SWGMap.java b/src/resources/objects/SWGMap.java index 663041a4..a8ffc398 100644 --- a/src/resources/objects/SWGMap.java +++ b/src/resources/objects/SWGMap.java @@ -32,8 +32,6 @@ import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; -import main.NGECore; - import org.apache.mina.core.buffer.IoBuffer; import com.sleepycat.persist.model.Persistent; @@ -51,7 +49,6 @@ public class SWGMap implements Map, Serializable { private static final long serialVersionUID = 1L; private Map map = new TreeMap(); private transient int updateCounter = 0; - private long objectId; private byte viewType; private short updateType; private boolean addByte; @@ -61,7 +58,6 @@ public class SWGMap implements Map, Serializable { public SWGMap() { } public SWGMap(SWGObject object, int viewType, int updateType, boolean addByte) { - this.objectId = object.getObjectID(); this.viewType = (byte) viewType; this.updateType = (short) updateType; this.addByte = addByte; @@ -70,7 +66,6 @@ public class SWGMap implements Map, Serializable { public SWGMap(Map m) { if (m instanceof SWGMap) { - this.objectId = ((SWGMap) m).objectId; this.object = ((SWGMap) m).object; this.viewType = ((SWGMap) m).viewType; this.updateType = ((SWGMap) m).updateType; @@ -78,10 +73,20 @@ public class SWGMap implements Map, Serializable { } } - public void init() { + public void init(SWGObject object) { objectMutex = new Object(); updateCounter = 0; - object = NGECore.getInstance().objectService.getObject(objectId); + this.object = object; + + for (Object item : map.values()) { + try { + if (item instanceof IDelta) { + item.getClass().getMethod("init", new Class[] {}).invoke(item, new Object[] { }); + } + } catch (Exception e) { + e.printStackTrace(); + } + } } public void clear() { diff --git a/src/resources/objects/SWGMultiMap.java b/src/resources/objects/SWGMultiMap.java index e851df91..fce0b1c9 100644 --- a/src/resources/objects/SWGMultiMap.java +++ b/src/resources/objects/SWGMultiMap.java @@ -29,8 +29,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import main.NGECore; - import org.apache.mina.core.buffer.IoBuffer; import org.python.google.common.collect.ArrayListMultimap; import org.python.google.common.collect.Multimap; @@ -46,7 +44,6 @@ public class SWGMultiMap implements Multimap, Serializable { private static final long serialVersionUID = 1L; private Multimap map = ArrayListMultimap.create(); private transient int updateCounter = 0; - private long objectId; private byte viewType; private short updateType; private boolean addByte; @@ -56,7 +53,6 @@ public class SWGMultiMap implements Multimap, Serializable { public SWGMultiMap() { } public SWGMultiMap(SWGObject object, int viewType, int updateType, boolean addByte) { - this.objectId = object.getObjectId(); this.viewType = (byte) viewType; this.updateType = (short) updateType; this.addByte = addByte; @@ -65,7 +61,6 @@ public class SWGMultiMap implements Multimap, Serializable { public SWGMultiMap(Multimap m) { if (m instanceof SWGMultiMap) { - this.objectId = ((SWGMultiMap) m).objectId; this.object = ((SWGMultiMap) m).object; this.viewType = ((SWGMultiMap) m).viewType; this.updateType = ((SWGMultiMap) m).updateType; @@ -73,9 +68,20 @@ public class SWGMultiMap implements Multimap, Serializable { } } - public void init() { + public void init(SWGObject object) { objectMutex = new Object(); - object = NGECore.getInstance().objectService.getObject(objectId); + updateCounter = 0; + this.object = object; + + for (Object item : map.values()) { + try { + if (item instanceof IDelta) { + item.getClass().getMethod("init", new Class[] {}).invoke(item, new Object[] { }); + } + } catch (Exception e) { + e.printStackTrace(); + } + } } public Map> asMap() { diff --git a/src/resources/objects/SWGSet.java b/src/resources/objects/SWGSet.java index 68af00dd..9d316343 100644 --- a/src/resources/objects/SWGSet.java +++ b/src/resources/objects/SWGSet.java @@ -29,8 +29,6 @@ import java.util.List; import java.util.Set; import java.util.TreeSet; -import main.NGECore; - import org.apache.mina.core.buffer.IoBuffer; import engine.resources.objects.Baseline; @@ -45,7 +43,6 @@ public class SWGSet implements Set, Serializable { private static final long serialVersionUID = 1L; private TreeSet set = new TreeSet(); private transient int updateCounter = 0; - private long objectId; private byte viewType; private short updateType; private boolean addByte; @@ -55,7 +52,6 @@ public class SWGSet implements Set, Serializable { public SWGSet() { } public SWGSet(SWGObject object, int viewType, int updateType, boolean addByte) { - this.objectId = object.getObjectId(); this.viewType = (byte) viewType; this.updateType = (short) updateType; this.addByte = addByte; @@ -64,7 +60,6 @@ public class SWGSet implements Set, Serializable { public SWGSet(Set s) { if (s instanceof SWGSet) { - this.objectId = ((SWGSet) s).objectId; this.object = ((SWGSet) s).object; this.viewType = ((SWGSet) s).viewType; this.updateType = ((SWGSet) s).updateType; @@ -72,10 +67,20 @@ public class SWGSet implements Set, Serializable { } } - public void init() { + public void init(SWGObject object) { objectMutex = new Object(); updateCounter = 0; - object = NGECore.getInstance().objectService.getObject(objectId); + this.object = object; + + for (Object item : set) { + try { + if (item instanceof IDelta) { + item.getClass().getMethod("init", new Class[] {}).invoke(item, new Object[] { }); + } + } catch (Exception e) { + e.printStackTrace(); + } + } } public boolean add(E e) { diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index 7f945571..84e0bf2c 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -212,14 +212,13 @@ public class CreatureObject extends TangibleObject implements Serializable { cooldowns = new ConcurrentHashMap(); performanceAudience = new Vector(); messageBuilder = new CreatureMessageBuilder(this); - dotList.init(); - buffList.init(); - equipmentList.init(); - appearanceEquipmentList.init(); - missionCriticalObjects.init(); - abilities.init(); - skillMods.init(); - skillMods.forEach((name, skillMod) -> skillMod.init()); + dotList.init(this); + buffList.init(this); + equipmentList.init(this); + appearanceEquipmentList.init(this); + missionCriticalObjects.init(this); + abilities.init(this); + skillMods.init(this); } private void loadTemplateData() { @@ -1554,20 +1553,6 @@ public class CreatureObject extends TangibleObject implements Serializable { if(getClient() != null) getClient().getSession().write(messageBuilder.buildListenToId(performanceListenee.getObjectId())); } - - - - @Override - public void setPvPBitmask(int pvpBitmask) { - super.setPvPBitmask(pvpBitmask); - notifyObservers(new UpdatePVPStatusMessage(getObjectID(), getPvPBitmask(), getFaction()), false); - } - - @Override - public void setPvpStatus(int pvpBitmask, boolean add) { - super.setPvpStatus(pvpBitmask, add); - notifyObservers(new UpdatePVPStatusMessage(getObjectID(), getPvPBitmask(), getFaction()), false); - } public byte getDifficulty() { synchronized(objectMutex) { diff --git a/src/resources/objects/guild/GuildObject.java b/src/resources/objects/guild/GuildObject.java index 1393a230..bee39d0c 100644 --- a/src/resources/objects/guild/GuildObject.java +++ b/src/resources/objects/guild/GuildObject.java @@ -92,15 +92,14 @@ public class GuildObject extends UniverseObject implements Serializable { public void initAfterDBLoad() { super.init(); messageBuilder = new GuildMessageBuilder(this); - guildList.init(); - currentServerGCWZonePercentMap.init(); - currentServerGCWTotalPercentMap.init(); - currentServerGCWZoneHistoryMap.init(); - currentServerGCWTotalHistoryMap.init(); - otherServerGCWZonePercentMap.init(); - otherServerGCWTotalPercentMap.init(); + guildList.init(this); + currentServerGCWZonePercentMap.init(this); + currentServerGCWTotalPercentMap.init(this); + currentServerGCWZoneHistoryMap.init(this); + currentServerGCWTotalHistoryMap.init(this); + otherServerGCWZonePercentMap.init(this); + otherServerGCWTotalPercentMap.init(this); } - public float getComplexity() { synchronized(objectMutex) { diff --git a/src/resources/objects/intangible/IntangibleObject.java b/src/resources/objects/intangible/IntangibleObject.java index 3532317e..caa7c265 100644 --- a/src/resources/objects/intangible/IntangibleObject.java +++ b/src/resources/objects/intangible/IntangibleObject.java @@ -124,8 +124,8 @@ public class IntangibleObject extends SWGObject implements Serializable { // FIXME Check if destination has view permissions to this if (this.getContainer() == destination.getParent() || this.getGrandparent() == destination.getParent()) { - destination.getSession().write(getBaseline(8).getBaseline()); getBaseline(9); // Temp fix due to minor mistake in engine - destination.getSession().write(baseline9.getBaseline()); + destination.getSession().write(getBaseline(8).getBaseline()); + destination.getSession().write(getBaseline(9).getBaseline()); } } } diff --git a/src/resources/objects/tangible/TangibleObject.java b/src/resources/objects/tangible/TangibleObject.java index 2609d507..541c7ded 100644 --- a/src/resources/objects/tangible/TangibleObject.java +++ b/src/resources/objects/tangible/TangibleObject.java @@ -51,7 +51,6 @@ import com.sleepycat.persist.model.NotPersistent; import com.sleepycat.persist.model.Persistent; import engine.clientdata.ClientFileManager; -import engine.clientdata.StfTable; import engine.clientdata.visitors.IDManagerVisitor; import engine.clients.Client; import engine.resources.common.RGB; @@ -83,9 +82,6 @@ public class TangibleObject extends SWGObject implements Serializable { @NotPersistent private transient TangibleMessageBuilder messageBuilder; - private int respawnTime = 0; - private Point3D spawnCoordinates = new Point3D(0, 0, 0); - //private TreeSet> lootSpecification = new TreeSet>(); private List lootGroups = new ArrayList(); @@ -118,7 +114,6 @@ public class TangibleObject extends SWGObject implements Serializable { public TangibleObject(long objectID, Planet planet, String template, Point3D position, Quaternion orientation) { super(objectID, planet, position, orientation, template); messageBuilder = new TangibleMessageBuilder(this); - spawnCoordinates = position.clone(); if (this.getClass().getSimpleName().equals("TangibleObject")) setIntAttribute("volume", 1); } @@ -136,8 +131,6 @@ public class TangibleObject extends SWGObject implements Serializable { public void setCustomName2(String customName) { setCustomName(customName); - - notifyObservers(messageBuilder.buildCustomNameDelta(customName), true); } public int getIncapTimer() { @@ -496,18 +489,6 @@ public class TangibleObject extends SWGObject implements Serializable { notifyObservers(new StopClientEffectObjectByLabel(getObjectID(), commandString), true); } - public int getRespawnTime() { - synchronized(objectMutex) { - return respawnTime; - } - } - - public void setRespawnTime(int respawnTime) { - synchronized(objectMutex) { - this.respawnTime = respawnTime; - } - } - public TangibleObject getKiller() { synchronized(objectMutex) { return killer; @@ -520,41 +501,6 @@ public class TangibleObject extends SWGObject implements Serializable { } } - // Returns the full STF-based name filepath - public String getProperName() - { - return "@" + getStfFilename() + ":" + getStfName(); - } - - // Returns the STF-based description filepath - public String getProperDescription() - { - return "@" + getDetailFilename() + ":" + getDetailName(); - } - - // Returns the current, true name of the Object - public String getTrueName() - { - return getCustomName() != null ? getCustomName() : getTrueStfName(); - } - - // Returns the true STF-based name - public String getTrueStfName() - { - String name = null; - try - { - StfTable stf = new StfTable("clientdata/string/en/" + getStfFilename() + ".stf"); - for (int s = 1; s < stf.getRowCount(); s++) - { - if(stf.getStringById(s).getKey().equals(getStfName())) name = stf.getStringById(s).getValue(); - } - } - catch (Exception e) { } - - return name; - } - public List getLootGroups() { return lootGroups; } diff --git a/src/services/ConnectionService.java b/src/services/ConnectionService.java index a2c6afaa..73102790 100644 --- a/src/services/ConnectionService.java +++ b/src/services/ConnectionService.java @@ -195,6 +195,8 @@ public class ConnectionService implements INetworkDispatch { CreatureObject object = (CreatureObject) client.getParent(); + object.setPvPBitmask(0); + object.setInviteCounter(0); object.setInviteSenderId(0); object.setInviteSenderName(""); diff --git a/src/services/housing/HousingService.java b/src/services/housing/HousingService.java index 3abb8b04..ac3da7e3 100644 --- a/src/services/housing/HousingService.java +++ b/src/services/housing/HousingService.java @@ -470,7 +470,8 @@ public class HousingService implements INetworkDispatch { Vector itemList = building.getItemsList(); for (int i=0;i