[Feat] Респект и уважуха (#476)

* db

* wd comment

* manager & commands

* system & round end results

* raise ban event

* client manager & cached values

* role pick tweak

* tweak last commit

* more fixes

* weights fix

* Fix for short rounds

* tweak in cached dictionary

* reva pick system

* fix last commit

* cult role pick

* nukeops role picking

* fix cache in async & show command

* ooc msg show value

* move pick method to manager & traitor pick fix
This commit is contained in:
HitPanda
2023-10-08 15:53:28 +03:00
committed by Aviu00
parent a29e004eba
commit 7c9bd1d934
37 changed files with 3752 additions and 25 deletions

View File

@@ -0,0 +1,43 @@
using Content.Server.Administration;
using Content.Shared.Administration;
using Robust.Server.Player;
using Robust.Shared.Console;
namespace Content.Server.White.Reputation.Commands;
[AdminCommand(AdminFlags.Host)]
public sealed class SetReputationCommand : IConsoleCommand
{
public string Command => "setreput";
public string Description => "Sets the reputation to the certain value.";
public string Help => "Usage: setrep {ckey} {value}";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var playerManager = IoCManager.Resolve<IPlayerManager>();
var repManager = IoCManager.Resolve<ReputationManager>();
if (args.Length < 2)
{
shell.WriteLine($"Not enough arguments.\n{Help}");
return;
}
if (!playerManager.TryGetPlayerDataByUsername(args[0], out var playerData))
{
shell.WriteLine($"Couldn't find player: {args[0]}.");
return;
}
if (!float.TryParse(args[1], out var value))
{
shell.WriteLine($"Invalid value: {args[1]}.");
return;
}
var uid = playerData.UserId;
repManager.SetPlayerReputation(uid, value);
shell.WriteLine($"Set reputation of {args[0]} to {args[1]}.");
}
}