Ejemplo n.º 1
0
        static void lowhighgame_history()
        {
            clearScreen();
            Console.WriteLine("LOW-HIGH GAME HISTORY");
            Console.WriteLine("*********************************************************");
            GrdResult <GrdSessionData[]> result = GrdManager.GetUserSessionData(username, "LOWHIGHGAME", "result", 0, 20);

            if (result.error == 0)
            {
                Console.WriteLine("+-TIME-------------------------+-----CARD-----+---SELECT--+----RESULT----+-----MONEY-----+");
                foreach (GrdSessionData dt in result.data)
                {
                    //Contains the rand key
                    if (dt.values.ContainsKey("result"))
                    {
                        String value = dt.values["result"];
                        //Read the array result
                        List <object> jValue;
                        try
                        {
                            jValue = (List <object>)Json.Deserialize(value);
                            bool   islow      = jValue[0].ToString() == "1";
                            string yourNumber = jValue[1].ToString();
                            string randNumber = jValue[2].ToString();
                            double money      = double.Parse(jValue[3].ToString());
                            //
                            Console.WriteLine("|" + formatField(dt.getTime().ToString(), 30) + "|" + formatField(yourNumber + "", 14) + "|" + formatField((islow ? "LOW" : "HIGH"), 11) + "|" + formatField(randNumber + "", 14) + "|" + formatField(money + "", 15) + "|");
                            Console.WriteLine("+------------------------------+--------------+-----------+--------------+---------------+");
                        }
                        catch (Exception e)
                        {
                            // TODO Auto-generated catch block
                        }
                    }
                }
                pauseScreen();
            }
            else
            {
                printError(result);
            }
        }
Ejemplo n.º 2
0
        /*END ACCOUNT TEST*/
        /*SCRIPT SERVER API*/

        static void random09_history()
        {
            clearScreen();
            Console.WriteLine("RANDOM 1-9 HISTORY");
            Console.WriteLine("*********************************************************");
            GrdResult <GrdSessionData[]> result = GrdManager.GetUserSessionData(username, "GAME-9", "rand", 0, 20);

            if (result.error == 0)
            {
                Console.WriteLine("+-TIME-------------------------+---SELECT--+----RESULT----+-----MONEY-----+");
                foreach (GrdSessionData dt in result.data)
                {
                    if (dt.values.ContainsKey("rand"))
                    {
                        String value      = dt.values["rand"];
                        String yourNumber = "";
                        String randNumber = "";
                        String money;
                        int    ipos = value.IndexOf(",");
                        if (ipos > 0)
                        {
                            yourNumber = value.Substring(0, ipos);
                            value      = value.Substring(ipos + 1);
                        }
                        ipos = value.IndexOf(",");
                        if (ipos > 0)
                        {
                            randNumber = value.Substring(0, ipos);
                            value      = value.Substring(ipos + 1);
                        }
                        money = value;
                        Console.WriteLine("|" + formatField(dt.getTime().ToString(), 30) + "|" + formatField(yourNumber, 11) + "|" + formatField(randNumber, 14) + "|" + formatField(money, 15) + "|");
                        Console.WriteLine("+------------------------------+-----------+--------------+---------------+");
                    }
                }
                pauseScreen();
            }
            else
            {
                printError(result);
            }
        }