示例#1
0
 // Token: 0x060000BC RID: 188 RVA: 0x000150B0 File Offset: 0x000132B0
 public static void UpdateHandle()
 {
     Process[] processesByName = Process.GetProcessesByName("ASN_App_PcDx9_Final");
     if (processesByName.Length != 0)
     {
         if (GameMemory.gameHandle == 0)
         {
             DebugTools.Print("Update handle: Found new game handle.");
             GameMemory.processId  = processesByName[0].Id;
             GameMemory.gameHandle = GameMemory.OpenProcess(56, 0, GameMemory.processId);
             DebugTools.Print("Update handle: Will wait " + GameMemory.newHandleTime * 100 + "ms before loading game config.");
         }
     }
     else
     {
         GameMemory.gameHandle = 0;
         GameMemory.processId  = 0;
         if (GameMemory._OverlayProcess != null)
         {
             DebugTools.Print("Update handle: Lost game handle.");
             GameMemory.OverlayUnload();
         }
     }
     if (GameMemory.gameHandle > 0)
     {
         GameData.Update();
         if (GameMemory.newHandleTime > 0)
         {
             GameMemory.newHandleTime--;
             if (GameMemory.newHandleTime == 0)
             {
                 MainForm.AllLobbiesUI.RefreshList();
                 GameData.Update();
                 if (SteamData.errorCode == 0 && GameData.youAreHost)
                 {
                     SteamData.SetPlayerLimit(20);
                 }
                 GameMemory.ListCheckerLoad();
                 GameMemory.FullLobbyFixLoad();
                 GameMemory.HostMigrationFixLoad();
                 GameMemory.SLTCheckerLoad();
                 GameMemory.OptionsUpdate();
                 GameMemory.OverlayLoad();
                 return;
             }
         }
     }
     else
     {
         GameMemory.newHandleTime = 50;
     }
 }