I’ve started working recently on a mmo project. I designed the project to be very minimal in resource consumption on the server side. I made a database and use network extension to GET/POST to php pages that contain the functions to manipulate the database. What makes it possible is that the client (the gdevelop game) only queries the server when necessary. It loads player stats on startup, and player can save to the database to update whatever they’ve accomplished while playing. Otherwise the game only contacts the server every 5 minutes to sync: a sort of autosave - so it is not a large use of data from people contacting the server constantly. The client keeps running on the players device and anything acquired can be added to the database during the next sync.
Here’s where my question comes in: I am able to post data to the database in bulk: I can send all the players stats in a string expression and update in one query during the 5 minute sync interval. I haven’t yet found a way to retrieve data in bulk. I have to retrieve each variable one request at a time when loading the stats at the start of play. The requests are stretched out over a few moments to minimize server impact. It would be much more efficient if I could get all the data in 1 request to cut down on server requests. But I’m not really sure how to take the response from the server which would be in the form of something like:
“id=1 row1=something1 row2=something2” and sort that into:
I’ve tried to google but I haven’t been able to find the right search parameters to give me what I’m looking for: I have found some documents about converting a json file, which might be a possible solution, but it would require an extra step of saving the server response into a json file and then converting it into a structure. I haven’t entirely disregarded this idea, just wondering if it’s the most efficient solution. I’ve also seen some older discussions using c++ which I guess is from the older version of gdevelop so I mostly disregarded.
So I guess what I’m asking, even if it may be simple to some of you, is how do I go about this? What terminology can I put in google will bring up a proper example or code fragment to build this from? Any suggestion about the best way to proceed would be helpful.