As the title says...
I understand that it is not possible to store anything to the UserInfo or get any data relating to 'UserInfo.getMyInfo()', when the user is not logged in. It is also written down in the Greenfoot API in every method description which is related to the user which is playing the scenario right now. But my problem is, that even the other methods (or at least one), also do not work.
I want to be able to create the scoreboard, so even if someone is not logged in, he can see the other scores. I am trying to get a list of all users with 'UserInfo.getTop()' and then save their names and two of their ints.
But already the first line without everything else does not work, if you are not logged in. The scenario does not load. So is the UserInfo completely inaccessible for user who are not logged in?
Found the reason. Looks like 'UserInfo.getTop(0)' returns 'null' if not logged in. But in the API this "Returns null if: •the user is not logged in" is only written in those methods in which the own UserInfo is addressed, not in 'getTop()' or other 'get'-methods.
So why can't I access data when I am not logged in?
List top = new ArrayList(UserInfo.getTop(0)); if (!top.isEmpty()) { //... }