예제 #1
0
        private void OnUnitUpdated(Unit unit, UnitUpdatedEventArgs e)
        {
            var visibilityUpdated = (e.UpdateTypes & UnitUpdateTypes.Visibility) > 0;

            if (!visibilityUpdated)
            {
                return;
            }

            ImmutableInterlocked.Update(ref _updatedUnits, h => h.Add(unit));
        }
예제 #2
0
        private void OnUnitUpdated(Unit unit, UnitUpdatedEventArgs e)
        {
            if (!Gang.IsMember(unit))
            {
                return;
            }

            var send = (e.UpdateTypes & UnitUpdateTypes.Visibility) > 0 || (e.UpdatedProperties != null && e.UpdatedProperties.Any(p => p.Field.IsPublic()));

            if (!send)
            {
                return;
            }

            var v = Visibility.Invisible;

            if (unit.InZone)
            {
                v = Visibility.Visible;
            }

            Session.SendPacket(new GangUpdatePacketBuilder(v, (Player)unit));
        }