diff options
author | lbsa71 | 2007-09-19 04:19:27 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-19 04:19:27 +0000 |
commit | 2afbf8b22b1548c7994981acf92882c6d9628bb9 (patch) | |
tree | aae0d8494f800b7d23748069f108e606358cd5d1 /OpenSim/Region | |
parent | * Deleted unused RegionManager.cs (diff) | |
download | opensim-SC_OLD-2afbf8b22b1548c7994981acf92882c6d9628bb9.zip opensim-SC_OLD-2afbf8b22b1548c7994981acf92882c6d9628bb9.tar.gz opensim-SC_OLD-2afbf8b22b1548c7994981acf92882c6d9628bb9.tar.bz2 opensim-SC_OLD-2afbf8b22b1548c7994981acf92882c6d9628bb9.tar.xz |
* Added AddToPhysicalScene and RemoveFromPhysicalScene and added to MakeAvatar and MakeChildAgent respectively
* Removed unused m_child from ClientView
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/PacketServer.cs | 47 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/UDPServer.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 35 |
6 files changed, 39 insertions, 75 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 3bb7c03..61fc498 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | |||
@@ -175,18 +175,15 @@ namespace OpenSim.Region.ClientStack | |||
175 | } | 175 | } |
176 | break; | 176 | break; |
177 | case PacketType.AgentAnimation: | 177 | case PacketType.AgentAnimation: |
178 | if (!m_child) | 178 | AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; |
179 | for (int i = 0; i < AgentAni.AnimationList.Length; i++) | ||
179 | { | 180 | { |
180 | AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; | 181 | if (AgentAni.AnimationList[i].StartAnim) |
181 | for (int i = 0; i < AgentAni.AnimationList.Length; i++) | ||
182 | { | 182 | { |
183 | if (AgentAni.AnimationList[i].StartAnim) | ||
184 | { | ||
185 | 183 | ||
186 | if (OnStartAnim != null) | 184 | if (OnStartAnim != null) |
187 | { | 185 | { |
188 | OnStartAnim(this, AgentAni.AnimationList[i].AnimID, 1); | 186 | OnStartAnim(this, AgentAni.AnimationList[i].AnimID, 1); |
189 | } | ||
190 | } | 187 | } |
191 | } | 188 | } |
192 | } | 189 | } |
@@ -352,8 +349,8 @@ namespace OpenSim.Region.ClientStack | |||
352 | break; | 349 | break; |
353 | case PacketType.AssetUploadRequest: | 350 | case PacketType.AssetUploadRequest: |
354 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; | 351 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; |
355 | // Console.WriteLine("upload request " + Pack.ToString()); | 352 | // Console.WriteLine("upload request " + Pack.ToString()); |
356 | // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionID).ToStringHyphenated()); | 353 | // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionID).ToStringHyphenated()); |
357 | if (OnAssetUploadRequest != null) | 354 | if (OnAssetUploadRequest != null) |
358 | { | 355 | { |
359 | OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal); | 356 | OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal); |
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 2341b7b..dcca31c 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -62,7 +62,6 @@ namespace OpenSim.Region.ClientStack | |||
62 | public LLUUID SecureSessionID = LLUUID.Zero; | 62 | public LLUUID SecureSessionID = LLUUID.Zero; |
63 | public string firstName; | 63 | public string firstName; |
64 | public string lastName; | 64 | public string lastName; |
65 | public bool m_child = false; | ||
66 | private UseCircuitCodePacket cirpack; | 65 | private UseCircuitCodePacket cirpack; |
67 | public Thread ClientThread; | 66 | public Thread ClientThread; |
68 | public LLVector3 startpos; | 67 | public LLVector3 startpos; |
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs index 3b26a59..f02f105 100644 --- a/OpenSim/Region/ClientStack/PacketServer.cs +++ b/OpenSim/Region/ClientStack/PacketServer.cs | |||
@@ -71,53 +71,6 @@ namespace OpenSim.Region.ClientStack | |||
71 | m_clientManager.InPacket(circuitCode, packet); | 71 | m_clientManager.InPacket(circuitCode, packet); |
72 | } | 72 | } |
73 | 73 | ||
74 | /// <summary> | ||
75 | /// | ||
76 | /// </summary> | ||
77 | /// <param name="circuitCode"></param> | ||
78 | /// <returns></returns> | ||
79 | public virtual bool AddNewCircuitCodeClient(uint circuitCode) | ||
80 | { | ||
81 | return false; | ||
82 | } | ||
83 | |||
84 | /// <summary> | ||
85 | /// | ||
86 | /// </summary> | ||
87 | /// <param name="packet"></param> | ||
88 | public virtual void SendPacketToAllClients(Packet packet) | ||
89 | { | ||
90 | |||
91 | } | ||
92 | |||
93 | /// <summary> | ||
94 | /// | ||
95 | /// </summary> | ||
96 | /// <param name="packet"></param> | ||
97 | /// <param name="simClient"></param> | ||
98 | public virtual void SendPacketToAllExcept(Packet packet, IClientAPI simClient) | ||
99 | { | ||
100 | |||
101 | } | ||
102 | |||
103 | /// <summary> | ||
104 | /// | ||
105 | /// </summary> | ||
106 | /// <param name="packetType"></param> | ||
107 | /// <param name="handler"></param> | ||
108 | public virtual void AddClientPacketHandler(PacketType packetType, PacketMethod handler) | ||
109 | { | ||
110 | |||
111 | } | ||
112 | |||
113 | /// <summary> | ||
114 | /// | ||
115 | /// </summary> | ||
116 | public virtual void RegisterClientPacketHandlers() | ||
117 | { | ||
118 | |||
119 | } | ||
120 | |||
121 | protected virtual IClientAPI CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions) | 74 | protected virtual IClientAPI CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions) |
122 | { | 75 | { |
123 | return new ClientView(remoteEP, initialcirpack, clientManager, scene, assetCache, packServer, authenSessions ); | 76 | return new ClientView(remoteEP, initialcirpack, clientManager, scene, assetCache, packServer, authenSessions ); |
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index 6d72853..64ed4b4 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs | |||
@@ -133,7 +133,7 @@ namespace OpenSim.Region.ClientStack | |||
133 | else if (packet.Type == PacketType.UseCircuitCode) | 133 | else if (packet.Type == PacketType.UseCircuitCode) |
134 | { | 134 | { |
135 | // new client | 135 | // new client |
136 | this.AddNewClient(packet); | 136 | AddNewClient(packet); |
137 | } | 137 | } |
138 | else | 138 | else |
139 | { // invalid client | 139 | { // invalid client |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index df125aa..3a45e23 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -706,7 +706,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
706 | { | 706 | { |
707 | SubscribeToClientEvents(client); | 707 | SubscribeToClientEvents(client); |
708 | m_estateManager.sendRegionHandshake(client); | 708 | m_estateManager.sendRegionHandshake(client); |
709 | |||
709 | CreateAndAddScenePresence(client, child); | 710 | CreateAndAddScenePresence(client, child); |
711 | |||
710 | m_LandManager.sendParcelOverlay(client); | 712 | m_LandManager.sendParcelOverlay(client); |
711 | commsManager.UserProfiles.AddNewUser(client.AgentId); | 713 | commsManager.UserProfiles.AddNewUser(client.AgentId); |
712 | commsManager.TransactionsManager.AddUser(client.AgentId); | 714 | commsManager.TransactionsManager.AddUser(client.AgentId); |
@@ -791,13 +793,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
791 | MainLog.Instance.Verbose(RegionInfo.RegionName + ": Creating new root agent."); | 793 | MainLog.Instance.Verbose(RegionInfo.RegionName + ": Creating new root agent."); |
792 | MainLog.Instance.Verbose(RegionInfo.RegionName + ": Adding Physical agent."); | 794 | MainLog.Instance.Verbose(RegionInfo.RegionName + ": Adding Physical agent."); |
793 | 795 | ||
794 | PhysicsVector pVec = | 796 | newAvatar.AddToPhysicalScene( ); |
795 | new PhysicsVector(newAvatar.AbsolutePosition.X, newAvatar.AbsolutePosition.Y, | ||
796 | newAvatar.AbsolutePosition.Z); | ||
797 | lock (m_syncRoot) | ||
798 | { | ||
799 | newAvatar.PhysActor = phyScene.AddAvatar(pVec); | ||
800 | } | ||
801 | } | 797 | } |
802 | 798 | ||
803 | lock (Entities) | 799 | lock (Entities) |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 64c6eaa..811c962 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -265,17 +265,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
265 | } | 265 | } |
266 | } | 266 | } |
267 | 267 | ||
268 | /// <summary> | ||
269 | /// | ||
270 | /// </summary> | ||
271 | /// <param name="pos"></param> | ||
272 | public void MakeAvatar(LLVector3 pos, bool isFlying) | 268 | public void MakeAvatar(LLVector3 pos, bool isFlying) |
273 | { | 269 | { |
274 | //this.childAvatar = false; | ||
275 | AbsolutePosition = pos; | ||
276 | _physActor.Flying = isFlying; | ||
277 | newAvatar = true; | 270 | newAvatar = true; |
278 | childAgent = false; | 271 | childAgent = false; |
272 | |||
273 | AbsolutePosition = pos; | ||
274 | |||
275 | AddToPhysicalScene( ); | ||
276 | _physActor.Flying = isFlying; | ||
277 | |||
278 | |||
279 | m_scene.SendAllSceneObjectsToClient(this); | 279 | m_scene.SendAllSceneObjectsToClient(this); |
280 | } | 280 | } |
281 | 281 | ||
@@ -283,9 +283,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
283 | { | 283 | { |
284 | Velocity = new LLVector3(0, 0, 0); | 284 | Velocity = new LLVector3(0, 0, 0); |
285 | childAgent = true; | 285 | childAgent = true; |
286 | |||
287 | RemoveFromPhysicalScene(); | ||
288 | |||
286 | //this.Pos = new LLVector3(128, 128, 70); | 289 | //this.Pos = new LLVector3(128, 128, 70); |
287 | } | 290 | } |
288 | 291 | ||
292 | private void RemoveFromPhysicalScene() | ||
293 | { | ||
294 | m_scene.phyScene.RemoveAvatar( this.PhysActor ); | ||
295 | } | ||
296 | |||
289 | /// <summary> | 297 | /// <summary> |
290 | /// | 298 | /// |
291 | /// </summary> | 299 | /// </summary> |
@@ -832,7 +840,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
832 | 840 | ||
833 | public override void SetText(string text, Vector3 color, double alpha) | 841 | public override void SetText(string text, Vector3 color, double alpha) |
834 | { | 842 | { |
835 | throw new Exception("The method or operation is not implemented."); | 843 | throw new Exception("Can't set Text on avatar."); |
844 | } | ||
845 | |||
846 | public void AddToPhysicalScene( ) | ||
847 | { | ||
848 | PhysicsScene scene = m_scene.phyScene; | ||
849 | |||
850 | PhysicsVector pVec = | ||
851 | new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, | ||
852 | AbsolutePosition.Z); | ||
853 | |||
854 | _physActor = scene.AddAvatar(pVec); | ||
836 | } | 855 | } |
837 | } | 856 | } |
838 | } \ No newline at end of file | 857 | } \ No newline at end of file |