Skip to content

Commit 1be91f9

Browse files
committed
Mostly why space changes and a comment to clue in future-me of
a "problem" if I happen to notice it again in the future when working on my test applications.
1 parent 4921b05 commit 1be91f9

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

src/main/java/com/simsilica/ethereal/NetworkStateListener.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,19 @@ public void endFrame( long time ) {
341341
it.remove();
342342
idIndex.retireId(so.getNetworkId());
343343

344+
// Dear future-Paul, if you are here because you are trying
345+
// to figure out why a removed object didn't actually get
346+
// removed from the activeIds (and thus not removed on the client)
347+
// note that if there are no other moving objects in the space
348+
// the frame updates stop happening. There are no frame times
349+
// and so StateCollector stops calling us at all.
350+
// I've left it this way because it is extremely unreastic
351+
// that NO objects would be moving anywhere in the space...
352+
// especially since typically the player itself is an object
353+
// moving in the space. Fixing it is non-trivial and incurs
354+
// a small overhead all the time just to support this unlikely
355+
// use-case. But hopefully this comment will save you a couple
356+
// hours of debug logging if you forget why it's like that.
344357
activeIds.remove(so.getEntityId());
345358
} else {
346359
activeIds.add(so.getEntityId());

src/main/java/com/simsilica/ethereal/zone/StateCollector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ protected void publishFrame( StateFrame frame ) {
208208
}
209209
l.beginFrame(frame.getTime());
210210
}
211-
211+
212212
for( StateBlock b : frame ) {
213213
publish( b );
214214
}
@@ -248,7 +248,7 @@ protected void collect() {
248248
for( StateFrame f : frames ) {
249249
if( f == null ) {
250250
continue;
251-
}
251+
}
252252
publishFrame(f);
253253
}
254254

src/main/java/com/simsilica/ethereal/zone/ZoneManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public void beginUpdate( long time ) {
231231
for( Long id : pendingRemoval ) {
232232
if( log.isDebugEnabled() ) {
233233
log.debug("ZONE: --- delayed deactivation:" + id);
234-
}
234+
}
235235
ZoneRange range = index.remove(id);
236236
if( log.isDebugEnabled() ) {
237237
log.debug("range:" + range);
@@ -439,7 +439,7 @@ public void remove( Long id ) {
439439
ZoneRange range = index.get(id);
440440
if( log.isDebugEnabled() ) {
441441
log.debug("range:" + range);
442-
}
442+
}
443443
if( range == null ) {
444444
return;
445445
}

src/main/java/com/simsilica/util/BufferedHashSet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public Set<E> getTransaction() {
9595
* Called from the writing thread to apply the buffer changes
9696
* to the readable view.
9797
*/
98+
@SuppressWarnings("unchecked")
9899
public void commit() {
99100
assert checkThread() : badThreadMessage();
100101
delegate = buffer;

0 commit comments

Comments
 (0)