Пример #1
0
        /// <summary>
        /// Retrives all objects from the old rex tables
        /// </summary>
        /// <returns>All objects as a list, if none found or error while processing returns null</returns>
        public List<RexLegacyPrimData> LoadAllRexPrimData()
        {
            try
            {
                RexLegacyPrimData obj = new RexLegacyPrimData();
                ICriteria criteria = manager.GetSession().CreateCriteria(typeof(RexLegacyPrimData));

                List<RexLegacyPrimData> rexprimdata = (List<RexLegacyPrimData>)criteria.List<RexLegacyPrimData>();
                return rexprimdata;
            }
            catch (Exception e)
            {
                m_log.WarnFormat("[NHIBERNATE]: Failed loading legacy RexPrimData. Exception {0} ", e);
                return new List<RexLegacyPrimData>();
            }
        }
Пример #2
0
        public void SetRexPrimDataFromLegacyData(RexLegacyPrimData source)
        {
            try
            {
                mProcessingPacketData = true;
                ParentObjectID = source.UUID;
                RexDrawType = Convert.ToByte(source.DrawType);
                RexIsVisible = ConvertStringToBoolean(source.IsVisible);
                RexCastShadows = ConvertStringToBoolean(source.CastShadows);
                RexLightCreatesShadows = ConvertStringToBoolean(source.LightCreatesShadows);
                RexDescriptionTexture = ConvertStringToBoolean(source.DescriptionTexture);
                RexScaleToPrim = ConvertStringToBoolean(source.ScaleToPrim);
                RexDrawDistance = source.DrawDistance;
                RexLOD = source.LODBias;
                RexMeshUUID = source.Mesh;
                RexCollisionMeshUUID = source.CollisionMesh;
                RexParticleScriptUUID = source.ParticleScript;
                RexAnimationPackageUUID = source.AnimationPackage;
                RexAnimationName = source.AnimationName;
                RexAnimationRate = source.AnimationRate;
                RexMaterials.ClearMaterials();
                RexClassName = source.ClassName;
                RexSoundUUID = source.Sound;
                RexSoundVolume = source.SoundVolume;
                RexSoundRadius = source.SoundRadius;

                if(source.RexExtraPrimData != null && source.RexExtraPrimData.Length > 0)
                    RexData = Encoding.UTF8.GetString(source.RexExtraPrimData);

                RexSelectPriority = source.SelectPriority;
                mProcessingPacketData = false;

                TriggerChangedRexObjectProperties();
            }
            catch (Exception e)
            {
                mProcessingPacketData = false;
                m_log.Error(e.ToString());
            }
        }