-using System.Numerics;
+using System;
+using System.Numerics;
using Impostor.Api.Net;
using Impostor.Api.Net.Messages;
using Microsoft.Extensions.Logging;
}
else
{
+ if (!sender.IsOwner(this))
+ {
+ throw new ImpostorCheatException($"Client attempted to send unowned {nameof(InnerCustomNetworkTransform)} data.");
+ }
+
+ if (target != null)
+ {
+ throw new ImpostorCheatException($"Client attempted to send {nameof(InnerCustomNetworkTransform)} data to a specific player, must be broadcast.");
+ }
+
if (!SidGreaterThan(sequenceId, _lastSequenceId))
{
return;
public override void Deserialize(IClientPlayer sender, IClientPlayer? target, IMessageReader reader, bool initialState)
{
+ if (!sender.IsHost)
+ {
+ throw new ImpostorCheatException($"Client attempted to send data for {nameof(InnerShipStatus)} as non-host.");
+ }
+
var votes = _votes;
var unknown = reader.ReadByte();
if (unknown != 0)
public override void Deserialize(IClientPlayer sender, IClientPlayer? target, IMessageReader reader, bool initialState)
{
+ if (!sender.IsHost)
+ {
+ throw new ImpostorCheatException($"Client attempted to send data for {nameof(InnerGameData)} as non-host.");
+ }
+
if (initialState)
{
var num = reader.ReadPackedInt32();
using System;
using System.Linq;
using Impostor.Api.Games;
-using Impostor.Api.Innersloth.Data;
using Impostor.Api.Net;
using Impostor.Api.Net.Messages;
using Microsoft.Extensions.Logging;
public override void Deserialize(IClientPlayer sender, IClientPlayer? target, IMessageReader reader, bool initialState)
{
+ if (!sender.IsHost)
+ {
+ throw new ImpostorCheatException($"Client attempted to send data for {nameof(InnerMeetingHud)} as non-host.");
+ }
+
+ if (target != null)
+ {
+ throw new ImpostorCheatException($"Client attempted to send {nameof(InnerMeetingHud)} data to a specific player, must be broadcast.");
+ }
+
if (initialState)
{
PopulateButtons(0);
public override void Deserialize(IClientPlayer sender, IClientPlayer? target, IMessageReader reader, bool initialState)
{
+ if (!sender.IsHost)
+ {
+ throw new ImpostorCheatException($"Client attempted to send data for {nameof(InnerPlayerControl)} as non-host.");
+ }
+
if (initialState)
{
IsNew = reader.ReadBoolean();
{
PlayerInfo.IsDead = true;
PlayerInfo.LastDeathReason = reason;
+
+ Console.WriteLine($"{PlayerInfo.PlayerName,-15} died {reason}");
}
}
}
\ No newline at end of file
public override void Deserialize(IClientPlayer sender, IClientPlayer? target, IMessageReader reader, bool initialState)
{
+ if (!sender.IsHost)
+ {
+ throw new ImpostorCheatException($"Client attempted to send data for {nameof(InnerShipStatus)} as non-host.");
+ }
+
+ if (target != null)
+ {
+ throw new ImpostorCheatException($"Client attempted to send {nameof(InnerShipStatus)} data to a specific player, must be broadcast.");
+ }
+
if (initialState)
{
// TODO: (_systems[SystemTypes.Doors] as DoorsSystemType).SetDoors();
private static async Task Main(string[] args)
{
- Log.Logger = new LoggerConfiguration()
- // .MinimumLevel.Verbose()
- .MinimumLevel.Debug()
- .WriteTo.Console()
- .CreateLogger();
+ // Log.Logger = new LoggerConfiguration()
+ // // .MinimumLevel.Verbose()
+ // .MinimumLevel.Debug()
+ // .WriteTo.Console()
+ // .CreateLogger();
var stopwatch = Stopwatch.StartNew();