Skip to content

Commit

Permalink
Added the RPC_UPDATE_TIME preprocessor that defines the time in milli…
Browse files Browse the repository at this point in the history
…seconds that must pass to update the RPC.
  • Loading branch information
Zukaritasu committed Dec 16, 2023
1 parent 585eb44 commit 0fe2e1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vstudio/src/PluginDiscord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "PluginDiscord.h"
#include "PluginInterface.h"
#include "PluginResources.h"

#include <cstdlib>
#include <cstdio>
Expand Down Expand Up @@ -246,7 +247,7 @@ void RichPresence::CallBacks(void* data) noexcept
goto reconnect;
}
mutex.Unlock();
::Sleep(1000 / 60);
::Sleep(RPC_UPDATE_TIME / 60);
}
}

Expand All @@ -256,7 +257,7 @@ void RichPresence::Status(void* data) noexcept
{
while (true)
{
::Sleep(10000);
::Sleep(RPC_UPDATE_TIME);
reinterpret_cast<RichPresence*>(data)->Update(false);
}

Expand Down
1 change: 1 addition & 0 deletions vstudio/src/PluginResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#define DEF_LARGE_TEXT_FORMAT "Editing a %(LANG) file"
#define DEF_APPLICATION_ID_STR "938157386068279366"
#define DEF_APPLICATION_ID 938157386068279366
#define RPC_UPDATE_TIME 1000

#define MIN_CLIENT_ID ((__int64)1E16)
#define MIN_LENGTH_CLIENT_ID 17
Expand Down

0 comments on commit 0fe2e1f

Please sign in to comment.