diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Framework/Data.MSSQL | |
parent | * Deleted .user file (diff) | |
download | opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Framework/Data.MSSQL')
-rw-r--r-- | OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Data.MSSQL/MSSQLManager.cs | 68 | ||||
-rw-r--r-- | OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs | 31 |
3 files changed, 56 insertions, 47 deletions
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs index e628882..1946790 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs | |||
@@ -185,10 +185,10 @@ namespace OpenSim.Framework.Data.MSSQL | |||
185 | byte[] hash = HashProvider.ComputeHash(stream); | 185 | byte[] hash = HashProvider.ComputeHash(stream); |
186 | return false; | 186 | return false; |
187 | } | 187 | } |
188 | |||
188 | public ReservationData GetReservationAtPoint(uint x, uint y) | 189 | public ReservationData GetReservationAtPoint(uint x, uint y) |
189 | { | 190 | { |
190 | return null; | 191 | return null; |
191 | } | 192 | } |
192 | } | 193 | } |
193 | 194 | } \ No newline at end of file | |
194 | } | ||
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs index 77d29f7..c0b2edf 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs | |||
@@ -36,12 +36,12 @@ namespace OpenSim.Framework.Data.MSSQL | |||
36 | /// <summary> | 36 | /// <summary> |
37 | /// A management class for the MS SQL Storage Engine | 37 | /// A management class for the MS SQL Storage Engine |
38 | /// </summary> | 38 | /// </summary> |
39 | class MSSqlManager | 39 | internal class MSSqlManager |
40 | { | 40 | { |
41 | /// <summary> | 41 | /// <summary> |
42 | /// The database connection object | 42 | /// The database connection object |
43 | /// </summary> | 43 | /// </summary> |
44 | IDbConnection dbcon; | 44 | private IDbConnection dbcon; |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// Initialises and creates a new Sql connection and maintains it. | 47 | /// Initialises and creates a new Sql connection and maintains it. |
@@ -55,7 +55,8 @@ namespace OpenSim.Framework.Data.MSSQL | |||
55 | { | 55 | { |
56 | try | 56 | try |
57 | { | 57 | { |
58 | string connectionString = "Server=" + hostname + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";"; | 58 | string connectionString = "Server=" + hostname + ";Database=" + database + ";User ID=" + username + |
59 | ";Password=" + password + ";Pooling=" + cpooling + ";"; | ||
59 | dbcon = new SqlConnection(connectionString); | 60 | dbcon = new SqlConnection(connectionString); |
60 | 61 | ||
61 | dbcon.Open(); | 62 | dbcon.Open(); |
@@ -83,14 +84,14 @@ namespace OpenSim.Framework.Data.MSSQL | |||
83 | /// <returns>A Sql DB Command</returns> | 84 | /// <returns>A Sql DB Command</returns> |
84 | public IDbCommand Query(string sql, Dictionary<string, string> parameters) | 85 | public IDbCommand Query(string sql, Dictionary<string, string> parameters) |
85 | { | 86 | { |
86 | SqlCommand dbcommand = (SqlCommand)dbcon.CreateCommand(); | 87 | SqlCommand dbcommand = (SqlCommand) dbcon.CreateCommand(); |
87 | dbcommand.CommandText = sql; | 88 | dbcommand.CommandText = sql; |
88 | foreach (KeyValuePair<string, string> param in parameters) | 89 | foreach (KeyValuePair<string, string> param in parameters) |
89 | { | 90 | { |
90 | dbcommand.Parameters.AddWithValue(param.Key, param.Value); | 91 | dbcommand.Parameters.AddWithValue(param.Key, param.Value); |
91 | } | 92 | } |
92 | 93 | ||
93 | return (IDbCommand)dbcommand; | 94 | return (IDbCommand) dbcommand; |
94 | } | 95 | } |
95 | 96 | ||
96 | /// <summary> | 97 | /// <summary> |
@@ -105,42 +106,42 @@ namespace OpenSim.Framework.Data.MSSQL | |||
105 | if (reader.Read()) | 106 | if (reader.Read()) |
106 | { | 107 | { |
107 | // Region Main | 108 | // Region Main |
108 | regionprofile.regionHandle = (ulong)reader["regionHandle"]; | 109 | regionprofile.regionHandle = (ulong) reader["regionHandle"]; |
109 | regionprofile.regionName = (string)reader["regionName"]; | 110 | regionprofile.regionName = (string) reader["regionName"]; |
110 | regionprofile.UUID = new LLUUID((string)reader["uuid"]); | 111 | regionprofile.UUID = new LLUUID((string) reader["uuid"]); |
111 | 112 | ||
112 | // Secrets | 113 | // Secrets |
113 | regionprofile.regionRecvKey = (string)reader["regionRecvKey"]; | 114 | regionprofile.regionRecvKey = (string) reader["regionRecvKey"]; |
114 | regionprofile.regionSecret = (string)reader["regionSecret"]; | 115 | regionprofile.regionSecret = (string) reader["regionSecret"]; |
115 | regionprofile.regionSendKey = (string)reader["regionSendKey"]; | 116 | regionprofile.regionSendKey = (string) reader["regionSendKey"]; |
116 | 117 | ||
117 | // Region Server | 118 | // Region Server |
118 | regionprofile.regionDataURI = (string)reader["regionDataURI"]; | 119 | regionprofile.regionDataURI = (string) reader["regionDataURI"]; |
119 | regionprofile.regionOnline = false; // Needs to be pinged before this can be set. | 120 | regionprofile.regionOnline = false; // Needs to be pinged before this can be set. |
120 | regionprofile.serverIP = (string)reader["serverIP"]; | 121 | regionprofile.serverIP = (string) reader["serverIP"]; |
121 | regionprofile.serverPort = (uint)reader["serverPort"]; | 122 | regionprofile.serverPort = (uint) reader["serverPort"]; |
122 | regionprofile.serverURI = (string)reader["serverURI"]; | 123 | regionprofile.serverURI = (string) reader["serverURI"]; |
123 | 124 | ||
124 | // Location | 125 | // Location |
125 | regionprofile.regionLocX = (uint)((int)reader["locX"]); | 126 | regionprofile.regionLocX = (uint) ((int) reader["locX"]); |
126 | regionprofile.regionLocY = (uint)((int)reader["locY"]); | 127 | regionprofile.regionLocY = (uint) ((int) reader["locY"]); |
127 | regionprofile.regionLocZ = (uint)((int)reader["locZ"]); | 128 | regionprofile.regionLocZ = (uint) ((int) reader["locZ"]); |
128 | 129 | ||
129 | // Neighbours - 0 = No Override | 130 | // Neighbours - 0 = No Override |
130 | regionprofile.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"]; | 131 | regionprofile.regionEastOverrideHandle = (ulong) reader["eastOverrideHandle"]; |
131 | regionprofile.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"]; | 132 | regionprofile.regionWestOverrideHandle = (ulong) reader["westOverrideHandle"]; |
132 | regionprofile.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"]; | 133 | regionprofile.regionSouthOverrideHandle = (ulong) reader["southOverrideHandle"]; |
133 | regionprofile.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"]; | 134 | regionprofile.regionNorthOverrideHandle = (ulong) reader["northOverrideHandle"]; |
134 | 135 | ||
135 | // Assets | 136 | // Assets |
136 | regionprofile.regionAssetURI = (string)reader["regionAssetURI"]; | 137 | regionprofile.regionAssetURI = (string) reader["regionAssetURI"]; |
137 | regionprofile.regionAssetRecvKey = (string)reader["regionAssetRecvKey"]; | 138 | regionprofile.regionAssetRecvKey = (string) reader["regionAssetRecvKey"]; |
138 | regionprofile.regionAssetSendKey = (string)reader["regionAssetSendKey"]; | 139 | regionprofile.regionAssetSendKey = (string) reader["regionAssetSendKey"]; |
139 | 140 | ||
140 | // Userserver | 141 | // Userserver |
141 | regionprofile.regionUserURI = (string)reader["regionUserURI"]; | 142 | regionprofile.regionUserURI = (string) reader["regionUserURI"]; |
142 | regionprofile.regionUserRecvKey = (string)reader["regionUserRecvKey"]; | 143 | regionprofile.regionUserRecvKey = (string) reader["regionUserRecvKey"]; |
143 | regionprofile.regionUserSendKey = (string)reader["regionUserSendKey"]; | 144 | regionprofile.regionUserSendKey = (string) reader["regionUserSendKey"]; |
144 | } | 145 | } |
145 | else | 146 | else |
146 | { | 147 | { |
@@ -156,12 +157,15 @@ namespace OpenSim.Framework.Data.MSSQL | |||
156 | /// <returns>Successful?</returns> | 157 | /// <returns>Successful?</returns> |
157 | public bool insertRow(RegionProfileData profile) | 158 | public bool insertRow(RegionProfileData profile) |
158 | { | 159 | { |
159 | string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; | 160 | string sql = |
160 | sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; | 161 | "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; |
162 | sql += | ||
163 | "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; | ||
161 | sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES "; | 164 | sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES "; |
162 | 165 | ||
163 | sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, "; | 166 | sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, "; |
164 | sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, "; | 167 | sql += |
168 | "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, "; | ||
165 | sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);"; | 169 | sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);"; |
166 | 170 | ||
167 | Dictionary<string, string> parameters = new Dictionary<string, string>(); | 171 | Dictionary<string, string> parameters = new Dictionary<string, string>(); |
@@ -208,4 +212,4 @@ namespace OpenSim.Framework.Data.MSSQL | |||
208 | return returnval; | 212 | return returnval; |
209 | } | 213 | } |
210 | } | 214 | } |
211 | } | 215 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs b/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs index eeac06c..6846ecf 100644 --- a/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs | |||
@@ -1,24 +1,28 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.InteropServices; | 2 | using System.Runtime.InteropServices; |
3 | |||
3 | // General Information about an assembly is controlled through the following | 4 | // General Information about an assembly is controlled through the following |
4 | // set of attributes. Change these attribute values to modify the information | 5 | // set of attributes. Change these attribute values to modify the information |
5 | // associated with an assembly. | 6 | // associated with an assembly. |
6 | [assembly: AssemblyTitle("OpenSim.Framework.Data.MSSQL")] | 7 | |
7 | [assembly: AssemblyDescription("")] | 8 | [assembly : AssemblyTitle("OpenSim.Framework.Data.MSSQL")] |
8 | [assembly: AssemblyConfiguration("")] | 9 | [assembly : AssemblyDescription("")] |
9 | [assembly: AssemblyCompany("")] | 10 | [assembly : AssemblyConfiguration("")] |
10 | [assembly: AssemblyProduct("OpenSim.Framework.Data.MSSQL")] | 11 | [assembly : AssemblyCompany("")] |
11 | [assembly: AssemblyCopyright("Copyright © 2007")] | 12 | [assembly : AssemblyProduct("OpenSim.Framework.Data.MSSQL")] |
12 | [assembly: AssemblyTrademark("")] | 13 | [assembly : AssemblyCopyright("Copyright © 2007")] |
13 | [assembly: AssemblyCulture("")] | 14 | [assembly : AssemblyTrademark("")] |
15 | [assembly : AssemblyCulture("")] | ||
14 | 16 | ||
15 | // Setting ComVisible to false makes the types in this assembly not visible | 17 | // Setting ComVisible to false makes the types in this assembly not visible |
16 | // to COM components. If you need to access a type in this assembly from | 18 | // to COM components. If you need to access a type in this assembly from |
17 | // COM, set the ComVisible attribute to true on that type. | 19 | // COM, set the ComVisible attribute to true on that type. |
18 | [assembly: ComVisible(false)] | 20 | |
21 | [assembly : ComVisible(false)] | ||
19 | 22 | ||
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
21 | [assembly: Guid("0e1c1ca4-2cf2-4315-b0e7-432c02feea8a")] | 24 | |
25 | [assembly : Guid("0e1c1ca4-2cf2-4315-b0e7-432c02feea8a")] | ||
22 | 26 | ||
23 | // Version information for an assembly consists of the following four values: | 27 | // Version information for an assembly consists of the following four values: |
24 | // | 28 | // |
@@ -29,5 +33,6 @@ using System.Runtime.InteropServices; | |||
29 | // | 33 | // |
30 | // You can specify all the values or you can default the Revision and Build Numbers | 34 | // You can specify all the values or you can default the Revision and Build Numbers |
31 | // by using the '*' as shown below: | 35 | // by using the '*' as shown below: |
32 | [assembly: AssemblyVersion("1.0.0.0")] | 36 | |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 37 | [assembly : AssemblyVersion("1.0.0.0")] |
38 | [assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file | ||