diff options
author | MW | 2007-06-15 13:11:26 +0000 |
---|---|---|
committer | MW | 2007-06-15 13:11:26 +0000 |
commit | 95676b298819d6b2d1df74d1f52668e2549a2c2f (patch) | |
tree | e3152f0685f262253e72a482a4a3e4b64aae631a | |
parent | and some more (diff) | |
download | opensim-SC_OLD-95676b298819d6b2d1df74d1f52668e2549a2c2f.zip opensim-SC_OLD-95676b298819d6b2d1df74d1f52668e2549a2c2f.tar.gz opensim-SC_OLD-95676b298819d6b2d1df74d1f52668e2549a2c2f.tar.bz2 opensim-SC_OLD-95676b298819d6b2d1df74d1f52668e2549a2c2f.tar.xz |
Preliminary movement added to sugilite, forwards walking only and no animations.
-rw-r--r-- | Common/OpenSim.Framework/Interfaces/IClientAPI.cs | 7 | ||||
-rw-r--r-- | OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs | 27 | ||||
-rw-r--r-- | OpenSim/OpenSim.Region/Scenes/Avatar.cs | 102 | ||||
-rw-r--r-- | OpenSim/OpenSim.Region/Scenes/Scene.cs | 8 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/ClientStackNetworkHandler.cs (renamed from OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs) | 2 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/ClientView.API.cs | 99 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs | 3 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj | 11 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build | 5 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/PacketServer.cs | 4 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/RegionApplicationBase.cs (renamed from OpenSim/OpenSim.RegionServer/RegionServerBase.cs) | 6 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/UDPServer.cs | 2 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/UserConfigUtility.cs | 37 | ||||
-rw-r--r-- | OpenSim/OpenSim/OpenSimMain.cs | 2 |
14 files changed, 220 insertions, 95 deletions
diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs index feccf36..cebfd9a 100644 --- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs +++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs | |||
@@ -55,6 +55,7 @@ namespace OpenSim.Framework.Interfaces | |||
55 | public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); | 55 | public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); |
56 | public delegate void StatusChange(bool status); | 56 | public delegate void StatusChange(bool status); |
57 | public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); | 57 | public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); |
58 | public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); | ||
58 | 59 | ||
59 | public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); | 60 | public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); |
60 | public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); | 61 | public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); |
@@ -75,7 +76,7 @@ namespace OpenSim.Framework.Interfaces | |||
75 | event GenericCall OnRegionHandShakeReply; | 76 | event GenericCall OnRegionHandShakeReply; |
76 | event GenericCall OnRequestWearables; | 77 | event GenericCall OnRequestWearables; |
77 | event GenericCall2 OnCompleteMovementToRegion; | 78 | event GenericCall2 OnCompleteMovementToRegion; |
78 | event GenericCall3 OnAgentUpdate; | 79 | event UpdateAgent OnAgentUpdate; |
79 | event GenericCall OnRequestAvatarsData; | 80 | event GenericCall OnRequestAvatarsData; |
80 | event GenericCall4 OnAddPrim; | 81 | event GenericCall4 OnAddPrim; |
81 | event UpdateShape OnUpdatePrimShape; | 82 | event UpdateShape OnUpdatePrimShape; |
@@ -125,10 +126,12 @@ namespace OpenSim.Framework.Interfaces | |||
125 | void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | 126 | void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); |
126 | void SendLayerData(float[] map); | 127 | void SendLayerData(float[] map); |
127 | void MoveAgentIntoRegion(RegionInfo regInfo); | 128 | void MoveAgentIntoRegion(RegionInfo regInfo); |
128 | void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos); | ||
129 | void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort); | 129 | void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort); |
130 | AgentCircuitData RequestClientInfo(); | 130 | AgentCircuitData RequestClientInfo(); |
131 | 131 | ||
132 | void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos); | ||
133 | void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); | ||
134 | |||
132 | void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); | 135 | void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); |
133 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID); | 136 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID); |
134 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID); | 137 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID); |
diff --git a/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs b/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs index d5c25f3..3f87e10 100644 --- a/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs +++ b/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs | |||
@@ -36,14 +36,26 @@ using OpenSim.Framework.Interfaces; | |||
36 | namespace OpenSim.Region.Scenes | 36 | namespace OpenSim.Region.Scenes |
37 | { | 37 | { |
38 | partial class Avatar | 38 | partial class Avatar |
39 | { | 39 | { |
40 | /// <summary> | 40 | /// <summary> |
41 | /// | 41 | /// |
42 | /// </summary> | 42 | /// </summary> |
43 | public override void update() | 43 | public override void update() |
44 | { | 44 | { |
45 | 45 | if (this.newForce) | |
46 | 46 | { | |
47 | this.SendTerseUpdateToALLClients(); | ||
48 | _updateCount = 0; | ||
49 | } | ||
50 | else if (movementflag != 0) | ||
51 | { | ||
52 | _updateCount++; | ||
53 | if (_updateCount > 3) | ||
54 | { | ||
55 | this.SendTerseUpdateToALLClients(); | ||
56 | _updateCount = 0; | ||
57 | } | ||
58 | } | ||
47 | } | 59 | } |
48 | 60 | ||
49 | /// <summary> | 61 | /// <summary> |
@@ -117,15 +129,6 @@ namespace OpenSim.Region.Scenes | |||
117 | } | 129 | } |
118 | 130 | ||
119 | /// <summary> | 131 | /// <summary> |
120 | /// Very likely to be deleted soon! | ||
121 | /// </summary> | ||
122 | /// <returns></returns> | ||
123 | public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock() | ||
124 | { | ||
125 | return null; | ||
126 | } | ||
127 | |||
128 | /// <summary> | ||
129 | /// | 132 | /// |
130 | /// </summary> | 133 | /// </summary> |
131 | /// <param name="animID"></param> | 134 | /// <param name="animID"></param> |
diff --git a/OpenSim/OpenSim.Region/Scenes/Avatar.cs b/OpenSim/OpenSim.Region/Scenes/Avatar.cs index 6ae4319..17b2437 100644 --- a/OpenSim/OpenSim.Region/Scenes/Avatar.cs +++ b/OpenSim/OpenSim.Region/Scenes/Avatar.cs | |||
@@ -61,6 +61,7 @@ namespace OpenSim.Region.Scenes | |||
61 | private ulong m_regionHandle; | 61 | private ulong m_regionHandle; |
62 | private Dictionary<uint, IClientAPI> m_clientThreads; | 62 | private Dictionary<uint, IClientAPI> m_clientThreads; |
63 | private bool childAvatar = false; | 63 | private bool childAvatar = false; |
64 | private bool newForce = false; | ||
64 | 65 | ||
65 | protected RegionInfo m_regionInfo; | 66 | protected RegionInfo m_regionInfo; |
66 | /// <summary> | 67 | /// <summary> |
@@ -78,6 +79,7 @@ namespace OpenSim.Region.Scenes | |||
78 | this.uuid = theClient.AgentId; | 79 | this.uuid = theClient.AgentId; |
79 | 80 | ||
80 | m_regionInfo = reginfo; | 81 | m_regionInfo = reginfo; |
82 | m_regionHandle = reginfo.RegionHandle; | ||
81 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Avatar.cs - Loading details from grid (DUMMY)"); | 83 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Avatar.cs - Loading details from grid (DUMMY)"); |
82 | ControllingClient = theClient; | 84 | ControllingClient = theClient; |
83 | this.firstname = ControllingClient.FirstName; | 85 | this.firstname = ControllingClient.FirstName; |
@@ -99,8 +101,8 @@ namespace OpenSim.Region.Scenes | |||
99 | //ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance); | 101 | //ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance); |
100 | ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.CompleteMovement); | 102 | ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.CompleteMovement); |
101 | ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.SendInitialPosition); | 103 | ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.SendInitialPosition); |
102 | /* ControllingClient.OnAgentUpdate += new GenericCall3(this.HandleAgentUpdate); | 104 | ControllingClient.OnAgentUpdate += new UpdateAgent(this.HandleAgentUpdate); |
103 | ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); | 105 | /* ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); |
104 | ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); | 106 | ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); |
105 | ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); | 107 | ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); |
106 | */ | 108 | */ |
@@ -135,31 +137,51 @@ namespace OpenSim.Region.Scenes | |||
135 | /// </summary> | 137 | /// </summary> |
136 | public override void addForces() | 138 | public override void addForces() |
137 | { | 139 | { |
138 | 140 | lock (this.forcesList) | |
141 | { | ||
142 | newForce = false; | ||
143 | if (this.forcesList.Count > 0) | ||
144 | { | ||
145 | for (int i = 0; i < this.forcesList.Count; i++) | ||
146 | { | ||
147 | NewForce force = this.forcesList[i]; | ||
148 | PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z); | ||
149 | lock (m_world.SyncRoot) | ||
150 | { | ||
151 | this._physActor.Velocity = phyVector; | ||
152 | } | ||
153 | this.updateflag = true; | ||
154 | this.velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this | ||
155 | // but as we are setting the velocity (rather than using real forces) at the moment it is okay. | ||
156 | this.newForce = true; | ||
157 | } | ||
158 | for (int i = 0; i < this.forcesList.Count; i++) | ||
159 | { | ||
160 | this.forcesList.RemoveAt(0); | ||
161 | } | ||
162 | } | ||
163 | } | ||
139 | } | 164 | } |
140 | 165 | ||
141 | /// <summary> | 166 | public void SendTerseUpdateToClient(IClientAPI RemoteClient) |
142 | /// likely to removed very soon | ||
143 | /// </summary> | ||
144 | /// <param name="name"></param> | ||
145 | public static void SetupTemplate(string name) | ||
146 | { | 167 | { |
147 | 168 | RemoteClient.SendAvatarTerseUpdate(this.m_regionHandle, 64096, this.localid, new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z), new LLVector3(this._physActor.Velocity.X, this._physActor.Velocity.Y, this._physActor.Velocity.Z)); | |
148 | } | 169 | } |
149 | 170 | ||
150 | /// <summary> | 171 | /// <summary> |
151 | /// likely to removed very soon | 172 | /// |
152 | /// </summary> | 173 | /// </summary> |
153 | /// <param name="objdata"></param> | 174 | public void SendTerseUpdateToALLClients() |
154 | protected static void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata) | ||
155 | { | 175 | { |
156 | 176 | List<Avatar> avatars = this.m_world.RequestAvatarList(); | |
157 | 177 | for (int i = 0; i < avatars.Count; i++) | |
158 | 178 | { | |
179 | this.SendTerseUpdateToClient(avatars[i].ControllingClient); | ||
180 | } | ||
159 | } | 181 | } |
160 | 182 | ||
161 | /// <summary> | 183 | /// <summary> |
162 | /// | 184 | /// Complete Avatar's movement into the region |
163 | /// </summary> | 185 | /// </summary> |
164 | public void CompleteMovement() | 186 | public void CompleteMovement() |
165 | { | 187 | { |
@@ -187,9 +209,55 @@ namespace OpenSim.Region.Scenes | |||
187 | /// <summary> | 209 | /// <summary> |
188 | /// | 210 | /// |
189 | /// </summary> | 211 | /// </summary> |
190 | public void SendRegionHandshake() | 212 | /// <param name="pack"></param> |
213 | public void HandleAgentUpdate(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation) | ||
191 | { | 214 | { |
192 | 215 | ||
216 | if ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS) != 0) | ||
217 | { | ||
218 | Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); | ||
219 | if (((movementflag & 1) == 0) || (q != this.bodyRot)) | ||
220 | { | ||
221 | //we should add a new force to the list | ||
222 | // but for now we will deal with velocities | ||
223 | NewForce newVelocity = new NewForce(); | ||
224 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0); | ||
225 | Axiom.MathLib.Vector3 direc = q * v3; | ||
226 | direc.Normalize(); | ||
227 | |||
228 | //work out velocity for sim physics system | ||
229 | direc = direc * ((0.03f) * 128f); | ||
230 | if (this._physActor.Flying) | ||
231 | direc *= 4; | ||
232 | |||
233 | newVelocity.X = direc.x; | ||
234 | newVelocity.Y = direc.y; | ||
235 | newVelocity.Z = direc.z; | ||
236 | this.forcesList.Add(newVelocity); | ||
237 | movementflag = 1; | ||
238 | this.bodyRot = q; | ||
239 | } | ||
240 | } | ||
241 | else | ||
242 | { | ||
243 | if (movementflag == 16) | ||
244 | { | ||
245 | movementflag = 0; | ||
246 | } | ||
247 | if ((movementflag) != 0) | ||
248 | { | ||
249 | NewForce newVelocity = new NewForce(); | ||
250 | newVelocity.X = 0; | ||
251 | newVelocity.Y = 0; | ||
252 | newVelocity.Z = 0; | ||
253 | this.forcesList.Add(newVelocity); | ||
254 | movementflag = 0; | ||
255 | |||
256 | this.movementflag = 16; | ||
257 | |||
258 | } | ||
259 | } | ||
260 | |||
193 | } | 261 | } |
194 | 262 | ||
195 | /// <summary> | 263 | /// <summary> |
diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs index 7c61c90..98f5027 100644 --- a/OpenSim/OpenSim.Region/Scenes/Scene.cs +++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs | |||
@@ -123,14 +123,8 @@ namespace OpenSim.Region.Scenes | |||
123 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs - creating LandMap"); | 123 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs - creating LandMap"); |
124 | TerrainManager = new TerrainManager(new SecondLife()); | 124 | TerrainManager = new TerrainManager(new SecondLife()); |
125 | Terrain = new TerrainEngine(); | 125 | Terrain = new TerrainEngine(); |
126 | Avatar.SetupTemplate("avatar-texture.dat"); | 126 | |
127 | |||
128 | Avatar.LoadAnims(); | 127 | Avatar.LoadAnims(); |
129 | |||
130 | //this.SetDefaultScripts(); | ||
131 | //this.LoadScriptEngines(); | ||
132 | |||
133 | |||
134 | } | 128 | } |
135 | catch (Exception e) | 129 | catch (Exception e) |
136 | { | 130 | { |
diff --git a/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs b/OpenSim/OpenSim.RegionServer/ClientStackNetworkHandler.cs index 382ba21..7552195 100644 --- a/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs +++ b/OpenSim/OpenSim.RegionServer/ClientStackNetworkHandler.cs | |||
@@ -36,7 +36,7 @@ using libsecondlife; | |||
36 | namespace OpenSim | 36 | namespace OpenSim |
37 | { | 37 | { |
38 | 38 | ||
39 | public interface OpenSimNetworkHandler | 39 | public interface ClientStackNetworkHandler |
40 | { | 40 | { |
41 | void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender); | 41 | void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender); |
42 | void RemoveClientCircuit(uint circuitcode); | 42 | void RemoveClientCircuit(uint circuitcode); |
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs index 484ecc1..33727c4 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim | |||
47 | public event GenericCall OnRequestWearables; | 47 | public event GenericCall OnRequestWearables; |
48 | public event SetAppearance OnSetAppearance; | 48 | public event SetAppearance OnSetAppearance; |
49 | public event GenericCall2 OnCompleteMovementToRegion; | 49 | public event GenericCall2 OnCompleteMovementToRegion; |
50 | public event GenericCall3 OnAgentUpdate; | 50 | public event UpdateAgent OnAgentUpdate; |
51 | public event StartAnim OnStartAnim; | 51 | public event StartAnim OnStartAnim; |
52 | public event GenericCall OnRequestAvatarsData; | 52 | public event GenericCall OnRequestAvatarsData; |
53 | public event LinkObjects OnLinkObjects; | 53 | public event LinkObjects OnLinkObjects; |
@@ -393,6 +393,26 @@ namespace OpenSim | |||
393 | 393 | ||
394 | } | 394 | } |
395 | 395 | ||
396 | /// <summary> | ||
397 | /// | ||
398 | /// </summary> | ||
399 | /// <param name="regionHandle"></param> | ||
400 | /// <param name="timeDilation"></param> | ||
401 | /// <param name="localID"></param> | ||
402 | /// <param name="position"></param> | ||
403 | /// <param name="velocity"></param> | ||
404 | public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity) | ||
405 | { | ||
406 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = this.CreateAvatarImprovedBlock(localID, position, velocity); | ||
407 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); | ||
408 | terse.RegionData.RegionHandle = regionHandle; | ||
409 | terse.RegionData.TimeDilation = timeDilation; | ||
410 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | ||
411 | terse.ObjectData[0] = terseBlock; | ||
412 | |||
413 | this.OutPacket(terse); | ||
414 | } | ||
415 | |||
396 | #endregion | 416 | #endregion |
397 | 417 | ||
398 | #region Primitive Packet/data Sending Methods | 418 | #region Primitive Packet/data Sending Methods |
@@ -491,6 +511,83 @@ namespace OpenSim | |||
491 | 511 | ||
492 | #region Helper Methods | 512 | #region Helper Methods |
493 | 513 | ||
514 | protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos, LLVector3 velocity) | ||
515 | { | ||
516 | byte[] bytes = new byte[60]; | ||
517 | int i = 0; | ||
518 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); | ||
519 | |||
520 | dat.TextureEntry = new byte[0];// AvatarTemplate.TextureEntry; | ||
521 | |||
522 | uint ID = localID; | ||
523 | |||
524 | bytes[i++] = (byte)(ID % 256); | ||
525 | bytes[i++] = (byte)((ID >> 8) % 256); | ||
526 | bytes[i++] = (byte)((ID >> 16) % 256); | ||
527 | bytes[i++] = (byte)((ID >> 24) % 256); | ||
528 | bytes[i++] = 0; | ||
529 | bytes[i++] = 1; | ||
530 | i += 14; | ||
531 | bytes[i++] = 128; | ||
532 | bytes[i++] = 63; | ||
533 | |||
534 | byte[] pb = pos.GetBytes(); | ||
535 | Array.Copy(pb, 0, bytes, i, pb.Length); | ||
536 | i += 12; | ||
537 | ushort InternVelocityX; | ||
538 | ushort InternVelocityY; | ||
539 | ushort InternVelocityZ; | ||
540 | Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0); | ||
541 | |||
542 | internDirec = new Axiom.MathLib.Vector3(velocity.X, velocity.Y, velocity.Z); | ||
543 | |||
544 | internDirec = internDirec / 128.0f; | ||
545 | internDirec.x += 1; | ||
546 | internDirec.y += 1; | ||
547 | internDirec.z += 1; | ||
548 | |||
549 | InternVelocityX = (ushort)(32768 * internDirec.x); | ||
550 | InternVelocityY = (ushort)(32768 * internDirec.y); | ||
551 | InternVelocityZ = (ushort)(32768 * internDirec.z); | ||
552 | |||
553 | ushort ac = 32767; | ||
554 | bytes[i++] = (byte)(InternVelocityX % 256); | ||
555 | bytes[i++] = (byte)((InternVelocityX >> 8) % 256); | ||
556 | bytes[i++] = (byte)(InternVelocityY % 256); | ||
557 | bytes[i++] = (byte)((InternVelocityY >> 8) % 256); | ||
558 | bytes[i++] = (byte)(InternVelocityZ % 256); | ||
559 | bytes[i++] = (byte)((InternVelocityZ >> 8) % 256); | ||
560 | |||
561 | //accel | ||
562 | bytes[i++] = (byte)(ac % 256); | ||
563 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
564 | bytes[i++] = (byte)(ac % 256); | ||
565 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
566 | bytes[i++] = (byte)(ac % 256); | ||
567 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
568 | |||
569 | //rot | ||
570 | bytes[i++] = (byte)(ac % 256); | ||
571 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
572 | bytes[i++] = (byte)(ac % 256); | ||
573 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
574 | bytes[i++] = (byte)(ac % 256); | ||
575 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
576 | bytes[i++] = (byte)(ac % 256); | ||
577 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
578 | |||
579 | //rotation vel | ||
580 | bytes[i++] = (byte)(ac % 256); | ||
581 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
582 | bytes[i++] = (byte)(ac % 256); | ||
583 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
584 | bytes[i++] = (byte)(ac % 256); | ||
585 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
586 | |||
587 | dat.Data = bytes; | ||
588 | return (dat); | ||
589 | } | ||
590 | |||
494 | /// <summary> | 591 | /// <summary> |
495 | /// | 592 | /// |
496 | /// </summary> | 593 | /// </summary> |
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs index dbe0bd9..f8c7cdb 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs | |||
@@ -168,7 +168,8 @@ namespace OpenSim | |||
168 | case PacketType.AgentUpdate: | 168 | case PacketType.AgentUpdate: |
169 | if (OnAgentUpdate != null) | 169 | if (OnAgentUpdate != null) |
170 | { | 170 | { |
171 | OnAgentUpdate(Pack); | 171 | AgentUpdatePacket agenUpdate = (AgentUpdatePacket) Pack; |
172 | OnAgentUpdate(this, agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotation ); | ||
172 | } | 173 | } |
173 | break; | 174 | break; |
174 | case PacketType.AgentAnimation: | 175 | case PacketType.AgentAnimation: |
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj index 4231f40..63eeb9c 100644 --- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj +++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj | |||
@@ -130,6 +130,9 @@ | |||
130 | </ProjectReference> | 130 | </ProjectReference> |
131 | </ItemGroup> | 131 | </ItemGroup> |
132 | <ItemGroup> | 132 | <ItemGroup> |
133 | <Compile Include="ClientStackNetworkHandler.cs"> | ||
134 | <SubType>Code</SubType> | ||
135 | </Compile> | ||
133 | <Compile Include="ClientView.AgentAssetUpload.cs"> | 136 | <Compile Include="ClientView.AgentAssetUpload.cs"> |
134 | <SubType>Code</SubType> | 137 | <SubType>Code</SubType> |
135 | </Compile> | 138 | </Compile> |
@@ -151,21 +154,15 @@ | |||
151 | <Compile Include="NetworkServersInfo.cs"> | 154 | <Compile Include="NetworkServersInfo.cs"> |
152 | <SubType>Code</SubType> | 155 | <SubType>Code</SubType> |
153 | </Compile> | 156 | </Compile> |
154 | <Compile Include="OpenSimNetworkHandler.cs"> | ||
155 | <SubType>Code</SubType> | ||
156 | </Compile> | ||
157 | <Compile Include="PacketServer.cs"> | 157 | <Compile Include="PacketServer.cs"> |
158 | <SubType>Code</SubType> | 158 | <SubType>Code</SubType> |
159 | </Compile> | 159 | </Compile> |
160 | <Compile Include="RegionServerBase.cs"> | 160 | <Compile Include="RegionApplicationBase.cs"> |
161 | <SubType>Code</SubType> | 161 | <SubType>Code</SubType> |
162 | </Compile> | 162 | </Compile> |
163 | <Compile Include="UDPServer.cs"> | 163 | <Compile Include="UDPServer.cs"> |
164 | <SubType>Code</SubType> | 164 | <SubType>Code</SubType> |
165 | </Compile> | 165 | </Compile> |
166 | <Compile Include="UserConfigUtility.cs"> | ||
167 | <SubType>Code</SubType> | ||
168 | </Compile> | ||
169 | <Compile Include="VersionInfo.cs"> | 166 | <Compile Include="VersionInfo.cs"> |
170 | <SubType>Code</SubType> | 167 | <SubType>Code</SubType> |
171 | </Compile> | 168 | </Compile> |
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build index f5f8440..23eca3a 100644 --- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build +++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build | |||
@@ -11,6 +11,7 @@ | |||
11 | <resources prefix="OpenSim.RegionServer" dynamicprefix="true" > | 11 | <resources prefix="OpenSim.RegionServer" dynamicprefix="true" > |
12 | </resources> | 12 | </resources> |
13 | <sources failonempty="true"> | 13 | <sources failonempty="true"> |
14 | <include name="ClientStackNetworkHandler.cs" /> | ||
14 | <include name="ClientView.AgentAssetUpload.cs" /> | 15 | <include name="ClientView.AgentAssetUpload.cs" /> |
15 | <include name="ClientView.API.cs" /> | 16 | <include name="ClientView.API.cs" /> |
16 | <include name="ClientView.cs" /> | 17 | <include name="ClientView.cs" /> |
@@ -18,11 +19,9 @@ | |||
18 | <include name="ClientView.ProcessPackets.cs" /> | 19 | <include name="ClientView.ProcessPackets.cs" /> |
19 | <include name="ClientViewBase.cs" /> | 20 | <include name="ClientViewBase.cs" /> |
20 | <include name="NetworkServersInfo.cs" /> | 21 | <include name="NetworkServersInfo.cs" /> |
21 | <include name="OpenSimNetworkHandler.cs" /> | ||
22 | <include name="PacketServer.cs" /> | 22 | <include name="PacketServer.cs" /> |
23 | <include name="RegionServerBase.cs" /> | 23 | <include name="RegionApplicationBase.cs" /> |
24 | <include name="UDPServer.cs" /> | 24 | <include name="UDPServer.cs" /> |
25 | <include name="UserConfigUtility.cs" /> | ||
26 | <include name="VersionInfo.cs" /> | 25 | <include name="VersionInfo.cs" /> |
27 | <include name="Assets/InventoryCache.cs" /> | 26 | <include name="Assets/InventoryCache.cs" /> |
28 | </sources> | 27 | </sources> |
diff --git a/OpenSim/OpenSim.RegionServer/PacketServer.cs b/OpenSim/OpenSim.RegionServer/PacketServer.cs index f0bf44f..229570c 100644 --- a/OpenSim/OpenSim.RegionServer/PacketServer.cs +++ b/OpenSim/OpenSim.RegionServer/PacketServer.cs | |||
@@ -40,13 +40,13 @@ namespace OpenSim | |||
40 | { | 40 | { |
41 | public class PacketServer | 41 | public class PacketServer |
42 | { | 42 | { |
43 | private OpenSimNetworkHandler _networkHandler; | 43 | private ClientStackNetworkHandler _networkHandler; |
44 | private IWorld _localWorld; | 44 | private IWorld _localWorld; |
45 | public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>(); | 45 | public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>(); |
46 | public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>(); | 46 | public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>(); |
47 | protected uint serverPort; | 47 | protected uint serverPort; |
48 | 48 | ||
49 | public PacketServer(OpenSimNetworkHandler networkHandler, uint port) | 49 | public PacketServer(ClientStackNetworkHandler networkHandler, uint port) |
50 | { | 50 | { |
51 | _networkHandler = networkHandler; | 51 | _networkHandler = networkHandler; |
52 | this.serverPort = port; | 52 | this.serverPort = port; |
diff --git a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs b/OpenSim/OpenSim.RegionServer/RegionApplicationBase.cs index c059d7c..8509dcc 100644 --- a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs +++ b/OpenSim/OpenSim.RegionServer/RegionApplicationBase.cs | |||
@@ -52,7 +52,7 @@ using OpenSim.GenericConfig; | |||
52 | 52 | ||
53 | namespace OpenSim | 53 | namespace OpenSim |
54 | { | 54 | { |
55 | public class RegionServerBase | 55 | public class RegionApplicationBase |
56 | { | 56 | { |
57 | protected IGenericConfig localConfig; | 57 | protected IGenericConfig localConfig; |
58 | protected PhysicsManager physManager; | 58 | protected PhysicsManager physManager; |
@@ -78,12 +78,12 @@ namespace OpenSim | |||
78 | 78 | ||
79 | protected ConsoleBase m_console; | 79 | protected ConsoleBase m_console; |
80 | 80 | ||
81 | public RegionServerBase() | 81 | public RegionApplicationBase() |
82 | { | 82 | { |
83 | 83 | ||
84 | } | 84 | } |
85 | 85 | ||
86 | public RegionServerBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile) | 86 | public RegionApplicationBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile) |
87 | { | 87 | { |
88 | this.configFileSetup = useConfigFile; | 88 | this.configFileSetup = useConfigFile; |
89 | m_sandbox = sandBoxMode; | 89 | m_sandbox = sandBoxMode; |
diff --git a/OpenSim/OpenSim.RegionServer/UDPServer.cs b/OpenSim/OpenSim.RegionServer/UDPServer.cs index 090ed7d..315cb2c 100644 --- a/OpenSim/OpenSim.RegionServer/UDPServer.cs +++ b/OpenSim/OpenSim.RegionServer/UDPServer.cs | |||
@@ -52,7 +52,7 @@ using OpenSim.GenericConfig; | |||
52 | namespace OpenSim | 52 | namespace OpenSim |
53 | { | 53 | { |
54 | 54 | ||
55 | public class UDPServer : OpenSimNetworkHandler | 55 | public class UDPServer : ClientStackNetworkHandler |
56 | { | 56 | { |
57 | protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); | 57 | protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); |
58 | public Socket Server; | 58 | public Socket Server; |
diff --git a/OpenSim/OpenSim.RegionServer/UserConfigUtility.cs b/OpenSim/OpenSim.RegionServer/UserConfigUtility.cs deleted file mode 100644 index 2f04c07..0000000 --- a/OpenSim/OpenSim.RegionServer/UserConfigUtility.cs +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim | ||
33 | { | ||
34 | public class UserConfigUtility | ||
35 | { | ||
36 | } | ||
37 | } | ||
diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs index ea71330..9fe9581 100644 --- a/OpenSim/OpenSim/OpenSimMain.cs +++ b/OpenSim/OpenSim/OpenSimMain.cs | |||
@@ -57,7 +57,7 @@ using OpenGrid.Framework.Communications; | |||
57 | namespace OpenSim | 57 | namespace OpenSim |
58 | { | 58 | { |
59 | 59 | ||
60 | public class OpenSimMain : RegionServerBase, conscmd_callback | 60 | public class OpenSimMain : RegionApplicationBase, conscmd_callback |
61 | { | 61 | { |
62 | private CheckSumServer checkServer; | 62 | private CheckSumServer checkServer; |
63 | protected RegionServerCommsManager commsManager; | 63 | protected RegionServerCommsManager commsManager; |