Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord Rich Presence support #3167

Merged
merged 31 commits into from
Oct 11, 2023
Merged

Conversation

znvjder
Copy link
Contributor

@znvjder znvjder commented Sep 2, 2023

Based on fork #2577

I decided to copy the code from the base fork and rework it due to compilation problems.
What has changed:

  • Most features tweaked, class rebuilt a bit.
  • Added enable/disable from client menu for Discord rich presence sync - disabled by default.
  • Any server owner who wants their own logo must create their own application (we need to create a tutorial on how to do this).
  • Added a feature to manage from the server, but on the client side.
  • Added the ability to display buttons to the discord-rpc code.
  • Support emojis

Below are some of the features:

setDiscordApplicationID(string applicationid)
setDiscordRichPresenceDetails(string details)
setDiscordRichPresenceState(string state)
setDiscordRichPresenceAsset(string assetImage, string text)
setDiscordRichPresenceSmallAsset(string assetImage, string text)
setDiscordRichPresenceButton(number index, string text, string url)
resetDiscordRichPresenceData()
isDiscordRichPresenceConnected()

Example on Discord:
drpc

All that was left was to add a default resource to show additional data.
I have no idea what else to add, so I'm open to suggestions.

@CrosRoad95
Copy link
Contributor

here's our favourite issue back again, vendor libraries inflate pull requests, either: 1. download sources from some server, 2. use submodule
because now reviewing it is hard due to laggy browser :)

@znvjder
Copy link
Contributor Author

znvjder commented Sep 2, 2023

here's our favourite issue back again, vendor libraries inflate pull requests, either: 1. download sources from some server, 2. use submodule

because now reviewing it is hard due to laggy browser :)

Sorry, but due to the fact that I have an edited version of discord-rpc I had to add it.

If you want i can redo it.

@CrosRoad95
Copy link
Contributor

i don't want to discuss the same issue over and over for every case, i want general solution

@Dutchman101
Copy link
Member

Dutchman101 commented Sep 2, 2023

@CrosRoad95 Please leave comments like that to the project maintainers (MTA team/write access). Avoid dragging contributors down on their PR's, if those responsible want to update coding guidelines then they can do it separately and in its own discussion. Don't reply to this post, let's keep it on topic, thanks.

@znvjder Don't mind it, vendor\discord-rpc in this PR is fine

Who uses a mobile browser to review code anyways, im on desktop and it scrolls smoothly.
Nice PR, and heavily awaited!

@Fernando-A-Rocha
Copy link
Contributor

Commenting for support and exposure. Nice PR, thank you!

@lopezloo lopezloo added the enhancement New feature or request label Sep 19, 2023
Copy link
Member

@Lpsd Lpsd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly seems good to me, just a couple of small comments.

You also mentioned "due to the fact that I have an edited version of discord-rpc I had to add it." - in this case we would want to commit those changes to https://github.com/multitheftauto/discord-rpc and restore the install_discord script. You should be able to make a pull request to the master branch of that repository with the changes.

This way we retain the install_discord premake script & exclude the vendor files from the mtasa-blue repo, which is definitely preferable.

It would be really nice to have a test resource showing examples of all functions. They will need to be written for the wiki anyway.

Good work and thanks for picking up the branch!

Client/core/CDiscordRichPresence.h Outdated Show resolved Hide resolved
Client/sdk/core/CDiscordInterface.h Outdated Show resolved Hide resolved
Lpsd
Lpsd previously approved these changes Oct 9, 2023
@Lpsd
Copy link
Member

Lpsd commented Oct 9, 2023

To be merged along with this: multitheftauto/discord-rpc#1

@Lpsd
Copy link
Member

Lpsd commented Oct 9, 2023

The branch got borked by our simultaneous commits, it's fixed now. I've kept the v in the tag for consistency (I made a mistake when creating 3.4.2).

@Lpsd Lpsd merged commit fdaa3ac into multitheftauto:master Oct 11, 2023
6 checks passed
This was referenced Oct 11, 2023
@znvjder znvjder deleted the feature/DiscordRPC branch November 18, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants