--- /dev/null
+using Impostor.Api.Net.Inner.Objects;
+
+namespace Impostor.Api.Events.Player
+{
+ public interface IPlayerReportedBodyEvent : IPlayerEvent
+ {
+ /// <summary>
+ /// Gets the player who's body got reported.
+ /// </summary>
+ IInnerPlayerControl Body { get; }
+ }
+}
--- /dev/null
+using Impostor.Api.Events.Player;
+using Impostor.Api.Games;
+using Impostor.Api.Net;
+using Impostor.Api.Net.Inner.Objects;
+
+namespace Impostor.Server.Events.Player
+{
+ public class PlayerReportedBodyEvent : IPlayerReportedBodyEvent
+ {
+ public PlayerReportedBodyEvent(IGame game, IClientPlayer clientPlayer, IInnerPlayerControl playerControl, IInnerPlayerControl body)
+ {
+ Game = game;
+ ClientPlayer = clientPlayer;
+ PlayerControl = playerControl;
+ Body = body;
+ }
+
+ public IGame Game { get; }
+
+ public IClientPlayer ClientPlayer { get; }
+
+ public IInnerPlayerControl PlayerControl { get; }
+
+ public IInnerPlayerControl Body { get; }
+ }
+}
using System;
+using System.Linq;
using System.Threading.Tasks;
using Impostor.Api;
using Impostor.Api.Events.Managers;
}
var deadBodyPlayerId = reader.ReadByte();
+ await _eventManager.CallAsync(new PlayerReportedBodyEvent(_game, sender, this, _game.GetClientPlayer(deadBodyPlayerId).Character));
+
break;
}