4 ms·
Even better, make a simple networked game. Socket.io makes it quite trivial to send messages. What I found works really well is keeping state as a series of mut
by matthewfcarlson 3y ago
Even better, make a simple networked game. Socket.io makes it quite trivial to send messages. What I found works really well is keeping state as a series of mutations. Then a client emits a mutation and its broadcast out, if the mutation can’t apply, then it gets discarded and the server sends its copy of the state to the client that emitted the bad mutation. Makes it really hard to cheat but only requires sending mutations to the clients.
https://matthewc.dev/projects/vuex-sync-p1/ https://matthewc.dev/projects/vuex-sync-p1/