Updated script

port has to be above 1024 for non-root; connect to IP:49999 (e.g.
http://127.0.0.1:49999) with a webbrowser
Updated script

function is leaveGame not leaveLevel