From: js6pak Date: Fri, 6 Jan 2023 18:11:09 +0000 (+0100) Subject: Expose RoleType in api X-Git-Tag: v1.8.0~1^2~1 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=9cd5de6a36cff979525468224d0200bd84905891;p=rhonda%2Fimpostor.git Expose RoleType in api --- diff --git a/src/Impostor.Api/Net/Inner/Objects/IInnerPlayerInfo.cs b/src/Impostor.Api/Net/Inner/Objects/IInnerPlayerInfo.cs index 368f3a1..eb3654a 100644 --- a/src/Impostor.Api/Net/Inner/Objects/IInnerPlayerInfo.cs +++ b/src/Impostor.Api/Net/Inner/Objects/IInnerPlayerInfo.cs @@ -12,6 +12,11 @@ namespace Impostor.Api.Net.Inner.Objects /// string PlayerName { get; } + /// + /// Gets the role type of the player. + /// + RoleTypes? RoleType { get; } + /// /// Gets a value indicating whether the player is an impostor. /// diff --git a/src/Impostor.Plugins.Example/Handlers/GameEventListener.cs b/src/Impostor.Plugins.Example/Handlers/GameEventListener.cs index 39bcb01..404e0a8 100644 --- a/src/Impostor.Plugins.Example/Handlers/GameEventListener.cs +++ b/src/Impostor.Plugins.Example/Handlers/GameEventListener.cs @@ -52,7 +52,7 @@ namespace Impostor.Plugins.Example.Handlers { var info = player.Character!.PlayerInfo; - _logger.LogInformation("- {player} is {role}", info.PlayerName, info.IsImpostor ? "an impostor" : "a crewmate"); + _logger.LogInformation("- {player} is {role}", info.PlayerName, info.RoleType); } }