Server API

Feb 7, 2017
Server API
  • Code (C#):
    OnDisconnect(string hwid, string uid, string name):void
    OnLmageUploaded(string hwid, string uid, string name, byte[] jpg):void
    OnLoad(string hwid, string uid, string name):void
    OnLogin(string hwid, string uid, string name):void
    OnRustBusterUserMessage(API.RustBusterUserAPI user, Message msgc):string

    RustBusterUsersList:List<RustBusterUserAPI>
    RustBusterVersion:string
    RustBusterUsers:Dictionary<ulong, RustBusterUserAPI>
    Example of usage:
    C#
    Code (C#):
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using RustBuster2016Server;

    namespace TestPlugin
    {
        public class TestPlugin : Fougerite.Module
        {
            public override void Initialize()
            {
                Hooks.OnCommand += new Hooks.CommandHandlerDelegate(On_Command);
            }

            private void On_Command(Fougerite.Player Player, string cmd, string[] args)
            {
                cmd = cmd.ToLower();
                if (cmd.Equals("find"))
                {
                    string name = string.Join(" ", args).Trim(' ', '"');
                    foreach (var obj in API.RustBusterUsersList)
                    {
                        if (obj.Name == name)
                        {
                            Player.MessageFrom("TestPlugin", name + "'s HWID is: " + obj.HardwareID);
                        }
                    }
                }
            }
        }
    }
salva likes this.