diff options
author | lbsa71 | 2007-03-27 20:45:04 +0000 |
---|---|---|
committer | lbsa71 | 2007-03-27 20:45:04 +0000 |
commit | 7adbe756fbb1d1c4cd71df90bd12d7e3da60bdf8 (patch) | |
tree | d8dc563b7fef4ce9dcc34fbcc31c3fcc7d99d49f /OpenSim.RegionServer | |
parent | * Config should be loaded before login server startup... (diff) | |
download | opensim-SC_OLD-7adbe756fbb1d1c4cd71df90bd12d7e3da60bdf8.zip opensim-SC_OLD-7adbe756fbb1d1c4cd71df90bd12d7e3da60bdf8.tar.gz opensim-SC_OLD-7adbe756fbb1d1c4cd71df90bd12d7e3da60bdf8.tar.bz2 opensim-SC_OLD-7adbe756fbb1d1c4cd71df90bd12d7e3da60bdf8.tar.xz |
* Reverting todays work. It was worth a try.
Diffstat (limited to 'OpenSim.RegionServer')
-rw-r--r-- | OpenSim.RegionServer/AgentAssetUpload.cs | 17 | ||||
-rw-r--r-- | OpenSim.RegionServer/CAPS/AdminWebFront.cs | 11 | ||||
-rw-r--r-- | OpenSim.RegionServer/CAPS/SimHttp.cs | 41 | ||||
-rw-r--r-- | OpenSim.RegionServer/OpenSim.RegionServer.csproj | 68 | ||||
-rw-r--r-- | OpenSim.RegionServer/OpenSim.RegionServer.dll.build | 7 | ||||
-rw-r--r-- | OpenSim.RegionServer/OpenSimMain.cs | 8 | ||||
-rw-r--r-- | OpenSim.RegionServer/SimClient.cs | 99 | ||||
-rw-r--r-- | OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs | 18 | ||||
-rw-r--r-- | OpenSim.RegionServer/UserServer/LoginServer.cs | 20 | ||||
-rw-r--r-- | OpenSim.RegionServer/world/Avatar.cs | 39 | ||||
-rw-r--r-- | OpenSim.RegionServer/world/Primitive.cs | 27 | ||||
-rw-r--r-- | OpenSim.RegionServer/world/World.cs | 33 |
12 files changed, 160 insertions, 228 deletions
diff --git a/OpenSim.RegionServer/AgentAssetUpload.cs b/OpenSim.RegionServer/AgentAssetUpload.cs index 9f85598..a482e80 100644 --- a/OpenSim.RegionServer/AgentAssetUpload.cs +++ b/OpenSim.RegionServer/AgentAssetUpload.cs | |||
@@ -1,7 +1,6 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using OpenSim.Assets; | ||
5 | using OpenSim.Framework.Assets; | 4 | using OpenSim.Framework.Assets; |
6 | using OpenSim.Framework.Utilities; | 5 | using OpenSim.Framework.Utilities; |
7 | using libsecondlife; | 6 | using libsecondlife; |
@@ -13,14 +12,10 @@ namespace OpenSim | |||
13 | { | 12 | { |
14 | private Dictionary<LLUUID, AssetTransaction> transactions = new Dictionary<LLUUID, AssetTransaction>(); | 13 | private Dictionary<LLUUID, AssetTransaction> transactions = new Dictionary<LLUUID, AssetTransaction>(); |
15 | private SimClient ourClient; | 14 | private SimClient ourClient; |
16 | private AssetCache m_assetCache; | ||
17 | private InventoryCache m_inventoryCache; | ||
18 | 15 | ||
19 | public AgentAssetUpload(SimClient client, AssetCache assetCache, InventoryCache inventoryCache) | 16 | public AgentAssetUpload(SimClient client) |
20 | { | 17 | { |
21 | this.ourClient = client; | 18 | this.ourClient = client; |
22 | m_assetCache = assetCache; | ||
23 | m_inventoryCache = inventoryCache; | ||
24 | } | 19 | } |
25 | 20 | ||
26 | public void AddUpload(LLUUID transactionID, AssetBase asset) | 21 | public void AddUpload(LLUUID transactionID, AssetBase asset) |
@@ -153,8 +148,8 @@ namespace OpenSim | |||
153 | //check if we should add it to inventory | 148 | //check if we should add it to inventory |
154 | if (trans.AddToInventory) | 149 | if (trans.AddToInventory) |
155 | { | 150 | { |
156 | m_assetCache.AddAsset(trans.Asset); | 151 | OpenSimRoot.Instance.AssetCache.AddAsset(trans.Asset); |
157 | m_inventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset); | 152 | OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset); |
158 | } | 153 | } |
159 | 154 | ||
160 | 155 | ||
@@ -181,7 +176,7 @@ namespace OpenSim | |||
181 | AssetTransaction trans = this.transactions[transactionID]; | 176 | AssetTransaction trans = this.transactions[transactionID]; |
182 | if (trans.UploadComplete) | 177 | if (trans.UploadComplete) |
183 | { | 178 | { |
184 | m_assetCache.AddAsset(trans.Asset); | 179 | OpenSimRoot.Instance.AssetCache.AddAsset(trans.Asset); |
185 | asset = trans.Asset; | 180 | asset = trans.Asset; |
186 | } | 181 | } |
187 | } | 182 | } |
@@ -200,8 +195,8 @@ namespace OpenSim | |||
200 | if (trans.UploadComplete) | 195 | if (trans.UploadComplete) |
201 | { | 196 | { |
202 | //already complete so we can add it to the inventory | 197 | //already complete so we can add it to the inventory |
203 | m_assetCache.AddAsset(trans.Asset); | 198 | OpenSimRoot.Instance.AssetCache.AddAsset(trans.Asset); |
204 | Console.WriteLine( "ITem created is " +m_inventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset).ToStringHyphenated()); | 199 | Console.WriteLine( "ITem created is " +OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset).ToStringHyphenated()); |
205 | } | 200 | } |
206 | else | 201 | else |
207 | { | 202 | { |
diff --git a/OpenSim.RegionServer/CAPS/AdminWebFront.cs b/OpenSim.RegionServer/CAPS/AdminWebFront.cs index 03f8692..ea32589 100644 --- a/OpenSim.RegionServer/CAPS/AdminWebFront.cs +++ b/OpenSim.RegionServer/CAPS/AdminWebFront.cs | |||
@@ -2,7 +2,6 @@ using System; | |||
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.IO; | 4 | using System.IO; |
5 | using OpenSim.world; | ||
6 | 5 | ||
7 | namespace OpenSim.CAPS | 6 | namespace OpenSim.CAPS |
8 | { | 7 | { |
@@ -12,11 +11,9 @@ namespace OpenSim.CAPS | |||
12 | private string NewAccountForm; | 11 | private string NewAccountForm; |
13 | private string LoginForm; | 12 | private string LoginForm; |
14 | private string passWord = "Admin"; | 13 | private string passWord = "Admin"; |
15 | private World m_world; | ||
16 | 14 | ||
17 | public AdminWebFront(string password, World world) | 15 | public AdminWebFront(string password) |
18 | { | 16 | { |
19 | m_world = world; | ||
20 | passWord = password; | 17 | passWord = password; |
21 | LoadAdminPage(); | 18 | LoadAdminPage(); |
22 | } | 19 | } |
@@ -48,11 +45,11 @@ namespace OpenSim.CAPS | |||
48 | { | 45 | { |
49 | responseString = " <p> Listing connected Clients </p>"; | 46 | responseString = " <p> Listing connected Clients </p>"; |
50 | OpenSim.world.Avatar TempAv; | 47 | OpenSim.world.Avatar TempAv; |
51 | foreach (libsecondlife.LLUUID UUID in m_world.Entities.Keys) | 48 | foreach (libsecondlife.LLUUID UUID in OpenSimRoot.Instance.LocalWorld.Entities.Keys) |
52 | { | 49 | { |
53 | if (m_world.Entities[UUID].ToString() == "OpenSim.world.Avatar") | 50 | if (OpenSimRoot.Instance.LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar") |
54 | { | 51 | { |
55 | TempAv = (OpenSim.world.Avatar)m_world.Entities[UUID]; | 52 | TempAv = (OpenSim.world.Avatar)OpenSimRoot.Instance.LocalWorld.Entities[UUID]; |
56 | responseString += "<p>"; | 53 | responseString += "<p>"; |
57 | responseString += String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()); | 54 | responseString += String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()); |
58 | responseString += "</p>"; | 55 | responseString += "</p>"; |
diff --git a/OpenSim.RegionServer/CAPS/SimHttp.cs b/OpenSim.RegionServer/CAPS/SimHttp.cs index 92bbc6f..a1073f0 100644 --- a/OpenSim.RegionServer/CAPS/SimHttp.cs +++ b/OpenSim.RegionServer/CAPS/SimHttp.cs | |||
@@ -39,27 +39,22 @@ using System.Collections.Generic; | |||
39 | using libsecondlife; | 39 | using libsecondlife; |
40 | using OpenSim.Framework.Console; | 40 | using OpenSim.Framework.Console; |
41 | using OpenSim.Framework.Interfaces; | 41 | using OpenSim.Framework.Interfaces; |
42 | using OpenSim.Servers; | ||
43 | 42 | ||
44 | namespace OpenSim.CAPS | 43 | namespace OpenSim.CAPS |
45 | { | 44 | { |
46 | // Dummy HTTP server, does nothing useful for now | 45 | // Dummy HTTP server, does nothing useful for now |
47 | 46 | ||
48 | public class SimCAPSHTTPServer : BaseHttpServer | 47 | public class SimCAPSHTTPServer |
49 | { | 48 | { |
50 | private Thread m_workerThread; | 49 | public Thread HTTPD; |
51 | private HttpListener m_httpListener; | 50 | public HttpListener Listener; |
52 | private Dictionary<string, IRestHandler> m_restHandlers = new Dictionary<string, IRestHandler>(); | 51 | private Dictionary<string, IRestHandler> restHandlers = new Dictionary<string, IRestHandler>(); |
53 | private IGridServer m_gridServer; | ||
54 | private int m_port; | ||
55 | 52 | ||
56 | public SimCAPSHTTPServer(IGridServer gridServer, int port) | 53 | public SimCAPSHTTPServer() |
57 | { | 54 | { |
58 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Starting up HTTP Server"); | 55 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Starting up HTTP Server"); |
59 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); | 56 | HTTPD = new Thread(new ThreadStart(StartHTTP)); |
60 | m_workerThread.Start(); | 57 | HTTPD.Start(); |
61 | m_gridServer = gridServer; | ||
62 | m_port = port; | ||
63 | } | 58 | } |
64 | 59 | ||
65 | public void StartHTTP() | 60 | public void StartHTTP() |
@@ -67,15 +62,15 @@ namespace OpenSim.CAPS | |||
67 | try | 62 | try |
68 | { | 63 | { |
69 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("SimHttp.cs:StartHTTP() - Spawned main thread OK"); | 64 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("SimHttp.cs:StartHTTP() - Spawned main thread OK"); |
70 | m_httpListener = new HttpListener(); | 65 | Listener = new HttpListener(); |
71 | 66 | ||
72 | m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); | 67 | Listener.Prefixes.Add("http://+:" + OpenSimRoot.Instance.Cfg.IPListenPort + "/"); |
73 | m_httpListener.Start(); | 68 | Listener.Start(); |
74 | 69 | ||
75 | HttpListenerContext context; | 70 | HttpListenerContext context; |
76 | while (true) | 71 | while (true) |
77 | { | 72 | { |
78 | context = m_httpListener.GetContext(); | 73 | context = Listener.GetContext(); |
79 | ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context); | 74 | ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context); |
80 | } | 75 | } |
81 | } | 76 | } |
@@ -87,9 +82,9 @@ namespace OpenSim.CAPS | |||
87 | 82 | ||
88 | public bool AddRestHandler(string path, IRestHandler handler) | 83 | public bool AddRestHandler(string path, IRestHandler handler) |
89 | { | 84 | { |
90 | if (!this.m_restHandlers.ContainsKey(path)) | 85 | if (!this.restHandlers.ContainsKey(path)) |
91 | { | 86 | { |
92 | this.m_restHandlers.Add(path, handler); | 87 | this.restHandlers.Add(path, handler); |
93 | return true; | 88 | return true; |
94 | } | 89 | } |
95 | 90 | ||
@@ -113,12 +108,12 @@ namespace OpenSim.CAPS | |||
113 | agent_data.lastname = (string)requestData["lastname"]; | 108 | agent_data.lastname = (string)requestData["lastname"]; |
114 | agent_data.AgentID = new LLUUID((string)requestData["agent_id"]); | 109 | agent_data.AgentID = new LLUUID((string)requestData["agent_id"]); |
115 | agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); | 110 | agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); |
116 | if (m_gridServer.GetName() == "Remote") | 111 | if (OpenSimRoot.Instance.GridServers.GridServer.GetName() == "Remote") |
117 | { | 112 | { |
118 | 113 | ((RemoteGridBase)OpenSimRoot.Instance.GridServers.GridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data); | |
119 | ((RemoteGridBase)m_gridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data); | ||
120 | } | 114 | } |
121 | return "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>"; | 115 | return "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>"; |
116 | break; | ||
122 | } | 117 | } |
123 | } | 118 | } |
124 | catch (Exception e) | 119 | catch (Exception e) |
@@ -140,9 +135,9 @@ namespace OpenSim.CAPS | |||
140 | //path[0] should be empty so we are interested in path[1] | 135 | //path[0] should be empty so we are interested in path[1] |
141 | if (path.Length > 1) | 136 | if (path.Length > 1) |
142 | { | 137 | { |
143 | if ((path[1] != "") && (this.m_restHandlers.ContainsKey(path[1]))) | 138 | if ((path[1] != "") && (this.restHandlers.ContainsKey(path[1]))) |
144 | { | 139 | { |
145 | responseString = this.m_restHandlers[path[1]].HandleREST(requestBody, requestURL, requestMethod); | 140 | responseString = this.restHandlers[path[1]].HandleREST(requestBody, requestURL, requestMethod); |
146 | } | 141 | } |
147 | } | 142 | } |
148 | 143 | ||
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim.RegionServer/OpenSim.RegionServer.csproj index c08eb48..f376e04 100644 --- a/OpenSim.RegionServer/OpenSim.RegionServer.csproj +++ b/OpenSim.RegionServer/OpenSim.RegionServer.csproj | |||
@@ -1,12 +1,13 @@ | |||
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> |
5 | <SchemaVersion>2.0</SchemaVersion> | 5 | <SchemaVersion>2.0</SchemaVersion> |
6 | <ProjectGuid>{72B438C6-38C5-4620-AC4C-E15BA326FF51}</ProjectGuid> | 6 | <ProjectGuid>{4171D545-81F5-4C64-AD29-6D7414C38181}</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.RegionServer</AssemblyName> | 13 | <AssemblyName>OpenSim.RegionServer</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.RegionServer</RootNamespace> | 21 | <RootNamespace>OpenSim.RegionServer</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,60 +61,58 @@ | |||
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.Data" /> |
73 | <Reference Include="System.Xml"> | ||
66 | <HintPath>System.Xml.dll</HintPath> | 74 | <HintPath>System.Xml.dll</HintPath> |
67 | <Private>False</Private> | 75 | <Private>False</Private> |
68 | </Reference> | 76 | </Reference> |
69 | <Reference Include="libsecondlife.dll" > | 77 | <Reference Include="libsecondlife.dll"> |
70 | <HintPath>..\bin\libsecondlife.dll</HintPath> | 78 | <HintPath>..\bin\libsecondlife.dll</HintPath> |
71 | <Private>False</Private> | 79 | <Private>False</Private> |
72 | </Reference> | 80 | </Reference> |
73 | <Reference Include="Axiom.MathLib.dll" > | 81 | <Reference Include="Axiom.MathLib.dll"> |
74 | <HintPath>..\bin\Axiom.MathLib.dll</HintPath> | 82 | <HintPath>..\bin\Axiom.MathLib.dll</HintPath> |
75 | <Private>False</Private> | 83 | <Private>False</Private> |
76 | </Reference> | 84 | </Reference> |
77 | <Reference Include="Db4objects.Db4o.dll" > | 85 | <Reference Include="Db4objects.Db4o.dll"> |
78 | <HintPath>..\bin\Db4objects.Db4o.dll</HintPath> | 86 | <HintPath>..\bin\Db4objects.Db4o.dll</HintPath> |
79 | <Private>False</Private> | 87 | <Private>False</Private> |
80 | </Reference> | 88 | </Reference> |
81 | </ItemGroup> | 89 | </ItemGroup> |
82 | <ItemGroup> | 90 | <ItemGroup> |
83 | <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj"> | ||
84 | <Name>OpenSim.Framework</Name> | ||
85 | <Project>{E1171263-9131-454C-B0A6-2374D98714A8}</Project> | ||
86 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
87 | <Private>False</Private> | ||
88 | </ProjectReference> | ||
89 | <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> | 91 | <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> |
90 | <Name>OpenSim.Framework.Console</Name> | 92 | <Name>OpenSim.Framework.Console</Name> |
91 | <Project>{C73A2D5E-EF8F-41D1-9A1D-1730694B6822}</Project> | 93 | <Project>{7AED7536-7D6B-4E28-8016-B5A554C663B4}</Project> |
92 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 94 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
93 | <Private>False</Private> | 95 | <Private>False</Private> |
94 | </ProjectReference> | 96 | </ProjectReference> |
95 | <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> | 97 | <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> |
96 | <Name>OpenSim.Physics.Manager</Name> | 98 | <Name>OpenSim.Physics.Manager</Name> |
97 | <Project>{EE1CA661-C388-44B7-BBE4-7C59C83B1E09}</Project> | 99 | <Project>{0AAA0EEB-1F2C-4B4B-9BFA-7C3E45BCD348}</Project> |
98 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 100 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
99 | <Private>False</Private> | 101 | <Private>False</Private> |
100 | </ProjectReference> | 102 | </ProjectReference> |
101 | <ProjectReference Include="..\Servers\OpenSim.Servers.csproj"> | 103 | <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj"> |
102 | <Name>OpenSim.Servers</Name> | 104 | <Name>OpenSim.Framework</Name> |
103 | <Project>{8038EFDC-3245-4EA1-B198-0DA1E724D7A1}</Project> | 105 | <Project>{90D4F7AF-D75E-4DE8-A0E1-70CC242B31A1}</Project> |
104 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 106 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
105 | <Private>False</Private> | 107 | <Private>False</Private> |
106 | </ProjectReference> | 108 | </ProjectReference> |
107 | </ItemGroup> | 109 | </ItemGroup> |
108 | <ItemGroup> | 110 | <ItemGroup> |
109 | <Compile Include="AgentAssetUpload.cs"> | 111 | <Compile Include="AgentAssetUpload.cs"> |
110 | <SubType>Code</SubType> | 112 | <SubType>Code</SubType> |
111 | </Compile> | 113 | </Compile> |
114 | <Compile Include="CAPS\AdminWebFront.cs" /> | ||
115 | <Compile Include="CAPS\IRestHandler.cs" /> | ||
112 | <Compile Include="ConsoleCmds.cs"> | 116 | <Compile Include="ConsoleCmds.cs"> |
113 | <SubType>Code</SubType> | 117 | <SubType>Code</SubType> |
114 | </Compile> | 118 | </Compile> |
@@ -142,12 +146,6 @@ | |||
142 | <Compile Include="Assets\InventoryCache.cs"> | 146 | <Compile Include="Assets\InventoryCache.cs"> |
143 | <SubType>Code</SubType> | 147 | <SubType>Code</SubType> |
144 | </Compile> | 148 | </Compile> |
145 | <Compile Include="CAPS\AdminWebFront.cs"> | ||
146 | <SubType>Code</SubType> | ||
147 | </Compile> | ||
148 | <Compile Include="CAPS\IRestHandler.cs"> | ||
149 | <SubType>Code</SubType> | ||
150 | </Compile> | ||
151 | <Compile Include="CAPS\SimHttp.cs"> | 149 | <Compile Include="CAPS\SimHttp.cs"> |
152 | <SubType>Code</SubType> | 150 | <SubType>Code</SubType> |
153 | </Compile> | 151 | </Compile> |
@@ -195,4 +193,4 @@ | |||
195 | <PostBuildEvent> | 193 | <PostBuildEvent> |
196 | </PostBuildEvent> | 194 | </PostBuildEvent> |
197 | </PropertyGroup> | 195 | </PropertyGroup> |
198 | </Project> | 196 | </Project> \ No newline at end of file |
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build index 04e86bc..4e44c4b 100644 --- a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build +++ b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build | |||
@@ -49,10 +49,9 @@ | |||
49 | <include name="../bin/libsecondlife.dll" /> | 49 | <include name="../bin/libsecondlife.dll" /> |
50 | <include name="../bin/Axiom.MathLib.dll" /> | 50 | <include name="../bin/Axiom.MathLib.dll" /> |
51 | <include name="../bin/Db4objects.Db4o.dll" /> | 51 | <include name="../bin/Db4objects.Db4o.dll" /> |
52 | <include name="../bin/OpenSim.Framework.dll" /> | 52 | <include name="../OpenSim.Framework.Console/${build.dir}/OpenSim.Framework.Console.dll" /> |
53 | <include name="../bin/OpenSim.Framework.Console.dll" /> | 53 | <include name="../OpenSim.Physics/Manager/${build.dir}/OpenSim.Physics.Manager.dll" /> |
54 | <include name="../bin/OpenSim.Physics.Manager.dll" /> | 54 | <include name="../OpenSim.Framework/${build.dir}/OpenSim.Framework.dll" /> |
55 | <include name="../bin/OpenSim.Servers.dll" /> | ||
56 | </references> | 55 | </references> |
57 | </csc> | 56 | </csc> |
58 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" /> | 57 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" /> |
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs index 91f8008..7425fca 100644 --- a/OpenSim.RegionServer/OpenSimMain.cs +++ b/OpenSim.RegionServer/OpenSimMain.cs | |||
@@ -91,7 +91,7 @@ namespace OpenSim | |||
91 | 91 | ||
92 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Main.cs:Startup() - We are " + OpenSimRoot.Instance.Cfg.RegionName + " at " + OpenSimRoot.Instance.Cfg.RegionLocX.ToString() + "," + OpenSimRoot.Instance.Cfg.RegionLocY.ToString()); | 92 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Main.cs:Startup() - We are " + OpenSimRoot.Instance.Cfg.RegionName + " at " + OpenSimRoot.Instance.Cfg.RegionLocX.ToString() + "," + OpenSimRoot.Instance.Cfg.RegionLocY.ToString()); |
93 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Initialising world"); | 93 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Initialising world"); |
94 | OpenSimRoot.Instance.LocalWorld = new World(OpenSimRoot.Instance.ClientThreads, OpenSimRoot.Instance.Cfg.RegionHandle, OpenSimRoot.Instance.LocalWorld, OpenSimRoot.Instance.Cfg.RegionName, OpenSimRoot.Instance.Cfg); | 94 | OpenSimRoot.Instance.LocalWorld = new World(); |
95 | OpenSimRoot.Instance.LocalWorld.LandMap = OpenSimRoot.Instance.Cfg.LoadWorld(); | 95 | OpenSimRoot.Instance.LocalWorld.LandMap = OpenSimRoot.Instance.Cfg.LoadWorld(); |
96 | 96 | ||
97 | this.physManager = new OpenSim.Physics.Manager.PhysicsManager(); | 97 | this.physManager = new OpenSim.Physics.Manager.PhysicsManager(); |
@@ -113,8 +113,8 @@ namespace OpenSim | |||
113 | } | 113 | } |
114 | 114 | ||
115 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Main.cs:Startup() - Starting CAPS HTTP server"); | 115 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Main.cs:Startup() - Starting CAPS HTTP server"); |
116 | OpenSimRoot.Instance.HttpServer = new SimCAPSHTTPServer(OpenSimRoot.Instance.GridServers.GridServer, OpenSimRoot.Instance.Cfg.IPListenPort); | 116 | OpenSimRoot.Instance.HttpServer = new SimCAPSHTTPServer(); |
117 | OpenSimRoot.Instance.HttpServer.AddRestHandler("Admin", new AdminWebFront("Admin", OpenSimRoot.Instance.LocalWorld)); | 117 | OpenSimRoot.Instance.HttpServer.AddRestHandler("Admin", new AdminWebFront("Admin")); |
118 | 118 | ||
119 | timer1.Enabled = true; | 119 | timer1.Enabled = true; |
120 | timer1.Interval = 100; | 120 | timer1.Interval = 100; |
@@ -172,7 +172,7 @@ namespace OpenSim | |||
172 | { // new client | 172 | { // new client |
173 | UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet; | 173 | UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet; |
174 | this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); | 174 | this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); |
175 | SimClient newuser = new SimClient(epSender, useCircuit, OpenSimRoot.Instance.LocalWorld, OpenSimRoot.Instance.ClientThreads, OpenSimRoot.Instance.AssetCache, OpenSimRoot.Instance.GridServers.GridServer, OpenSimRoot.Instance.Application, OpenSimRoot.Instance.InventoryCache, OpenSimRoot.Instance.Sandbox); | 175 | SimClient newuser = new SimClient(epSender, useCircuit); |
176 | //OpenSimRoot.Instance.ClientThreads.Add(epSender, newuser); | 176 | //OpenSimRoot.Instance.ClientThreads.Add(epSender, newuser); |
177 | OpenSimRoot.Instance.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser); | 177 | OpenSimRoot.Instance.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser); |
178 | } | 178 | } |
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs index 698053d..d463c75 100644 --- a/OpenSim.RegionServer/SimClient.cs +++ b/OpenSim.RegionServer/SimClient.cs | |||
@@ -71,13 +71,6 @@ namespace OpenSim | |||
71 | private AgentAssetUpload UploadAssets; | 71 | private AgentAssetUpload UploadAssets; |
72 | private LLUUID newAssetFolder = LLUUID.Zero; | 72 | private LLUUID newAssetFolder = LLUUID.Zero; |
73 | private bool debug = false; | 73 | private bool debug = false; |
74 | private World m_world; | ||
75 | private Dictionary<uint, SimClient> m_clientThreads; | ||
76 | private AssetCache m_assetCache; | ||
77 | private IGridServer m_gridServer; | ||
78 | private OpenSimApplication m_application; | ||
79 | private InventoryCache m_inventoryCache; | ||
80 | private bool m_sandboxMode; | ||
81 | 74 | ||
82 | private void ack_pack(Packet Pack) | 75 | private void ack_pack(Packet Pack) |
83 | { | 76 | { |
@@ -112,15 +105,15 @@ namespace OpenSim | |||
112 | switch (Pack.Type) | 105 | switch (Pack.Type) |
113 | { | 106 | { |
114 | case PacketType.CompleteAgentMovement: | 107 | case PacketType.CompleteAgentMovement: |
115 | ClientAvatar.CompleteMovement(m_world); | 108 | ClientAvatar.CompleteMovement(OpenSimRoot.Instance.LocalWorld); |
116 | ClientAvatar.SendInitialPosition(); | 109 | ClientAvatar.SendInitialPosition(); |
117 | break; | 110 | break; |
118 | case PacketType.RegionHandshakeReply: | 111 | case PacketType.RegionHandshakeReply: |
119 | m_world.SendLayerData(this); | 112 | OpenSimRoot.Instance.LocalWorld.SendLayerData(this); |
120 | break; | 113 | break; |
121 | case PacketType.AgentWearablesRequest: | 114 | case PacketType.AgentWearablesRequest: |
122 | ClientAvatar.SendInitialAppearance(); | 115 | ClientAvatar.SendInitialAppearance(); |
123 | foreach (SimClient client in m_clientThreads.Values) | 116 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
124 | { | 117 | { |
125 | if (client.AgentID != this.AgentID) | 118 | if (client.AgentID != this.AgentID) |
126 | { | 119 | { |
@@ -129,7 +122,7 @@ namespace OpenSim | |||
129 | client.ClientAvatar.SendAppearanceToOtherAgent(this); | 122 | client.ClientAvatar.SendAppearanceToOtherAgent(this); |
130 | } | 123 | } |
131 | } | 124 | } |
132 | m_world.GetInitialPrims(this); | 125 | OpenSimRoot.Instance.LocalWorld.GetInitialPrims(this); |
133 | break; | 126 | break; |
134 | case PacketType.AgentIsNowWearing: | 127 | case PacketType.AgentIsNowWearing: |
135 | AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack; | 128 | AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack; |
@@ -141,7 +134,7 @@ namespace OpenSim | |||
141 | this.ClientAvatar.SetAppearance(appear); | 134 | this.ClientAvatar.SetAppearance(appear); |
142 | break; | 135 | break; |
143 | case PacketType.ObjectAdd: | 136 | case PacketType.ObjectAdd: |
144 | m_world.AddNewPrim((ObjectAddPacket)Pack, this); | 137 | OpenSimRoot.Instance.LocalWorld.AddNewPrim((ObjectAddPacket)Pack, this); |
145 | break; | 138 | break; |
146 | case PacketType.ObjectLink: | 139 | case PacketType.ObjectLink: |
147 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(Pack.ToString()); | 140 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(Pack.ToString()); |
@@ -153,7 +146,7 @@ namespace OpenSim | |||
153 | ObjectShapePacket shape = (ObjectShapePacket)Pack; | 146 | ObjectShapePacket shape = (ObjectShapePacket)Pack; |
154 | for (int i = 0; i < shape.ObjectData.Length; i++) | 147 | for (int i = 0; i < shape.ObjectData.Length; i++) |
155 | { | 148 | { |
156 | foreach (Entity ent in m_world.Entities.Values) | 149 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) |
157 | { | 150 | { |
158 | if (ent.localid == shape.ObjectData[i].ObjectLocalID) | 151 | if (ent.localid == shape.ObjectData[i].ObjectLocalID) |
159 | { | 152 | { |
@@ -170,7 +163,7 @@ namespace OpenSim | |||
170 | if (multipleupdate.ObjectData[i].Type == 9) //change position | 163 | if (multipleupdate.ObjectData[i].Type == 9) //change position |
171 | { | 164 | { |
172 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); | 165 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); |
173 | foreach (Entity ent in m_world.Entities.Values) | 166 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) |
174 | { | 167 | { |
175 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) | 168 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) |
176 | { | 169 | { |
@@ -184,7 +177,7 @@ namespace OpenSim | |||
184 | else if (multipleupdate.ObjectData[i].Type == 10)//rotation | 177 | else if (multipleupdate.ObjectData[i].Type == 10)//rotation |
185 | { | 178 | { |
186 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); | 179 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); |
187 | foreach (Entity ent in m_world.Entities.Values) | 180 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) |
188 | { | 181 | { |
189 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) | 182 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) |
190 | { | 183 | { |
@@ -197,7 +190,7 @@ namespace OpenSim | |||
197 | { | 190 | { |
198 | 191 | ||
199 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); | 192 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); |
200 | foreach (Entity ent in m_world.Entities.Values) | 193 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) |
201 | { | 194 | { |
202 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) | 195 | if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID) |
203 | { | 196 | { |
@@ -211,13 +204,13 @@ namespace OpenSim | |||
211 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; | 204 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; |
212 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) | 205 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) |
213 | { | 206 | { |
214 | m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image); | 207 | OpenSimRoot.Instance.AssetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image); |
215 | } | 208 | } |
216 | break; | 209 | break; |
217 | case PacketType.TransferRequest: | 210 | case PacketType.TransferRequest: |
218 | //Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request"); | 211 | //Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request"); |
219 | TransferRequestPacket transfer = (TransferRequestPacket)Pack; | 212 | TransferRequestPacket transfer = (TransferRequestPacket)Pack; |
220 | m_assetCache.AddAssetRequest(this, transfer); | 213 | OpenSimRoot.Instance.AssetCache.AddAssetRequest(this, transfer); |
221 | break; | 214 | break; |
222 | case PacketType.AgentUpdate: | 215 | case PacketType.AgentUpdate: |
223 | ClientAvatar.HandleUpdate((AgentUpdatePacket)Pack); | 216 | ClientAvatar.HandleUpdate((AgentUpdatePacket)Pack); |
@@ -237,18 +230,18 @@ namespace OpenSim | |||
237 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; | 230 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; |
238 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); | 231 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); |
239 | kill.ObjectData[0].ID = this.ClientAvatar.localid; | 232 | kill.ObjectData[0].ID = this.ClientAvatar.localid; |
240 | foreach (SimClient client in m_clientThreads.Values) | 233 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
241 | { | 234 | { |
242 | client.OutPacket(kill); | 235 | client.OutPacket(kill); |
243 | } | 236 | } |
244 | m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode); | 237 | OpenSimRoot.Instance.GridServers.GridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode); |
245 | lock (m_world.Entities) | 238 | lock (OpenSimRoot.Instance.LocalWorld.Entities) |
246 | { | 239 | { |
247 | m_world.Entities.Remove(this.AgentID); | 240 | OpenSimRoot.Instance.LocalWorld.Entities.Remove(this.AgentID); |
248 | } | 241 | } |
249 | //need to do other cleaning up here too | 242 | //need to do other cleaning up here too |
250 | m_clientThreads.Remove(this.CircuitCode); //this.userEP); | 243 | OpenSimRoot.Instance.ClientThreads.Remove(this.CircuitCode); //this.userEP); |
251 | m_application.RemoveClientCircuit(this.CircuitCode); | 244 | OpenSimRoot.Instance.Application.RemoveClientCircuit(this.CircuitCode); |
252 | this.ClientThread.Abort(); | 245 | this.ClientThread.Abort(); |
253 | break; | 246 | break; |
254 | case PacketType.ChatFromViewer: | 247 | case PacketType.ChatFromViewer: |
@@ -265,7 +258,7 @@ namespace OpenSim | |||
265 | reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0"); | 258 | reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0"); |
266 | reply.ChatData.OwnerID = this.AgentID; | 259 | reply.ChatData.OwnerID = this.AgentID; |
267 | reply.ChatData.SourceID = this.AgentID; | 260 | reply.ChatData.SourceID = this.AgentID; |
268 | foreach (SimClient client in m_clientThreads.Values) | 261 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
269 | { | 262 | { |
270 | client.OutPacket(reply); | 263 | client.OutPacket(reply); |
271 | } | 264 | } |
@@ -274,7 +267,7 @@ namespace OpenSim | |||
274 | ObjectImagePacket imagePack = (ObjectImagePacket)Pack; | 267 | ObjectImagePacket imagePack = (ObjectImagePacket)Pack; |
275 | for (int i = 0; i < imagePack.ObjectData.Length; i++) | 268 | for (int i = 0; i < imagePack.ObjectData.Length; i++) |
276 | { | 269 | { |
277 | foreach (Entity ent in m_world.Entities.Values) | 270 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) |
278 | { | 271 | { |
279 | if (ent.localid == imagePack.ObjectData[i].ObjectLocalID) | 272 | if (ent.localid == imagePack.ObjectData[i].ObjectLocalID) |
280 | { | 273 | { |
@@ -285,7 +278,7 @@ namespace OpenSim | |||
285 | break; | 278 | break; |
286 | case PacketType.ObjectFlagUpdate: | 279 | case PacketType.ObjectFlagUpdate: |
287 | ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack; | 280 | ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack; |
288 | foreach (Entity ent in m_world.Entities.Values) | 281 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) |
289 | { | 282 | { |
290 | if (ent.localid == flags.AgentData.ObjectLocalID) | 283 | if (ent.localid == flags.AgentData.ObjectLocalID) |
291 | { | 284 | { |
@@ -313,7 +306,7 @@ namespace OpenSim | |||
313 | break; | 306 | break; |
314 | case PacketType.CreateInventoryFolder: | 307 | case PacketType.CreateInventoryFolder: |
315 | CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; | 308 | CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; |
316 | m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type); | 309 | OpenSimRoot.Instance.InventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type); |
317 | Console.WriteLine(Pack.ToString()); | 310 | Console.WriteLine(Pack.ToString()); |
318 | break; | 311 | break; |
319 | case PacketType.CreateInventoryItem: | 312 | case PacketType.CreateInventoryItem: |
@@ -327,11 +320,11 @@ namespace OpenSim | |||
327 | case PacketType.FetchInventory: | 320 | case PacketType.FetchInventory: |
328 | //Console.WriteLine("fetch item packet"); | 321 | //Console.WriteLine("fetch item packet"); |
329 | FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack; | 322 | FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack; |
330 | m_inventoryCache.FetchInventory(this, FetchInventory); | 323 | OpenSimRoot.Instance.InventoryCache.FetchInventory(this, FetchInventory); |
331 | break; | 324 | break; |
332 | case PacketType.FetchInventoryDescendents: | 325 | case PacketType.FetchInventoryDescendents: |
333 | FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; | 326 | FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; |
334 | m_inventoryCache.FetchInventoryDescendents(this, Fetch); | 327 | OpenSimRoot.Instance.InventoryCache.FetchInventoryDescendents(this, Fetch); |
335 | break; | 328 | break; |
336 | case PacketType.UpdateInventoryItem: | 329 | case PacketType.UpdateInventoryItem: |
337 | UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack; | 330 | UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack; |
@@ -339,17 +332,17 @@ namespace OpenSim | |||
339 | { | 332 | { |
340 | if (update.InventoryData[i].TransactionID != LLUUID.Zero) | 333 | if (update.InventoryData[i].TransactionID != LLUUID.Zero) |
341 | { | 334 | { |
342 | AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID)); | 335 | AssetBase asset = OpenSimRoot.Instance.AssetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID)); |
343 | if (asset != null) | 336 | if (asset != null) |
344 | { | 337 | { |
345 | m_inventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset); | 338 | OpenSimRoot.Instance.InventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset); |
346 | } | 339 | } |
347 | else | 340 | else |
348 | { | 341 | { |
349 | asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); | 342 | asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); |
350 | if (asset != null) | 343 | if (asset != null) |
351 | { | 344 | { |
352 | m_inventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset); | 345 | OpenSimRoot.Instance.InventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset); |
353 | } | 346 | } |
354 | } | 347 | } |
355 | } | 348 | } |
@@ -357,7 +350,7 @@ namespace OpenSim | |||
357 | break; | 350 | break; |
358 | case PacketType.ViewerEffect: | 351 | case PacketType.ViewerEffect: |
359 | ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; | 352 | ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; |
360 | foreach (SimClient client in m_clientThreads.Values) | 353 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
361 | { | 354 | { |
362 | if (client.AgentID != this.AgentID) | 355 | if (client.AgentID != this.AgentID) |
363 | { | 356 | { |
@@ -369,7 +362,7 @@ namespace OpenSim | |||
369 | break; | 362 | break; |
370 | case PacketType.DeRezObject: | 363 | case PacketType.DeRezObject: |
371 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet"); | 364 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet"); |
372 | m_world.DeRezObject((DeRezObjectPacket)Pack, this); | 365 | OpenSimRoot.Instance.LocalWorld.DeRezObject((DeRezObjectPacket)Pack, this); |
373 | break; | 366 | break; |
374 | } | 367 | } |
375 | } | 368 | } |
@@ -508,11 +501,11 @@ namespace OpenSim | |||
508 | if (Pack.Header.Zerocoded) | 501 | if (Pack.Header.Zerocoded) |
509 | { | 502 | { |
510 | int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); | 503 | int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); |
511 | m_application.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, CircuitCode);//userEP); | 504 | OpenSimRoot.Instance.Application.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, CircuitCode);//userEP); |
512 | } | 505 | } |
513 | else | 506 | else |
514 | { | 507 | { |
515 | m_application.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, CircuitCode); //userEP); | 508 | OpenSimRoot.Instance.Application.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, CircuitCode); //userEP); |
516 | } | 509 | } |
517 | } | 510 | } |
518 | catch (Exception) | 511 | catch (Exception) |
@@ -576,22 +569,14 @@ namespace OpenSim | |||
576 | this.PacketQueue.Enqueue(item); | 569 | this.PacketQueue.Enqueue(item); |
577 | } | 570 | } |
578 | 571 | ||
579 | public SimClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, World world, Dictionary<uint, SimClient> clientThreads, AssetCache assetCache, IGridServer gridServer, OpenSimApplication application, InventoryCache inventoryCache, bool sandboxMode) | 572 | public SimClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack) |
580 | { | 573 | { |
581 | m_world = world; | ||
582 | m_clientThreads = clientThreads; | ||
583 | m_assetCache = assetCache; | ||
584 | m_gridServer = gridServer; | ||
585 | m_application = application; | ||
586 | m_inventoryCache = inventoryCache; | ||
587 | m_sandboxMode = sandboxMode; | ||
588 | |||
589 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs - Started up new client thread to handle incoming request"); | 574 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs - Started up new client thread to handle incoming request"); |
590 | cirpack = initialcirpack; | 575 | cirpack = initialcirpack; |
591 | userEP = remoteEP; | 576 | userEP = remoteEP; |
592 | PacketQueue = new BlockingQueue<QueItem>(); | 577 | PacketQueue = new BlockingQueue<QueItem>(); |
593 | 578 | ||
594 | this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache ); | 579 | this.UploadAssets = new AgentAssetUpload(this); |
595 | AckTimer = new System.Timers.Timer(500); | 580 | AckTimer = new System.Timers.Timer(500); |
596 | AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); | 581 | AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); |
597 | AckTimer.Start(); | 582 | AckTimer.Start(); |
@@ -623,16 +608,14 @@ namespace OpenSim | |||
623 | protected virtual void InitNewClient() | 608 | protected virtual void InitNewClient() |
624 | { | 609 | { |
625 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); | 610 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); |
626 | 611 | OpenSimRoot.Instance.LocalWorld.AddViewerAgent(this); | |
627 | m_world.AddViewerAgent(this); | 612 | world.Entity tempent = OpenSimRoot.Instance.LocalWorld.Entities[this.AgentID]; |
628 | world.Entity tempent = m_world.Entities[this.AgentID]; | ||
629 | |||
630 | this.ClientAvatar = (world.Avatar)tempent; | 613 | this.ClientAvatar = (world.Avatar)tempent; |
631 | } | 614 | } |
632 | 615 | ||
633 | protected virtual void AuthUser() | 616 | protected virtual void AuthUser() |
634 | { | 617 | { |
635 | AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code); | 618 | AuthenticateResponse sessionInfo = OpenSimRoot.Instance.GridServers.GridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code); |
636 | if (!sessionInfo.Authorised) | 619 | if (!sessionInfo.Authorised) |
637 | { | 620 | { |
638 | //session/circuit not authorised | 621 | //session/circuit not authorised |
@@ -655,23 +638,23 @@ namespace OpenSim | |||
655 | } | 638 | } |
656 | 639 | ||
657 | // Create Inventory, currently only works for sandbox mode | 640 | // Create Inventory, currently only works for sandbox mode |
658 | if (m_sandboxMode) | 641 | if (OpenSimRoot.Instance.Sandbox) |
659 | { | 642 | { |
660 | if (sessionInfo.LoginInfo.InventoryFolder != null) | 643 | if (sessionInfo.LoginInfo.InventoryFolder != null) |
661 | { | 644 | { |
662 | this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder); | 645 | this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder); |
663 | if (sessionInfo.LoginInfo.BaseFolder != null) | 646 | if (sessionInfo.LoginInfo.BaseFolder != null) |
664 | { | 647 | { |
665 | m_inventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder); | 648 | OpenSimRoot.Instance.InventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder); |
666 | this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder; | 649 | this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder; |
667 | AssetBase[] inventorySet = m_assetCache.CreateNewInventorySet(this.AgentID); | 650 | AssetBase[] inventorySet = OpenSimRoot.Instance.AssetCache.CreateNewInventorySet(this.AgentID); |
668 | if (inventorySet != null) | 651 | if (inventorySet != null) |
669 | { | 652 | { |
670 | for (int i = 0; i < inventorySet.Length; i++) | 653 | for (int i = 0; i < inventorySet.Length; i++) |
671 | { | 654 | { |
672 | if (inventorySet[i] != null) | 655 | if (inventorySet[i] != null) |
673 | { | 656 | { |
674 | m_inventoryCache.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]); | 657 | OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this, sessionInfo.LoginInfo.BaseFolder, inventorySet[i]); |
675 | } | 658 | } |
676 | } | 659 | } |
677 | } | 660 | } |
@@ -687,8 +670,8 @@ namespace OpenSim | |||
687 | { | 670 | { |
688 | AgentInventory inventory = new AgentInventory(); | 671 | AgentInventory inventory = new AgentInventory(); |
689 | inventory.AgentID = this.AgentID; | 672 | inventory.AgentID = this.AgentID; |
690 | m_inventoryCache.AddNewAgentsInventory(inventory); | 673 | OpenSimRoot.Instance.InventoryCache.AddNewAgentsInventory(inventory); |
691 | m_inventoryCache.CreateNewInventoryFolder(this, baseFolder); | 674 | OpenSimRoot.Instance.InventoryCache.CreateNewInventoryFolder(this, baseFolder); |
692 | } | 675 | } |
693 | } | 676 | } |
694 | } | 677 | } |
diff --git a/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs b/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs index eee1c3a..83e340b 100644 --- a/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs +++ b/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs | |||
@@ -12,15 +12,11 @@ namespace OpenSim.UserServer | |||
12 | { | 12 | { |
13 | class LocalUserProfileManager : UserProfileManager | 13 | class LocalUserProfileManager : UserProfileManager |
14 | { | 14 | { |
15 | private IGridServer m_gridServer; | 15 | private IGridServer _gridServer; |
16 | private int m_port; | ||
17 | private string m_ipAddr; | ||
18 | 16 | ||
19 | public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr) | 17 | public LocalUserProfileManager(IGridServer gridServer) |
20 | { | 18 | { |
21 | m_gridServer = gridServer; | 19 | _gridServer = gridServer; |
22 | m_port = simPort; | ||
23 | m_ipAddr = ipAddr; | ||
24 | } | 20 | } |
25 | 21 | ||
26 | public override void InitUserProfiles() | 22 | public override void InitUserProfiles() |
@@ -33,8 +29,8 @@ namespace OpenSim.UserServer | |||
33 | uint circode = (uint)response["circuit_code"]; | 29 | uint circode = (uint)response["circuit_code"]; |
34 | theUser.AddSimCircuit(circode, LLUUID.Random()); | 30 | theUser.AddSimCircuit(circode, LLUUID.Random()); |
35 | response["home"] = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}"; | 31 | response["home"] = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}"; |
36 | response["sim_port"] = m_port; | 32 | response["sim_port"] = OpenSimRoot.Instance.Cfg.IPListenPort; |
37 | response["sim_ip"] = m_ipAddr; | 33 | response["sim_ip"] = OpenSimRoot.Instance.Cfg.IPListenAddr; |
38 | response["region_y"] = (Int32)996 * 256; | 34 | response["region_y"] = (Int32)996 * 256; |
39 | response["region_x"] = (Int32)997* 256; | 35 | response["region_x"] = (Int32)997* 256; |
40 | 36 | ||
@@ -71,9 +67,9 @@ namespace OpenSim.UserServer | |||
71 | _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]); | 67 | _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]); |
72 | 68 | ||
73 | //working on local computer if so lets add to the gridserver's list of sessions? | 69 | //working on local computer if so lets add to the gridserver's list of sessions? |
74 | if (m_gridServer.GetName() == "Local") | 70 | if (OpenSimRoot.Instance.GridServers.GridServer.GetName() == "Local") |
75 | { | 71 | { |
76 | ((LocalGridBase)this.m_gridServer).AddNewSession(_login); | 72 | ((LocalGridBase)this._gridServer).AddNewSession(_login); |
77 | } | 73 | } |
78 | } | 74 | } |
79 | } | 75 | } |
diff --git a/OpenSim.RegionServer/UserServer/LoginServer.cs b/OpenSim.RegionServer/UserServer/LoginServer.cs index 47af8a8..86b098a 100644 --- a/OpenSim.RegionServer/UserServer/LoginServer.cs +++ b/OpenSim.RegionServer/UserServer/LoginServer.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.UserServer | |||
52 | /// </summary> | 52 | /// </summary> |
53 | public class LoginServer : LoginService , IUserServer | 53 | public class LoginServer : LoginService , IUserServer |
54 | { | 54 | { |
55 | private IGridServer m_gridServer; | 55 | private IGridServer _gridServer; |
56 | private ushort _loginPort = 8080; | 56 | private ushort _loginPort = 8080; |
57 | public IPAddress clientAddress = IPAddress.Loopback; | 57 | public IPAddress clientAddress = IPAddress.Loopback; |
58 | public IPAddress remoteAddress = IPAddress.Any; | 58 | public IPAddress remoteAddress = IPAddress.Any; |
@@ -63,14 +63,10 @@ namespace OpenSim.UserServer | |||
63 | private string _mpasswd; | 63 | private string _mpasswd; |
64 | private bool _needPasswd = false; | 64 | private bool _needPasswd = false; |
65 | private LocalUserProfileManager userManager; | 65 | private LocalUserProfileManager userManager; |
66 | private int m_simPort; | ||
67 | private string m_simAddr; | ||
68 | 66 | ||
69 | public LoginServer(IGridServer gridServer, string simAddr, int simPort) | 67 | public LoginServer(IGridServer gridServer) |
70 | { | 68 | { |
71 | m_gridServer = gridServer; | 69 | _gridServer = gridServer; |
72 | m_simPort = simPort; | ||
73 | m_simAddr = simAddr; | ||
74 | } | 70 | } |
75 | 71 | ||
76 | // InitializeLogin: initialize the login | 72 | // InitializeLogin: initialize the login |
@@ -93,7 +89,7 @@ namespace OpenSim.UserServer | |||
93 | SR.Close(); | 89 | SR.Close(); |
94 | this._mpasswd = EncodePassword("testpass"); | 90 | this._mpasswd = EncodePassword("testpass"); |
95 | 91 | ||
96 | userManager = new LocalUserProfileManager(this.m_gridServer, m_simPort, m_simAddr ); | 92 | userManager = new LocalUserProfileManager(this._gridServer); |
97 | userManager.InitUserProfiles(); | 93 | userManager.InitUserProfiles(); |
98 | userManager.SetKeys("", "", "", "Welcome to OpenSim"); | 94 | userManager.SetKeys("", "", "", "Welcome to OpenSim"); |
99 | 95 | ||
@@ -293,8 +289,8 @@ namespace OpenSim.UserServer | |||
293 | XmlRpcResponse response = (XmlRpcResponse)(new XmlRpcResponseDeserializer()).Deserialize(this._defaultResponse); | 289 | XmlRpcResponse response = (XmlRpcResponse)(new XmlRpcResponseDeserializer()).Deserialize(this._defaultResponse); |
294 | Hashtable responseData = (Hashtable)response.Value; | 290 | Hashtable responseData = (Hashtable)response.Value; |
295 | 291 | ||
296 | responseData["sim_port"] = m_simPort; | 292 | responseData["sim_port"] = OpenSimRoot.Instance.Cfg.IPListenPort; |
297 | responseData["sim_ip"] = m_simAddr; | 293 | responseData["sim_ip"] = OpenSimRoot.Instance.Cfg.IPListenAddr; |
298 | responseData["agent_id"] = Agent.ToStringHyphenated(); | 294 | responseData["agent_id"] = Agent.ToStringHyphenated(); |
299 | responseData["session_id"] = Session.ToStringHyphenated(); | 295 | responseData["session_id"] = Session.ToStringHyphenated(); |
300 | responseData["secure_session_id"]= secureSess.ToStringHyphenated(); | 296 | responseData["secure_session_id"]= secureSess.ToStringHyphenated(); |
@@ -331,9 +327,9 @@ namespace OpenSim.UserServer | |||
331 | _login.InventoryFolder = InventoryFolderID; | 327 | _login.InventoryFolder = InventoryFolderID; |
332 | 328 | ||
333 | //working on local computer if so lets add to the gridserver's list of sessions? | 329 | //working on local computer if so lets add to the gridserver's list of sessions? |
334 | if (m_gridServer.GetName() == "Local") | 330 | if (OpenSimRoot.Instance.GridServers.GridServer.GetName() == "Local") |
335 | { | 331 | { |
336 | ((LocalGridBase)m_gridServer).AddNewSession(_login); | 332 | ((LocalGridBase)this._gridServer).AddNewSession(_login); |
337 | } | 333 | } |
338 | 334 | ||
339 | // forward the XML-RPC response to the client | 335 | // forward the XML-RPC response to the client |
diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs index 2ae9992..75f2cff 100644 --- a/OpenSim.RegionServer/world/Avatar.cs +++ b/OpenSim.RegionServer/world/Avatar.cs | |||
@@ -30,23 +30,14 @@ namespace OpenSim.world | |||
30 | private byte[] visualParams; | 30 | private byte[] visualParams; |
31 | private AvatarWearable[] Wearables; | 31 | private AvatarWearable[] Wearables; |
32 | private LLVector3 positionLastFrame = new LLVector3(0, 0, 0); | 32 | private LLVector3 positionLastFrame = new LLVector3(0, 0, 0); |
33 | private World m_world; | ||
34 | private ulong m_regionHandle; | ||
35 | private Dictionary<uint, SimClient> m_clientThreads; | ||
36 | private string m_regionName; | ||
37 | 33 | ||
38 | public Avatar(SimClient TheClient, World world, string regionName, Dictionary<uint, SimClient> clientThreads, ulong regionHandle) | 34 | public Avatar(SimClient TheClient) |
39 | { | 35 | { |
40 | m_world = world; | ||
41 | m_clientThreads = clientThreads; | ||
42 | m_regionName = regionName; | ||
43 | m_regionHandle = regionHandle; | ||
44 | |||
45 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); | 36 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); |
46 | ControllingClient = TheClient; | 37 | ControllingClient = TheClient; |
47 | localid = 8880000 + (m_world._localNumber++); | 38 | localid = 8880000 + (OpenSimRoot.Instance.LocalWorld._localNumber++); |
48 | position = new LLVector3(100.0f, 100.0f, 30.0f); | 39 | position = new LLVector3(100.0f, 100.0f, 30.0f); |
49 | position.Z = m_world.LandMap[(int)position.Y * 256 + (int)position.X] + 1; | 40 | position.Z = OpenSimRoot.Instance.LocalWorld.LandMap[(int)position.Y * 256 + (int)position.X] + 1; |
50 | visualParams = new byte[218]; | 41 | visualParams = new byte[218]; |
51 | for (int i = 0; i < 218; i++) | 42 | for (int i = 0; i < 218; i++) |
52 | { | 43 | { |
@@ -61,7 +52,7 @@ namespace OpenSim.world | |||
61 | this.Wearables[0].ItemID = LLUUID.Random(); | 52 | this.Wearables[0].ItemID = LLUUID.Random(); |
62 | 53 | ||
63 | this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); | 54 | this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); |
64 | 55 | ||
65 | } | 56 | } |
66 | 57 | ||
67 | public PhysicsActor PhysActor | 58 | public PhysicsActor PhysActor |
@@ -105,11 +96,11 @@ namespace OpenSim.world | |||
105 | //use CreateTerseBlock() | 96 | //use CreateTerseBlock() |
106 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); | 97 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); |
107 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); | 98 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); |
108 | terse.RegionData.RegionHandle = m_regionHandle; // FIXME | 99 | terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME |
109 | terse.RegionData.TimeDilation = 64096; | 100 | terse.RegionData.TimeDilation = 64096; |
110 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 101 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |
111 | terse.ObjectData[0] = terseBlock; | 102 | terse.ObjectData[0] = terseBlock; |
112 | foreach (SimClient client in m_clientThreads.Values) | 103 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
113 | { | 104 | { |
114 | client.OutPacket(terse); | 105 | client.OutPacket(terse); |
115 | } | 106 | } |
@@ -128,11 +119,11 @@ namespace OpenSim.world | |||
128 | //It has been a while since last update was sent so lets send one. | 119 | //It has been a while since last update was sent so lets send one. |
129 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); | 120 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); |
130 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); | 121 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); |
131 | terse.RegionData.RegionHandle = m_regionHandle; // FIXME | 122 | terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME |
132 | terse.RegionData.TimeDilation = 64096; | 123 | terse.RegionData.TimeDilation = 64096; |
133 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 124 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |
134 | terse.ObjectData[0] = terseBlock; | 125 | terse.ObjectData[0] = terseBlock; |
135 | foreach (SimClient client in m_clientThreads.Values) | 126 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
136 | { | 127 | { |
137 | client.OutPacket(terse); | 128 | client.OutPacket(terse); |
138 | } | 129 | } |
@@ -181,7 +172,7 @@ namespace OpenSim.world | |||
181 | AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); | 172 | AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); |
182 | mov.AgentData.SessionID = this.ControllingClient.SessionID; | 173 | mov.AgentData.SessionID = this.ControllingClient.SessionID; |
183 | mov.AgentData.AgentID = this.ControllingClient.AgentID; | 174 | mov.AgentData.AgentID = this.ControllingClient.AgentID; |
184 | mov.Data.RegionHandle = m_regionHandle; | 175 | mov.Data.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; |
185 | // TODO - dynamicalise this stuff | 176 | // TODO - dynamicalise this stuff |
186 | mov.Data.Timestamp = 1172750370; | 177 | mov.Data.Timestamp = 1172750370; |
187 | mov.Data.Position = new LLVector3(100f, 100f, 23f); | 178 | mov.Data.Position = new LLVector3(100f, 100f, 23f); |
@@ -196,7 +187,7 @@ namespace OpenSim.world | |||
196 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; | 187 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; |
197 | //send a objectupdate packet with information about the clients avatar | 188 | //send a objectupdate packet with information about the clients avatar |
198 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); | 189 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); |
199 | objupdate.RegionData.RegionHandle = m_regionHandle; | 190 | objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; |
200 | objupdate.RegionData.TimeDilation = 64096; | 191 | objupdate.RegionData.TimeDilation = 64096; |
201 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; | 192 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; |
202 | 193 | ||
@@ -211,9 +202,9 @@ namespace OpenSim.world | |||
211 | byte[] pb = pos2.GetBytes(); | 202 | byte[] pb = pos2.GetBytes(); |
212 | 203 | ||
213 | Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); | 204 | Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); |
214 | m_world._localNumber++; | 205 | OpenSimRoot.Instance.LocalWorld._localNumber++; |
215 | 206 | ||
216 | foreach (SimClient client in m_clientThreads.Values) | 207 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
217 | { | 208 | { |
218 | client.OutPacket(objupdate); | 209 | client.OutPacket(objupdate); |
219 | if (client.AgentID != ControllingClient.AgentID) | 210 | if (client.AgentID != ControllingClient.AgentID) |
@@ -250,7 +241,7 @@ namespace OpenSim.world | |||
250 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; | 241 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; |
251 | //send a objectupdate packet with information about the clients avatar | 242 | //send a objectupdate packet with information about the clients avatar |
252 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); | 243 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); |
253 | objupdate.RegionData.RegionHandle = m_regionHandle; | 244 | objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; |
254 | objupdate.RegionData.TimeDilation = 64096; | 245 | objupdate.RegionData.TimeDilation = 64096; |
255 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; | 246 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; |
256 | 247 | ||
@@ -302,7 +293,7 @@ namespace OpenSim.world | |||
302 | this.visualParams[i] = appear.VisualParam[i].ParamValue; | 293 | this.visualParams[i] = appear.VisualParam[i].ParamValue; |
303 | } | 294 | } |
304 | 295 | ||
305 | foreach (SimClient client in m_clientThreads.Values) | 296 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
306 | { | 297 | { |
307 | if (client.AgentID != ControllingClient.AgentID) | 298 | if (client.AgentID != ControllingClient.AgentID) |
308 | { | 299 | { |
@@ -499,7 +490,7 @@ namespace OpenSim.world | |||
499 | handshake.RegionInfo.SimAccess = 13; | 490 | handshake.RegionInfo.SimAccess = 13; |
500 | handshake.RegionInfo.WaterHeight = 20; | 491 | handshake.RegionInfo.WaterHeight = 20; |
501 | handshake.RegionInfo.RegionFlags = 72458694; | 492 | handshake.RegionInfo.RegionFlags = 72458694; |
502 | handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0"); | 493 | handshake.RegionInfo.SimName = _enc.GetBytes(OpenSimRoot.Instance.Cfg.RegionName + "\0"); |
503 | handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000"); | 494 | handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000"); |
504 | handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); | 495 | handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); |
505 | handshake.RegionInfo.TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); | 496 | handshake.RegionInfo.TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); |
diff --git a/OpenSim.RegionServer/world/Primitive.cs b/OpenSim.RegionServer/world/Primitive.cs index a185f0b..6ff66a3 100644 --- a/OpenSim.RegionServer/world/Primitive.cs +++ b/OpenSim.RegionServer/world/Primitive.cs | |||
@@ -22,9 +22,6 @@ namespace OpenSim.world | |||
22 | private PhysicsActor _physActor; | 22 | private PhysicsActor _physActor; |
23 | private bool physicsEnabled = false; | 23 | private bool physicsEnabled = false; |
24 | private bool physicstest = false; //just added for testing | 24 | private bool physicstest = false; //just added for testing |
25 | private Dictionary<uint, SimClient> m_clientThreads; | ||
26 | private ulong m_regionHandle; | ||
27 | private World m_world; | ||
28 | 25 | ||
29 | public bool PhysicsEnabled | 26 | public bool PhysicsEnabled |
30 | { | 27 | { |
@@ -68,14 +65,10 @@ namespace OpenSim.world | |||
68 | } | 65 | } |
69 | } | 66 | } |
70 | 67 | ||
71 | public Primitive(Dictionary<uint, SimClient> clientThreads, ulong regionHandle, World world) | 68 | public Primitive() |
72 | { | 69 | { |
73 | mesh_cutbegin = 0.0f; | 70 | mesh_cutbegin = 0.0f; |
74 | mesh_cutend = 1.0f; | 71 | mesh_cutend = 1.0f; |
75 | |||
76 | m_clientThreads = clientThreads; | ||
77 | m_regionHandle = regionHandle; | ||
78 | m_world = world; | ||
79 | } | 72 | } |
80 | 73 | ||
81 | public override Mesh getMesh() | 74 | public override Mesh getMesh() |
@@ -106,7 +99,7 @@ namespace OpenSim.world | |||
106 | { | 99 | { |
107 | if (this.newPrimFlag) | 100 | if (this.newPrimFlag) |
108 | { | 101 | { |
109 | foreach (SimClient client in m_clientThreads.Values) | 102 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
110 | { | 103 | { |
111 | client.OutPacket(OurPacket); | 104 | client.OutPacket(OurPacket); |
112 | } | 105 | } |
@@ -115,11 +108,11 @@ namespace OpenSim.world | |||
115 | else if (this.updateFlag) | 108 | else if (this.updateFlag) |
116 | { | 109 | { |
117 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); | 110 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); |
118 | terse.RegionData.RegionHandle = m_regionHandle; // FIXME | 111 | terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME |
119 | terse.RegionData.TimeDilation = 64096; | 112 | terse.RegionData.TimeDilation = 64096; |
120 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 113 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |
121 | terse.ObjectData[0] = this.CreateImprovedBlock(); | 114 | terse.ObjectData[0] = this.CreateImprovedBlock(); |
122 | foreach (SimClient client in m_clientThreads.Values) | 115 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
123 | { | 116 | { |
124 | client.OutPacket(terse); | 117 | client.OutPacket(terse); |
125 | } | 118 | } |
@@ -127,7 +120,7 @@ namespace OpenSim.world | |||
127 | } | 120 | } |
128 | else if (this.dirtyFlag) | 121 | else if (this.dirtyFlag) |
129 | { | 122 | { |
130 | foreach (SimClient client in m_clientThreads.Values) | 123 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
131 | { | 124 | { |
132 | UpdateClient(client); | 125 | UpdateClient(client); |
133 | } | 126 | } |
@@ -138,11 +131,11 @@ namespace OpenSim.world | |||
138 | if (this._physActor != null && this.physicsEnabled) | 131 | if (this._physActor != null && this.physicsEnabled) |
139 | { | 132 | { |
140 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); | 133 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); |
141 | terse.RegionData.RegionHandle = m_regionHandle; // FIXME | 134 | terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME |
142 | terse.RegionData.TimeDilation = 64096; | 135 | terse.RegionData.TimeDilation = 64096; |
143 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 136 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |
144 | terse.ObjectData[0] = this.CreateImprovedBlock(); | 137 | terse.ObjectData[0] = this.CreateImprovedBlock(); |
145 | foreach (SimClient client in m_clientThreads.Values) | 138 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
146 | { | 139 | { |
147 | client.OutPacket(terse); | 140 | client.OutPacket(terse); |
148 | } | 141 | } |
@@ -262,7 +255,7 @@ namespace OpenSim.world | |||
262 | public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) | 255 | public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) |
263 | { | 256 | { |
264 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); | 257 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); |
265 | objupdate.RegionData.RegionHandle = m_regionHandle; | 258 | objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; |
266 | objupdate.RegionData.TimeDilation = 64096; | 259 | objupdate.RegionData.TimeDilation = 64096; |
267 | 260 | ||
268 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; | 261 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; |
@@ -330,7 +323,7 @@ namespace OpenSim.world | |||
330 | { | 323 | { |
331 | //need to clean this up as it shares a lot of code with CreateFromPacket() | 324 | //need to clean this up as it shares a lot of code with CreateFromPacket() |
332 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); | 325 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); |
333 | objupdate.RegionData.RegionHandle = m_regionHandle; | 326 | objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; |
334 | objupdate.RegionData.TimeDilation = 64096; | 327 | objupdate.RegionData.TimeDilation = 64096; |
335 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; | 328 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; |
336 | 329 | ||
@@ -487,7 +480,7 @@ namespace OpenSim.world | |||
487 | this.primData.LocalID = this.localid; | 480 | this.primData.LocalID = this.localid; |
488 | this.primData.Position = this.position; | 481 | this.primData.Position = this.position; |
489 | this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w); | 482 | this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w); |
490 | m_world.localStorage.StorePrim(this.primData); | 483 | OpenSimRoot.Instance.LocalWorld.localStorage.StorePrim(this.primData); |
491 | } | 484 | } |
492 | } | 485 | } |
493 | 486 | ||
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs index 7605f9e..e6d8921 100644 --- a/OpenSim.RegionServer/world/World.cs +++ b/OpenSim.RegionServer/world/World.cs | |||
@@ -25,21 +25,10 @@ namespace OpenSim.world | |||
25 | private Random Rand = new Random(); | 25 | private Random Rand = new Random(); |
26 | private uint _primCount = 702000; | 26 | private uint _primCount = 702000; |
27 | private int storageCount; | 27 | private int storageCount; |
28 | private Dictionary<uint, SimClient> m_clientThreads; | ||
29 | private ulong m_regionHandle; | ||
30 | private World m_world; | ||
31 | private string m_regionName; | ||
32 | private SimConfig m_cfg; | ||
33 | 28 | ||
34 | public World(Dictionary<uint, SimClient> clientThreads, ulong regionHandle, World world, string regionName, SimConfig cfg) | 29 | public World() |
35 | { | 30 | { |
36 | m_clientThreads = clientThreads; | 31 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating new entitities instance"); |
37 | m_regionHandle = regionHandle; | ||
38 | m_world = world; | ||
39 | m_regionName = regionName; | ||
40 | m_cfg = cfg; | ||
41 | |||
42 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating new entitities instance"); | ||
43 | Entities = new Dictionary<libsecondlife.LLUUID, Entity>(); | 32 | Entities = new Dictionary<libsecondlife.LLUUID, Entity>(); |
44 | 33 | ||
45 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); | 34 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); |
@@ -126,9 +115,9 @@ namespace OpenSim.world | |||
126 | HeightmapGenHills hills = new HeightmapGenHills(); | 115 | HeightmapGenHills hills = new HeightmapGenHills(); |
127 | this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); | 116 | this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); |
128 | this.phyScene.SetTerrain(this.LandMap); | 117 | this.phyScene.SetTerrain(this.LandMap); |
129 | m_cfg.SaveMap(this.LandMap); | 118 | OpenSimRoot.Instance.Cfg.SaveMap(this.LandMap); |
130 | 119 | ||
131 | foreach(SimClient client in m_clientThreads.Values) { | 120 | foreach(SimClient client in OpenSimRoot.Instance.ClientThreads.Values) { |
132 | this.SendLayerData(client); | 121 | this.SendLayerData(client); |
133 | } | 122 | } |
134 | } | 123 | } |
@@ -145,7 +134,7 @@ namespace OpenSim.world | |||
145 | _primCount = prim.LocalID + 1; | 134 | _primCount = prim.LocalID + 1; |
146 | } | 135 | } |
147 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId "+ prim.LocalID+ " ) from storage"); | 136 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId "+ prim.LocalID+ " ) from storage"); |
148 | Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, m_world); | 137 | Primitive nPrim = new Primitive(); |
149 | nPrim.CreateFromStorage(prim); | 138 | nPrim.CreateFromStorage(prim); |
150 | this.Entities.Add(nPrim.uuid, nPrim); | 139 | this.Entities.Add(nPrim.uuid, nPrim); |
151 | } | 140 | } |
@@ -186,7 +175,7 @@ namespace OpenSim.world | |||
186 | 175 | ||
187 | public void AddViewerAgent(SimClient AgentClient) { | 176 | public void AddViewerAgent(SimClient AgentClient) { |
188 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); | 177 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); |
189 | Avatar NewAvatar = new Avatar(AgentClient, m_world, m_regionName, m_clientThreads, m_regionHandle ); | 178 | Avatar NewAvatar = new Avatar(AgentClient); |
190 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); | 179 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); |
191 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); | 180 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); |
192 | NewAvatar.SendRegionHandshake(this); | 181 | NewAvatar.SendRegionHandshake(this); |
@@ -198,7 +187,7 @@ namespace OpenSim.world | |||
198 | public void AddNewPrim(ObjectAddPacket addPacket, SimClient AgentClient) | 187 | public void AddNewPrim(ObjectAddPacket addPacket, SimClient AgentClient) |
199 | { | 188 | { |
200 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim"); | 189 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim"); |
201 | Primitive prim = new Primitive(m_clientThreads, m_regionHandle, m_world ); | 190 | Primitive prim = new Primitive(); |
202 | prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount); | 191 | prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount); |
203 | PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z); | 192 | PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z); |
204 | PhysicsVector pSize = new PhysicsVector( 0.255f, 0.255f, 0.255f); | 193 | PhysicsVector pSize = new PhysicsVector( 0.255f, 0.255f, 0.255f); |
@@ -221,7 +210,7 @@ namespace OpenSim.world | |||
221 | foreach( DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData ) | 210 | foreach( DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData ) |
222 | { | 211 | { |
223 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); | 212 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); |
224 | foreach (Entity ent in m_world.Entities.Values) | 213 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) |
225 | { | 214 | { |
226 | if (ent.localid == Data.ObjectLocalID) | 215 | if (ent.localid == Data.ObjectLocalID) |
227 | { | 216 | { |
@@ -231,7 +220,7 @@ namespace OpenSim.world | |||
231 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; | 220 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; |
232 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); | 221 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); |
233 | kill.ObjectData[0].ID = ent.localid; | 222 | kill.ObjectData[0].ID = ent.localid; |
234 | foreach (SimClient client in m_clientThreads.Values) | 223 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) |
235 | { | 224 | { |
236 | client.OutPacket(kill); | 225 | client.OutPacket(kill); |
237 | } | 226 | } |
@@ -245,9 +234,9 @@ namespace OpenSim.world | |||
245 | } | 234 | } |
246 | foreach( libsecondlife.LLUUID uuid in DeRezEnts ) | 235 | foreach( libsecondlife.LLUUID uuid in DeRezEnts ) |
247 | { | 236 | { |
248 | lock (m_world.Entities) | 237 | lock (OpenSimRoot.Instance.LocalWorld.Entities) |
249 | { | 238 | { |
250 | m_world.Entities.Remove(uuid); | 239 | OpenSimRoot.Instance.LocalWorld.Entities.Remove(uuid); |
251 | } | 240 | } |
252 | } | 241 | } |
253 | 242 | ||