Exemplo n.º 1
0
        public void GetServerMatch(HttpListenerContext context)
        {
            string   endpoint  = ReqExtracters.ExtractEndpoint(context.Request);
            DateTime timestamp = ReqExtracters.ExtractTimestamp(context.Request);

            MatchInfo matchInfo = _db.GetServerMatch(endpoint, timestamp);

            if (matchInfo == null)
            {
                this.SendResponse(context.Response, "", HttpStatusCode.NotFound);
                return;
            }

            string matchInfoJson = JsonConvert.SerializeObject(matchInfo);

            this.SendResponse(context.Response, matchInfoJson, HttpStatusCode.OK);
        }