public override void Unpack(byte[] data) { Reset(data); KillerID = ReadByte(); int r = ReadInt16(); if (r == Constants.PhysicsDriverDeath) { Reason = BlowedUpReasons.DeathTouch; } else { Reason = (BlowedUpReasons)r; } ShotID = ReadInt16(); FlagAbreviation = ReadFixedSizeString(2); if (Reason == BlowedUpReasons.DeathTouch) { PhysicsDriverID = ReadInt32(); } }
protected virtual bool DoPlayerScore(ServerPlayer victim, ref ScoreInfo victimScoreDelta, ServerPlayer killer, ref ScoreInfo killerScoreDelta, BlowedUpReasons eventReason) { if (victim.ActualTeam == killer.ActualTeam && killer.ActualTeam != BZFlag.Data.Teams.TeamColors.RogueTeam) { killerScoreDelta.TeamKills = 1; } victimScoreDelta.Losses = 1; if (eventReason == BlowedUpReasons.GotShot || eventReason == BlowedUpReasons.GotRunOver) { if (killer.Info.CariedFlag != null && killer.Info.CariedFlag.Flag == FlagTypeList.Genocide && victim.ActualTeam != BZFlag.Data.Teams.TeamColors.RogueTeam) { killerScoreDelta.Wins = victim.Info.Team.Members.FindAll((x) => x.Info.Alive).Count; } else { killerScoreDelta.Wins = 1; } } return(!victimScoreDelta.Empty && !killerScoreDelta.Empty); }