Exemple #1
0
        private string Blast(EnemyCoordinates coordinates)
        {
            var httpConnectionFeature = HttpContext.Features.Get <IHttpConnectionFeature>();
            var localIpAddress        = httpConnectionFeature?.LocalIpAddress;

            bool   hit        = coordinates.X > 0.1 && coordinates.Y > 0.1;
            string hitMessage = hit?"HIT":"MISS";
            string message    = $"Bang[{coordinates.X}/{coordinates.Y}] = {hitMessage} | {localIpAddress} @ {DateTime.Now.ToString()}";

            Console.WriteLine(message);

            return(message);
        }
Exemple #2
0
 public string Post([FromBody] EnemyCoordinates coordinates)
 {
     return(Blast(coordinates));
 }