Game() public method

public Game ( string game ) : bool
game string
return bool
Exemplo n.º 1
0
Arquivo: Fuse.cs Projeto: tinspin/fuse
    // ------------- EXAMPLE USAGE -------------
    public static void Main()
    {
        try {
            Log("Ping: " + Ping("fuse.rupy.se"));

            string key = "TvaaS3cqJhQyK6sn";
            string salt = null;

            Fuse fuse = new Fuse();
            fuse.Start();
            fuse.Host("fuse.rupy.se");

            //Thread.Sleep(100);

            Log("Time: " + fuse.Time());
            Log("Date: " + fuse.Date());

            // if no key is stored try
        /*
            try {
                key = fuse.User("fuse");
                Log("User: "******"F9hG7K7Jwe1SmtiQ";
            //key = "yt4QACtL2uzbyUTT";

            //if(key != null) {
                try {
                    salt = fuse.SignNameKey("fuse", key);
                }
                catch(Exception e) {
                    Log(e.Message);
                    return;
                }
            //}

            Log("Sign: " + salt);

            if(salt != null) {
                fuse.Pull(salt);

                // Very important to sleep a bit here
                // Use coroutines to send fuse.Game("race");
                // in Unity. Or send it on the first "noop" in Update()!
                Thread.Sleep(100);

                fuse.Game("race");

                Thread.Sleep(100);

                Thread thread = new Thread(FakeLoop);
                thread.Start();

                Thread.Sleep(500);

                fuse.Chat("root", "hello");

                Thread.Sleep(500);

                Log("Room: " + fuse.Room("race", 4));

                Thread.Sleep(500);

                string[] list = fuse.ListRoom();

                if(list != null) {
                    Log("List: " + list.Length);

                    for(int i = 0; i < list.Length; i++) {
                        string[] room = list[i].Split(',');
                        Log("      " + room[0] + " " + room[1] + " " + room[2]);
                    }
                }

                Thread.Sleep(500);

                fuse.Chat("root", "hello");

                Thread.Sleep(500);

                fuse.Send("white+0+0");
            }
        }
        catch(Exception e) {
            Log(e.ToString());
        }
    }
Exemplo n.º 2
0
    // ------------- EXAMPLE USAGE -------------

    public static void Main()
    {
        try {
            Log("Ping: " + Ping(host));

            string key  = "TvaaS3cqJhQyK6sn";
            string salt = null;

            Fuse fuse = new Fuse();
            fuse.Start();
            fuse.Host(host);

            //Thread.Sleep(100);

            Log("Time: " + fuse.Time());

            // if no key is stored try

/*
 *                      try {
 *                              key = fuse.User("fuse");
 *                              Log("User: "******"F9hG7K7Jwe1SmtiQ";
            //key = "yt4QACtL2uzbyUTT";

            //if(key != null) {
            try {
                salt = fuse.SignNameKey("fuse", key);
            }
            catch (Exception e) {
                Log(e.Message);
                return;
            }
            //}

            Log("Sign: " + salt);

            if (salt != null)
            {
                fuse.Pull(salt);

                // Very important to sleep a bit here
                // Use coroutines to send fuse.Game("race");
                // in Unity. Or send it on the first "noop" in Update()!
                Thread.Sleep(100);

                fuse.Game("race");

                Thread.Sleep(100);

                Thread thread = new Thread(FakeLoop);
                thread.Start();

                Thread.Sleep(500);

                fuse.Chat("root", "hello");

                Thread.Sleep(500);

                Log("Room: " + fuse.Room("race", 4));

                Thread.Sleep(500);

                string[] list = fuse.ListRoom();

                if (list != null)
                {
                    Log("List: " + list.Length);

                    for (int i = 0; i < list.Length; i++)
                    {
                        string[] room = list[i].Split(',');
                        Log("      " + room[0] + " " + room[1] + " " + room[2]);
                    }
                }

                Thread.Sleep(500);

                fuse.Chat("root", "hello");

                Thread.Sleep(500);

                fuse.Send("white+0+0");
            }
        }
        catch (Exception e) {
            Log(e.ToString());
        }
    }