Exemplo n.º 1
0
        public CServerServerList(MemoryStream buffer, CServersList ServerList)
        {
            BinaryReader reader   = new BinaryReader(buffer);
            byte         nServers = reader.ReadByte();
            uint         IP;
            ushort       port;

            NewServers = 0;
            try
            {
                for (int i = 0; i != nServers; i++)
                {
                    IP   = reader.ReadUInt32();
                    port = reader.ReadUInt16();
                    if (ServerList.Add(IP, port) != null)
                    {
                        NewServers++;
                    }
                }
            }
            catch {}
            reader.Close();
            buffer.Close();
            reader = null;
            buffer = null;
        }
Exemplo n.º 2
0
        public CKernel()
        {
#if VERBOSE
            LogClient = new CLogClient();
#endif
            m_PortChanged = false;
            m_Version     = (Protocol.eAnt_VERSION_MAJOR).ToString() + "." + Protocol.eAnt_VERSION.ToString("00");

            Preferences = new Config(DllDirectory, "config.xml", "0.02", "AntKernel");

            Preferences.PropertyChanged  += new Config.PropertyEventHandler(OnPropertyChanged);
            Preferences.PropertyDefaults += new Config.PropertyDefaultHandler(OnGetDefaultProperty);
            Preferences.PropertyLoaded   += new Config.PropertyLoadedHandler(OnPropertyLoaded);
            Preferences.LoadProperties();

            Globalization = new Classes.Globalization(LangDirectory, "kernel_", "xml", Preferences.GetString("Language"));



            SourcesOld      = new CSourcesOld();
            Listener        = new CListener();
            ConnectionsList = new CConnectionsList();
            ServersList     = new CServersList();

            FilesList               = new CFilesList();
            ClientsList             = new CClientsList();
            InterfaceGateway[0]     = new CInterfaceGateway();
            InterfaceGateway[0].apw = true;
            //InterfaceGateway[0].CheckPw(Preferences.GetString("RemotePassword"));
            //FilesList.LoadSharedFiles(); // > StartKernel()
            FriendsList = new CFriendsList();

            GlobalStatistics = new CStatistics();
            if (Preferences.GetBool("RemoteControlEnabled"))
            {
                Sremoto = new CRemoting();
            }
            Searchs     = new SortedList();
            Queue       = new CQueue();
            UDPListener = new CUDPListener();           // UDPListener.Start(); > StartKernel()

            CategoriesList = new CCategoriesList();

            httpDownload             = new ChttpDownload();
            httpDownload.Downloaded += new DownloadedEventHandler(OnFileDownloaded);
        }