mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-06 21:13:37 -04:00
Fixed players flickering upon zone in
This commit is contained in:
@@ -52,6 +52,7 @@ import resources.network.NetBuffer;
|
||||
import resources.objects.building.BuildingObject;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
import resources.player.Player;
|
||||
import resources.player.PlayerState;
|
||||
import resources.server_info.Log;
|
||||
import services.CoreManager;
|
||||
|
||||
@@ -128,7 +129,7 @@ public abstract class SWGObject extends BaselineObject implements Comparable<SWG
|
||||
* Adds the specified object to this object and places it in the appropriate slot if needed
|
||||
* @param object Object to add to this container, which will either be put into the appropriate slot(s) or become a contained object
|
||||
*/
|
||||
protected boolean addObject(SWGObject object) {
|
||||
public boolean addObject(SWGObject object) {
|
||||
// If the arrangement is -1, then this object will be a contained object
|
||||
int arrangementId = getArrangementId(object);
|
||||
if (arrangementId == -1) {
|
||||
@@ -160,7 +161,7 @@ public abstract class SWGObject extends BaselineObject implements Comparable<SWG
|
||||
* Removes the specified object from this current object.
|
||||
* @param object Object to remove
|
||||
*/
|
||||
protected void removeObject(SWGObject object) {
|
||||
public void removeObject(SWGObject object) {
|
||||
synchronized (object.objectsAware) {
|
||||
object.objectsAware.clear();
|
||||
object.objectsAware.addAll(getObjectsAware());
|
||||
@@ -740,6 +741,12 @@ public abstract class SWGObject extends BaselineObject implements Comparable<SWG
|
||||
awarenessOutOfRange(o, updateSelf);
|
||||
}
|
||||
}
|
||||
|
||||
public void resetAwareness() {
|
||||
synchronized (objectsAware) {
|
||||
objectsAware.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public Set <SWGObject> getObjectsAware() {
|
||||
Set<SWGObject> aware;
|
||||
@@ -789,6 +796,8 @@ public abstract class SWGObject extends BaselineObject implements Comparable<SWG
|
||||
Player awareOwner = aware.getOwner();
|
||||
if (awareOwner == null || awareOwner.equals(owner))
|
||||
continue;
|
||||
if (awareOwner.getPlayerState() != PlayerState.ZONED_IN)
|
||||
continue;
|
||||
if (((CreatureObject) aware).isLoggedInPlayer())
|
||||
observers.add(aware);
|
||||
} else
|
||||
@@ -845,12 +854,6 @@ public abstract class SWGObject extends BaselineObject implements Comparable<SWG
|
||||
synchronized (objectsAware) {
|
||||
outOfRange = new HashSet<>(objectsAware);
|
||||
}
|
||||
if (outOfRange.contains(this)) {
|
||||
Log.e("SWGObject", "outOfRange contains this");
|
||||
}
|
||||
if (withinRange.contains(this)) {
|
||||
Log.e("SWGObject", "withinRange contains this");
|
||||
}
|
||||
for (SWGObject o : outOfRange) {
|
||||
if (!withinRange.contains(o)) {
|
||||
awarenessOutOfRange(o, true);
|
||||
@@ -940,7 +943,6 @@ public abstract class SWGObject extends BaselineObject implements Comparable<SWG
|
||||
synchronized (slots) {
|
||||
for (SWGObject slotObject : slots.values()) {
|
||||
if (slotObject != null && !sentObjects.contains(slotObject)) {
|
||||
//Log.i("ChildrenObjects", "Sending slotObj " + slotObject + " to " + target);
|
||||
slotObject.createObject(target, ignoreSnapshotChecks);
|
||||
sentObjects.add(slotObject);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user