working on server side game loop