Esempio n. 1
0
        public bool Load()
        {
            ClientList list = new ClientList();
            list.Path = System.IO.Path.Combine(Core.LaunchData.PhoenixDir, ClientList.Filename);
            list.Load();
            ClientInfo = list.FindClient(Core.LaunchData.ClientHash);

            if (Calculated)
            {
                Trace.WriteLine("Clients keys found.", "Phoenix");
                return true;
            }
            else
            {
                Trace.WriteLine("Clients keys not found.", "Phoenix");
                return false;
            }
        }
Esempio n. 2
0
        public void Save()
        {
            try
            {
                ClientList list = new ClientList();
                list.Path = System.IO.Path.Combine(Core.LaunchData.PhoenixDir, ClientList.Filename);
                list.Load();

                list.AddClient(ClientInfo);

                list.Save();

                Trace.WriteLine("Clients keys updated.", "Phoenix");
            }
            catch (Exception e)
            {
                Trace.WriteLine(String.Format("Error saving client keys. Exception: {0}", e.Message), "Phoenix");
            }
        }
Esempio n. 3
0
        private bool CheckClient(out string clientHash)
        {
            if (!File.Exists(server.ClientExe))
                throw new Exception("Client executable not found.");

            try {
                clientHash = MD5.ComputeHash(server.ClientExe);

                ClientList clientList = new ClientList();
                clientList.Path = Path.Combine(Constants.PhoenixDir, ClientList.Filename);
                clientList.Load();

                ClientInfo clientInfo = clientList.FindClient(clientHash);
                if (clientInfo.Hash != null && clientInfo.Key1 != null && clientInfo.Key2 != null)
                    return true;
                else
                    return false;
            }
            catch (Exception e) {
                throw new Exception(Resources.Launcher_ErrorCalculatingMD5, e);
            }
        }