Exemplo n.º 1
0
        public MITM(MITMConfiguration configuration)
        {
            m_configuration = configuration;
            AuthConnections = new ClientManager <ConnectionMITM>(
                DnsExtensions.GetIPEndPointFromHostName(m_configuration.FakeAuthHost, m_configuration.FakeAuthPort, AddressFamily.InterNetwork), CreateAuthClient);
            WorldConnections = new ClientManager <ConnectionMITM>(
                DnsExtensions.GetIPEndPointFromHostName(m_configuration.FakeWorldHost, m_configuration.FakeWorldPort, AddressFamily.InterNetwork), CreateWorldClient);

            AuthConnections.ClientConnected     += OnAuthClientConnected;
            AuthConnections.ClientDisconnected  += OnAuthClientDisconnected;
            WorldConnections.ClientConnected    += OnWorldClientConnected;
            WorldConnections.ClientDisconnected += OnWorldClientDisconnected;

            MessageBuilder = new MessageReceiver();
            MessageBuilder.Initialize();

            NetworkMessageDispatcher.RegisterSharedContainer(this);
        }
Exemplo n.º 2
0
 protected virtual Task <IPAddress[]> GetHostAddresses(CancellationToken cancellationToken)
 {
     return(DnsExtensions.GetHostAddressesWithCancellationTokenAsync(this.Config.TargetHostname, cancellationToken));
 }