public List <BasePacket> CreatePacket(byte[] buffer) { object @lock = _lock; ObjectFlowControl.CheckForSyncLockOnValueType(@lock); bool lockTaken = false; try { Monitor.Enter(@lock, ref lockTaken); read.Position = read.Length; read.Write(buffer, 0, buffer.Length); List <BasePacket> packets = new List <BasePacket>(); while (ReadPacket(ref packets)) { } return(packets); } finally { if (lockTaken) { Monitor.Exit(@lock); } } }
// Token: 0x06000190 RID: 400 RVA: 0x000093F4 File Offset: 0x000075F4 private void method_55() { if (this.int_6 == this.byte_1.Length) { this.int_6 = 0; object obj = this.object_0; ObjectFlowControl.CheckForSyncLockOnValueType(obj); lock (obj) { this.byte_1 = this.queue_0.Dequeue(); } } int num; if (this.bool_0 && this.int_6 == 0) { num = 4; Buffer.BlockCopy(BitConverter.GetBytes(this.byte_1.Length), 0, this.byte_3, this.socketAsyncEventArgs_1.Offset, 4); } int num2 = Math.Min(this.byte_1.Length - this.int_6, this.int_0 - num); Buffer.BlockCopy(this.byte_1, this.int_6, this.byte_3, this.socketAsyncEventArgs_1.Offset + num, num2); this.socketAsyncEventArgs_1.SetBuffer(this.socketAsyncEventArgs_1.Offset, num2 + num); if (!this.socket_0.SendAsync(this.socketAsyncEventArgs_1)) { this.method_52(this.socket_0, this.socketAsyncEventArgs_1); } }
public void DisposeSplashScreen() { object splashLock = new object(); ObjectFlowControl.CheckForSyncLockOnValueType(splashLock); lock (splashLock) { if (this.m_SplashScreen.IsActivating) { this.mainformSync?.Send(new SendOrPostCallback(delegate { if (this.MainForm != null) { new UIPermission(UIPermissionWindow.AllWindows).Assert(); this.MainForm.Activate(); PermissionSet.RevertAssert(); } }), null); } if ((this.m_SplashScreen != null) && !this.m_SplashScreen.IsDisposed) { this.m_SplashScreen.Dispose(); } } }
protected void HideSplashScreen() { var Expression = m_SplashLock; ObjectFlowControl.CheckForSyncLockOnValueType(Expression); var lockTaken = false; try { Monitor.Enter(Expression, ref lockTaken); if (MainForm != null) { new UIPermission(UIPermissionWindow.AllWindows).Assert(); MainForm.Activate(); PermissionSet.RevertAssert(); } if (m_SplashScreen == null || m_SplashScreen.IsDisposed) { return; } m_SplashScreen.Invoke(new DisposeDelegate(((Component)m_SplashScreen).Dispose)); m_SplashScreen = null; } finally { if (lockTaken) { Monitor.Exit(Expression); } } }
// Token: 0x0600018F RID: 399 RVA: 0x0000935C File Offset: 0x0000755C public void method_54(byte[] byte_4) { if (!this.bool_2) { return; } try { object obj = this.object_0; ObjectFlowControl.CheckForSyncLockOnValueType(obj); lock (obj) { this.queue_0.Enqueue(byte_4); if (!this.bool_7) { this.bool_7 = true; this.method_55(); } } } catch (Exception exception_) { Client.GDelegate9 gdelegate = this.gdelegate9_0; if (gdelegate != null) { gdelegate(this, exception_); } this.method_56(); } }
public static string Environ(int Expression) { if ((Expression <= 0) || (Expression > 0xff)) { throw new ArgumentException(Utils.GetResourceString("Argument_Range1toFF1", new string[] { "Expression" })); } if (m_SortedEnvList == null) { object environSyncObject = m_EnvironSyncObject; ObjectFlowControl.CheckForSyncLockOnValueType(environSyncObject); lock (environSyncObject) { if (m_SortedEnvList == null) { new EnvironmentPermission(PermissionState.Unrestricted).Assert(); m_SortedEnvList = new SortedList(Environment.GetEnvironmentVariables()); PermissionSet.RevertAssert(); } } } if (Expression > m_SortedEnvList.Count) { return(""); } string pathList = m_SortedEnvList.GetKey(Expression - 1).ToString(); string str3 = m_SortedEnvList.GetByIndex(Expression - 1).ToString(); new EnvironmentPermission(EnvironmentPermissionAccess.Read, pathList).Demand(); return(pathList + "=" + str3); }
// Token: 0x06000434 RID: 1076 RVA: 0x001D5EF8 File Offset: 0x001D42F8 public GClass3(string string_3, int int_26) { this.fileStream_0 = null; this.gclass5_0 = null; this.object_0 = RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(new object()))); this.byte_0 = Convert.ToByte(GClass5.int_0); this.int_3 = 0; try { object objectValue = RuntimeHelpers.GetObjectValue(this.object_0); ObjectFlowControl.CheckForSyncLockOnValueType(RuntimeHelpers.GetObjectValue(objectValue)); object obj = objectValue; ObjectFlowControl.CheckForSyncLockOnValueType(obj); lock (obj) { this.fileStream_0 = new FileStream(string_3, FileMode.Open, FileAccess.Read); } this.int_2 = int_26; this.method_0(); } catch (SystemException ex) { Console.Write("cannot open file " + string_3 + "\n"); } }
// Token: 0x06000085 RID: 133 RVA: 0x0000999C File Offset: 0x00007B9C private static void RedirectStandardError(object stupid) { try { int firstCharRead; while (CMD._prc != null && !CMD._prc.HasExited && CMD.CSharpImpl.__Assign <int>(ref firstCharRead, CMD._prc.StandardError.Read()) > -1) { CMD.ReadStream(firstCharRead, CMD._prc.StandardError, true); } object readLock = CMD._readLock; ObjectFlowControl.CheckForSyncLockOnValueType(readLock); lock (readLock) { if (CMD._read) { CMD._read = false; throw new ApplicationException("session unexpectedly closed"); } } } catch (ObjectDisposedException ex) { } catch (Exception ex2) { if (!(ex2 is ApplicationException)) { InvalidOperationException ex3 = ex2 as InvalidOperationException; } } }
public virtual bool Run(bool threaded) { AsyncOperation asyncOp = AsyncOperationManager.CreateOperation(this.taskIdentifier); this._waitEvent = new AutoResetEvent(false); object syncRoot = this.userStateToLifetime.SyncRoot; ObjectFlowControl.CheckForSyncLockOnValueType(syncRoot); lock (syncRoot) { if (this.userStateToLifetime.Contains(this.taskIdentifier)) { Interaction.MsgBox("There is an operation still pending.\r\n\r\nPlease disconnect then reconnect your phone and then try again.", MsgBoxStyle.Exclamation, null); return(false); } this.userStateToLifetime[this.taskIdentifier] = asyncOp; } if (threaded) { new WorkerEventHandler(this.ProcessCommandQueue).BeginInvoke(asyncOp, null, null); } else { this.ProcessCommandQueue(asyncOp); } return(true); }
internal void Flush() { object syncObject = this.m_SyncObject; ObjectFlowControl.CheckForSyncLockOnValueType(syncObject); lock (syncObject) { this.m_Stream.Flush(); } }
internal void WriteLine(string message) { object syncObject = this.m_SyncObject; ObjectFlowControl.CheckForSyncLockOnValueType(syncObject); lock (syncObject) { this.m_Stream.WriteLine(message); } }
internal void AddReference() { object syncObject = this.m_SyncObject; ObjectFlowControl.CheckForSyncLockOnValueType(syncObject); lock (syncObject) { this.m_ReferenceCount++; } }
public void CancelAsync() { if (RuntimeHelpers.GetObjectValue(this.userStateToLifetime[this.taskIdentifier]) != null) { object syncRoot = this.userStateToLifetime.SyncRoot; ObjectFlowControl.CheckForSyncLockOnValueType(syncRoot); lock (syncRoot) { this.userStateToLifetime.Remove(this.taskIdentifier); } } }
internal void RecreateParser() { var mySyncRoot = this.mySyncRoot; ObjectFlowControl.CheckForSyncLockOnValueType(mySyncRoot); lock (mySyncRoot) { var analyzer = new FleeExpressionAnalyzer(); var parser = new ExpressionParser(TextReader.Null, analyzer, this); this.myProperties.SetValue("ExpressionParser", parser); } }
public string method_17(long long_0) { int num = 0; byte[] array = new byte[GClass3.int_13 - 1 + 1 - 1 + 1]; char[] array2 = new char[GClass3.int_13 - 1 + 1 - 1 + 1]; string result; try { int num2 = this.method_19(long_0); bool flag = num2 == this.int_0[0]; if (flag) { return(null); } int num3 = num2 + (2 * this.int_1 - 1) * this.int_0[0]; flag = ((this.int_2 & GClass3.int_21) == 1); if (flag) { Array.Copy(this.byte_1, num3, array, 0, Math.Min(this.byte_1.Length - num3, GClass3.int_13)); } else { object objectValue = RuntimeHelpers.GetObjectValue(this.object_0); ObjectFlowControl.CheckForSyncLockOnValueType(RuntimeHelpers.GetObjectValue(objectValue)); object obj = objectValue; ObjectFlowControl.CheckForSyncLockOnValueType(obj); lock (obj) { this.fileStream_0.Seek((long)num3, SeekOrigin.Begin); this.fileStream_0.Read(array, 0, GClass3.int_13); } } while (array[num] != 0) { array2[num] = Convert.ToChar(array[num]); num++; } array2[num] = '\0'; result = new string(array2, 0, num); } catch (IOException ex) { Console.Write("IO Exception"); result = null; } return(result); }
private void CompletionMethod(Exception exc, bool canceled, AsyncOperation asyncOp) { if (!canceled) { object syncRoot = this.userStateToLifetime.SyncRoot; ObjectFlowControl.CheckForSyncLockOnValueType(syncRoot); lock (syncRoot) { this.userStateToLifetime.Remove(RuntimeHelpers.GetObjectValue(asyncOp.UserSuppliedState)); } } RunCompletedEventArgs arg = new RunCompletedEventArgs(exc, canceled, RuntimeHelpers.GetObjectValue(asyncOp.UserSuppliedState)); this._isBusy = false; asyncOp.PostOperationCompleted(this.onCompletedDelegate, arg); }
// Token: 0x06000050 RID: 80 RVA: 0x000038AC File Offset: 0x00001AAC private void method_8(object object_1) { if (this.bool_0) { object obj = this.object_0; ObjectFlowControl.CheckForSyncLockOnValueType(obj); lock (obj) { GClass5.GDelegate1 gdelegate = this.gdelegate1_0; if (gdelegate != null) { gdelegate(this); } } } }
public void AllJobsPushed() { object _PushLock = this.__PushLock; ObjectFlowControl.CheckForSyncLockOnValueType(_PushLock); lock (_PushLock) { this.__AllPushed = true; if (this.Finished) { ThreadPool.OnFinishedEventHandler onFinishedEvent = this.OnFinishedEvent; if (onFinishedEvent != null) { onFinishedEvent(); } } } }
// Token: 0x06000436 RID: 1078 RVA: 0x001D643C File Offset: 0x001D483C public void method_1() { try { object objectValue = RuntimeHelpers.GetObjectValue(this.object_0); ObjectFlowControl.CheckForSyncLockOnValueType(RuntimeHelpers.GetObjectValue(objectValue)); object obj = objectValue; ObjectFlowControl.CheckForSyncLockOnValueType(obj); lock (obj) { this.fileStream_0.Close(); } this.fileStream_0 = null; } catch (Exception ex) { } }
private void OS_NetworkAvailabilityChangedListener(object sender, EventArgs e) { var Expression = m_SyncObject; ObjectFlowControl.CheckForSyncLockOnValueType(Expression); var lockTaken = false; try { Monitor.Enter(Expression, ref lockTaken); m_SynchronizationContext.Post(m_NetworkAvailabilityChangedCallback, null); } finally { if (lockTaken) { Monitor.Exit(Expression); } } }
// Token: 0x06000082 RID: 130 RVA: 0x00009808 File Offset: 0x00007A08 private static void ReadStream(int firstCharRead, StreamReader streamReader, bool isError) { object readStreamLock = CMD._readStreamLock; ObjectFlowControl.CheckForSyncLockOnValueType(readStreamLock); lock (readStreamLock) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(Strings.ChrW(firstCharRead)); while (streamReader.Peek() > -1) { int charCode = streamReader.Read(); stringBuilder.Append(Strings.ChrW(charCode)); if (streamReader.Peek() == 0) { CMD.SendAndFlushBuffer(stringBuilder, isError); } } CMD.SendAndFlushBuffer(stringBuilder, isError); } }
internal void CloseStream() { object syncObject = this.m_SyncObject; ObjectFlowControl.CheckForSyncLockOnValueType(syncObject); lock (syncObject) { try { this.m_ReferenceCount--; this.m_Stream.Flush(); } finally { if (this.m_ReferenceCount <= 0) { this.m_Stream.Close(); this.m_Stream = null; } } } }
internal ExpressionElement Parse(string expression, IServiceProvider services) { var mySyncRoot = this.mySyncRoot; ObjectFlowControl.CheckForSyncLockOnValueType(mySyncRoot); ExpressionElement parse; lock (mySyncRoot) { var sr = new StringReader(expression); var parser = this.Parser; parser.Reset(); parser.Tokenizer.Reset(sr); var analyzer = (FleeExpressionAnalyzer)parser.Analyzer; analyzer.SetServices(services); var rootNode = this.DoParse(); analyzer.Reset(); var topElement = (ExpressionElement)rootNode.ValuesArrayList[0]; parse = topElement; } return(parse); }
public static PayRewardController GetInstance() { object obj = _lock; ObjectFlowControl.CheckForSyncLockOnValueType(obj); bool lockTaken = false; try { Monitor.Enter(obj, ref lockTaken); if (Information.IsNothing(instance)) { instance = new PayRewardController(); } return(instance); } finally { if (lockTaken) { Monitor.Exit(obj); } } }
public static GameListener GetInstance() { object @lock = _lock; ObjectFlowControl.CheckForSyncLockOnValueType(@lock); bool lockTaken = false; try { Monitor.Enter(@lock, ref lockTaken); if (Information.IsNothing(instance)) { instance = new GameListener(IPAddress.Any, checked ((ushort)ChatConfig.GAME_CHANNEL_PORT)); } return(instance); } finally { if (lockTaken) { Monitor.Exit(@lock); } } }
public static LoginListener GetInstance() { object @lock = _lock; ObjectFlowControl.CheckForSyncLockOnValueType(@lock); bool lockTaken = false; try { Monitor.Enter(@lock, ref lockTaken); if (Information.IsNothing(instance)) { instance = new LoginListener(IPAddress.Any, LoginConfig.LOGIN_PORT); } return(instance); } finally { if (lockTaken) { Monitor.Exit(@lock); } } }
public static TimeThread GetInstance() { object @lock = _lock; ObjectFlowControl.CheckForSyncLockOnValueType(@lock); bool lockTaken = false; try { Monitor.Enter(@lock, ref lockTaken); if (Information.IsNothing(instance)) { instance = new TimeThread(); } return(instance); } finally { if (lockTaken) { Monitor.Exit(@lock); } } }
// Token: 0x06000435 RID: 1077 RVA: 0x001D5FF4 File Offset: 0x001D43F4 private void method_0() { byte[] array = new byte[3]; byte[] array2 = new byte[GClass3.int_9 - 1 + 1 - 1 + 1]; this.byte_0 = (byte)GClass5.int_0; this.int_1 = GClass3.int_10; object objectValue = RuntimeHelpers.GetObjectValue(this.object_0); ObjectFlowControl.CheckForSyncLockOnValueType(RuntimeHelpers.GetObjectValue(objectValue)); object obj = objectValue; ObjectFlowControl.CheckForSyncLockOnValueType(obj); lock (obj) { this.fileStream_0.Seek(-3L, SeekOrigin.End); int num = GClass3.int_6 - 1; bool flag; for (int i = 0; i <= num; i++) { this.fileStream_0.Read(array, 0, 3); flag = (array[0] == byte.MaxValue && array[1] == byte.MaxValue && array[2] == byte.MaxValue); if (flag) { this.byte_0 = Convert.ToByte(this.fileStream_0.ReadByte()); flag = (this.byte_0 >= 106); if (flag) { this.byte_0 -= 105; } flag = ((int)this.byte_0 == GClass5.int_1); if (flag) { this.int_0 = new int[] { GClass3.int_15 }; this.int_1 = GClass3.int_10; } else { flag = ((int)this.byte_0 == GClass5.int_2); if (flag) { this.int_0 = new int[] { GClass3.int_16 }; this.int_1 = GClass3.int_10; } else { bool flag2; if ((int)this.byte_0 != GClass5.int_3 && (int)this.byte_0 != GClass5.int_4) { if ((int)this.byte_0 != GClass5.int_5 && (int)this.byte_0 != GClass5.int_14) { if ((int)this.byte_0 != GClass5.int_6 && (int)this.byte_0 != GClass5.int_13) { if ((int)this.byte_0 != GClass5.int_8 && (int)this.byte_0 != GClass5.int_12) { if ((int)this.byte_0 != GClass5.int_18 && (int)this.byte_0 != GClass5.int_19) { if ((int)this.byte_0 != GClass5.int_17 && (int)this.byte_0 != GClass5.int_16) { flag2 = false; goto IL_215; } } } } } } flag2 = true; IL_215: flag = flag2; if (flag) { this.int_0 = new int[] { 0 }; bool flag3; if ((int)this.byte_0 != GClass5.int_3 && (int)this.byte_0 != GClass5.int_4) { if ((int)this.byte_0 != GClass5.int_12 && (int)this.byte_0 != GClass5.int_18) { if ((int)this.byte_0 != GClass5.int_19 && (int)this.byte_0 != GClass5.int_17) { if ((int)this.byte_0 != GClass5.int_16 && (int)this.byte_0 != GClass5.int_8) { flag3 = false; goto IL_2A5; } } } } flag3 = true; IL_2A5: flag = flag3; if (flag) { this.int_1 = GClass3.int_10; } else { this.int_1 = GClass3.int_11; } this.fileStream_0.Read(array2, 0, GClass3.int_9); int num2 = GClass3.int_9 - 1; for (int j = 0; j <= num2; j++) { int num3 = 0; this.int_0[num3] = this.int_0[num3] + (GClass3.smethod_2(array2[j]) << j * 8); } } } } break; } this.fileStream_0.Seek(-4L, SeekOrigin.Current); } bool flag4; if ((int)this.byte_0 != GClass5.int_0 && (int)this.byte_0 != GClass5.int_11) { if ((int)this.byte_0 != GClass5.int_7 && (int)this.byte_0 != GClass5.int_9) { flag4 = false; goto IL_388; } } flag4 = true; IL_388: flag = flag4; if (flag) { this.int_0 = new int[] { GClass3.int_4 }; this.int_1 = GClass3.int_10; } flag = ((this.int_2 & GClass3.int_21) == 1); if (flag) { int num4 = (int)this.fileStream_0.Length; this.byte_1 = new byte[num4 - 1 + 1 - 1 + 1]; this.fileStream_0.Seek(0L, SeekOrigin.Begin); this.fileStream_0.Read(this.byte_1, 0, num4); } } }
private int method_19(long long_0) { byte[] array = new byte[2 * GClass3.int_12 - 1 + 1 - 1 + 1]; int[] array2 = new int[2]; int num = 0; int num2 = 31; for (;;) { bool flag; try { flag = ((this.int_2 & GClass3.int_21) == 1); if (flag) { int num3 = 2 * GClass3.int_12 - 1; for (int i = 0; i <= num3; i++) { array[i] = this.byte_1[i + 2 * this.int_1 * num]; } } else { object objectValue = RuntimeHelpers.GetObjectValue(this.object_0); ObjectFlowControl.CheckForSyncLockOnValueType(RuntimeHelpers.GetObjectValue(objectValue)); object obj = objectValue; ObjectFlowControl.CheckForSyncLockOnValueType(obj); lock (obj) { this.fileStream_0.Seek((long)(2 * this.int_1 * num), SeekOrigin.Begin); this.fileStream_0.Read(array, 0, 2 * GClass3.int_12); } } } catch (IOException ex) { Console.Write("IO Exception"); } int num4 = 0; do { array2[num4] = 0; int num5 = this.int_1 - 1; for (int j = 0; j <= num5; j++) { int num6 = (int)array[num4 * this.int_1 + j]; flag = (num6 < 0); if (flag) { num6 += 256; } int num7 = num4; array2[num7] += num6 << j * 8; } num4++; }while (num4 <= 1); flag = ((long_0 & 1L << (num2 & 31)) > 0L); if (flag) { bool flag2 = array2[1] >= this.int_0[0]; if (flag2) { break; } num = array2[1]; } else { bool flag2 = array2[0] >= this.int_0[0]; if (flag2) { goto Block_7; } num = array2[0]; } num2 += -1; if (num2 < 0) { goto Block_8; } } return(array2[1]); Block_7: return(array2[0]); Block_8: Console.Write("Error Seeking country while Seeking " + Conversions.ToString(long_0)); return(0); }
// Token: 0x06000437 RID: 1079 RVA: 0x001D64D4 File Offset: 0x001D48D4 public GClass5 method_10() { bool flag = this.gclass5_0 != null; GClass5 result; if (flag) { result = this.gclass5_0; } else { try { object objectValue = RuntimeHelpers.GetObjectValue(this.object_0); ObjectFlowControl.CheckForSyncLockOnValueType(RuntimeHelpers.GetObjectValue(objectValue)); object obj = objectValue; ObjectFlowControl.CheckForSyncLockOnValueType(obj); lock (obj) { bool flag2 = false; byte[] array = new byte[3]; this.fileStream_0.Seek(-3L, SeekOrigin.End); int num = GClass3.int_6 - 1; for (int i = 0; i <= num; i++) { this.fileStream_0.Read(array, 0, 3); flag = (array[0] == byte.MaxValue && array[1] == byte.MaxValue && array[2] == byte.MaxValue); if (flag) { flag2 = true; break; } this.fileStream_0.Seek(-4L, SeekOrigin.Current); } flag = flag2; if (flag) { this.fileStream_0.Seek(-6L, SeekOrigin.Current); } else { this.fileStream_0.Seek(-3L, SeekOrigin.End); } int num2 = GClass3.int_7 - 1; for (int j = 0; j <= num2; j++) { this.fileStream_0.Read(array, 0, 3); flag = (array[0] == 0 && array[1] == 0 && array[2] == 0); if (flag) { byte[] array2 = new byte[j - 1 + 1 - 1 + 1]; char[] array3 = new char[j - 1 + 1 - 1 + 1]; this.fileStream_0.Read(array2, 0, j); int num3 = j - 1; for (int k = 0; k <= num3; k++) { array3[k] = Convert.ToChar(array2[k]); } this.gclass5_0 = new GClass5(new string(array3)); return(this.gclass5_0); } this.fileStream_0.Seek(-4L, SeekOrigin.Current); } } } catch (Exception ex) { Exception ex2 = ex; Console.Write(ex2.Message); } result = new GClass5(string.Empty); } return(result); }