Пример #1
0
        public string cmDetectedCountry(int number)
        {
            m_host.AddScriptLPS(1);
            if (!m_CMFunctionsEnabled)
            {
                return(String.Empty);
            }
            if (World.UserAccountService == null)
            {
                return(String.Empty);
            }
            DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, number);

            if (detectedParams == null)
            {
                return(String.Empty);
            }
            UUID key = detectedParams.Key;

            if (key == UUID.Zero)
            {
                return(String.Empty);
            }
            UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, key);

            return(account.UserCountry);
        }
Пример #2
0
        public string cmDetectedCountry(int number)
        {
            m_host.AddScriptLPS(1);
            DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_item.ItemID, number);

            if (detectedParams == null)
            {
                return(String.Empty);
            }
            return(detectedParams.Country);
        }
Пример #3
0
        /// <summary>
        /// Get the current Windlight scene
        /// </summary>
        /// <returns>List of windlight parameters</returns>
        public LSL_List lsGetWindlightScene(LSL_List rules)
        {
            if (!m_LSFunctionsEnabled)
            {
                LSShoutError("LightShare functions are not enabled.");
                return(new LSL_List());
            }
            m_host.AddScriptLPS(1);
            RegionLightShareData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings;

            LSL_List values = new LSL_List();
            int      idx    = 0;

            while (idx < rules.Length)
            {
                uint     rule  = (uint)rules.GetLSLIntegerItem(idx);
                LSL_List toadd = new LSL_List();

                switch (rule)
                {
                case (int)ScriptBaseClass.WL_AMBIENT:
                    toadd.Add(new LSL_Rotation(wl.ambient.X, wl.ambient.Y, wl.ambient.Z, wl.ambient.W));
                    break;

                case (int)ScriptBaseClass.WL_BIG_WAVE_DIRECTION:
                    toadd.Add(new LSL_Vector(wl.bigWaveDirection.X, wl.bigWaveDirection.Y, 0.0f));
                    break;

                case (int)ScriptBaseClass.WL_BLUE_DENSITY:
                    toadd.Add(new LSL_Rotation(wl.blueDensity.X, wl.blueDensity.Y, wl.blueDensity.Z, wl.blueDensity.W));
                    break;

                case (int)ScriptBaseClass.WL_BLUR_MULTIPLIER:
                    toadd.Add(new LSL_Float(wl.blurMultiplier));
                    break;

                case (int)ScriptBaseClass.WL_CLOUD_COLOR:
                    toadd.Add(new LSL_Rotation(wl.cloudColor.X, wl.cloudColor.Y, wl.cloudColor.Z, wl.cloudColor.W));
                    break;

                case (int)ScriptBaseClass.WL_CLOUD_COVERAGE:
                    toadd.Add(new LSL_Float(wl.cloudCoverage));
                    break;

                case (int)ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY:
                    toadd.Add(new LSL_Vector(wl.cloudDetailXYDensity.X, wl.cloudDetailXYDensity.Y, wl.cloudDetailXYDensity.Z));
                    break;

                case (int)ScriptBaseClass.WL_CLOUD_SCALE:
                    toadd.Add(new LSL_Float(wl.cloudScale));
                    break;

                case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X:
                    toadd.Add(new LSL_Float(wl.cloudScrollX));
                    break;

                case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
                    toadd.Add(new LSL_Integer(wl.cloudScrollXLock ? 1 : 0));
                    break;

                case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y:
                    toadd.Add(new LSL_Float(wl.cloudScrollY));
                    break;

                case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
                    toadd.Add(new LSL_Integer(wl.cloudScrollYLock ? 1 : 0));
                    break;

                case (int)ScriptBaseClass.WL_CLOUD_XY_DENSITY:
                    toadd.Add(new LSL_Vector(wl.cloudXYDensity.X, wl.cloudXYDensity.Y, wl.cloudXYDensity.Z));
                    break;

                case (int)ScriptBaseClass.WL_DENSITY_MULTIPLIER:
                    toadd.Add(new LSL_Float(wl.densityMultiplier));
                    break;

                case (int)ScriptBaseClass.WL_DISTANCE_MULTIPLIER:
                    toadd.Add(new LSL_Float(wl.distanceMultiplier));
                    break;

                case (int)ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS:
                    toadd.Add(new LSL_Integer(wl.drawClassicClouds ? 1 : 0));
                    break;

                case (int)ScriptBaseClass.WL_EAST_ANGLE:
                    toadd.Add(new LSL_Float(wl.eastAngle));
                    break;

                case (int)ScriptBaseClass.WL_FRESNEL_OFFSET:
                    toadd.Add(new LSL_Float(wl.fresnelOffset));
                    break;

                case (int)ScriptBaseClass.WL_FRESNEL_SCALE:
                    toadd.Add(new LSL_Float(wl.fresnelScale));
                    break;

                case (int)ScriptBaseClass.WL_HAZE_DENSITY:
                    toadd.Add(new LSL_Float(wl.hazeDensity));
                    break;

                case (int)ScriptBaseClass.WL_HAZE_HORIZON:
                    toadd.Add(new LSL_Float(wl.hazeHorizon));
                    break;

                case (int)ScriptBaseClass.WL_HORIZON:
                    toadd.Add(new LSL_Rotation(wl.horizon.X, wl.horizon.Y, wl.horizon.Z, wl.horizon.W));
                    break;

                case (int)ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION:
                    toadd.Add(new LSL_Vector(wl.littleWaveDirection.X, wl.littleWaveDirection.Y, 0.0f));
                    break;

                case (int)ScriptBaseClass.WL_MAX_ALTITUDE:
                    toadd.Add(new LSL_Integer(wl.maxAltitude));
                    break;

                case (int)ScriptBaseClass.WL_NORMAL_MAP_TEXTURE:
                    toadd.Add(new LSL_Key(wl.normalMapTexture.ToString()));
                    break;

                case (int)ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE:
                    toadd.Add(new LSL_Vector(wl.reflectionWaveletScale.X, wl.reflectionWaveletScale.Y, wl.reflectionWaveletScale.Z));
                    break;

                case (int)ScriptBaseClass.WL_REFRACT_SCALE_ABOVE:
                    toadd.Add(new LSL_Float(wl.refractScaleAbove));
                    break;

                case (int)ScriptBaseClass.WL_REFRACT_SCALE_BELOW:
                    toadd.Add(new LSL_Float(wl.refractScaleBelow));
                    break;

                case (int)ScriptBaseClass.WL_SCENE_GAMMA:
                    toadd.Add(new LSL_Float(wl.sceneGamma));
                    break;

                case (int)ScriptBaseClass.WL_STAR_BRIGHTNESS:
                    toadd.Add(new LSL_Float(wl.starBrightness));
                    break;

                case (int)ScriptBaseClass.WL_SUN_GLOW_FOCUS:
                    toadd.Add(new LSL_Float(wl.sunGlowFocus));
                    break;

                case (int)ScriptBaseClass.WL_SUN_GLOW_SIZE:
                    toadd.Add(new LSL_Float(wl.sunGlowSize));
                    break;

                case (int)ScriptBaseClass.WL_SUN_MOON_COLOR:
                    toadd.Add(new LSL_Rotation(wl.sunMoonColor.X, wl.sunMoonColor.Y, wl.sunMoonColor.Z, wl.sunMoonColor.W));
                    break;

                case (int)ScriptBaseClass.WL_UNDERWATER_FOG_MODIFIER:
                    toadd.Add(new LSL_Float(wl.underwaterFogModifier));
                    break;

                case (int)ScriptBaseClass.WL_WATER_COLOR:
                    toadd.Add(new LSL_Vector(wl.waterColor.X, wl.waterColor.Y, wl.waterColor.Z));
                    break;

                case (int)ScriptBaseClass.WL_WATER_FOG_DENSITY_EXPONENT:
                    toadd.Add(new LSL_Float(wl.waterFogDensityExponent));
                    break;
                }

                if (toadd.Length > 0)
                {
                    values.Add(rule);
                    values.Add(toadd.Data[0]);
                }
                idx++;
            }


            return(values);
        }