Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README-TESTER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# RedSync — tester package

## Play

1. Run **`Install-All.bat`** once (installs client mods into Cyberpunk).
2. Run **`PLAY.bat`** each session.
3. Pick / confirm your **username** when prompted (admins must match `XEROX710` or `lucifer420`).
4. Load into Night City — RedSync HUD should appear after a few seconds.

Default server: **`88.214.59.166:1337`**

Optional: put `host:port` in `release\server-address.cfg`.

## What gets installed

- RED4ext, ArchiveXL, TweakXL, Codeware, RedData, CET (dependencies)
- RedSync client plugin + archives + redscript + CET overlay

## Build a zip for friends

```powershell
powershell -ExecutionPolicy Bypass -File .\Build-Tester-Package.ps1
```

Output: `dist\RedSync-Tester-Package.zip`
145 changes: 36 additions & 109 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,135 +1,62 @@
# RedSync

Multiplayer framework for **Cyberpunk 2077** (v2.31). Rebrand of the Cyberverse rewrite — client plugin, redscript layer, and a .NET game server with a C++ networking core.
Multiplayer mod for **Cyberpunk 2077** (v2.31): RED4ext client plugin, redscript HUD, and a .NET + native UDP server (GameNetworkingSockets).

> [!NOTE]
> Active development. A self-contained tester package lives in [`release/`](release/) with auto-detect installers. See [Quick start](#quick-start-for-testers).
## Quick start

## Features

| Area | Status | Notes |
| --- | --- | --- |
| Connection & auth | Working | GameNetworkingSockets (UDP); username auth |
| HUD overlay | Working | Ping, player count, connection status |
| Server console | Working | **F10** — commands such as `help`, `players`, `say` |
| Admin panel | Working | **F7** — kick / ban / teleport (allowlisted users) |
| Join / leave | Working | Puppets spawn and despawn with players |
| Movement sync | Working | ~10 Hz position updates via `AITeleportCommand` |
| Player puppets | Working (AMM) | Remote V via TPP templates + local appearance |
| Vehicles | Basic | Spawn replicates; driving sync is rudimentary |
| Weapons / combat | Basic | Equip and shot relay; no damage yet |
| Animation | Not implemented | Puppets slide rather than walk |
| Chat / server browser | Not implemented | Planned for the redscript layer |

Plugin-oriented server design: shared protocol in `shared/protocol`; high-level logic in managed code so servers can extend behavior (e.g. RP-oriented setups).

## Requirements

| Dependency | Version | Role |
| --- | --- | --- |
| [Cyberpunk 2077](https://store.steampowered.com/app/1091500/) | **2.31** | Other patches unsupported |
| [RED4ext](https://github.com/WopsS/RED4ext) | 1.30.0+ | Plugin loader |
| [redscript](https://github.com/jac3km4/redscript) | 0.5.31+ | Script compiler |
| [Codeware](https://github.com/psiberx/cp2077-codeware) | 1.18.0+ | Entity spawning |
| [Cyber Engine Tweaks](https://github.com/maximegmd/CyberEngineTweaks) | 1.37.0+ | Required by AMM |
| [Appearance Menu Mod](https://www.nexusmods.com/cyberpunk2077/mods/790) | 2.4+ | Remote player appearance as V |

Server from source targets **.NET 9**. The [`release/`](release/) host tools document a .NET runtime for the packaged server executable — follow that package’s notes when using the tester build.

## Quick start for testers

1. Copy or download the [`release/`](release/) folder to the target PC.
2. Run **`Install-All.bat`** (RED4ext, redscript, Codeware, RedSync).
3. Run **`RedSync - Play.bat`** (reads server address / prompts as needed).
4. Load into the world — HUD should show ping and online players.

Full guide: [`release/START-HERE.txt`](release/START-HERE.txt) and [`release/README-TESTER.txt`](release/README-TESTER.txt).
**Download launcher (goes to your Downloads folder):**

```
--redsync-server-address=<ip> --redsync-server-port=1337 --launcher-skip
http://88.214.59.166:5005/api/media/RedSync_Launcher.zip
```

Use `127.0.0.1` only on the machine running the server. Remote clients need the host LAN IP or a public/VPS address.

Do **not** copy `game-path.cfg`, `launch-args.cfg`, or `server-address.cfg` between PCs — they are created locally. Stale paths cause errors like *"Cannot find drive D:"*; delete `game-path.cfg` and re-run `Install-All.bat`.
Or in PowerShell (auto-extracts to `Downloads\RedSync_Launcher`):

## Architecture

```
Client: Redscript → RED4ext C++ plugin → UDP (GameNetworkingSockets)
Server: Native C++ sockets/framing → Managed .NET 9 (logic, entities, plugins)
Shared: shared/protocol (client and server must match the same revision)
```powershell
irm http://88.214.59.166:5005/api/media/RedSync_Launcher.zip -OutFile "$env:USERPROFILE\Downloads\RedSync_Launcher.zip"; Expand-Archive "$env:USERPROFILE\Downloads\RedSync_Launcher.zip" -DestinationPath "$env:USERPROFILE\Downloads" -Force; explorer "$env:USERPROFILE\Downloads\RedSync_Launcher"
```

| Component | Role |
| --- | --- |
| `client/red4ext` | Networking, clientbound spawn/teleport/destroy, serverbound actions |
| `client/RedscriptModule` | Game events, UI, puppet spawn/teleport via Codeware |
| `server/Native` | Low-level sockets and serialization |
| `server/Managed` | Players, entities, plugins, outbound queue |
Then:

## Running a server
1. Open `Downloads\RedSync_Launcher` and run **`PLAY.bat`**.
2. When prompted, pick your **username** (Enter keeps the last one). Admins must match `XEROX710` / `lucifer420`.
3. (First time only) install the client with `release\Install-All.bat` from the full package if RedSync is not in the game yet.

**Docker** (from repo root after copying protocol into the server tree as documented in build scripts):
Default public server:

```bash
cp -r shared/protocol server/protocol
cd server
docker build -t redsync-server .
docker run -d --name redsync-server --restart unless-stopped \
-p 1337:1337/tcp -p 1337:1337/udp redsync-server
```

**Local / release package:** `RedSync - Start Server.bat` or `server/Start-Server.bat` (UDP/TCP **1337**). Allow the port through the firewall; forward UDP 1337 for internet clients.

From source without Docker: `dotnet publish -c Release` on `server/Managed`, then run `RedSync.Server` (.NET 9).

## Building the client plugin

Requires Visual Studio 2022, CMake, and vcpkg:

```powershell
$env:VCPKG_ROOT = "C:\path\to\vcpkg"
cmake -S client/red4ext -B client/red4ext/build/vs-vcpkg `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" `
-DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -A x64
cmake --build client/red4ext/build/vs-vcpkg --config Release
88.214.59.166:1337
```

Output: `client/red4ext/build/vs-vcpkg/src/Release/RedSync.Red4Ext.dll`

CI builds the Windows client plugin and Linux server image on push/PR; the DLL is uploaded as a build artifact.

### Manual client install

| Source | Destination |
| --- | --- |
| `RedSync.Red4Ext.dll` | `red4ext/plugins/` |
| Runtime DLLs (`GameNetworkingSockets`, protobuf, abseil, OpenSSL) | `bin/x64/` |
| `client/RedscriptModule/src/` → `RedSync/` | `r6/scripts/RedSync/` |

Delete `r6/cache/final.redscripts.modded` once after install or script updates so redscript recompiles.

Healthy client log (`%LOCALAPPDATA%\RED4ext\RedSync.log` or game `red4ext/logs/`): connect → login accepted → `PlayerJoinWorld`.
Launch args (username is required for nametags / F7 admin):

## Admin
```
--redsync-server-address=88.214.59.166 --redsync-server-port=1337 --redsync-username=YOUR_NAME --launcher-skip
```

Allowlisted usernames may open **F7** and run admin commands (kick, ban, teleport). Enforced server-side.
## Launcher (replaces XBUNIVERSE)

Edit next to `RedSync.Server.exe` (restart after changes):
See [`release/RedSync_Launcher/`](release/RedSync_Launcher/). Run `Convert-From-XBUNIVERSE.ps1` to rename your Downloads launcher folder, install the username picker, and point Play at the VPS. Or use `release/Download-Launcher-To-Downloads.ps1` / `GET-REDSYNC-LAUNCHER.ps1`.

```json
[
{ "name": "YourUsername" }
]
```
## Server (VPS)

File: `admins.json` (or `admins.txt`, one name per line). Names must match the player’s join name / `username.cfg` (case-insensitive). `Configure-Host.bat` can seed the list from `username.cfg`. Process console always has full access; in-game `admins` / `adminadd` / `adminremove` manage the list. Non-admins see “Not authorized” on F7; **F10** remains available for general console commands.
Deploy helpers live in [`deploy/`](deploy/). The production host is **88.214.59.166** (UDP **1337**).

## License
## Requirements

[MIT](LICENSE) — Copyright (c) 2023–2026 **XEROX710**.
| Dependency | Role |
| --- | --- |
| Cyberpunk 2077 2.31 | Game |
| RED4ext 1.30+ | Plugin loader |
| redscript 0.5.31+ | Scripts |
| Codeware 1.18+ | Entity spawn |
| CET + AMM | Remote appearance |

## Credits
## Layout

Originally based on **Cyberverse** by **MeFisto94** / TDUniverse. RedSync continues that work under the MIT license with copyright held by XEROX710.
| Path | Role |
| --- | --- |
| `client/` | RED4ext + redscript client |
| `server/` | Native + managed game server |
| `shared/protocol` | Shared packets |
| `release/` | Tester package / launchers |
38 changes: 38 additions & 0 deletions START-HERE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# RedSync — start here

## Get the launcher into Downloads

Open this link (saves to Downloads), then unzip:

**http://88.214.59.166:5005/api/media/RedSync_Launcher.zip**

Or paste in PowerShell:

```powershell
irm http://88.214.59.166:5005/api/media/RedSync_Launcher.zip -OutFile "$env:USERPROFILE\Downloads\RedSync_Launcher.zip"; Expand-Archive "$env:USERPROFILE\Downloads\RedSync_Launcher.zip" -DestinationPath "$env:USERPROFILE\Downloads" -Force; explorer "$env:USERPROFILE\Downloads\RedSync_Launcher"
```

You should get: `C:\Users\<you>\Downloads\RedSync_Launcher\`

## What you need

1. **Cyberpunk 2077** installed (Steam / GOG / Epic)
2. RedSync client installed once (`Install-All.bat` from the full release package)

## Play

1. Double-click **`PLAY.bat`** in `Downloads\RedSync_Launcher`
2. Confirm or change your username when prompted
3. Load into Night City — the RedSync HUD should appear after a few seconds

## Server

Default: **`88.214.59.166:1337`**

## Troubleshooting

| Problem | Fix |
|---------|-----|
| Wrong username / no admin | Run `PLAY.bat` again and type the correct name (`XEROX710` / `lucifer420`) |
| No multiplayer HUD | Install client with `Install-All.bat`, then use `PLAY.bat` only |
| Can't connect | Confirm the server is up and UDP/TCP **1337** is open |
46 changes: 46 additions & 0 deletions deploy/vps-install-redsync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
# Install/run RedSync server on Ubuntu VPS (88.214.59.166)
set -euo pipefail
PORT=1337
APP=/opt/redsync
mkdir -p "$APP"
cd "$(dirname "$0")/.."

# Prefer wine self-contained Windows build if native .so missing
if [[ -f release/server/RedSync.Server.exe ]]; then
apt-get update -y
apt-get install -y wine64 unzip curl
mkdir -p "$APP/server"
cp -a release/server/. "$APP/server/"
cat > /etc/systemd/system/redsync.service << UNIT
[Unit]
Description=RedSync Cyberpunk multiplayer server
After=network.target

[Service]
Type=simple
WorkingDirectory=$APP/server
ExecStart=/usr/bin/wine RedSync.Server.exe
Restart=always
RestartSec=3
Environment=WINEDEBUG=-all

[Install]
WantedBy=multi-user.target
UNIT
systemctl daemon-reload
systemctl enable --now redsync.service
sleep 2
systemctl status redsync --no-pager || true
ss -ulnp | grep 1337 || true
echo "RedSync should be listening UDP $PORT"
else
echo "Missing release/server/RedSync.Server.exe"
exit 1
fi

# Open firewall if ufw present
if command -v ufw >/dev/null; then
ufw allow 1337/udp || true
ufw allow 1337/tcp || true
fi
31 changes: 31 additions & 0 deletions release/Download-Launcher-To-Downloads.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#Requires -Version 5.1
<#
.SYNOPSIS
Downloads RedSync_Launcher into your Downloads folder and opens it.
#>
$ErrorActionPreference = "Stop"
$Downloads = Join-Path $env:USERPROFILE "Downloads"
$DestDir = Join-Path $Downloads "RedSync_Launcher"
$ZipPath = Join-Path $Downloads "RedSync_Launcher.zip"
$Url = "http://88.214.59.166:5005/api/media/RedSync_Launcher.zip"

New-Item -ItemType Directory -Force -Path $Downloads | Out-Null
Write-Host "Downloading RedSync launcher -> $ZipPath"
Invoke-WebRequest -Uri $Url -OutFile $ZipPath -UseBasicParsing

# Refresh destination
if (Test-Path -LiteralPath $DestDir) {
Remove-Item -LiteralPath $DestDir -Recurse -Force
}

Expand-Archive -LiteralPath $ZipPath -DestinationPath $Downloads -Force

if (-not (Test-Path -LiteralPath (Join-Path $DestDir "PLAY.bat"))) {
throw "Extract failed — PLAY.bat missing under $DestDir"
}

Write-Host ""
Write-Host "Installed: $DestDir"
Write-Host "Double-click PLAY.bat — pick your username, then the game launches."
Write-Host "Admins: XEROX710 or lucifer420"
explorer $DestDir
11 changes: 11 additions & 0 deletions release/GET-REDSYNC-LAUNCHER.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Paste into PowerShell — installs to Downloads\RedSync_Launcher
$ErrorActionPreference = "Stop"
$d = Join-Path $env:USERPROFILE "Downloads"
$z = Join-Path $d "RedSync_Launcher.zip"
$u = "http://88.214.59.166:5005/api/media/RedSync_Launcher.zip"
Invoke-WebRequest $u -OutFile $z -UseBasicParsing
$dest = Join-Path $d "RedSync_Launcher"
if (Test-Path $dest) { Remove-Item $dest -Recurse -Force }
Expand-Archive $z -DestinationPath $d -Force
explorer $dest
Write-Host "Ready: $dest — run PLAY.bat and pick your username."
35 changes: 22 additions & 13 deletions release/GamePath.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -419,25 +419,34 @@ function Save-UsernameConfig {
}

function Resolve-RedSyncUsername {
param([string]$ReleaseRoot)
param(
[string]$ReleaseRoot,
[switch]$ForcePrompt
)

$name = Read-UsernameConfig -ReleaseRoot $ReleaseRoot
if (-not [string]::IsNullOrWhiteSpace($name)) {
return $name
}
$current = Read-UsernameConfig -ReleaseRoot $ReleaseRoot

Write-Host ""
Write-Host "Pick a username other players will see above your head."
Write-Host "(letters, digits, - and _ only; stored in username.cfg)"
$name = Format-RedSyncUsername (Read-Host "Username")
if (-not [string]::IsNullOrWhiteSpace($current)) {
Write-Host "Current username: $current"
Write-Host "Press Enter to keep it, or type a new one."
} else {
Write-Host "Pick a username other players will see above your head."
}
Write-Host "(letters, digits, - and _ only; max 24 chars)"
$entered = Format-RedSyncUsername (Read-Host "Username")

if ([string]::IsNullOrWhiteSpace($name)) {
$name = Format-RedSyncUsername $env:USERNAME
if ([string]::IsNullOrWhiteSpace($entered)) {
$entered = $current
}
if ([string]::IsNullOrWhiteSpace($entered)) {
$entered = Format-RedSyncUsername $env:USERNAME
}

if (-not [string]::IsNullOrWhiteSpace($name)) {
Save-UsernameConfig -ReleaseRoot $ReleaseRoot -Name $name
if (-not [string]::IsNullOrWhiteSpace($entered)) {
Save-UsernameConfig -ReleaseRoot $ReleaseRoot -Name $entered
}

return $name
return $entered
}

Loading