refactor parts of server code, todo: fix desync when player hit by bullets