Hello ragezone,
I see allot people has laggs / dreadlocks by an high amout of users online.
Ive edited the timedlock, maby its helpfull for someone.
Replace the whole TimedLock.cs with:
Code:using System; using System.Threading; using Uber; // # Edited by Breakz0ne. // // # DONT EDIT THIS! public struct TimedLock : IDisposable { public static TimedLock Lock(object o) { return Lock(o, TimeSpan.FromSeconds(10)); } public static TimedLock Lock(object o, TimeSpan timeout) { TimedLock tl = new TimedLock(o); if (!Monitor.TryEnter(o, timeout)) { #if DEBUG System.GC.SuppressFinalize(tl.leakDetector); #endif throw new LockTimeoutException(); } return tl; } private TimedLock(object o) { target = o; #if DEBUG leakDetector = new Sentinel(); #endif } private object target; public void Dispose() { Monitor.Exit(target); #if DEBUG GC.SuppressFinalize(leakDetector); #endif } #if DEBUG private class Sentinel { ~Sentinel() { System.Diagnostics.Debug.Fail("Undisposed lock"); } } private Sentinel leakDetector; #endif } public class LockTimeoutException : ApplicationException { public LockTimeoutException() : base("Timeout waiting for lock") { } }




you don't even need Timedlock to debug the locks, the reality is, you can't lock an object in one class, from another class.
