How to update a value across all devices this app installed in (played or closed)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Suleymanov
If a < b:
    b = a #done
    _save_b_value() #successfully saved
    #now, how to update var b in all devices that has this app installed (while played or closed)?" 

Do you want to save some data to a file that was executed during the game?

VarionDrakon | 2020-12-28 12:27

Thank you for the reply! Yes, but not only to a local file (which I can already do), but I want to save the same data to the files in all of the respected devices that has this application.

When var b is updated in one device, I want b to be updated in all devices for the same app. Say, my score updated to 3, it should show 3 in your device too (either live or upon scene reload).

Suleymanov | 2020-12-28 12:36

Well, for this you need a server on which the “Save” for the game will be stored. You can make it so that when you start the game and when the Internet is connected on the device, initially there is a check of saves on the server(or other place where it can be stored), and when you find a newer version of the file, it downloads to the device (this is called synchronization). If you play some semi-online games on Android, you may notice that some games and apps (Such as What’sapp) save to the user’s GoogleDisk what they chose Themselves…

VarionDrakon | 2020-12-28 13:26

Thank you for the guide! It’s a good base to start from. I’ll research servers and how to exchange data with them. Any further guide from you on where exactly I can find practical information about servers is much appreciated!

Suleymanov | 2020-12-28 13:42

I’ll wait for the results)

VarionDrakon | 2020-12-28 13:55

:bust_in_silhouette: Reply From: rustyStriker

Well, basically you want a server, something the client can “look up to” and ask “do you have any updates for me on other players?”…
basically a server to hold all the data, since if 2 players aren’t connected(to the internet) at the same time you cannot really enforce the data to pass between them

I just wrote about this in the comments above…

VarionDrakon | 2020-12-28 13:31

Thank you for the reply! Since I am new to the process, another question arises: Can player’s device be the server for other devices? If not, are there free 24/7 server services out there since all I have to save is literally one single data. Any reference to how it can be accomplished is much appreciated!

Suleymanov | 2020-12-28 13:38