Jump to content

Discord Rich Presence


Recommended Posts

  • Premium
On 10/1/2021 at 6:23 PM, zsoltiabeka10 said:

Hey guys, anyone knows how can I get characters like "á,ő,ú,ű" etc working? Right now it's displayed as "?".
I tried changing file encoding but it didn't work for me.

Thanks in advance!

https://docs.microsoft.com/en-us/cpp/preprocessor/execution-character-set?view=msvc-160

  • Love 1
Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 1 year later...

Severity    Code    Description    Project    File    Line    Suppression State
Error    C1047    The object or library file '..\..\extern\lib\libjpeg-MT.lib' was created by a different version of the compiler than other objects like '..\..\extern\lib\discord_rpc_r.lib'; rebuild all objects and libraries with the same compiler    UserInterface    D:\files\Leg\ClientSource\Client\UserInterface\LINK    1    

and

Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK1257    code generation failed    UserInterface    D:\files\Leg\ClientSource\Client\UserInterface\LINK    1    

I got this error in vs2022

Edited by Viello
Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
On 7/31/2021 at 8:09 PM, Cysgod said:

Talvez alguém possa fazer uso dele:
 

espaçador.png

 

Fonte:

  Ocultar conteúdo

 

 

discord_rpc.h (na fonte rpc e sua pasta externa)

 

// Search the struct and replace it

typedef struct DiscordRichPresence {
    const char* state;   /* max 128 bytes */
    const char* details; /* max 128 bytes */
    int64_t startTimestamp;
    int64_t endTimestamp;
    const char* largeImageKey;  /* max 32 bytes */
    const char* largeImageText; /* max 128 bytes */
    const char* smallImageKey;  /* max 32 bytes */
    const char* smallImageText; /* max 128 bytes */
    const char* partyId;        /* max 128 bytes */
    int partySize;
    int partyMax;
    const char* matchSecret;    /* max 128 bytes */
    const char* joinSecret;     /* max 128 bytes */
    const char* spectateSecret; /* max 128 bytes */
    const char* buttonLabel; /* max 128 bytes */
    const char* buttonURL; /* max 128 bytes */
    int8_t instance;
} DiscordRichPresence;

 

Serialização.cpp (na fonte RPC):

// Search:

                if ((presence->partyId && presence->partyId[0]) || presence->partySize ||
                    presence->partyMax) {

// Add ABOVE:

                if (presence->buttonLabel && presence->buttonLabel[0] && presence->buttonURL && presence->buttonURL[0]) {
                    WriteArray assets(writer, "buttons");
                    WriteObject btn1(writer);
                    WriteOptionalString(writer, "label", presence->buttonLabel);
                    WriteOptionalString(writer, "url", presence->buttonURL);
                }

 

Na origem do cliente, você precisa adicioná-lo à atualização RPC:
 

	discordPresence.buttonLabel = "Join Servername2's Discord";
	discordPresence.buttonURL = "https://discord.gg/ASDASDASDIASDASDAOPS";

	Discord_UpdatePresence(&discordPresence);

 

 

how do i make it work??

Link to comment
Share on other sites

  • 5 months later...
  • 4 months later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.