Second problem:

choose one:

Quote:
movement code for player - executed on server and client


You either have the server be responsible for movement and rely results to the client or you can have the client do their own movements and then update the server with the results. You can use either depending on your application, but not both at the same time.