Multiple clients writing to ES3 cloud

Discussion and help for Easy Save 3
Post Reply
nFighter
Posts: 52
Joined: Thu Apr 12, 2018 7:15 am

Multiple clients writing to ES3 cloud

Post by nFighter »

I want to allow multiple clients to read/write same file in ES cloud. Basic turnaround could be:
1. player read array from ES cloud file
2. add/delete value from array
3. save ES cloud file

It should not be an often action but I believe it could be a situation when 2 or more payers will try to access same file simultaneously. What’s the best way to deal with this task? I’m thinking about “locking” a file to player before editing. Something like:
0. Check if file’s special variable is empty, if yes ->
1. Write your ID to special variable in the file
2. Check if file’s special variable contains your ID (to prevent situation if someone write ID to the file faster than you)
3. Read/write array from file
4. Empty the file’s special variable


Should it work? Did I missed some important cases? Did I not understand some concept and use ES3 wrong?
User avatar
Joel
Moodkie Staff
Posts: 4852
Joined: Wed Nov 07, 2012 10:32 pm

Re: Multiple clients writing to ES3 cloud

Post by Joel »

Hi there,

MySQL handles concurrent access to a file, so you should not need to perform your own versioning.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply