Ignore:
Timestamp:
May 20, 2010, 12:35:16 PM (12 years ago)
Author:
Sven Rech
Message:

replaced all BigInteger stuff with the new BigInteger class from .net 4.0

But there are still problems with some plugins (Keysearcher, BigInteger Operations...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/PeerToPeerManager_NEW/P2PManagerBase_NEW.cs

    r1433 r1448  
    2323using Cryptool.PluginBase.Miscellaneous;
    2424using Cryptool.Plugins.PeerToPeer.Internal;
     25using System.Numerics;
    2526
    2627/* TODO:
     
    282283        private void HandleJobAcceptanceMessage(PeerId sender, byte[] data)
    283284        {
    284             BigInteger jobId = null;
     285            BigInteger jobId = 0;
    285286            if (JobMessages.GetJobAcceptanceMessage(data, out jobId))
    286287            {
     
    455456        {
    456457            int i = 0;
    457             BigInteger temp_jobId = null;
     458            BigInteger temp_jobId = 0;
    458459            List<PeerId> freePeers = ((WorkersManagement)this.peerManagement).GetFreeWorkers();
    459460
     
    506507        {
    507508            double jobProgressInPercent;
    508             double lFinishedAmount = (double)this.distributableJobControl.FinishedAmount.LongValue();
    509             double lAllocatedAmount = (double)this.distributableJobControl.AllocatedAmount.LongValue();
    510             double lTotalAmount = (double)this.distributableJobControl.TotalAmount.LongValue();
     509            double lFinishedAmount = (double)(long)this.distributableJobControl.FinishedAmount;
     510            double lAllocatedAmount = (double)(long)this.distributableJobControl.AllocatedAmount;
     511            double lTotalAmount = (double)(long)this.distributableJobControl.TotalAmount;
    511512
    512513            if (lFinishedAmount > 0 && lAllocatedAmount > 0)
     
    541542        {
    542543            DateTime retTime = DateTime.MaxValue;
    543             if (this.distributableJobControl.FinishedAmount.LongValue() > 0)
     544            if ((long)this.distributableJobControl.FinishedAmount > 0)
    544545            {
    545546                TimeSpan bruteforcingTime = DateTime.Now.Subtract(this.StartWorkingTime);
    546                 double jobsPerSecond = bruteforcingTime.TotalSeconds / this.distributableJobControl.FinishedAmount.LongValue();
     547                double jobsPerSecond = bruteforcingTime.TotalSeconds / (long)this.distributableJobControl.FinishedAmount;
    547548                double restSeconds = jobsPerSecond *
    548                     (this.distributableJobControl.TotalAmount - this.distributableJobControl.FinishedAmount).LongValue();
     549                    (long)(this.distributableJobControl.TotalAmount - this.distributableJobControl.FinishedAmount);
    549550                //retTime.TotalSeconds = jobsPerSecond * (2 - (progressInPercent / 100));
    550551                retTime = DateTime.Now.AddSeconds(restSeconds);
Note: See TracChangeset for help on using the changeset viewer.