defined function to lock and restart server
removed useless code from playerLogin