Client rendering from authoritative server

Hi there. I’m working on a real-time multiplayer game using phaser 3, nodejs, socket.io, express.io. Development was going just fine until I considered how players could easily cheat via the client-side code. As such, I’d like to move the physics to server-side. I heard about running phaser 3 in headless mode. I am looking for a starting point for that transition.

Is there someone that could supply me a basic example of setup code that shows the client rendering the information it gets from the server? There are a few multiplayer games floating around this discourse which I did take a look at but unfortunately I learn by doing and am looking for a basic setup example of a client rendering the changes that the server sends. Thank you.

This is a very helpful tutorial that got me started on making my multiplayer game with an authoritative server. :slight_smile:

Actually, this might be what I’m looking for. Let me take a look and let you know, thank you. Yeah this looks like a great example of what I’m looking for. Thank you!

No problem! It sounded like everything you needed, you just need to adjust the code to your game. If you have any questions about the tutorial let me know. I know theres one error in part 2 where you add datauri because they changed the syntax in the latest version of it. I’ll post the solution when I open my game up again. My game is entirely different from the tutorial so I’ve had to play around with it a lot so far. I plan on making a very in depth video on this on YouTube when I finish my game.

Okay, so instead of

const Datauri = require('datauri');

const datauri = new Datauri();

replace that with

const DatauriParser = require("datauri/parser");

const parser = new DatauriParser();

in the index.js or whatever you call your server file to work with datauri 3.0.0 :slight_smile:

Word, thanks man. I will be sure to make that change.