Exemple #1
0
        private void method_10(object sender, EventArgs31 e)
        {
            lock (((ICollection)Class142.dictionary_0).SyncRoot)
            {
                switch (e.InvasionState.enum97_0)
                {
                case Enum97.const_0:
                case Enum97.const_2:
                    if (Class142.dictionary_0.ContainsKey(this))
                    {
                        Class142.dictionary_0[this] = e.InvasionState;
                    }
                    else
                    {
                        Class142.dictionary_0.Add(this, e.InvasionState);
                    }
                    this.Invasion = new Struct26?(e.InvasionState);
                    break;

                case Enum97.const_1:
                    if (Class142.dictionary_0.ContainsKey(this))
                    {
                        Class142.dictionary_0.Remove(this);
                    }
                    this.Invasion = null;
                    break;
                }
            }
            if (this.eventHandler_6 != null)
            {
                this.eventHandler_6(this, e);
            }
            Class142.smethod_6(this, e.InvasionState);
        }
Exemple #2
0
 private void method_12(object sender, EventArgs e)
 {
     this.District = null;
     this.Invasion = null;
     lock (((ICollection)Class142.dictionary_0).SyncRoot)
     {
         if (Class142.dictionary_0.ContainsKey(this))
         {
             Class142.dictionary_0.Remove(this);
         }
     }
     if (this.eventHandler_7 != null)
     {
         this.eventHandler_7(this, null);
     }
     lock (((ICollection)Class142.dictionary_1).SyncRoot)
     {
         if (Class142.dictionary_1.ContainsKey(this))
         {
             Class142.dictionary_1[this] = null;
         }
         else
         {
             Class142.dictionary_1.Add(this, null);
         }
     }
     Class142.smethod_7(this, null);
 }
Exemple #3
0
 // Token: 0x060028B2 RID: 10418 RVA: 0x000129BB File Offset: 0x00010BBB
 private static void smethod_7(Class142 window, Class177 district)
 {
     if (Class142.eventHandler_3 != null)
     {
         Class142.eventHandler_3(window, new EventArgs37(district));
     }
 }
Exemple #4
0
 // Token: 0x060028D2 RID: 10450 RVA: 0x0009A404 File Offset: 0x00098604
 protected override void vmethod_0()
 {
     lock (((ICollection)Class142.list_1).SyncRoot)
     {
         if (Class142.list_1.Contains(this))
         {
             Class142.list_1.Remove(this);
         }
     }
     lock (((ICollection)this.list_2).SyncRoot)
     {
         this.list_2.Clear();
     }
     lock (((ICollection)Class142.dictionary_1).SyncRoot)
     {
         if (Class142.dictionary_1.ContainsKey(this))
         {
             Class142.dictionary_1.Remove(this);
         }
     }
     this.District = null;
     Class142.smethod_0();
     if (this.eventHandler_7 != null)
     {
         this.eventHandler_7(this, new EventArgs37(null));
     }
     Class142.smethod_4(this);
     Class142.smethod_7(this, null);
     this.ToonTownProcess.Dispose();
     base.vmethod_0();
 }
Exemple #5
0
 // Token: 0x060028B1 RID: 10417 RVA: 0x000129A1 File Offset: 0x00010BA1
 private static void smethod_6(Class142 window, Struct26 state)
 {
     if (Class142.eventHandler_2 != null)
     {
         Class142.eventHandler_2(window, new EventArgs31(state));
     }
 }
Exemple #6
0
 // Token: 0x060028B0 RID: 10416 RVA: 0x00012987 File Offset: 0x00010B87
 private static void smethod_5(Class142 window, Class177 district)
 {
     if (Class142.eventHandler_4 != null)
     {
         Class142.eventHandler_4(window, new EventArgs29(district));
     }
 }
Exemple #7
0
 // Token: 0x060028AF RID: 10415 RVA: 0x0001296E File Offset: 0x00010B6E
 private static void smethod_4(Class142 window)
 {
     if (Class142.eventHandler_5 != null)
     {
         Class142.eventHandler_5(window, EventArgs.Empty);
     }
 }
Exemple #8
0
        // Token: 0x060028C9 RID: 10441 RVA: 0x00099D58 File Offset: 0x00097F58
        public static Class142 smethod_9(IntPtr hWnd, Enum101 serverType, string username)
        {
            Class142 result;

            try
            {
                result = new Class142(hWnd, serverType, username);
            }
            catch (Exception ex)
            {
                ex.smethod_0();
                result = null;
            }
            return(result);
        }
Exemple #9
0
 // Token: 0x060028A3 RID: 10403 RVA: 0x00099868 File Offset: 0x00097A68
 public static bool smethod_2(IntPtr hWnd, out Class142 wnd)
 {
     lock (((ICollection)Class142.list_1).SyncRoot)
     {
         foreach (Class142 @class in Class142.list_1)
         {
             if (@class.ToonTownProcess.MainWindowHandle == hWnd)
             {
                 wnd = @class;
                 return(true);
             }
         }
     }
     wnd = null;
     return(false);
 }
Exemple #10
0
 private void method_13(object sender, EventArgs1 e)
 {
     lock (((ICollection)this.list_2).SyncRoot)
     {
         this.list_2.Clear();
         foreach (uint shardID in e.Shards)
         {
             Class177 item = Class177.smethod_0(shardID);
             if (!this.list_2.Contains(item))
             {
                 this.list_2.Add(item);
             }
         }
     }
     Class142.smethod_0();
 }
Exemple #11
0
        public static Class142 smethod_8(Process p, Enum101 serverType, string username, bool isOpen = true)
        {
            Class142 result;

            try
            {
                p.EnableRaisingEvents = true;
                result = new Class142(p, serverType, username, isOpen);
            }
            catch (Exception ex)
            {
                ex.smethod_0();
                result = null;
            }
            return(result);
        }
Exemple #12
0
 private void method_14(object sender, EventArgs e)
 {
     Class142.smethod_5(this, this.District);
 }
Exemple #13
0
        // Token: 0x060028D0 RID: 10448 RVA: 0x0009A000 File Offset: 0x00098200
        private static bool smethod_10(Process p, out string logFile)
        {
            Class335.smethod_2(Class142.string_7, true);
            List <FileSystemInfo> list = Class471.smethod_2(p.Id);

            if (list != null)
            {
                using (List <FileSystemInfo> .Enumerator enumerator = list.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        FileSystemInfo fileSystemInfo = enumerator.Current;
                        if (fileSystemInfo is FileInfo && string.Equals(fileSystemInfo.Extension, Class142.string_4, StringComparison.OrdinalIgnoreCase) && fileSystemInfo.Name.StartsWith("toontown", StringComparison.OrdinalIgnoreCase) && fileSystemInfo.Exists)
                        {
                            logFile = fileSystemInfo.FullName;
                            Class335.smethod_3(Class142.string_6, new object[]
                            {
                                logFile
                            });
                            return(true);
                        }
                    }
                    goto IL_B4;
                }
                bool result;
                return(result);
            }
            Class335.smethod_2(Class142.string_5, true);
IL_B4:
            string text = null;

            if ((p.StartInfo == null || string.IsNullOrEmpty(text = p.StartInfo.WorkingDirectory)) && p.MainModule != null)
            {
                text = Path.GetDirectoryName(p.MainModule.FileName);
            }
            if (!string.IsNullOrEmpty(text) && Directory.Exists(text))
            {
                Class142.Class442 @class = new Class142.Class442();
                Class335.smethod_3(Class142.string_2, new object[]
                {
                    text
                });
                @class.dateTime_0 = p.StartTime;
                @class.hashSet_0  = Class142.smethod_3();
                IEnumerable <string> source = Class234.smethod_1(text, Class142.string_3, Class142.string_4).Where(new Func <string, bool>(@class.method_0));
                if (Class142.func_0 == null)
                {
                    Class142.func_0 = new Func <string, bool>(Class142.smethod_12);
                }
                string[] array = source.Where(Class142.func_0).Where(new Func <string, bool>(@class.method_1)).ToArray <string>();
                if (array.Length == 1)
                {
                    logFile = array[0];
                    Class335.smethod_3(Class142.string_1, new object[]
                    {
                        logFile
                    });
                    return(true);
                }
            }
            Class335.smethod_2(Class142.string_0, true);
            logFile = null;
            return(false);
        }
Exemple #14
0
        // Token: 0x060028CF RID: 10447 RVA: 0x00099ED0 File Offset: 0x000980D0
        private bool method_6(EventHandler endOfStream = null)
        {
            EventHandler <EventArgs0>  eventHandler  = null;
            EventHandler <EventArgs31> eventHandler2 = null;
            EventHandler <EventArgs37> eventHandler3 = null;
            EventHandler eventHandler4 = null;
            EventHandler <EventArgs1> eventHandler5 = null;
            EventHandler eventHandler6 = null;
            EventHandler <EventArgs30> eventHandler7 = null;
            string logFile;

            if (Class142.smethod_10(this.ToonTownProcess.Process, out logFile))
            {
                this.LogMonitor = new Class129(logFile);
                Class129 logMonitor = this.LogMonitor;
                if (eventHandler == null)
                {
                    eventHandler = new EventHandler <EventArgs0>(this.method_9);
                }
                logMonitor.FileStateRead += eventHandler;
                Class129 logMonitor2 = this.LogMonitor;
                if (eventHandler2 == null)
                {
                    eventHandler2 = new EventHandler <EventArgs31>(this.method_10);
                }
                logMonitor2.InvasionStateChanged += eventHandler2;
                Class129 logMonitor3 = this.LogMonitor;
                if (eventHandler3 == null)
                {
                    eventHandler3 = new EventHandler <EventArgs37>(this.method_11);
                }
                logMonitor3.DistrictChanged += eventHandler3;
                Class129 logMonitor4 = this.LogMonitor;
                if (eventHandler4 == null)
                {
                    eventHandler4 = new EventHandler(this.method_12);
                }
                logMonitor4.LoggedOut += eventHandler4;
                Class129 logMonitor5 = this.LogMonitor;
                if (eventHandler5 == null)
                {
                    eventHandler5 = new EventHandler <EventArgs1>(this.method_13);
                }
                logMonitor5.AvailableDistrictsChanged += eventHandler5;
                Class129 logMonitor6 = this.LogMonitor;
                if (eventHandler6 == null)
                {
                    eventHandler6 = new EventHandler(this.method_14);
                }
                logMonitor6.NoInvasionDetected += eventHandler6;
                Class129 logMonitor7 = this.LogMonitor;
                if (eventHandler7 == null)
                {
                    eventHandler7 = new EventHandler <EventArgs30>(this.method_15);
                }
                logMonitor7.PlaygroundChanged += eventHandler7;
                if (endOfStream != null)
                {
                    this.LogMonitor.ReadingPaused += endOfStream;
                }
                this.LogMonitor.method_4();
                return(true);
            }
            return(false);
        }