Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Discord Rich Presence support #3167

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

Merged
Lpsd merged 31 commits into multitheftauto:master from znvjder:feature/DiscordRPC
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.

PlatinMTA, AlexTMjugador, Dutchman101, Weaita, Mkl21, bum8hj, Fernando-A-Rocha, xLive, Bence58, Noiz3, and 6 more reacted with thumbs up emoji Deihim007 reacted with hooray emoji PlatinMTA, Dutchman101, Weaita, Pieter-Dewachter, znvjder, Fernando-A-Rocha, xLive, Bence58, Noiz3, MobinYengejehi, and 5 more reacted with rocket emoji
znvjder added 16 commits August 12, 2023 13:29
Copy link

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 :)

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.

Copy link

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

Copy link
Member

Dutchman101 commented Sep 2, 2023
edited
Loading

@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!

Pieter-Dewachter, Fernando-A-Rocha, znvjder, bum8hj, Nico8340, Bence58, Wannacry-ops, MobinYengejehi, and matheustkn reacted with thumbs up emoji Fernando-A-Rocha reacted with hooray emoji Fernando-A-Rocha reacted with heart emoji Fernando-A-Rocha reacted with rocket emoji

Copy link
Contributor

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

znvjder reacted with thumbs up emoji

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

@Lpsd Lpsd left a comment
edited
Loading

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!

Lpsd
Lpsd previously approved these changes Oct 9, 2023
Copy link
Member

Lpsd commented Oct 9, 2023

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

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).

znvjder reacted with thumbs up emoji

@Lpsd Lpsd merged commit fdaa3ac into multitheftauto:master Oct 11, 2023
MTABot pushed a commit that referenced this pull request Oct 11, 2023
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

Reviewers

@Lpsd Lpsd Lpsd approved these changes

+3 more reviewers

@AlexTMjugador AlexTMjugador AlexTMjugador left review comments

@Allerek Allerek Allerek left review comments

@TracerDS TracerDS TracerDS left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

enhancement New feature or request

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /