I've been reading up a lot on Game networking and at this point I'm very confused on what I need to do in a client/server setup.
My question stems from this Gaffer on Games article. Mainly the bit about a pure client/server setup.
In a pure client/server model you run no game code locally, instead sending your inputs such as key presses, mouse movement, clicks to the server. In response the server updates the state of your character in the world and replies with a packet containing the state of your character and other players near you. All the client has to do is interpolate between these updates to provide the illusion of smooth movement and BAM you have a networked client/server game.
Inputs would then be time sensitive, right? So you would have to tell the server when each input happens in relation to the last/next input?
How would you accomplish this? Send a long representing a tick number on the client side so that the server knows when the commands happened? (pressed left at tick 50, released left at tick 342, pressed up at tick 345) Or am I misunderstanding the term "command"?
My next question is in regards to what gets sent out to all clients (state updates or commands). I've asked this question before but I think I misunderstood the answer. Here's what I thought was the correct way to handle this entire interaction (just movement):
Client sends raw position updates (not commands) -> Server does validity checks then sends that update to all clients in area
OR
Client sends movement command (like move east from this position) -> Server accepts command and applies to simulation
Server is on a loop that sends delta updates to all clients (raw positions and interpolate on client)