Code: Select all
Integer userId = userMap.get(playerId);
User user = null;
if(userId !=null && userId != -1){
user = getApi().getUserById(userId);
if(user != null)
getApi().joinRoom(user, getParentRoom(), null, true, null, true, true);
}
userMap maps our assigned player IDs to the SFS ID assigned to the User object of the player. And it is updated whenever a player logs in to the application with the new SFS ID that is generated on login.
We've noticed that this code breaks when the player whose userId is being processed is also simultaneously logging into SFS. This has happened everytime. And upon debugging, it seems like it's breaking at getApi().getUserById(userId) but we cannot be sure since the method does not throw any Exception while the rest of the code is within a try-catch block so, any exception thrown by the rest of the code would have been caught.
So, can getApi().getUserById(userId) break if the user is also concurrently logging into SFS?