Ejemplo n.º 1
0
 private void AcceptClient(IAsyncResult ar)
 {
     var socket = Listener.EndAccept(ar);
     var client = new CoCProxyClient(socket);
     Console.WriteLine("Accepted new socket: {0}", socket.RemoteEndPoint);
     client.Client.NetworkManager.ExceptionLog = ExceptionLog;
     Clients.Add(client);
     Listener.BeginAccept(AcceptClient, Listener);
 }
Ejemplo n.º 2
0
        private void HandlePacket(CoCProxyClient client, IPacket packet)
        {
            var handler = (PacketHandler)null;

            if (!PacketHandlers.TryGetValue(packet.ID, out handler))
            {
                return;
            }
            handler(this, client, packet);
        }
Ejemplo n.º 3
0
        private void AcceptClient(IAsyncResult ar)
        {
            var socket = Listener.EndAccept(ar);
            var client = new CoCProxyClient(socket);

            Console.WriteLine("Accepted new socket: {0}", socket.RemoteEndPoint);
            client.Client.NetworkManager.ExceptionLog = ExceptionLog;
            Clients.Add(client);
            Listener.BeginAccept(AcceptClient, Listener);
        }
Ejemplo n.º 4
0
        private void AcceptClient(IAsyncResult ar)
        {
            var client = _listener.EndAccept(ar);
            Console.WriteLine("Accepted new client: {0}", client.RemoteEndPoint);

            var server = new Socket(SocketType.Stream, ProtocolType.Tcp);
            server.Connect("gamea.clashofclans.com", 9339);
            Console.WriteLine("Created new connection to gamea.clashofclans.com");

            var connection = new CoCProxyClient(client, server, Settings);
            Connections.Add(connection);

            _listener.BeginAccept(AcceptClient, _listener);
        }
Ejemplo n.º 5
0
 private void HandlePacket(CoCProxyClient client, IPacket packet)
 {
     var handler = (PacketHandler)null;
     if (!PacketHandlers.TryGetValue(packet.ID, out handler))
         return;
     handler(this, client, packet);
 }