Giter Club home page Giter Club logo

discord_game_sdk's Introduction

discord_game_sdk

Documentation Latest Version License Build Status

This crate provides a safe interface to the Discord Game SDK.

This crate is not official, it is not supported by the Discord Game SDK Developers.

The Discord Game SDK provides features such as, but not limited to:

  • Activities (Rich Presence)
  • Users, Avatars and Relationships
  • Lobbies, Matchmaking and Voice communication
  • Faux-P2P Networking on Discord's Infrastructure
  • Cloud Synchronized Storage
  • Store Transactions
  • Achievements

Version requirement: Rust 1.37 and up.

Release Notes

Usage

Add this to your Cargo.toml:

[dependencies]
discord_game_sdk = "1.0.1"

Read up on potential bindgen requirements.

Download the Discord Game SDK and set the following environment variable to where you extracted it:

export DISCORD_GAME_SDK_PATH=/path/to/discord_game_sdk

If you're also planning on using the default link feature, keep reading below.

Features:

link

Enabled by default, delegates to discord_game_sdk_sys/link.

Provides functional linking with the caveat that libraries are renamed and some additional set-up is required:

# Linux: prepend with `lib` and add to library search path
cp $DISCORD_GAME_SDK_PATH/lib/x86_64/{,lib}discord_game_sdk.so
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}$DISCORD_GAME_SDK_PATH/lib/x86_64

# Mac OS: prepend with `lib` and add to library search path
cp $DISCORD_GAME_SDK_PATH/lib/x86_64/{,lib}discord_game_sdk.dylib
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}:}$DISCORD_GAME_SDK_PATH/lib/x86_64

# Windows: change `dll.lib` to `lib` (won't affect library searching)
cp $DISCORD_GAME_SDK_PATH/lib/x86_64/discord_game_sdk.{dll.lib,lib}
cp $DISCORD_GAME_SDK_PATH/lib/x86/discord_game_sdk.{dll.lib,lib}

This allows for cargo run to function.

Optional crate.

Provides a conversion from our Image to image::RgbaImage.

Safety

This crate relies on the SDK to provide correct data and behavior:

  • Non-null pointers to valid memory
  • UTF-8, NUL-terminated strings
  • No mutation of memory it should have no ownership of
  • No use of pointers after destroy is called

Some of these are tested when compiled with debug_assertions.

Legal

You MUST acquaint yourself with and agree to the official terms of the Discord Game SDK.

The code of the Rust crates discord_game_sdk and discord_game_sdk_sys are licensed at your option under either of:

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Communication and Support

I can be reached via Discord twiikuu#0047, on the Official Game SDK Server (nicked as ldesgoui (rust wrapper)), as well as twitter and email. I reserve myself no obligation to support you, although I'm generally nice.

discord_game_sdk's People

Contributors

ldesgoui avatar dependabot-preview[bot] avatar djdeveloperr avatar eirexe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.