diff options
author | lbsa71 | 2007-07-01 13:17:27 +0000 |
---|---|---|
committer | lbsa71 | 2007-07-01 13:17:27 +0000 |
commit | 5e805656db1215518a344d6d5364629a4997fd47 (patch) | |
tree | 2d8b50bac8e77f983e3016e969df3535c52fb0d3 /OpenSim/Region/Environment | |
parent | * Project files fixed for OGS. (diff) | |
download | opensim-SC_OLD-5e805656db1215518a344d6d5364629a4997fd47.zip opensim-SC_OLD-5e805656db1215518a344d6d5364629a4997fd47.tar.gz opensim-SC_OLD-5e805656db1215518a344d6d5364629a4997fd47.tar.bz2 opensim-SC_OLD-5e805656db1215518a344d6d5364629a4997fd47.tar.xz |
Fixed SimpleApp - aka thankgoditssundaycommit
* Updated SimpleApp with various introduced dependencies
* Extracted ScenePrescence creation in Scene
* removed try-catchall from UserManagerBase (that actually hid a bug)
* Refactored RegionInfo
* handle is calculated
* it will explode upon accessing x,y,ip,port,externalip if not explicitly initialized
* Removed superfluous 'ref' keywords
* Removed a shitload of 'catch Exception e' that causes build warnings
* Lots of small refactorings, renames et c
* Ignored some bins
Diffstat (limited to 'OpenSim/Region/Environment')
4 files changed, 53 insertions, 58 deletions
diff --git a/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj b/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj index 6dabd05..428f381 100644 --- a/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj +++ b/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj | |||
@@ -144,55 +144,55 @@ | |||
144 | </ProjectReference> | 144 | </ProjectReference> |
145 | </ItemGroup> | 145 | </ItemGroup> |
146 | <ItemGroup> | 146 | <ItemGroup> |
147 | <Compile Include="RegionManager.cs"> | ||
148 | <SubType>Code</SubType> | ||
149 | </Compile> | ||
150 | <Compile Include="EstateManager.cs"> | 147 | <Compile Include="EstateManager.cs"> |
151 | <SubType>Code</SubType> | 148 | <SubType>Code</SubType> |
152 | </Compile> | 149 | </Compile> |
153 | <Compile Include="ParcelManager.cs"> | 150 | <Compile Include="ParcelManager.cs"> |
154 | <SubType>Code</SubType> | 151 | <SubType>Code</SubType> |
155 | </Compile> | 152 | </Compile> |
153 | <Compile Include="RegionManager.cs"> | ||
154 | <SubType>Code</SubType> | ||
155 | </Compile> | ||
156 | <Compile Include="Scenes\Entity.cs"> | 156 | <Compile Include="Scenes\Entity.cs"> |
157 | <SubType>Code</SubType> | 157 | <SubType>Code</SubType> |
158 | </Compile> | 158 | </Compile> |
159 | <Compile Include="Scenes\Scene.cs"> | 159 | <Compile Include="Scenes\IScenePresenceBody.cs"> |
160 | <SubType>Code</SubType> | 160 | <SubType>Code</SubType> |
161 | </Compile> | 161 | </Compile> |
162 | <Compile Include="Scenes\ScenePresence.Body.cs"> | 162 | <Compile Include="Scenes\Primitive.cs"> |
163 | <SubType>Code</SubType> | 163 | <SubType>Code</SubType> |
164 | </Compile> | 164 | </Compile> |
165 | <Compile Include="Scenes\SceneEvents.cs"> | 165 | <Compile Include="Scenes\Scene.cs"> |
166 | <SubType>Code</SubType> | 166 | <SubType>Code</SubType> |
167 | </Compile> | 167 | </Compile> |
168 | <Compile Include="Scenes\ScenePresence.cs"> | 168 | <Compile Include="Scenes\Scene.PacketHandlers.cs"> |
169 | <SubType>Code</SubType> | 169 | <SubType>Code</SubType> |
170 | </Compile> | 170 | </Compile> |
171 | <Compile Include="Scenes\ScenePresence.Animations.cs"> | 171 | <Compile Include="Scenes\SceneBase.cs"> |
172 | <SubType>Code</SubType> | 172 | <SubType>Code</SubType> |
173 | </Compile> | 173 | </Compile> |
174 | <Compile Include="Scenes\Scene.PacketHandlers.cs"> | 174 | <Compile Include="Scenes\SceneEvents.cs"> |
175 | <SubType>Code</SubType> | 175 | <SubType>Code</SubType> |
176 | </Compile> | 176 | </Compile> |
177 | <Compile Include="Scenes\SceneObject.cs"> | 177 | <Compile Include="Scenes\SceneObject.cs"> |
178 | <SubType>Code</SubType> | 178 | <SubType>Code</SubType> |
179 | </Compile> | 179 | </Compile> |
180 | <Compile Include="Scenes\Primitive.cs"> | 180 | <Compile Include="Scenes\ScenePresence.Animations.cs"> |
181 | <SubType>Code</SubType> | 181 | <SubType>Code</SubType> |
182 | </Compile> | 182 | </Compile> |
183 | <Compile Include="Scenes\SceneBase.cs"> | 183 | <Compile Include="Scenes\ScenePresence.Body.cs"> |
184 | <SubType>Code</SubType> | 184 | <SubType>Code</SubType> |
185 | </Compile> | 185 | </Compile> |
186 | <Compile Include="Scenes\IScenePresenceBody.cs"> | 186 | <Compile Include="Scenes\ScenePresence.cs"> |
187 | <SubType>Code</SubType> | 187 | <SubType>Code</SubType> |
188 | </Compile> | 188 | </Compile> |
189 | <Compile Include="Scenes\scripting\ScriptManager.cs"> | 189 | <Compile Include="Scenes\scripting\Script.cs"> |
190 | <SubType>Code</SubType> | 190 | <SubType>Code</SubType> |
191 | </Compile> | 191 | </Compile> |
192 | <Compile Include="Scenes\scripting\ScriptInfo.cs"> | 192 | <Compile Include="Scenes\scripting\ScriptInfo.cs"> |
193 | <SubType>Code</SubType> | 193 | <SubType>Code</SubType> |
194 | </Compile> | 194 | </Compile> |
195 | <Compile Include="Scenes\scripting\Script.cs"> | 195 | <Compile Include="Scenes\scripting\ScriptManager.cs"> |
196 | <SubType>Code</SubType> | 196 | <SubType>Code</SubType> |
197 | </Compile> | 197 | </Compile> |
198 | <Compile Include="Scenes\scripting\Engines\CSharpScriptEngine.cs"> | 198 | <Compile Include="Scenes\scripting\Engines\CSharpScriptEngine.cs"> |
diff --git a/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build b/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build index eb26ea0..2fa5e76 100644 --- a/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build +++ b/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build | |||
@@ -11,23 +11,23 @@ | |||
11 | <resources prefix="OpenSim.Region.Environment" dynamicprefix="true" > | 11 | <resources prefix="OpenSim.Region.Environment" dynamicprefix="true" > |
12 | </resources> | 12 | </resources> |
13 | <sources failonempty="true"> | 13 | <sources failonempty="true"> |
14 | <include name="RegionManager.cs" /> | ||
15 | <include name="EstateManager.cs" /> | 14 | <include name="EstateManager.cs" /> |
16 | <include name="ParcelManager.cs" /> | 15 | <include name="ParcelManager.cs" /> |
16 | <include name="RegionManager.cs" /> | ||
17 | <include name="Scenes/Entity.cs" /> | 17 | <include name="Scenes/Entity.cs" /> |
18 | <include name="Scenes/IScenePresenceBody.cs" /> | ||
19 | <include name="Scenes/Primitive.cs" /> | ||
18 | <include name="Scenes/Scene.cs" /> | 20 | <include name="Scenes/Scene.cs" /> |
19 | <include name="Scenes/ScenePresence.Body.cs" /> | ||
20 | <include name="Scenes/SceneEvents.cs" /> | ||
21 | <include name="Scenes/ScenePresence.cs" /> | ||
22 | <include name="Scenes/ScenePresence.Animations.cs" /> | ||
23 | <include name="Scenes/Scene.PacketHandlers.cs" /> | 21 | <include name="Scenes/Scene.PacketHandlers.cs" /> |
24 | <include name="Scenes/SceneObject.cs" /> | ||
25 | <include name="Scenes/Primitive.cs" /> | ||
26 | <include name="Scenes/SceneBase.cs" /> | 22 | <include name="Scenes/SceneBase.cs" /> |
27 | <include name="Scenes/IScenePresenceBody.cs" /> | 23 | <include name="Scenes/SceneEvents.cs" /> |
28 | <include name="Scenes/scripting/ScriptManager.cs" /> | 24 | <include name="Scenes/SceneObject.cs" /> |
29 | <include name="Scenes/scripting/ScriptInfo.cs" /> | 25 | <include name="Scenes/ScenePresence.Animations.cs" /> |
26 | <include name="Scenes/ScenePresence.Body.cs" /> | ||
27 | <include name="Scenes/ScenePresence.cs" /> | ||
30 | <include name="Scenes/scripting/Script.cs" /> | 28 | <include name="Scenes/scripting/Script.cs" /> |
29 | <include name="Scenes/scripting/ScriptInfo.cs" /> | ||
30 | <include name="Scenes/scripting/ScriptManager.cs" /> | ||
31 | <include name="Scenes/scripting/Engines/CSharpScriptEngine.cs" /> | 31 | <include name="Scenes/scripting/Engines/CSharpScriptEngine.cs" /> |
32 | <include name="Scenes/scripting/Engines/JScriptEngine.cs" /> | 32 | <include name="Scenes/scripting/Engines/JScriptEngine.cs" /> |
33 | </sources> | 33 | </sources> |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 8c912d0..d5406b6 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -493,19 +493,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
493 | /// <param name="remoteClient"></param | 493 | /// <param name="remoteClient"></param |
494 | /// <param name="agentID"></param> | 494 | /// <param name="agentID"></param> |
495 | /// <param name="child"></param> | 495 | /// <param name="child"></param> |
496 | public override void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child) | 496 | public override void AddNewClient(IClientAPI client, bool child) |
497 | { | 497 | { |
498 | remoteClient.OnRegionHandShakeReply += this.SendLayerData; | 498 | client.OnRegionHandShakeReply += this.SendLayerData; |
499 | //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); | 499 | //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); |
500 | remoteClient.OnChatFromViewer += this.SimChat; | 500 | client.OnChatFromViewer += this.SimChat; |
501 | remoteClient.OnRequestWearables += this.InformClientOfNeighbours; | 501 | client.OnRequestWearables += this.InformClientOfNeighbours; |
502 | remoteClient.OnAddPrim += this.AddNewPrim; | 502 | client.OnAddPrim += this.AddNewPrim; |
503 | remoteClient.OnUpdatePrimPosition += this.UpdatePrimPosition; | 503 | client.OnUpdatePrimPosition += this.UpdatePrimPosition; |
504 | remoteClient.OnRequestMapBlocks += this.RequestMapBlocks; | 504 | client.OnRequestMapBlocks += this.RequestMapBlocks; |
505 | remoteClient.OnTeleportLocationRequest += this.RequestTeleportLocation; | 505 | client.OnTeleportLocationRequest += this.RequestTeleportLocation; |
506 | //remoteClient.OnObjectSelect += this.SelectPrim; | 506 | //remoteClient.OnObjectSelect += this.SelectPrim; |
507 | remoteClient.OnGrapUpdate += this.MoveObject; | 507 | client.OnGrapUpdate += this.MoveObject; |
508 | remoteClient.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; | 508 | client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; |
509 | 509 | ||
510 | /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest); | 510 | /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest); |
511 | remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest); | 511 | remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest); |
@@ -513,19 +513,21 @@ namespace OpenSim.Region.Environment.Scenes | |||
513 | remoteClient.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest); | 513 | remoteClient.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest); |
514 | remoteClient.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage); | 514 | remoteClient.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage); |
515 | */ | 515 | */ |
516 | 516 | this.estateManager.sendRegionHandshake(client); | |
517 | |||
518 | CreateAndAddScenePresence(client); | ||
519 | return; | ||
520 | } | ||
521 | |||
522 | protected void CreateAndAddScenePresence(IClientAPI client) | ||
523 | { | ||
517 | ScenePresence newAvatar = null; | 524 | ScenePresence newAvatar = null; |
518 | try | ||
519 | { | ||
520 | 525 | ||
521 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); | 526 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); |
522 | newAvatar = new ScenePresence(remoteClient, this, this.m_regInfo); | 527 | newAvatar = new ScenePresence(client, this, this.m_regInfo); |
523 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Adding new avatar to world"); | 528 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Adding new avatar to world"); |
524 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Starting RegionHandshake "); | 529 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Starting RegionHandshake "); |
525 | 530 | ||
526 | //newAvatar.SendRegionHandshake(); | ||
527 | this.estateManager.sendRegionHandshake(remoteClient); | ||
528 | |||
529 | PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); | 531 | PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); |
530 | lock (this.m_syncRoot) | 532 | lock (this.m_syncRoot) |
531 | { | 533 | { |
@@ -534,36 +536,29 @@ namespace OpenSim.Region.Environment.Scenes | |||
534 | 536 | ||
535 | lock (Entities) | 537 | lock (Entities) |
536 | { | 538 | { |
537 | if (!Entities.ContainsKey(agentID)) | 539 | if (!Entities.ContainsKey(client.AgentId)) |
538 | { | 540 | { |
539 | this.Entities.Add(agentID, newAvatar); | 541 | this.Entities.Add(client.AgentId, newAvatar); |
540 | } | 542 | } |
541 | else | 543 | else |
542 | { | 544 | { |
543 | Entities[agentID] = newAvatar; | 545 | Entities[client.AgentId] = newAvatar; |
544 | } | 546 | } |
545 | } | 547 | } |
546 | lock (Avatars) | 548 | lock (Avatars) |
547 | { | 549 | { |
548 | if (Avatars.ContainsKey(agentID)) | 550 | if (Avatars.ContainsKey(client.AgentId)) |
549 | { | 551 | { |
550 | Avatars[agentID] = newAvatar; | 552 | Avatars[client.AgentId] = newAvatar; |
551 | } | 553 | } |
552 | else | 554 | else |
553 | { | 555 | { |
554 | this.Avatars.Add(agentID, newAvatar); | 556 | this.Avatars.Add(client.AgentId, newAvatar); |
555 | } | 557 | } |
556 | } | 558 | } |
557 | } | ||
558 | catch (Exception e) | ||
559 | { | ||
560 | OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: AddViewerAgent() - Failed with exception " + e.ToString()); | ||
561 | } | ||
562 | return; | ||
563 | } | 559 | } |
564 | 560 | ||
565 | 561 | ||
566 | |||
567 | /// <summary> | 562 | /// <summary> |
568 | /// | 563 | /// |
569 | /// </summary> | 564 | /// </summary> |
@@ -642,8 +637,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
642 | this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo,gridSettings); | 637 | this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo,gridSettings); |
643 | if (this.regionCommsHost != null) | 638 | if (this.regionCommsHost != null) |
644 | { | 639 | { |
645 | this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection); | 640 | this.regionCommsHost.OnExpectUser += this.NewUserConnection; |
646 | this.regionCommsHost.OnAvatarCrossingIntoRegion += new AgentCrossing(this.AgentCrossing); | 641 | this.regionCommsHost.OnAvatarCrossingIntoRegion += this.AgentCrossing; |
647 | } | 642 | } |
648 | } | 643 | } |
649 | 644 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 50d3b82..e06acbd 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs | |||
@@ -148,7 +148,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
148 | /// <param name="remoteClient"></param> | 148 | /// <param name="remoteClient"></param> |
149 | /// <param name="agentID"></param> | 149 | /// <param name="agentID"></param> |
150 | /// <param name="child"></param> | 150 | /// <param name="child"></param> |
151 | public abstract void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child); | 151 | public abstract void AddNewClient(IClientAPI client, bool child); |
152 | 152 | ||
153 | /// <summary> | 153 | /// <summary> |
154 | /// | 154 | /// |