# Client rendering from authoritative server

**URL:** <https://phaser.discourse.group/t/client-rendering-from-authoritative-server/6486>\
**Category:** Phaser 3\
**Created:** [May 29, 2020, 6:11am UTC](https://phaser.discourse.group/t/client-rendering-from-authoritative-server/6486 "2020-05-29T06:11:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Secrets](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Secrets](https://phaser.discourse.group/u/Secrets)\
**Post date:** [May 29, 2020, 6:11am UTC](https://phaser.discourse.group/t/client-rendering-from-authoritative-server/6486/1 "2020-05-29T06:11:40Z")

</div>

Hi there. I’m working on a real-time multiplayer game using phaser 3, nodejs, [socket.io](http://socket.io), [express.io](http://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.

---

<div class="post-metadata">

**Author:** ![josephbaitz](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/josephbaitz/32/3516_2.png) [@josephbaitz](https://phaser.discourse.group/u/josephbaitz)\
**Post date:** [June 5, 2020, 12:16pm UTC](https://phaser.discourse.group/t/client-rendering-from-authoritative-server/6486/2 "2020-06-05T12:16:34Z")

</div>

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

> **[Creating A Simple Multiplayer Game In Phaser 3 With An Authoritative Server –...](https://phasertutorials.com/creating-a-simple-multiplayer-game-in-phaser-3-with-an-authoritative-server-part-1/)**
>
> In this multi-part tutorial, we will be creating a simple multiplayer game with Phaser and Socket.io. For our multiplayer game, we will follow the client-server game architecture and we will be settin

---

<div class="post-metadata">

**Author:** ![Secrets](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Secrets](https://phaser.discourse.group/u/Secrets)\
**Post date:** [June 6, 2020, 6:31am UTC](https://phaser.discourse.group/t/client-rendering-from-authoritative-server/6486/3 "2020-06-06T06:31:04Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![josephbaitz](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/josephbaitz/32/3516_2.png) [@josephbaitz](https://phaser.discourse.group/u/josephbaitz)\
**Post date:** [June 6, 2020, 10:31am UTC](https://phaser.discourse.group/t/client-rendering-from-authoritative-server/6486/4 "2020-06-06T10:31:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![josephbaitz](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/josephbaitz/32/3516_2.png) [@josephbaitz](https://phaser.discourse.group/u/josephbaitz)\
**Post date:** [June 6, 2020, 1:04pm UTC](https://phaser.discourse.group/t/client-rendering-from-authoritative-server/6486/5 "2020-06-06T13:04:43Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Secrets](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Secrets](https://phaser.discourse.group/u/Secrets)\
**Post date:** [June 7, 2020, 7:11am UTC](https://phaser.discourse.group/t/client-rendering-from-authoritative-server/6486/6 "2020-06-07T07:11:49Z")

</div>

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