コード例 #1
0
        public void Simulate(string host, string dataApi, string tag)
        {
            //_simulator = new Simulator("34.80.239.146","http://35.188.137.20","FrequentUser");
            Task.Delay(random.Next(1, 3)).Wait();
            _simulator = new Simulator(host, dataApi, tag);
            var text = _simulator.GetPlayerAsync().Result;
            var o    = JsonSerializer.Deserialize <ApiResult>(text);

            _simulator.ConnectAsync().Wait();
            _simulator.ReceiveAsync().Wait();

            _simulator.Do($"login {o.data.playerId}").Wait();
            _simulator.Do("look").Wait();

            while (NextAction(o.data))
            {
                var wait = random.Next(3, 10) * 1000;
                Debug($"Wait for {wait} ms");
                Task.Delay(wait).Wait();
            }
        }