EmbarkStudios / discord-sdk

An open implementation of the Discord Game SDK in Rust
Apache License 2.0
150 stars 10 forks source link

Initial implementation #2

Closed Jake-Shadle closed 3 years ago

Jake-Shadle commented 3 years ago

This adds the base groundwork for replicating the official SDK as well as (mostly) complete implementations of the Activities, Lobbies, and Overlay portions of the SDK.

The current implementation is largely hands off, meaning that it is up to the user to manage the actual state, unlike the official SDK. For example, if you create a lobby, and wanted to present the state of the lobby in a UI (the users in the lobby, whether those users are speaking, what messages had been sent to the lobby, and any metadata associated with the lobby or the users) you would need to keep the state of the lobby updated with all of the various events (member connected/disconnected/updated, member start/stop speaking, lobby updated) to accurately represent the complete lobby state as Discord would see it.

One other thing, we are using a fork of tokio as named pipe support on Windows is extremely new, and was missing a few small methods that we need to be able to use the same exact I/O loop code on both Unix and Windows without having to have a separate special path just for Windows.