🧩 WindowsGSM Plugin Development Guide - Support more game servers by creating and installing plugins!
- Introduction
- Basic Knowledge
- Set up a plugin development environment
- Creating Your First Plugin
- Testing Your First Plugin
WindowsGSM (>= 1.21.0) starts supporting plugins installation since users want to add their own game servers to WindowsGSM which WindowsGSM doesn't support those game servers yet. More importantly, users can wait for a plugin release on the community instead of WindowsGSM release.
(27/01/2020) ! AssaultLine says... We need to know if its possible to add a game now in a custom way.
(14/04/2020) Redyear20 says... I want to know if this game panel is capable to add games not listed. For example I want to add The Isle
(20/07/2020) Kratomasy 🌈 aka Alaric says... is there a way to add a custom steam game server that is not in the list of GSM?
(06/08/2020) Tempus Thales says... If I wanted to add a server that is not listed in your tool, can I still add it with your tool?
(09/08/2020) WindowsGSM v1.21.0 released! 🥳
✔ Before writing plugins, lets understand how it looks like and how it works.
WindowsGSM scan the plugins folder and loads {PLUGIN_NAME}.cs, {PLUGIN_NAME}.png and author.png files of each plugin.
The plugin file structure is basically like that: (Installed WindowsGSM.ARMA3 and WindowsGSM.PaperMC)
For WindowsGSM.PaperMC plugin, WindowsGSM reads folder PaperMC.cs and loads PaperMC.cs, PaperMC.png and author.png
Now let's set up a plugin development environment.
Download or git pull the latest WindowsGSM #master (https://github.com/WindowsGSM/WindowsGSM)
Open WindowsGSM.sln with Visual Studio 2019
The plugin development environment is set up! 🥳
As you know, most game servers use steamcmd to install and update the server. WindowsGSM already created SteamCMDAgent class for inheritance purpose, so adding a game server that uses steamcmd is much easier than adding a server that does not support steamcmd.
Create a MyFirstPlugin.cs file inside Plugins folder on WindowsGSM-Plugin-Development project
using WindowsGSM.Functions;
using WindowsGSM.GameServer.Engine;
using WindowsGSM.GameServer.Query;
using Newtonsoft.Json.Linq;
namespace WindowsGSM.Plugins
public Plugin Plugin = new Plugin
{
name = "WindowsGSM.XXXXX",
author = "Your name",
description = "🧩 WindowsGSM plugin for supporting XXXXXX Server",
version = "1.0",
url = "https://github.com/XXXXXXXX/XXXXXXXX",
color = "#ffffff"
};
Plugin Format that inherits SteamCMDAgent
public class MyFirstPlugin : SteamCMDAgent
public MyFirstPlugin(ServerConfig serverData) : base(serverData) => base.serverData = _serverData = serverData;
private readonly ServerConfig _serverData;
public override bool loginAnonymous => false; // true if allows login anonymous on steamcmd, else false
public override string AppId => ""; // Value of app_update <AppId>
public override string StartPath => ""; // Game server start path
public string FullName = ""; // Game server FullName
public bool AllowsEmbedConsole = false; // Does this server support output redirect?
public int PortIncrements = 1; // This tells WindowsGSM how many ports should skip after installation
public object QueryMethod = null; // Query method. Accepted value: null or new A2S() or new FIVEM() or new UT3()
public string Port = ""; // Default port
public string QueryPort = ""; // Default query port
public string Defaultmap = ""; // Default map name
public string Maxplayers = ""; // Default maxplayers
public string Additional = ""; // Additional server start parameter
public async void CreateServerCFG() { } // Creates a default cfg for the game server after installation
public async Task<Process> Start() { return null; } // Start server function, return its Process
public async Task Stop(Process p) { } // Stop server function
Done! All necessary variables and functions were all created. you can now start edit your script and create your first plugin!
Example plugin with plugin format that inherits SteamCMDAgent: WindowsGSM.ARMA3
Classic Plugin Format
public MyFirstPlugin(ServerConfig serverData) => _serverData = serverData;
private readonly ServerConfig _serverData;
public string Error, Notice;
public string StartPath = ""; // Game server start path
public string FullName = ""; // Game server FullName
public bool AllowsEmbedConsole = false; // Does this server support output redirect?
public int PortIncrements = 1; // This tells WindowsGSM how many ports should skip after installation
public object QueryMethod = null; // Query method. Accepted value: null or new A2S() or new FIVEM() or new UT3()
public string Port = ""; // Default port
public string QueryPort = ""; // Default query port
public string Defaultmap = ""; // Default map name
public string Maxplayers = ""; // Default maxplayers
public string Additional = ""; // Additional server start parameter
public async void CreateServerCFG() { } // Creates a default cfg for the game server after installation
public async Task<Process> Start() { return null; } // Start server function, return its Process
public async Task Stop(Process p) { } // Stop server function
public async Task<Process> Install() { return null; } // Install server function
public async Task<Process> Update() { return null; } // Update server function
public bool IsInstallValid() { return false; } // Check if the installation is successful
public bool IsImportValid(string path) { return false; } // Check is the directory valid for import
public string GetLocalBuild() { return ""; } // Return local server version
public async Task<string> GetRemoteBuild() { return ""; } // Return latest server version
Done! All necessary variables and functions were all created. you can now start edit your script and create your first plugin!
Example plugin with classic plugin format: WindowsGSM.PaperMC
- Set Startup Project to WindowsGSM-Plugin-Development and click Start to start installing your plugins.
- Set Startup Project to WindowsGSM and click Start to start WindowsGSM and start debug!