Vatuu / discord-rpc

Java Wrapper of the Discord-RPC Library for Discord Rich Presence.
MIT License
194 stars 42 forks source link

Make end time of game nullable #18

Closed 1-alex98 closed 5 years ago

1-alex98 commented 6 years ago

If I wanna set start and end time of a game. I am forced to set start and end time by the parameters being long and not Long. Our game https://faforever.com/ does not have a fixed end time, so I want to be able to only set a start time but no end time.

Vatuu commented 5 years ago

Sorry for being quite inactive for the last weeks.

Every field inside the DiscordRichPresence object is nullable by default. You can add a start timestamp, and the timer inside the presence will count up. Simply don't assign anything to the end timestamp.

1-alex98 commented 5 years ago

https://github.com/Vatuu/discord-rpc/blob/031fe6a9d23cfd42695b9ba9a869da5002217d25/src/main/java/net/arikia/dev/drpc/DiscordRichPresence.java#L40 Sure? long is not nullable right?

1-alex98 commented 5 years ago

Ok i got it now so i can set startTime but not endtime. But that is not possible via the Builder. So it would be good to either split up startTime and endTime in the setTimestamps call or to accept Long instead of long in the Builder, because that was really confusing for me. I thought you would keep variables private if you have a Builder. Whatever thank you very much for your help ;)

1-alex98 commented 5 years ago

image