Documentation

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:

#Include "TextLib" as TL

// Returns true if the user has Openplanet installed
Boolean HasOpenplanet() {
  return TL::RegexFind("^Openplanet ", System.ExtraTool_Info, "").count == 1;
}

// Returns the signature mode currently used in Openplanet
Text GetOpenplanetSignatureMode() {
  declare Text[] SignatureMode = TL::RegexMatch(" \\[([A-Z]*)\\]$", System.ExtraTool_Info, "");
  if (SignatureMode.count == 1) {
    return SignatureMode[0];
  }
  return "REGULAR";
}

The signature modes available with Openplanet by default are:

  • OFFICIAL - Only plugins shipped with Openplanet can run.
  • REGULAR - Only signed regular plugins can run.
  • SCHOOL - Only signed school mode and regular plugins can run.
  • DEVMODE - All signed and unsigned plugins can run.

Competition profiles can be returned here, too. For example, COMPETITION is returned when the user has the TMWT competition profile enabled. If you wish to host your own competition with a custom set of approved plugins, please get in touch with us.

The list of signature modes are "tiered", meaning that one signature mode allows its own set of plugins plus anything above, as seen in the table below.

Current / Define OFFICIAL REGULAR SCHOOL DEVMODE
Official
Regular
School
Developer

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. (We have some plans to make this easier to handle in the future.)


Page updated 10 months ago by Miss(Trusted developer)