* Sanity check for ObjectAdd

* Renamed and attempted to fix the Say/Shout functions

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@64 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2006-07-18 02:54:13 +00:00
parent a9352ceed6
commit 53a2cfdfd8
3 changed files with 86 additions and 9 deletions

View File

@@ -312,24 +312,24 @@ namespace libsecondlife
Client.Network.SendPacket(packet);
}
public void Chat(string message, byte type)
public void Say(string message, int channel)
{
LLUUID CommandID = new LLUUID();
LLVector3 Position = new LLVector3(0.0F,0.0F,0.0F);
Packet packet = Packets.Communication.ChatFromViewer(Client.Protocol, Client.Avatar.ID, Client.Network.SessionID,
message, type, 0, 0, CommandID, 20, Position);
message, (byte)1, channel, 0, CommandID, 20, Position);
Client.Network.SendPacket(packet);
}
public void Shout(string message)
public void Shout(string message, int channel)
{
LLUUID CommandID = new LLUUID();
LLVector3 Position = new LLVector3(0.0F,0.0F,0.0F);
Packet packet = Packets.Communication.ChatFromViewer(Client.Protocol,Client.Avatar.ID,Client.Network.SessionID,
message, 0, 0, 0, CommandID,100,Position);
message, (byte)2, channel, 0, CommandID, 100, Position);
Client.Network.SendPacket(packet);
}

View File

@@ -35,8 +35,8 @@ namespace libsecondlife
public float ProfileBegin = 0;
public float PathRadiusOffset = 0;
public float PathSkew = 0;
public LLVector3 RayStart = new LLVector3();
public int ProfileCurve = 0;
public LLVector3 Position = new LLVector3();
public uint ProfileCurve = 0;
public float PathScaleX = 0;
public float PathScaleY = 0;
public LLUUID UUID = new LLUUID();
@@ -58,6 +58,7 @@ namespace libsecondlife
public uint ProfileHollow = 0;
public float PathRevolutions = 0;
public LLQuaternion Rotation = new LLQuaternion();
public uint State;
public PrimObject(LLUUID texture)
{
@@ -88,13 +89,13 @@ namespace libsecondlife
public static byte ProfileBeginByte(float profileBegin)
{
// Y = ceil (200X)
return (byte)Convert.ToInt16(Math.Ceiling(200.0F * profileBegin));
return (byte)Convert.ToInt16(200.0F * profileBegin);
}
public static byte ProfileEndByte(float profileEnd)
{
// Y = 200 - ceil (200X)
return (byte)(200 - (int)ProfileBeginByte(profileEnd));
// Y = 200 - ceil (200X)
return (byte)(200 - (200.0F * profileEnd));
}
public static byte PathBeginByte(float pathBegin)

View File

@@ -393,6 +393,82 @@ namespace libsecondlife
{
return X.ToString() + " " + Y.ToString() + " " + Z.ToString();
}
public override int GetHashCode()
{
int x = (int)X;
int y = (int)Y;
int z = (int)Z;
return (x ^ y ^ z);
}
public override bool Equals(object o)
{
if (!(o is LLVector3))
{
return false;
}
LLVector3 vector = (LLVector3)o;
if (X == vector.X && Y == vector.Y && Z == vector.Z)
{
return true;
}
else
{
return false;
}
}
public static bool operator==(LLVector3 lhs, LLVector3 rhs)
{
try
{
if (lhs.X == rhs.X && lhs.Y == rhs.Y && lhs.Z == rhs.Z)
{
return true;
}
else
{
return false;
}
}
catch (NullReferenceException)
{
float test;
bool lhsnull = false;
bool rhsnull = false;
try
{
test = lhs.X;
}
catch (NullReferenceException)
{
lhsnull = true;
}
try
{
test = rhs.X;
}
catch (NullReferenceException)
{
rhsnull = true;
}
return (lhsnull == rhsnull);
}
return false;
}
public static bool operator!=(LLVector3 lhs, LLVector3 rhs)
{
return !(lhs == rhs);
}
}
public class LLVector3d