Now the open function will follow through a bit more and insure that the
proper sequence of events happens during the Open call. This required
some refactoring and a few mild changes in the onEvent func.
* Added ability to change the online status
* Add structs for rick presence implementation
* Refractor and publicise UpdateStatusData
* Add UpdateStatusComplex for raw status data sending
* Case gameType to int, stopped it compiling
* Might want to gofmt.
Doesn't do it on save because Gogland removed it and their new thing I
can't make sense of.
* Revert "Added ability to change the online status"
This reverts commit 235cd15a8eebbec070cb95a5853295387bceae1c.
* Change gametypeto match
* Move RLock to UpdateStatusComplex
* add custom ratelimits
* check for nil ratelimiter
* Don't expose custom ratelimits to Session
* attempt to fix race conditions
* use defer instead
* Slightly improved ratelimiter
You shouldn't need to change the ratelimiters ratelimits while its
running so I removed the functions SetCustomRatelimit and
RemoveCustomRatelimit.
* Add heartbeat ACK response and error handling
- Error when sending a heartbeat now triggers a reconnection
- Op7 now triggers a reconnection
- Session now tracks the last heartbeat ACK that was recieved. If the
last ACK is more than FailedHeartbeatAcks*heartbeatinterval in the past,
this is treated as a dead connection and a reconnection is forced.
* Address @iopred comments
This is a stability improvement but may have a slight performance
impact. This change will be reviewed again later. Doing this solves a
data race issue with the Sequence number that must be tracked for
gateway resume and heartbeats. Event specific handlers are now called
as a goroutine though.
Also cleaned up identify sending so there's now a function that handles
it instead of duplicate code. Renamed handshake* structs to identify*
structs to make naming match up.