diff options
author | MW | 2007-04-26 12:56:14 +0000 |
---|---|---|
committer | MW | 2007-04-26 12:56:14 +0000 |
commit | c64039363daf90b37ddbeaa95b2516f0020c3f06 (patch) | |
tree | adb7896607eaeb264eecd2718862ec08021a84ff /OpenSim.RegionServer | |
parent | attempted bug fix (diff) | |
download | opensim-SC-c64039363daf90b37ddbeaa95b2516f0020c3f06.zip opensim-SC-c64039363daf90b37ddbeaa95b2516f0020c3f06.tar.gz opensim-SC-c64039363daf90b37ddbeaa95b2516f0020c3f06.tar.bz2 opensim-SC-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 '')
-rw-r--r-- | OpenSim.RegionServer/world/Avatar.cs | 40 | ||||
-rw-r--r-- | OpenSim.RegionServer/world/AvatarUpdate.cs | 3 | ||||
-rw-r--r-- | OpenSim.RegionServer/world/World.cs | 2 |
3 files changed, 39 insertions, 6 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"); |
diff --git a/OpenSim.RegionServer/world/AvatarUpdate.cs b/OpenSim.RegionServer/world/AvatarUpdate.cs index 34d032c..ba2965d 100644 --- a/OpenSim.RegionServer/world/AvatarUpdate.cs +++ b/OpenSim.RegionServer/world/AvatarUpdate.cs | |||
@@ -124,9 +124,9 @@ namespace OpenSim.world | |||
124 | objupdate.RegionData.RegionHandle = m_regionHandle; | 124 | objupdate.RegionData.RegionHandle = m_regionHandle; |
125 | objupdate.RegionData.TimeDilation = 64096; | 125 | objupdate.RegionData.TimeDilation = 64096; |
126 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; | 126 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; |
127 | |||
128 | objupdate.ObjectData[0] = AvatarTemplate; | 127 | objupdate.ObjectData[0] = AvatarTemplate; |
129 | //give this avatar object a local id and assign the user a name | 128 | //give this avatar object a local id and assign the user a name |
129 | |||
130 | objupdate.ObjectData[0].ID = this.localid; | 130 | objupdate.ObjectData[0].ID = this.localid; |
131 | this.uuid = objupdate.ObjectData[0].FullID = ControllingClient.AgentID; | 131 | this.uuid = objupdate.ObjectData[0].FullID = ControllingClient.AgentID; |
132 | objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0"); | 132 | objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstname + "\nLastName STRING RW SV " + lastname + " \0"); |
@@ -134,7 +134,6 @@ namespace OpenSim.world | |||
134 | byte[] pb = pos2.GetBytes(); | 134 | byte[] pb = pos2.GetBytes(); |
135 | Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); | 135 | Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); |
136 | m_world._localNumber++; | 136 | m_world._localNumber++; |
137 | |||
138 | foreach (SimClient client in m_clientThreads.Values) | 137 | foreach (SimClient client in m_clientThreads.Values) |
139 | { | 138 | { |
140 | client.OutPacket(objupdate); | 139 | client.OutPacket(objupdate); |
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs index 5bada2b..0e5dbf0 100644 --- a/OpenSim.RegionServer/world/World.cs +++ b/OpenSim.RegionServer/world/World.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.world | |||
70 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); | 70 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); |
71 | TerrainManager = new TerrainManager(new SecondLife()); | 71 | TerrainManager = new TerrainManager(new SecondLife()); |
72 | Terrain = new TerrainEngine(); | 72 | Terrain = new TerrainEngine(); |
73 | Avatar.SetupTemplate("avatar-template.dat"); | 73 | Avatar.SetupTemplate("avatar-template2.dat"); |
74 | // MainConsole.Instance.WriteLine("World.cs - Creating script engine instance"); | 74 | // MainConsole.Instance.WriteLine("World.cs - Creating script engine instance"); |
75 | // Initialise this only after the world has loaded | 75 | // Initialise this only after the world has loaded |
76 | // Scripts = new ScriptEngine(this); | 76 | // Scripts = new ScriptEngine(this); |