I'm trying to make an android game in which I want the palyer to have the liberty to play offline or online via an email authentification. If online, all the players progress, coins and purchases will be saved on the phones memory into a global, and if he connects via email , the values will be updated to the account and everytime the player is buying something it will be stored there. But in a scenario in which the user plays online and makes a small progress and then plays offline on another phone and makes a big progress or buys some items, how could I keep the bigger progress and the items if the user choses to go online with the account, because I want the account to set the values stocked on server and what was on the phone would be overwritten by the server data. And when the user enters the game, first I check if he isconnected and if he is, again I want to set those values. What is the best procedure to avoid these type of situations?
What is the best practice to store and get the data of a player if he can play both online and offline?
196 Views Asked by Cassius At
1
There are 1 best solutions below
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in UNITY-GAME-ENGINE
- How to use invokerepeating and make ui text fade in/out over time?
- Player input not working properly in unity
- Get block in Mesh Unity
- Does Unity render invisible material?
- Physics.OverlapSphere couldn't detect my ‘Player’
- Cannot sync non-player objects in Unity mirror
- How to script a simple collision using hands in OVRCameraRigInteraction?
- Drawing on 3D object at Unity
- How to Override Spline Rotation for Player-Controlled Car in Racing Game?
- Why doesn't my enemy shield take damage first. Instead both enemy and shield are being destroyed together
- unity + Vuforia balck screen in android AR app
- how do I change an objects tag when the game closes
- How to remove white space in a user's input through an input field in Unity?
- Timeline doesn't start eventhough it recognises the trigger input
- Ragdoll 2D Aiming
Related Questions in MOBILE
- Doesn't work TrafficStats.clearThreadStatsTag() in Kotlin
- KeyboardAvoidingView makes a messy the flexbox
- How can I find a lost Samsung Device?
- How can I eliminate or deactivate the white flash that appears when I press a button via a mobile device?
- In MAUI how can I Show different appshell tabbars depending on the user role?
- Why doesn't TrafficStats.clearThreadStatsTag() work in Kotlin?
- How can I create an animation like WhatsApp archive button spawn animation with SwiftUI on watchOS?
- Not showing the widget wrapped with Obx in Android 14
- Is there a way to use Family Link group in my own application?
- Is it viable proxying all my mobile apps requests, to some kind knowing that a request is coming from a secure source
- How can I connect android app to arduino via Bluetooth?
- How to animate calculated position/container height when viewport changes?
- Unnecessary override. Try adding behavior in the overriding member or removing the override
- Selecting an option in the mobile app drop down which is not visible when the app is loaded for the first time
- Getting Real-Time Sensor Data from Smart Watches
Related Questions in SAVE
- Flutter: How to add items and save it in local storage?
- Can be their an extension to save pages in as offline in the browser itself?
- Excel VBA macro works flawlessly on my computer, but has different errors on different machines?
- Cannot save a Custom Variational Autoencoder Model built in Keras with tensor flow
- String Type Value Member and Display Member in VB.NET Combobox with manually filled data
- VBA Word changing command button properties prevents closing without save prompt
- How to save plots one at a time from momentuHMM fit object?
- what is the expected behavior if you try to save an openpyxl workbook on a file that is already open?
- Nextjs: How to save simple data even in a way that are not lost when navigation between routes?
- Excel VBA unable to save file on a network drive
- Android Studio Error : Class declares multiple JSON fields named 'mLifecycleRegistry';
- How to save a file in Files iOS system app in iOS 17 Swift
- Saving a base64 code into a folder gives me a failed image and cannot open it with PHP
- In Oracle Cloud Infrastructure, how to upload a csv file generated in a notebook directly into a bucket?
- Tensorflow - Save & Load custom model in Keras v3 format
Related Questions in NAKAMA
- Nakama server can't load golang .so plugin
- UserNames search by wildcard Nakama Api
- “JavaScript runtime function invalid.”,”key”:”afterUpdateAccount”
- Nakama Error when trying to modify existing builtin api
- how to setup js runtime in nakama game server?
- Nakama Godot Error code Not Found when trying to auth
- Godot PGSGP Why can't I connect a function to the signal
- Nakama service gets terminated on aws t2xlrage Ireland
- Connecting YugabyteDB to nakama in docker-compose
- SocketListener doesn't give callbacks
- How to Connect Nakama Client (on unity) to a linux VM instance
- Remote debug with VSCode, go & nakama
- Nakama is running from command line using docker-compose up command but unable to access it from URL http://127.0.0.1:7350/ What can be the issue?
- Run cockroachdb in secure mode using docker compose and connect nakama to it
- Facebook authentication through Nakama server in Unity3D game
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
What you describe would require a fairly sophisticated backend server to maintain all of this information.
You might consider looking into Nakama by Heroic Labs and seeing if that fits your needs, or you can find something similar.
I am not affiliated with them by the way, it's just open source and I have been considering using their tech for my own game.
Either way, it will take more than just knowing best practices in order to implement what you have described.
Also, to answer your question about conflict resolution, usually you would maintain timestamps of all transactions (balance changed, item collected etc.) and you would compare the timestamps with your local information to see which data was newer.
You would also likely add some custom logic to only update certain data this way. An example would be when you have a local device with a higher balance than the online account; you may want to just keep the higher balance instead of taking the online balance if the balance isn't critical to your player economy.
But you'd usually want everything to be server authoritative, to reduce the chance of players hacking balances as an example.