using InABox.API;
using InABox.Clients;
using InABox.Core;
using InABox.Database;

namespace InABox.Rpc
{
    
    public class RpcInfoHandler : RpcCommandHandler<IRpcServer, RpcInfoCommand, RpcInfoParameters, RpcInfoResult> 
    {
        protected override RpcInfoResult Execute(IRpcSession session, RpcInfoParameters? parameters, Logger logger)
        {
            var response = new RpcInfoResult()
            {
                Info = new DatabaseInfo(DbFactory.ColorScheme, DbFactory.Logo, CoreUtils.GetVersion(), Sender.IsSecure(), DbFactory.RestPort, DbFactory.RPCPort, DbFactory.ID)
            };
            
            return response;
        }

        public RpcInfoHandler(IRpcServer sender) : base(sender)
        {
        }
    }
}