aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/world/Avatar.cs
diff options
context:
space:
mode:
authorMW2007-04-26 12:56:14 +0000
committerMW2007-04-26 12:56:14 +0000
commitc64039363daf90b37ddbeaa95b2516f0020c3f06 (patch)
treeadb7896607eaeb264eecd2718862ec08021a84ff /OpenSim.RegionServer/world/Avatar.cs
parentattempted bug fix (diff)
downloadopensim-SC_OLD-c64039363daf90b37ddbeaa95b2516f0020c3f06.zip
opensim-SC_OLD-c64039363daf90b37ddbeaa95b2516f0020c3f06.tar.gz
opensim-SC_OLD-c64039363daf90b37ddbeaa95b2516f0020c3f06.tar.bz2
opensim-SC_OLD-c64039363daf90b37ddbeaa95b2516f0020c3f06.tar.xz
Mostly working again.
Updated to lastest libsl and handled the changes to the message templates (some byte fields are now ushort fields ). Still seems to be a problem when logging on, in that I get the downloading clothing message at the end of the precaching (which I didn't before)
Diffstat (limited to 'OpenSim.RegionServer/world/Avatar.cs')
-rw-r--r--OpenSim.RegionServer/world/Avatar.cs40
1 files changed, 37 insertions, 3 deletions
diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs
index df7d5ba..917c893 100644
--- a/OpenSim.RegionServer/world/Avatar.cs
+++ b/OpenSim.RegionServer/world/Avatar.cs
@@ -102,7 +102,7 @@ namespace OpenSim.world
102 102
103 public static void SetupTemplate(string name) 103 public static void SetupTemplate(string name)
104 { 104 {
105 int i = 0; 105 int i = 0;
106 FileInfo fInfo = new FileInfo(name); 106 FileInfo fInfo = new FileInfo(name);
107 long numBytes = fInfo.Length; 107 long numBytes = fInfo.Length;
108 FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read); 108 FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read);
@@ -111,8 +111,19 @@ namespace OpenSim.world
111 br.Close(); 111 br.Close();
112 fStream.Close(); 112 fStream.Close();
113 113
114 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); 114 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
115 115
116 SetDefaultPacketValues(objdata);
117 objdata.ObjectData = data1;
118 objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24);
119 objdata.PathCurve = 16;
120 objdata.ProfileCurve = 1;
121 objdata.PathScaleX = 100;
122 objdata.PathScaleY = 100;
123 objdata.ParentID = 0;
124 objdata.OwnerID = LLUUID.Zero;
125 objdata.Scale = new LLVector3(1, 1, 1);
126 objdata.PCode = 47;
116 System.Text.Encoding enc = System.Text.Encoding.ASCII; 127 System.Text.Encoding enc = System.Text.Encoding.ASCII;
117 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16); 128 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
118 pos.X = 100f; 129 pos.X = 100f;
@@ -126,6 +137,29 @@ namespace OpenSim.world
126 Avatar.AvatarTemplate = objdata; 137 Avatar.AvatarTemplate = objdata;
127 } 138 }
128 139
140 protected static void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
141 {
142 objdata.PSBlock = new byte[0];
143 objdata.ExtraParams = new byte[1];
144 objdata.MediaURL = new byte[0];
145 objdata.NameValue = new byte[0];
146 objdata.Text = new byte[0];
147 objdata.TextColor = new byte[4];
148 objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0);
149 objdata.JointPivot = new LLVector3(0, 0, 0);
150 objdata.Material = 4;
151 objdata.TextureAnim = new byte[0];
152 objdata.Sound = LLUUID.Zero;
153 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
154 objdata.TextureEntry = ntex.ToBytes();
155 objdata.State = 0;
156 objdata.Data = new byte[0];
157
158 objdata.ObjectData = new byte[60];
159 objdata.ObjectData[46] = 128;
160 objdata.ObjectData[47] = 63;
161 }
162
129 public void CompleteMovement(World RegionInfo) 163 public void CompleteMovement(World RegionInfo)
130 { 164 {
131 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs:CompleteMovement() - Constructing AgentMovementComplete packet"); 165 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs:CompleteMovement() - Constructing AgentMovementComplete packet");