Skip to content

Plug in system

GlennMR edited this page Dec 16, 2011 · 4 revisions

Plug-in system

800craft comes with a simple yet effective plug-in system. It allows you to write .NET DLL's and use them to modify existing functions or add features to your server.

How do I make a plug-in

You create a plug-in by creating a class Init and inheriting the Plugin interface which you will find in the fCraft namespace. Below is a simple example.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using fCraft;

namespace HelloJonty
{
    public class Init : Plugin
    {
        public void Initialize()
        {
            Logger.Log(LogType.ConsoleOutput, "HEY JONTY");
        }

        public string Name
        {
            get
            {
                return "HelloJonty";
            }
            set
            {
                Name = value;
            }
        }

        public string Version
        {
            get
            {
                return "1.0";
            }
            set
            {
                Version = value;
            }
        }
    }
}

You'll then have to compile this class into a DLL, place the DLL in the plugins folder. If the plugins folder doesn't exist then you should manually create it. When you start 800craft, it will automatically load your plug-in.

Clone this wiki locally