Skip to content

Commit

Permalink
Fixes and cleanup (#16)
Browse files Browse the repository at this point in the history
* Expose types::Snowflake

* Correct voice region, add st-pete

* Update deps

* Fixup README

* Update CHANGELOG
  • Loading branch information
Jake-Shadle authored Aug 23, 2021
1 parent 7597e20 commit a39a969
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
2 changes: 0 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ ignore = [
# dev only xcb
"RUSTSEC-2020-0097",
"RUSTSEC-2021-0019",
# dev only net2
"RUSTSEC-2020-0016",
]

[bans]
Expand Down
2 changes: 1 addition & 1 deletion examples/overlay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ test = false
doctest = false

[dev-dependencies]
eframe = "0.12"
eframe = "0.13"
examples-shared = { path = "../../examples-shared" }
parking_lot = "0.11"
8 changes: 8 additions & 0 deletions sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- markdownlint-disable blanks-around-headers no-duplicate-header blanks-around-lists -->

<!-- next-header -->
## [Unreleased] - ReleaseDate
### Changed
- [PR#16](https://github.com/EmbarkStudios/discord-sdk/pull/16) exposed the `Snowflake` type publicly, as there are cases where you might need to use it directly as it is the underlying type for most of the unique identifiers throught the SDK.

### Fixed
- [PR#16](https://github.com/EmbarkStudios/discord-sdk/pull/16) fixed regions to use `kebab-case` instead of `snake_case`, and add the `st-pete` region, which is apparently a voice region that can be used, but isn't listed in `/voice/regions`.

## [0.1.2] - 2021-08-11
### Fixed
- [PR#14](https://github.com/EmbarkStudios/discord-sdk/pull/14) fixed an issue where the `RELATIONSHIP_UPDATE` event actually uses stringized timestamps in the activity information, rather than the normal `i64` timestamps in eg `SET_ACTIVITY`.
Expand Down
7 changes: 4 additions & 3 deletions sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ An (unofficial) open source Rust implementation of the [Discord Game SDK](https:
- You like to live dangerously (though this library does also have some automated tests!).

## Implemented Features

### TODO: [Achievements](https://discord.com/developers/docs/game-sdk/achievements)

### [Activities (Rich Presence)](https://discord.com/developers/docs/game-sdk/activities)
Expand Down Expand Up @@ -144,7 +145,7 @@ cargo test --features local-testing test_activity

### Lobbies

**NOTE**: This a does not test the lobby `search` functionality as that command seems to be non-functioning and never returns results, even if the [REST](https://discord.com/developers/docs/game-sdk/lobbies#create-lobby-search) equivalent does return the expected results.
**NOTE**: This does not test the lobby `search` functionality as that command seems to be non-functioning and never returns results, even if the [REST](https://discord.com/developers/docs/game-sdk/lobbies#create-lobby-search) equivalent does return the expected results.

```sh
cargo test --features local-testing test_lobbies
Expand All @@ -165,8 +166,8 @@ Any contribution intentionally submitted for inclusion in an Embark Studios proj

This contribution is dual licensed under EITHER OF

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)

at your option.

Expand Down
1 change: 1 addition & 0 deletions sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ pub use error::{DiscordApiErr, DiscordErr, Error};
pub use handler::{handlers, wheel, DiscordHandler, DiscordMsg};
pub use proto::event::Event;
use proto::{Command, CommandKind};
pub use types::Snowflake;
pub type AppId = i64;

pub use crossbeam_channel as cc;
Expand Down
4 changes: 3 additions & 1 deletion sdk/src/lobby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub type Metadata = std::collections::BTreeMap<String, String>;
pub type LobbyId = Snowflake;

#[derive(Serialize, Deserialize, PartialEq, Debug, Copy, Clone)]
#[serde(rename_all = "snake_case")]
#[serde(rename_all = "kebab-case")]
pub enum Region {
Amsterdam,
Brazil,
Expand All @@ -37,6 +37,8 @@ pub enum Region {
VipAmsterdam,
VipUsEast,
VipUsWest,
// This isn't in the list returned by /voice/regions but...
StPete,
}

#[derive(Copy, Clone, Debug, Serialize_repr, Deserialize_repr)]
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/lobby/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub enum LobbyEvent {
///
/// [API docs](https://discord.com/developers/docs/game-sdk/lobbies#onmemberupdate)
MemberUpdate(MemberEvent),
/// Event fired when a lobby is deleted.
/// Event fired when a lobby is deleted, or when the current user disconnects.
///
/// [API docs](https://discord.com/developers/docs/game-sdk/lobbies#onlobbydelete)
Delete {
Expand Down

0 comments on commit a39a969

Please sign in to comment.