mooball
    Preparing search index...

    Type Alias IPlugin

    type IPlugin = {
        prototype: Addon;
        new (
            name: string,
            active?: boolean,
            metadata?: any,
        ): Addon & AllPluginCallbacks;
    }
    • Creates a new Plugin instance.

      Parameters

      • name: string

        Name of the Plugin. Every Plugin should have a unique name, since they can be accessed directly by their names from inside a Room object.

      • Optionalactive: boolean

        Activation status of the Plugin. If this is true, the Plugin is automatically activated just after initialization, while a Room object is being created.

      • Optionalmetadata: any

        Any information that we would want to show/update inside a GUI application about this Plugin. This is not used by the API by default, but we can reprogram the Plugin's prototype to make use of this value if we want.

      Returns Addon & AllPluginCallbacks

      void.

      // If you are using require.js library or in node.js, 
      // API might also be defined via var API = require("mooball");
      function TestPlugin(API){
      const { Plugin, AllowFlags } = API;
      Object.setPrototypeOf(this, Plugin.prototype);
      Plugin.call(this, "template", true, {
      version: "0.1",
      author: "author",
      description: `This is a test plugin`,
      allowFlags: AllowFlags.CreateRoom|AllowFlags.JoinRoom
      });
      // Plugin codes here...
      }
    Index

    Properties

    Properties

    prototype: Addon