コード例 #1
0
        private void InitializeAckDataToEntityMappables(Sub60FinishedWarpAckCommand command, int entityGuid)
        {
            //We have to do basically what the 3 packet process does for newly joining clients
            //We need to create the world transform so that it will be known where to spawn.
            float   rotation = UnitScaler.ScaleYRotation(command.YAxisRotation);
            Vector3 position = UnitScaler.Scale(command.Position);

            WorldTransformMappable[entityGuid] = new WorldTransform(position, Quaternion.Euler(0.0f, rotation, 0.0f));

            //Then we have to actually create/set the zone data so that
            //it's known which zone the player is in
            ZoneDataMappable[entityGuid] = new PlayerZoneData(command.ZoneId);
        }
コード例 #2
0
        /// <inheritdoc />
        protected override Task HandleSubMessage(IPeerMessageContext <PSOBBGamePacketPayloadClient> context, Sub60StartNewWarpCommand command)
        {
            //TODO: We should remove the player's physical representation from the current map if they're in it.
            if (Logger.IsDebugEnabled)
            {
                Logger.Debug($"Player ID: {command.Identifier} starting warp to ZoneId: {command.ZoneId} - Unused: {command.Unused1} {command.Unused2}");
            }

            //Even if we don't know about the entity, and have never seen it, let's assume that we will or need this data
            //and store/override the existing zone data in the ZoneMappable.

            int entityGuid = EntityGuid.ComputeEntityGuid(EntityType.Player, command.Identifier);

            ZoneDataMappable[entityGuid] = new PlayerZoneData(command.ZoneId);

            return(Task.CompletedTask);
        }