Change UserProfiles so that the parcel name is used for a ProfilePick and not the parcel owners name. This change also fixes a bug where if the avatar enters and does not move, creating or editing a ProfilePick would set the parcelId as an empty UUID. This is because ScenePresence.currentParcelUUID is not set until the avatar moves.
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>inv-download
parent
bdb91d0e70
commit
1e444b1449
|
@ -402,7 +402,7 @@ namespace OpenSim.Data.MySQL
|
|||
bool.TryParse((string)reader["enabled"], out pick.Enabled);
|
||||
pick.Name = (string)reader["name"];
|
||||
pick.Desc = description;
|
||||
pick.User = (string)reader["user"];
|
||||
pick.ParcelName = (string)reader["user"];
|
||||
pick.OriginalName = (string)reader["originalname"];
|
||||
pick.SimName = (string)reader["simname"];
|
||||
pick.SortOrder = (int)reader["sortorder"];
|
||||
|
@ -443,6 +443,8 @@ namespace OpenSim.Data.MySQL
|
|||
query += "parceluuid=?ParcelId,";
|
||||
query += "name=?Name,";
|
||||
query += "description=?Desc,";
|
||||
query += "user=?User,";
|
||||
query += "simname=?SimName,";
|
||||
query += "snapshotuuid=?SnapshotId,";
|
||||
query += "pickuuid=?PickId,";
|
||||
query += "posglobal=?GlobalPos,";
|
||||
|
@ -462,7 +464,7 @@ namespace OpenSim.Data.MySQL
|
|||
cmd.Parameters.AddWithValue("?Name", pick.Name.ToString());
|
||||
cmd.Parameters.AddWithValue("?Desc", pick.Desc.ToString());
|
||||
cmd.Parameters.AddWithValue("?SnapshotId", pick.SnapshotId.ToString());
|
||||
cmd.Parameters.AddWithValue("?User", pick.User.ToString());
|
||||
cmd.Parameters.AddWithValue("?User", pick.ParcelName.ToString());
|
||||
cmd.Parameters.AddWithValue("?Original", pick.OriginalName.ToString());
|
||||
cmd.Parameters.AddWithValue("?SimName",pick.SimName.ToString());
|
||||
cmd.Parameters.AddWithValue("?GlobalPos", pick.GlobalPos);
|
||||
|
|
|
@ -385,7 +385,7 @@ namespace OpenSim.Data.PGSQL
|
|||
pick.Enabled = Convert.ToBoolean(reader["enabled"]);
|
||||
pick.Name = reader["name"].ToString ();
|
||||
pick.Desc = reader["description"].ToString();
|
||||
pick.User = reader["user"].ToString();
|
||||
pick.ParcelName = reader["user"].ToString();
|
||||
pick.OriginalName = reader["originalname"].ToString();
|
||||
pick.SimName = reader["simname"].ToString();
|
||||
pick.SortOrder = (int)reader["sortorder"];
|
||||
|
@ -437,7 +437,7 @@ namespace OpenSim.Data.PGSQL
|
|||
cmd.Parameters.Add(m_database.CreateParameter("Name", pick.Name));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("Desc", pick.Desc));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("SnapshotId", pick.SnapshotId));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("User", pick.User));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("User", pick.ParcelName));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("Original", pick.OriginalName));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("SimName",pick.SimName));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("GlobalPos", pick.GlobalPos));
|
||||
|
|
|
@ -368,7 +368,7 @@ namespace OpenSim.Data.SQLite
|
|||
bool.TryParse((string)reader["enabled"].ToString(), out pick.Enabled);
|
||||
pick.Name = (string)reader["name"];
|
||||
pick.Desc = description;
|
||||
pick.User = (string)reader["user"];
|
||||
pick.ParcelName = (string)reader["user"];
|
||||
pick.OriginalName = (string)reader["originalname"];
|
||||
pick.SimName = (string)reader["simname"];
|
||||
pick.SortOrder = (int)reader["sortorder"];
|
||||
|
@ -434,7 +434,7 @@ namespace OpenSim.Data.SQLite
|
|||
cmd.Parameters.AddWithValue(":Name", pick.Name.ToString());
|
||||
cmd.Parameters.AddWithValue(":Desc", pick.Desc.ToString());
|
||||
cmd.Parameters.AddWithValue(":SnapshotId", pick.SnapshotId.ToString());
|
||||
cmd.Parameters.AddWithValue(":User", pick.User.ToString());
|
||||
cmd.Parameters.AddWithValue(":User", pick.ParcelName.ToString());
|
||||
cmd.Parameters.AddWithValue(":Original", pick.OriginalName.ToString());
|
||||
cmd.Parameters.AddWithValue(":SimName",pick.SimName.ToString());
|
||||
cmd.Parameters.AddWithValue(":GlobalPos", pick.GlobalPos);
|
||||
|
|
|
@ -77,7 +77,7 @@ namespace OpenSim.Framework
|
|||
public string Desc = string.Empty;
|
||||
public UUID ParcelId = UUID.Zero;
|
||||
public UUID SnapshotId = UUID.Zero;
|
||||
public string User = string.Empty;
|
||||
public string ParcelName = string.Empty;
|
||||
public string SimName = string.Empty;
|
||||
public string GlobalPos = "<0,0,0>";
|
||||
public string Gatekeeper = string.Empty;
|
||||
|
|
|
@ -671,7 +671,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||
|
||||
// Pull the rabbit out of the hat
|
||||
remoteClient.SendPickInfoReply(pick.PickId,pick.CreatorId,pick.TopPick,pick.ParcelId,pick.Name,
|
||||
pick.Desc,pick.SnapshotId,pick.User,pick.OriginalName,pick.SimName,
|
||||
pick.Desc,pick.SnapshotId,pick.ParcelName,pick.OriginalName,pick.SimName,
|
||||
globalPos,pick.SortOrder,pick.Enabled);
|
||||
}
|
||||
|
||||
|
@ -721,24 +721,16 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||
remoteClient.Scene.RegionInfo.WorldLocY + avaPos.Y,
|
||||
avaPos.Z);
|
||||
|
||||
string landOwnerName = string.Empty;
|
||||
string landParcelName = "My Parcel";
|
||||
UUID landParcelID = p.currentParcelUUID;
|
||||
|
||||
ILandObject land = p.Scene.LandChannel.GetLandObject(avaPos.X, avaPos.Y);
|
||||
|
||||
if (land != null)
|
||||
{
|
||||
if (land.LandData.IsGroupOwned)
|
||||
{
|
||||
IGroupsModule groupMod = p.Scene.RequestModuleInterface<IGroupsModule>();
|
||||
UUID groupId = land.LandData.GroupID;
|
||||
GroupRecord groupRecord = groupMod.GetGroupRecord(groupId);
|
||||
landOwnerName = groupRecord.GroupName;
|
||||
}
|
||||
else
|
||||
{
|
||||
IUserAccountService accounts = p.Scene.RequestModuleInterface<IUserAccountService>();
|
||||
UserAccount user = accounts.GetUserAccount(p.Scene.RegionInfo.ScopeID, land.LandData.OwnerID);
|
||||
landOwnerName = user.Name;
|
||||
}
|
||||
// If land found, use parcel uuid from here because the value from SP will be blank if the avatar hasnt moved
|
||||
landParcelName = land.LandData.Name;
|
||||
landParcelID = land.LandData.GlobalID;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -753,9 +745,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
|||
pick.TopPick = topPick;
|
||||
pick.Name = name;
|
||||
pick.Desc = desc;
|
||||
pick.ParcelId = p.currentParcelUUID;
|
||||
pick.ParcelId = landParcelID;
|
||||
pick.SnapshotId = snapshotID;
|
||||
pick.User = landOwnerName;
|
||||
pick.ParcelName = landParcelName;
|
||||
pick.SimName = remoteClient.Scene.RegionInfo.RegionName;
|
||||
pick.Gatekeeper = MyGatekeeper;
|
||||
pick.GlobalPos = posGlobal.ToString();
|
||||
|
|
Loading…
Reference in New Issue