diff --git a/ReallifeGamemode.DataService/Controllers/LocationController.cs b/ReallifeGamemode.DataService/Controllers/LocationController.cs index 88984ac8..f911d98a 100644 --- a/ReallifeGamemode.DataService/Controllers/LocationController.cs +++ b/ReallifeGamemode.DataService/Controllers/LocationController.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Text.RegularExpressions; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -31,7 +32,10 @@ namespace ReallifeGamemode.DataService.Controllers foreach(var location in list) { - locations.Add($"{Uri.EscapeDataString(location.Description).PadRight(20)} - {Math.Round(location.X, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Y, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Z, 2).ToString(CultureInfo.InvariantCulture)} - Richtung: {Math.Round(location.Heading, 2)}"); + string description = location.Description; + description = Regex.Replace(description, @"<[^>]*(>|$)", string.Empty); + description = Regex.Replace(description, @"[\s\r\n]+", " ").Trim(); + locations.Add($"{description.PadRight(20)} - {Math.Round(location.X, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Y, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Z, 2).ToString(CultureInfo.InvariantCulture)} - Richtung: {Math.Round(location.Heading, 2)}"); } return locations; diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 73862458..240fba02 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1738,7 +1738,7 @@ namespace ReallifeGamemode.Server.Commands } } - [Command("save", "~m~Benutzung: ~s~/save [Typ = ~g~Blip~s~, ~g~Goto (X)~s~, ~r~Marker~s~, ~r~Ped~s~, ~r~Pickup~s~, ~r~TextLabel~s~, ~g~Vehicle~s~, ~g~FVehicle~s~, ~g~SVehicle (X)~s~, ~g~JVehicle (X)~s~, ~g~Location~s~] (Weitere Angaben) = (X)")] + [Command("save", "~m~Benutzung: ~s~/save [Typ = ~g~Blip~s~, ~g~Goto (X)~s~, ~r~Marker~s~, ~r~Ped~s~, ~r~Pickup~s~, ~r~TextLabel~s~, ~g~Vehicle~s~, ~g~FVehicle~s~, ~g~SVehicle (X)~s~, ~g~JVehicle (X)~s~, ~g~Location~s~] (Weitere Angaben) = (X)", GreedyArg = true)] public void CmdAdminSave(Client player, string typ, string option1 = null, string option2 = null) { if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true) @@ -1902,7 +1902,7 @@ namespace ReallifeGamemode.Server.Commands { dbContext.Locations.Add(new Location { - Description = option1, + Description = option1 + (option2 != null ? " " + option2 : ""), X = player.Position.X, Y = player.Position.Y, Z = player.Position.Z,