Skip to content

Commit

Permalink
Add Experience block to ScriptQuestionPacket
Browse files Browse the repository at this point in the history
  • Loading branch information
cinderblocks committed Jul 25, 2015
1 parent 29c1a37 commit 02f7121
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
45 changes: 45 additions & 0 deletions OpenMetaverse/_Packets_.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32349,16 +32349,56 @@ public override void ToBytes(byte[] bytes, ref int i)

}

/// <exclude/>
public sealed class ExperienceBlock : PacketBlock
{
public UUID ExperienceID;

public override int Length
{
get
{
return 16;
}
}

public ExperienceBlock() { }
public ExperienceBlock(byte[] bytes, ref int i)
{
FromBytes(bytes, ref i);
}

public override void FromBytes(byte[] bytes, ref int i)
{
try
{
ExperienceID.FromBytes(bytes, i); i += 16;
}
catch (Exception)
{
throw new MalformedDataException();
}
}

public override void ToBytes(byte[] bytes, ref int i)
{
ExperienceID.ToBytes(bytes, i); i += 16;
}

}

public override int Length
{
get
{
int length = 10;
length += Data.Length;
length += Experience.Length;
return length;
}
}
public DataBlock Data;
public ExperienceBlock Experience;

public ScriptQuestionPacket()
{
Expand All @@ -32369,6 +32409,7 @@ public ScriptQuestionPacket()
Header.ID = 188;
Header.Reliable = true;
Data = new DataBlock();
Experience = new ExperienceBlock();
}

public ScriptQuestionPacket(byte[] bytes, ref int i) : this()
Expand All @@ -32386,6 +32427,7 @@ override public void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[
bytes = zeroBuffer;
}
Data.FromBytes(bytes, ref i);
Experience.FromBytes(bytes, ref i);
}

public ScriptQuestionPacket(Header head, byte[] bytes, ref int i): this()
Expand All @@ -32398,17 +32440,20 @@ override public void FromBytes(Header header, byte[] bytes, ref int i, ref int p
{
Header = header;
Data.FromBytes(bytes, ref i);
Experience.FromBytes(bytes, ref i);
}

public override byte[] ToBytes()
{
int length = 10;
length += Data.Length;
length += Experience.Length;
if (Header.AckList != null && Header.AckList.Length > 0) { length += Header.AckList.Length * 4 + 1; }
byte[] bytes = new byte[length];
int i = 0;
Header.ToBytes(bytes, ref i);
Data.ToBytes(bytes, ref i);
Experience.ToBytes(bytes, ref i);
if (Header.AckList != null && Header.AckList.Length > 0) { Header.AcksToBytes(bytes, ref i); }
return bytes;
}
Expand Down
4 changes: 4 additions & 0 deletions data/message_template.msg
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4245,6 +4245,10 @@ version 2.0
{ ObjectOwner Variable 1 }
{ Questions S32 }
}
{
Experience Single
{ ExperienceID LLUUID }
}
}

// ScriptControlChange
Expand Down

0 comments on commit 02f7121

Please sign in to comment.