Un-revert IPlayerManager refactor (#21244)

This commit is contained in:
Leon Friedrich
2023-10-28 09:59:53 +11:00
committed by GitHub
parent c55e1dcafd
commit e685cb626b
245 changed files with 781 additions and 943 deletions

View File

@@ -6,7 +6,6 @@ using Content.Server.Voting.Managers;
using Content.Shared.Administration;
using Content.Shared.Database;
using Content.Shared.Voting;
using Robust.Server.Player;
using Robust.Shared.Console;
namespace Content.Server.Voting
@@ -36,14 +35,14 @@ namespace Content.Server.Voting
var mgr = IoCManager.Resolve<IVoteManager>();
if (shell.Player != null && !mgr.CanCallVote((IPlayerSession) shell.Player, type))
if (shell.Player != null && !mgr.CanCallVote(shell.Player, type))
{
_adminLogger.Add(LogType.Vote, LogImpact.Medium, $"{shell.Player} failed to start {type.ToString()} vote");
shell.WriteError(Loc.GetString("cmd-createvote-cannot-call-vote-now"));
return;
}
mgr.CreateStandardVote((IPlayerSession?) shell.Player, type);
mgr.CreateStandardVote(shell.Player, type);
}
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
@@ -92,7 +91,7 @@ namespace Content.Server.Voting
options.Options.Add((args[i], i));
}
options.SetInitiatorOrServer((IPlayerSession?) shell.Player);
options.SetInitiatorOrServer(shell.Player);
if (shell.Player != null)
_adminLogger.Add(LogType.Vote, LogImpact.Medium, $"{shell.Player} initiated a custom vote: {options.Title} - {string.Join("; ", options.Options.Select(x => x.text))}");
@@ -187,7 +186,7 @@ namespace Content.Server.Voting
return;
}
vote.CastVote((IPlayerSession) shell.Player!, optionN);
vote.CastVote(shell.Player!, optionN);
}
}