/save location leerzeichen
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user