Skip to content

Commit

Permalink
Add new functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrapivin committed May 27, 2020
1 parent b58aed7 commit abe5fcc
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
Binary file modified NekoPresence.dll
Binary file not shown.
18 changes: 18 additions & 0 deletions NekoPresence/nekopresence-lin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ extern "C" {
return GM_TRUE;
}

EXPORTED_FN double np_registergame(char* client_id, char* command) {
if (!np_Initialized) return GM_FALSE;
Discord_Register(client_id, command);
return GM_TRUE;
}

EXPORTED_FN double np_registergame_steam(char* client_id, char* steam_id) {
if (!np_Initialized) return GM_FALSE;
Discord_RegisterSteamGame(client_id, steam_id);
return GM_TRUE;
}

EXPORTED_FN double np_setpresence_more(char* small_image_text, char* large_image_text, double instance) {
if (!np_Initialized) return GM_FALSE;

Expand All @@ -166,4 +178,10 @@ extern "C" {
Discord_UpdatePresence(&discordPresence);
return GM_TRUE;
}

EXPORTED_FN double np_clearpresence(void) {
if (!np_Initialized) return GM_FALSE;
Discord_ClearPresence();
return GM_TRUE;
}
}
18 changes: 18 additions & 0 deletions NekoPresence/nekopresence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ extern "C" {
return GM_TRUE;
}

EXPORTED_FN double np_registergame(char* client_id, char* command) {
if (!np_Initialized) return GM_FALSE;
Discord_Register(client_id, command);
return GM_TRUE;
}

EXPORTED_FN double np_registergame_steam(char* client_id, char* steam_id) {
if (!np_Initialized) return GM_FALSE;
Discord_RegisterSteamGame(client_id, steam_id);
return GM_TRUE;
}

EXPORTED_FN double np_setpresence_more(char* small_image_text, char* large_image_text, double instance) {
if (!np_Initialized) return GM_FALSE;

Expand All @@ -166,4 +178,10 @@ extern "C" {
Discord_UpdatePresence(&discordPresence);
return GM_TRUE;
}

EXPORTED_FN double np_clearpresence(void) {
if (!np_Initialized) return GM_FALSE;
Discord_ClearPresence();
return GM_TRUE;
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ But in some rare cases you may want to build this extension yourself.
1. Open `NekoPresence.sln` in Visual Studio 2019.
2. Build it.
3. Replace `Release\NekoPresence.dll` in extension files with your new DLL.
PS: (Build directory of the project is set to `Release\`, DLL in root of this repo won't be replaced, it's just here to make it easier to find!)
PS: (Build directory of the project is set to `Release\`, DLL in root of this repo won't be replaced! It's for people who just want latest prebuilt libs.)

#### Linux (64-Bit, Debian-based)
1. Make sure you have `build-essential` package installed.
Expand Down
Binary file modified libnekopresence.so
Binary file not shown.

0 comments on commit abe5fcc

Please sign in to comment.