Example #1
0
        public static void Main(string[] args)
        {
            string status  = args.Length >= 1 ? args[0] : null;
            string namearg = args.Length >= 2 ? args[1] : null;

            if (status == null)
            {
                Console.WriteLine("Choose between [S]Serveur, [M]Miner, [U]User");
                Console.Write("\n status : ");
                status = Epicoin.ReadLine();
            }

            if (status == "S" || status == "Serveur")
            {
                Epicoin.Serveur(namearg);
            }
            if (status == "M" || status == "Miner")
            {
                Epicoin.Miner(namearg);
            }
            if (status == "U" || status == "User")
            {
                Epicoin.User(namearg);
            }

            /*
             * if (status == "SW")
             * {
             *  Epicoin.ServeurWithoutMenu(namearg);
             * }*/

            Environment.Exit(Environment.ExitCode);
        }
Example #2
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     base.OnFormClosing(e);
     Epicoin.ExportWallet();
     Epicoin.Continue = false;
     Environment.Exit(0);
 }
Example #3
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     base.OnFormClosing(e);
     Epicoin.Continue    = false;
     DataClient.Continue = false;
     DataServer.Continue = false;
     StopServ();
     Epicoin.ExportChain();
     Epicoin.ExportWallet();
     Environment.Exit(0);
 }
Example #4
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     base.OnFormClosing(e);
     Epicoin.Continue = false;
     if (this.worker != null)
     {
         this.worker.Abort();
     }
     this.worker = null;
     this.work   = false;
     Epicoin.ExportWallet();
     Environment.Exit(0);
 }
Example #5
0
 protected void StopServ()
 {
     Epicoin.Continue    = false;
     DataClient.Continue = false;
     DataServer.Continue = false;
     Epicoin.ExportChain();
     Epicoin.ExportWallet();
     this.block     = null;
     this.server    = null;
     this.saveChain = null;
     Epicoin.server = null;
     Epicoin.client = null;
 }
Example #6
0
 public User()
 {
     Epicoin.ImportWallet();
     if (Epicoin.Wallet == null)
     {
         string name = "";
         while (name == "")
         {
             name = Microsoft.VisualBasic.Interaction.InputBox("Your pseudo :  ", "Your pseudo", "Bob");
         }
         Epicoin.CreateWallet(name);
         Epicoin.ExportWallet();
     }
     Epicoin.client = new Client(Epicoin.host, Epicoin.port);
     InitializeComponent();
 }
Example #7
0
        public Serveur()
        {
            Epicoin.Continue = false;
            Epicoin.ImportWallet();
            if (Epicoin.Wallet == null)
            {
                string name = "";
                while (name == "")
                {
                    name = Microsoft.VisualBasic.Interaction.InputBox("Your pseudo :  ", "Your pseudo", "Bob");
                }
                Epicoin.CreateWallet(name);
                Epicoin.ExportWallet();
            }
            Epicoin.ImportChain();
            if (Epicoin.Coin == null)
            {
                Epicoin.Init();
            }
            Epicoin.server = new Server(Epicoin.port, Epicoin.Coin);

            InitializeComponent();
        }