Skip to content

Commit

Permalink
Update to CS# v305
Browse files Browse the repository at this point in the history
  • Loading branch information
b0ink committed Jan 31, 2025
1 parent b48e96d commit 1547c90
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 54 deletions.
80 changes: 39 additions & 41 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,46 @@
name: .NET

on:
push:
branches: [ "main" ]
push:
branches: ["main"]

env:
VERSION: 2.0.0
BUILD_NUMBER: ${{ github.run_number }}
PROJECT_PATH: "FixDemoVoiceChat.csproj"
PROJECT_NAME: "FixDemoVoiceChat"
OUTPUT_PATH: "./FixDemoVoiceChat"

VERSION: 3.0.0
PROJECT_PATH: "FixDemoVoiceChat.csproj"
PROJECT_NAME: "FixDemoVoiceChat"
OUTPUT_PATH: "./FixDemoVoiceChat"

jobs:
build:
permissions: write-all
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore

- name: Build
run: dotnet build ${{ env.PROJECT_PATH }} -c Release -o ${{ env.OUTPUT_PATH }} -p:Version=${{ env.VERSION }} --version-suffix ${{ env.BUILD_NUMBER }}

- name: Zip
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: '${{ env.PROJECT_NAME }}-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.zip'
path: ${{ env.OUTPUT_PATH }}

- name: Release
uses: ncipollo/release-action@v1.12.0
with:
artifacts: ${{ env.PROJECT_NAME }}-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.zip
name: "Version ${{ env.VERSION }}.${{ env.BUILD_NUMBER }}"
tag: "v${{ env.VERSION }}.${{ env.BUILD_NUMBER }}"
body: |
Place the FixDemoVoiceChat folder in game/csgo/addons/counterstrikesharp/plugins/
build:
permissions: write-all
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore

- name: Build
run: dotnet build ${{ env.PROJECT_PATH }} -c Release -o ${{ env.OUTPUT_PATH }} -p:Version=${{ env.VERSION }} --version-suffix ${{ env.VERSION }}

- name: Zip
uses: thedoctor0/zip-release@0.7.5
with:
type: "zip"
filename: "${{ env.PROJECT_NAME }}-${{ env.VERSION }}.zip"
path: ${{ env.OUTPUT_PATH }}

- name: Release
uses: ncipollo/release-action@v1.12.0
with:
artifacts: ${{ env.PROJECT_NAME }}-${{ env.VERSION }}.zip
name: "Version ${{ env.VERSION }}"
tag: "v${{ env.VERSION }}"
body: |
Place the FixDemoVoiceChat folder in game/csgo/addons/counterstrikesharp/plugins/
2 changes: 1 addition & 1 deletion FixDemoVoiceChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class FixDemoVoiceChat : BasePlugin
{
public override string ModuleName => "Fix Voice Chat in Demo Recordings";
public override string ModuleAuthor => "BOINK";
public override string ModuleVersion => "2.0.0";
public override string ModuleVersion => "3.0.0";

public override void Load(bool hotReload)
{
Expand Down
2 changes: 1 addition & 1 deletion FixDemoVoiceChat.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.244" />
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.305" />
</ItemGroup>
</Project>
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,39 @@ Counter-Strike 2's SourceTV currently does not record player's voice chat by def

This should work with any gamemode/config as the player's voice flags are not changed.

## Requirements
- [Metamod](https://www.sourcemm.net/downloads.php/?branch=master)
- [CounterStrikeSharp](https://github.com/roflmuffin/CounterStrikeSharp) (>v244) (.NET 8)
### Requirements

## Installation
- Download the [latest release](https://github.com/b0ink/CS2-FixDemoVoiceChat/releases)
- Upload the `/FixDemoVoiceChat` folder into `game/csgo/addons/counterstrikesharp/plugins/`
- The SourceTV's voice flag fix is applied on each round start
- [Metamod](https://www.sourcemm.net/downloads.php/?branch=master)
- [CounterStrikeSharp](https://github.com/roflmuffin/CounterStrikeSharp) (>v305) (.NET 8)

### Installation

- Download the [latest release](https://github.com/b0ink/CS2-FixDemoVoiceChat/releases)
- Upload the `/FixDemoVoiceChat` folder into `game/csgo/addons/counterstrikesharp/plugins/`
- The SourceTV's voice flag fix is applied on each round start

## Demo Playback

# Demo Playback
To hear all player's voice chat, use the following commands in your console **before** loading up the demo:
```

```yaml
tv_listen_voice_indices -1
tv_listen_voice_indices_h -1

playdemo yourdemo.dem
```

Per [u/roge-s's comment on reddit](https://www.reddit.com/r/GlobalOffensive/comments/17i3zuc/comment/k6s7fjz), these convars can be used to select specific players to hear in demos:
```

```yaml
tv_listen_voice_indices 0: Bitfield of playerslots to listen to voice messages from when connected to SourceTV, default is none
tv_listen_voice_indices_h 0: High 32 bits of bitfield of playerslots to listen to voice messages from when connected to SourceTV, default is none
```
> Going by the descriptions of these convars, you need to enable each bit for the corresponding player slots you want to be able to hear. `tv_listen_voice_indices` would be used to configure player slots 0-31, and `tv_listen_voice_indices_h` for player slots 32-63.

> The confusing part about this is that the CS2 console seems to be treating these variables as signed 32-bit integers. That makes setting up these convars a bit annoying since you need to deal with the two's complement encoding that signed int32's use on x86 platforms.
With this all in mind, I would expect that by setting both of these convars to the decimal value of -1, you should be able to hear everyone.
> With this all in mind, I would expect that by setting both of these convars to the decimal value of -1, you should be able to hear everyone.

> If you want to selectively hear players, you can use a 32-bit two's complement integer calculator such as this one: https://www.binaryconvert.com/convert_signed_int.html?hexadecimal=0
> For this calculator in particular, just enable squares at the bottom corresponding to the player slots you want to hear, then click to "convert to decimal", and then use the decimal representation to set the corresponding convar in the game client.
Expand Down

0 comments on commit 1547c90

Please sign in to comment.