Room synchronization

19 views
Skip to first unread message

Toby

unread,
Nov 11, 2019, 12:50:55 AM11/11/19
to Union Platform
My first app uses account logins, and doesn't have the problem described here.
My second app just gives clients names and doesn't use accounts or logins - just simple connections.

In the second app, on a couple of occasions, a user has indicated they don't see someone who is in the room,
or, in an even more bizarre variation, the client code seems to think two clients have the same name (with one of them being the wrong name).

I am trying to figure this out, which is hard, because, since it's on the client side, getting debug info is difficult at best.

In desperation, I ask if anyone here (that is, if anyone IS here at all) has any insight.

Here are some places where I've looked:
function addOccupantListener(e) // e is a RoomEvent
{
 
if (rm.getSyncState() != net.user1.orbiter.SynchronizationState.SYNCHRONIZING)
    addObserver
(name, id, true, r);
 
return;
}
What happens when the state IS Synchronizing? Does this get a second chance later when it's done? Does this cause this client to be missed somehow?
I copied this code from the Chat Room example, and it's been working fine on my other app.

Another place is this one:  If you do this at the wrong time (too early, I guess), might the list of occupants be wrong?

function joinRoomListener(e)
{
 
var observers = myRoom.getOccupants();
 
for (var o=0; o<observers.length; o++)
   
{
   
var c = observers[o];
   
var id = c.getClientID();
   
var name = getPlayerName(c);
    addObserver
(name, id, false, roomID);
   
}
}

Anyone got any other ideas?


Reply all
Reply to author
Forward
0 new messages