diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Console/LocalConsole.cs | 63 | ||||
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/PrimitiveBaseShape.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/SLUtil.cs | 33 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 2 |
5 files changed, 90 insertions, 17 deletions
diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index be936b6..a3036d0 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.Framework.Console | |||
38 | { | 38 | { |
39 | /// <summary> | 39 | /// <summary> |
40 | /// A console that uses cursor control and color | 40 | /// A console that uses cursor control and color |
41 | /// </summary> | 41 | /// </summary> |
42 | public class LocalConsole : CommandConsole | 42 | public class LocalConsole : CommandConsole |
43 | { | 43 | { |
44 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -100,24 +100,40 @@ namespace OpenSim.Framework.Console | |||
100 | private int SetCursorTop(int top) | 100 | private int SetCursorTop(int top) |
101 | { | 101 | { |
102 | // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try | 102 | // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try |
103 | // to set a cursor row position with a currently invalid column, mono will throw an exception. | 103 | // to set a cursor row position with a currently invalid column, mono will throw an exception. |
104 | // Therefore, we need to make sure that the column position is valid first. | 104 | // Therefore, we need to make sure that the column position is valid first. |
105 | int left = System.Console.CursorLeft; | 105 | int left = System.Console.CursorLeft; |
106 | 106 | ||
107 | if (left < 0) | 107 | if (left < 0) |
108 | { | ||
108 | System.Console.CursorLeft = 0; | 109 | System.Console.CursorLeft = 0; |
109 | else if (left >= System.Console.BufferWidth) | 110 | } |
110 | System.Console.CursorLeft = System.Console.BufferWidth - 1; | 111 | else |
112 | { | ||
113 | int bw = System.Console.BufferWidth; | ||
114 | |||
115 | // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) | ||
116 | if (bw > 0 && left >= bw) | ||
117 | System.Console.CursorLeft = bw - 1; | ||
118 | } | ||
111 | 119 | ||
112 | if (top < 0) | 120 | if (top < 0) |
121 | { | ||
113 | top = 0; | 122 | top = 0; |
114 | if (top >= System.Console.BufferHeight) | 123 | } |
115 | top = System.Console.BufferHeight - 1; | 124 | else |
125 | { | ||
126 | int bh = System.Console.BufferHeight; | ||
127 | |||
128 | // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) | ||
129 | if (bh > 0 && top >= bh) | ||
130 | top = bh - 1; | ||
131 | } | ||
116 | 132 | ||
117 | System.Console.CursorTop = top; | 133 | System.Console.CursorTop = top; |
118 | 134 | ||
119 | return top; | 135 | return top; |
120 | } | 136 | } |
121 | 137 | ||
122 | /// <summary> | 138 | /// <summary> |
123 | /// Set the cursor column. | 139 | /// Set the cursor column. |
@@ -129,23 +145,38 @@ namespace OpenSim.Framework.Console | |||
129 | /// </param> | 145 | /// </param> |
130 | /// <returns> | 146 | /// <returns> |
131 | /// The new cursor column. | 147 | /// The new cursor column. |
132 | /// </returns> | 148 | /// </returns> |
133 | private int SetCursorLeft(int left) | 149 | private int SetCursorLeft(int left) |
134 | { | 150 | { |
135 | // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try | 151 | // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try |
136 | // to set a cursor column position with a currently invalid row, mono will throw an exception. | 152 | // to set a cursor column position with a currently invalid row, mono will throw an exception. |
137 | // Therefore, we need to make sure that the row position is valid first. | 153 | // Therefore, we need to make sure that the row position is valid first. |
138 | int top = System.Console.CursorTop; | 154 | int top = System.Console.CursorTop; |
139 | 155 | ||
140 | if (top < 0) | 156 | if (top < 0) |
157 | { | ||
141 | System.Console.CursorTop = 0; | 158 | System.Console.CursorTop = 0; |
142 | else if (top >= System.Console.BufferHeight) | 159 | } |
143 | System.Console.CursorTop = System.Console.BufferHeight - 1; | 160 | else |
161 | { | ||
162 | int bh = System.Console.BufferHeight; | ||
163 | // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) | ||
164 | if (bh > 0 && top >= bh) | ||
165 | System.Console.CursorTop = bh - 1; | ||
166 | } | ||
144 | 167 | ||
145 | if (left < 0) | 168 | if (left < 0) |
169 | { | ||
146 | left = 0; | 170 | left = 0; |
147 | if (left >= System.Console.BufferWidth) | 171 | } |
148 | left = System.Console.BufferWidth - 1; | 172 | else |
173 | { | ||
174 | int bw = System.Console.BufferWidth; | ||
175 | |||
176 | // On Mono 2.4.2.3 (and possibly above), the buffer value is sometimes erroneously zero (Mantis 4657) | ||
177 | if (bw > 0 && left >= bw) | ||
178 | left = bw - 1; | ||
179 | } | ||
149 | 180 | ||
150 | System.Console.CursorLeft = left; | 181 | System.Console.CursorLeft = left; |
151 | 182 | ||
@@ -183,7 +214,7 @@ namespace OpenSim.Framework.Console | |||
183 | System.Console.Write("{0}", prompt); | 214 | System.Console.Write("{0}", prompt); |
184 | 215 | ||
185 | SetCursorTop(new_y); | 216 | SetCursorTop(new_y); |
186 | SetCursorLeft(new_x); | 217 | SetCursorLeft(new_x); |
187 | } | 218 | } |
188 | } | 219 | } |
189 | 220 | ||
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 4577758..af88c4a 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -236,6 +236,10 @@ namespace OpenSim.Framework | |||
236 | IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, | 236 | IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, |
237 | sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate); | 237 | sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate); |
238 | 238 | ||
239 | public delegate void LinkInventoryItem( | ||
240 | IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, | ||
241 | sbyte invType, sbyte type, UUID olditemID); | ||
242 | |||
239 | public delegate void FetchInventoryDescendents( | 243 | public delegate void FetchInventoryDescendents( |
240 | IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder); | 244 | IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder); |
241 | 245 | ||
@@ -930,6 +934,7 @@ namespace OpenSim.Framework | |||
930 | event ObjectPermissions OnObjectPermissions; | 934 | event ObjectPermissions OnObjectPermissions; |
931 | 935 | ||
932 | event CreateNewInventoryItem OnCreateNewInventoryItem; | 936 | event CreateNewInventoryItem OnCreateNewInventoryItem; |
937 | event LinkInventoryItem OnLinkInventoryItem; | ||
933 | event CreateInventoryFolder OnCreateNewInventoryFolder; | 938 | event CreateInventoryFolder OnCreateNewInventoryFolder; |
934 | event UpdateInventoryFolder OnUpdateInventoryFolder; | 939 | event UpdateInventoryFolder OnUpdateInventoryFolder; |
935 | event MoveInventoryFolder OnMoveInventoryFolder; | 940 | event MoveInventoryFolder OnMoveInventoryFolder; |
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 9c2a4f9..1208b97 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs | |||
@@ -188,6 +188,10 @@ namespace OpenSim.Framework | |||
188 | m_textureEntry = DEFAULT_TEXTURE; | 188 | m_textureEntry = DEFAULT_TEXTURE; |
189 | } | 189 | } |
190 | 190 | ||
191 | /// <summary> | ||
192 | /// Construct a PrimitiveBaseShape object from a OpenMetaverse.Primitive object | ||
193 | /// </summary> | ||
194 | /// <param name="prim"></param> | ||
191 | public PrimitiveBaseShape(Primitive prim) | 195 | public PrimitiveBaseShape(Primitive prim) |
192 | { | 196 | { |
193 | PCode = (byte)prim.PrimData.PCode; | 197 | PCode = (byte)prim.PrimData.PCode; |
diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs index f6d6a7c..a489806 100644 --- a/OpenSim/Framework/SLUtil.cs +++ b/OpenSim/Framework/SLUtil.cs | |||
@@ -106,6 +106,39 @@ namespace OpenSim.Framework | |||
106 | } | 106 | } |
107 | } | 107 | } |
108 | 108 | ||
109 | public static string SLInvTypeToContentType(int invType) | ||
110 | { | ||
111 | switch ((InventoryType)invType) | ||
112 | { | ||
113 | case InventoryType.Animation: | ||
114 | return "application/vnd.ll.animation"; | ||
115 | case InventoryType.CallingCard: | ||
116 | return "application/vnd.ll.callingcard"; | ||
117 | case InventoryType.Folder: | ||
118 | return "application/vnd.ll.folder"; | ||
119 | case InventoryType.Gesture: | ||
120 | return "application/vnd.ll.gesture"; | ||
121 | case InventoryType.Landmark: | ||
122 | return "application/vnd.ll.landmark"; | ||
123 | case InventoryType.LSL: | ||
124 | return "application/vnd.ll.lsltext"; | ||
125 | case InventoryType.Notecard: | ||
126 | return "application/vnd.ll.notecard"; | ||
127 | case InventoryType.Attachment: | ||
128 | case InventoryType.Object: | ||
129 | return "application/vnd.ll.primitive"; | ||
130 | case InventoryType.Sound: | ||
131 | return "application/ogg"; | ||
132 | case InventoryType.Snapshot: | ||
133 | case InventoryType.Texture: | ||
134 | return "image/x-j2c"; | ||
135 | case InventoryType.Wearable: | ||
136 | return "application/vnd.ll.clothing"; | ||
137 | default: | ||
138 | return "application/octet-stream"; | ||
139 | } | ||
140 | } | ||
141 | |||
109 | public static sbyte ContentTypeToSLAssetType(string contentType) | 142 | public static sbyte ContentTypeToSLAssetType(string contentType) |
110 | { | 143 | { |
111 | switch (contentType) | 144 | switch (contentType) |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 8cb9127..c39fb6f 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1486,4 +1486,4 @@ namespace OpenSim.Framework | |||
1486 | } | 1486 | } |
1487 | 1487 | ||
1488 | } | 1488 | } |
1489 | } | 1489 | } \ No newline at end of file |