mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -38,7 +38,7 @@ namespace OpenSim.Framework.Console
|
||||
{
|
||||
/// <summary>
|
||||
/// A console that uses cursor control and color
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
public class LocalConsole : CommandConsole
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -100,24 +100,40 @@ namespace OpenSim.Framework.Console
|
||||
private int SetCursorTop(int top)
|
||||
{
|
||||
// From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
|
||||
// to set a cursor row position with a currently invalid column, mono will throw an exception.
|
||||
// Therefore, we need to make sure that the column position is valid first.
|
||||
// to set a cursor row position with a currently invalid column, mono will throw an exception.
|
||||
// Therefore, we need to make sure that the column position is valid first.
|
||||
int left = System.Console.CursorLeft;
|
||||
|
||||
if (left < 0)
|
||||
{
|
||||
System.Console.CursorLeft = 0;
|
||||
else if (left >= System.Console.BufferWidth)
|
||||
System.Console.CursorLeft = System.Console.BufferWidth - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int bw = System.Console.BufferWidth;
|
||||
|
||||
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
|
||||
if (bw > 0 && left >= bw)
|
||||
System.Console.CursorLeft = bw - 1;
|
||||
}
|
||||
|
||||
if (top < 0)
|
||||
{
|
||||
top = 0;
|
||||
if (top >= System.Console.BufferHeight)
|
||||
top = System.Console.BufferHeight - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int bh = System.Console.BufferHeight;
|
||||
|
||||
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
|
||||
if (bh > 0 && top >= bh)
|
||||
top = bh - 1;
|
||||
}
|
||||
|
||||
System.Console.CursorTop = top;
|
||||
|
||||
return top;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the cursor column.
|
||||
@@ -129,23 +145,38 @@ namespace OpenSim.Framework.Console
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The new cursor column.
|
||||
/// </returns>
|
||||
/// </returns>
|
||||
private int SetCursorLeft(int left)
|
||||
{
|
||||
// From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
|
||||
// to set a cursor column position with a currently invalid row, mono will throw an exception.
|
||||
// Therefore, we need to make sure that the row position is valid first.
|
||||
// to set a cursor column position with a currently invalid row, mono will throw an exception.
|
||||
// Therefore, we need to make sure that the row position is valid first.
|
||||
int top = System.Console.CursorTop;
|
||||
|
||||
if (top < 0)
|
||||
{
|
||||
System.Console.CursorTop = 0;
|
||||
else if (top >= System.Console.BufferHeight)
|
||||
System.Console.CursorTop = System.Console.BufferHeight - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int bh = System.Console.BufferHeight;
|
||||
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
|
||||
if (bh > 0 && top >= bh)
|
||||
System.Console.CursorTop = bh - 1;
|
||||
}
|
||||
|
||||
if (left < 0)
|
||||
{
|
||||
left = 0;
|
||||
if (left >= System.Console.BufferWidth)
|
||||
left = System.Console.BufferWidth - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int bw = System.Console.BufferWidth;
|
||||
|
||||
// On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657)
|
||||
if (bw > 0 && left >= bw)
|
||||
left = bw - 1;
|
||||
}
|
||||
|
||||
System.Console.CursorLeft = left;
|
||||
|
||||
@@ -183,7 +214,7 @@ namespace OpenSim.Framework.Console
|
||||
System.Console.Write("{0}", prompt);
|
||||
|
||||
SetCursorTop(new_y);
|
||||
SetCursorLeft(new_x);
|
||||
SetCursorLeft(new_x);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -236,6 +236,10 @@ namespace OpenSim.Framework
|
||||
IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name,
|
||||
sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate);
|
||||
|
||||
public delegate void LinkInventoryItem(
|
||||
IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name,
|
||||
sbyte invType, sbyte type, UUID olditemID);
|
||||
|
||||
public delegate void FetchInventoryDescendents(
|
||||
IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
|
||||
|
||||
@@ -930,6 +934,7 @@ namespace OpenSim.Framework
|
||||
event ObjectPermissions OnObjectPermissions;
|
||||
|
||||
event CreateNewInventoryItem OnCreateNewInventoryItem;
|
||||
event LinkInventoryItem OnLinkInventoryItem;
|
||||
event CreateInventoryFolder OnCreateNewInventoryFolder;
|
||||
event UpdateInventoryFolder OnUpdateInventoryFolder;
|
||||
event MoveInventoryFolder OnMoveInventoryFolder;
|
||||
|
||||
@@ -188,6 +188,10 @@ namespace OpenSim.Framework
|
||||
m_textureEntry = DEFAULT_TEXTURE;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct a PrimitiveBaseShape object from a OpenMetaverse.Primitive object
|
||||
/// </summary>
|
||||
/// <param name="prim"></param>
|
||||
public PrimitiveBaseShape(Primitive prim)
|
||||
{
|
||||
PCode = (byte)prim.PrimData.PCode;
|
||||
|
||||
@@ -106,6 +106,39 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public static string SLInvTypeToContentType(int invType)
|
||||
{
|
||||
switch ((InventoryType)invType)
|
||||
{
|
||||
case InventoryType.Animation:
|
||||
return "application/vnd.ll.animation";
|
||||
case InventoryType.CallingCard:
|
||||
return "application/vnd.ll.callingcard";
|
||||
case InventoryType.Folder:
|
||||
return "application/vnd.ll.folder";
|
||||
case InventoryType.Gesture:
|
||||
return "application/vnd.ll.gesture";
|
||||
case InventoryType.Landmark:
|
||||
return "application/vnd.ll.landmark";
|
||||
case InventoryType.LSL:
|
||||
return "application/vnd.ll.lsltext";
|
||||
case InventoryType.Notecard:
|
||||
return "application/vnd.ll.notecard";
|
||||
case InventoryType.Attachment:
|
||||
case InventoryType.Object:
|
||||
return "application/vnd.ll.primitive";
|
||||
case InventoryType.Sound:
|
||||
return "application/ogg";
|
||||
case InventoryType.Snapshot:
|
||||
case InventoryType.Texture:
|
||||
return "image/x-j2c";
|
||||
case InventoryType.Wearable:
|
||||
return "application/vnd.ll.clothing";
|
||||
default:
|
||||
return "application/octet-stream";
|
||||
}
|
||||
}
|
||||
|
||||
public static sbyte ContentTypeToSLAssetType(string contentType)
|
||||
{
|
||||
switch (contentType)
|
||||
|
||||
@@ -1486,4 +1486,4 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user