Merge branch '0.7.6-post-fixes' of ssh://opensimulator.org/var/git/opensim into 0.7.6-post-fixes

0.7.6-extended
Justin Clark-Casey (justincc) 2014-01-15 00:28:58 +00:00
commit 91d86301ef
5 changed files with 80 additions and 10 deletions

View File

@ -546,6 +546,10 @@ namespace OpenSim.Data.MySQL
reader.Read(); reader.Read();
notes.Notes = OSD.FromString((string)reader["notes"]); notes.Notes = OSD.FromString((string)reader["notes"]);
} }
else
{
notes.Notes = OSD.FromString("");
}
} }
} }
} }
@ -927,13 +931,18 @@ namespace OpenSim.Data.MySQL
} }
else else
{ {
dbcon.Close();
dbcon.Open();
query = "INSERT INTO usersettings VALUES ";
query += "(?uuid,'false','false', ?Email)";
using (MySqlCommand put = new MySqlCommand(query, dbcon)) using (MySqlCommand put = new MySqlCommand(query, dbcon))
{ {
query = "INSERT INTO usersettings VALUES ";
query += "(?Id,'false','false', '')";
lock(Lock) put.Parameters.AddWithValue("?Email", pref.EMail);
{ put.Parameters.AddWithValue("?uuid", pref.UserId.ToString());
put.ExecuteNonQuery(); put.ExecuteNonQuery();
} }
} }
@ -941,7 +950,6 @@ namespace OpenSim.Data.MySQL
} }
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
m_log.DebugFormat("[PROFILES_DATA]" + m_log.DebugFormat("[PROFILES_DATA]" +

View File

@ -810,11 +810,12 @@ namespace OpenSim.Data.SQLite
else else
{ {
query = "INSERT INTO usersettings VALUES "; query = "INSERT INTO usersettings VALUES ";
query += "(:Id,'false','false', '')"; query += "(:Id,'false','false', :Email)";
using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
{ {
put.Parameters.AddWithValue(":Id", pref.UserId.ToString()); put.Parameters.AddWithValue(":Id", pref.UserId.ToString());
put.Parameters.AddWithValue(":Email", pref.EMail);
put.ExecuteNonQuery(); put.ExecuteNonQuery();
} }

View File

@ -3631,7 +3631,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance);
// TODO: don't create new blocks if recycling an old packet // TODO: don't create new blocks if recycling an old packet
avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[visualParams.Length];
avp.ObjectData.TextureEntry = textureEntry; avp.ObjectData.TextureEntry = textureEntry;
AvatarAppearancePacket.VisualParamBlock avblock = null; AvatarAppearancePacket.VisualParamBlock avblock = null;

View File

@ -760,8 +760,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
IClientAPI remoteClient = (IClientAPI)sender; IClientAPI remoteClient = (IClientAPI)sender;
string serverURI = string.Empty; string serverURI = string.Empty;
GetUserProfileServerURI(remoteClient.AgentId, out serverURI); GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
note.TargetId = remoteClient.AgentId; note.UserId = remoteClient.AgentId;
UUID.TryParse(args[0], out note.UserId); UUID.TryParse(args[0], out note.TargetId);
object Note = (object)note; object Note = (object)note;
if(!JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString())) if(!JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString()))

View File

@ -37,6 +37,7 @@ using OpenSim.Data;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Services.UserAccountService;
namespace OpenSim.Services.ProfilesService namespace OpenSim.Services.ProfilesService
{ {
@ -166,11 +167,71 @@ namespace OpenSim.Services.ProfilesService
#region User Preferences #region User Preferences
public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result)
{ {
if(string.IsNullOrEmpty(pref.EMail))
{
UserAccount account = new UserAccount();
if(userAccounts is UserAccountService.UserAccountService)
{
try
{
account = userAccounts.GetUserAccount(UUID.Zero, pref.UserId);
if(string.IsNullOrEmpty(account.Email))
{
result = "No Email address on record!";
return false;
}
else
pref.EMail = account.Email;
}
catch
{
m_log.Info ("[PROFILES]: UserAccountService Exception: Could not get user account");
result = "Missing Email address!";
return false;
}
}
else
{
m_log.Info ("[PROFILES]: UserAccountService: Could not get user account");
result = "Missing Email address!";
return false;
}
}
return ProfilesData.UpdateUserPreferences(ref pref, ref result); return ProfilesData.UpdateUserPreferences(ref pref, ref result);
} }
public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) public bool UserPreferencesRequest(ref UserPreferences pref, ref string result)
{ {
if(string.IsNullOrEmpty(pref.EMail))
{
UserAccount account = new UserAccount();
if(userAccounts is UserAccountService.UserAccountService)
{
try
{
account = userAccounts.GetUserAccount(UUID.Zero, pref.UserId);
if(string.IsNullOrEmpty(account.Email))
{
result = "No Email address on record!";
return false;
}
else
pref.EMail = account.Email;
}
catch
{
m_log.Info ("[PROFILES]: UserAccountService Exception: Could not get user account");
result = "Missing Email address!";
return false;
}
}
else
{
m_log.Info ("[PROFILES]: UserAccountService: Could not get user account");
result = "Missing Email address!";
return false;
}
}
return ProfilesData.GetUserPreferences(ref pref, ref result); return ProfilesData.GetUserPreferences(ref pref, ref result);
} }
#endregion User Preferences #endregion User Preferences