Commit Graph

2 Commits

Author SHA1 Message Date
Christopher F
bfaa6fc97a Enforce a maximum value when parsing unix timestamps (#981)
* UnixTimestampConverter should now obey a maximum value

This change prevents an issue where the converter would be unable to
handle obscenely large timestamp values - which are actually quite
common on Discord.

OptionalConverter had to be rewritten to support checking whether or not
an InnerConverter returned an Optional. The perf impacts from this
_shouldn't_ be too bad, as types without a custom parser (which should
be the majority of Optionals in the lib) will bypass the type-check.

* optimizations on OptionalConverter
2018-03-18 16:22:27 -04:00
Christopher F
34b4e5a6d2 Refactor Games, support reading Rich Presences (#877)
* Add API-level support for Rich Presences

* Add library-level support for Game presences

* Add model conversions for outgoing+incoming rich presences

* Refactored Game into Activities

* Integrated Activities with user entities

rebase hell from 5f3cb947a92f4fd01cc4df47ca548180036b47f3

* Fix JSON converters for Activities

* Finish rebase, activity should be set on BaseSocketClient

* Use ApplicationId to define a rich presence

* Added SetActivityAsync to Base and Sharded Socket clients

* Remove public parameterless Game constructor

* Remove GameAssets, refactored to GameAsset

* Hide constructors for types that should be read-only

* Revert changes to Discord.Net.sln

got damned visual studio caching

* Refactor GameParty to use dedicated current/capacity values

Per feedback from @khionu
2017-12-23 14:58:35 -05:00