Merge branch '20-10-30-admins' into 20-11-13-merges
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.GameObjects.Components.Body;
|
||||
using Content.Shared.GameObjects.Components.Body.Part;
|
||||
@@ -16,6 +18,7 @@ using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Body
|
||||
{
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
class AddHandCommand : IClientCommand
|
||||
{
|
||||
public const string DefaultHandPrototype = "LeftHandHuman";
|
||||
@@ -149,6 +152,7 @@ namespace Content.Server.GameObjects.Components.Body
|
||||
}
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
class RemoveHandCommand : IClientCommand
|
||||
{
|
||||
public string Command => "removehand";
|
||||
@@ -190,6 +194,7 @@ namespace Content.Server.GameObjects.Components.Body
|
||||
}
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
class DestroyMechanismCommand : IClientCommand
|
||||
{
|
||||
public string Command => "destroymechanism";
|
||||
@@ -242,6 +247,7 @@ namespace Content.Server.GameObjects.Components.Body
|
||||
}
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
class HurtCommand : IClientCommand
|
||||
{
|
||||
public string Command => "hurt";
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameObjects.Components.Atmos;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.GameObjects.Components.Damage;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
@@ -115,6 +117,7 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
}
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public class AddDamageFlagCommand : DamageFlagCommand
|
||||
{
|
||||
public override string Command => "adddamageflag";
|
||||
@@ -133,6 +136,7 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
}
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public class RemoveDamageFlagCommand : DamageFlagCommand
|
||||
{
|
||||
public override string Command => "removedamageflag";
|
||||
@@ -151,6 +155,7 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
}
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
public class GodModeCommand : IClientCommand
|
||||
{
|
||||
public string Command => "godmode";
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#nullable enable
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -8,6 +10,7 @@ using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Disposal
|
||||
{
|
||||
[AdminCommand(AdminFlags.Debug)]
|
||||
public class TubeConnectionsCommand : IClientCommand
|
||||
{
|
||||
public string Command => "tubeconnections";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#nullable enable
|
||||
using System.Linq;
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Maps;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
@@ -14,7 +16,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
/// <summary>
|
||||
/// <see cref="TilePryingComponent.TryPryTile"/>
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
[AdminCommand(AdminFlags.Debug)]
|
||||
class TilePryCommand : IClientCommand
|
||||
{
|
||||
public string Command => "tilepry";
|
||||
@@ -69,7 +71,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
}
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
[AdminCommand(AdminFlags.Debug)]
|
||||
class AnchorCommand : IClientCommand
|
||||
{
|
||||
public string Command => "anchor";
|
||||
@@ -114,7 +116,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
}
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
[AdminCommand(AdminFlags.Debug)]
|
||||
class UnAnchorCommand : IClientCommand
|
||||
{
|
||||
public string Command => "unanchor";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Commands;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
@@ -88,6 +90,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
}
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Debug)]
|
||||
public sealed class ShowAlert : IClientCommand
|
||||
{
|
||||
public string Command => "showalert";
|
||||
@@ -129,6 +132,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
}
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Debug)]
|
||||
public sealed class ClearAlert : IClientCommand
|
||||
{
|
||||
public string Command => "clearalert";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
@@ -17,6 +19,7 @@ namespace Content.Server.GameObjects.Components.Mobs.Speech
|
||||
public string Accentuate(string message);
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public class AddAccent : IClientCommand
|
||||
{
|
||||
public string Command => "addaccent";
|
||||
@@ -38,12 +41,12 @@ namespace Content.Server.GameObjects.Components.Mobs.Speech
|
||||
shell.SendText(player, "You don't have a player!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var compFactory = IoCManager.Resolve<IComponentFactory>();
|
||||
|
||||
|
||||
if (args[0] == "?")
|
||||
{
|
||||
// Get all components that implement the ISpeechComponent except
|
||||
// Get all components that implement the ISpeechComponent except
|
||||
var speeches = compFactory.GetAllRefTypes()
|
||||
.Where(c => typeof(IAccentComponent).IsAssignableFrom(c) && c.IsClass);
|
||||
var msg = "";
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameObjects.Components.AI;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
@@ -19,12 +21,12 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
* Currently factions are implicitly friendly if they are not hostile.
|
||||
* This may change where specified friendly factions are listed. (e.g. to get number of friendlies in area).
|
||||
*/
|
||||
|
||||
|
||||
public Faction GetHostileFactions(Faction faction) => _hostileFactions.TryGetValue(faction, out var hostiles) ? hostiles : Faction.None;
|
||||
|
||||
|
||||
private Dictionary<Faction, Faction> _hostileFactions = new Dictionary<Faction, Faction>
|
||||
{
|
||||
{Faction.NanoTransen,
|
||||
{Faction.NanoTransen,
|
||||
Faction.SimpleHostile | Faction.Syndicate | Faction.Xeno},
|
||||
{Faction.SimpleHostile,
|
||||
Faction.NanoTransen | Faction.Syndicate
|
||||
@@ -35,11 +37,11 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
},
|
||||
{Faction.Syndicate,
|
||||
Faction.NanoTransen | Faction.SimpleHostile | Faction.Xeno},
|
||||
{Faction.Xeno,
|
||||
{Faction.Xeno,
|
||||
Faction.NanoTransen | Faction.Syndicate},
|
||||
};
|
||||
|
||||
public Faction GetFactions(IEntity entity) =>
|
||||
public Faction GetFactions(IEntity entity) =>
|
||||
entity.TryGetComponent(out AiFactionTagComponent factionTags)
|
||||
? factionTags.Factions
|
||||
: Faction.None;
|
||||
@@ -76,7 +78,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
hostileFactions &= ~target;
|
||||
_hostileFactions[source] = hostileFactions;
|
||||
}
|
||||
|
||||
|
||||
public void MakeHostile(Faction source, Faction target)
|
||||
{
|
||||
if (!_hostileFactions.TryGetValue(source, out var hostileFactions))
|
||||
@@ -89,12 +91,13 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
_hostileFactions[source] = hostileFactions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public sealed class FactionCommand : IClientCommand
|
||||
{
|
||||
public string Command => "factions";
|
||||
public string Description => "Update / list factional relationships for NPCs.";
|
||||
public string Help => "faction <source> <friendly/hostile> target\n" +
|
||||
public string Help => "faction <source> <friendly/hostile> target\n" +
|
||||
"faction <source> list: hostile factions";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
@@ -108,11 +111,11 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
continue;
|
||||
result.Append(value + "\n");
|
||||
}
|
||||
|
||||
|
||||
shell.SendText(player, result.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (args.Length < 2)
|
||||
{
|
||||
shell.SendText(player, Loc.GetString("Need more args"));
|
||||
@@ -141,7 +144,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
shell.SendText(player, Loc.GetString("Invalid target faction"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
EntitySystem.Get<AiFactionTagSystem>().MakeFriendly(faction, targetFaction);
|
||||
shell.SendText(player, Loc.GetString("Command successful"));
|
||||
break;
|
||||
@@ -157,7 +160,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
shell.SendText(player, Loc.GetString("Invalid target faction"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
EntitySystem.Get<AiFactionTagSystem>().MakeHostile(faction, targetFaction);
|
||||
shell.SendText(player, Loc.GetString("Command successful"));
|
||||
break;
|
||||
@@ -172,4 +175,4 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameObjects.Components.Movement;
|
||||
using Content.Shared;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.GameObjects.Components.Movement;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.AI;
|
||||
@@ -145,6 +146,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI
|
||||
public bool ProcessorTypeExists(string name) => _processorTypes.ContainsKey(name);
|
||||
|
||||
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
private class AddAiCommand : IClientCommand
|
||||
{
|
||||
public string Command => "addai";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameObjects.Components.MachineLinking;
|
||||
using Content.Server.GameObjects.EntitySystems.Click;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -98,6 +100,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Debug)]
|
||||
public class SignalLinkerCommand : IClientCommand
|
||||
{
|
||||
public string Command => "signallink";
|
||||
|
||||
Reference in New Issue
Block a user