Server Auto-Discover Script

The auto-discovery script allows the server to evaluate whether a Client can be registered by the server.

Default Script:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DrawerBackup.Server.AutoDiscoverable;
using DrawerBackup.Server.Data.Entities;

namespace DrawerBackup.Server.Scripts
{
        public class AutoDiscover : IAutoDiscover
        {
                public bool Accept(AutoDiscoverRequest request)
                {
                        return true;
                }

                public Client Create(AutoDiscoverRequest request)
                {
                        return new Client( )
                        {
                                LastSeen = DateTime.Now,
                                Name = request.Name
                        };
                }
        }
}

Accept Method

Should return true/false indicating whether the Client will be registred by the server.

Create Method

Should return the Client Object based on the AutoDiscover Request

AutoDiscoverRequest

The request object has two properties:

Name: The name of the client Address: The remote address of the client