wirelesskillo.blogg.se

The forest mod api wiki
The forest mod api wiki









the forest mod api wiki
  1. #The forest mod api wiki how to#
  2. #The forest mod api wiki .dll#

#The forest mod api wiki .dll#

dll which is then added to the Mods folder on the dedicated server alongside a ModInfo.xml just like other mods. ModAPI mods are written in c and compiled as a. dll as well as and UnityEngine.dll inside the mod folder. ModAPI Allows a modder to add additional functionality to the dedicated server. Add a ModInfo.xml ( see Mod Structure for more information ) and drop your project. Once you have completed the code, build the project and then create a new folder for your mod inside the dedicated server mods folder.

#The forest mod api wiki how to#

This is an extensive open source ModAPI mod which has some fantastic examples on how to do many things. This method has not be included here because it's part of the ServerTools mod by dmustanger. Note that we call a method called SendChatMessage which handles sending message from the server to clients. when they check to see if the message is hello and if so we have the server respond saying hello back. Inside this method we check to make sure the message is not blank and that we it starts with Returning true allows other listeners to process this message.Īs you can see from the above code, we register a handler for the ModEvent called ChatMessage which is then handled by our own method called ChatMessage. We return false to prevent any other listeners from processing this message.

the forest mod api wiki

SendChatMessage(clientInfo, $"Hello ", -1, LoadConfig.Server_Response_Name, EChatType.Global, null) we then remove that / to get the rest of the message. We check to see if the message starts with a / If(!string.IsNullOrEmpty(message) & clientInfo != null & mainName != ServerChatName) We make sure there is an actual message and a client, and also ignore the message if it's from the server. Private bool ChatMessage(ClientInfo _cInfo, EChatType _type, int _senderId, string _msg, string _mainName, bool _localizeMain, List _recipientEntityIds) This method will then be called every time a ChatMessage is sent. This registers a handler for when the server handles a chat message. Private string ServerChatName = "Server" Your API class needs to implement the IModApi interface and in the InitMod method we will register handlers for ModEvents. Once you have added the references rename Class1.cs to API.cs this will be the start point for the mod. Then add the following references from your dedicated server '7DaysToDieServer_Data/Managed' Folder Using Visual StudioĬreate a new Class Library project targetting. This is a quick start tutorial for getting started with modAPI. WARNING: Mod API only works on dedicated server and will not run on the client either in single player or client hosted multiplayer Tutorial It supports:, ENGLISH, DEUTSCHE languages. I work alone, so updates may take a long time, and there may also be bugs that you can tell me about. dll which is then added to the Mods folder on the dedicated server alongside a ModInfo.xml just like other mods. This mod will add to your world many different mobs, bosses, items, structures, weapons, potions and much more. ModAPI mods are written in c# and compiled as a.

the forest mod api wiki

ModAPI Allows a modder to add additional functionality to the dedicated server.











The forest mod api wiki