Developing OpenSim Addins

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 15: Line 15:
 
== Addin Directives ==
 
== Addin Directives ==
  
As usual, your region module should be annotated as an OpenSim Region Module:
+
As usual, [https://github.com/diva/diva-distribution/blob/master/addon-modules/02AddinExample/AddinExampleModule.cs the region module] should be annotated as an OpenSim Region Module:
 
     [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AddinsExampleModule")]
 
     [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AddinsExampleModule")]
 
     public class AddinExampleModule : ISharedRegionModule
 
     public class AddinExampleModule : ISharedRegionModule
Line 21: Line 21:
 
       ...
 
       ...
 
     }
 
     }
 +
 +
Additionally, [https://github.com/diva/diva-distribution/blob/master/addon-modules/02AddinExample/Properties/AssemblyInfo.cs the assembly] that contains the region module should contain the following directives:
 +
[assembly: Addin("Diva.AddinExample", OpenSim.VersionInfo.VersionNumber + ".1")]
 +
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
 +
[assembly: AddinDescription("Example of how to create OpenSim Addins")]
 +
[assembly: AddinAuthor("Diva Canto")]
 +
 +
[assembly: ImportAddinAssembly("CsvHelper.dll")]
 +
[assembly: ImportAddinFile("AddinExample.ini")]
 +
[assembly: ImportAddinFile("AddinExample.html")]

Revision as of 13:04, 31 December 2014

This page explains how to develop, package and distribute OpenSimulator region module addins. It is written for developers who wish to provide additional functionality beyond what comes in the core distribution of OpenSim. These instructions pertain to region modules that run at the simulators. It is assumed that you are already familiar with the basics of developing region modules.

If you are looking for using and installing 3rd-party addins, please see this other page.

The Final Package

An addin example can be found at https://github.com/diva/diva-distribution/tree/master/addon-modules/02AddinExample. This is a very simple example that extends the simulator with the capability of presenting a web form to a user asking for first and last name, and storing the form data in a Comma Separated Value (CSV) file. The final addin package contains:

  • the region module dll (Diva.AddinExample.dll)
  • an external dll (CsvHelper.dll)
  • an .ini file (AddinExample.ini)
  • an html file (AddinExample.html)

These are all the files we need for OpenSim users to run the addin in their installations.

Addin Directives

As usual, the region module should be annotated as an OpenSim Region Module:

    [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AddinsExampleModule")]
    public class AddinExampleModule : ISharedRegionModule
    {
      ...
    }

Additionally, the assembly that contains the region module should contain the following directives:

[assembly: Addin("Diva.AddinExample", OpenSim.VersionInfo.VersionNumber + ".1")]
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
[assembly: AddinDescription("Example of how to create OpenSim Addins")]
[assembly: AddinAuthor("Diva Canto")]

[assembly: ImportAddinAssembly("CsvHelper.dll")]
[assembly: ImportAddinFile("AddinExample.ini")]
[assembly: ImportAddinFile("AddinExample.html")]
Personal tools
General
About This Wiki