11-21-2020, 12:03 PM
(11-21-2020, 08:40 AM)fitkoh Wrote: Not really: my limited programming knowledge is entirely self taught and self guided. I haven't adhered to any particular curriculum or course of study... I just try to learn what I need to know to achieve a goal. I have bits and pieces of different languages, techniques, methods I've acquired over the years, mostly from examining other's code. Recently I've found https://www.w3schools.com to be very useful.
Perhaps a long long time ago, before stylesheets, I could have been considered fluent in javascript, but js have evolved significantly since then, and I haven't kept up with the changes. This recent project has been challenging, but I am satisfied with my progress thus far. I have some help on the client, but I've done all the integrations with the server side, and wrote the first prototype from scratch in 2 days. I then did some research and rewrote almost the entire set of scripts using newly discovered techniques. Five days later, more studying later, I rewrote about half of what I had. Now I'm working on a fourth iteration which will be heavily focused on security, in hopes of a round of beta testing maybe by early next year
Okay then it might be helpful to remind you that a full-blown registration system is only needed when one wants to identify the users/players in the long-term; hence the users table/list and the registration process plus the login/logout routines. If that's what you really want then yes, a database-backed app is warranted.
On the other hand, if you only want to keep track of the who's who, short-term (ie during the ongoing game server-side), then PHP sessions are what you're looking for instead. PHP session is the way PHP keeps track of the user-agent requests (ie the way it keeps state on a stateless protocol that's HTTP). They are generally ephemeral (destroyed when the browser exit) and you can destroy(/or regenerate them server-side) via your PHP script.
I'll leave it to you to see what fits best your use case. In case of an ephemeral state preservation (that shouldn't require a user, login, logout tables) you'll only need the session table implemented preferably with Redis [don't use a classic database server in Games, inadequate for latency] and a session script.
The way I would have implemented it is by using JavaScript in both the front-end (your actual JavaScript-based game) and in the back-end using Node.js and Redis to store my users session data.
If Node.js and Redis are new software for you, I'd highly recommend you to start studying them in-depth. They are the keys for a successful HTML5-based Game App.
Good luck!