* 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]
afrisby
Adam Frisby 2007-07-21 07:29:37 +00:00
parent 32aacd4f36
commit 2c90c61020
4 changed files with 124 additions and 2 deletions

View File

@ -536,6 +536,91 @@ namespace OpenSim.Framework.Data.MySQL
return returnval;
}
/// <summary>
/// Creates a new user and inserts it into the database
/// </summary>
/// <param name="uuid">User ID</param>
/// <param name="username">First part of the login</param>
/// <param name="lastname">Second part of the login</param>
/// <param name="passwordHash">A salted hash of the users password</param>
/// <param name="passwordSalt">The salt used for the password hash</param>
/// <param name="homeRegion">A regionHandle of the users home region</param>
/// <param name="homeLocX">Home region position vector</param>
/// <param name="homeLocY">Home region position vector</param>
/// <param name="homeLocZ">Home region position vector</param>
/// <param name="homeLookAtX">Home region 'look at' vector</param>
/// <param name="homeLookAtY">Home region 'look at' vector</param>
/// <param name="homeLookAtZ">Home region 'look at' vector</param>
/// <param name="created">Account created (unix timestamp)</param>
/// <param name="lastlogin">Last login (unix timestamp)</param>
/// <param name="inventoryURI">Users inventory URI</param>
/// <param name="assetURI">Users asset URI</param>
/// <param name="canDoMask">I can do mask</param>
/// <param name="wantDoMask">I want to do mask</param>
/// <param name="aboutText">Profile text</param>
/// <param name="firstText">Firstlife text</param>
/// <param name="profileImage">UUID for profile image</param>
/// <param name="firstImage">UUID for firstlife image</param>
/// <returns>Success?</returns>
public bool insertUserRow(libsecondlife.LLUUID uuid, string username, string lastname, string passwordHash, string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ,
float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, string aboutText, string firstText,
libsecondlife.LLUUID profileImage, libsecondlife.LLUUID firstImage)
{
string sql = "INSERT INTO users (`UUID`, `username`, `lastname`, `passwordHash`, `passwordSalt`, `homeRegion`, ";
sql += "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, ";
sql += "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, ";
sql += "`profileFirstText`, `profileImage`, `profileFirstImage`) VALUES ";
sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passwordSalt, ?homeRegion, ";
sql += "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, ";
sql += "?lastLogin, ?userInventoryURI, ?userAssetURI, ?profileCanDoMask, ?profileWantDoMask, ?profileAboutText, ";
sql += "?profileFirstText, ?profileImage, ?profileFirstImage)";
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["?UUID"] = uuid.ToStringHyphenated();
parameters["?username"] = username.ToString();
parameters["?lastname"] = lastname.ToString();
parameters["?passwordHash"] = passwordHash.ToString();
parameters["?passwordSalt"] = passwordSalt.ToString();
parameters["?homeRegion"] = homeRegion.ToString();
parameters["?homeLocationX"] = homeLocX.ToString();
parameters["?homeLocationY"] = homeLocY.ToString();
parameters["?homeLocationZ"] = homeLocZ.ToString();
parameters["?homeLookAtX"] = homeLookAtX.ToString();
parameters["?homeLookAtY"] = homeLookAtY.ToString();
parameters["?homeLookAtZ"] = homeLookAtZ.ToString();
parameters["?created"] = created.ToString();
parameters["?lastLogin"] = lastlogin.ToString();
parameters["?userInventoryURI"] = "";
parameters["?userAssetURI"] = "";
parameters["?profileCanDoMask"] = "0";
parameters["?profileWantDoMask"] = "0";
parameters["?profileAboutText"] = "";
parameters["?profileFirstText"] = "";
parameters["?profileImage"] = libsecondlife.LLUUID.Zero.ToStringHyphenated();
parameters["?profileFirstImage"] = libsecondlife.LLUUID.Zero.ToStringHyphenated();
bool returnval = false;
try
{
IDbCommand result = Query(sql, parameters);
if (result.ExecuteNonQuery() == 1)
returnval = true;
result.Dispose();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return false;
}
return returnval;
}
/// <summary>
/// Inserts a new region into the database
/// </summary>

View File

@ -199,6 +199,21 @@ namespace OpenSim.Framework.Data.MySQL
/// <param name="user">The user profile to create</param>
public void addNewUserProfile(UserProfileData user)
{
try
{
lock (database)
{
database.insertUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, user.homeRegion, user.homeLocation.X, user.homeLocation.Y, user.homeLocation.Z,
user.homeLookAt.X, user.homeLookAt.Y, user.homeLookAt.Z, user.created, user.lastLogin, user.userInventoryURI, user.userAssetURI, user.profileCanDoMask, user.profileWantDoMask,
user.profileAboutText, user.profileFirstText, user.profileImage, user.profileFirstImage);
}
}
catch (Exception e)
{
database.Reconnect();
Console.WriteLine(e.ToString());
}
}
/// <summary>

View File

@ -614,7 +614,7 @@ namespace OpenSim.Framework.UserManagement
System.Console.WriteLine("METHOD BY UUID CALLED");
if (requestData.Contains("avatar_uuid"))
{
userProfile = getUserProfile((LLUUID)requestData["avatar_uuid"]);
userProfile = getUserProfile((LLUUID)(string)requestData["avatar_uuid"]);
if (userProfile == null)
{
return CreateUnknownUserErrorResponse();

View File

@ -235,6 +235,27 @@ namespace OpenSim.Region.Environment.Scenes
storageCount = 0;
}
if (Terrain.tainted > 0)
{
lock (m_syncRoot)
{
phyScene.SetTerrain(Terrain.getHeights1D());
}
storageManager.DataStore.StoreTerrain(Terrain.getHeights2DD());
ForEachScenePresence(delegate(ScenePresence presence)
{
SendLayerData(presence.ControllingClient);
});
foreach (LLUUID UUID in Entities.Keys)
{
Entities[UUID].LandRenegerated();
}
Terrain.tainted = 0;
}
landPrimCheckCount++;
if (landPrimCheckCount > 50) //check every 5 seconds for tainted prims
{
@ -559,6 +580,7 @@ namespace OpenSim.Region.Environment.Scenes
client.OnObjectName += PrimName;
client.OnLinkObjects += LinkObjects;
client.OnObjectDuplicate += DuplicateObject;
client.OnModifyTerrain += ModifyTerrain;
client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(m_LandManager.handleParcelPropertiesRequest);
client.OnParcelDivideRequest += new ParcelDivideRequest(m_LandManager.handleParcelDivideRequest);