HTML5 multiplayer concept advise

Greetings everyone,

This is my first time posting in the AnswerHub - so here it goes.
While I have a good knowledge of PHP + MySQL, my knowledge in JavaScript, openGL and other web languages/render/scripting are lacking…

From my research there is not much on this (at least that I have been able to find using google, and community).

  1. It is a bad idea to put ANYTHING regarding connecting to a database inside the client - to prevent users from gaining access to the DB and changing values. However with HTML5, it is running in the webpage - would it be okay to have DB queries in the “client” AKA what the user interacts with when playing the game? or should this also be avoided?

I know about and have, to a limited extent used: VaRest, HttpRequest, so…
2) Lets say for a hypothetical Multiplayer Online Game - with the user playing in their browser (HTML5)

  • user goes to website
  • user enters login credentials → gets sent to log-in server via VaRest or HttpRequest, etc…
  • If valid login show list of game servers (think ARK: Survival Evolved) → user can select the server
  • user selects the server → game connects to the relevant server (running a UnReal server with out of the box multiplayer - for replication, etc…)
  1. Would that kind of system work? or would I need to make my own Sockets to connect the client to the server?
  2. Lets say for argument that both the server and client - client, embedded in a website - are being hosted on the same physical server. Would the answer given for #3 still apply?

Thank you,