예제 #1
0
 public CkernelGateway()
 {
     m_isLocal=true;
     edonkeyCore=new CKernel();
     krnGateway=CKernel.InterfaceGateway[0];
     Initialize();
 }
예제 #2
0
 public CkernelGateway(CInterfaceGateway in_krnGateway)
 {
     m_isLocal=false;
     krnGateway=in_krnGateway;
     Initialize();
 }
예제 #3
0
파일: HathiForm.cs 프로젝트: elnomade/hathi
 public HathiForm(string elink,Mutex in_Mutex,CInterfaceGateway remoteGateway)
 {
     m_Mutex=in_Mutex;
     m_link=elink;
     m_remoteGateway=remoteGateway;
     InitializeComponent();
     Initialize();
 }
예제 #4
0
파일: HathiForm.cs 프로젝트: elnomade/hathi
 public HathiForm(string elink, Mutex in_Mutex)
 {
     m_Mutex=in_Mutex;
     m_link=elink;
     m_remoteGateway=null;
     InitializeComponent();
     Initialize();
 }
예제 #5
0
파일: Remoting.cs 프로젝트: elnomade/hathi
 public bool Connect(string IP,int port3,string key,int port2)
 {
     m_ip = IPAddress.Parse(IP);
     if (port2!=0)
     this.m_Port=port2;
     this.m_url="tcp://" + IP + ":" + this.m_Port + "/RemoteInterface";
     this.m_Port2=port2;
     System.Security.Cryptography.MD5 cripto=System.Security.Cryptography.MD5.Create();
     bool valor=false;
     try
     {
     m_lPhantChannel = new TcpClientChannel(props, provider);
     ChannelServices.RegisterChannel(m_lPhantChannel, true);
     }
     catch
     {
     DisConnect();
     if (m_lPhantChannel!=null)
         ChannelServices.RegisterChannel(m_lPhantChannel, true);
     else
         m_lPhantChannel = new TcpClientChannel(props, provider);
     }
     remoteInterface = (CInterfaceGateway) Activator.GetObject(typeof(CInterfaceGateway),
                  this.m_url);
     if (remoteInterface == null)
     Debug.Write("Could not locate the server");
     else
     {
     //c = new byte[key.Length];
     //for (int i=0;i<key.Length;i++) c[i]=System.Convert.ToByte(key[i]);
     //cripto.ComputeHash(c);
     //try
     //{
     valor = remoteInterface.CheckPw( key );
     /*}
     catch
     {
         ChannelServices.UnregisterChannel(this.canalCeLephant);
         this.canalCeLephant = null;
         Debug.Write("\nNo se pudo encontrar el servidor\n");
     }*/
     }
     return valor;
 }
예제 #6
0
파일: Remoting.cs 프로젝트: elnomade/hathi
 public bool Connect(string IP,string key,int port2)
 {
     m_ip = IPAddress.Parse(IP);
     if (port2!=0)
     this.m_Port=port2;
     this.m_url="tcp://" + IP + ":" + this.m_Port + "/RemoteInterface";
     this.m_Port2=port2;
     System.Security.Cryptography.MD5 cripto=System.Security.Cryptography.MD5.Create();
     bool valor=false;
     try
     {
     m_lPhantChannel = new TcpClientChannel(props, provider);
     ChannelServices.RegisterChannel(m_lPhantChannel, true);
     }
     catch
     {
     DisConnect();
     if (m_lPhantChannel!=null)
         ChannelServices.RegisterChannel(m_lPhantChannel, true);
     else
         m_lPhantChannel = new TcpClientChannel(props, provider);
     }
     remoteInterface = (CInterfaceGateway) Activator.GetObject(typeof(CInterfaceGateway),
                  this.m_url);
     if (remoteInterface == null)
     Debug.Write("Could not locate the server");
     else
     {
     try
     {
         valor = remoteInterface.CheckPw( key );
     }
     catch
     {
         Debug.Write("\nCould not locate the server\n");
     }
     }
     return valor;
 }
예제 #7
0
파일: Kernel.cs 프로젝트: elnomade/hathi
 public CKernel()
 {
     #if VERBOSE
     LogClient=new CLogClient();
     #endif
     m_PortChanged=false;
     m_Version=(Protocol.ELEPHANT_VERSION_MAJOR-1).ToString()+"."+Protocol.ELEPHANT_VERSION.ToString("00");
     Preferences=new Config(DllDirectory, "config.xml", "0.02", "HathiKernel");
     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);
 }