aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs (unfollow)
Commit message (Collapse)AuthorFilesLines
2011-10-22Get UUIDGatherer to scan notecards in the graph for asset uuids.Justin Clark-Casey (justincc)1-3/+4
This is to support npc baked texture saving in oars and iars. May address http://opensimulator.org/mantis/view.php?id=5743
2011-09-13In an object return message, send a null-terminated empty string in binary ↵Justin Clark-Casey (justincc)1-2/+40
bucket to prevent a viewer 3 crash. This is the message sent to the client when the object is returned. We were sending byte[0] in the binary bucket. This didn't kill viewer 1 but did terminate viewer 3 (don't know about viewer 2). So sending "\0" instead. This is to address http://opensimulator.org/mantis/view.php?id=5683
2011-08-31If a FireAndForget thread terminates with an exception, then catch and log ↵Justin Clark-Casey (justincc)1-1/+15
rather than letting it terminate the simulator. Exceptions don't appear to do this with the SmartThreadPool but they do with UnsafeQueueUserWorkItem (and maybe others)
2011-08-16Add new FireAndForgetMethod.None.Justin Clark-Casey (justincc)1-1/+10
This executes the callback on the same thread that made the request. Designed for use only by regression tests that rely on a predicable event ordering.
2011-07-29For all Util.FireAndForget invocations, set thread to en_US before ↵Justin Clark-Casey (justincc)1-5/+10
continuing wtih the invocation. This is to avoid bugs where the locale is not manually set on the thread and bad data values get sent to the database or over the wire. Lots of code does this manually but as we've seen, a subtle change can hit code which has forgotton to do this. Since en_US show be used throughout the server at present, setting it at FireAndForget seems reasonable. Arguably, it would be better to do this where data is sent, but doing it here is much easier. All the manual BeginInvokes() remaining in the code should probably call FireAndForget instead.
2011-07-08When loading library asset set, only store an asset if it's different from ↵Justin Clark-Casey (justincc)1-3/+13
an existing one with the same id. We compare existing and loaded asset by doing an SHA1 on both, so that a changed library asset will still update the store. This cuts asset library load time from 10 seconds to <1 sec. Note, a fix on the previous commit revealed a bug where a library script cannot be copied except on the first login after a cache clear. This is unrelated to this commit and needs to be fixed at some subsequent time.
2011-07-08Fix interpretation of physics mesh proxies from mesh dataJustin Clark-Casey (justincc)1-2/+17
As per http://wiki.secondlife.com/wiki/Mesh/Mesh_Asset_Format, some submesh blocks may just have the flag "NoGeometry" to signal that they provide no mesh data. If a block contains this, ignore it for meshing purposes rather than suffer a ClassCastException This fixes physics proxy meshing, so you can now walk through mesh doorways, properly stand on the trailer of mesh trucks, etc. To get mesh physics proxy, the UseMeshiesPhysicsMesh must be true in a [Mesh] config section in OpenSim.ini (example in OpenSimDefaults.ini). Convex hull physics not currently supported.
2011-05-22More on HG Friends. Added Delete(string, string) across the board. Added ↵Diva Canto1-2/+4
security to friendship identifiers so that they can safely be deleted across worlds. Had to change Get(string) to use LIKE because the secret in the identifier is not always known -- affects only HG visitors. BOTTOM LINE SO FAR: HG friendships established and deleted safely across grids, local rights working but not (yet?) being transmitted back.
2011-05-19HG Friends working to some extent: friendships offered and accepted ↵Diva Canto1-0/+61
correctly handled. Friends list showing correct foreign names. TODO: GrantRights.
2011-04-19Requeue unacknowledged entity updates rather than resend then "as is".Dan Lake1-0/+17
Often, by the time the UDPServer realizes that an entity update packet has not been acknowledged, there is a newer update for the same entity already queued up or there is a higher priority update that should be sent first. This patch eliminates 1:1 packet resends for unacked entity update packets. Insteawd, unacked update packets are decomposed into the original entity updates and those updates are placed back into the priority queues based on their new priority but the original update timestamp. This will generally place them at the head of the line to be put back on the wire as a new outgoing packet but prevents the resend queue from filling up with multiple stale updates for the same entity. This new approach takes advantage of the UDP nature of the Linden protocol in that the intent of a reliable update packet is that if it goes unacknowledge, SOMETHING has to happen to get the update to the client. We are simply making sure that we are resending current object state rather than stale object state. Additionally, this patch includes a generalized callback mechanism so that any caller can specify their own method to call when a packet expires without being acknowledged. We use this mechanism to requeue update packets and otherwise use the UDPServer default method of just putting expired packets in the resend queue.
2011-04-18Requeue unacknowledged entity updates rather than resend then "as is".Dan Lake1-0/+17
Often, by the time the UDPServer realizes that an entity update packet has not been acknowledged, there is a newer update for the same entity already queued up or there is a higher priority update that should be sent first. This patch eliminates 1:1 packet resends for unacked entity update packets. Insteawd, unacked update packets are decomposed into the original entity updates and those updates are placed back into the priority queues based on their new priority but the original update timestamp. This will generally place them at the head of the line to be put back on the wire as a new outgoing packet but prevents the resend queue from filling up with multiple stale updates for the same entity. This new approach takes advantage of the UDP nature of the Linden protocol in that the intent of a reliable update packet is that if it goes unacknowledge, SOMETHING has to happen to get the update to the client. We are simply making sure that we are resending current object state rather than stale object state. Additionally, this patch includes a generalized callback mechanism so that any caller can specify their own method to call when a packet expires without being acknowledged. We use this mechanism to requeue update packets and otherwise use the UDPServer default method of just putting expired packets in the resend queue.
2011-02-22Parameterizes the view distance used to compute and manageMic Bowman1-3/+10
child agents in neighbor regions. This means you can extend the view on a simulator beyond the default 3x3 regions. This uses a region default draw distance and should be replaced at some point by the avatar specified draw distance. That will require more careful, dynamic recomputation of child agents every time the draw distance changes. WARNING: this is experimental and has known instabilities. specifically all regions "within site" should be running the same default draw distance or agents will not be closed correctly.
2011-02-04Put something in the ImprovedInstantMessage.BinaryBucket for ↵Justin Clark-Casey (justincc)1-0/+10
llInstantMessage() to stop this crashing viewer 2.4.0 (1.23.5 was fine with this). We're putting in a string of format "<region name><x pos floor int><y pos floor int><z pos floor int> which appears to be the expected value. This resolves http://opensimulator.org/mantis/view.php?id=5356
2011-01-13Make FireAndForgetWrapper a singleton classBlueWall1-3/+24
Made FireAndForgetWrapper a singleton class to allow us to drop dependancy on the BclExtras35 library. BclExtras is broken in Mono 2.8.2 and we used the library in only one function.
2011-01-13Make FireAndForgetWrapper a singleton classBlueWall1-3/+24
Made FireAndForgetWrapper a singleton class to allow us to drop dependancy on the BclExtras35 library. BclExtras is broken in Mono 2.8.2 and we used the library in only one function.
2010-11-29Preservation of creator information now also working in IARs. Cleaned up ↵Diva Canto1-0/+20
usage help. Moved Osp around, deleted unnecessary OspInventoryWrapperPlugin, added manipulation of SOP's xml representation in a generic ExternalRepresentationUtils function.
2010-11-27Changed the parser for InventoryItem deserialization. Moved some utility ↵Diva Canto1-0/+61
functions around.
2010-11-17minor: add some method commentsJustin Clark-Casey (justincc)1-0/+8
2010-10-03Port ExecutingDirectory from omfOS Util class.Melanie1-0/+11
2010-09-04Make User Agent Service and Login Service separable.Diva Canto1-1/+17
2010-09-03Added XFF header processing. Untested, for lack of proxy.Diva Canto1-0/+28
2010-08-07Correct display of landmark about info. Also correct region maturity ratingMelanie Thielker1-1/+11
in LM info. Maturity is NOT the parcel's setting, that is only for the image and text. Parcel maturity is governed by region maturity.
2010-04-16Fix http://opensimulator.org/mantis/view.php?id=4657 where ↵Justin Clark-Casey (justincc)1-1/+1
OpenSim.Grid.UserServer.exe fails on startup if no previous config probably appears to occur because mono 2.4.2.3 (and possibly later) erroneously returns a value of 0 for BufferWidth and BufferHeight in some circumstances
2010-03-06Bug fix: store correct position information upon logout. Fixes mantis #4608Diva Canto1-0/+18
2010-02-18Change handling of the SYSTEMIP constant to be more sane.Melanie1-6/+12
This will now choose the first network interface IP address, or the loopback interface if no external interfaces are found. It will log the IP address used as [NETWORK]: Using x.x.x.x for SYSTEMIP.
2010-01-30Changed an error message to w warning message.Diva Canto1-1/+1
2009-12-31More progress on both the Simulation service and the Login service. Both ↵Diva Canto1-0/+27
still unfinished.
2009-12-13* Implements OSSL function: osGetSimulatorMemory - returns the current ↵Adam Frisby1-0/+20
amount of memory allocated to the simulator process (Moderate Threat Level). * Cleans redundant information out of the Simulator Version. Versions now look like: "OpenSimulator 0.6.9(dev) Unix/Mono" * [Minor] additional log info for MySQLInventoryData
2009-12-01* Fix Inconsistent line ending style in UtilTeravus Ovares (Dan Olivares)1-24/+24
2009-11-29* Patch from Misterblue to fix Environment.TickCount for statistics ↵Teravus Ovares (Dan Olivares)1-1/+25
purposes. Resolves the wrap-around of the 32 bit uint. * Teravus moved the Environment methods to the Util class
2009-10-27Experimental test to rate limit the incoming packet handler and try to ↵John Hurliman1-0/+21
always leave a worker thread available for other tasks
2009-10-23* Change the way Util.FireAndForget() calls SmartThreadPool to avoid using a ↵John Hurliman1-1/+11
delegate (which STP appears to hold on to). This removes the slow leak I was seeing when using async_call_method=SmartThreadPool and stabilizes allocated memory for an idle OpenSim instance
2009-10-22Terrible typo in the previous commit!John Hurliman1-1/+1
2009-10-22* Added a check if Util.m_ThreadPool is null before trying to use it, and if ↵John Hurliman1-13/+7
so initialize it to sane defaults * Simplified the InitThreadPool() function
2009-10-22* Allow SmartThreadPool to be initialized without setting max stack size ↵John Hurliman1-5/+7
(like the original implementation) * Only initialize Util's SmartThreadPool if it is actually being used * No longer initializing Util's SmartThreadPool with a custom max stack size. From MSDN: "Avoid using this constructor overload. The default stack size used by the Thread(ThreadStart) constructor overload is the recommended stack size for threads."
2009-10-21* Changed the misc. methods calling ThreadPool.UnsafeQueueUserWorkItem() to ↵John Hurliman1-19/+51
Util.FireAndForget() * Changed Util.FireAndForget() to use any of five different methods set with async_call_method in the [Startup] section of OpenSim.ini. Look at the example config for possible values
2009-10-22Reduce the default pool threads to 15 (from 30) and the minimum from 5 to 2Melanie1-1/+1
2009-10-22Add MaxPoolThreads in startup to limit the size of the thread pool usedMelanie1-12/+22
for FireAndForget. This lets us limit concurrency to make OpenSim play nice
2009-10-19* Change Util.FireAndForget to use ThreadPool.UnsafeQueueUserWorkItem(). ↵John Hurliman1-8/+10
This avoids .NET remoting and a managed->unmanaged->managed jump. Overall, a night and day performance difference * Initialize the LLClientView prim full update queue to the number of prims in the scene for a big performance boost * Reordered some comparisons on hot code paths for a minor speed boost * Removed an unnecessary call to the expensive DateTime.Now function (if you *have* to get the current time as opposed to Environment.TickCount, always use DateTime.UtcNow) * Don't fire the queue empty callback for the Resend category * Run the outgoing packet handler thread loop for each client synchronously. It seems like more time was being spent doing the execution asynchronously, and it made deadlocks very difficult to track down * Rewrote some expensive math in LandObject.cs * Optimized EntityManager to only lock on operations that need locking, and use TryGetValue() where possible * Only update the attachment database when an object is attached or detached * Other small misc. performance improvements
2009-10-16Converted FireAndForget methods to use a singleton pattern to attempt to ↵John Hurliman1-2/+21
work around a Mono bug with nested delegates
2009-10-06* Try/catch around EndInvoke() when Util.FireAndForget() returns to catch ↵John Hurliman1-1/+3
exceptions thrown in the async method * Added packet stats handling to the new LLUDP implementation * Attempting to avoid a race condition when creating a new LLUDPClient
2009-10-06* Continued work on the new LLUDP implementation. Appears to be functioning, ↵John Hurliman1-0/+36
although not everything is reimplemented yet * Replaced logic in ThreadTracker with a call to System.Diagnostics that does the same thing * Added Util.StringToBytes256() and Util.StringToBytes1024() to clamp output at byte[256] and byte[1024], respectively * Fixed formatting for a MySQLAssetData error logging line
2009-10-02* Creates Util.UTF8 and switches some references of Encoding.UTF8 to ↵John Hurliman1-5/+7
Util.UTF8 (not all references were switched since not all OpenSim libraries reference OpenSim.Framework) * Shrinks the largest in-memory object, the LLRAW.HeightmapLookupValue struct (only used for exporting to LLRAW terrain files), to the minimum possible size. This seems to have the odd side effect of cutting the size of the two double[256,256] terrain objects in half. Possibly an alignment optimization?
2009-10-01Formatting cleanup.Jeff Ames1-3/+3
2009-09-26Moved all HG1 operations to HGGridConnector.cs and ↵Diva Canto1-0/+26
HypergridServerConnector.cs/HypergridServiceConnector.cs, away from Region.Communications and HGNetworkServersInfo. Fixed small bugs with hyperlinked regions' map positions.
2009-09-24* Minor commit, added two new math utility functions.Adam Frisby1-0/+33
2009-09-03Added Util.FireAndForget(), to replace leaking calls to Delegate.BeginInvoke()John Hurliman1-0/+22
2009-08-07Remove debugging output frm ini file loading. Make it collect matchingMelanie1-10/+8
files only from last path component.
2009-08-07Add extensive debug output to Util.GlobMelanie1-0/+9
2009-08-07Remove GetFullPath call from config includes, because it barfs in WindozeMelanie1-3/+0