コード例 #1
0
 private void ProcessLobbySessionStart()
 {
     LobbyUtils.ResetLobbyData();
     Variables.LobbySession = true;
     if (Variables.OverlayWindow == null)
     {
         Variables.OverlayThread = new Thread(() => {
             Variables.OverlayApp    = new Application();
             Variables.OverlayWindow = new MainWindow();
             Task.Delay(500).ContinueWith(task => Variables.OverlayWindow.UpdateConfiguration(Variables.Config, Variables.LobbySession));
             Variables.OverlayWindow.RegisterHotKeyHooks(CopyPlayerStats, CalculateBalancedTeamsRank, CalculateBalancedTeamsTotalGames, CalculateBalancedTeamsWinRatio);
             Variables.OverlayApp.Run(Variables.OverlayWindow);
         });
         Variables.OverlayThread.SetApartmentState(ApartmentState.STA);
         Variables.OverlayThread.Start();
     }
     else
     {
         Variables.OverlayWindow.UpdateConfiguration(Variables.Config, Variables.LobbySession);
     }
     if (Variables.ReplayMode)
     {
         Task.Factory.StartNew(() => new NetHookDumpReaderJob());
     }
     else
     {
         SteamUtils.CheckNethookPaths();
         Task.Delay(5000).ContinueWith(t => SteamUtils.CheckNethookPaths()); //In case NetHook didn't start up fast enough
     }
 }
コード例 #2
0
        private void ReadFile(FileInfo file)
        {
            var item = new NetHookItem();

            if (item.LoadFromFile(file))
            {
                switch (item.Direction)
                {
                case NetHookItem.PacketDirection.In:
                    switch (item.EMsg)
                    {
                    case EMsg.ClientMMSLobbyData:
                        ProcessLobbyUpdate(item);
                        SetLobbyPresence(true);
                        break;

                    case EMsg.ClientMMSCreateLobbyResponse:
                        ProcessCreateLobbyResponse(item);
                        break;

                    case EMsg.ClientMMSJoinLobbyResponse:
                        ProcessJoinLobbyResponse(item);
                        break;
                    }
                    break;

                case NetHookItem.PacketDirection.Out:
                    switch (item.EMsg)
                    {
                    case EMsg.ClientMMSCreateLobby:
                    case EMsg.ClientMMSJoinLobby:
                        LobbyUtils.ResetLobbyData();
                        SetLobbyPresence(true);
                        ClearOverlayTeams();
                        break;

                    case EMsg.ClientMMSLeaveLobby:
                        ProcessLobbyLeave();
                        SetLobbyPresence(false);
                        break;

                    case EMsg.ClientLBSSetScore:
                        ProcessLeaderBoardUpdate(item);
                        break;
                    }
                    break;
                }
            }
            else
            {
                throw new Exception("Failed to read");
            }
        }
コード例 #3
0
 public NetHookDumpReaderJob()
 {
     LobbyUtils.ResetLobbyData();
     if (Variables.ReplayMode)
     {
         ReadNewFiles();
     }
     else
     {
         StartJob();
     }
 }