Changeset 1527 for trunk/CrypP2P


Ignore:
Timestamp:
May 29, 2010, 3:08:17 PM (12 years ago)
Author:
Paul Lelgemann
Message:

o Updated Peer@Play-DLLs to support IrcBootstrapperV2
o CrypP2P: Switched to built-in settings
+ P2PEditor: Moved settings to settings pane and wired them to the new CrypP2P settings style
o P2PEditor: Play button connects P2P network

Location:
trunk/CrypP2P
Files:
3 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypP2P/CrypP2P.csproj

    r1505 r1527  
    191191    <Compile Include="Internal\NotConnectedException.cs" />
    192192    <Compile Include="P2PSettings.cs" />
     193    <Compile Include="P2PSettings.Designer.cs">
     194      <AutoGen>True</AutoGen>
     195      <DesignTimeSharedInput>True</DesignTimeSharedInput>
     196      <DependentUpon>P2PSettings.settings</DependentUpon>
     197    </Compile>
    193198    <Compile Include="Worker\ConnectionWorker.cs" />
    194199    <Compile Include="Worker\WorkerBase.cs" />
     
    199204  </ItemGroup>
    200205  <ItemGroup>
     206    <None Include="app.config" />
     207    <None Include="P2PSettings.settings">
     208      <Generator>PublicSettingsSingleFileGenerator</Generator>
     209      <LastGenOutput>P2PSettings.Designer.cs</LastGenOutput>
     210    </None>
    201211    <None Include="pap_certificates\CrypTool2.pfx" />
    202212    <None Include="pap_certificates\opa.vs.uni-due.de.cer" />
  • trunk/CrypP2P/Internal/P2PBase.cs

    r1477 r1527  
    2424using PeersAtPlay.P2POverlay.FullMeshOverlay;
    2525using PeersAtPlay.P2PLink;
    26 using PeersAtPlay.P2POverlay.Bootstrapper.IrcBootstrapper;
     26using PeersAtPlay.P2POverlay.Bootstrapper.IrcBootstrapperV2;
    2727using System.Threading;
    2828using PeersAtPlay;
     
    3030using Gears4Net;
    3131using Cryptool.Plugins.PeerToPeer.Internal;
    32 using PeersAtPlay.Util.Threading;
    3332
    3433/* TODO:
     
    151150        public void Initialize(P2PSettings p2PSettings)
    152151        {
    153             Initialize(p2PSettings.PeerName, p2PSettings.WorldName,
    154                 (P2PLinkManagerType)p2PSettings.LinkManagerType, (P2PBootstrapperType)p2PSettings.BsType,
    155                 (P2POverlayType)p2PSettings.OverlayType, (P2PDHTType)p2PSettings.DhtType);
     152            Initialize(p2PSettings.PeerName, p2PSettings.WorldName, p2PSettings.LinkManager, p2PSettings.Bootstrapper, p2PSettings.Overlay, p2PSettings.Dht);
    156153        }
    157154
  • trunk/CrypP2P/P2PManager.cs

    r1505 r1527  
    6060        public P2PBase P2PBase { get; set; }
    6161        public P2PSettings P2PSettings { get; set; }
     62        public bool IsP2PConnecting { get; internal set; }
    6263
    6364        #endregion
     
    7980        public string UserInfo()
    8081        {
     82            if (!P2PConnected())
     83            {
     84                return null;
     85            }
     86
    8187            string userName;
    82             PeerId userInfo = P2PBase.GetPeerID(out userName);
     88            var userInfo = P2PBase.GetPeerID(out userName);
    8389            return userInfo + " (" + userName + ")";
     90        }
     91
     92        public void HandleConnectOnStartup()
     93        {
     94            if (P2PSettings.ConnectOnStartup && IsReadyToConnect())
     95            {
     96                GuiLogMessage("Connect on startup enabled. Establishing connection...", NotificationLevel.Info);
     97                new ConnectionWorker(P2PBase, P2PSettings).Start();
     98            }
     99        }
     100
     101        private bool IsReadyToConnect()
     102        {
     103            if (String.IsNullOrEmpty(P2PSettings.PeerName))
     104            {
     105                GuiLogMessage("Peer-to-peer not fully configured: username missing.", NotificationLevel.Error);
     106                return false;
     107            }
     108
     109            if (String.IsNullOrEmpty(P2PSettings.WorldName))
     110            {
     111                GuiLogMessage("Peer-to-peer not fully configured: world name missing.", NotificationLevel.Error);
     112                return false;
     113            }
     114
     115            return true;
    84116        }
    85117
  • trunk/CrypP2P/Worker/ConnectionWorker.cs

    r1477 r1527  
    3939                    ? "Connection to P2P network established."
    4040                    : "Connection to P2P network terminated.", NotificationLevel.Info);
     41            P2PManager.Instance.IsP2PConnecting = false;
    4142        }
    4243
     
    6768        protected override void PrePerformWork()
    6869        {
     70            P2PManager.Instance.IsP2PConnecting = true;
    6971        }
    7072    }
Note: See TracChangeset for help on using the changeset viewer.