コード例 #1
0
        public IEnumerator PingTest()
        {
            SetupGood();
            masterNodeApiGood.PingServer((bool success, string json) => {
                // Test that ping can reach testnet
                calledBack = true;
                Assert.True(success);
            });
            while (!calledBack)
            {
                yield return(null);
            }

            SetupBad();
            LogAssert.Expect(LogType.Warning, new Regex($".*{badHost}.*"));
            masterNodeApiBad.PingServer((bool success, string json) =>
            {
                // Test that ping failed
                calledBack = true;
                Assert.True(!success);
            });
            while (!calledBack)
            {
                yield return(null);
            }
        }
コード例 #2
0
 public void Ping()
 {
     masterNodeApi.PingServer((bool success, string json) =>
     {
         if (success)
         {
             imagePing.color = Color.green;
         }
         else
         {
             imagePing.color = Color.red;
             Debug.LogWarning($"Ping failed with response: {json}");
         }
     });
 }