public static void SendMapRunningFightDetailsMessage(IPacketReceiver client, IFight fight) { var redFighters = fight.ChallengersTeam.GetAllFighters(x => !(x is SummonedFighter) && !(x is SummonedBomb)).ToArray(); var blueFighters = fight.DefendersTeam.GetAllFighters(x => !(x is SummonedFighter) && !(x is SummonedBomb)).ToArray(); var partiesName = fight.GetPartiesName().ToArray(); if (partiesName.Length > 0) { client.Send(new MapRunningFightDetailsExtendedMessage( fight.Id, redFighters.Select(entry => entry.GetGameFightFighterLightInformations()), blueFighters.Select(entry => entry.GetGameFightFighterLightInformations()), partiesName)); } else { client.Send(new MapRunningFightDetailsMessage( fight.Id, redFighters.Select(entry => entry.GetGameFightFighterLightInformations()), blueFighters.Select(entry => entry.GetGameFightFighterLightInformations()))); } }
public static void SendGameFightSpectatorJoinMessage(IPacketReceiver client, IFight fight) { client.Send(new GameFightSpectatorJoinMessage(false, false, false, fight.IsStarted, fight.IsStarted ? (short)0 : (short)(fight.GetPlacementTimeLeft().TotalMilliseconds / 100), (sbyte)fight.FightType, fight.GetPartiesName())); }