Esempio n. 1
0
        static void Init(string programPath)
        {
            client = new TenhouClient("aixile");
            
            gameEnd.Reset();

            client.OnLogin += () =>
            {
                //client.EnterLobby(0);
                client.Join(GameType.North);
                client.Join(GameType.North_fast);
                client.Join(GameType.East);
                client.Join(GameType.East_fast);
            };
            client.OnGameEnd += () => { gameEnd.Set(); };
            client.OnClose += () => { gameEnd.Set(); };

            monitor = new Monitor(client);
            monitor.Start();

            controller = new Controller(client, programPath);
            controller.Start();

            client.Login();
        }
Esempio n. 2
0
        static void Init(string programPath)
        {
            client = new TenhouClient("aixile");

            gameEnd.Reset();

            client.OnLogin += () =>
            {
                //client.EnterLobby(0);
                client.Join(GameType.North);
                client.Join(GameType.North_fast);
                client.Join(GameType.East);
                client.Join(GameType.East_fast);
            };
            client.OnGameEnd += () => { gameEnd.Set(); };
            client.OnClose   += () => { gameEnd.Set(); };

            monitor = new Monitor(client);
            monitor.Start();

            controller = new Controller(client, programPath);
            controller.Start();

            client.Login();
        }
Esempio n. 3
0
        static void Start(Config config)
        {
            client = new TenhouClient(config.Id);

            gameEnd.Reset();

            client.OnLogin += () =>
            {
                client.EnterLobby(config.Lobby);
                client.Join(config.GameType);
            };
            client.OnGameEnd += () =>
            {
                config.Repeat--;
                gameEnd.Set();
            };
            client.OnConnectionException += () =>
            {
                if (config.Id.Length <= 8) // 如果没有天凤账号,无法断线重连
                {
                    config.Repeat--;
                }
                gameEnd.Set();
            };

            monitor = new Monitor(client);
            monitor.Start();

            controller = new AIController(client);
            controller.Start();

            client.Login();
        }