Detecting Openplanet in ManiaScript

To detect Openplanet in ManiaScript, you check the value System.ExtraTool_Info on the clientside. This will be a string containing the string "Openplanet" and a version. For example:

Boolean HasOpenplanet() {
  return TL::RegexFind("^Openplanet [0-9\\.]+ \\([^,]+, [^\\)]+\\)$", System.ExtraTool_Info, "g").count == 1;
}

Note that this works only on the side where Openplanet is running, so if you want to check on the server if some client is running Openplanet, you'll have to send them a Manialink with the detection code and do a netwrite request and netread response.

Use a library

The code example above is from Dommy's Openplanet Maniascript library. You can download it here.

Created 412 days ago by