News for hackers. Stuff that matters.
Re:UI = F(statesⁿ) by matthewfcarlson on Friday February 16, 2024 @02:36PM (#39401891)
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/

There are no comments on this comment yet.