Jump to content

Developing OpenMod Plugins


- Alex -

Recommended Posts

  • Community Leader

  • Member ID:  1
  • Group:  Community Leader
  • Followers:  11
  • Topic Count:  211
  • Topics Per Day:  0.06
  • Content Count:  508
  • Content Per Day:  0.15
  • Reputation:   36
  • Achievement Points:  4808
  • Solved Content:  0
  • Days Won:  36
  • Joined:  07/11/17
  • Status:  Online
  • Last Seen:  
  • Device:  Windows

Developing OpenMod Plugins
From Project Template to Testable Plugin
GGU Public Technical Knowledge Base

Public Knowledge Base:
This article is written for both GGU administrators and the wider server-hosting community. General instructions are platform-neutral where possible; GGU-specific practices are identified separately.

 

Applies To

  • C# developers
  • OpenMod plugin maintainers

 

Prerequisites

  • .NET SDK suitable for the target project
  • OpenMod development dependencies
  • A test server

 

What You’ll Accomplish

Create a maintainable OpenMod plugin using the framework's command, configuration, permission, logging, and lifecycle concepts.

 

Start with the Official Template

OpenMod provides project templates for universal and Unturned plugins. A plugin ID should be unique and is commonly aligned with the package ID.

dotnet new openmod-universal-plugin --PluginId <PluginId>
dotnet new openmod-unturned-plugin --PluginId <PluginId>

 

Plugin Structure

  • Plugin entry class/lifecycle.
  • Commands.
  • Configuration.
  • Permissions.
  • Services/dependency injection.
  • Logging.
  • Translations/resources where applicable.

 

Commands

Use OpenMod command base classes and command metadata for names, aliases, description, and syntax. Restrict actor types through the framework's actor mechanism rather than ad-hoc type checks.

 

Configuration

OpenMod's developer docs use `Microsoft.Extensions.Configuration`. Keep configuration focused on settings operators are likely to change, and do not hardcode operational values that vary between servers.

 

Permissions

Register custom permissions before checking them. Command permissions are better handled through the command system rather than manually recreating command-use checks.

 

Logging

Inject `ILogger` and log meaningful state transitions and errors. Avoid logging secrets.

 

Build & Test

  1. Build in Release mode for deployment.
  2. Test load/unload/reload.
  3. Test a fresh configuration.
  4. Test permission denied and allowed paths.
  5. Test failure cases, not only the happy path.
  6. Document any data migration.

 

GGU Implementation Notes

GGU in-house OpenMod plugins should live in Gitea, be reproducibly built, and have deployment/version information tied to the repository revision. Production binaries should come from the approved build artifact whenever practical.

 

Upstream References

 

Golden Gamers United — Public Technical Knowledge Base
General guidance first. GGU implementation details second.

Alex Thunderhunter

Alex — Founder & Systems Architect

Building the community, one server at a time.

Community Leader
Link to comment
Share on other sites


  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.