aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMW2008-02-04 12:04:02 +0000
committerMW2008-02-04 12:04:02 +0000
commit755ad9e3e0447b60299b08a18624064d1d64141b (patch)
tree89859180b5ba7ef47defbf6a1d6640177ecb1326 /OpenSim/Framework
parent* Whole buncha stuff. (diff)
downloadopensim-SC-755ad9e3e0447b60299b08a18624064d1d64141b.zip
opensim-SC-755ad9e3e0447b60299b08a18624064d1d64141b.tar.gz
opensim-SC-755ad9e3e0447b60299b08a18624064d1d64141b.tar.bz2
opensim-SC-755ad9e3e0447b60299b08a18624064d1d64141b.tar.xz
First part of avatar persistence, currently only really works in standalone mode (with accounts_authenticate set to true), it also only currently has a mysql database connector. (sqlite one will follow soon). It also uses the tribalmedia database system, so this needs checking to see if the old problems with mono have been fixed.
To use, see the appearance section in opensim.ini.example, set "persist = true", then add the correct connection string for your database.(see mysql-AvatarAppearance.sql in share folder for a example of the table mysql table structure). This could possible be used in a very small grid, but would mean each region server would need to connect to the same mysql database. But the work to move the code to one of the grid servers shouldn't be too much.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/GridAssetClient.cs2
-rw-r--r--OpenSim/Framework/Communications/RestClient/RestClient.cs1
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs9
-rw-r--r--OpenSim/Framework/Data/OpenSimDataReader.cs4
-rw-r--r--OpenSim/Framework/Data/OpenSimDatabaseConnector.cs26
-rw-r--r--OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs4
-rw-r--r--OpenSim/Framework/Data/OpenSimTableMapper.cs3
-rw-r--r--OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs6
8 files changed, 40 insertions, 15 deletions
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
index cf54fa4..2f0727f 100644
--- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
@@ -95,11 +95,13 @@ namespace OpenSim.Framework.Communications.Cache
95 // RestClient rc = new RestClient(_assetServerUrl); 95 // RestClient rc = new RestClient(_assetServerUrl);
96 MainLog.Instance.Verbose("ASSET", "Storing asset"); 96 MainLog.Instance.Verbose("ASSET", "Storing asset");
97 //rc.AddResourcePath("assets"); 97 //rc.AddResourcePath("assets");
98
98 // rc.RequestMethod = "POST"; 99 // rc.RequestMethod = "POST";
99 // rc.Request(s); 100 // rc.Request(s);
100 //MainLog.Instance.Verbose("ASSET", "Stored {0}", rc); 101 //MainLog.Instance.Verbose("ASSET", "Stored {0}", rc);
101 MainLog.Instance.Verbose("ASSET", "Sending to " + _assetServerUrl + "/assets/"); 102 MainLog.Instance.Verbose("ASSET", "Sending to " + _assetServerUrl + "/assets/");
102 RestObjectPoster.BeginPostObject<AssetBase>(_assetServerUrl + "/assets/", asset); 103 RestObjectPoster.BeginPostObject<AssetBase>(_assetServerUrl + "/assets/", asset);
104
103 } 105 }
104 catch (Exception e) 106 catch (Exception e)
105 { 107 {
diff --git a/OpenSim/Framework/Communications/RestClient/RestClient.cs b/OpenSim/Framework/Communications/RestClient/RestClient.cs
index e4da4dc..76bad64 100644
--- a/OpenSim/Framework/Communications/RestClient/RestClient.cs
+++ b/OpenSim/Framework/Communications/RestClient/RestClient.cs
@@ -389,6 +389,7 @@ namespace OpenSim.Framework.Communications
389 dst.Write(buf, 0, length); 389 dst.Write(buf, 0, length);
390 length = src.Read(buf, 0, 1024); 390 length = src.Read(buf, 0, 1024);
391 } 391 }
392
392 _response = (HttpWebResponse) _request.GetResponse(); 393 _response = (HttpWebResponse) _request.GetResponse();
393 394
394// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request); 395// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request);
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs b/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs
index 275ce47..5d636bd 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs
@@ -1,10 +1,11 @@
1using System.Data.Common; 1using System.Data.Common;
2using MySql.Data.MySqlClient; 2using MySql.Data.MySqlClient;
3// using TribalMedia.Framework.Data; 3 //using TribalMedia.Framework.Data;
4
4 5
5/*
6namespace OpenSim.Framework.Data.MySQL 6namespace OpenSim.Framework.Data.MySQL
7{ 7{
8 /*
8 public class MySQLDatabaseMapper : OpenSimDatabaseConnector 9 public class MySQLDatabaseMapper : OpenSimDatabaseConnector
9 { 10 {
10 public MySQLDatabaseMapper(string connectionString) 11 public MySQLDatabaseMapper(string connectionString)
@@ -22,6 +23,6 @@ namespace OpenSim.Framework.Data.MySQL
22 { 23 {
23 return "?" + fieldName; 24 return "?" + fieldName;
24 } 25 }
25 } 26 }*/
26} 27}
27*/ 28
diff --git a/OpenSim/Framework/Data/OpenSimDataReader.cs b/OpenSim/Framework/Data/OpenSimDataReader.cs
index c7b6470..d113f14 100644
--- a/OpenSim/Framework/Data/OpenSimDataReader.cs
+++ b/OpenSim/Framework/Data/OpenSimDataReader.cs
@@ -4,7 +4,7 @@ using System.Data;
4using System.Text; 4using System.Text;
5using libsecondlife; 5using libsecondlife;
6 6
7/* 7
8using TribalMedia.Framework.Data; 8using TribalMedia.Framework.Data;
9 9
10namespace OpenSim.Framework.Data 10namespace OpenSim.Framework.Data
@@ -39,4 +39,4 @@ namespace OpenSim.Framework.Data
39 } 39 }
40 } 40 }
41} 41}
42*/ 42
diff --git a/OpenSim/Framework/Data/OpenSimDatabaseConnector.cs b/OpenSim/Framework/Data/OpenSimDatabaseConnector.cs
index 155bdc1..aba9329 100644
--- a/OpenSim/Framework/Data/OpenSimDatabaseConnector.cs
+++ b/OpenSim/Framework/Data/OpenSimDatabaseConnector.cs
@@ -1,6 +1,8 @@
1using System.Data; 1using System.Data;
2using System.Data.Common;
2using libsecondlife; 3using libsecondlife;
3/* 4using MySql.Data.MySqlClient;
5
4using TribalMedia.Framework.Data; 6using TribalMedia.Framework.Data;
5 7
6namespace OpenSim.Framework.Data 8namespace OpenSim.Framework.Data
@@ -26,5 +28,25 @@ namespace OpenSim.Framework.Data
26 return new OpenSimDataReader(reader); 28 return new OpenSimDataReader(reader);
27 } 29 }
28 } 30 }
31
32
33 public class MySQLDatabaseMapper : OpenSimDatabaseConnector
34 {
35 public MySQLDatabaseMapper(string connectionString)
36 : base(connectionString)
37 {
38 }
39
40 public override DbConnection GetNewConnection()
41 {
42 MySqlConnection connection = new MySqlConnection(m_connectionString);
43 return connection;
44 }
45
46 public override string CreateParamName(string fieldName)
47 {
48 return "?" + fieldName;
49 }
50 }
29} 51}
30*/ 52
diff --git a/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs b/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs
index 8d5b9cf..269f863 100644
--- a/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs
+++ b/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
3using System.Data.Common; 3using System.Data.Common;
4using System.Text; 4using System.Text;
5using libsecondlife; 5using libsecondlife;
6/* 6
7using TribalMedia.Framework.Data; 7using TribalMedia.Framework.Data;
8 8
9namespace OpenSim.Framework.Data 9namespace OpenSim.Framework.Data
@@ -73,4 +73,4 @@ namespace OpenSim.Framework.Data
73 } 73 }
74 } 74 }
75} 75}
76*/ 76
diff --git a/OpenSim/Framework/Data/OpenSimTableMapper.cs b/OpenSim/Framework/Data/OpenSimTableMapper.cs
index f596b45..e5deae0 100644
--- a/OpenSim/Framework/Data/OpenSimTableMapper.cs
+++ b/OpenSim/Framework/Data/OpenSimTableMapper.cs
@@ -1,5 +1,5 @@
1using System.Data; 1using System.Data;
2/* 2
3using TribalMedia.Framework.Data; 3using TribalMedia.Framework.Data;
4 4
5namespace OpenSim.Framework.Data 5namespace OpenSim.Framework.Data
@@ -11,4 +11,3 @@ namespace OpenSim.Framework.Data
11 } 11 }
12 } 12 }
13} 13}
14*/
diff --git a/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs b/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs
index 227a98e..ec9689a 100644
--- a/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs
+++ b/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs
@@ -1,9 +1,9 @@
1using System; 1using System;
2using OpenSim.Framework; 2using OpenSim.Framework;
3//using TribalMedia.Framework.Data; 3using TribalMedia.Framework.Data;
4using libsecondlife; 4using libsecondlife;
5 5
6/* 6
7namespace OpenSim.Framework.Data 7namespace OpenSim.Framework.Data
8{ 8{
9 public class PrimitiveBaseShapeRowMapper : BaseRowMapper<PrimitiveBaseShape> 9 public class PrimitiveBaseShapeRowMapper : BaseRowMapper<PrimitiveBaseShape>
@@ -142,4 +142,4 @@ namespace OpenSim.Framework.Data
142 } 142 }
143 } 143 }
144} 144}
145*/ 145