aboutsummaryrefslogtreecommitdiff
path: root/src/gateway
Commit message (Collapse)AuthorAgeFilesLines
* Fix testsZeyla Hellyer2017-08-011-1/+1
|
* Fix the `_other` match armacdenisSK2017-07-271-3/+6
|
* Change the config a bit, and a few nitpicksacdenisSK2017-07-271-15/+22
|
* rustfmtacdenisSK2017-07-272-54/+44
|
* Revert the ignoring of protocol and data frame errors, while actually ↵acdenisSK2017-07-241-2/+0
| | | | | | handling ping pongs When receiving pings, serenity MUST send the pong with the same data as the ping. Well, as said in the rfc for websockets anyway. Though, regarding the errors, i found out that serenity's gateway wouldn't work, but i do see that i'll have to file an issue to see if they know why are these happening at all
* Also ignore data frame errorsacdenisSK2017-07-231-1/+2
|
* Ignore protocol errorsacdenisSK2017-07-231-0/+1
| | | | Without ignoring, sometimes serenity would start auto-reconnecting and spamming the console quite a lot, but not sure why do these errors happen. Still, ignoring them doesn't seem to do any harm.
* Switch to tokio for events (#122)Alex Lyon2017-07-141-1/+1
|
* Fix doc testsacdenisSK2017-07-021-14/+17
|
* Attempt to reconnect if heartbeating failsZeyla Hellyer2017-06-211-6/+6
|
* Reconnect on failed heartbeatsZeyla Hellyer2017-06-211-6/+10
|
* Update dependenciesZeyla Hellyer2017-06-211-2/+2
|
* Extract Discord close codes to constantsZeyla Hellyer2017-06-211-13/+13
|
* Rework shard logic and shard handlingZeyla Hellyer2017-06-164-420/+398
|
* Switch from #[doc(hidden)] to pub(crate)alex2017-06-141-14/+6
| | | | | | Switch from using `#[doc(hidden)]` to hide some internal functions to `pub(crate)`. The library now requires rustc 1.18.
* Only set shard timeout after a READY is receivedZeyla Hellyer2017-06-131-5/+9
|
* Fix voice compilationZeyla Hellyer2017-06-101-2/+19
|
* Fix shard doctestsZeyla Hellyer2017-06-071-7/+7
|
* Upgrade rust-websocket, rust-openssl, and hyperZeyla Hellyer2017-06-075-180/+164
| | | | | | | | | | | | | | | | Upgrade `rust-websocket` to v0.20, maintaining use of its sync client. This indirectly switches from `rust-openssl` v0.7 - which required openssl-1.0 on all platforms - to `native-tls`, which allows for use of schannel on Windows, Secure Transport on OSX, and openssl-1.1 on other platforms. Additionally, since hyper is no longer even a dependency of rust-websocket, we can safely and easily upgrade to `hyper` v0.10 and `multipart` v0.12. This commit is fairly experimental as it has not been tested on a long-running bot.
* Ws read/write timeout after 90sZeyla Hellyer2017-06-061-1/+25
| | | | | | | | | | Make read/writes to the stream timeout after 90 seconds to prevent a potentially infinitely blocked call. If the timeout is reached, perform a reconnect. This fixes issues such as intermittent internet issues causing a message to never be received, and thus infinitely blocking.
* Separate websocket client initializationZeyla Hellyer2017-06-061-12/+10
| | | | | The logic for this was duplicated, and can be easily separated into its own function.
* Deprecate Client::login, add Client::newZeyla Hellyer2017-06-061-1/+2
|
* Use chrono for struct timestamp fieldsZeyla Hellyer2017-06-062-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chrono is easier to use than timestamped strings, so they should be automatically deserialized and available for the user, instead of having the user deserialize the strings themselves. These fields have been changed to use a type of `DateTime<FixedOffset>`: - `ChannelPinsUpdateEvent.last_pin_timestamp` - `Group.last_pin_timestamp` - `Guild.joined_at` - `GuildChannel.last_pin_timestamp` - `Invite.created_at` - `Member.joined_at` - `Message.edited_timestamp - `Message.timestamp` - `MessageUpdateEvent.edited_timestamp` - `MessageUpdateEvent.timestamp` - `PrivateChannel.last_pin_timestamp` `Member.joined_at` is now also an `Option`. Previously, if a Guild Member Update was received for a member not in the cache, a new Member would be instantiated with a default String value. This is incorrect behaviour, and has now been replaced with being set to `None` in that case. Id methods' `created_at()` method now return a `chrono::NaiveDateTime` instead of a `time::Timespec`, and `User::created_at` has been updated to reflect that. Additionally, drop `time` as a direct dependency and use chrono for internals.
* Check last heartbeat acknowledged in heartbeaterZeyla Hellyer2017-06-012-4/+34
| | | | | | | | | | When heartbeating, first ensure that the previous heartbeat was acknowledged. If it wasn't, shutdown the sender and receiver so that an auto-reconnect can take place. When receiving a Heartbeat Acknowledgement, set the `last_heartbeat_acknowledged` to `true` to prevent the auto-reconnect process.
* Add more examples and improve some othersZeyla Hellyer2017-05-231-18/+133
| | | | | Add examples to some functions, and update some of the old examples to use the `?` operator instead of unwrapping.
* Restructure modulesZeyla Hellyer2017-05-225-0/+958
Modules are now separated into a fashion where the library can be used for most use cases, without needing to compile the rest. The core of serenity, with no features enabled, contains only the struct (model) definitions, constants, and prelude. Models do not have most functions compiled in, as that is separated into the `model` feature. The `client` module has been split into 3 modules: `client`, `gateway`, and `http`. `http` contains functions to interact with the REST API. `gateway` contains the Shard to interact with the gateway, requiring `http` for retrieving the gateway URL. `client` requires both of the other features and acts as an abstracted interface over both the gateway and REST APIs, handling the event loop. The `builder` module has been separated from `utils`, and can now be optionally compiled in. It and the `http` feature are required by the `model` feature due to a large number of methods requiring access to them. `utils` now contains a number of utilities, such as the Colour struct, the `MessageBuilder`, and mention parsing functions. Each of the original `ext` modules are still featured, with `cache` not requiring any feature to be enabled, `framework` requiring the `client`, `model`, and `utils`, and `voice` requiring `gateway`. In total the features and their requirements are: - `builder`: none - `cache`: none - `client`: `gateway`, `http` - `framework`: `client`, `model`, `utils` - `gateway`: `http` - `http`: none - `model`: `builder`, `http` - `utils`: none - `voice`: `gateway` The default features are `builder`, `cache`, `client`, `framework`, `gateway`, `model`, `http`, and `utils`. To help with forwards compatibility, modules have been re-exported from their original locations.