Tonight I found strange behavior in User class. It seems like isPlayer field is not compatible with isSpectator() method. In my case, isPlayer field is always set to false (even when user.getPlayerIndex() > 0), while isSpectator() method returns correct result (true when user.getPlayerIndex() == -1, and false when user.getPlayerIndex() > 0).
The same thing goes on with playerIndex/getPlayerIndex() pair. playerIndex is always set to 0, while getPlayerIndex returns correct value for the user.
Ok, we shouldn't access class fields directly, but it is strange behavior nevertheless. I used isPlayer/playerIndex fields accidentally tonight, and it took me almost one hour to figure out what is going on.
If we are not supposed to use playerIndex and isPlayer fields, then you should make them private (to prevent use by accident), or at least mark them in documentation as fields for internal use, to warn people about possible problems.