aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorlbsa712008-01-16 12:25:13 +0000
committerlbsa712008-01-16 12:25:13 +0000
commit5e757d2ad1ae3ad158a9b5f6077abcfaf9fac616 (patch)
tree96b3f4b939bd0c4a6e8b457f3e604ba143970c00 /OpenSim
parent* Fix for: http://opensimulator.org/mantis/view.php?id=358 (diff)
downloadopensim-SC_OLD-5e757d2ad1ae3ad158a9b5f6077abcfaf9fac616.zip
opensim-SC_OLD-5e757d2ad1ae3ad158a9b5f6077abcfaf9fac616.tar.gz
opensim-SC_OLD-5e757d2ad1ae3ad158a9b5f6077abcfaf9fac616.tar.bz2
opensim-SC_OLD-5e757d2ad1ae3ad158a9b5f6077abcfaf9fac616.tar.xz
* More work on getting the database framework to actually work
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs2
-rw-r--r--OpenSim/Framework/Data/OpenSimDataReader.cs2
-rw-r--r--OpenSim/Framework/Data/OpenSimDatabaseConnector.cs (renamed from OpenSim/Framework/Data/OpenSimDatabaseMapper.cs)11
-rw-r--r--OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs2
-rw-r--r--OpenSim/Framework/Data/OpenSimTableMapper.cs5
-rw-r--r--OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs8
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs37
7 files changed, 33 insertions, 34 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs b/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs
index 6b23c74..ac5fb9d 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs
@@ -3,7 +3,7 @@ using MySql.Data.MySqlClient;
3 3
4namespace OpenSim.Framework.Data.MySQL 4namespace OpenSim.Framework.Data.MySQL
5{ 5{
6 public class MySQLDatabaseMapper : OpenSimDatabaseMapper 6 public class MySQLDatabaseMapper : OpenSimDatabaseConnector
7 { 7 {
8 public MySQLDatabaseMapper(string connectionString) 8 public MySQLDatabaseMapper(string connectionString)
9 : base(connectionString) 9 : base(connectionString)
diff --git a/OpenSim/Framework/Data/OpenSimDataReader.cs b/OpenSim/Framework/Data/OpenSimDataReader.cs
index 11a8b8b..518cdc9 100644
--- a/OpenSim/Framework/Data/OpenSimDataReader.cs
+++ b/OpenSim/Framework/Data/OpenSimDataReader.cs
@@ -7,7 +7,7 @@ using TribalMedia.Framework.Data;
7 7
8namespace OpenSim.Framework.Data 8namespace OpenSim.Framework.Data
9{ 9{
10 public class OpenSimDataReader : DataReader 10 public class OpenSimDataReader : BaseDataReader
11 { 11 {
12 public OpenSimDataReader(IDataReader source) : base(source) 12 public OpenSimDataReader(IDataReader source) : base(source)
13 { 13 {
diff --git a/OpenSim/Framework/Data/OpenSimDatabaseMapper.cs b/OpenSim/Framework/Data/OpenSimDatabaseConnector.cs
index 4f202bc..ec80488 100644
--- a/OpenSim/Framework/Data/OpenSimDatabaseMapper.cs
+++ b/OpenSim/Framework/Data/OpenSimDatabaseConnector.cs
@@ -1,12 +1,12 @@
1using System.Data.Common; 1using System.Data;
2using libsecondlife; 2using libsecondlife;
3using TribalMedia.Framework.Data; 3using TribalMedia.Framework.Data;
4 4
5namespace OpenSim.Framework.Data 5namespace OpenSim.Framework.Data
6{ 6{
7 public abstract class OpenSimDatabaseMapper : BaseDatabaseConnector 7 public abstract class OpenSimDatabaseConnector : BaseDatabaseConnector
8 { 8 {
9 public OpenSimDatabaseMapper(string connectionString) : base(connectionString) 9 public OpenSimDatabaseConnector(string connectionString) : base(connectionString)
10 { 10 {
11 } 11 }
12 12
@@ -19,5 +19,10 @@ namespace OpenSim.Framework.Data
19 19
20 return base.ConvertToDbType(value); 20 return base.ConvertToDbType(value);
21 } 21 }
22
23 public override BaseDataReader CreateReader(IDataReader reader)
24 {
25 return new OpenSimDataReader(reader);
26 }
22 } 27 }
23} 28}
diff --git a/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs b/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs
index d8c2ddf..103de2d 100644
--- a/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs
+++ b/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Framework.Data
44 } 44 }
45 } 45 }
46 46
47 protected override object GetValue(DataReader reader) 47 protected override object GetValue(BaseDataReader reader)
48 { 48 {
49 object value; 49 object value;
50 50
diff --git a/OpenSim/Framework/Data/OpenSimTableMapper.cs b/OpenSim/Framework/Data/OpenSimTableMapper.cs
index a77936f..744f062 100644
--- a/OpenSim/Framework/Data/OpenSimTableMapper.cs
+++ b/OpenSim/Framework/Data/OpenSimTableMapper.cs
@@ -8,10 +8,5 @@ namespace OpenSim.Framework.Data
8 public OpenSimTableMapper(BaseDatabaseConnector database, string tableName) : base(database, tableName) 8 public OpenSimTableMapper(BaseDatabaseConnector database, string tableName) : base(database, tableName)
9 { 9 {
10 } 10 }
11
12 protected override DataReader CreateReader(IDataReader reader)
13 {
14 return new OpenSimDataReader(reader);
15 }
16 } 11 }
17} 12}
diff --git a/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs b/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs
index af49376..c915538 100644
--- a/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs
+++ b/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs
@@ -5,11 +5,11 @@ using libsecondlife;
5 5
6namespace OpenSim.Framework.Data 6namespace OpenSim.Framework.Data
7{ 7{
8 public class PrimitiveBaseShapeRowMapper : RowMapper<PrimitiveBaseShape> 8 public class PrimitiveBaseShapeRowMapper : BaseRowMapper<PrimitiveBaseShape>
9 { 9 {
10 public Guid SceneObjectPartId; 10 public Guid SceneObjectPartId;
11 11
12 public PrimitiveBaseShapeRowMapper(Schema schema, PrimitiveBaseShape obj) : base(schema, obj) 12 public PrimitiveBaseShapeRowMapper(BaseSchema schema, PrimitiveBaseShape obj) : base(schema, obj)
13 { 13 {
14 } 14 }
15 } 15 }
@@ -19,7 +19,7 @@ namespace OpenSim.Framework.Data
19 public PrimitiveBaseShapeTableMapper(BaseDatabaseConnector connection, string tableName) 19 public PrimitiveBaseShapeTableMapper(BaseDatabaseConnector connection, string tableName)
20 : base(connection, tableName) 20 : base(connection, tableName)
21 { 21 {
22 ObjectSchema<PrimitiveBaseShapeRowMapper> rowMapperSchema = new ObjectSchema<PrimitiveBaseShapeRowMapper>(this); 22 BaseSchema<PrimitiveBaseShapeRowMapper> rowMapperSchema = new BaseSchema<PrimitiveBaseShapeRowMapper>(this);
23 m_schema = rowMapperSchema; 23 m_schema = rowMapperSchema;
24 24
25 m_keyFieldMapper = rowMapperSchema.AddMapping<Guid>("SceneObjectPartId", 25 m_keyFieldMapper = rowMapperSchema.AddMapping<Guid>("SceneObjectPartId",
@@ -111,7 +111,7 @@ namespace OpenSim.Framework.Data
111 delegate(PrimitiveBaseShapeRowMapper shape, byte[] value) { shape.Object.ExtraParams = value; }); 111 delegate(PrimitiveBaseShapeRowMapper shape, byte[] value) { shape.Object.ExtraParams = value; });
112 } 112 }
113 113
114 public override PrimitiveBaseShapeRowMapper FromReader(DataReader reader) 114 public override PrimitiveBaseShapeRowMapper FromReader(BaseDataReader reader)
115 { 115 {
116 PrimitiveBaseShape shape = new PrimitiveBaseShape(); 116 PrimitiveBaseShape shape = new PrimitiveBaseShape();
117 117
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index e74aee7..d6c9d1d 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -416,7 +416,7 @@ namespace OpenSim.Region.ClientStack
416 { 416 {
417 // this will normally trigger at least one packet (ping response) 417 // this will normally trigger at least one packet (ping response)
418 SendStartPingCheck(0); 418 SendStartPingCheck(0);
419 419
420 } 420 }
421 } 421 }
422 else 422 else
@@ -424,7 +424,7 @@ namespace OpenSim.Region.ClientStack
424 // Something received in the meantime - we can reset the counters 424 // Something received in the meantime - we can reset the counters
425 m_probesWithNoIngressPackets = 0; 425 m_probesWithNoIngressPackets = 0;
426 m_lastPacketsReceived = m_packetsReceived; 426 m_lastPacketsReceived = m_packetsReceived;
427 427
428 } 428 }
429 } 429 }
430 430
@@ -2311,7 +2311,7 @@ namespace OpenSim.Region.ClientStack
2311 if (Pack.Header.Reliable) //DIRTY HACK 2311 if (Pack.Header.Reliable) //DIRTY HACK
2312 { 2312 {
2313 AddAck(Pack); // this adds the need to ack this packet later 2313 AddAck(Pack); // this adds the need to ack this packet later
2314 2314
2315 2315
2316 if (Pack.Type != PacketType.PacketAck && Pack.Type != PacketType.LogoutRequest) 2316 if (Pack.Type != PacketType.PacketAck && Pack.Type != PacketType.LogoutRequest)
2317 { 2317 {
@@ -2355,10 +2355,15 @@ namespace OpenSim.Region.ClientStack
2355 { 2355 {
2356 lock (m_needAck) 2356 lock (m_needAck)
2357 { 2357 {
2358 foreach (uint ack in NewPack.Header.AckList) 2358 foreach (uint ackedPacketId in NewPack.Header.AckList)
2359 { 2359 {
2360 m_unAckedBytes -= m_needAck[ack].ToBytes().Length; 2360 Packet ackedPacket;
2361 m_needAck.Remove(ack); 2361
2362 if (m_needAck.TryGetValue(ackedPacketId, out ackedPacket))
2363 {
2364 m_unAckedBytes -= ackedPacket.ToBytes().Length;
2365 m_needAck.Remove(ackedPacketId);
2366 }
2362 } 2367 }
2363 } 2368 }
2364 } 2369 }
@@ -2373,18 +2378,12 @@ namespace OpenSim.Region.ClientStack
2373 { 2378 {
2374 foreach (PacketAckPacket.PacketsBlock block in ackPacket.Packets) 2379 foreach (PacketAckPacket.PacketsBlock block in ackPacket.Packets)
2375 { 2380 {
2376 if (m_needAck.ContainsKey(block.ID)) 2381 uint ackedPackId = block.ID;
2382 Packet ackedPacket;
2383 if (m_needAck.TryGetValue(ackedPackId, out ackedPacket))
2377 { 2384 {
2378 try 2385 m_unAckedBytes -= ackedPacket.ToBytes().Length;
2379 { 2386 m_needAck.Remove(ackedPackId);
2380 m_unAckedBytes -= m_needAck[block.ID].ToBytes().Length;
2381 m_needAck.Remove(block.ID);
2382 }
2383 catch (System.Collections.Generic.KeyNotFoundException)
2384 {
2385 // Did another packet come in with the ack already?
2386 // apparently so!
2387 }
2388 } 2387 }
2389 } 2388 }
2390 } 2389 }
@@ -2500,11 +2499,11 @@ namespace OpenSim.Region.ClientStack
2500 2499
2501 protected void AckTimer_Elapsed(object sender, ElapsedEventArgs ea) 2500 protected void AckTimer_Elapsed(object sender, ElapsedEventArgs ea)
2502 { 2501 {
2503 2502
2504 SendAcks(); 2503 SendAcks();
2505 ResendUnacked(); 2504 ResendUnacked();
2506 SendPacketStats(); 2505 SendPacketStats();
2507 2506
2508 } 2507 }
2509 2508
2510 protected void SendPacketStats() 2509 protected void SendPacketStats()