* Made Packet.TickCount internal

* Added Packet.ResendCount so we can track the number of times a packet is resent (not implemented yet)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1619 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2008-01-12 02:39:17 +00:00
parent bb09afe4ed
commit da540b4a67
5 changed files with 18 additions and 14 deletions

View File

@@ -470,9 +470,9 @@ namespace libsecondlife
return (byte)(200 - (byte)Math.Round(pathScale / SCALE_QUANTA));
}
public static byte PackPathShear(float pathShear)
public static sbyte PackPathShear(float pathShear)
{
return (byte)Math.Round(pathShear / SHEAR_QUANTA);
return (sbyte)Math.Round(pathShear / SHEAR_QUANTA);
}
/// <summary>

View File

@@ -703,8 +703,8 @@ namespace libsecondlife
packet.ObjectData.PathRevolutions = LLObject.PackPathRevolutions(prim.PathRevolutions);
packet.ObjectData.PathScaleX = LLObject.PackPathScale(prim.PathScaleX);
packet.ObjectData.PathScaleY = LLObject.PackPathScale(prim.PathScaleY);
packet.ObjectData.PathShearX = LLObject.PackPathShear(prim.PathShearX);
packet.ObjectData.PathShearY = LLObject.PackPathShear(prim.PathShearY);
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);

View File

@@ -97,10 +97,11 @@ namespace libsecondlife.Packets
public uint Sequence
{
get { return (uint)((Data[1] << 24) + (Data[2] << 16) + (Data[3] << 8) + Data[4]); }
set {
Data[1] = (byte)(value >> 24); Data[2] = (byte)(value >> 16);
Data[3] = (byte)(value >> 8); Data[4] = (byte)(value % 256);
}
set
{
Data[1] = (byte)(value >> 24); Data[2] = (byte)(value >> 16);
Data[3] = (byte)(value >> 8); Data[4] = (byte)(value % 256);
}
}
/// <summary>Numeric ID number of this packet</summary>
public abstract ushort ID { get; set; }
@@ -780,7 +781,8 @@ namespace libsecondlife.Packets
public abstract PacketType Type { get; }
public abstract void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);
public abstract void FromBytes(Header header, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);
public int TickCount;
internal int TickCount;
internal int ResendCount;
public abstract byte[] ToBytes();
public static PacketType GetType(ushort id, PacketFrequency frequency)

View File

@@ -836,7 +836,8 @@ namespace mapgenerator
" public abstract PacketType Type { get; }" + Environment.NewLine +
" public abstract void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);" + Environment.NewLine +
" public abstract void FromBytes(Header header, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer);" + Environment.NewLine +
" public int TickCount;" + Environment.NewLine + Environment.NewLine +
" internal int TickCount;" + Environment.NewLine +
" internal int ResendCount;" + Environment.NewLine + Environment.NewLine +
" public abstract byte[] ToBytes();" //+ Environment.NewLine + Environment.NewLine +
//" public void ToXml(XmlWriter xmlWriter)" + Environment.NewLine +
//" {" + Environment.NewLine +

View File

@@ -97,10 +97,11 @@ namespace libsecondlife.Packets
public uint Sequence
{
get { return (uint)((Data[1] << 24) + (Data[2] << 16) + (Data[3] << 8) + Data[4]); }
set {
Data[1] = (byte)(value >> 24); Data[2] = (byte)(value >> 16);
Data[3] = (byte)(value >> 8); Data[4] = (byte)(value % 256);
}
set
{
Data[1] = (byte)(value >> 24); Data[2] = (byte)(value >> 16);
Data[3] = (byte)(value >> 8); Data[4] = (byte)(value % 256);
}
}
/// <summary>Numeric ID number of this packet</summary>
public abstract ushort ID { get; set; }