Fixed various bugs

This commit is contained in:
Treeku
2014-05-12 04:56:29 +01:00
parent 9b4272e434
commit 4fe246975c
12 changed files with 71 additions and 115 deletions
+12 -7
View File
@@ -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<E> implements Set<E>, Serializable {
private static final long serialVersionUID = 1L;
private TreeSet<E> set = new TreeSet<E>();
private transient int updateCounter = 0;
private long objectId;
private byte viewType;
private short updateType;
private boolean addByte;
@@ -55,7 +52,6 @@ public class SWGSet<E> implements Set<E>, 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<E> implements Set<E>, Serializable {
public SWGSet(Set<E> s) {
if (s instanceof SWGSet) {
this.objectId = ((SWGSet<E>) s).objectId;
this.object = ((SWGSet<E>) s).object;
this.viewType = ((SWGSet<E>) s).viewType;
this.updateType = ((SWGSet<E>) s).updateType;
@@ -72,10 +67,20 @@ public class SWGSet<E> implements Set<E>, 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) {