Example #1
0
        /// <inheritdoc />
        protected override void OnEventFired(object source, PlayerWorldSessionCreationEventArgs args)
        {
            EntityCreationData data = new EntityCreationData(args.EntityGuid, MovementDataMappable[args.EntityGuid], EntityDataUpdateFactory.Create(new EntityFieldUpdateCreationContext(EntityDataMappable[args.EntityGuid], EntityDataMappable[args.EntityGuid].DataSetIndicationArray)));

            var senderContext = new GenericSingleTargetMessageContext <PlayerSelfSpawnEventPayload>(args.EntityGuid, new PlayerSelfSpawnEventPayload(data));

            Sender.Send(senderContext);
        }
Example #2
0
        private void SetInitialFieldValues([NotNull] EntityCreationData creationData, [NotNull] IEntityDataFieldContainer dataContainer)
        {
            if (creationData == null)
            {
                throw new ArgumentNullException(nameof(creationData));
            }
            if (dataContainer == null)
            {
                throw new ArgumentNullException(nameof(dataContainer));
            }

            //TODO: We need a better way to handle initial field values, this is a disaster.
            foreach (var entry in creationData.InitialFieldValues.FieldValueUpdateMask
                     .EnumerateSetBitsByIndex()
                     .Zip(creationData.InitialFieldValues.FieldValueUpdates, (setIndex, value) => new { setIndex, value }))
            {
                dataContainer.SetFieldValue(entry.setIndex, entry.value);
            }
        }
 /// <inheritdoc />
 public NetworkEntityNowVisibleEventArgs([NotNull] NetworkEntityGuid entityGuid, [NotNull] EntityCreationData creationData, [NotNull] IEntityDataFieldContainer entityDataContainer)
 {
     EntityGuid          = entityGuid ?? throw new ArgumentNullException(nameof(entityGuid));
     CreationData        = creationData ?? throw new ArgumentNullException(nameof(creationData));
     EntityDataContainer = entityDataContainer ?? throw new ArgumentNullException(nameof(entityDataContainer));
 }
Example #4
0
 /// <inheritdoc />
 public PlayerSelfSpawnEventPayload([NotNull] EntityCreationData creationData)
 {
     CreationData = creationData ?? throw new ArgumentNullException(nameof(creationData));
 }
Example #5
0
 /// <inheritdoc />
 public SelfPlayerSpawnEventArgs([NotNull] EntityCreationData creationData)
 {
     CreationData = creationData ?? throw new ArgumentNullException(nameof(creationData));
 }