updated server-side gameplay code