modified the magplayer server code