当前位置: 首页>>代码示例>>C#>>正文


C# OpenMetaverse.Simulator类代码示例

本文整理汇总了C#中OpenMetaverse.Simulator的典型用法代码示例。如果您正苦于以下问题:C# Simulator类的具体用法?C# Simulator怎么用?C# Simulator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Simulator类属于OpenMetaverse命名空间,在下文中一共展示了Simulator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Objects_OnNewAvatar

        void Objects_OnNewAvatar(Simulator simulator, Avatar avatar, ulong regionHandle, ushort timeDilation)
        {
            if (enabled)
            {
                // Search this avatar for textures
                for (int i = 0; i < avatar.Textures.FaceTextures.Length; i++)
                {
                    Primitive.TextureEntryFace face = avatar.Textures.FaceTextures[i];

                    if (face != null)
                    {
                        if (!alreadyRequested.ContainsKey(face.TextureID))
                        {
                            alreadyRequested[face.TextureID] = face.TextureID;

                            // Determine if this is a baked outfit texture or a normal texture
                            ImageType type = ImageType.Normal;
                            AppearanceManager.TextureIndex index = (AppearanceManager.TextureIndex)i;
                            switch (index)
                            {
                                case AppearanceManager.TextureIndex.EyesBaked:
                                case AppearanceManager.TextureIndex.HeadBaked:
                                case AppearanceManager.TextureIndex.LowerBaked:
                                case AppearanceManager.TextureIndex.SkirtBaked:
                                case AppearanceManager.TextureIndex.UpperBaked:
                                    type = ImageType.Baked;
                                    break;
                            }

                            Client.Assets.RequestImage(face.TextureID, type);
                        }
                    }
                }
            }
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:35,代码来源:TexturesCommand.cs

示例2: SendPacket

 public void SendPacket(Packet packet, Simulator sim)
 {
     if (OnPacketSent != null)
     {
         OnPacketSent(packet, sim);
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:7,代码来源:MockNetworkManager.cs

示例3: Objects_OnObjectProperties11

 public void Objects_OnObjectProperties11(Simulator simulator, Primitive prim, Primitive.ObjectProperties props)
 {
     //Primitive prim = GetPrimitive(props.ObjectID, simulator);
     if (prim == null)
     {
         prim = GetPrimitive(props.ObjectID, simulator);
     }
     DeclareProperties(prim, props, simulator);
     if (prim != null)
     {
         prim.RegionHandle = simulator.Handle;
         SimObject updateMe = GetSimObject(prim, simulator);
         if (updateMe == null)
         {
             return;
         }
         if (prim.ParentID == 0 && !SimRegion.OutOfRegion(prim.Position))
         {
             updateMe.ResetPrim(prim, client, simulator);
         }
         if (MaintainObjectProperties)
         {
             //updateMe.Properties = null;
             updateMe.Properties = (props);
         }
         //Debug("UpdateProperties: {0}", updateMe.DebugInfo());
         describePrimToAI(prim, simulator);
     }
 }
开发者ID:drzo,项目名称:opensim4opencog,代码行数:29,代码来源:WorldObjectData.cs

示例4: Caps

        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="simulator"></param>
        /// <param name="seedcaps"></param>
        internal Caps(Simulator simulator, string seedcaps)
        {
            Simulator = simulator;
            _SeedCapsURI = seedcaps;

            MakeSeedRequest();
        }
开发者ID:3di,项目名称:3di-viewer-rei-libs,代码行数:12,代码来源:Caps.cs

示例5: ProcessAnimationsPacket

        private void ProcessAnimationsPacket(Packet packet, Simulator simulator)
        {
            if (!(packet is AvatarAnimationPacket))
                return;

            AvatarAnimationPacket animation = (AvatarAnimationPacket)packet;

            SimData simData;
            if (!Ox.DataStore.World.SimCollection.TryGet(simulator.ID.ToString(), out simData))
                return;

            ObjectData objectData;
            if (!simData.TryGet(animation.Sender.ID.ToString(), out objectData))
                return;

            if (!(objectData is AvatarData))
                return;

            AvatarData avatarData = objectData as AvatarData;

            List<AvatarData.Animation> anims = new List<AvatarData.Animation>();
            foreach (AvatarAnimationPacket.AnimationListBlock block in animation.AnimationList)
                anims.Add(new AvatarData.Animation(block.AnimID.ToString(), block.AnimSequenceID));
            avatarData.UpdateAnimation(anims.ToArray());

            string msg = JsonUtil.SerializeMessage(JsonType.ObjectUpdated, new JsonObjectUpdated(
                simulator.ID.ToString(),
                animation.Sender.ID.ToString(),
                (int)JsonObjectUpdated.PrimType.Avatar,
                (int)JsonObjectUpdated.Type.UpdateAnimation
                ));
            Ox.EventFire(msg, true);
        }
开发者ID:yooyke,项目名称:work,代码行数:33,代码来源:Protocol_process.cs

示例6: ntfPermissions

        public ntfPermissions(RadegastInstance instance, Simulator simulator, UUID taskID, UUID itemID, string objectName, string objectOwner, ScriptPermission questions)
            : base(NotificationType.PermissionsRequest)
        {
            InitializeComponent();

            this.instance = instance;
            this.simulator = simulator;
            this.taskID = taskID;
            this.itemID = itemID;
            this.objectName = objectName;
            this.objectOwner = objectOwner;
            this.questions = questions;

            txtMessage.BackColor = instance.MainForm.NotificationBackground;
            txtMessage.Text = "Object " + objectName + " owned by " + objectOwner + " is asking permission to " + questions.ToString() + ". Do you accept?";

            // Fire off event
            NotificationEventArgs args = new NotificationEventArgs(instance);
            args.Text = txtMessage.Text;
            args.Buttons.Add(btnYes);
            args.Buttons.Add(btnNo);
            args.Buttons.Add(btnMute);
            FireNotificationCallback(args);

            Radegast.GUI.GuiHelpers.ApplyGuiFixes(this);
        }
开发者ID:nooperation,项目名称:radegast,代码行数:26,代码来源:PermissionsNotification.cs

示例7: LandPatchReceivedEventArgs

 public LandPatchReceivedEventArgs(Simulator simulator, int x, int y, int patchSize, float[] heightMap)
 {
     this.m_Simulator = simulator;
     this.m_X = x;
     this.m_Y = y;
     this.m_PatchSize = patchSize;
     this.m_HeightMap = heightMap;
 }
开发者ID:GwynethLlewelyn,项目名称:restbot,代码行数:8,代码来源:TerrainManager.cs

示例8: Network_SkipEvent

 private bool Network_SkipEvent(PacketType type, Simulator sim)
 {
     if (PacketTypeRegional.Contains(type))
     {
         if (!IsMaster(sim)) return true;
     }
     return false;
 }
开发者ID:drzo,项目名称:opensim4opencog,代码行数:8,代码来源:WorldRegionMastering.cs

示例9: Serialize

        public static string Serialize(Simulator settings, RegionSettings reg)
        {
            StringWriter sw = new StringWriter();
            XmlTextWriter xtw = new XmlTextWriter(sw);
            xtw.Formatting = Formatting.Indented;
            xtw.WriteStartDocument();

            xtw.WriteStartElement("RegionSettings");

            xtw.WriteStartElement("General");
            xtw.WriteElementString("AllowDamage", ((settings.Flags & RegionFlags.AllowDamage) != 0).ToString());
            xtw.WriteElementString("AllowLandResell", ((settings.Flags & RegionFlags.BlockLandResell) == 0).ToString());
            xtw.WriteElementString("AllowLandJoinDivide", ((settings.Flags & RegionFlags.AllowParcelChanges) != 0).ToString());
            xtw.WriteElementString("BlockFly", ((settings.Flags & RegionFlags.NoFly) != 0).ToString());
            xtw.WriteElementString("BlockLandShowInSearch", ((settings.Flags & RegionFlags.BlockParcelSearch) != 0).ToString());
            xtw.WriteElementString("BlockTerraform", ((settings.Flags & RegionFlags.BlockTerraform) != 0).ToString());
            xtw.WriteElementString("DisableCollisions", ((settings.Flags & RegionFlags.SkipCollisions) != 0).ToString());
            xtw.WriteElementString("DisablePhysics", ((settings.Flags & RegionFlags.SkipPhysics) != 0).ToString());
            xtw.WriteElementString("DisableScripts", ((settings.Flags & RegionFlags.SkipScripts) != 0).ToString());
            xtw.WriteElementString("MaturityRating", settings.Access.ToString());
            xtw.WriteElementString("RestrictPushing", ((settings.Flags & RegionFlags.RestrictPushObject) != 0).ToString());
            xtw.WriteElementString("AgentLimit", reg.AgentLimit.ToString());
            xtw.WriteElementString("ObjectBonus", reg.ObjectBonus.ToString());
            xtw.WriteEndElement();

            xtw.WriteStartElement("GroundTextures");
            xtw.WriteElementString("Texture1", settings.TerrainDetail0.ToString());
            xtw.WriteElementString("Texture2", settings.TerrainDetail1.ToString());
            xtw.WriteElementString("Texture3", settings.TerrainDetail2.ToString());
            xtw.WriteElementString("Texture4", settings.TerrainDetail3.ToString());
            xtw.WriteElementString("ElevationLowSW", settings.TerrainStartHeight00.ToString());
            xtw.WriteElementString("ElevationLowNW", settings.TerrainStartHeight01.ToString());
            xtw.WriteElementString("ElevationLowSE", settings.TerrainStartHeight10.ToString());
            xtw.WriteElementString("ElevationLowNE", settings.TerrainStartHeight11.ToString());
            xtw.WriteElementString("ElevationHighSW", settings.TerrainHeightRange00.ToString());
            xtw.WriteElementString("ElevationHighNW", settings.TerrainHeightRange01.ToString());
            xtw.WriteElementString("ElevationHighSE", settings.TerrainHeightRange10.ToString());
            xtw.WriteElementString("ElevationHighNE", settings.TerrainHeightRange11.ToString());
            xtw.WriteEndElement();

            xtw.WriteStartElement("Terrain");
            xtw.WriteElementString("WaterHeight", settings.WaterHeight.ToString());
            xtw.WriteElementString("TerrainRaiseLimit", reg.TerrainRaiseLimit.ToString());
            xtw.WriteElementString("TerrainLowerLimit", reg.TerrainLowerLimit.ToString());
            xtw.WriteElementString("UseEstateSun", reg.UseEstateSun.ToString());
            xtw.WriteElementString("FixedSun", reg.FixedSun.ToString());
            //todo xtw.WriteElementString("SunPosition", settings.SunPosition.ToString());
            // Note: 'SunVector' isn't saved because this value is owned by the Sun Module, which
            // calculates it automatically according to the date and other factors.
            xtw.WriteEndElement();

            xtw.WriteEndElement();

            xtw.Close();
            sw.Close();

            return sw.ToString();
        }
开发者ID:drzo,项目名称:opensim4opencog,代码行数:58,代码来源:OarFile_Land.cs

示例10: AttachedSoundEventArgs

 /// <summary>
 /// Construct a new instance of the SoundTriggerEventArgs class
 /// </summary>
 /// <param name="sim">Simulator where the event originated</param>
 /// <param name="soundID">The sound asset id</param>
 /// <param name="ownerID">The ID of the owner</param>
 /// <param name="objectID">The ID of the object</param>
 /// <param name="gain">The volume level</param>
 /// <param name="flags">The <see cref="SoundFlags"/></param>
 public AttachedSoundEventArgs(Simulator sim, UUID soundID, UUID ownerID, UUID objectID, float gain, SoundFlags flags)
 {
     this.m_Simulator = sim;
     this.m_SoundID = soundID;
     this.m_OwnerID = ownerID;
     this.m_ObjectID = objectID;
     this.m_Gain = gain;
     this.m_Flags = flags;
 }
开发者ID:VirtualReality,项目名称:LibOMV,代码行数:18,代码来源:SoundManager.cs

示例11: AgentDataUpdateHandler

 private void AgentDataUpdateHandler(Packet packet, Simulator sim)
 {
     AgentDataUpdatePacket p = (AgentDataUpdatePacket)packet;
     if (p.AgentData.AgentID == Client.Self.AgentID)
     {
         activeGroup = Utils.BytesToString(p.AgentData.GroupName) + " ( " + Utils.BytesToString(p.AgentData.GroupTitle) + " )";
         GroupsEvent.Set();
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:9,代码来源:ActivateGroupCommand.cs

示例12: AgentDataUpdateHandler

 private void AgentDataUpdateHandler(Packet packet, Simulator sim)
 {
     AgentDataUpdatePacket p = (AgentDataUpdatePacket)packet;
     if (p.AgentData.AgentID == Client.Self.AgentID)
     {
         activeGroup = Helpers.FieldToUTF8String(p.AgentData.GroupName) + " ( " + Helpers.FieldToUTF8String(p.AgentData.GroupTitle) + " )";
         GroupsEvent.Set();
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:9,代码来源:ActivateGroupCommand.cs

示例13: Nurse_OnInstantMessage

        void Nurse_OnInstantMessage(InstantMessage im, Simulator simulator)
        {
            if (im.Message.Equals("Reset"))
            {
                Reset();
                return;
            }

            if (im.Message.Equals("Stop"))
            {
                Stop();
                return;
            }

            if (im.Message.Equals("Start"))
            {
                Start();
                return;
            }

            if (state != States.idle)
            {
                client.Self.InstantMessage(im.FromAgentID, "busy");
                return;
            }

            List<Vector3> wayPointList = null;
            if (im.Message.Equals("thirsty"))
            {
                state = States.water;
                wayPointList = WaypointService.GetWayPoints(client.Self.SimPosition, "room5");
                client.Self.Chat("Ok " + im.FromAgentName + ", I'll get you a drink.", 0, ChatType.Normal);
                TraverseWayPoints(wayPointList);
                client.Self.Chat("I'm getting water for the patient in " + roomName, 0, ChatType.Normal);
                wayPointList = WaypointService.GetWayPoints(client.Self.SimPosition, roomName);
                TraverseWayPoints(wayPointList);
                client.Self.Chat("Here is your water.", 0, ChatType.Normal);
            }
            if (im.Message.Equals("pain"))
            {
                state = States.drugs;
                wayPointList = WaypointService.GetWayPoints(client.Self.SimPosition, "pharmacy");
                client.Self.Chat("Ok " + im.FromAgentName + ", I'll see what they have in the pharmacy", 0, ChatType.Normal);
                TraverseWayPoints(wayPointList);
                client.Self.Chat("I'm getting drugs for the patient in " + roomName, 0, ChatType.Normal);
                wayPointList = WaypointService.GetWayPoints(client.Self.SimPosition, roomName);
                TraverseWayPoints(wayPointList);
                client.Self.Chat("Here is your morphine.", 0, ChatType.Normal);
            }

            state = States.travelling;
            wayPointList = WaypointService.GetWayPoints(client.Self.SimPosition, "lobby");
            TraverseWayPoints(wayPointList);

            state = States.idle;
        }
开发者ID:SonicZentropy,项目名称:MiscProjects,代码行数:56,代码来源:NurseBot.cs

示例14: Self_OnInstantMessage

 static void Self_OnInstantMessage(InstantMessage im, Simulator simulator)
 {
     if (im.Dialog == InstantMessageDialog.RequestTeleport)
     {
         if (im.FromAgentID == _MasterID)
         {
             _Client.Self.TeleportLureRespond(im.FromAgentID, true);
         }
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:10,代码来源:Program.cs

示例15: Objects_OnObjectProperties

        void Objects_OnObjectProperties(Simulator simulator, Primitive.ObjectProperties properties)
        {
            lock (PrimsWaiting) {
                Primitive prim;
                if (PrimsWaiting.TryGetValue(properties.ObjectID, out prim)) {
                    prim.Properties = properties;
                }
                PrimsWaiting.Remove(properties.ObjectID);

                if (PrimsWaiting.Count == 0)
                    AllPropertiesReceived.Set();
            }
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:13,代码来源:FindObjectsCommand.cs


注:本文中的OpenMetaverse.Simulator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。