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

Multiplayer Notification Fix for random Termination #2024

Merged
merged 5 commits into from
Feb 27, 2020
Merged

Multiplayer Notification Fix for random Termination #2024

merged 5 commits into from
Feb 27, 2020

Conversation

wrov
Copy link
Contributor

@wrov wrov commented Feb 27, 2020

This pull request hopefully fixes the problem that the multiplayer turn notifier randomly stops running. The problem seems to have been a reliance on global variables. Because of the Worker architecture of the notifier, the Unciv app context may not exist when it is called by the WorkManager. In that case all global variables may have default or null values.

To remove the dependence on global variables, the turn notifier has been rewritten to store its settings in a Data object that is part of the WorkManager API.

Also all dependence on the .tr() lib has been removed. The .tr() call relies heavily on Unciv.Current being initialized, which is not guaranteed because Android might have unloaded the app from RAM.

As a result, I had to switch the notifier over to Android's native i18n lib, which uses a completely different set of files for its texts. :(

wrov added 5 commits February 27, 2020 01:51
…n-final static variables being null. Instead moved all state to Worker specific architecture. Also switched to Android based localization because core-based one can be unavailable to worker.
Added missing androidX declaration (neccessary for newer Gradle versions)
Updated Gradle for new Android Studio Version
@yairm210 yairm210 merged commit 9188c77 into yairm210:master Feb 27, 2020
@yairm210
Copy link
Owner

Please add an explaination on how to translate these strings in the wiki

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.

2 participants