diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/OpenSim.World/Avatar.Update.cs | 7 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/Avatar.cs | 18 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/OpenSim.World.csproj | 52 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/Primitive.cs | 476 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/SceneObject.cs | 6 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/World.PacketHandlers.cs | 175 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/World.Scripting.cs | 2 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/World.cs | 110 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/WorldBase.cs | 45 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/scripting/IScriptHandler.cs | 2 |
10 files changed, 600 insertions, 293 deletions
diff --git a/OpenSim/OpenSim.World/Avatar.Update.cs b/OpenSim/OpenSim.World/Avatar.Update.cs index 33132cf..13a480a 100644 --- a/OpenSim/OpenSim.World/Avatar.Update.cs +++ b/OpenSim/OpenSim.World/Avatar.Update.cs | |||
@@ -4,6 +4,7 @@ using System.Text; | |||
4 | using libsecondlife; | 4 | using libsecondlife; |
5 | using libsecondlife.Packets; | 5 | using libsecondlife.Packets; |
6 | using OpenSim.Physics.Manager; | 6 | using OpenSim.Physics.Manager; |
7 | using OpenSim.Framework.Interfaces; | ||
7 | 8 | ||
8 | namespace OpenSim.world | 9 | namespace OpenSim.world |
9 | { | 10 | { |
@@ -22,7 +23,7 @@ namespace OpenSim.world | |||
22 | 23 | ||
23 | public ObjectUpdatePacket CreateUpdatePacket() | 24 | public ObjectUpdatePacket CreateUpdatePacket() |
24 | { | 25 | { |
25 | 26 | return null; | |
26 | } | 27 | } |
27 | 28 | ||
28 | public void SendInitialPosition() | 29 | public void SendInitialPosition() |
@@ -35,7 +36,7 @@ namespace OpenSim.world | |||
35 | 36 | ||
36 | } | 37 | } |
37 | 38 | ||
38 | public void SendOurAppearance(ClientView OurClient) | 39 | public void SendOurAppearance(IClientAPI OurClient) |
39 | { | 40 | { |
40 | 41 | ||
41 | } | 42 | } |
@@ -57,7 +58,7 @@ namespace OpenSim.world | |||
57 | 58 | ||
58 | public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock() | 59 | public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock() |
59 | { | 60 | { |
60 | 61 | return null; | |
61 | } | 62 | } |
62 | 63 | ||
63 | // Sends animation update | 64 | // Sends animation update |
diff --git a/OpenSim/OpenSim.World/Avatar.cs b/OpenSim/OpenSim.World/Avatar.cs index cca266b..551283a 100644 --- a/OpenSim/OpenSim.World/Avatar.cs +++ b/OpenSim/OpenSim.World/Avatar.cs | |||
@@ -17,7 +17,7 @@ namespace OpenSim.world | |||
17 | public static AvatarAnimations Animations; | 17 | public static AvatarAnimations Animations; |
18 | public string firstname; | 18 | public string firstname; |
19 | public string lastname; | 19 | public string lastname; |
20 | public ClientView ControllingClient; | 20 | public IClientAPI ControllingClient; |
21 | public LLUUID current_anim; | 21 | public LLUUID current_anim; |
22 | public int anim_seq; | 22 | public int anim_seq; |
23 | private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate; | 23 | private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate; |
@@ -37,7 +37,7 @@ namespace OpenSim.world | |||
37 | private bool m_regionTerraform; | 37 | private bool m_regionTerraform; |
38 | private bool childAvatar = false; | 38 | private bool childAvatar = false; |
39 | 39 | ||
40 | public Avatar(ClientView TheClient, World world, string regionName, Dictionary<uint, ClientView> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater) | 40 | public Avatar(IClientAPI TheClient, World world, string regionName, Dictionary<uint, IClientAPI> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater) |
41 | { | 41 | { |
42 | m_world = world; | 42 | m_world = world; |
43 | // m_clientThreads = clientThreads; | 43 | // m_clientThreads = clientThreads; |
@@ -49,7 +49,7 @@ namespace OpenSim.world | |||
49 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs - Loading details from grid (DUMMY)"); | 49 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs - Loading details from grid (DUMMY)"); |
50 | ControllingClient = TheClient; | 50 | ControllingClient = TheClient; |
51 | localid = 8880000 + (this.m_world._localNumber++); | 51 | localid = 8880000 + (this.m_world._localNumber++); |
52 | Pos = ControllingClient.startpos; | 52 | Pos = ControllingClient.StartPos; |
53 | visualParams = new byte[218]; | 53 | visualParams = new byte[218]; |
54 | for (int i = 0; i < 218; i++) | 54 | for (int i = 0; i < 218; i++) |
55 | { | 55 | { |
@@ -66,14 +66,14 @@ namespace OpenSim.world | |||
66 | this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); | 66 | this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); |
67 | 67 | ||
68 | //register for events | 68 | //register for events |
69 | ControllingClient.OnRequestWearables += new ClientView.GenericCall(this.SendOurAppearance); | 69 | ControllingClient.OnRequestWearables += new GenericCall(this.SendOurAppearance); |
70 | ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance); | 70 | ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance); |
71 | ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.CompleteMovement); | 71 | ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.CompleteMovement); |
72 | ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.SendInitialPosition); | 72 | ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.SendInitialPosition); |
73 | ControllingClient.OnAgentUpdate += new ClientView.GenericCall3(this.HandleAgentUpdate); | 73 | ControllingClient.OnAgentUpdate += new GenericCall3(this.HandleAgentUpdate); |
74 | ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); | 74 | ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); |
75 | ControllingClient.OnChildAgentStatus += new ClientView.StatusChange(this.ChildStatusChange); | 75 | ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); |
76 | ControllingClient.OnStopMovement += new ClientView.GenericCall2(this.StopMovement); | 76 | ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); |
77 | } | 77 | } |
78 | 78 | ||
79 | public PhysicsActor PhysActor | 79 | public PhysicsActor PhysActor |
diff --git a/OpenSim/OpenSim.World/OpenSim.World.csproj b/OpenSim/OpenSim.World/OpenSim.World.csproj index 471f148..37293e1 100644 --- a/OpenSim/OpenSim.World/OpenSim.World.csproj +++ b/OpenSim/OpenSim.World/OpenSim.World.csproj | |||
@@ -1,4 +1,4 @@ | |||
1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
2 | <PropertyGroup> | 2 | <PropertyGroup> |
3 | <ProjectType>Local</ProjectType> | 3 | <ProjectType>Local</ProjectType> |
4 | <ProductVersion>8.0.50727</ProductVersion> | 4 | <ProductVersion>8.0.50727</ProductVersion> |
@@ -6,7 +6,8 @@ | |||
6 | <ProjectGuid>{642A14A8-0000-0000-0000-000000000000}</ProjectGuid> | 6 | <ProjectGuid>{642A14A8-0000-0000-0000-000000000000}</ProjectGuid> |
7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | 7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | 8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
9 | <ApplicationIcon></ApplicationIcon> | 9 | <ApplicationIcon> |
10 | </ApplicationIcon> | ||
10 | <AssemblyKeyContainerName> | 11 | <AssemblyKeyContainerName> |
11 | </AssemblyKeyContainerName> | 12 | </AssemblyKeyContainerName> |
12 | <AssemblyName>OpenSim.World</AssemblyName> | 13 | <AssemblyName>OpenSim.World</AssemblyName> |
@@ -15,9 +16,11 @@ | |||
15 | <DefaultTargetSchema>IE50</DefaultTargetSchema> | 16 | <DefaultTargetSchema>IE50</DefaultTargetSchema> |
16 | <DelaySign>false</DelaySign> | 17 | <DelaySign>false</DelaySign> |
17 | <OutputType>Library</OutputType> | 18 | <OutputType>Library</OutputType> |
18 | <AppDesignerFolder></AppDesignerFolder> | 19 | <AppDesignerFolder> |
20 | </AppDesignerFolder> | ||
19 | <RootNamespace>OpenSim.World</RootNamespace> | 21 | <RootNamespace>OpenSim.World</RootNamespace> |
20 | <StartupObject></StartupObject> | 22 | <StartupObject> |
23 | </StartupObject> | ||
21 | <FileUpgradeFlags> | 24 | <FileUpgradeFlags> |
22 | </FileUpgradeFlags> | 25 | </FileUpgradeFlags> |
23 | </PropertyGroup> | 26 | </PropertyGroup> |
@@ -28,7 +31,8 @@ | |||
28 | <ConfigurationOverrideFile> | 31 | <ConfigurationOverrideFile> |
29 | </ConfigurationOverrideFile> | 32 | </ConfigurationOverrideFile> |
30 | <DefineConstants>TRACE;DEBUG</DefineConstants> | 33 | <DefineConstants>TRACE;DEBUG</DefineConstants> |
31 | <DocumentationFile></DocumentationFile> | 34 | <DocumentationFile> |
35 | </DocumentationFile> | ||
32 | <DebugSymbols>True</DebugSymbols> | 36 | <DebugSymbols>True</DebugSymbols> |
33 | <FileAlignment>4096</FileAlignment> | 37 | <FileAlignment>4096</FileAlignment> |
34 | <Optimize>False</Optimize> | 38 | <Optimize>False</Optimize> |
@@ -37,7 +41,8 @@ | |||
37 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | 41 | <RemoveIntegerChecks>False</RemoveIntegerChecks> |
38 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | 42 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> |
39 | <WarningLevel>4</WarningLevel> | 43 | <WarningLevel>4</WarningLevel> |
40 | <NoWarn></NoWarn> | 44 | <NoWarn> |
45 | </NoWarn> | ||
41 | </PropertyGroup> | 46 | </PropertyGroup> |
42 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | 47 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
43 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | 48 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
@@ -46,7 +51,8 @@ | |||
46 | <ConfigurationOverrideFile> | 51 | <ConfigurationOverrideFile> |
47 | </ConfigurationOverrideFile> | 52 | </ConfigurationOverrideFile> |
48 | <DefineConstants>TRACE</DefineConstants> | 53 | <DefineConstants>TRACE</DefineConstants> |
49 | <DocumentationFile></DocumentationFile> | 54 | <DocumentationFile> |
55 | </DocumentationFile> | ||
50 | <DebugSymbols>False</DebugSymbols> | 56 | <DebugSymbols>False</DebugSymbols> |
51 | <FileAlignment>4096</FileAlignment> | 57 | <FileAlignment>4096</FileAlignment> |
52 | <Optimize>True</Optimize> | 58 | <Optimize>True</Optimize> |
@@ -55,26 +61,27 @@ | |||
55 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | 61 | <RemoveIntegerChecks>False</RemoveIntegerChecks> |
56 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | 62 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> |
57 | <WarningLevel>4</WarningLevel> | 63 | <WarningLevel>4</WarningLevel> |
58 | <NoWarn></NoWarn> | 64 | <NoWarn> |
65 | </NoWarn> | ||
59 | </PropertyGroup> | 66 | </PropertyGroup> |
60 | <ItemGroup> | 67 | <ItemGroup> |
61 | <Reference Include="System" > | 68 | <Reference Include="System"> |
62 | <HintPath>System.dll</HintPath> | 69 | <HintPath>System.dll</HintPath> |
63 | <Private>False</Private> | 70 | <Private>False</Private> |
64 | </Reference> | 71 | </Reference> |
65 | <Reference Include="System.Xml" > | 72 | <Reference Include="System.Xml"> |
66 | <HintPath>System.Xml.dll</HintPath> | 73 | <HintPath>System.Xml.dll</HintPath> |
67 | <Private>False</Private> | 74 | <Private>False</Private> |
68 | </Reference> | 75 | </Reference> |
69 | <Reference Include="libsecondlife.dll" > | 76 | <Reference Include="libsecondlife.dll"> |
70 | <HintPath>..\..\bin\libsecondlife.dll</HintPath> | 77 | <HintPath>..\..\bin\libsecondlife.dll</HintPath> |
71 | <Private>False</Private> | 78 | <Private>False</Private> |
72 | </Reference> | 79 | </Reference> |
73 | <Reference Include="Axiom.MathLib.dll" > | 80 | <Reference Include="Axiom.MathLib.dll"> |
74 | <HintPath>..\..\bin\Axiom.MathLib.dll</HintPath> | 81 | <HintPath>..\..\bin\Axiom.MathLib.dll</HintPath> |
75 | <Private>False</Private> | 82 | <Private>False</Private> |
76 | </Reference> | 83 | </Reference> |
77 | <Reference Include="Db4objects.Db4o.dll" > | 84 | <Reference Include="Db4objects.Db4o.dll"> |
78 | <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath> | 85 | <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath> |
79 | <Private>False</Private> | 86 | <Private>False</Private> |
80 | </Reference> | 87 | </Reference> |
@@ -84,43 +91,43 @@ | |||
84 | <Name>OpenSim.Terrain.BasicTerrain</Name> | 91 | <Name>OpenSim.Terrain.BasicTerrain</Name> |
85 | <Project>{2270B8FE-0000-0000-0000-000000000000}</Project> | 92 | <Project>{2270B8FE-0000-0000-0000-000000000000}</Project> |
86 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 93 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
87 | <Private>False</Private> | 94 | <Private>False</Private> |
88 | </ProjectReference> | 95 | </ProjectReference> |
89 | <ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj"> | 96 | <ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj"> |
90 | <Name>OpenSim.Framework</Name> | 97 | <Name>OpenSim.Framework</Name> |
91 | <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> | 98 | <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> |
92 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 99 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
93 | <Private>False</Private> | 100 | <Private>False</Private> |
94 | </ProjectReference> | 101 | </ProjectReference> |
95 | <ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> | 102 | <ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> |
96 | <Name>OpenSim.Framework.Console</Name> | 103 | <Name>OpenSim.Framework.Console</Name> |
97 | <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> | 104 | <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> |
98 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 105 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
99 | <Private>False</Private> | 106 | <Private>False</Private> |
100 | </ProjectReference> | 107 | </ProjectReference> |
101 | <ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj"> | 108 | <ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj"> |
102 | <Name>OpenSim.GenericConfig.Xml</Name> | 109 | <Name>OpenSim.GenericConfig.Xml</Name> |
103 | <Project>{E88EF749-0000-0000-0000-000000000000}</Project> | 110 | <Project>{E88EF749-0000-0000-0000-000000000000}</Project> |
104 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 111 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
105 | <Private>False</Private> | 112 | <Private>False</Private> |
106 | </ProjectReference> | 113 | </ProjectReference> |
107 | <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> | 114 | <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> |
108 | <Name>OpenSim.Physics.Manager</Name> | 115 | <Name>OpenSim.Physics.Manager</Name> |
109 | <Project>{8BE16150-0000-0000-0000-000000000000}</Project> | 116 | <Project>{8BE16150-0000-0000-0000-000000000000}</Project> |
110 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 117 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
111 | <Private>False</Private> | 118 | <Private>False</Private> |
112 | </ProjectReference> | 119 | </ProjectReference> |
113 | <ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj"> | 120 | <ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj"> |
114 | <Name>OpenSim.Servers</Name> | 121 | <Name>OpenSim.Servers</Name> |
115 | <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project> | 122 | <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project> |
116 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 123 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
117 | <Private>False</Private> | 124 | <Private>False</Private> |
118 | </ProjectReference> | 125 | </ProjectReference> |
119 | <ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj"> | 126 | <ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj"> |
120 | <Name>XMLRPC</Name> | 127 | <Name>XMLRPC</Name> |
121 | <Project>{8E81D43C-0000-0000-0000-000000000000}</Project> | 128 | <Project>{8E81D43C-0000-0000-0000-000000000000}</Project> |
122 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 129 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
123 | <Private>False</Private> | 130 | <Private>False</Private> |
124 | </ProjectReference> | 131 | </ProjectReference> |
125 | </ItemGroup> | 132 | </ItemGroup> |
126 | <ItemGroup> | 133 | <ItemGroup> |
@@ -142,9 +149,6 @@ | |||
142 | <Compile Include="Primitive.cs"> | 149 | <Compile Include="Primitive.cs"> |
143 | <SubType>Code</SubType> | 150 | <SubType>Code</SubType> |
144 | </Compile> | 151 | </Compile> |
145 | <Compile Include="Primitive2.cs"> | ||
146 | <SubType>Code</SubType> | ||
147 | </Compile> | ||
148 | <Compile Include="SceneObject.cs"> | 152 | <Compile Include="SceneObject.cs"> |
149 | <SubType>Code</SubType> | 153 | <SubType>Code</SubType> |
150 | </Compile> | 154 | </Compile> |
@@ -192,4 +196,4 @@ | |||
192 | <PostBuildEvent> | 196 | <PostBuildEvent> |
193 | </PostBuildEvent> | 197 | </PostBuildEvent> |
194 | </PropertyGroup> | 198 | </PropertyGroup> |
195 | </Project> | 199 | </Project> \ No newline at end of file |
diff --git a/OpenSim/OpenSim.World/Primitive.cs b/OpenSim/OpenSim.World/Primitive.cs index 433ea9e..492341a 100644 --- a/OpenSim/OpenSim.World/Primitive.cs +++ b/OpenSim/OpenSim.World/Primitive.cs | |||
@@ -7,11 +7,485 @@ using libsecondlife.Packets; | |||
7 | using OpenSim.Framework.Interfaces; | 7 | using OpenSim.Framework.Interfaces; |
8 | using OpenSim.Physics.Manager; | 8 | using OpenSim.Physics.Manager; |
9 | using OpenSim.Framework.Types; | 9 | using OpenSim.Framework.Types; |
10 | using OpenSim.Framework.Inventory; | ||
10 | 11 | ||
11 | namespace OpenSim.world | 12 | namespace OpenSim.world |
12 | { | 13 | { |
13 | public class Primitive : Entity | 14 | public class Primitive : Entity |
14 | { | 15 | { |
15 | 16 | protected PrimData primData; | |
17 | //private ObjectUpdatePacket OurPacket; | ||
18 | private LLVector3 positionLastFrame = new LLVector3(0, 0, 0); | ||
19 | private Dictionary<uint, IClientAPI> m_clientThreads; | ||
20 | private ulong m_regionHandle; | ||
21 | private const uint FULL_MASK_PERMISSIONS = 2147483647; | ||
22 | private bool physicsEnabled = false; | ||
23 | |||
24 | private Dictionary<LLUUID, InventoryItem> inventoryItems; | ||
25 | |||
26 | #region Properties | ||
27 | |||
28 | public LLVector3 Scale | ||
29 | { | ||
30 | set | ||
31 | { | ||
32 | this.primData.Scale = value; | ||
33 | //this.dirtyFlag = true; | ||
34 | } | ||
35 | get | ||
36 | { | ||
37 | return this.primData.Scale; | ||
38 | } | ||
39 | } | ||
40 | |||
41 | public PhysicsActor PhysActor | ||
42 | { | ||
43 | set | ||
44 | { | ||
45 | this._physActor = value; | ||
46 | } | ||
47 | } | ||
48 | public override LLVector3 Pos | ||
49 | { | ||
50 | get | ||
51 | { | ||
52 | return base.Pos; | ||
53 | } | ||
54 | set | ||
55 | { | ||
56 | base.Pos = value; | ||
57 | } | ||
58 | } | ||
59 | #endregion | ||
60 | |||
61 | public Primitive(Dictionary<uint, IClientAPI> clientThreads, ulong regionHandle, World world) | ||
62 | { | ||
63 | m_clientThreads = clientThreads; | ||
64 | m_regionHandle = regionHandle; | ||
65 | m_world = world; | ||
66 | inventoryItems = new Dictionary<LLUUID, InventoryItem>(); | ||
67 | } | ||
68 | |||
69 | public Primitive(Dictionary<uint, IClientAPI> clientThreads, ulong regionHandle, World world, LLUUID owner) | ||
70 | { | ||
71 | m_clientThreads = clientThreads; | ||
72 | m_regionHandle = regionHandle; | ||
73 | m_world = world; | ||
74 | inventoryItems = new Dictionary<LLUUID, InventoryItem>(); | ||
75 | this.primData = new PrimData(); | ||
76 | this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
77 | this.primData.OwnerID = owner; | ||
78 | } | ||
79 | |||
80 | public byte[] GetByteArray() | ||
81 | { | ||
82 | byte[] result = null; | ||
83 | List<byte[]> dataArrays = new List<byte[]>(); | ||
84 | dataArrays.Add(primData.ToBytes()); | ||
85 | foreach (Entity child in children) | ||
86 | { | ||
87 | if (child is OpenSim.world.Primitive) | ||
88 | { | ||
89 | dataArrays.Add(((OpenSim.world.Primitive)child).GetByteArray()); | ||
90 | } | ||
91 | } | ||
92 | byte[] primstart = Helpers.StringToField("<Prim>"); | ||
93 | byte[] primend = Helpers.StringToField("</Prim>"); | ||
94 | int totalLength = primstart.Length + primend.Length; | ||
95 | for (int i = 0; i < dataArrays.Count; i++) | ||
96 | { | ||
97 | totalLength += dataArrays[i].Length; | ||
98 | } | ||
99 | |||
100 | result = new byte[totalLength]; | ||
101 | int arraypos = 0; | ||
102 | Array.Copy(primstart, 0, result, 0, primstart.Length); | ||
103 | arraypos += primstart.Length; | ||
104 | for (int i = 0; i < dataArrays.Count; i++) | ||
105 | { | ||
106 | Array.Copy(dataArrays[i], 0, result, arraypos, dataArrays[i].Length); | ||
107 | arraypos += dataArrays[i].Length; | ||
108 | } | ||
109 | Array.Copy(primend, 0, result, arraypos, primend.Length); | ||
110 | |||
111 | return result; | ||
112 | } | ||
113 | |||
114 | #region Overridden Methods | ||
115 | |||
116 | public override void update() | ||
117 | { | ||
118 | LLVector3 pos2 = new LLVector3(0, 0, 0); | ||
119 | } | ||
120 | |||
121 | public override void BackUp() | ||
122 | { | ||
123 | |||
124 | } | ||
125 | |||
126 | #endregion | ||
127 | |||
128 | #region Packet handlers | ||
129 | |||
130 | public void UpdatePosition(LLVector3 pos) | ||
131 | { | ||
132 | |||
133 | } | ||
134 | |||
135 | public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket) | ||
136 | { | ||
137 | this.primData.PathBegin = addPacket.PathBegin; | ||
138 | this.primData.PathEnd = addPacket.PathEnd; | ||
139 | this.primData.PathScaleX = addPacket.PathScaleX; | ||
140 | this.primData.PathScaleY = addPacket.PathScaleY; | ||
141 | this.primData.PathShearX = addPacket.PathShearX; | ||
142 | this.primData.PathShearY = addPacket.PathShearY; | ||
143 | this.primData.PathSkew = addPacket.PathSkew; | ||
144 | this.primData.ProfileBegin = addPacket.ProfileBegin; | ||
145 | this.primData.ProfileEnd = addPacket.ProfileEnd; | ||
146 | this.primData.PathCurve = addPacket.PathCurve; | ||
147 | this.primData.ProfileCurve = addPacket.ProfileCurve; | ||
148 | this.primData.ProfileHollow = addPacket.ProfileHollow; | ||
149 | this.primData.PathRadiusOffset = addPacket.PathRadiusOffset; | ||
150 | this.primData.PathRevolutions = addPacket.PathRevolutions; | ||
151 | this.primData.PathTaperX = addPacket.PathTaperX; | ||
152 | this.primData.PathTaperY = addPacket.PathTaperY; | ||
153 | this.primData.PathTwist = addPacket.PathTwist; | ||
154 | this.primData.PathTwistBegin = addPacket.PathTwistBegin; | ||
155 | } | ||
156 | |||
157 | public void UpdateTexture(byte[] tex) | ||
158 | { | ||
159 | this.primData.Texture = tex; | ||
160 | //this.dirtyFlag = true; | ||
161 | } | ||
162 | |||
163 | public void UpdateObjectFlags(ObjectFlagUpdatePacket pack) | ||
164 | { | ||
165 | |||
166 | } | ||
167 | |||
168 | public void AssignToParent(Primitive prim) | ||
169 | { | ||
170 | |||
171 | } | ||
172 | |||
173 | public void GetProperites(IClientAPI client) | ||
174 | { | ||
175 | ObjectPropertiesPacket proper = new ObjectPropertiesPacket(); | ||
176 | proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; | ||
177 | proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); | ||
178 | proper.ObjectData[0].ItemID = LLUUID.Zero; | ||
179 | proper.ObjectData[0].CreationDate = (ulong)this.primData.CreationDate; | ||
180 | proper.ObjectData[0].CreatorID = this.primData.OwnerID; | ||
181 | proper.ObjectData[0].FolderID = LLUUID.Zero; | ||
182 | proper.ObjectData[0].FromTaskID = LLUUID.Zero; | ||
183 | proper.ObjectData[0].GroupID = LLUUID.Zero; | ||
184 | proper.ObjectData[0].InventorySerial = 0; | ||
185 | proper.ObjectData[0].LastOwnerID = LLUUID.Zero; | ||
186 | proper.ObjectData[0].ObjectID = this.uuid; | ||
187 | proper.ObjectData[0].OwnerID = primData.OwnerID; | ||
188 | proper.ObjectData[0].TouchName = new byte[0]; | ||
189 | proper.ObjectData[0].TextureID = new byte[0]; | ||
190 | proper.ObjectData[0].SitName = new byte[0]; | ||
191 | proper.ObjectData[0].Name = new byte[0]; | ||
192 | proper.ObjectData[0].Description = new byte[0]; | ||
193 | proper.ObjectData[0].OwnerMask = this.primData.OwnerMask; | ||
194 | proper.ObjectData[0].NextOwnerMask = this.primData.NextOwnerMask; | ||
195 | proper.ObjectData[0].GroupMask = this.primData.GroupMask; | ||
196 | proper.ObjectData[0].EveryoneMask = this.primData.EveryoneMask; | ||
197 | proper.ObjectData[0].BaseMask = this.primData.BaseMask; | ||
198 | |||
199 | client.OutPacket(proper); | ||
200 | } | ||
201 | |||
202 | #endregion | ||
203 | |||
204 | # region Inventory Methods | ||
205 | |||
206 | public bool AddToInventory(InventoryItem item) | ||
207 | { | ||
208 | return false; | ||
209 | } | ||
210 | |||
211 | public InventoryItem RemoveFromInventory(LLUUID itemID) | ||
212 | { | ||
213 | return null; | ||
214 | } | ||
215 | |||
216 | public void RequestInventoryInfo(IClientAPI simClient, RequestTaskInventoryPacket packet) | ||
217 | { | ||
218 | |||
219 | } | ||
220 | |||
221 | public void RequestXferInventory(IClientAPI simClient, ulong xferID) | ||
222 | { | ||
223 | //will only currently work if the total size of the inventory data array is under about 1000 bytes | ||
224 | SendXferPacketPacket send = new SendXferPacketPacket(); | ||
225 | |||
226 | send.XferID.ID = xferID; | ||
227 | send.XferID.Packet = 1 + 2147483648; | ||
228 | send.DataPacket.Data = this.ConvertInventoryToBytes(); | ||
229 | |||
230 | simClient.OutPacket(send); | ||
231 | } | ||
232 | |||
233 | public byte[] ConvertInventoryToBytes() | ||
234 | { | ||
235 | System.Text.Encoding enc = System.Text.Encoding.ASCII; | ||
236 | byte[] result = new byte[0]; | ||
237 | List<byte[]> inventoryData = new List<byte[]>(); | ||
238 | int totallength = 0; | ||
239 | foreach (InventoryItem invItem in inventoryItems.Values) | ||
240 | { | ||
241 | byte[] data = enc.GetBytes(invItem.ExportString()); | ||
242 | inventoryData.Add(data); | ||
243 | totallength += data.Length; | ||
244 | } | ||
245 | //TODO: copy arrays into the single result array | ||
246 | |||
247 | return result; | ||
248 | } | ||
249 | |||
250 | public void CreateInventoryFromBytes(byte[] data) | ||
251 | { | ||
252 | |||
253 | } | ||
254 | |||
255 | #endregion | ||
256 | |||
257 | #region Update viewers Methods | ||
258 | |||
259 | //should change these mehtods, so that outgoing packets are sent through the avatar class | ||
260 | public void SendFullUpdateToClient(IClientAPI remoteClient) | ||
261 | { | ||
262 | LLVector3 lPos; | ||
263 | if (this._physActor != null && this.physicsEnabled) | ||
264 | { | ||
265 | PhysicsVector pPos = this._physActor.Position; | ||
266 | lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z); | ||
267 | } | ||
268 | else | ||
269 | { | ||
270 | lPos = this.Pos; | ||
271 | } | ||
272 | |||
273 | ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); | ||
274 | outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; | ||
275 | outPacket.ObjectData[0] = this.CreateUpdateBlock(); | ||
276 | byte[] pb = lPos.GetBytes(); | ||
277 | Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); | ||
278 | |||
279 | remoteClient.OutPacket(outPacket); | ||
280 | } | ||
281 | |||
282 | public void SendFullUpdateToAllClients() | ||
283 | { | ||
284 | |||
285 | } | ||
286 | |||
287 | public void SendTerseUpdateToClient(IClientAPI RemoteClient) | ||
288 | { | ||
289 | |||
290 | } | ||
291 | |||
292 | public void SendTerseUpdateToALLClients() | ||
293 | { | ||
294 | |||
295 | } | ||
296 | |||
297 | #endregion | ||
298 | |||
299 | #region Create Methods | ||
300 | |||
301 | public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID ownerID, uint localID) | ||
302 | { | ||
303 | PrimData PData = new PrimData(); | ||
304 | this.primData = PData; | ||
305 | this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
306 | |||
307 | PData.OwnerID = ownerID; | ||
308 | PData.PCode = addPacket.ObjectData.PCode; | ||
309 | PData.PathBegin = addPacket.ObjectData.PathBegin; | ||
310 | PData.PathEnd = addPacket.ObjectData.PathEnd; | ||
311 | PData.PathScaleX = addPacket.ObjectData.PathScaleX; | ||
312 | PData.PathScaleY = addPacket.ObjectData.PathScaleY; | ||
313 | PData.PathShearX = addPacket.ObjectData.PathShearX; | ||
314 | PData.PathShearY = addPacket.ObjectData.PathShearY; | ||
315 | PData.PathSkew = addPacket.ObjectData.PathSkew; | ||
316 | PData.ProfileBegin = addPacket.ObjectData.ProfileBegin; | ||
317 | PData.ProfileEnd = addPacket.ObjectData.ProfileEnd; | ||
318 | PData.Scale = addPacket.ObjectData.Scale; | ||
319 | PData.PathCurve = addPacket.ObjectData.PathCurve; | ||
320 | PData.ProfileCurve = addPacket.ObjectData.ProfileCurve; | ||
321 | PData.ParentID = 0; | ||
322 | PData.ProfileHollow = addPacket.ObjectData.ProfileHollow; | ||
323 | PData.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset; | ||
324 | PData.PathRevolutions = addPacket.ObjectData.PathRevolutions; | ||
325 | PData.PathTaperX = addPacket.ObjectData.PathTaperX; | ||
326 | PData.PathTaperY = addPacket.ObjectData.PathTaperY; | ||
327 | PData.PathTwist = addPacket.ObjectData.PathTwist; | ||
328 | PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin; | ||
329 | LLVector3 pos1 = addPacket.ObjectData.RayEnd; | ||
330 | this.primData.FullID = this.uuid = LLUUID.Random(); | ||
331 | this.localid = (uint)(localID); | ||
332 | this.primData.Position = this.Pos = pos1; | ||
333 | } | ||
334 | |||
335 | public void CreateFromBytes(byte[] data) | ||
336 | { | ||
337 | |||
338 | } | ||
339 | |||
340 | public void CreateFromPrimData(PrimData primData) | ||
341 | { | ||
342 | this.CreateFromPrimData(primData, primData.Position, primData.LocalID, false); | ||
343 | } | ||
344 | |||
345 | public void CreateFromPrimData(PrimData primData, LLVector3 posi, uint localID, bool newprim) | ||
346 | { | ||
347 | |||
348 | } | ||
349 | |||
350 | #endregion | ||
351 | |||
352 | #region Packet Update Methods | ||
353 | protected void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata) | ||
354 | { | ||
355 | objdata.PSBlock = new byte[0]; | ||
356 | objdata.ExtraParams = new byte[1]; | ||
357 | objdata.MediaURL = new byte[0]; | ||
358 | objdata.NameValue = new byte[0]; | ||
359 | objdata.Text = new byte[0]; | ||
360 | objdata.TextColor = new byte[4]; | ||
361 | objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0); | ||
362 | objdata.JointPivot = new LLVector3(0, 0, 0); | ||
363 | objdata.Material = 3; | ||
364 | objdata.TextureAnim = new byte[0]; | ||
365 | objdata.Sound = LLUUID.Zero; | ||
366 | LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); | ||
367 | this.primData.Texture = objdata.TextureEntry = ntex.ToBytes(); | ||
368 | objdata.State = 0; | ||
369 | objdata.Data = new byte[0]; | ||
370 | |||
371 | objdata.ObjectData = new byte[60]; | ||
372 | objdata.ObjectData[46] = 128; | ||
373 | objdata.ObjectData[47] = 63; | ||
374 | } | ||
375 | |||
376 | protected void SetPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData) | ||
377 | { | ||
378 | objectData.OwnerID = this.primData.OwnerID; | ||
379 | objectData.PCode = this.primData.PCode; | ||
380 | objectData.PathBegin = this.primData.PathBegin; | ||
381 | objectData.PathEnd = this.primData.PathEnd; | ||
382 | objectData.PathScaleX = this.primData.PathScaleX; | ||
383 | objectData.PathScaleY = this.primData.PathScaleY; | ||
384 | objectData.PathShearX = this.primData.PathShearX; | ||
385 | objectData.PathShearY = this.primData.PathShearY; | ||
386 | objectData.PathSkew = this.primData.PathSkew; | ||
387 | objectData.ProfileBegin = this.primData.ProfileBegin; | ||
388 | objectData.ProfileEnd = this.primData.ProfileEnd; | ||
389 | objectData.Scale = this.primData.Scale; | ||
390 | objectData.PathCurve = this.primData.PathCurve; | ||
391 | objectData.ProfileCurve = this.primData.ProfileCurve; | ||
392 | objectData.ParentID = this.primData.ParentID; | ||
393 | objectData.ProfileHollow = this.primData.ProfileHollow; | ||
394 | objectData.PathRadiusOffset = this.primData.PathRadiusOffset; | ||
395 | objectData.PathRevolutions = this.primData.PathRevolutions; | ||
396 | objectData.PathTaperX = this.primData.PathTaperX; | ||
397 | objectData.PathTaperY = this.primData.PathTaperY; | ||
398 | objectData.PathTwist = this.primData.PathTwist; | ||
399 | objectData.PathTwistBegin = this.primData.PathTwistBegin; | ||
400 | } | ||
401 | |||
402 | #endregion | ||
403 | protected ObjectUpdatePacket.ObjectDataBlock CreateUpdateBlock() | ||
404 | { | ||
405 | ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock(); | ||
406 | this.SetDefaultPacketValues(objupdate); | ||
407 | objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; | ||
408 | this.SetPacketShapeData(objupdate); | ||
409 | byte[] pb = this.Pos.GetBytes(); | ||
410 | Array.Copy(pb, 0, objupdate.ObjectData, 0, pb.Length); | ||
411 | return objupdate; | ||
412 | } | ||
413 | |||
414 | protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateImprovedBlock() | ||
415 | { | ||
416 | uint ID = this.localid; | ||
417 | byte[] bytes = new byte[60]; | ||
418 | |||
419 | int i = 0; | ||
420 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); | ||
421 | dat.TextureEntry = new byte[0]; | ||
422 | bytes[i++] = (byte)(ID % 256); | ||
423 | bytes[i++] = (byte)((ID >> 8) % 256); | ||
424 | bytes[i++] = (byte)((ID >> 16) % 256); | ||
425 | bytes[i++] = (byte)((ID >> 24) % 256); | ||
426 | bytes[i++] = 0; | ||
427 | bytes[i++] = 0; | ||
428 | |||
429 | LLVector3 lPos; | ||
430 | Axiom.MathLib.Quaternion lRot; | ||
431 | if (this._physActor != null && this.physicsEnabled) | ||
432 | { | ||
433 | PhysicsVector pPos = this._physActor.Position; | ||
434 | lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z); | ||
435 | lRot = this._physActor.Orientation; | ||
436 | } | ||
437 | else | ||
438 | { | ||
439 | lPos = this.Pos; | ||
440 | lRot = this.rotation; | ||
441 | } | ||
442 | byte[] pb = lPos.GetBytes(); | ||
443 | Array.Copy(pb, 0, bytes, i, pb.Length); | ||
444 | i += 12; | ||
445 | ushort ac = 32767; | ||
446 | |||
447 | //vel | ||
448 | bytes[i++] = (byte)(ac % 256); | ||
449 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
450 | bytes[i++] = (byte)(ac % 256); | ||
451 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
452 | bytes[i++] = (byte)(ac % 256); | ||
453 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
454 | |||
455 | //accel | ||
456 | bytes[i++] = (byte)(ac % 256); | ||
457 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
458 | bytes[i++] = (byte)(ac % 256); | ||
459 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
460 | bytes[i++] = (byte)(ac % 256); | ||
461 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
462 | |||
463 | ushort rw, rx, ry, rz; | ||
464 | rw = (ushort)(32768 * (lRot.w + 1)); | ||
465 | rx = (ushort)(32768 * (lRot.x + 1)); | ||
466 | ry = (ushort)(32768 * (lRot.y + 1)); | ||
467 | rz = (ushort)(32768 * (lRot.z + 1)); | ||
468 | |||
469 | //rot | ||
470 | bytes[i++] = (byte)(rx % 256); | ||
471 | bytes[i++] = (byte)((rx >> 8) % 256); | ||
472 | bytes[i++] = (byte)(ry % 256); | ||
473 | bytes[i++] = (byte)((ry >> 8) % 256); | ||
474 | bytes[i++] = (byte)(rz % 256); | ||
475 | bytes[i++] = (byte)((rz >> 8) % 256); | ||
476 | bytes[i++] = (byte)(rw % 256); | ||
477 | bytes[i++] = (byte)((rw >> 8) % 256); | ||
478 | |||
479 | //rotation vel | ||
480 | bytes[i++] = (byte)(ac % 256); | ||
481 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
482 | bytes[i++] = (byte)(ac % 256); | ||
483 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
484 | bytes[i++] = (byte)(ac % 256); | ||
485 | bytes[i++] = (byte)((ac >> 8) % 256); | ||
486 | |||
487 | dat.Data = bytes; | ||
488 | return dat; | ||
489 | } | ||
16 | } | 490 | } |
17 | } | 491 | } |
diff --git a/OpenSim/OpenSim.World/SceneObject.cs b/OpenSim/OpenSim.World/SceneObject.cs index a846fb5..d78c7a2 100644 --- a/OpenSim/OpenSim.World/SceneObject.cs +++ b/OpenSim/OpenSim.World/SceneObject.cs | |||
@@ -14,8 +14,8 @@ namespace OpenSim.world | |||
14 | public class SceneObject : Entity | 14 | public class SceneObject : Entity |
15 | { | 15 | { |
16 | private LLUUID rootUUID; | 16 | private LLUUID rootUUID; |
17 | private Dictionary<LLUUID, Primitive2> ChildPrimitives = new Dictionary<LLUUID, Primitive2>(); | 17 | private Dictionary<LLUUID, Primitive> ChildPrimitives = new Dictionary<LLUUID, Primitive>(); |
18 | private Dictionary<uint, ClientView> m_clientThreads; | 18 | private Dictionary<uint, IClientAPI> m_clientThreads; |
19 | private World m_world; | 19 | private World m_world; |
20 | 20 | ||
21 | public SceneObject() | 21 | public SceneObject() |
@@ -42,7 +42,7 @@ namespace OpenSim.world | |||
42 | 42 | ||
43 | } | 43 | } |
44 | 44 | ||
45 | public void GetProperites(ClientView client) | 45 | public void GetProperites(IClientAPI client) |
46 | { | 46 | { |
47 | /* | 47 | /* |
48 | ObjectPropertiesPacket proper = new ObjectPropertiesPacket(); | 48 | ObjectPropertiesPacket proper = new ObjectPropertiesPacket(); |
diff --git a/OpenSim/OpenSim.World/World.PacketHandlers.cs b/OpenSim/OpenSim.World/World.PacketHandlers.cs index ee5a23a..3357536 100644 --- a/OpenSim/OpenSim.World/World.PacketHandlers.cs +++ b/OpenSim/OpenSim.World/World.PacketHandlers.cs | |||
@@ -6,10 +6,8 @@ using libsecondlife.Packets; | |||
6 | using OpenSim.Physics.Manager; | 6 | using OpenSim.Physics.Manager; |
7 | using OpenSim.Framework.Interfaces; | 7 | using OpenSim.Framework.Interfaces; |
8 | using OpenSim.Framework.Types; | 8 | using OpenSim.Framework.Types; |
9 | using OpenSim.Framework.Terrain; | ||
10 | using OpenSim.Framework.Inventory; | 9 | using OpenSim.Framework.Inventory; |
11 | using OpenSim.Framework.Utilities; | 10 | using OpenSim.Framework.Utilities; |
12 | using OpenSim.Assets; | ||
13 | 11 | ||
14 | namespace OpenSim.world | 12 | namespace OpenSim.world |
15 | { | 13 | { |
@@ -35,10 +33,10 @@ namespace OpenSim.world | |||
35 | 33 | ||
36 | public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) | 34 | public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) |
37 | { | 35 | { |
38 | foreach (ClientView client in m_clientThreads.Values) | 36 | foreach (IClientAPI client in m_clientThreads.Values) |
39 | { | 37 | { |
40 | // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); | 38 | // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); |
41 | int dis = (int)client.ClientAvatar.Pos.GetDistanceTo(fromPos); | 39 | int dis = 0; // (int)client.ClientAvatar.Pos.GetDistanceTo(fromPos); |
42 | 40 | ||
43 | switch (type) | 41 | switch (type) |
44 | { | 42 | { |
@@ -72,190 +70,57 @@ namespace OpenSim.world | |||
72 | 70 | ||
73 | public void RezObject(AssetBase primAsset, LLVector3 pos) | 71 | public void RezObject(AssetBase primAsset, LLVector3 pos) |
74 | { | 72 | { |
75 | PrimData primd = new PrimData(primAsset.Data); | 73 | |
76 | Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this); | ||
77 | nPrim.CreateFromStorage(primd, pos, this._primCount, true); | ||
78 | this.Entities.Add(nPrim.uuid, nPrim); | ||
79 | this._primCount++; | ||
80 | } | 74 | } |
81 | 75 | ||
82 | public void DeRezObject(Packet packet, ClientView simClient) | 76 | public void DeRezObject(Packet packet, IClientAPI simClient) |
83 | { | 77 | { |
84 | DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)packet; | 78 | |
85 | |||
86 | //Needs to delete object from physics at a later date | ||
87 | if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero) | ||
88 | { | ||
89 | //currently following code not used (or don't know of any case of destination being zero | ||
90 | |||
91 | } | ||
92 | else | ||
93 | { | ||
94 | foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) | ||
95 | { | ||
96 | Entity selectedEnt = null; | ||
97 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); | ||
98 | foreach (Entity ent in this.Entities.Values) | ||
99 | { | ||
100 | if (ent.localid == Data.ObjectLocalID) | ||
101 | { | ||
102 | AssetBase primAsset = new AssetBase(); | ||
103 | primAsset.FullID = LLUUID.Random();//DeRezPacket.AgentBlock.TransactionID.Combine(LLUUID.Zero); //should be combining with securesessionid | ||
104 | primAsset.InvType = 6; | ||
105 | primAsset.Type = 6; | ||
106 | primAsset.Name = "Prim"; | ||
107 | primAsset.Description = ""; | ||
108 | primAsset.Data = ((Primitive)ent).GetByteArray(); | ||
109 | this._assetCache.AddAsset(primAsset); | ||
110 | this._inventoryCache.AddNewInventoryItem(simClient, DeRezPacket.AgentBlock.DestinationID, primAsset); | ||
111 | selectedEnt = ent; | ||
112 | break; | ||
113 | } | ||
114 | } | ||
115 | if (selectedEnt != null) | ||
116 | { | ||
117 | this.localStorage.RemovePrim(selectedEnt.uuid); | ||
118 | KillObjectPacket kill = new KillObjectPacket(); | ||
119 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; | ||
120 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); | ||
121 | kill.ObjectData[0].ID = selectedEnt.localid; | ||
122 | foreach (ClientView client in m_clientThreads.Values) | ||
123 | { | ||
124 | client.OutPacket(kill); | ||
125 | } | ||
126 | lock (Entities) | ||
127 | { | ||
128 | Entities.Remove(selectedEnt.uuid); | ||
129 | } | ||
130 | } | ||
131 | } | ||
132 | } | ||
133 | |||
134 | } | 79 | } |
135 | 80 | ||
136 | public void SendAvatarsToClient(ClientView remoteClient) | 81 | public void SendAvatarsToClient(IClientAPI remoteClient) |
137 | { | 82 | { |
138 | foreach (ClientView client in m_clientThreads.Values) | 83 | |
139 | { | ||
140 | if (client.AgentID != remoteClient.AgentID) | ||
141 | { | ||
142 | // ObjectUpdatePacket objupdate = client.ClientAvatar.CreateUpdatePacket(); | ||
143 | // RemoteClient.OutPacket(objupdate); | ||
144 | client.ClientAvatar.SendUpdateToOtherClient(remoteClient.ClientAvatar); | ||
145 | client.ClientAvatar.SendAppearanceToOtherAgent(remoteClient.ClientAvatar); | ||
146 | } | ||
147 | } | ||
148 | } | 84 | } |
149 | 85 | ||
150 | public void LinkObjects(uint parentPrim, List<uint> childPrims) | 86 | public void LinkObjects(uint parentPrim, List<uint> childPrims) |
151 | { | 87 | { |
152 | Primitive parentprim = null; | 88 | |
153 | foreach (Entity ent in Entities.Values) | ||
154 | { | ||
155 | if (ent.localid == parentPrim) | ||
156 | { | ||
157 | parentprim = (OpenSim.world.Primitive)ent; | ||
158 | |||
159 | } | ||
160 | } | ||
161 | |||
162 | for (int i = 0; i < childPrims.Count; i++) | ||
163 | { | ||
164 | uint childId = childPrims[i]; | ||
165 | foreach (Entity ent in Entities.Values) | ||
166 | { | ||
167 | if (ent.localid == childId) | ||
168 | { | ||
169 | ((OpenSim.world.Primitive)ent).MakeParent(parentprim); | ||
170 | } | ||
171 | } | ||
172 | } | ||
173 | 89 | ||
174 | } | 90 | } |
175 | 91 | ||
176 | public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock) | 92 | public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock) |
177 | { | 93 | { |
178 | foreach (Entity ent in Entities.Values) | 94 | |
179 | { | ||
180 | if (ent.localid == primLocalID) | ||
181 | { | ||
182 | ((OpenSim.world.Primitive)ent).UpdateShape(shapeBlock); | ||
183 | break; | ||
184 | } | ||
185 | } | ||
186 | } | 95 | } |
187 | 96 | ||
188 | public void SelectPrim(uint primLocalID, ClientView remoteClient) | 97 | public void SelectPrim(uint primLocalID, IClientAPI remoteClient) |
189 | { | 98 | { |
190 | foreach (Entity ent in Entities.Values) | 99 | |
191 | { | ||
192 | if (ent.localid == primLocalID) | ||
193 | { | ||
194 | ((OpenSim.world.Primitive)ent).GetProperites(remoteClient); | ||
195 | break; | ||
196 | } | ||
197 | } | ||
198 | } | 100 | } |
199 | 101 | ||
200 | public void UpdatePrimFlags(uint localID, Packet packet, ClientView remoteClient) | 102 | public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient) |
201 | { | 103 | { |
202 | foreach (Entity ent in Entities.Values) | 104 | |
203 | { | ||
204 | if (ent.localid == localID) | ||
205 | { | ||
206 | ((OpenSim.world.Primitive)ent).UpdateObjectFlags((ObjectFlagUpdatePacket) packet); | ||
207 | break; | ||
208 | } | ||
209 | } | ||
210 | } | 105 | } |
211 | 106 | ||
212 | public void UpdatePrimTexture(uint localID, byte[] texture, ClientView remoteClient) | 107 | public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient) |
213 | { | 108 | { |
214 | foreach (Entity ent in Entities.Values) | 109 | |
215 | { | ||
216 | if (ent.localid == localID) | ||
217 | { | ||
218 | ((OpenSim.world.Primitive)ent).UpdateTexture(texture); | ||
219 | break; | ||
220 | } | ||
221 | } | ||
222 | } | 110 | } |
223 | 111 | ||
224 | public void UpdatePrimPosition(uint localID, LLVector3 pos, ClientView remoteClient) | 112 | public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient) |
225 | { | 113 | { |
226 | foreach (Entity ent in Entities.Values) | 114 | |
227 | { | ||
228 | if (ent.localid == localID) | ||
229 | { | ||
230 | ((OpenSim.world.Primitive)ent).UpdatePosition(pos); | ||
231 | break; | ||
232 | } | ||
233 | } | ||
234 | } | 115 | } |
235 | 116 | ||
236 | public void UpdatePrimRotation(uint localID, LLQuaternion rot, ClientView remoteClient) | 117 | public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) |
237 | { | 118 | { |
238 | foreach (Entity ent in Entities.Values) | 119 | |
239 | { | ||
240 | if (ent.localid == localID) | ||
241 | { | ||
242 | ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z); | ||
243 | ((OpenSim.world.Primitive)ent).UpdateFlag = true; | ||
244 | break; | ||
245 | } | ||
246 | } | ||
247 | } | 120 | } |
248 | 121 | ||
249 | public void UpdatePrimScale(uint localID, LLVector3 scale, ClientView remoteClient) | 122 | public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient) |
250 | { | 123 | { |
251 | foreach (Entity ent in Entities.Values) | ||
252 | { | ||
253 | if (ent.localid == localID) | ||
254 | { | ||
255 | ((OpenSim.world.Primitive)ent).Scale = scale; | ||
256 | break; | ||
257 | } | ||
258 | } | ||
259 | } | 124 | } |
260 | } | 125 | } |
261 | } | 126 | } |
diff --git a/OpenSim/OpenSim.World/World.Scripting.cs b/OpenSim/OpenSim.World/World.Scripting.cs index 44ef05a..24d887c 100644 --- a/OpenSim/OpenSim.World/World.Scripting.cs +++ b/OpenSim/OpenSim.World/World.Scripting.cs | |||
@@ -96,7 +96,7 @@ namespace OpenSim.world | |||
96 | pos.Y = y; | 96 | pos.Y = y; |
97 | Primitive prim = entity as Primitive; | 97 | Primitive prim = entity as Primitive; |
98 | // Of course, we really should have asked the physEngine if this is possible, and if not, returned false. | 98 | // Of course, we really should have asked the physEngine if this is possible, and if not, returned false. |
99 | prim.UpdatePosition(pos); | 99 | //prim.UpdatePosition(pos); |
100 | // Console.WriteLine("script- setting entity " + localID + " positon"); | 100 | // Console.WriteLine("script- setting entity " + localID + " positon"); |
101 | } | 101 | } |
102 | } | 102 | } |
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs index d840d10..2580761 100644 --- a/OpenSim/OpenSim.World/World.cs +++ b/OpenSim/OpenSim.World/World.cs | |||
@@ -6,13 +6,11 @@ using System.Text; | |||
6 | using System.Reflection; | 6 | using System.Reflection; |
7 | using System.IO; | 7 | using System.IO; |
8 | using System.Threading; | 8 | using System.Threading; |
9 | using System.Timers; | ||
9 | using OpenSim.Physics.Manager; | 10 | using OpenSim.Physics.Manager; |
10 | using OpenSim.Framework.Interfaces; | 11 | using OpenSim.Framework.Interfaces; |
11 | using OpenSim.Framework.Types; | 12 | using OpenSim.Framework.Types; |
12 | using OpenSim.Framework.Terrain; | ||
13 | using OpenSim.Framework.Inventory; | 13 | using OpenSim.Framework.Inventory; |
14 | using OpenSim.Assets; | ||
15 | //using OpenSim.world.scripting; | ||
16 | using OpenSim.RegionServer.world.scripting; | 14 | using OpenSim.RegionServer.world.scripting; |
17 | using OpenSim.Terrain; | 15 | using OpenSim.Terrain; |
18 | 16 | ||
@@ -20,6 +18,7 @@ namespace OpenSim.world | |||
20 | { | 18 | { |
21 | public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI | 19 | public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI |
22 | { | 20 | { |
21 | protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer(); | ||
23 | public object LockPhysicsEngine = new object(); | 22 | public object LockPhysicsEngine = new object(); |
24 | public Dictionary<libsecondlife.LLUUID, Avatar> Avatars; | 23 | public Dictionary<libsecondlife.LLUUID, Avatar> Avatars; |
25 | public Dictionary<libsecondlife.LLUUID, Primitive> Prims; | 24 | public Dictionary<libsecondlife.LLUUID, Primitive> Prims; |
@@ -57,15 +56,16 @@ namespace OpenSim.world | |||
57 | /// <param name="clientThreads">Dictionary to contain client threads</param> | 56 | /// <param name="clientThreads">Dictionary to contain client threads</param> |
58 | /// <param name="regionHandle">Region Handle for this region</param> | 57 | /// <param name="regionHandle">Region Handle for this region</param> |
59 | /// <param name="regionName">Region Name for this region</param> | 58 | /// <param name="regionName">Region Name for this region</param> |
60 | public World(Dictionary<uint, IClientAPI> clientThreads, RegionInfo regInfo, ulong regionHandle, string regionName) | 59 | public World(Dictionary<uint, IClientAPI> clientThreads, RegionInfo regInfo) |
61 | { | 60 | { |
62 | try | 61 | try |
63 | { | 62 | { |
64 | updateLock = new Mutex(false); | 63 | updateLock = new Mutex(false); |
65 | m_clientThreads = clientThreads; | 64 | m_clientThreads = clientThreads; |
66 | m_regionHandle = regionHandle; | ||
67 | m_regionName = regionName; | ||
68 | m_regInfo = regInfo; | 65 | m_regInfo = regInfo; |
66 | m_regionHandle = m_regInfo.RegionHandle; | ||
67 | m_regionName = m_regInfo.RegionName; | ||
68 | this.m_datastore = m_regInfo.DataStore; | ||
69 | 69 | ||
70 | m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>(); | 70 | m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>(); |
71 | m_scripts = new Dictionary<string, ScriptFactory>(); | 71 | m_scripts = new Dictionary<string, ScriptFactory>(); |
@@ -85,6 +85,8 @@ namespace OpenSim.world | |||
85 | Avatar.LoadAnims(); | 85 | Avatar.LoadAnims(); |
86 | this.SetDefaultScripts(); | 86 | this.SetDefaultScripts(); |
87 | this.LoadScriptEngines(); | 87 | this.LoadScriptEngines(); |
88 | |||
89 | |||
88 | } | 90 | } |
89 | catch (Exception e) | 91 | catch (Exception e) |
90 | { | 92 | { |
@@ -93,6 +95,13 @@ namespace OpenSim.world | |||
93 | } | 95 | } |
94 | #endregion | 96 | #endregion |
95 | 97 | ||
98 | public void StartTimer() | ||
99 | { | ||
100 | m_heartbeatTimer.Enabled = true; | ||
101 | m_heartbeatTimer.Interval = 100; | ||
102 | m_heartbeatTimer.Elapsed += new ElapsedEventHandler(this.Heartbeat); | ||
103 | } | ||
104 | |||
96 | #region Script Methods | 105 | #region Script Methods |
97 | /// <summary> | 106 | /// <summary> |
98 | /// Loads a new script into the specified entity | 107 | /// Loads a new script into the specified entity |
@@ -167,6 +176,18 @@ namespace OpenSim.world | |||
167 | #endregion | 176 | #endregion |
168 | 177 | ||
169 | #region Update Methods | 178 | #region Update Methods |
179 | |||
180 | |||
181 | /// <summary> | ||
182 | /// Performs per-frame updates regularly | ||
183 | /// </summary> | ||
184 | /// <param name="sender"></param> | ||
185 | /// <param name="e"></param> | ||
186 | void Heartbeat(object sender, System.EventArgs e) | ||
187 | { | ||
188 | this.Update(); | ||
189 | } | ||
190 | |||
170 | /// <summary> | 191 | /// <summary> |
171 | /// Performs per-frame updates on the world, this should be the central world loop | 192 | /// Performs per-frame updates on the world, this should be the central world loop |
172 | /// </summary> | 193 | /// </summary> |
@@ -327,7 +348,7 @@ namespace OpenSim.world | |||
327 | } | 348 | } |
328 | this.localStorage.SaveMap(this.Terrain.getHeights1D()); | 349 | this.localStorage.SaveMap(this.Terrain.getHeights1D()); |
329 | 350 | ||
330 | foreach (ClientView client in m_clientThreads.Values) | 351 | foreach (IClientAPI client in m_clientThreads.Values) |
331 | { | 352 | { |
332 | this.SendLayerData(client); | 353 | this.SendLayerData(client); |
333 | } | 354 | } |
@@ -358,7 +379,7 @@ namespace OpenSim.world | |||
358 | } | 379 | } |
359 | this.localStorage.SaveMap(this.Terrain.getHeights1D()); | 380 | this.localStorage.SaveMap(this.Terrain.getHeights1D()); |
360 | 381 | ||
361 | foreach (ClientView client in m_clientThreads.Values) | 382 | foreach (IClientAPI client in m_clientThreads.Values) |
362 | { | 383 | { |
363 | this.SendLayerData(client); | 384 | this.SendLayerData(client); |
364 | } | 385 | } |
@@ -388,7 +409,7 @@ namespace OpenSim.world | |||
388 | { | 409 | { |
389 | /* Dont save here, rely on tainting system instead */ | 410 | /* Dont save here, rely on tainting system instead */ |
390 | 411 | ||
391 | foreach (ClientView client in m_clientThreads.Values) | 412 | foreach (IClientAPI client in m_clientThreads.Values) |
392 | { | 413 | { |
393 | this.SendLayerData(pointx, pointy, client); | 414 | this.SendLayerData(pointx, pointy, client); |
394 | } | 415 | } |
@@ -436,23 +457,9 @@ namespace OpenSim.world | |||
436 | /// Sends prims to a client | 457 | /// Sends prims to a client |
437 | /// </summary> | 458 | /// </summary> |
438 | /// <param name="RemoteClient">Client to send to</param> | 459 | /// <param name="RemoteClient">Client to send to</param> |
439 | public void GetInitialPrims(ClientView RemoteClient) | 460 | public void GetInitialPrims(IClientAPI RemoteClient) |
440 | { | 461 | { |
441 | try | 462 | |
442 | { | ||
443 | foreach (libsecondlife.LLUUID UUID in Entities.Keys) | ||
444 | { | ||
445 | if (Entities[UUID] is Primitive) | ||
446 | { | ||
447 | Primitive primitive = Entities[UUID] as Primitive; | ||
448 | primitive.UpdateClient(RemoteClient); | ||
449 | } | ||
450 | } | ||
451 | } | ||
452 | catch (Exception e) | ||
453 | { | ||
454 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: GetInitialPrims() - Failed with exception " + e.ToString()); | ||
455 | } | ||
456 | } | 463 | } |
457 | 464 | ||
458 | /// <summary> | 465 | /// <summary> |
@@ -477,67 +484,32 @@ namespace OpenSim.world | |||
477 | /// <param name="prim">The object to load</param> | 484 | /// <param name="prim">The object to load</param> |
478 | public void PrimFromStorage(PrimData prim) | 485 | public void PrimFromStorage(PrimData prim) |
479 | { | 486 | { |
480 | try | 487 | |
481 | { | ||
482 | if (prim.LocalID >= this._primCount) | ||
483 | { | ||
484 | _primCount = prim.LocalID + 1; | ||
485 | } | ||
486 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: PrimFromStorage() - Reloading prim (localId " + prim.LocalID + " ) from storage"); | ||
487 | Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this); | ||
488 | nPrim.CreateFromStorage(prim); | ||
489 | this.Entities.Add(nPrim.uuid, nPrim); | ||
490 | } | ||
491 | catch (Exception e) | ||
492 | { | ||
493 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: PrimFromStorage() - Failed with exception " + e.ToString()); | ||
494 | } | ||
495 | } | 488 | } |
496 | 489 | ||
497 | public void AddNewPrim(Packet addPacket, ClientView agentClient) | 490 | public void AddNewPrim(Packet addPacket, IClientAPI agentClient) |
498 | { | 491 | { |
499 | AddNewPrim((ObjectAddPacket)addPacket, agentClient.AgentID); | 492 | AddNewPrim((ObjectAddPacket)addPacket, agentClient.AgentId); |
500 | } | 493 | } |
501 | 494 | ||
502 | public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID) | 495 | public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID) |
503 | { | 496 | { |
504 | try | 497 | |
505 | { | ||
506 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: AddNewPrim() - Creating new prim"); | ||
507 | Primitive prim = new Primitive(m_clientThreads, m_regionHandle, this); | ||
508 | prim.CreateFromPacket(addPacket, ownerID, this._primCount); | ||
509 | PhysicsVector pVec = new PhysicsVector(prim.Pos.X, prim.Pos.Y, prim.Pos.Z); | ||
510 | PhysicsVector pSize = new PhysicsVector(0.255f, 0.255f, 0.255f); | ||
511 | if (OpenSim.world.Avatar.PhysicsEngineFlying) | ||
512 | { | ||
513 | lock (this.LockPhysicsEngine) | ||
514 | { | ||
515 | prim.PhysActor = this.phyScene.AddPrim(pVec, pSize); | ||
516 | } | ||
517 | } | ||
518 | |||
519 | this.Entities.Add(prim.uuid, prim); | ||
520 | this._primCount++; | ||
521 | } | ||
522 | catch (Exception e) | ||
523 | { | ||
524 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddNewPrim() - Failed with exception " + e.ToString()); | ||
525 | } | ||
526 | } | 498 | } |
527 | 499 | ||
528 | #endregion | 500 | #endregion |
529 | 501 | ||
530 | #region Add/Remove Avatar Methods | 502 | #region Add/Remove Avatar Methods |
531 | 503 | ||
532 | public override Avatar AddViewerAgent(ClientView agentClient) | 504 | public override bool AddNewAvatar(IClientAPI agentClient, bool child) |
533 | { | 505 | { |
534 | Avatar newAvatar = null; | 506 | |
535 | return newAvatar; | 507 | return false; |
536 | } | 508 | } |
537 | 509 | ||
538 | public override void RemoveViewerAgent(ClientView agentClient) | 510 | public override bool RemoveAvatar(LLUUID agentID) |
539 | { | 511 | { |
540 | 512 | return false; | |
541 | } | 513 | } |
542 | #endregion | 514 | #endregion |
543 | 515 | ||
diff --git a/OpenSim/OpenSim.World/WorldBase.cs b/OpenSim/OpenSim.World/WorldBase.cs index 8fe98d3..33952bf 100644 --- a/OpenSim/OpenSim.World/WorldBase.cs +++ b/OpenSim/OpenSim.World/WorldBase.cs | |||
@@ -9,28 +9,27 @@ using System.Threading; | |||
9 | using OpenSim.Physics.Manager; | 9 | using OpenSim.Physics.Manager; |
10 | using OpenSim.Framework.Interfaces; | 10 | using OpenSim.Framework.Interfaces; |
11 | using OpenSim.Framework.Types; | 11 | using OpenSim.Framework.Types; |
12 | using OpenSim.Framework.Terrain; | ||
13 | using OpenSim.Framework.Inventory; | 12 | using OpenSim.Framework.Inventory; |
14 | using OpenSim.Assets; | ||
15 | using OpenSim.RegionServer.world.scripting; | 13 | using OpenSim.RegionServer.world.scripting; |
16 | using OpenSim.Terrain; | 14 | using OpenSim.Terrain; |
17 | 15 | ||
18 | namespace OpenSim.world | 16 | namespace OpenSim.world |
19 | { | 17 | { |
20 | public class WorldBase | 18 | public class WorldBase : IWorld |
21 | { | 19 | { |
22 | public Dictionary<libsecondlife.LLUUID, Entity> Entities; | 20 | public Dictionary<libsecondlife.LLUUID, Entity> Entities; |
23 | protected Dictionary<uint, IClientAPI> m_clientThreads; | 21 | protected Dictionary<uint, IClientAPI> m_clientThreads; |
24 | protected ulong m_regionHandle; | 22 | protected ulong m_regionHandle; |
25 | protected string m_regionName; | 23 | protected string m_regionName; |
26 | protected InventoryCache _inventoryCache; | 24 | // protected InventoryCache _inventoryCache; |
27 | protected AssetCache _assetCache; | 25 | // protected AssetCache _assetCache; |
28 | protected RegionInfo m_regInfo; | 26 | protected RegionInfo m_regInfo; |
29 | 27 | ||
30 | public TerrainEngine Terrain; //TODO: Replace TerrainManager with this. | 28 | public TerrainEngine Terrain; //TODO: Replace TerrainManager with this. |
31 | protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine | 29 | protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine |
32 | 30 | ||
33 | #region Properties | 31 | #region Properties |
32 | /* | ||
34 | public InventoryCache InventoryCache | 33 | public InventoryCache InventoryCache |
35 | { | 34 | { |
36 | set | 35 | set |
@@ -46,6 +45,7 @@ namespace OpenSim.world | |||
46 | this._assetCache = value; | 45 | this._assetCache = value; |
47 | } | 46 | } |
48 | } | 47 | } |
48 | */ | ||
49 | #endregion | 49 | #endregion |
50 | 50 | ||
51 | #region Constructors | 51 | #region Constructors |
@@ -56,14 +56,7 @@ namespace OpenSim.world | |||
56 | #endregion | 56 | #endregion |
57 | 57 | ||
58 | #region Setup Methods | 58 | #region Setup Methods |
59 | /// <summary> | 59 | |
60 | /// Register Packet handler Methods with the packet server (which will register them with the SimClient) | ||
61 | /// </summary> | ||
62 | /// <param name="packetServer"></param> | ||
63 | public virtual void RegisterPacketHandlers(PacketServer packetServer) | ||
64 | { | ||
65 | |||
66 | } | ||
67 | #endregion | 60 | #endregion |
68 | 61 | ||
69 | #region Update Methods | 62 | #region Update Methods |
@@ -90,7 +83,7 @@ namespace OpenSim.world | |||
90 | /// Send the region heightmap to the client | 83 | /// Send the region heightmap to the client |
91 | /// </summary> | 84 | /// </summary> |
92 | /// <param name="RemoteClient">Client to send to</param> | 85 | /// <param name="RemoteClient">Client to send to</param> |
93 | public virtual void SendLayerData(ClientView RemoteClient) | 86 | public virtual void SendLayerData(IClientAPI RemoteClient) |
94 | { | 87 | { |
95 | try | 88 | try |
96 | { | 89 | { |
@@ -122,7 +115,7 @@ namespace OpenSim.world | |||
122 | /// <param name="px">Patch coordinate (x) 0..16</param> | 115 | /// <param name="px">Patch coordinate (x) 0..16</param> |
123 | /// <param name="py">Patch coordinate (y) 0..16</param> | 116 | /// <param name="py">Patch coordinate (y) 0..16</param> |
124 | /// <param name="RemoteClient">The client to send to</param> | 117 | /// <param name="RemoteClient">The client to send to</param> |
125 | public void SendLayerData(int px, int py, ClientView RemoteClient) | 118 | public void SendLayerData(int px, int py, IClientAPI RemoteClient) |
126 | { | 119 | { |
127 | try | 120 | try |
128 | { | 121 | { |
@@ -144,25 +137,23 @@ namespace OpenSim.world | |||
144 | #endregion | 137 | #endregion |
145 | 138 | ||
146 | #region Add/Remove Agent/Avatar | 139 | #region Add/Remove Agent/Avatar |
147 | /// <summary> | 140 | public virtual bool AddNewAvatar(IClientAPI remoteClient, bool child) |
148 | /// Add a new Agent's avatar | ||
149 | /// </summary> | ||
150 | /// <param name="agentClient"></param> | ||
151 | public virtual Avatar AddViewerAgent(ClientView agentClient) | ||
152 | { | 141 | { |
153 | return null; | 142 | return false; |
154 | } | 143 | } |
155 | 144 | ||
156 | /// <summary> | 145 | public virtual bool RemoveAvatar(LLUUID agentID) |
157 | /// Remove a Agent's avatar | ||
158 | /// </summary> | ||
159 | /// <param name="agentClient"></param> | ||
160 | public virtual void RemoveViewerAgent(ClientView agentClient) | ||
161 | { | 146 | { |
162 | 147 | return false; | |
163 | } | 148 | } |
149 | |||
164 | #endregion | 150 | #endregion |
165 | 151 | ||
152 | public virtual RegionInfo GetRegionInfo() | ||
153 | { | ||
154 | return null; | ||
155 | } | ||
156 | |||
166 | #region Shutdown | 157 | #region Shutdown |
167 | /// <summary> | 158 | /// <summary> |
168 | /// Tidy before shutdown | 159 | /// Tidy before shutdown |
diff --git a/OpenSim/OpenSim.World/scripting/IScriptHandler.cs b/OpenSim/OpenSim.World/scripting/IScriptHandler.cs index 15efc49..efd67b1 100644 --- a/OpenSim/OpenSim.World/scripting/IScriptHandler.cs +++ b/OpenSim/OpenSim.World/scripting/IScriptHandler.cs | |||
@@ -87,7 +87,7 @@ namespace OpenSim.RegionServer.world.scripting | |||
87 | { | 87 | { |
88 | Primitive prim = m_entity as Primitive; | 88 | Primitive prim = m_entity as Primitive; |
89 | // Of course, we really should have asked the physEngine if this is possible, and if not, returned false. | 89 | // Of course, we really should have asked the physEngine if this is possible, and if not, returned false. |
90 | prim.UpdatePosition( value ); | 90 | // prim.UpdatePosition( value ); |
91 | } | 91 | } |
92 | } | 92 | } |
93 | } | 93 | } |