Skip to content

修复一个弹幕长连可能导致死循环和崩溃的问题 #144

修复一个弹幕长连可能导致死循环和崩溃的问题

修复一个弹幕长连可能导致死循环和崩溃的问题 #144

Workflow file for this run

name: DDTV5_Dev
on:
push:
tags:
- "dev*"
pull_request:
paths:
- 'Server/**'
- 'Client/**'
- 'Desktop/**'
- '!**/README.md'
workflow_dispatch:
jobs:
Server:
strategy:
matrix:
include:
- os: windows-latest
runtime: win-x64
- os: macOS-latest
runtime: osx-x64
- os: macOS-latest
runtime: osx-arm64
- os: ubuntu-latest
runtime: linux-x64
- os: ubuntu-latest
runtime: linux-arm
- os: ubuntu-latest
runtime: linux-arm64
- os: ubuntu-latest
runtime: linux-musl-x64
- os: ubuntu-latest
runtime: linux-musl-arm
- os: ubuntu-latest
runtime: linux-musl-arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use .NET 8.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Download and extract latest release (Linux or macOS)
if: runner.os != 'Windows'
run: |
mkdir -p Static
header="authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
FILE_URL=$(curl -sH "$header" "https://api.github.com/repos/moehuhu/DDTV_GUI_React/releases/latest" \
| grep "browser_download_url.*ddtv-gui-react_v.*\.zip" \
| cut -d : -f 2,3 \
| tr -d \")
wget --header="$header" $FILE_URL -O ddtv-gui-react.zip
unzip ddtv-gui-react.zip -d Static
rm ddtv-gui-react.zip
shell: bash
- name: Download and extract latest release (Windows)
if: runner.os == 'Windows'
run: |
mkdir Static
$header = @{
Authorization = "Bearer ${{ secrets.GITHUB_TOKEN }}"
}
$url = Invoke-RestMethod -Uri https://api.github.com/repos/moehuhu/DDTV_GUI_React/releases/latest -Headers $header
$fileUrl = $url.assets | Where-Object { $_.name -match "ddtv-gui-react_v.*\.zip" } | Select-Object -ExpandProperty browser_download_url
Invoke-WebRequest -Uri $fileUrl -OutFile ddtv-gui-react.zip -Headers $header
Expand-Archive -Path ddtv-gui-react.zip -DestinationPath Static
Remove-Item -Path ddtv-gui-react.zip
shell: powershell
- name: Replace string with current date (Linux or macOS)
if: runner.os != 'Windows'
run: |
export TZ='Asia/Shanghai'
current_date=$(date +%Y-%m-%d)
current_time=$(date +%H:%M:%S)
combined_date_time="${current_date} ${current_time}"
echo ${combined_date_time}
sed -i.bak "s/CompilationTime/${combined_date_time}/g" Core/Init.cs
- name: Replace string with current date (Windows)
if: runner.os == 'Windows'
run: |
$beijingTime = [System.TimeZoneInfo]::ConvertTimeFromUtc((Get-Date).ToUniversalTime(), [System.TimeZoneInfo]::FindSystemTimeZoneById('China Standard Time'))
$current_date = $beijingTime.ToString("yyyy-MM-dd")
$current_time = $beijingTime.ToString("HH:mm:ss")
$combined_date_time = "$current_date $current_time"
Write-Output $combined_date_time
(Get-Content Core/Init.cs) -replace 'CompilationTime', $combined_date_time | Set-Content Core/Init.cs
- name: Replace VerString (Linux or macOS)
if: runner.os != 'Windows'
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
VERSION_NUMBER=$(echo $TAG_NAME | sed -n -E 's/^dev([0-9]+\.[0-9]+\.[0-9]+)$/\1/p')
COMMIT_COUNT=$(git rev-list --count HEAD)
FINAL_VERSION="${VERSION_NUMBER}.${COMMIT_COUNT}"
echo ${FINAL_VERSION}
sed -i.bak "s/5.0.0.0/${FINAL_VERSION}/g" Core/Core.csproj
sed -i.bak "s/5.0.0.0/${FINAL_VERSION}/g" Server/Server.csproj
- name: Replace VerString (Windows)
if: runner.os == 'Windows'
run: |
$TAG_NAME = "${env:GITHUB_REF}".Replace("refs/tags/", "")
$VERSION_NUMBER = $TAG_NAME -replace ".*?(\d+\.\d+\.\d+).*", '$1'
$COMMIT_COUNT = git rev-list --count HEAD
$FINAL_VERSION = "$VERSION_NUMBER.$COMMIT_COUNT"
Write-Output $FINAL_VERSION
(Get-Content Core/Core.csproj) | Foreach-Object { $_ -replace "5.0.0.0", $FINAL_VERSION } | Set-Content Core/Core.csproj
(Get-Content Server/Server.csproj) | Foreach-Object { $_ -replace "5.0.0.0", $FINAL_VERSION } | Set-Content Server/Server.csproj
shell: pwsh
- name: Build Server
run: cd Server && dotnet publish --runtime ${{ matrix.runtime }} --configuration Release --self-contained true --output build_output
- name: Build Update
run: cd Update && dotnet publish --runtime ${{ matrix.runtime }} --configuration Release --self-contained true --output build_update_output
- name: Move Update (Linux or macOS)
if: runner.os != 'Windows'
run: |
source="Update/build_update_output/*"
destination="Server/build_output/Update"
mkdir -p $destination
mv $source $destination
- name: Move Update (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$source = "Update/build_update_output/*"
$destination = "Server/build_output/Update"
New-Item -ItemType Directory -Force -Path $destination
Move-Item -Path $source -Destination $destination
- name: Copy Static folder to build_output
run: cp -r Static Server/build_output/Static
- name: Copy ffmpeg.exe (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir Server\\build_output\\Plugins\\ffmpeg
copy Server\\Plugins\\ffmpeg\\ffmpeg.exe Server\\build_output\\Plugins\\ffmpeg\\ffmpeg.exe
- name: Move all files to bin folder and create shortcut (Linux or macOS)
if: runner.os != 'Windows'
run: |
mkdir -p Server/build_output/bin
find Server/build_output -mindepth 1 -maxdepth 1 ! -name bin -exec mv {} Server/build_output/bin \;
echo "Creating shortcut for Server"
echo "#!/bin/bash" > Server/build_output/DDTV_Server.sh
echo "dir=\$(cd \"\$(dirname \"\$0\")\"; pwd)" >> Server/build_output/DDTV_Server.sh
echo "\$dir/bin/Server" >> Server/build_output/DDTV_Server.sh
chmod +x Server/build_output/DDTV_Server.sh
- name: Move all files to bin folder and create shortcut (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Get-ChildItem -Path "Server/build_output" | Move-Item -Destination "Server/build_output/bin"
$bat_file_path = "Server/build_output/启动DDTV_Server.bat"
$command = @"
setlocal EnableDelayedExpansion
set "abs_path=%~dp0"
cd %abs_path%bin
start Server.exe
"@
Set-Content -Path $bat_file_path -Value $command
- name: Add VersionFile (Linux or macOS)
if: runner.os != 'Windows'
run: |
echo "type=DDTV-Server-${{ matrix.os }}-${{ matrix.runtime }}" > Server/build_output/bin/ver.ini
echo "ver=${{ github.ref_name }}" >> Server/build_output/bin/ver.ini
- name: Add VersionFile (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$bat_file_path = "Server/build_output/bin/ver.ini"
$command = @"
type=DDTV-Server-${{ matrix.os }}-${{ matrix.runtime }}
ver=${{ github.ref_name }}
"@
Set-Content -Path $bat_file_path -Value $command
- name: List all files (Linux or macOS)
if: runner.os != 'Windows'
run: |
echo "Absolute paths:"
find "$(pwd)/Server/build_output" -type f
echo "Relative paths:"
find Server/build_output -type f
shell: bash
- name: List all files (Windows)
if: runner.os == 'Windows'
run: |
echo "Absolute paths:"
Get-ChildItem -Path "$(Resolve-Path Server/build_output)" -File -Recurse | ForEach-Object FullName
echo "Relative paths:"
Get-ChildItem -Path "Server/build_output" -File -Recurse | ForEach-Object Name
shell: powershell
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: DDTV-Server-${{ matrix.os }}-${{ matrix.runtime }}
path: Server/build_output
Desktop:
strategy:
matrix:
include:
- os: windows-latest
runtime: win-x64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use .NET 8.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Download and extract latest release (Windows)
if: runner.os == 'Windows'
run: |
mkdir Static
$header = @{
Authorization = "Bearer ${{ secrets.GITHUB_TOKEN }}"
}
$url = Invoke-RestMethod -Uri https://api.github.com/repos/moehuhu/DDTV_GUI_React/releases/latest -Headers $header
$fileUrl = $url.assets | Where-Object { $_.name -match "ddtv-gui-react_v.*\.zip" } | Select-Object -ExpandProperty browser_download_url
Invoke-WebRequest -Uri $fileUrl -OutFile ddtv-gui-react.zip -Headers $header
Expand-Archive -Path ddtv-gui-react.zip -DestinationPath Static
Remove-Item -Path ddtv-gui-react.zip
shell: powershell
- name: Replace string with current date (Windows)
if: runner.os == 'Windows'
run: |
$beijingTime = [System.TimeZoneInfo]::ConvertTimeFromUtc((Get-Date).ToUniversalTime(), [System.TimeZoneInfo]::FindSystemTimeZoneById('China Standard Time'))
$current_date = $beijingTime.ToString("yyyy-MM-dd")
$current_time = $beijingTime.ToString("HH:mm:ss")
$combined_date_time = "$current_date $current_time"
Write-Output $combined_date_time
(Get-Content Core/Init.cs) -replace 'CompilationTime', $combined_date_time | Set-Content Core/Init.cs
- name: Replace VerString (Windows)
if: runner.os == 'Windows'
run: |
$TAG_NAME = "${env:GITHUB_REF}".Replace("refs/tags/", "")
$VERSION_NUMBER = $TAG_NAME -replace ".*?(\d+\.\d+\.\d+).*", '$1'
$COMMIT_COUNT = git rev-list --count HEAD
$FINAL_VERSION = "$VERSION_NUMBER.$COMMIT_COUNT"
Write-Output $FINAL_VERSION
(Get-Content Core/Core.csproj) | Foreach-Object { $_ -replace "5.0.0.0", $FINAL_VERSION } | Set-Content Core/Core.csproj
(Get-Content Server/Server.csproj) | Foreach-Object { $_ -replace "5.0.0.0", $FINAL_VERSION } | Set-Content Server/Server.csproj
(Get-Content Desktop/Desktop.csproj) | Foreach-Object { $_ -replace "5.0.0.0", $FINAL_VERSION } | Set-Content Desktop/Desktop.csproj
shell: pwsh
- name: Build
run: cd Desktop && dotnet publish --runtime ${{ matrix.runtime }} --configuration Release --self-contained true --output build_output
- name: Build Update
run: cd Update && dotnet publish --runtime ${{ matrix.runtime }} --configuration Release --self-contained true --output build_update_output
- name: Move Update (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$source = "Update/build_update_output/*"
$destination = "Desktop/build_output/Update"
New-Item -ItemType Directory -Force -Path $destination
Move-Item -Path $source -Destination $destination
- name: Copy Static folder to build_output
run: cp -r Static Desktop/build_output/Static
- name: Copy ffmpeg.exe (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir Desktop\\build_output\\Plugins\\ffmpeg
copy Desktop\\Plugins\\ffmpeg\\ffmpeg.exe Desktop\\build_output\\Plugins\\ffmpeg\\ffmpeg.exe
- name: Copy VLC (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
mkdir Desktop/build_output/Plugins/vlc
$source = "Desktop/Plugins/vlc/*"
$destination = "Desktop/build_output/Plugins/vlc"
New-Item -ItemType Directory -Force -Path $destination
Move-Item -Path $source -Destination $destination
- name: Move all files to bin folder and create shortcut (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Get-ChildItem -Path "Desktop/build_output" | Move-Item -Destination "Desktop/build_output/bin"
$bat_file_path = "Desktop/build_output/启动DDTV_Desktop.bat"
$command = @"
setlocal EnableDelayedExpansion
set "abs_path=%~dp0"
cd %abs_path%bin
start Desktop.exe
"@
Set-Content -Path $bat_file_path -Value $command
- name: Add VersionFile (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$bat_file_path = "Desktop/build_output/bin/ver.ini"
$command = @"
type=DDTV-Desktop-${{ matrix.os }}-${{ matrix.runtime }}
ver=${{ github.ref_name }}
"@
Set-Content -Path $bat_file_path -Value $command
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: DDTV-Desktop-${{ matrix.os }}-${{ matrix.runtime }}
path: Desktop/build_output
Client:
strategy:
matrix:
include:
- os: windows-latest
runtime: win-x64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use .NET 8.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Download and extract latest release (Windows)
if: runner.os == 'Windows'
run: |
mkdir Static
$header = @{
Authorization = "Bearer ${{ secrets.GITHUB_TOKEN }}"
}
$url = Invoke-RestMethod -Uri https://api.github.com/repos/moehuhu/DDTV_GUI_React/releases/latest -Headers $header
$fileUrl = $url.assets | Where-Object { $_.name -match "ddtv-gui-react_v.*\.zip" } | Select-Object -ExpandProperty browser_download_url
Invoke-WebRequest -Uri $fileUrl -OutFile ddtv-gui-react.zip -Headers $header
Expand-Archive -Path ddtv-gui-react.zip -DestinationPath Static
Remove-Item -Path ddtv-gui-react.zip
shell: powershell
- name: Replace string with current date (Windows)
if: runner.os == 'Windows'
run: |
$beijingTime = [System.TimeZoneInfo]::ConvertTimeFromUtc((Get-Date).ToUniversalTime(), [System.TimeZoneInfo]::FindSystemTimeZoneById('China Standard Time'))
$current_date = $beijingTime.ToString("yyyy-MM-dd")
$current_time = $beijingTime.ToString("HH:mm:ss")
$combined_date_time = "$current_date $current_time"
Write-Output $combined_date_time
(Get-Content Core/Init.cs) -replace 'CompilationTime', $combined_date_time | Set-Content Core/Init.cs
- name: Replace VerString (Windows)
if: runner.os == 'Windows'
run: |
$TAG_NAME = "${env:GITHUB_REF}".Replace("refs/tags/", "")
$VERSION_NUMBER = $TAG_NAME -replace ".*?(\d+\.\d+\.\d+).*", '$1'
$COMMIT_COUNT = git rev-list --count HEAD
$FINAL_VERSION = "$VERSION_NUMBER.$COMMIT_COUNT"
Write-Output $FINAL_VERSION
(Get-Content Core/Core.csproj) | Foreach-Object { $_ -replace "5.0.0.0", $FINAL_VERSION } | Set-Content Core/Core.csproj
(Get-Content Server/Server.csproj) | Foreach-Object { $_ -replace "5.0.0.0", $FINAL_VERSION } | Set-Content Server/Server.csproj
(Get-Content Client/Client.csproj) | Foreach-Object { $_ -replace "5.0.0.0", $FINAL_VERSION } | Set-Content Client/Client.csproj
shell: pwsh
- name: Build
run: cd Client && dotnet publish --runtime ${{ matrix.runtime }} --configuration Release --self-contained true --output build_output
- name: Build Update
run: cd Update && dotnet publish --runtime ${{ matrix.runtime }} --configuration Release --self-contained true --output build_update_output
- name: Move Update (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$source = "Update/build_update_output/*"
$destination = "Client/build_output/Update"
New-Item -ItemType Directory -Force -Path $destination
Move-Item -Path $source -Destination $destination
- name: Copy Static folder to build_output
run: cp -r Static Client/build_output/Static
- name: Copy ffmpeg.exe (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir Client\\build_output\\Plugins\\ffmpeg
copy Client\\Plugins\\ffmpeg\\ffmpeg.exe Client\\build_output\\Plugins\\ffmpeg\\ffmpeg.exe
- name: Move all files to bin folder and create shortcut (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Get-ChildItem -Path "Client/build_output" | Move-Item -Destination "Client/build_output/bin"
$bat_file_path = "Client/build_output/启动DDTV_Client.bat"
$command = @"
setlocal EnableDelayedExpansion
set "abs_path=%~dp0"
cd %abs_path%bin
start Client.exe
"@
Set-Content -Path $bat_file_path -Value $command
- name: Add VersionFile (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$bat_file_path = "Client/build_output/bin/ver.ini"
$command = @"
type=DDTV-Client-${{ matrix.os }}-${{ matrix.runtime }}
ver=${{ github.ref_name }}
"@
Set-Content -Path $bat_file_path -Value $command
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: DDTV-Client-${{ matrix.os }}-${{ matrix.runtime }}
path: Client/build_output
Dev:
needs: [Server, Client, Desktop]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: assets
- run: |
cd assets
rm -rf *linux-musl*
for f in *; do
(cd $f && zip -r ../$f-${{ github.ref_name }}.zip .)
done
- uses: softprops/action-gh-release@v2
with:
files: assets/*.zip
prerelease: true
body: |
DDTV
-------------
这里是开发版,和正式版的区别就是更新频率会更高,其他没有什么不同。
DDTV5.x分为三个版本:【Server】、【Client】、【Desktop】
 
【Server】:为控制台应用,自带WEBUI服务,跨平台适配win、linux、mac
【Client】:为Server的Windows平台下的窗口程序封装,在Server的基础上提供了WEBUI的桌面窗口,只适配Windows,适合win下的轻量化用户
【Desktop】:Windows下的完全体,提供Server和Client的所有功能,以及特有的观看和桌面端控制UI,支持连接远程Server,为只适配Windows的WPF应用
 
请根据使用环境选择下载的包体
包体的命名规则为:DDTV-[版本]-[系统环境]-latest-[适配硬件架构]-dev[版本号].zip
例如使用微软Windows操作系统的AMD or 英特尔CPU想使用桌面版本的就该选择:[DDTV-Desktop-windows-latest-win-x64-dev]
如有问题欢迎加群:338182356