/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { LLObject llobj = obj as LLObject; if (llobj == null) { return(false); } return(ID.Equals(llobj.ID)); }
void Avatars_OnAvatarAppearance(LLUUID avatarID, bool isTrial, LLObject.TextureEntryFace defaultTexture, LLObject.TextureEntryFace[] faceTextures, System.Collections.Generic.List<byte> visualParams) { if (IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.EyesBaked]) && IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.HeadBaked]) && IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.LowerBaked]) && IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.SkirtBaked]) && IsNullOrZero(faceTextures[(int)AppearanceManager.TextureIndex.UpperBaked])) { Console.WriteLine("Avatar " + avatarID.ToString() + " may be a bot"); } }
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(); } }
public bool TryGetValue(uint objectLocalID, out LLObject obj) { Avatar avatar; Primitive prim; if (Avatars.TryGetValue(objectLocalID, out avatar)) { obj = avatar; return(true); } if (Prims.TryGetValue(objectLocalID, out prim)) { obj = prim; return(true); } obj = null; return(false); }
public bool TryGetValue(uint objectLocalID, out LLObject obj) { Avatar avatar; Primitive prim; if (Avatars.TryGetValue(objectLocalID, out avatar)) { obj = avatar; return true; } if (Prims.TryGetValue(objectLocalID, out prim)) { obj = prim; return true; } obj = null; return false; }
private bool IsNullOrZero(LLObject.TextureEntryFace face) { return (face == null || face.TextureID == LLUUID.Zero); }
void Objects_OnObjectProperties(Simulator simulator, LLObject.ObjectProperties properties) { lock (PrimsWaiting) { PrimsWaiting.Remove(properties.ObjectID); if (PrimsWaiting.Count == 0) AllPropertiesReceived.Set(); } }
void Objects_OnObjectPropertiesFamily(Simulator simulator, LLObject.ObjectPropertiesFamily properties) { Properties = properties; GotPermissions = true; GotPermissionsEvent.Set(); }
/// <summary> /// Set the textures to apply to the faces of an object /// </summary> /// <param name="simulator">A reference to the <seealso cref="libsecondlife.Simulator"/> object where the object resides</param> /// <param name="localID">The objects ID which is local to the simulator the object is in</param> /// <param name="textures">The texture data to apply</param> /// <param name="mediaUrl">A media URL (not used)</param> public void SetTextures(Simulator simulator, uint localID, LLObject.TextureEntry textures, string mediaUrl) { ObjectImagePacket image = new ObjectImagePacket(); image.AgentData.AgentID = Client.Self.AgentID; image.AgentData.SessionID = Client.Self.SessionID; image.ObjectData = new ObjectImagePacket.ObjectDataBlock[1]; image.ObjectData[0] = new ObjectImagePacket.ObjectDataBlock(); image.ObjectData[0].ObjectLocalID = localID; image.ObjectData[0].TextureEntry = textures.ToBytes(); image.ObjectData[0].MediaURL = Helpers.StringToField(mediaUrl); Client.Network.SendPacket(image, simulator); }
/// <summary> /// Set the textures to apply to the faces of an object /// </summary> /// <param name="simulator">A reference to the <seealso cref="libsecondlife.Simulator"/> object where the object resides</param> /// <param name="localID">The objects ID which is local to the simulator the object is in</param> /// <param name="textures">The texture data to apply</param> public void SetTextures(Simulator simulator, uint localID, LLObject.TextureEntry textures) { SetTextures(simulator, localID, textures, String.Empty); }
/// <summary> /// Create, or "rez" a new prim object in a simulator /// </summary> /// <param name="simulator">A reference to the <seealso cref="libsecondlife.Simulator"/> object to place the object in</param> /// <param name="prim">Data describing the prim object to rez</param> /// <param name="groupID">Group ID that this prim will be set to, or LLUUID.Zero if you /// do not want the object to be associated with a specific group</param> /// <param name="position">An approximation of the position at which to rez the prim</param> /// <param name="scale">Scale vector to size this prim</param> /// <param name="rotation">Rotation quaternion to rotate this prim</param> /// <remarks>Due to the way client prim rezzing is done on the server, /// the requested position for an object is only close to where the prim /// actually ends up. If you desire exact placement you'll need to /// follow up by moving the object after it has been created. This /// function will not set textures, light and flexible data, or other /// extended primitive properties</remarks> public void AddPrim(Simulator simulator, LLObject.ObjectData prim, LLUUID groupID, LLVector3 position, LLVector3 scale, LLQuaternion rotation) { ObjectAddPacket packet = new ObjectAddPacket(); packet.AgentData.AgentID = Client.Self.AgentID; packet.AgentData.SessionID = Client.Self.SessionID; packet.AgentData.GroupID = groupID; packet.ObjectData.State = prim.State; packet.ObjectData.AddFlags = (uint)LLObject.ObjectFlags.CreateSelected; packet.ObjectData.PCode = (byte)PCode.Prim; packet.ObjectData.Material = (byte)prim.Material; packet.ObjectData.Scale = scale; packet.ObjectData.Rotation = rotation; packet.ObjectData.PathCurve = (byte)prim.PathCurve; packet.ObjectData.PathBegin = LLObject.PackBeginCut(prim.PathBegin); packet.ObjectData.PathEnd = LLObject.PackEndCut(prim.PathEnd); packet.ObjectData.PathRadiusOffset = LLObject.PackPathTwist(prim.PathRadiusOffset); packet.ObjectData.PathRevolutions = LLObject.PackPathRevolutions(prim.PathRevolutions); packet.ObjectData.PathScaleX = LLObject.PackPathScale(prim.PathScaleX); packet.ObjectData.PathScaleY = LLObject.PackPathScale(prim.PathScaleY); packet.ObjectData.PathShearX = (byte)LLObject.PackPathShear(prim.PathShearX); packet.ObjectData.PathShearY = (byte)LLObject.PackPathShear(prim.PathShearY); packet.ObjectData.PathSkew = LLObject.PackPathTwist(prim.PathSkew); packet.ObjectData.PathTaperX = LLObject.PackPathTaper(prim.PathTaperX); packet.ObjectData.PathTaperY = LLObject.PackPathTaper(prim.PathTaperY); packet.ObjectData.PathTwist = LLObject.PackPathTwist(prim.PathTwist); packet.ObjectData.PathTwistBegin = LLObject.PackPathTwist(prim.PathTwistBegin); packet.ObjectData.ProfileCurve = prim.profileCurve; packet.ObjectData.ProfileBegin = LLObject.PackBeginCut(prim.ProfileBegin); packet.ObjectData.ProfileEnd = LLObject.PackEndCut(prim.ProfileEnd); packet.ObjectData.ProfileHollow = LLObject.PackProfileHollow(prim.ProfileHollow); packet.ObjectData.RayStart = position; packet.ObjectData.RayEnd = position; packet.ObjectData.RayEndIsIntersection = 0; packet.ObjectData.RayTargetID = LLUUID.Zero; packet.ObjectData.BypassRaycast = 1; Client.Network.SendPacket(packet, simulator); }
/// <summary> /// /// </summary> /// <param name="sim"></param> /// <param name="props"></param> protected void FireOnObjectPropertiesFamily(Simulator sim, LLObject.ObjectPropertiesFamily props) { if (OnObjectPropertiesFamily != null) { try { OnObjectPropertiesFamily(sim, props); } catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); } } }
/// <summary> /// /// </summary> /// <param name="sim"></param> /// <param name="props"></param> protected void FireOnObjectPropertiesFamily(Simulator sim, LLObject.ObjectPropertiesFamily props) { if (OnObjectPropertiesFamily != null) { try { OnObjectPropertiesFamily(sim, props); } catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); } } }
/// <summary> /// Used to flag to a subclass that an LLObject was updated/created /// </summary> /// <param name="simulator"></param> /// <param name="obj"></param> virtual protected void llObjectUpdated(Simulator simulator, LLObject obj) { }
private void Objects_OnObjectPropertiesFamily(Simulator simulator, LLObject.ObjectPropertiesFamily properties) { if (properties.ObjectID != prim.ID) return; gettingProperties = false; gotProperties = true; prim.PropertiesFamily = properties; listBox.BeginInvoke( new OnPropReceivedRaise(OnPropertiesReceived), new object[] { EventArgs.Empty }); }