diff options
author | Adam Frisby | 2007-07-21 07:29:37 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-21 07:29:37 +0000 |
commit | 2c90c6102037e0b0332fd8fe2a48627dee80158a (patch) | |
tree | 87b557a68ba87e8bd34302705e3724556752a391 /OpenSim | |
parent | * Issue#209 - Terrain Hills Patch (Thanks Babblefrog) (diff) | |
download | opensim-SC_OLD-2c90c6102037e0b0332fd8fe2a48627dee80158a.zip opensim-SC_OLD-2c90c6102037e0b0332fd8fe2a48627dee80158a.tar.gz opensim-SC_OLD-2c90c6102037e0b0332fd8fe2a48627dee80158a.tar.bz2 opensim-SC_OLD-2c90c6102037e0b0332fd8fe2a48627dee80158a.tar.xz |
* Issue#206 - Casting of a LLUUID from XMLRPC hashtable causes an error. (Thanks Babblefrog)
* Issue#205 - MySQLManager User Creation support readded (Thanks Babblefrog + adjohn)
* Issue#204 - Clients now recieve terrain updates properly (Thanks Babblefrog) [May do some slight modifications on this to make it an event]
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLManager.cs | 85 | ||||
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLUserData.cs | 15 | ||||
-rw-r--r-- | OpenSim/Framework/UserManager/UserManagerBase.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 24 |
4 files changed, 124 insertions, 2 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs index a5434c8..affb8f3 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs | |||
@@ -536,6 +536,91 @@ namespace OpenSim.Framework.Data.MySQL | |||
536 | return returnval; | 536 | return returnval; |
537 | } | 537 | } |
538 | 538 | ||
539 | /// <summary> | ||
540 | /// Creates a new user and inserts it into the database | ||
541 | /// </summary> | ||
542 | /// <param name="uuid">User ID</param> | ||
543 | /// <param name="username">First part of the login</param> | ||
544 | /// <param name="lastname">Second part of the login</param> | ||
545 | /// <param name="passwordHash">A salted hash of the users password</param> | ||
546 | /// <param name="passwordSalt">The salt used for the password hash</param> | ||
547 | /// <param name="homeRegion">A regionHandle of the users home region</param> | ||
548 | /// <param name="homeLocX">Home region position vector</param> | ||
549 | /// <param name="homeLocY">Home region position vector</param> | ||
550 | /// <param name="homeLocZ">Home region position vector</param> | ||
551 | /// <param name="homeLookAtX">Home region 'look at' vector</param> | ||
552 | /// <param name="homeLookAtY">Home region 'look at' vector</param> | ||
553 | /// <param name="homeLookAtZ">Home region 'look at' vector</param> | ||
554 | /// <param name="created">Account created (unix timestamp)</param> | ||
555 | /// <param name="lastlogin">Last login (unix timestamp)</param> | ||
556 | /// <param name="inventoryURI">Users inventory URI</param> | ||
557 | /// <param name="assetURI">Users asset URI</param> | ||
558 | /// <param name="canDoMask">I can do mask</param> | ||
559 | /// <param name="wantDoMask">I want to do mask</param> | ||
560 | /// <param name="aboutText">Profile text</param> | ||
561 | /// <param name="firstText">Firstlife text</param> | ||
562 | /// <param name="profileImage">UUID for profile image</param> | ||
563 | /// <param name="firstImage">UUID for firstlife image</param> | ||
564 | /// <returns>Success?</returns> | ||
565 | public bool insertUserRow(libsecondlife.LLUUID uuid, string username, string lastname, string passwordHash, string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, | ||
566 | float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, string aboutText, string firstText, | ||
567 | libsecondlife.LLUUID profileImage, libsecondlife.LLUUID firstImage) | ||
568 | { | ||
569 | string sql = "INSERT INTO users (`UUID`, `username`, `lastname`, `passwordHash`, `passwordSalt`, `homeRegion`, "; | ||
570 | sql += "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, "; | ||
571 | sql += "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, "; | ||
572 | sql += "`profileFirstText`, `profileImage`, `profileFirstImage`) VALUES "; | ||
573 | |||
574 | sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passwordSalt, ?homeRegion, "; | ||
575 | sql += "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, "; | ||
576 | sql += "?lastLogin, ?userInventoryURI, ?userAssetURI, ?profileCanDoMask, ?profileWantDoMask, ?profileAboutText, "; | ||
577 | sql += "?profileFirstText, ?profileImage, ?profileFirstImage)"; | ||
578 | |||
579 | Dictionary<string, string> parameters = new Dictionary<string, string>(); | ||
580 | parameters["?UUID"] = uuid.ToStringHyphenated(); | ||
581 | parameters["?username"] = username.ToString(); | ||
582 | parameters["?lastname"] = lastname.ToString(); | ||
583 | parameters["?passwordHash"] = passwordHash.ToString(); | ||
584 | parameters["?passwordSalt"] = passwordSalt.ToString(); | ||
585 | parameters["?homeRegion"] = homeRegion.ToString(); | ||
586 | parameters["?homeLocationX"] = homeLocX.ToString(); | ||
587 | parameters["?homeLocationY"] = homeLocY.ToString(); | ||
588 | parameters["?homeLocationZ"] = homeLocZ.ToString(); | ||
589 | parameters["?homeLookAtX"] = homeLookAtX.ToString(); | ||
590 | parameters["?homeLookAtY"] = homeLookAtY.ToString(); | ||
591 | parameters["?homeLookAtZ"] = homeLookAtZ.ToString(); | ||
592 | parameters["?created"] = created.ToString(); | ||
593 | parameters["?lastLogin"] = lastlogin.ToString(); | ||
594 | parameters["?userInventoryURI"] = ""; | ||
595 | parameters["?userAssetURI"] = ""; | ||
596 | parameters["?profileCanDoMask"] = "0"; | ||
597 | parameters["?profileWantDoMask"] = "0"; | ||
598 | parameters["?profileAboutText"] = ""; | ||
599 | parameters["?profileFirstText"] = ""; | ||
600 | parameters["?profileImage"] = libsecondlife.LLUUID.Zero.ToStringHyphenated(); | ||
601 | parameters["?profileFirstImage"] = libsecondlife.LLUUID.Zero.ToStringHyphenated(); | ||
602 | |||
603 | bool returnval = false; | ||
604 | |||
605 | try | ||
606 | { | ||
607 | IDbCommand result = Query(sql, parameters); | ||
608 | |||
609 | if (result.ExecuteNonQuery() == 1) | ||
610 | returnval = true; | ||
611 | |||
612 | result.Dispose(); | ||
613 | } | ||
614 | catch (Exception e) | ||
615 | { | ||
616 | Console.WriteLine(e.ToString()); | ||
617 | return false; | ||
618 | } | ||
619 | |||
620 | return returnval; | ||
621 | } | ||
622 | |||
623 | |||
539 | /// <summary> | 624 | /// <summary> |
540 | /// Inserts a new region into the database | 625 | /// Inserts a new region into the database |
541 | /// </summary> | 626 | /// </summary> |
diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs index b044bdd..66ea465 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs | |||
@@ -199,6 +199,21 @@ namespace OpenSim.Framework.Data.MySQL | |||
199 | /// <param name="user">The user profile to create</param> | 199 | /// <param name="user">The user profile to create</param> |
200 | public void addNewUserProfile(UserProfileData user) | 200 | public void addNewUserProfile(UserProfileData user) |
201 | { | 201 | { |
202 | try | ||
203 | { | ||
204 | lock (database) | ||
205 | { | ||
206 | database.insertUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, user.homeRegion, user.homeLocation.X, user.homeLocation.Y, user.homeLocation.Z, | ||
207 | user.homeLookAt.X, user.homeLookAt.Y, user.homeLookAt.Z, user.created, user.lastLogin, user.userInventoryURI, user.userAssetURI, user.profileCanDoMask, user.profileWantDoMask, | ||
208 | user.profileAboutText, user.profileFirstText, user.profileImage, user.profileFirstImage); | ||
209 | } | ||
210 | } | ||
211 | catch (Exception e) | ||
212 | { | ||
213 | database.Reconnect(); | ||
214 | Console.WriteLine(e.ToString()); | ||
215 | } | ||
216 | |||
202 | } | 217 | } |
203 | 218 | ||
204 | /// <summary> | 219 | /// <summary> |
diff --git a/OpenSim/Framework/UserManager/UserManagerBase.cs b/OpenSim/Framework/UserManager/UserManagerBase.cs index c614300..a103f25 100644 --- a/OpenSim/Framework/UserManager/UserManagerBase.cs +++ b/OpenSim/Framework/UserManager/UserManagerBase.cs | |||
@@ -614,7 +614,7 @@ namespace OpenSim.Framework.UserManagement | |||
614 | System.Console.WriteLine("METHOD BY UUID CALLED"); | 614 | System.Console.WriteLine("METHOD BY UUID CALLED"); |
615 | if (requestData.Contains("avatar_uuid")) | 615 | if (requestData.Contains("avatar_uuid")) |
616 | { | 616 | { |
617 | userProfile = getUserProfile((LLUUID)requestData["avatar_uuid"]); | 617 | userProfile = getUserProfile((LLUUID)(string)requestData["avatar_uuid"]); |
618 | if (userProfile == null) | 618 | if (userProfile == null) |
619 | { | 619 | { |
620 | return CreateUnknownUserErrorResponse(); | 620 | return CreateUnknownUserErrorResponse(); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index a660d82..acd7f3f 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -235,6 +235,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
235 | storageCount = 0; | 235 | storageCount = 0; |
236 | } | 236 | } |
237 | 237 | ||
238 | if (Terrain.tainted > 0) | ||
239 | { | ||
240 | lock (m_syncRoot) | ||
241 | { | ||
242 | phyScene.SetTerrain(Terrain.getHeights1D()); | ||
243 | } | ||
244 | |||
245 | storageManager.DataStore.StoreTerrain(Terrain.getHeights2DD()); | ||
246 | |||
247 | ForEachScenePresence(delegate(ScenePresence presence) | ||
248 | { | ||
249 | SendLayerData(presence.ControllingClient); | ||
250 | }); | ||
251 | |||
252 | foreach (LLUUID UUID in Entities.Keys) | ||
253 | { | ||
254 | Entities[UUID].LandRenegerated(); | ||
255 | } | ||
256 | Terrain.tainted = 0; | ||
257 | } | ||
258 | |||
238 | landPrimCheckCount++; | 259 | landPrimCheckCount++; |
239 | if (landPrimCheckCount > 50) //check every 5 seconds for tainted prims | 260 | if (landPrimCheckCount > 50) //check every 5 seconds for tainted prims |
240 | { | 261 | { |
@@ -559,6 +580,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
559 | client.OnObjectName += PrimName; | 580 | client.OnObjectName += PrimName; |
560 | client.OnLinkObjects += LinkObjects; | 581 | client.OnLinkObjects += LinkObjects; |
561 | client.OnObjectDuplicate += DuplicateObject; | 582 | client.OnObjectDuplicate += DuplicateObject; |
583 | client.OnModifyTerrain += ModifyTerrain; | ||
562 | 584 | ||
563 | client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(m_LandManager.handleParcelPropertiesRequest); | 585 | client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(m_LandManager.handleParcelPropertiesRequest); |
564 | client.OnParcelDivideRequest += new ParcelDivideRequest(m_LandManager.handleParcelDivideRequest); | 586 | client.OnParcelDivideRequest += new ParcelDivideRequest(m_LandManager.handleParcelDivideRequest); |
@@ -969,4 +991,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
969 | } | 991 | } |
970 | #endregion | 992 | #endregion |
971 | } | 993 | } |
972 | } \ No newline at end of file | 994 | } |