From e77309d0ece2636931e1ed0f7f52a406fdc2b020 Mon Sep 17 00:00:00 2001 From: notabird Date: Sun, 7 Jun 2026 11:32:06 -0700 Subject: [PATCH] apply change from https://github.com/CannedNet/CannedNet/commit/873aa009ca9dd9b0d8221b2f957b1766737ce59b --- .../Services/Controllers/APIController.cs | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/CannedNet/Services/Controllers/APIController.cs b/CannedNet/Services/Controllers/APIController.cs index e81ef42..aa637c7 100644 --- a/CannedNet/Services/Controllers/APIController.cs +++ b/CannedNet/Services/Controllers/APIController.cs @@ -28,53 +28,6 @@ public class APIController : ControllerBase }); } - [HttpPost("gamesight/event")] - public async Task Event(HttpRequest request) { - string? eventType = null; - string? userId = null; - string? identifiers = null; - - if (request.HasFormContentType) - { - IFormCollection form = await request.ReadFormAsync(); - string eventData = form["EventData"].ToString(); - - if (!string.IsNullOrWhiteSpace(eventData)) - { - try - { - using JsonDocument doc = JsonDocument.Parse(eventData); - JsonElement root = doc.RootElement; - - if (root.TryGetProperty("type", out JsonElement typeProp)) - eventType = typeProp.GetString(); - - if (root.TryGetProperty("user_id", out JsonElement userIdProp)) - userId = userIdProp.GetString(); - - if (root.TryGetProperty("transaction_id", out JsonElement transactionProp)) - identifiers = transactionProp.GetString(); - } - catch (JsonException) - { - } - } - } - - string createdAt = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss", System.Globalization.CultureInfo.InvariantCulture); - - return Results.Json(new - { - @event = new - { - created_at = createdAt, - identifiers = identifiers ?? "", - type = string.IsNullOrWhiteSpace(eventType) ? "game_launch" : eventType, - user_id = string.IsNullOrWhiteSpace(userId) ? "0" : userId - } - }); - } - [HttpGet("config/v2")] public async Task ConfigV2() => Results.Content(await System.IO.File.ReadAllTextAsync("JSON/configv2.json"), "application/json");