- Joined
- Apr 13, 2016
- Messages
- 32
- Reaction score
- 19
Hello Guys
here i want to present you the DPDDs StarMade Wrapper. It is be a multifunctional server management and extension tool. The Wrapper is written in C# in the .Net Version 4.6.1 (How to use on Linux, look below).
If you dont have an StarMade Installation linked in the Prroperties(default is ./StarMade) the Wrapper will automatically download the latest if you have set SMAutoUpdate to true, otherwise you get asked on Wrapper Start
But The most Important:
The Download Link: https://starmadedock.net/content/dpdds-starmade-wrapper-0-9.7681/
GitHub: Alendon1/DPDDs-StarMade-Wrapper
If you want to see the Wrapper in Action our Server runs on them, the links to the server threads:
LetsKautsch: https://starmadedock.net/threads/lets-kautsch-e-v-fair-play-server.30958/
Also you can just join our Discord Server if you directly interested: discord.gg/kFftHUK
Or add me Directly: Alendon#1984
here i want to present you the DPDDs StarMade Wrapper. It is be a multifunctional server management and extension tool. The Wrapper is written in C# in the .Net Version 4.6.1 (How to use on Linux, look below).
- Server/Wrapper:
- The Server restarts automatically and have a built in daily restarter
- Updates automatically the Server when a new StarMade Version was released
- Built in Plugin System
- a !help method for a general information about all plugin commands
- !help 'plugin_command' for detailed information
- !usage 'plugin_command' for the usage
- DONT NEED any Modifications on the Client Side
- Have Multiple StarMade Servers running if you want
- Wrapper Commands like: start, stop, pause, resume, restart, update, various plugin commands
- Run every StarMade Command from the Console if you want
- Logging System (not all Important things write logs yet)
- Plugin System:
- Very easy installation of new Plugins
- Files with multiple Plugins inside are fully supported
- Choose Easily which Plugin you want to activate or not, also you can load unload them later
- A ! based Command System
- Multiple Events are supported like: PlayerKilled, SectorChange or FactionJoin
- All important Commands with a return Value are supported, for example FactionMembers or PlayerInfo
- And still if not directly implemented you can use any StarMade Command which has Console
compatibility - A Build in Custom Event System(The Wrapper triggers and a random event method from a plugin get called)
- The Logging System Is accesable from the Plugins for an uniform logging
- Support for Voting Based Rewards
- Property/Config Support for Plugins
- Server/Wrapper:
- Use the Chat in the Wrapper(not that difficult just not implemented yet)
Pretty Up the whole Wrapper, maybe a GUI Version-> Create a Remote Tool for the Wrapper
- Support for Timebased Plugin Actions (Next Update)
- Add Database Support
- Create a Server Mod for bridging StarMade and The Wrapper and general Distort Support
- Expand the AutoUpdater for Extended File Support(BlockType.Properties for example)
- Automatic Backups
- Custom Wrapper Commands (for Plugins)
- Plugin System:
- A Questing System?
- On Windows:
- Make Sure you have a compatible .NET Version installed
- On Linux or macOS:
- Goto Download - Stable | Mono
- Choose your Distribution
- Follow the installation Guide and install the mono complete Package to make sure everything runs right
- Extract the Content of the Wrapper to an empty Folder
- Open The wrapper.properties and adjust your preffered Settings
Code:
HourToRestart at which Hour the wrapper should restart, example 3 is at 3 o'clock
DailyAutoRestart if true the Server will daily restart at given time
SMAutoUpdate if set true it will automatically check if there is an StarMade update available and install it
PathToStarNet The Path where you have StarNet saved, i put it in the zip so dont change this
PathToSm The relative StarMade Path if you dont know how to use, just put your StarMade Folder(where the starmade.jar is inside) in the folder where the wrapper is, and eventually rename, OR you dont make anything and the Wrapper will automatically install StarMade
DefaultLoadPlugins if true all plugins which are inside the Plugin Path will be loaded
PluginPath The Path where the Wrapper searches the Plugins
Pass Your SuperAdminPassword
Port The Port where the Server will run, leave it at 4242 unless you want to run multiple Servers
RamMin The Minimum Ram for StarMade
RamMax The Maximum Ram for StarMade
StopCountdown The Countdown for stopping the Server
PlayerPerCustomEvent The needed Players for Triggering one more Custom Event
EventLogInConsole The SM-Events will be logged in Console if true(for example PlayerKilled PlayerJoin)
LogPath The Path where the Wrapper/Plugin Logs will be saved
PluginDataSavePath The Path for Custom Data saved by Plugins
CustomEventSleep The time how often a Custom event can Occur in millisecond
Debug Only Logs actually, if true Debug Informations will be logged
VoteLink The Link of your Server on starmade-servers.com
VoteApiKey your Server Api Key of starmade-servers.com
UseVoteSystem set this true, if you have a Plugin which uses the Vote System
- Run The Wrapper Executeable, on Linux Server use the mono command to start the Wrapper
- PLS Dont use older StarMade Version or only with caution, they are not supported
- On Wrapper Start it checks if the StarMade.jar exists to check the game availability and the version, the wrapper can update or install StarMade, Check the properties file
- At Runtime you can use various commands by just typing it into the console, also you can use StarMade Commands like ingame with "/status" for example, run the help command to see a list of all available commands
- IMPORTANT: ALWAYS CLOSE THE WRAPPER WITH THE STOP COMMAND, OTHERWISE ITS POSSIBLE THAT THE STARMADE SERVER KEEPS RUNNING, ALSO THE PLUGINS GET A STOPPED METHOD CALLED, SO THEY HAVE A CHANCE TO SAVE DATA OR ELSE
- Put the Plugin.dll inside your Plugins Folder
- Check your wrapper.properties and set DefaultLoadPlugins=true, or create a file named pluginload.properties and put there the PluginID inside =true
- You can use different wrapper commands to manage the Plugins, also See a List of all available Plugins with the "plugins_available" command, run help to see all
- Cooming soon xD
- No i give you a short instruction now but a more detailed one and a few examples are following
- In Visual Studio:
- Create a new ClassLibrary
- Add Reference to the SMWrapperLib.dll
- Your Main Class Have to implement the IPlugin Interface
- In the load and unload methods you put your registration stuff
- Custom Commands:
- Create a new Class which implements the ICommand Interface
- The Wrapper gives you the informations about the sender and the args
- The Execute Method will be called if someone use your command
- Register The Command(Example is at the end of this spoiler
- StarMade Events:
- Create a Method with the Parameters "SMEventType" and "SMArgs"
- The SMEventType Contains a single String
- The SMArgs a Dictionary<string,string>
- The Keys and all Events are saved in the Enum ConsoleManager.EventTypes
- Register this Method like any other C# Evemt
C#:
using SMWrapperLib;
class MyPlugin : IPlugin
{
//i "forgot" the common informations like name id...
public bool isLoaded { get => false; private set => isLoaded = value; }
ICommand Command = new MyCommand(); //intantiate a Object from your command class which implements ICommand
public void Load()
{
SMWrapperLib.ConsoleManager.OnSMEventOccured += new ConsoleManager.SMEventHandler(Event)
ObjectHandler.GetCommandHandler.AddCommand(Command);
loaded=true
}
public void OnStarMadeEvent(SmEventType, SMArgs)
{
//Do something here
}
}
Compare to the Github Project to see all Classes Methods and their return values. Also they are also up to date there
- IPlugin
- ICommand
- IEvent
- CommandHandler(Access with ObjectHandler.GetCommandHandler)
- AddCommand(ICommand)
- RemoveCommand(ICommand)
- CustomEventHandler(Acces with bjectHandler.GetEventHandler)
- AddCustomEvent(IEvent)
- RemoveCustomEvent(IEvent)
- ConsoleManager(For StarMade Events)
- delegate void SMEventHandler(SMEventType,SMArgs)
- event OnCMEventOccured
- enum EventTypes
- class SMArgs : EventArgs(Contains Dictionary<string,string>)
- class SMEventType : EventArgs(Contains String)
- delegate void SMEventHandler(SMEventType,SMArgs)
- StarMadeCommands (the most are formatted to dictionaries or lists)
- Status
- SectorInfo(x,y,z)
- Whitelisted(type) //List of all whitelisted by type: name ip account
- Banned(type) //List of all banned by type: name ip account
- ServerAdmins
- FactionMembers(FactionID)
- FactionPointsGet(FactionID)
- Faction_List
- Player_Info(Player)
- Player_List
- Command(String[] Args) // put the command into the folling style: {"/give","Alendon","XXXX","2"}
- List<String> Command // same args returns the output of starnet
- FactionCommands:
- Actually Empty
- PlayerCommands:
- int? GetPlayerFactionID(player) //return Faction ID, null if player has no faction
- ServerCommands:
- StopServer(countdown)
- ServerBroadcast(message)
- PlayerMessage(player, message)
- Logger
- LogEntry(string logMessage, LogType logType, LogLevel logLevel, IPlugin plugin = null) //Log what you want, set your plugin otherwise it gets into an general unidentified log file
- enum LogLevel
- enum LogType
- PluginCommands // I Know bad name xD
- SaveString(string toSave, string FileName, IPlugin, string subfolder = null, WriteMode)
- string Load String(string FileName, IPlugin, string subfolder = null)
- SaveStringArray(string toSave, string FileName, IPlugin, string subfolder = null, WriteMode)
- string[] LoadStringArray(string FileName, IPlugin, string subfolder = null)
- PropManager
- string GetProp(string field, string defaultProp = null, IPlugin plugin = null) // if plugin = null, it will be written in the wrapper.properties file
- WriteProp(string field, string value, IPlugin plugin = null)
- Vote
- event OnVoteReceived
The Download Link: https://starmadedock.net/content/dpdds-starmade-wrapper-0-9.7681/
GitHub: Alendon1/DPDDs-StarMade-Wrapper
If you want to see the Wrapper in Action our Server runs on them, the links to the server threads:
LetsKautsch: https://starmadedock.net/threads/lets-kautsch-e-v-fair-play-server.30958/
Also you can just join our Discord Server if you directly interested: discord.gg/kFftHUK
Or add me Directly: Alendon#1984
Last edited: