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


C# libsecondlife.Simulator类代码示例

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


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

示例1: ObjectAddHandler

        public void ObjectAddHandler(Packet packet, Simulator simulator)
        {
            LLVector3 position = null;

            if (WaitingOnUpdate)
            {
                CurrentPrimMutex.WaitOne();

                foreach (Block block in packet.Blocks())
                {
                    foreach (Field field in block.Fields)
                    {
                        if (field.Layout.Name == "RayEnd")
                        {
                            position = (LLVector3)field.Data;
                        }
                    }
                }

                txtLog.AppendText("Received an ObjectAdd, setting CurrentPrim position to " + position.ToString());
                CurrentPrim.Position = position;

                CurrentPrimMutex.ReleaseMutex();
            }
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:25,代码来源:frmPrimImporter.cs

示例2: 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:RavenB,项目名称:gridsearch,代码行数:12,代码来源:Caps.cs

示例3: AttachedSoundHandler

 protected void AttachedSoundHandler(Packet packet, Simulator simulator)
 {
     AttachedSoundPacket sound = (AttachedSoundPacket)packet;
     if (OnAttachSound != null)
     {
         try { OnAttachSound(sound.DataBlock.SoundID, sound.DataBlock.OwnerID, sound.DataBlock.ObjectID, sound.DataBlock.Gain, sound.DataBlock.Flags); }
         catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:9,代码来源:SoundManager.cs

示例4: AttachedSoundGainChangeHandler

 protected void AttachedSoundGainChangeHandler(Packet packet, Simulator simulator)
 {
     AttachedSoundGainChangePacket change = (AttachedSoundGainChangePacket)packet;
     if (OnAttachSoundGainChange != null)
     {
         try { OnAttachSoundGainChange(change.DataBlock.ObjectID, change.DataBlock.Gain); }
         catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:9,代码来源:SoundManager.cs

示例5: 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

示例6: Network_OnEventQueueRunning

        void Network_OnEventQueueRunning(Simulator simulator)
        {
            if (simulator == Client.Network.CurrentSim)
            {
                Console.WriteLine("Event queue connected for the primary simulator, requesting group info");

                Client.Groups.RequestCurrentGroups();
            }
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:9,代码来源:frmGroupManager.cs

示例7: Objects_OnObjectProperties

        void Objects_OnObjectProperties(Simulator simulator, LLObject.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

示例8: PreloadSoundHandler

 protected void PreloadSoundHandler(Packet packet, Simulator simulator)
 {
     PreloadSoundPacket preload = (PreloadSoundPacket)packet;
     if (OnPreloadSound != null)
     {
         foreach (PreloadSoundPacket.DataBlockBlock data in preload.DataBlock)
         {
             try
             {
                 OnPreloadSound(data.SoundID, data.OwnerID, data.ObjectID);
             }
             catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
         }
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:15,代码来源:SoundManager.cs

示例9: OnPacket

 private void OnPacket(Packet packet, Simulator simulator)
 {
     lock (Packets)
     {
         if (Count >= Total)
         {
             Done = true;
         }
         else
         {
             Packets.Add(packet);
             Count++;
         }
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:15,代码来源:PacketLogCommand.cs

示例10: AvatarAppearanceHandler

        private void AvatarAppearanceHandler(Packet packet, Simulator simulator)
        {
            AvatarAppearancePacket appearance = (AvatarAppearancePacket)packet;

            LLObject.TextureEntry te = new LLObject.TextureEntry(appearance.ObjectData.TextureEntry, 0, 
                appearance.ObjectData.TextureEntry.Length);

            if (IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.EyesBaked] ) &&
                IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.HeadBaked]) &&
                IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.LowerBaked]) &&
                IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.SkirtBaked]) &&
                IsNullOrZero(te.FaceTextures[(int)AppearanceManager.TextureIndex.UpperBaked]))
            {
                Console.WriteLine("Avatar " + appearance.Sender.ID.ToString() + " may be a bot");
            }
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:16,代码来源:DetectBotCommand.cs

示例11: Objects_OnNewAvatar

        private void Objects_OnNewAvatar(Simulator simulator, Avatar avatar, ulong regionHandle, ushort timeDilation)
        {
            if (imgManager == null)
            {
                Console.WriteLine("ImageManager not ready yet, queueing Avatar textures.");
                TextureQueue.Enqueue(avatar.FirstLifeImage);
                TextureQueue.Enqueue(avatar.ProfileImage);

                foreach (TextureEntryFace tef in avatar.Textures.FaceTextures.Values)
                {
                    TextureQueue.Enqueue(tef.TextureID);
                }
            }
            else
            {
                if (avatar.FirstLifeImage != null)
                {
                    if (imgManager.isCachedImage(avatar.FirstLifeImage) == false)
                    {
                        imgManager.RequestImageAsync(avatar.FirstLifeImage);
                    }
                }

                if (avatar.ProfileImage != null)
                {
                    if (imgManager.isCachedImage(avatar.FirstLifeImage) == false)
                    {
                        imgManager.RequestImageAsync(avatar.ProfileImage);
                    }
                }

                if (avatar.Textures != null)
                {
                    foreach (TextureEntryFace tef in avatar.Textures.FaceTextures.Values)
                    {
                        if (imgManager.isCachedImage(tef.TextureID) == false)
                        {
                            imgManager.RequestImageAsync(tef.TextureID);
                        }
                        else
                        {
                            Console.WriteLine("Already cached: " + tef.TextureID);
                        }
                    }
                }
            }
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:47,代码来源:IA_TestAsyncImage.cs

示例12: Parcels_OnParcelsDownloaded

        void Parcels_OnParcelsDownloaded(Simulator simulator, Dictionary<int, Parcel> Parcels, int[,] map)
        {
            foreach (KeyValuePair<int, Parcel> parcel in Parcels)
            {
                WaterType type = ParcelDownloader.GetWaterType(map, parcel.Value.LocalID);
                float delta = ParcelDownloader.GetHeightRange(map, parcel.Value.LocalID);
                int deviation = ParcelDownloader.GetRectangularDeviation(parcel.Value.AABBMin, parcel.Value.AABBMax, 
                    parcel.Value.Area);

                Console.WriteLine("Parcels[{0}]: Name: \"{1}\", Description: \"{2}\" ACL Count: {3}, " +
                    "Location: {4}, Height Range: {5}, Shape Deviation: {6}", parcel.Key, parcel.Value.Name, 
                    parcel.Value.Desc, parcel.Value.AccessList.Count, type.ToString(), delta, deviation);
            }

            ParcelCount = Parcels.Count;
            ParcelsDownloaded.Set();
        }
开发者ID:Belxjander,项目名称:Asuna,代码行数:17,代码来源:ParcelInfoCommand.cs

示例13: ObjectUpdateHandler

        public void ObjectUpdateHandler(Packet packet, Simulator simulator)
        {
            uint id = 0;
            LLUUID uuid = null;

            if (WaitingOnUpdate)
            {
                CurrentPrimMutex.WaitOne();

                foreach (Block block in packet.Blocks())
                {
                    foreach (Field field in block.Fields)
                    {
                        if (field.Layout.Name == "ID")
                        {
                            id = (uint)field.Data;
                        }
                        else if (field.Layout.Name == "FullID")
                        {
                            uuid = (LLUUID)field.Data;
                        }
                        else if (field.Layout.Name == "ObjectData")
                        {
                            byte[] byteArray = (byte[])field.Data;
                            LLVector3 position = new LLVector3(byteArray, 0);
                            if (CurrentPrim != null && position != CurrentPrim.Position)
                            {
                                txtLog.AppendText(position.ToString() + " doesn't match CurrentPrim.Position " +
                                    CurrentPrim.Position.ToString() + "\n"/* + ", ignoring"*/);
                                //return;
                            }
                        }
                    }
                }

                CurrentPrim.ID = id;
                CurrentPrim.UUID = uuid;

                WaitingOnUpdate = false;

                CurrentPrimMutex.ReleaseMutex();
            }
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:43,代码来源:frmPrimImporter.cs

示例14: QueryHandler

        public static void QueryHandler(Packet packet, Simulator simulator)
        {
            DirPeopleReplyPacket reply = (DirPeopleReplyPacket)packet;

            if (reply.QueryReplies.Length < 1)
            {
                Console.WriteLine("ERROR: Got an empty reply");
            }
            else
            {
                if (reply.QueryReplies.Length > 1)
                {
                    Console.WriteLine("ERROR: Ambiguous name. Returning first match");
                }

                Console.WriteLine("UUID: " + reply.QueryReplies[0].AgentID.ToString());
            }

            waiting = false;
        }
开发者ID:BackupTheBerlios,项目名称:libsecondlife-svn,代码行数:20,代码来源:name2key.cs

示例15: RaiseEvent

        /// <summary>
        /// Fire the events registered for this packet type synchronously
        /// </summary>
        /// <param name="packetType">Incoming packet type</param>
        /// <param name="packet">Incoming packet</param>
        /// <param name="simulator">Simulator this packet was received from</param>
        internal void RaiseEvent(PacketType packetType, Packet packet, Simulator simulator)
        {
            NetworkManager.PacketCallback callback;

            if (_EventTable.TryGetValue(packetType, out callback))
            {
                try
                {
                    callback(packet, simulator);
                }
                catch (Exception ex)
                {
                    Client.Log("Packet Event Handler: " + ex.ToString(), Helpers.LogLevel.Error);
                }
            }
            else if (packetType != PacketType.Default && packetType != PacketType.PacketAck)
            {
                Client.Log("No handler registered for packet event " + packetType, Helpers.LogLevel.Debug);
            }
        }
开发者ID:Belxjander,项目名称:Asuna,代码行数:26,代码来源:EventDictionary.cs


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