Ignore:
Timestamp:
May 18, 2010, 1:34:33 PM (12 years ago)
Author:
Paul Lelgemann
Message:
  • Removed unused configuration options of PeerToPeerProxy
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/PeerToPeerBaseProxy/P2PPeer.cs

    r1436 r1438  
    1 /* Copyright 2009 Team CrypTool (Christian Arnold), Uni Duisburg-Essen
     1/*
     2   Copyright 2010 Paul Lelgemann, University of Duisburg-Essen
    23
    34   Licensed under the Apache License, Version 2.0 (the "License");
     
    3031namespace Cryptool.Plugins.PeerToPeerProxy
    3132{
    32     [Author("Christian Arnold", "arnold@cryptool.org", "Uni Duisburg-Essen", "http://www.uni-due.de")]
    33     [PluginInfo(false, "P2P_Peer_Proxy", "Creates a new Peer", "", "PeerToPeerBase/icons/peer_inaktiv.png", "PeerToPeerBase/icons/peer_connecting.png", "PeerToPeerBase/icons/peer_online.png", "PeerToPeerBase/icons/peer_error.png")]
     33    [Author("Paul Lelgemann", "lelgemann@cryptool.org", "Uni Duisburg-Essen", "http://www.uni-due.de")]
     34    [PluginInfo(false, "P2P_Peer_Proxy", "Creates a new Peer. Uses the CrypTool2 built-in P2P network and can be used as a replacement for P2P_Peer.", "", "PeerToPeerBaseProxy/icons/peer_inactive.png", "PeerToPeerBaseProxy/icons/peer_connecting.png", "PeerToPeerBaseProxy/icons/peer_online.png", "PeerToPeerBaseProxy/icons/peer_error.png")]
    3435    public class P2PPeer : IIOMisc
    3536    {
     
    183184        public void StartPeer()
    184185        {
    185             GuiLogMessage("Peer is already started by CrypTool!", NotificationLevel.Info);
     186            this.settings.PeerStatusChanged(P2PPeerSettings.PeerStatus.Connecting);
    186187            P2PManager.Instance.P2PBase.OnP2PMessageReceived += new P2PBase.P2PMessageReceived(p2pBase_OnP2PMessageReceived);
     188
     189            if (P2PManager.Instance.P2PConnected())
     190            {
     191                GuiLogMessage("P2P connected.", NotificationLevel.Info);
     192                this.settings.PeerStatusChanged(P2PPeerSettings.PeerStatus.Online);
     193            }
     194            else
     195            {
     196                GuiLogMessage("P2P network must be configured and connecting using the world button.", NotificationLevel.Warning);
     197                this.settings.PeerStatusChanged(P2PPeerSettings.PeerStatus.Error);
     198
     199                // TODO use appropriate exception / abort procedure
     200                throw new ApplicationException("P2P unavailable.");
     201            }
    187202        }
    188203
Note: See TracChangeset for help on using the changeset viewer.