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

Minor Discord-RPC updates and Crowdin integration #3224

Conversation

znvjder
Copy link
Contributor

@znvjder znvjder commented Oct 28, 2023

This PR introduces several features and improvements:

  • Crowdin Integration: This feature enables the integration with Crowdin, allowing statuses to be displayed in the language used by the client. This enhances the localization of the application for users who prefer a different language.

  • Minor Fixes: The PR includes several minor fixes, addressing issues and bugs that have been identified and resolved for a smoother user experience.

  • Player Count Display: A new feature has been added that allows the display of the number of players in the status when using the default MTA Rich Presence application. This provides users with information about the current player count, which can be helpful for server management and user engagement.

  • Increased Rich Presence Refresh Time: The refresh time for Rich Presence has been increased. This adjustment is aimed at mitigating potential game fluidity issues, ensuring a smoother and more stable gaming experience for users.

  • Custom Application Handling: With the changes introduced in this PR, if a custom application is used and a resource is stopped (triggered the onClientResourceStop event), it will now trigger a reset and set the default MTA Rich Presence application. This ensures that the default Rich Presence functionality is retained when using custom applications. Additionally, a more precise method for checking if the client is connected with a custom application has been added, enhancing the reliability and accuracy of custom application detection.

Overall, this PR enhances localization, improves the user experience, and addresses potential issues related to game fluidity, resource handling, and custom application detection.

I changed this method to GetTickCount() because the function was being called too frequently, which could lead to additional issues. Now it refreshes every 10 seconds, which should be sufficient. Additionally, in the Discord documentation, there is a note about a rate limit of 1 per 15 seconds, but in reality, it can sometimes be less or more. It also introduces minor improvements.
I prepared this code so that in case of issues, we can smoothly disable the IO thread in Discord-RPC. This, however, brings problems, for example, during resource retrieval, the connection can be interrupted, causing a discrepancy, which may lead to an assert error.
I've decided to use synchronization maxPlayers in player_puresync. Synchronization sends every 512 packets, which, in the default settings, is interpreted as just under a minute.
Client/core/CCore.cpp Outdated Show resolved Hide resolved
@znvjder
Copy link
Contributor Author

znvjder commented Oct 29, 2023

I've added a more precise method for checking if client is connected with custom application.

@Dutchman101 Dutchman101 merged commit 1511bdd into multitheftauto:master Nov 3, 2023
6 checks passed
MTABot pushed a commit that referenced this pull request Nov 3, 2023
1511bdd Minor Discord-RPC updates and Crowdin integration (#3224)
@znvjder znvjder deleted the feature/discordrpc-crowdin-integrity-and-minor-fixes 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants