diff options
author | MW | 2007-06-15 16:03:02 +0000 |
---|---|---|
committer | MW | 2007-06-15 16:03:02 +0000 |
commit | 17b4818b8e9a141b54540b342542bcb2ad21b4db (patch) | |
tree | 5abca9ede1e82d4a2e01301cc19eed25ad88702a | |
parent | Preliminary movement added to sugilite, forwards walking only and no animations. (diff) | |
download | opensim-SC-17b4818b8e9a141b54540b342542bcb2ad21b4db.zip opensim-SC-17b4818b8e9a141b54540b342542bcb2ad21b4db.tar.gz opensim-SC-17b4818b8e9a141b54540b342542bcb2ad21b4db.tar.bz2 opensim-SC-17b4818b8e9a141b54540b342542bcb2ad21b4db.tar.xz |
Very Preliminary border crossing added to sugilite. (Note: Sugilite doesn't have any backend ogs communication support yet so everything is Sandbox mode only )
17 files changed, 266 insertions, 40 deletions
diff --git a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs index 0b29f8a..357321d 100644 --- a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs +++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs | |||
@@ -58,6 +58,11 @@ namespace OpenGrid.Framework.Communications.GridServer | |||
58 | { | 58 | { |
59 | return null; | 59 | return null; |
60 | } | 60 | } |
61 | |||
62 | public virtual RegionInfo RequestNeighbourInfo(ulong regionHandle) | ||
63 | { | ||
64 | return null; | ||
65 | } | ||
61 | 66 | ||
62 | } | 67 | } |
63 | } | 68 | } |
diff --git a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs index 78ae712..3c1c29b 100644 --- a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs +++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs | |||
@@ -54,5 +54,10 @@ namespace OpenGrid.Framework.Communications.GridServer | |||
54 | { | 54 | { |
55 | return sandBoxManager.RequestNeighbours(regionInfo); | 55 | return sandBoxManager.RequestNeighbours(regionInfo); |
56 | } | 56 | } |
57 | |||
58 | public override RegionInfo RequestNeighbourInfo(ulong regionHandle) | ||
59 | { | ||
60 | return sandBoxManager.RequestNeighbourInfo(regionHandle); | ||
61 | } | ||
57 | } | 62 | } |
58 | } | 63 | } |
diff --git a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsBase.cs b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsBase.cs index 7977c53..50335c5 100644 --- a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsBase.cs +++ b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsBase.cs | |||
@@ -42,5 +42,7 @@ namespace OpenGrid.Framework.Communications | |||
42 | /// <param name="agentData"></param> | 42 | /// <param name="agentData"></param> |
43 | /// <returns></returns> | 43 | /// <returns></returns> |
44 | public abstract bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData); | 44 | public abstract bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData); |
45 | public abstract bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); | ||
46 | |||
45 | } | 47 | } |
46 | } | 48 | } |
diff --git a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs index d1a0b4f..d70376c 100644 --- a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs +++ b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsLocal.cs | |||
@@ -52,5 +52,10 @@ namespace OpenGrid.Framework.Communications | |||
52 | { | 52 | { |
53 | return sandBoxManager.InformNeighbourOfChildAgent(regionHandle, agentData); | 53 | return sandBoxManager.InformNeighbourOfChildAgent(regionHandle, agentData); |
54 | } | 54 | } |
55 | |||
56 | public override bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) | ||
57 | { | ||
58 | return sandBoxManager.ExpectAvatarCrossing(regionHandle, agentID, position); | ||
59 | } | ||
55 | } | 60 | } |
56 | } | 61 | } |
diff --git a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsOGS.cs b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsOGS.cs index 2cdd825..e631cf4 100644 --- a/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsOGS.cs +++ b/Common/OpenGrid.Framework.Communications/InterSimComms/InterSimsCommsOGS.cs | |||
@@ -39,5 +39,10 @@ namespace OpenGrid.Framework.Communications | |||
39 | { | 39 | { |
40 | return false; | 40 | return false; |
41 | } | 41 | } |
42 | |||
43 | public override bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) | ||
44 | { | ||
45 | return false; | ||
46 | } | ||
42 | } | 47 | } |
43 | } | 48 | } |
diff --git a/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs b/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs index 6b923f6..928215e 100644 --- a/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs +++ b/Common/OpenGrid.Framework.Communications/LocalBackEndServices.cs | |||
@@ -96,6 +96,20 @@ namespace OpenGrid.Framework.Communications | |||
96 | } | 96 | } |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// | ||
100 | /// </summary> | ||
101 | /// <param name="regionHandle"></param> | ||
102 | /// <returns></returns> | ||
103 | public RegionInfo RequestNeighbourInfo(ulong regionHandle) | ||
104 | { | ||
105 | if (this.regions.ContainsKey(regionHandle)) | ||
106 | { | ||
107 | return this.regions[regionHandle]; | ||
108 | } | ||
109 | return null; | ||
110 | } | ||
111 | |||
112 | /// <summary> | ||
99 | /// </summary> | 113 | /// </summary> |
100 | /// <param name="regionHandle"></param> | 114 | /// <param name="regionHandle"></param> |
101 | /// <param name="agentData"></param> | 115 | /// <param name="agentData"></param> |
@@ -113,6 +127,24 @@ namespace OpenGrid.Framework.Communications | |||
113 | } | 127 | } |
114 | 128 | ||
115 | /// <summary> | 129 | /// <summary> |
130 | /// | ||
131 | /// </summary> | ||
132 | /// <param name="regionHandle"></param> | ||
133 | /// <param name="agentID"></param> | ||
134 | /// <param name="position"></param> | ||
135 | /// <returns></returns> | ||
136 | public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) | ||
137 | { | ||
138 | if (this.regionHosts.ContainsKey(regionHandle)) | ||
139 | { | ||
140 | // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); | ||
141 | this.regionHosts[regionHandle].ExpectAvatarCrossing(regionHandle, agentID, position); | ||
142 | return true; | ||
143 | } | ||
144 | return false; | ||
145 | } | ||
146 | |||
147 | /// <summary> | ||
116 | /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session | 148 | /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session |
117 | /// </summary> | 149 | /// </summary> |
118 | /// <param name="regionHandle"></param> | 150 | /// <param name="regionHandle"></param> |
diff --git a/Common/OpenSim.Framework/IRegionCommsHost.cs b/Common/OpenSim.Framework/IRegionCommsHost.cs index aa434c5..658afe6 100644 --- a/Common/OpenSim.Framework/IRegionCommsHost.cs +++ b/Common/OpenSim.Framework/IRegionCommsHost.cs | |||
@@ -35,12 +35,13 @@ namespace OpenSim.Framework | |||
35 | { | 35 | { |
36 | public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); | 36 | public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); |
37 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); | 37 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); |
38 | public delegate void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position); | ||
38 | 39 | ||
39 | public interface IRegionCommsHost | 40 | public interface IRegionCommsHost |
40 | { | 41 | { |
41 | event ExpectUserDelegate OnExpectUser; | 42 | event ExpectUserDelegate OnExpectUser; |
42 | event GenericCall2 OnExpectChildAgent; | 43 | event GenericCall2 OnExpectChildAgent; |
43 | event GenericCall2 OnAvatarCrossingIntoRegion; | 44 | event AgentCrossing OnAvatarCrossingIntoRegion; |
44 | event UpdateNeighbours OnNeighboursUpdate; | 45 | event UpdateNeighbours OnNeighboursUpdate; |
45 | } | 46 | } |
46 | } | 47 | } |
diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs index cebfd9a..45d73ef 100644 --- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs +++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs | |||
@@ -125,9 +125,10 @@ namespace OpenSim.Framework.Interfaces | |||
125 | void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | 125 | void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); |
126 | 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); |
127 | void SendLayerData(float[] map); | 127 | void SendLayerData(float[] map); |
128 | void MoveAgentIntoRegion(RegionInfo regInfo); | 128 | void MoveAgentIntoRegion(RegionInfo regInfo, 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 | void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort); | ||
131 | 132 | ||
132 | void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos); | 133 | 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 | void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); |
diff --git a/Common/OpenSim.Framework/RegionCommsHostBase.cs b/Common/OpenSim.Framework/RegionCommsHostBase.cs index 6a08eb8..88751b8 100644 --- a/Common/OpenSim.Framework/RegionCommsHostBase.cs +++ b/Common/OpenSim.Framework/RegionCommsHostBase.cs | |||
@@ -37,7 +37,7 @@ namespace OpenSim.Framework | |||
37 | { | 37 | { |
38 | public event ExpectUserDelegate OnExpectUser; | 38 | public event ExpectUserDelegate OnExpectUser; |
39 | public event GenericCall2 OnExpectChildAgent; | 39 | public event GenericCall2 OnExpectChildAgent; |
40 | public event GenericCall2 OnAvatarCrossingIntoRegion; | 40 | public event AgentCrossing OnAvatarCrossingIntoRegion; |
41 | public event UpdateNeighbours OnNeighboursUpdate; | 41 | public event UpdateNeighbours OnNeighboursUpdate; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
@@ -55,5 +55,15 @@ namespace OpenSim.Framework | |||
55 | 55 | ||
56 | return false; | 56 | return false; |
57 | } | 57 | } |
58 | |||
59 | public virtual bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) | ||
60 | { | ||
61 | if (OnAvatarCrossingIntoRegion != null) | ||
62 | { | ||
63 | OnAvatarCrossingIntoRegion(regionHandle, agentID, position); | ||
64 | return true; | ||
65 | } | ||
66 | return false; | ||
67 | } | ||
58 | } | 68 | } |
59 | } | 69 | } |
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 5636b13..341ffbb 100644 --- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -120,22 +120,22 @@ namespace OpenSim.Physics.BasicPhysicsPlugin | |||
120 | } | 120 | } |
121 | else | 121 | else |
122 | { | 122 | { |
123 | if (actor.Position.Y < -1) | 123 | if (actor.Position.Y < 0) |
124 | { | 124 | { |
125 | actor.Position.Y = -1; | 125 | actor.Position.Y = 0; |
126 | } | 126 | } |
127 | else if (actor.Position.Y > 257) | 127 | else if (actor.Position.Y > 256) |
128 | { | 128 | { |
129 | actor.Position.Y = 257; | 129 | actor.Position.Y = 256; |
130 | } | 130 | } |
131 | 131 | ||
132 | if (actor.Position.X < -1) | 132 | if (actor.Position.X < 0) |
133 | { | 133 | { |
134 | actor.Position.X = -1; | 134 | actor.Position.X = 0; |
135 | } | 135 | } |
136 | if (actor.Position.X > 257) | 136 | if (actor.Position.X > 256) |
137 | { | 137 | { |
138 | actor.Position.X = 257; | 138 | actor.Position.X = 256; |
139 | } | 139 | } |
140 | } | 140 | } |
141 | //} | 141 | //} |
diff --git a/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs b/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs index 3f87e10..d46bf0f 100644 --- a/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs +++ b/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs | |||
@@ -32,6 +32,7 @@ using libsecondlife; | |||
32 | using libsecondlife.Packets; | 32 | using libsecondlife.Packets; |
33 | using OpenSim.Physics.Manager; | 33 | using OpenSim.Physics.Manager; |
34 | using OpenSim.Framework.Interfaces; | 34 | using OpenSim.Framework.Interfaces; |
35 | using OpenSim.Framework.Types; | ||
35 | 36 | ||
36 | namespace OpenSim.Region.Scenes | 37 | namespace OpenSim.Region.Scenes |
37 | { | 38 | { |
@@ -55,7 +56,24 @@ namespace OpenSim.Region.Scenes | |||
55 | this.SendTerseUpdateToALLClients(); | 56 | this.SendTerseUpdateToALLClients(); |
56 | _updateCount = 0; | 57 | _updateCount = 0; |
57 | } | 58 | } |
58 | } | 59 | } |
60 | |||
61 | LLVector3 pos2 = this.Pos; | ||
62 | LLVector3 vel = this.Velocity; | ||
63 | |||
64 | float timeStep = 0.3f; | ||
65 | pos2.X = pos2.X + (vel.X * timeStep); | ||
66 | pos2.Y = pos2.Y + (vel.Y * timeStep); | ||
67 | pos2.Z = pos2.Z + (vel.Z * timeStep); | ||
68 | if ((pos2.X < 0) || (pos2.X > 256)) | ||
69 | { | ||
70 | this.CrossToNewRegion(); | ||
71 | } | ||
72 | |||
73 | if ((pos2.Y < 0) || (pos2.Y > 256)) | ||
74 | { | ||
75 | this.CrossToNewRegion(); | ||
76 | } | ||
59 | } | 77 | } |
60 | 78 | ||
61 | /// <summary> | 79 | /// <summary> |
@@ -147,5 +165,47 @@ namespace OpenSim.Region.Scenes | |||
147 | 165 | ||
148 | } | 166 | } |
149 | 167 | ||
168 | private void CrossToNewRegion() | ||
169 | { | ||
170 | |||
171 | // Console.WriteLine("crossing to new region from region " + this.m_regionInfo.RegionLocX + " , "+ this.m_regionInfo.RegionLocY); | ||
172 | LLVector3 pos = this.Pos; | ||
173 | LLVector3 newpos = new LLVector3(pos.X, pos.Y, pos.Z); | ||
174 | uint neighbourx = this.m_regionInfo.RegionLocX; | ||
175 | uint neighboury = this.m_regionInfo.RegionLocY; | ||
176 | |||
177 | if (pos.X < 2) | ||
178 | { | ||
179 | neighbourx -= 1; | ||
180 | newpos.X = 254; | ||
181 | } | ||
182 | if (pos.X > 253) | ||
183 | { | ||
184 | neighbourx += 1; | ||
185 | newpos.X = 1; | ||
186 | } | ||
187 | if (pos.Y < 2) | ||
188 | { | ||
189 | neighboury -= 1; | ||
190 | newpos.Y = 254; | ||
191 | } | ||
192 | if (pos.Y > 253) | ||
193 | { | ||
194 | neighboury += 1; | ||
195 | newpos.Y = 1; | ||
196 | } | ||
197 | |||
198 | LLVector3 vel = this.velocity; | ||
199 | // Console.WriteLine("new region should be " + neighbourx + " , " + neighboury); | ||
200 | ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury* 256)); | ||
201 | RegionInfo neighbourRegion = this.m_world.RequestNeighbouringRegionInfo(neighbourHandle); | ||
202 | if (neighbourRegion != null) | ||
203 | { | ||
204 | // Console.WriteLine("current region port is "+ this.m_regionInfo.IPListenPort + " now crossing to new region with port " + neighbourRegion.IPListenPort); | ||
205 | this.m_world.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos); | ||
206 | this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, System.Net.IPAddress.Parse(neighbourRegion.IPListenAddr), (ushort)neighbourRegion.IPListenPort); | ||
207 | } | ||
208 | } | ||
209 | |||
150 | } | 210 | } |
151 | } | 211 | } |
diff --git a/OpenSim/OpenSim.Region/Scenes/Avatar.cs b/OpenSim/OpenSim.Region/Scenes/Avatar.cs index 17b2437..98d7564 100644 --- a/OpenSim/OpenSim.Region/Scenes/Avatar.cs +++ b/OpenSim/OpenSim.Region/Scenes/Avatar.cs | |||
@@ -102,10 +102,10 @@ namespace OpenSim.Region.Scenes | |||
102 | ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.CompleteMovement); | 102 | ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.CompleteMovement); |
103 | ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.SendInitialPosition); | 103 | ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.SendInitialPosition); |
104 | ControllingClient.OnAgentUpdate += new UpdateAgent(this.HandleAgentUpdate); | 104 | ControllingClient.OnAgentUpdate += new UpdateAgent(this.HandleAgentUpdate); |
105 | /* ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); | 105 | // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); |
106 | ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); | 106 | ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); |
107 | ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); | 107 | //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); |
108 | */ | 108 | |
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
@@ -129,7 +129,14 @@ namespace OpenSim.Region.Scenes | |||
129 | /// <param name="status"></param> | 129 | /// <param name="status"></param> |
130 | public void ChildStatusChange(bool status) | 130 | public void ChildStatusChange(bool status) |
131 | { | 131 | { |
132 | this.childAvatar = status; | ||
132 | 133 | ||
134 | if (this.childAvatar == true) | ||
135 | { | ||
136 | this.Velocity = new LLVector3(0, 0, 0); | ||
137 | this.Pos = new LLVector3(128, 128, 70); | ||
138 | |||
139 | } | ||
133 | } | 140 | } |
134 | 141 | ||
135 | /// <summary> | 142 | /// <summary> |
@@ -137,22 +144,17 @@ namespace OpenSim.Region.Scenes | |||
137 | /// </summary> | 144 | /// </summary> |
138 | public override void addForces() | 145 | public override void addForces() |
139 | { | 146 | { |
147 | newForce = false; | ||
140 | lock (this.forcesList) | 148 | lock (this.forcesList) |
141 | { | 149 | { |
142 | newForce = false; | ||
143 | if (this.forcesList.Count > 0) | 150 | if (this.forcesList.Count > 0) |
144 | { | 151 | { |
145 | for (int i = 0; i < this.forcesList.Count; i++) | 152 | for (int i = 0; i < this.forcesList.Count; i++) |
146 | { | 153 | { |
147 | NewForce force = this.forcesList[i]; | 154 | NewForce force = this.forcesList[i]; |
148 | PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z); | 155 | |
149 | lock (m_world.SyncRoot) | ||
150 | { | ||
151 | this._physActor.Velocity = phyVector; | ||
152 | } | ||
153 | this.updateflag = true; | 156 | this.updateflag = true; |
154 | this.velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this | 157 | 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; | 158 | this.newForce = true; |
157 | } | 159 | } |
158 | for (int i = 0; i < this.forcesList.Count; i++) | 160 | for (int i = 0; i < this.forcesList.Count; i++) |
@@ -165,7 +167,9 @@ namespace OpenSim.Region.Scenes | |||
165 | 167 | ||
166 | public void SendTerseUpdateToClient(IClientAPI RemoteClient) | 168 | public void SendTerseUpdateToClient(IClientAPI RemoteClient) |
167 | { | 169 | { |
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)); | 170 | LLVector3 pos = this.Pos; |
171 | LLVector3 vel = this.Velocity; | ||
172 | RemoteClient.SendAvatarTerseUpdate(this.m_regionHandle, 64096, this.localid, new LLVector3(pos.X, pos.Y, pos.Z), new LLVector3(vel.X, vel.Y, vel.Z)); | ||
169 | } | 173 | } |
170 | 174 | ||
171 | /// <summary> | 175 | /// <summary> |
@@ -185,7 +189,7 @@ namespace OpenSim.Region.Scenes | |||
185 | /// </summary> | 189 | /// </summary> |
186 | public void CompleteMovement() | 190 | public void CompleteMovement() |
187 | { | 191 | { |
188 | this.ControllingClient.MoveAgentIntoRegion(m_regionInfo); | 192 | this.ControllingClient.MoveAgentIntoRegion(m_regionInfo, Pos); |
189 | } | 193 | } |
190 | 194 | ||
191 | /// <summary> | 195 | /// <summary> |
@@ -240,10 +244,6 @@ namespace OpenSim.Region.Scenes | |||
240 | } | 244 | } |
241 | else | 245 | else |
242 | { | 246 | { |
243 | if (movementflag == 16) | ||
244 | { | ||
245 | movementflag = 0; | ||
246 | } | ||
247 | if ((movementflag) != 0) | 247 | if ((movementflag) != 0) |
248 | { | 248 | { |
249 | NewForce newVelocity = new NewForce(); | 249 | NewForce newVelocity = new NewForce(); |
@@ -252,9 +252,6 @@ namespace OpenSim.Region.Scenes | |||
252 | newVelocity.Z = 0; | 252 | newVelocity.Z = 0; |
253 | this.forcesList.Add(newVelocity); | 253 | this.forcesList.Add(newVelocity); |
254 | movementflag = 0; | 254 | movementflag = 0; |
255 | |||
256 | this.movementflag = 16; | ||
257 | |||
258 | } | 255 | } |
259 | } | 256 | } |
260 | 257 | ||
diff --git a/OpenSim/OpenSim.Region/Scenes/Entity.cs b/OpenSim/OpenSim.Region/Scenes/Entity.cs index d4c981a..007bdaf 100644 --- a/OpenSim/OpenSim.Region/Scenes/Entity.cs +++ b/OpenSim/OpenSim.Region/Scenes/Entity.cs | |||
@@ -93,6 +93,41 @@ namespace OpenSim.Region.Scenes | |||
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | public virtual LLVector3 Velocity | ||
97 | { | ||
98 | get | ||
99 | { | ||
100 | if (this._physActor != null) | ||
101 | { | ||
102 | velocity.X = _physActor.Velocity.X; | ||
103 | velocity.Y = _physActor.Velocity.Y; | ||
104 | velocity.Z = _physActor.Velocity.Z; | ||
105 | } | ||
106 | |||
107 | return velocity; | ||
108 | } | ||
109 | set | ||
110 | { | ||
111 | if (this._physActor != null) | ||
112 | { | ||
113 | try | ||
114 | { | ||
115 | lock (this.m_world.SyncRoot) | ||
116 | { | ||
117 | |||
118 | this._physActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z); | ||
119 | } | ||
120 | } | ||
121 | catch (Exception e) | ||
122 | { | ||
123 | Console.WriteLine(e.Message); | ||
124 | } | ||
125 | } | ||
126 | |||
127 | velocity = value; | ||
128 | } | ||
129 | } | ||
130 | |||
96 | /// <summary> | 131 | /// <summary> |
97 | /// Creates a new Entity (should not occur on it's own) | 132 | /// Creates a new Entity (should not occur on it's own) |
98 | /// </summary> | 133 | /// </summary> |
diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs index 98f5027..2500ee6 100644 --- a/OpenSim/OpenSim.Region/Scenes/Scene.cs +++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs | |||
@@ -580,6 +580,7 @@ namespace OpenSim.Region.Scenes | |||
580 | agent.BaseFolder = LLUUID.Zero; | 580 | agent.BaseFolder = LLUUID.Zero; |
581 | agent.InventoryFolder = LLUUID.Zero; | 581 | agent.InventoryFolder = LLUUID.Zero; |
582 | agent.startpos = new LLVector3(128, 128, 70); | 582 | agent.startpos = new LLVector3(128, 128, 70); |
583 | agent.child = true; | ||
583 | this.commsManager.InterSims.InformNeighbourOfChildAgent(neighbours[i].RegionHandle, agent); | 584 | this.commsManager.InterSims.InformNeighbourOfChildAgent(neighbours[i].RegionHandle, agent); |
584 | remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].IPListenAddr), (ushort)neighbours[i].IPListenPort); | 585 | remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].IPListenAddr), (ushort)neighbours[i].IPListenPort); |
585 | } | 586 | } |
@@ -589,6 +590,27 @@ namespace OpenSim.Region.Scenes | |||
589 | /// <summary> | 590 | /// <summary> |
590 | /// | 591 | /// |
591 | /// </summary> | 592 | /// </summary> |
593 | /// <param name="regionHandle"></param> | ||
594 | /// <returns></returns> | ||
595 | public RegionInfo RequestNeighbouringRegionInfo(ulong regionHandle) | ||
596 | { | ||
597 | return this.commsManager.GridServer.RequestNeighbourInfo(regionHandle); | ||
598 | } | ||
599 | |||
600 | /// <summary> | ||
601 | /// | ||
602 | /// </summary> | ||
603 | /// <param name="regionhandle"></param> | ||
604 | /// <param name="agentID"></param> | ||
605 | /// <param name="position"></param> | ||
606 | public void InformNeighbourOfCrossing(ulong regionhandle, LLUUID agentID, LLVector3 position) | ||
607 | { | ||
608 | this.commsManager.InterSims.ExpectAvatarCrossing(regionhandle, agentID, position); | ||
609 | } | ||
610 | |||
611 | /// <summary> | ||
612 | /// | ||
613 | /// </summary> | ||
592 | /// <param name="agentID"></param> | 614 | /// <param name="agentID"></param> |
593 | public override void RemoveAvatar(LLUUID agentID) | 615 | public override void RemoveAvatar(LLUUID agentID) |
594 | { | 616 | { |
@@ -678,6 +700,7 @@ namespace OpenSim.Region.Scenes | |||
678 | if (this.regionCommsHost != null) | 700 | if (this.regionCommsHost != null) |
679 | { | 701 | { |
680 | this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection); | 702 | this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection); |
703 | this.regionCommsHost.OnAvatarCrossingIntoRegion += new AgentCrossing(this.AgentCrossing); | ||
681 | } | 704 | } |
682 | } | 705 | } |
683 | 706 | ||
@@ -696,6 +719,17 @@ namespace OpenSim.Region.Scenes | |||
696 | } | 719 | } |
697 | } | 720 | } |
698 | 721 | ||
722 | public void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) | ||
723 | { | ||
724 | if (regionHandle == this.m_regInfo.RegionHandle) | ||
725 | { | ||
726 | if (this.Avatars.ContainsKey(agentID)) | ||
727 | { | ||
728 | this.Avatars[agentID].Pos = position; | ||
729 | } | ||
730 | } | ||
731 | } | ||
732 | |||
699 | #endregion | 733 | #endregion |
700 | 734 | ||
701 | /// <summary> | 735 | /// <summary> |
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs index 33727c4..b126004 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs | |||
@@ -166,7 +166,7 @@ namespace OpenSim | |||
166 | /// | 166 | /// |
167 | /// </summary> | 167 | /// </summary> |
168 | /// <param name="regInfo"></param> | 168 | /// <param name="regInfo"></param> |
169 | public void MoveAgentIntoRegion(RegionInfo regInfo) | 169 | public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos) |
170 | { | 170 | { |
171 | AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); | 171 | AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); |
172 | mov.AgentData.SessionID = this.SessionID; | 172 | mov.AgentData.SessionID = this.SessionID; |
@@ -174,7 +174,14 @@ namespace OpenSim | |||
174 | mov.Data.RegionHandle = regInfo.RegionHandle; | 174 | mov.Data.RegionHandle = regInfo.RegionHandle; |
175 | // TODO - dynamicalise this stuff | 175 | // TODO - dynamicalise this stuff |
176 | mov.Data.Timestamp = 1172750370; | 176 | mov.Data.Timestamp = 1172750370; |
177 | mov.Data.Position = this.startpos; | 177 | if (pos != null) |
178 | { | ||
179 | mov.Data.Position = pos; | ||
180 | } | ||
181 | else | ||
182 | { | ||
183 | mov.Data.Position = this.startpos; | ||
184 | } | ||
178 | mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0); | 185 | mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0); |
179 | 186 | ||
180 | OutPacket(mov); | 187 | OutPacket(mov); |
@@ -305,6 +312,29 @@ namespace OpenSim | |||
305 | return agentData; | 312 | return agentData; |
306 | } | 313 | } |
307 | 314 | ||
315 | public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort) | ||
316 | { | ||
317 | CrossedRegionPacket newSimPack = new CrossedRegionPacket(); | ||
318 | newSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock(); | ||
319 | newSimPack.AgentData.AgentID = this.AgentID; | ||
320 | newSimPack.AgentData.SessionID = this.SessionID; | ||
321 | newSimPack.Info = new CrossedRegionPacket.InfoBlock(); | ||
322 | newSimPack.Info.Position = pos; | ||
323 | newSimPack.Info.LookAt = lookAt; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!! | ||
324 | newSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock(); | ||
325 | newSimPack.RegionData.RegionHandle = newRegionHandle; | ||
326 | byte[] byteIP = newRegionIP.GetAddressBytes(); | ||
327 | newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24; | ||
328 | newSimPack.RegionData.SimIP += (uint)byteIP[2] << 16; | ||
329 | newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8; | ||
330 | newSimPack.RegionData.SimIP += (uint)byteIP[0]; | ||
331 | newSimPack.RegionData.SimPort = newRegionPort; | ||
332 | newSimPack.RegionData.SeedCapability = new byte[0]; | ||
333 | |||
334 | this.OutPacket(newSimPack); | ||
335 | this.DowngradeClient(); | ||
336 | } | ||
337 | |||
308 | #region Appearance/ Wearables Methods | 338 | #region Appearance/ Wearables Methods |
309 | 339 | ||
310 | /// <summary> | 340 | /// <summary> |
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs index f8c7cdb..4cf6ac2 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs | |||
@@ -163,7 +163,6 @@ namespace OpenSim | |||
163 | { | 163 | { |
164 | OnCompleteMovementToRegion(); | 164 | OnCompleteMovementToRegion(); |
165 | } | 165 | } |
166 | // this.EnableNeighbours(); | ||
167 | break; | 166 | break; |
168 | case PacketType.AgentUpdate: | 167 | case PacketType.AgentUpdate: |
169 | if (OnAgentUpdate != null) | 168 | if (OnAgentUpdate != null) |
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.cs b/OpenSim/OpenSim.RegionServer/ClientView.cs index 0943c0d..29c871e 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.cs | |||
@@ -117,17 +117,22 @@ namespace OpenSim | |||
117 | { | 117 | { |
118 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent"); | 118 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent"); |
119 | this.m_child = false; | 119 | this.m_child = false; |
120 | this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode); | 120 | //this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode); |
121 | m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false); | 121 | m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false); |
122 | OnChildAgentStatus(this.m_child); | 122 | if (OnChildAgentStatus != null) |
123 | { | ||
124 | OnChildAgentStatus(this.m_child); | ||
125 | } | ||
123 | } | 126 | } |
124 | 127 | ||
125 | public void DowngradeClient() | 128 | public void DowngradeClient() |
126 | { | 129 | { |
127 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - changing full agent to child"); | 130 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - changing full agent to child"); |
128 | this.m_child = true; | 131 | this.m_child = true; |
129 | OnChildAgentStatus(this.m_child); | 132 | if (OnChildAgentStatus != null) |
130 | 133 | { | |
134 | OnChildAgentStatus(this.m_child); | ||
135 | } | ||
131 | } | 136 | } |
132 | 137 | ||
133 | public void KillClient() | 138 | public void KillClient() |