Exemplo n.º 1
0
        }//constructor

        public string fixOneGuidCorner(int raida_ID, CloudCoin cc, int corner, int[] trustedTriad)
        {
            /*1. WILL THE BROKEN RAIDA FIX? check to see if it has problems echo, detect, or fix. */
            if (RAIDA_Status.failsFix[raida_ID] || RAIDA_Status.failsEcho[raida_ID] || RAIDA_Status.failsEcho[raida_ID])
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.Out.WriteLine("");
                Console.Out.WriteLine(StringHolder.frackfixer_1);  // "RAIDA Fails Echo or Fix. Try again when RAIDA online.");
                Console.Out.WriteLine("");
                Console.ForegroundColor = ConsoleColor.White;
                return("RAIDA Fails Echo or Fix. Try again when RAIDA online.");
            }
            else
            {
                /*2. ARE ALL TRUSTED RAIDA IN THE CORNER READY TO HELP?*/
                //  Console.Out.WriteLine("Fails echo 0 " + RAIDA_Status.failsEcho[trustedTriad[0]]);
                //  Console.Out.WriteLine("Fails echo 1 " + RAIDA_Status.failsEcho[trustedTriad[1]]);
                //  Console.Out.WriteLine("Fails echo 2 " + RAIDA_Status.failsEcho[trustedTriad[2]]);
                //  Console.Out.WriteLine("Fails failsDetect 0 " + RAIDA_Status.failsDetect[trustedTriad[0]]);
                // Console.Out.WriteLine("Fails failsDetect 1 " + RAIDA_Status.failsDetect[trustedTriad[1]]);
                // Console.Out.WriteLine("Fails failsDetect 2 " + RAIDA_Status.failsDetect[trustedTriad[2]]);

                if (!RAIDA_Status.failsEcho[trustedTriad[0]] || !RAIDA_Status.failsDetect[trustedTriad[0]] || !RAIDA_Status.failsEcho[trustedTriad[1]] || !RAIDA_Status.failsDetect[trustedTriad[1]] || !RAIDA_Status.failsEcho[trustedTriad[2]] || !RAIDA_Status.failsDetect[trustedTriad[2]])
                {
                    /*3. GET TICKETS AND UPDATE RAIDA STATUS TICKETS*/
                    string[] ans = { cc.ans[trustedTriad[0]], cc.ans[trustedTriad[1]], cc.ans[trustedTriad[2]] };
                    raida.get_Tickets(trustedTriad, ans, cc.nn, cc.sn, cc.getDenomination(), 3000);
                    /*4. ARE ALL TICKETS GOOD?*/
                    if (RAIDA_Status.hasTicket[trustedTriad[0]] && RAIDA_Status.hasTicket[trustedTriad[0]] && RAIDA_Status.hasTicket[trustedTriad[0]])
                    {
                        /*5.T YES, so REQUEST FIX*/
                        DetectionAgent da          = new DetectionAgent(raida_ID, 5000);
                        Response       fixResponse = da.fix(trustedTriad, RAIDA_Status.tickets[trustedTriad[0]], RAIDA_Status.tickets[trustedTriad[1]], RAIDA_Status.tickets[trustedTriad[2]], cc.ans[raida_ID]);
                        /*6. DID THE FIX WORK?*/
                        if (fixResponse.success)
                        {
                            Console.ForegroundColor = ConsoleColor.Green;
                            Console.Out.WriteLine("");
                            Console.Out.WriteLine("RAIDA" + raida_ID + StringHolder.frackfixer_2);  //" unfracked successfully.");
                            Console.Out.WriteLine("");
                            Console.ForegroundColor = ConsoleColor.White;
                            return("RAIDA" + raida_ID + " unfracked successfully.");
                        }
                        else
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.Out.WriteLine("");
                            Console.Out.WriteLine(StringHolder.frackfixer_3 + corner);//"RAIDA failed to accept tickets on corner " + corner);
                            Console.Out.WriteLine("");
                            Console.ForegroundColor = ConsoleColor.White;
                            return("RAIDA failed to accept tickets on corner " + corner);
                        }//end if fix respons was success or fail
                    }
                    else
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.Out.WriteLine("");
                        Console.Out.WriteLine(StringHolder.frackfixer_4 + corner);//"Trusted servers failed to provide tickets for corner " + corner);
                        Console.Out.WriteLine("");
                        Console.ForegroundColor = ConsoleColor.White;

                        return("Trusted servers failed to provide tickets for corner " + corner);//no three good tickets
                    }//end if all good
                }//end if trused triad will echo and detect (Detect is used to get ticket)

                Console.ForegroundColor = ConsoleColor.Red;
                Console.Out.WriteLine("");
                Console.Out.WriteLine(StringHolder.frackfixer_5); //"One or more of the trusted triad will not echo and detect.So not trying.");
                Console.Out.WriteLine("");
                Console.ForegroundColor = ConsoleColor.White;
                return("One or more of the trusted triad will not echo and detect. So not trying.");
            }//end if RAIDA fails to fix.
        }    //end fix one
Exemplo n.º 2
0
        }     //End Constructor

        public void echoOne(int raida_id)
        {
            DetectionAgent da = new DetectionAgent(raida_id, 2000);

            responseArray[raida_id] = da.echo(raida_id);
        }//end echo
Exemplo n.º 3
0
        }//end echo

        public void detectOne(int raida_id, int nn, int sn, String an, String pan, int d)
        {
            DetectionAgent da = new DetectionAgent(raida_id, 5000);

            responseArray[raida_id] = da.detect(nn, sn, an, pan, d);
        }//end detectOne
Exemplo n.º 4
0
        }//end detect coin

        public void get_Ticket(int i, int raidaID, int nn, int sn, String an, int d)
        {
            DetectionAgent da = new DetectionAgent(raidaID, 5000);

            responseArray[raidaID] = da.get_ticket(nn, sn, an, d);
        }//end get ticket