aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs61
-rw-r--r--OpenSim/Region/ClientStack/Assets/InventoryCache.cs23
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs2
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs2
-rw-r--r--OpenSim/Region/Environment/LandManagement/LandManager.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs15
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs7
8 files changed, 41 insertions, 75 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 8e3f558..b052178 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -60,8 +60,8 @@ namespace OpenSim
60 public bool m_sandbox; 60 public bool m_sandbox;
61 public bool user_accounts; 61 public bool user_accounts;
62 public bool m_gridLocalAsset; 62 public bool m_gridLocalAsset;
63 protected bool m_useConfigFile; 63
64 public string m_configFileName; 64 protected string m_storageDLL = "OpenSim.DataStore.NullStorage.dll";
65 65
66 protected List<UDPServer> m_udpServers = new List<UDPServer>(); 66 protected List<UDPServer> m_udpServers = new List<UDPServer>();
67 protected List<RegionInfo> m_regionData = new List<RegionInfo>(); 67 protected List<RegionInfo> m_regionData = new List<RegionInfo>();
@@ -74,31 +74,30 @@ namespace OpenSim
74 : base() 74 : base()
75 { 75 {
76 IConfigSource startupSource = configSource; 76 IConfigSource startupSource = configSource;
77 string iniFile = startupSource.Configs["Startup"].GetString("inifile", "NA"); 77 string iniFile = startupSource.Configs["Startup"].GetString("inifile", "OpenSim.ini");
78 if (iniFile != "NA") 78
79 //check for .INI file (either default or name passed in command line)
80 string iniFilePath = Path.Combine(Util.configDir(), iniFile);
81 if (File.Exists(iniFilePath))
79 { 82 {
80 //a INI file is set to be used for startup settings 83 startupSource = new IniConfigSource(iniFilePath);
81 string iniFilePath = Path.Combine(Util.configDir(), iniFile); 84
82 if (File.Exists(iniFilePath)) 85 //enable following line, if we want the original config source(normally commandline args) merged with ini file settings.
83 { 86 //in this case we have it so that if both sources have the same named setting, the command line value will overwrite the ini file value.
84 startupSource = new IniConfigSource(iniFilePath); 87 //(as if someone has bothered to enter a command line arg, we should take notice of it)
85 88 startupSource.Merge(configSource);
86 //enable following line, if we want the original config source(normally commandline args) merged with ini file settings.
87 //in this case we have it so that if both sources have the same named setting, the command line value will overwrite the ini file value.
88 //(as if someone has bothered to enter a command line arg, we should take notice of it)
89 //startupSource.Merge(configSource);
90 }
91 } 89 }
90
92 ReadConfigSettings(startupSource); 91 ReadConfigSettings(startupSource);
93 } 92 }
94 93
95 protected void ReadConfigSettings(IConfigSource configSource) 94 protected void ReadConfigSettings(IConfigSource configSource)
96 { 95 {
97 m_useConfigFile = configSource.Configs["Startup"].GetBoolean("configfile", false);
98 m_sandbox = !configSource.Configs["Startup"].GetBoolean("gridmode", false); 96 m_sandbox = !configSource.Configs["Startup"].GetBoolean("gridmode", false);
99 m_physicsEngine = configSource.Configs["Startup"].GetString("physics", "basicphysics"); 97 m_physicsEngine = configSource.Configs["Startup"].GetString("physics", "basicphysics");
100 m_configFileName = configSource.Configs["Startup"].GetString("config", "simconfig.xml");
101 m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false); 98 m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false);
99
100 m_storageDLL = configSource.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
102 } 101 }
103 102
104 /// <summary> 103 /// <summary>
@@ -110,7 +109,7 @@ namespace OpenSim
110 { 109 {
111 Directory.CreateDirectory(Util.logDir()); 110 Directory.CreateDirectory(Util.logDir());
112 } 111 }
113 112
114 m_log = new LogBase(Path.Combine(Util.logDir(), m_logFilename), "Region", this, m_silent); 113 m_log = new LogBase(Path.Combine(Util.logDir(), m_logFilename), "Region", this, m_silent);
115 MainLog.Instance = m_log; 114 MainLog.Instance = m_log;
116 115
@@ -131,12 +130,12 @@ namespace OpenSim
131 } 130 }
132 131
133 string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); 132 string regionConfigPath = Path.Combine(Util.configDir(), "Regions");
134 133
135 if (!Directory.Exists(regionConfigPath)) 134 if (!Directory.Exists(regionConfigPath))
136 { 135 {
137 Directory.CreateDirectory(regionConfigPath); 136 Directory.CreateDirectory(regionConfigPath);
138 } 137 }
139 138
140 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); 139 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
141 140
142 if (configFiles.Length == 0) 141 if (configFiles.Length == 0)
@@ -175,7 +174,7 @@ namespace OpenSim
175 174
176 protected override StorageManager CreateStorageManager(RegionInfo regionInfo) 175 protected override StorageManager CreateStorageManager(RegionInfo regionInfo)
177 { 176 {
178 return new StorageManager("OpenSim.DataStore.NullStorage.dll", regionInfo.DataStore, regionInfo.RegionName); 177 return new StorageManager(m_storageDLL, regionInfo.DataStore, regionInfo.RegionName);
179 } 178 }
180 179
181 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager) 180 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager)
@@ -287,7 +286,7 @@ namespace OpenSim
287 286
288 case "terrain": 287 case "terrain":
289 string result = ""; 288 string result = "";
290 foreach(Scene scene in m_localScenes) 289 foreach (Scene scene in m_localScenes)
291 { 290 {
292 if (!scene.Terrain.RunTerrainCmd(cmdparams, ref result, scene.RegionInfo.RegionName)) 291 if (!scene.Terrain.RunTerrainCmd(cmdparams, ref result, scene.RegionInfo.RegionName))
293 { 292 {
@@ -296,21 +295,21 @@ namespace OpenSim
296 } 295 }
297 break; 296 break;
298 case "script": 297 case "script":
299 foreach(Scene scene in m_localScenes ) 298 foreach (Scene scene in m_localScenes)
300 { 299 {
301 scene.SendCommandToScripts(cmdparams); 300 scene.SendCommandToScripts(cmdparams);
302 } 301 }
303 break; 302 break;
304 303
305 case "backup": 304 case "backup":
306 foreach(Scene scene in m_localScenes ) 305 foreach (Scene scene in m_localScenes)
307 { 306 {
308 scene.Backup(); 307 scene.Backup();
309 } 308 }
310 break; 309 break;
311 310
312 case "alert": 311 case "alert":
313 foreach(Scene scene in m_localScenes) 312 foreach (Scene scene in m_localScenes)
314 { 313 {
315 scene.HandleAlertCommand(cmdparams); 314 scene.HandleAlertCommand(cmdparams);
316 } 315 }
@@ -344,19 +343,19 @@ namespace OpenSim
344 for (int i = 0; i < m_localScenes.Count; i++) 343 for (int i = 0; i < m_localScenes.Count; i++)
345 { 344 {
346 Scene scene = m_localScenes[i]; 345 Scene scene = m_localScenes[i];
347 foreach (Entity entity in scene.Entities.Values ) 346 foreach (Entity entity in scene.Entities.Values)
348 { 347 {
349 if ( entity is ScenePresence ) 348 if (entity is ScenePresence)
350 { 349 {
351 ScenePresence scenePrescence = entity as ScenePresence; 350 ScenePresence scenePrescence = entity as ScenePresence;
352 m_log.Error( 351 m_log.Error(
353 String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", 352 String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}",
354 scenePrescence.Firstname, 353 scenePrescence.Firstname,
355 scenePrescence.Lastname, 354 scenePrescence.Lastname,
356 scenePrescence.UUID, 355 scenePrescence.UUID,
357 scenePrescence.ControllingClient.AgentId, 356 scenePrescence.ControllingClient.AgentId,
358 "Unknown", 357 "Unknown",
359 "Unknown", 358 "Unknown",
360 scene.RegionInfo.RegionName)); 359 scene.RegionInfo.RegionName));
361 } 360 }
362 } 361 }
diff --git a/OpenSim/Region/ClientStack/Assets/InventoryCache.cs b/OpenSim/Region/ClientStack/Assets/InventoryCache.cs
index c0609b6..8185502 100644
--- a/OpenSim/Region/ClientStack/Assets/InventoryCache.cs
+++ b/OpenSim/Region/ClientStack/Assets/InventoryCache.cs
@@ -64,17 +64,6 @@ namespace OpenSim.Assets
64 } 64 }
65 } 65 }
66 66
67 public AgentInventory FetchAgentsInventory(LLUUID agentID, IUserServer userserver)
68 {
69 AgentInventory res = null;
70 if (!this._agentsInventory.ContainsKey(agentID))
71 {
72 res = userserver.RequestAgentsInventory(agentID);
73 this._agentsInventory.Add(agentID,res);
74 }
75 return res;
76 }
77
78 public AgentInventory GetAgentsInventory(LLUUID agentID) 67 public AgentInventory GetAgentsInventory(LLUUID agentID)
79 { 68 {
80 if (this._agentsInventory.ContainsKey(agentID)) 69 if (this._agentsInventory.ContainsKey(agentID))
@@ -85,18 +74,6 @@ namespace OpenSim.Assets
85 return null; 74 return null;
86 } 75 }
87 76
88 public void ClientLeaving(LLUUID clientID, IUserServer userserver)
89 {
90 if (this._agentsInventory.ContainsKey(clientID))
91 {
92 if (userserver != null)
93 {
94 userserver.UpdateAgentsInventory(clientID, this._agentsInventory[clientID]);
95 }
96 this._agentsInventory.Remove(clientID);
97 }
98 }
99
100 public bool CreateNewInventoryFolder(ClientView remoteClient, LLUUID folderID) 77 public bool CreateNewInventoryFolder(ClientView remoteClient, LLUUID folderID)
101 { 78 {
102 return this.CreateNewInventoryFolder(remoteClient, folderID, 0); 79 return this.CreateNewInventoryFolder(remoteClient, folderID, 0);
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index e693c64..1375f6c 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -120,7 +120,7 @@ namespace OpenSim.Region.ClientStack
120 public void KillClient() 120 public void KillClient()
121 { 121 {
122 clientPingTimer.Stop(); 122 clientPingTimer.Stop();
123 this.m_inventoryCache.ClientLeaving(this.AgentID, null); 123
124 m_scene.RemoveClient(this.AgentId); 124 m_scene.RemoveClient(this.AgentId);
125 125
126 m_clientThreads.Remove(this.CircuitCode); 126 m_clientThreads.Remove(this.CircuitCode);
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 05c970a..d47450a 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.ClientStack
70 70
71 Initialize(); 71 Initialize();
72 72
73 ScenePresence.CreateDefaultTextureEntry("avatar-texture.dat"); 73 ScenePresence.CreateDefaultTextureEntry();
74 74
75 m_httpServer = new BaseHttpServer( m_httpServerPort ); 75 m_httpServer = new BaseHttpServer( m_httpServerPort );
76 76
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs
index f67b51a..5bc975c 100644
--- a/OpenSim/Region/Environment/LandManagement/LandManager.cs
+++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.LandManagement
41 /// <summary> 41 /// <summary>
42 /// Handles Land objects and operations requiring information from other Land objects (divide, join, etc) 42 /// Handles Land objects and operations requiring information from other Land objects (divide, join, etc)
43 /// </summary> 43 /// </summary>
44 public class LandManager : ILocalStorageLandObjectReceiver 44 public class LandManager
45 { 45 {
46 46
47 #region Constants 47 #region Constants
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index cae57a2..d3c7f77 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes
50 50
51 public delegate void ForEachScenePresenceDelegate(ScenePresence presence); 51 public delegate void ForEachScenePresenceDelegate(ScenePresence presence);
52 52
53 public partial class Scene : SceneBase, ILocalStorageReceiver 53 public partial class Scene : SceneBase
54 { 54 {
55 protected Timer m_heartbeatTimer = new Timer(); 55 protected Timer m_heartbeatTimer = new Timer();
56 protected Dictionary<LLUUID, ScenePresence> Avatars; 56 protected Dictionary<LLUUID, ScenePresence> Avatars;
@@ -229,7 +229,7 @@ namespace OpenSim.Region.Environment.Scenes
229 229
230 //backup scene data 230 //backup scene data
231 storageCount++; 231 storageCount++;
232 if (storageCount > 1200) //set to how often you want to backup 232 if (storageCount > 600) //set to how often you want to backup
233 { 233 {
234 Backup(); 234 Backup();
235 storageCount = 0; 235 storageCount = 0;
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 114623a..1be1e7a 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -665,19 +665,8 @@ namespace OpenSim.Region.Environment.Scenes
665 } 665 }
666 } 666 }
667 667
668 public static void CreateDefaultTextureEntry(string name) 668 public static void CreateDefaultTextureEntry()
669 { 669 {
670 /* FileInfo fInfo = new FileInfo(name);
671 long numBytes = fInfo.Length;
672 FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read);
673 BinaryReader br = new BinaryReader(fStream);
674 byte[] data1 = br.ReadBytes((int)numBytes);
675 br.Close();
676 fStream.Close();
677 DefaultTexture = data1;
678 LLObject.TextureEntry textu = new LLObject.TextureEntry(data1, 0, data1.Length);
679 Console.WriteLine("default texture entry: " + textu.ToString());*/
680
681 LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); 670 LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97"));
682 textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012"); 671 textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012");
683 textu.CreateFace(1).TextureID = new LLUUID("5748decc-f629-461c-9a36-a35a221fe21f"); 672 textu.CreateFace(1).TextureID = new LLUUID("5748decc-f629-461c-9a36-a35a221fe21f");
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
index f85d3b6..45b19e6 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
@@ -1,7 +1,6 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using System.IO;
5 4
6using OpenSim.Region.Environment.Scenes; 5using OpenSim.Region.Environment.Scenes;
7using OpenSim.Region.Environment.LandManagement; 6using OpenSim.Region.Environment.LandManagement;
@@ -31,9 +30,10 @@ namespace OpenSim.DataStore.MonoSqliteStorage
31 30
32 public void Initialise(string dbfile, string dbname) 31 public void Initialise(string dbfile, string dbname)
33 { 32 {
34 // for us, dbfile will be the connect string 33 string connectionString = "URI=file:" + dbfile + ",version=3";
34
35 MainLog.Instance.Verbose("DATASTORE", "Sqlite - connecting: " + dbfile); 35 MainLog.Instance.Verbose("DATASTORE", "Sqlite - connecting: " + dbfile);
36 SqliteConnection conn = new SqliteConnection(dbfile); 36 SqliteConnection conn = new SqliteConnection(connectionString);
37 37
38 SqliteCommand primSelectCmd = new SqliteCommand(primSelect, conn); 38 SqliteCommand primSelectCmd = new SqliteCommand(primSelect, conn);
39 primDa = new SqliteDataAdapter(primSelectCmd); 39 primDa = new SqliteDataAdapter(primSelectCmd);
@@ -301,6 +301,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage
301 Convert.ToSingle(row["RotationZ"]), 301 Convert.ToSingle(row["RotationZ"]),
302 Convert.ToSingle(row["RotationW"]) 302 Convert.ToSingle(row["RotationW"])
303 ); 303 );
304
304 return prim; 305 return prim;
305 } 306 }
306 307