Skip to content

Commit

Permalink
Forgot createflags in inits
Browse files Browse the repository at this point in the history
  • Loading branch information
msciotti committed Aug 10, 2018
1 parent 5194deb commit f8d401e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/game_sdk/Activities.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ OnActivityInvite += (ActivityActionType type, User user, Activity activity) =>
### Example: Inviting a User to a Game

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);

// Update user's activity for your game.
// Party and secrets are vital.
Expand Down
2 changes: 1 addition & 1 deletion docs/game_sdk/Applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void ValidateOrExit((Discord.Result result) =>
### Example: Get OAuth2 Token

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);
var appManager = new discord.CreateApplicationsManager();

// Retrieve the token
Expand Down
2 changes: 1 addition & 1 deletion docs/game_sdk/Images.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void GetData(ImageHandle handle, (Discord.Result result, byte[] data) =>
### Example: A Helper Method for Getting a User's Avatar Data

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);

// Request user's avatar data. Sizes can be powers of 2 between 16 and 2048
static void FetchAvatar(Discord.ImagesManager imagesManager, Int64 userID)
Expand Down
4 changes: 2 additions & 2 deletions docs/game_sdk/Lobbies.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ In the preceding section, you probably noticed there are a couple different meth
If you are creating lobbies for users in the game client, and not on a backend server, consider using `GetLobbyActivitySecret` and `ConnectWithActivitySecret()`. `GetLobbyActivitySecret()` will return you a unique secret for the lobby concatenated with the lobby's id. You can pipe this value directly to the `Secrets.Join` field of the `Activity` payload. Then, when a user receives the secret, their client can call `ConnectWithActivitySecret()` with just the secret; the lobby id is parsed out automatically. This saves you the effort of concatenating the secret + id together yourself and then parsing them out again. As a code example:

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);
var lobbiesManager = Discord.CreateLobbiesManager();
var activitiesManager = Discord.CreateActivitiesManager();

Expand Down Expand Up @@ -347,7 +347,7 @@ If you are creating lobbies with your own backend system (see the section below)
### Example: Search for a Lobby, Connect, and Join Voice

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);

// Search lobbies.
var query = lobbiesManager.CreateLobbySearch();
Expand Down
2 changes: 1 addition & 1 deletion docs/game_sdk/Networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ A quick note here may be helpful for the two functions that should be called con
### Example: Connecting to Another Player in a Lobby

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);

// Join a lobby with another user in it
// Get their session id, and connect to them
Expand Down
4 changes: 2 additions & 2 deletions docs/game_sdk/Overlay.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ OnOverlayLocked += (bool locked) =>
### Example: Unlock the Overlay

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);

var overlayManager = discord.CreateOverlayManager();

Expand All @@ -64,7 +64,7 @@ overlayManager.SetLocked(false);
### Example: Activate Overlay Invite Modal

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);
var overlayManager = discord.CreateOverlayManager();

// Invite users to join your game
Expand Down
4 changes: 2 additions & 2 deletions docs/game_sdk/Relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ OnRelationshipUpdate += (Relationship relationship) =>
### Example: Accessing a User's Friends List

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);
var relationshipsManager = discord.CreateRelationshipsManager();

// Assign this handle right away to get the initial relationships update.
Expand Down Expand Up @@ -116,7 +116,7 @@ relationshipsManager.OnRelationshipsUpdate += () =>
### Example: Invite Users Who Are Playing the Same Game

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);
var relationshipsManager = discord.CreateRelationshipsManager();
var activitiesManager = discord.CreateActivitiesManager();

Expand Down
14 changes: 11 additions & 3 deletions docs/game_sdk/SDK_Starter_Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Now we're gonna start coding. Didn't think we'd get three so fast, did ya? _Thin

```cs
// Grab that Client ID from earlier
var discord = new Discord.Discord(CLIENT_ID);
var discord = new Discord.Discord(CLIENT_ID, Discord.CreateFlags.Default);
```

5. Make sure to call `discord.RunCallbacks()` in your main game loop; for Unity, that's your `Update()` function.
Expand All @@ -127,12 +127,19 @@ struct Application {
};

struct Application app;
// Don't forget to memset or otherwise initialize your classes!
memset(&app, 0, sizeof(app));

struct IDiscordCoreEvents events;
memset(&events, 0, sizeof(events));

DiscordCreate(0, CLIENT_ID, &events, &app, &app.core);
struct DiscordCreateParams params;
params.client_id = CLIENT_ID;
params.flags = DiscordCreateFlags_Default;
params.events = &events;
params.event_data = &app;

DiscordCreate(0, &params, &app.core);
```
5. Make sure to call `core->run_callbacks(core, 0)` in your game loop.
Expand All @@ -151,8 +158,9 @@ You're ready to go! Check out the rest of the documentation for more info on how
4. It's dangerous to go alone—take this small code block with you (to start)!
```cpp
// Don't forget to memset or otherwise initialize your classes!
discord::Core* core{};
auto result = discord::Core::Create(CLIENT_ID, &core);
auto result = discord::Core::Create(CLIENT_ID, DiscordCreateFlags_Default, &core);
```

5. Make sure to call `core->RunCallbacks()` in your game loop
Expand Down
2 changes: 1 addition & 1 deletion docs/game_sdk/Storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ FileStat StatIndex(int index);
### Example: Saving, Reading, Deleting, and Checking Data

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);
var storageManager = discord.CreateStorageManager();

// Create some nonsense data
Expand Down
2 changes: 1 addition & 1 deletion docs/game_sdk/Users.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ OnCurrentUserUpdate =+ User user =>
### Example: Fetching Data About a Discord User

```cs
var discord = new Discord.Discord(clientId);
var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);

var usersManager = discord.CreateUsersManager();
usersManager.Fetch(450795363658366976, (Discord.Result result, ref Discord.User user) =>
Expand Down

0 comments on commit f8d401e

Please sign in to comment.