hasPlayedBefore always return true?

@Listener
public void onLogin(ClientConnectionEvent.Join event) {
	System.out.println(event.getTargetEntity().hasPlayedBefore());
	System.out.println(event.getTargetEntity().firstPlayed());
	System.out.println(event.getTargetEntity().lastPlayed());
}

Even running a new server, it’s still return true. Why?

Version: SpongeVanilla version 1.11.2-6.0.0-BETA-243

[16:18:56] [Server thread/INFO] [STDOUT]: [***.onLogin(***.java:32)]: true
[16:18:56] [Server thread/INFO] [STDOUT]: [***.onLogin(***.java:33)]: SpongeValue{key=Key{Value:Value<Instant>, Query: FirstTimeJoined}, defaultValue=1970-01-01T00:00:00Z, actualValue=2017-04-04T08:18:55.928Z}
[16:18:56] [Server thread/INFO] [STDOUT]: [***.onLogin(***.java:34)]: SpongeValue{key=Key{Value:Value<Instant>, Query: LastTimePlayed}, defaultValue=1970-01-01T00:00:00Z, actualValue=2017-04-04T08:18:56.104Z}

This looks like a bug due to the first time joined, and first time played values being extremely close, but different.

Looks like we need to double check the tolerances, / make sure the data is set using the same time and not calling get time twice.

Thanks, I’ve filed it on the bug tracker which you can find here: https://github.com/SpongePowered/SpongeCommon/issues/1282

1 Like