Post-rebase fixes

This commit is contained in:
lickx
2026-02-15 13:13:45 +01:00
parent ec3388dcce
commit 5d58ca3074
6 changed files with 58 additions and 89 deletions

View File

@@ -181,11 +181,9 @@ namespace OpenSim.Framework.Console
{
// mono seems to fail unless we do check both left and top ranges, even current
int left = System.Console.CursorLeft;
if (left < 0)
{
System.Console.CursorLeft = 0;
}
else if(left > 0)
if (left <= 0)
left = 0;
else
{
int bufferWidth = System.Console.BufferWidth;
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
@@ -194,17 +192,16 @@ namespace OpenSim.Framework.Console
}
if (top <= 0)
top = 0;
else
{
System.Console.CursorTop = 0;
return 0;
}
int bufferHeight = System.Console.BufferHeight;
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
if (bufferHeight > 0 && top >= bufferHeight)
top = bufferHeight - 1;
}
System.Console.CursorTop = top;
System.Console.SetCursorPosition(left, top);
return top;
}
@@ -222,9 +219,9 @@ namespace OpenSim.Framework.Console
private int SetCursorLeft(int left)
{
int top = System.Console.CursorTop;
if (top < 0)
System.Console.CursorTop = 0;
else if( top > 0)
if (top <= 0)
top = 0;
else
{
int bufferHeight = System.Console.BufferHeight;
if (bufferHeight > 0 && top >= bufferHeight)
@@ -232,16 +229,16 @@ namespace OpenSim.Framework.Console
}
if (left <= 0)
left = 0;
else
{
System.Console.CursorLeft = 0;
return 0;
}
int bufferWidth = System.Console.BufferWidth;
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
if (bufferWidth > 0 && left >= bufferWidth)
left = bufferWidth - 1;
System.Console.CursorLeft = left;
}
System.Console.SetCursorPosition(left, top);
return left;
}
@@ -267,7 +264,7 @@ namespace OpenSim.Framework.Console
System.Console.SetCursorPosition(left, top);
}
private int SetCursorTopZeroLeft(int top)
private int SetCursorZeroLeft(int top)
{
if (top <= 0)
{
@@ -279,26 +276,9 @@ namespace OpenSim.Framework.Console
if (bufferHeight > 0 && top >= bufferHeight)
{
top = bufferHeight - 1;
}
System.Console.SetCursorPosition(0, top);
}
else
System.Console.CursorLeft = 0;
return top;
}
private int SetCursorZeroLeft(int top)
{
System.Console.CursorLeft = 0;
if (top <= 0)
{
System.Console.CursorTop = 0;
return 0;
}
int bufferHeight = System.Console.BufferHeight;
if (bufferHeight > 0 && top >= bufferHeight)
top = bufferHeight - 1;
System.Console.CursorTop = top;
return top;
}
@@ -319,11 +299,11 @@ namespace OpenSim.Framework.Console
{
m_cursorYPosition--;
new_y--;
SetCursorTopZeroLeft(System.Console.BufferHeight - 1);
SetCursorZeroLeft(System.Console.BufferHeight - 1);
System.Console.WriteLine(" ");
}
m_cursorYPosition = SetCursorTopZeroLeft(m_cursorYPosition);
m_cursorYPosition = SetCursorZeroLeft(m_cursorYPosition);
if (m_echo)
System.Console.Write("{0}{1}", prompt, m_commandLine);
@@ -341,16 +321,13 @@ namespace OpenSim.Framework.Console
{
if (m_cursorYPosition != -1)
{
m_cursorYPosition = SetCursorTopZeroLeft(m_cursorYPosition);
m_cursorYPosition = SetCursorZeroLeft(m_cursorYPosition);
int count = m_commandLine.Length + prompt.Length;
if(count > 0)
System.Console.Write(new string(' ', count));
while (count-- > 0)
System.Console.Write(" ");
m_cursorYPosition = SetCursorTopZeroLeft(m_cursorYPosition);
m_cursorYPosition = SetCursorZeroLeft(m_cursorYPosition);
}
}
catch (Exception)
@@ -462,13 +439,15 @@ namespace OpenSim.Framework.Console
return;
}
m_cursorYPosition = SetCursorTopZeroLeft(m_cursorYPosition);
m_cursorYPosition = SetCursorZeroLeft(m_cursorYPosition);
int count = m_commandLine.Length + prompt.Length - text.Length;
WriteLocalText(text, level);
for (int i = 0; i < count; ++i)
System.Console.Write(" ");
if(count > 0)
System.Console.WriteLine(new string(' ', count));
else
System.Console.WriteLine();
m_cursorYPosition = System.Console.CursorTop;
Show();
}
@@ -505,9 +484,10 @@ namespace OpenSim.Framework.Console
lock (m_commandLine)
{
SetCursorLeft(0); // Needed for mono
System.Console.Write(" "); // Needed for mono
m_cursorYPosition = System.Console.CursorTop;
// mono is silly
if (m_cursorYPosition >= System.Console.BufferHeight)
m_cursorYPosition = System.Console.BufferHeight - 1;
m_commandLine.Clear();
}
@@ -552,7 +532,7 @@ namespace OpenSim.Framework.Console
m_commandLine.Remove(m_cursorXPosition-1, 1);
m_cursorXPosition--;
m_cursorYPosition = SetCursorTopZeroLeft(m_cursorYPosition);
m_cursorYPosition = SetCursorZeroLeft(m_cursorYPosition);
if (m_echo)
System.Console.Write("{0}{1} ", prompt, m_commandLine);

View File

@@ -70,6 +70,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if(client is not null)
{
m_log.DebugFormat("[HG STATUS NOTIFIER]: Notifying {0} friends in {1}", friendsOnline.Count, kvp.Key);
m_FriendsModule.CacheFriendsOnline(userID, friendsOnline, online);
if(online)
client?.SendAgentOnline(friendsOnline.ToArray());
else
@@ -97,7 +98,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
HGFriendsServicesConnector fConn = new(friendsServerURI);
List<UUID> friendsOnline = fConn.StatusNotification(new List<string> { friendID.ToString() }, userID, online);
if (friendsOnline.Count > 0)
{
IClientAPI client = m_FriendsModule.LocateClientObject(userID);

View File

@@ -758,32 +758,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
}
if (!newPosition.IsZero())
defso.RootPart.GroupPosition = newPosition;
if (!Scene.AddSceneObject(defso))
{
m_log.DebugFormat(
"[HG ENTITY TRANSFER MODULE]: Problem adding scene object {0} {1} into {2} ",
defso.Name, defso.UUID, Scene.Name);
return;
}
if (defso.IsAttachment)
{
ScenePresence sp = Scene.GetScenePresence(defso.OwnerID);
if (sp != null && !sp.IsChildAgent)
{
m_log.DebugFormat(
"[HG ENTITY TRANSFER MODULE]: Resuming scripts in attachment {0} for HG root agent {1}",
defso.Name, defso.OwnerID);
defso.RootPart.ParentGroup.CreateScriptInstances(
0, false, Scene.DefaultScriptEngine, GetStateSource(defso));
defso.aggregateScriptEvents();
defso.ResumeScripts();
}
}
base.HandleIncomingSceneObject(defso, newPosition);
defso = null;
aCircuit = null;

View File

@@ -858,7 +858,7 @@ namespace OpenSim.Region.CoreModules.World.Land
private bool IsRestrictedFromLand_inner(UUID avatar)
{
if ((LandData.Flags & (uint)ParcelFlags.UseAccessList) == 0)
if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) == 0)
{
bool adults = m_estateSettings.DoDenyMinors ||
(m_estateSettings.DenyMinors || ((LandData.Flags & (uint)ParcelFlags.DenyAgeUnverified) != 0));

View File

@@ -3100,7 +3100,21 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>null if no child part with that linknum or child part</returns>
public SceneObjectPart GetLinkNumPart(int linknum)
{
SceneObjectPart[] parts = m_parts.GetArray();
if (linknum < 2)
{
// unlike SL 0 or 1 will mean root
// one reason is that we do not consider siting avatars on root linknumber
return linknum < 0 ? null : RootPart;
}
Span<SceneObjectPart> parts = m_parts.GetArray().AsSpan();
if (linknum <= parts.Length)
{
SceneObjectPart sop = parts[linknum - 1];
if (sop.LinkNum == linknum)
return sop;
}
for (int i = 0; i < parts.Length; i++)
{
if (parts[i].LinkNum == linknum)

View File

@@ -3089,8 +3089,8 @@ namespace OpenSim.Region.Framework.Scenes
if(IsNPC)
{
if (!Flying)
shouldfly = noFly ? false : (pos.Z > AbsolutePosition.Z + (Appearance.AvatarHeight*2));
LandAtTarget = landAtTarget & shouldfly;
shouldfly = !noFly && (pos.Z > AbsolutePosition.Z + (Appearance.AvatarHeight*2));
LandAtTarget = landAtTarget && shouldfly;
}
else
{