Add map name to lsmap (#4576)

This commit is contained in:
metalgearsloth
2023-11-20 01:47:19 +11:00
committed by GitHub
parent 8325966dbb
commit 2fe4a8b859

View File

@@ -131,6 +131,7 @@ internal sealed class RunMapInitCommand : LocalizedCommands
internal sealed class ListMapsCommand : LocalizedCommands
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IMapManager _map = default!;
public override string Command => "lsmap";
@@ -144,10 +145,13 @@ internal sealed class ListMapsCommand : LocalizedCommands
foreach (var mapId in _map.GetAllMapIds().OrderBy(id => id.Value))
{
msg.AppendFormat("{0}: init: {1}, paused: {2}, ent: {3}, grids: {4}\n",
mapId, _map.IsMapInitialized(mapId),
var mapUid = _map.GetMapEntityId(mapId);
msg.AppendFormat("{0}: {1}, init: {2}, paused: {3}, nent: {4}, grids: {5}\n",
mapId, _entManager.GetComponent<MetaDataComponent>(mapUid).EntityName,
_map.IsMapInitialized(mapId),
_map.IsMapPaused(mapId),
_map.GetMapEntityId(mapId),
_entManager.GetNetEntity(_map.GetMapEntityId(mapId)),
string.Join(",", _map.GetAllGrids(mapId).Select(grid => grid.Owner)));
}