moved all functions from game.cpp to client