using System;
using System.Net;
using System.Diagnostics;
using System.Threading;
using System.Net.Sockets;
using System.Threading.Tasks;

using FilterAPI.Networking;

namespace FilterZone.ZoneNetworking
{
    internal class ZoneListener : Listener
    {
		static String ZoneIPString = String.Format("Zone{0}BindIP", Program.ZoneID);

		static IPAddress ZoneIP = IPAddress.Parse(Program.Auth.ConfigValues[ZoneIPString]);

		static String ZonePortString = Program.Auth.ConfigValues[String.Format("Zone{0}BindPort", Program.ZoneID)];

		static int ZonePort = Convert.ToInt32(ZonePortString);
		public ZoneListener()
            : base(ZoneIP, 50000, ZonePort) { Accept(); }

        public override void NewSocket(Socket AcceptedSocket, IPEndPoint AcceptedEndPoint) { ZoneClient NewZone = new ZoneClient(AcceptedSocket, AcceptedEndPoint); }
    }
}
