From 3b147b4bbca90aa4f02da33e26d3c180e4cb7755 Mon Sep 17 00:00:00 2001 From: Roham Date: Wed, 24 Dec 2025 00:41:51 +0000 Subject: [PATCH 01/10] -Added PHP SUPPORT FOR HOSTING --- index.php | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 index.php diff --git a/index.php b/index.php new file mode 100644 index 0000000..e55becd --- /dev/null +++ b/index.php @@ -0,0 +1,134 @@ + $value) { + if (!in_array(strtolower($key), ['host', 'content-length'])) { + $headers[] = "$key: $value"; + } + } + $headers[] = "Cross-Origin-Opener-Policy: same-origin"; + $headers[] = "Cross-Origin-Embedder-Policy: require-corp"; + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + + // Forward body for POST/PUT/PATCH + if (!in_array($_SERVER['REQUEST_METHOD'], ['GET', 'HEAD'])) { + curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents('php://input')); + } + + curl_setopt($ch, CURLOPT_HEADER, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + $response = curl_exec($ch); + $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); + + $header_text = substr($response, 0, $header_size); + $body = substr($response, $header_size); + + foreach (explode("\r\n", $header_text) as $header) { + if ($header && stripos($header, 'Content-Length') === false) { + header($header, false); + } + } + + echo $body; + curl_close($ch); +} + +// ---------------- ROUTING ---------------- +$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); + +// Proxy /vcsky/* +if (preg_match('#^' . $BASE_PATH . '/vcsky/(.*)#', $uri, $matches)) { + $url = build_url($VCSKY_BASE_URL, $matches[1]); + proxy_request($url); + exit; +} + +// Proxy /vcbr/* +if (preg_match('#^' . $BASE_PATH . '/vcbr/(.*)#', $uri, $matches)) { + $url = build_url($BR_BASE_URL, $matches[1]); + proxy_request($url); + exit; +} + + +// Serve static files under $BASE_PATH +if (strpos($uri, $BASE_PATH) === 0) { + $relativePath = substr($uri, strlen($BASE_PATH)); + if ($relativePath === '' || $relativePath === '/') { + $relativePath = '/index.html'; + } + + $localFile = realpath($DIST_PATH . $relativePath); + + // Ensure the file exists AND is inside $DIST_PATH + if ($localFile && is_file($localFile) && str_starts_with($localFile, realpath($DIST_PATH))) { + // Set MIME type manually for common extensions + $ext = pathinfo($localFile, PATHINFO_EXTENSION); + switch (strtolower($ext)) { + case 'js': + $mimeType = 'application/javascript'; + break; + case 'css': + $mimeType = 'text/css'; + break; + case 'html': + case 'htm': + $mimeType = 'text/html'; + break; + case 'json': + $mimeType = 'application/json'; + break; + case 'wasm': + $mimeType = 'application/wasm'; + break; + default: + $mimeType = mime_content_type($localFile) ?: 'application/octet-stream'; + } + + header("Content-Type: $mimeType"); + header("Cross-Origin-Opener-Policy: same-origin"); + header("Cross-Origin-Embedder-Policy: require-corp"); + readfile($localFile); + exit; + } + + // SPA fallback only for HTML requests + if (str_ends_with($uri, '/') || preg_match('/\.html$/', $uri)) { + $indexFile = $DIST_PATH . '/index.html'; + if (is_file($indexFile)) { + header("Content-Type: text/html"); + header("Cross-Origin-Opener-Policy: same-origin"); + header("Cross-Origin-Embedder-Policy: require-corp"); + readfile($indexFile); + exit; + } + } +} + +// 404 fallback +http_response_code(404); +echo "Not Found"; From 6c33bf46dc08e9374eef5d195e8733283b77c31a Mon Sep 17 00:00:00 2001 From: Roham Date: Wed, 24 Dec 2025 00:42:37 +0000 Subject: [PATCH 02/10] -ADDED .HTACCESS TO SUPPORT SUB DIRS --- .htaccess | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..4f93bf3 --- /dev/null +++ b/.htaccess @@ -0,0 +1,47 @@ +# JS files +AddType application/javascript .js + +# WebAssembly files +AddType application/wasm .wasm + +# CSS files +AddType text/css .css + +# Brotli-compressed files +AddEncoding br .br + + + +# Enable rewrite engine +RewriteEngine On + +# Set base path if PHP file is not in root +RewriteBase / + +# If the request is for an existing file or directory, serve it directly +RewriteCond %{REQUEST_FILENAME} -f [OR] +RewriteCond %{REQUEST_FILENAME} -d +RewriteRule ^ - [L] + +# Otherwise, route everything to index.php +RewriteRule ^.*$ index.php [L,QSA] + + +# Correct MIME types +AddType application/javascript .js +AddType application/wasm .wasm +AddType text/css .css + +# Brotli compressed files +AddEncoding br .br + +# Optional: force correct MIME for .js.br or .wasm.br + + ForceType application/javascript + AddEncoding br + + + + ForceType application/wasm + AddEncoding br + \ No newline at end of file From dac7cc2ddda7dc65660952a011ac9a63d7428529 Mon Sep 17 00:00:00 2001 From: Roham Date: Wed, 24 Dec 2025 00:49:03 +0000 Subject: [PATCH 03/10] -UPDATED README --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ad2911..f81d6df 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Web-based port of GTA: Vice City running in browser via WebAssembly. - Python 3.8+ - Dependencies from `requirements.txt` -## Installation +## Installation (if you want to use a public hosting go to PHP) ```bash pip install -r requirements.txt @@ -28,6 +28,10 @@ Server starts at `http://localhost:8000` | `lang` | `en`, `ru` | Game language | | `cheats` | `1` | Enable cheat menu (F3) | +## PHP (NO INSTALL) +If you want to run the game from a hosted environment with `PHP 8.0` or above, just copy the contents of this repo to your desired hosting +By default the `index.php` and `.htaccess` will get the job done. + **Examples:** - `http://localhost:8000/?lang=ru` — Russian version - `http://localhost:8000/?lang=en&cheats=1` — English + cheats @@ -36,6 +40,8 @@ Server starts at `http://localhost:8000` ``` ├── server.py # FastAPI proxy server +├── index.php # php proxy server +├── .htaccess # apache config for php ├── requirements.txt # Python dependencies ├── dist/ # Game client files │ ├── index.html # Main page @@ -103,3 +109,5 @@ Based on open-source re3/reVC project. Not affiliated with Rockstar Games. **Deobfuscated by**: [@Lolendor](https://github.com/Lolendor) **Russian translation:** [GamesVoice](https://www.gamesvoice.ru/) + +**Shared hosting by:** [Rohamgames](https://github.com/rohamgames) From 713f7f26e8a437dd7802612e54139a0ca034d9f7 Mon Sep 17 00:00:00 2001 From: Rohamgames <47294157+Rohamgames@users.noreply.github.com> Date: Wed, 24 Dec 2025 01:18:41 +0000 Subject: [PATCH 04/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dcce74a..c84122c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Web-based port of GTA: Vice City running in browser via WebAssembly. ## Requirements -- Python 3.8+ +- Python 3.8+ or PHP 8.0+ - Dependencies from `requirements.txt` From b51a8c1412b36410da40d9fb32e96eeeb1d65d8a Mon Sep 17 00:00:00 2001 From: Rohamgames <47294157+Rohamgames@users.noreply.github.com> Date: Wed, 24 Dec 2025 01:19:20 +0000 Subject: [PATCH 05/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c84122c..21daba1 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ python server.py Server starts at `http://localhost:8000` -## OPtion 3; Shared Hosting on PHP (NO INSTALL) +## Option 3; Shared Hosting on PHP (Nn installation) If you want to run the game from a hosted environment with `PHP 8.0` or above, just copy the contents of this repo to your desired hosting By default the `index.php` and `.htaccess` will get the job done. From 3711e97b42fe157837956d8374ae17649a355069 Mon Sep 17 00:00:00 2001 From: Alexey Olendor <137941487+Lolendor@users.noreply.github.com> Date: Wed, 24 Dec 2025 20:59:52 +0300 Subject: [PATCH 06/10] Update README.md --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 2381ea7..17087b8 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,6 @@ Web-based port of GTA: Vice City running in browser via WebAssembly. - Python 3.8+ or PHP 8.0+ - Dependencies from `requirements.txt` - -## Installation -======= - ## Setup & Running ### Option 1: Using Docker (Recommended) @@ -54,7 +50,7 @@ python server.py Server starts at `http://localhost:8000` -## Option 3; Shared Hosting on PHP (Nn installation) +### Option 3; Shared Hosting on PHP (Nn installation) If you want to run the game from a hosted environment with `PHP 8.0` or above, just copy the contents of this repo to your desired hosting By default the `index.php` and `.htaccess` will get the job done. From fce2701ab5d023cc065b76bc0be4b506bbcb9768 Mon Sep 17 00:00:00 2001 From: Alexey Olendor <137941487+Lolendor@users.noreply.github.com> Date: Wed, 24 Dec 2025 21:00:50 +0300 Subject: [PATCH 07/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 17087b8..ea2f826 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ python server.py Server starts at `http://localhost:8000` -### Option 3; Shared Hosting on PHP (Nn installation) +### Option 3: Shared Hosting on PHP (No installation) If you want to run the game from a hosted environment with `PHP 8.0` or above, just copy the contents of this repo to your desired hosting By default the `index.php` and `.htaccess` will get the job done. From cd1e5592f5ce12ddd64226ac5b0384ffe5c349f7 Mon Sep 17 00:00:00 2001 From: Alexey Olendor <137941487+Lolendor@users.noreply.github.com> Date: Wed, 24 Dec 2025 21:01:35 +0300 Subject: [PATCH 08/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea2f826..c00981b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Web-based port of GTA: Vice City running in browser via WebAssembly. ## Requirements -- Python 3.8+ or PHP 8.0+ +- Docker or Python 3.8+ or PHP 8.0+ - Dependencies from `requirements.txt` ## Setup & Running From 663031cf653a7573d6c558c32ad33d67d8f4d816 Mon Sep 17 00:00:00 2001 From: Alexey Olendor <137941487+Lolendor@users.noreply.github.com> Date: Wed, 24 Dec 2025 21:16:17 +0300 Subject: [PATCH 09/10] Update README.md --- README.md | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c00981b..17f83e9 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,23 @@ Web-based port of GTA: Vice City running in browser via WebAssembly. - Docker or Python 3.8+ or PHP 8.0+ - Dependencies from `requirements.txt` +## Quick Start + +1. **Clone the repository**: + ```bash + git clone https://github.com/Lolendor/reVCDOS.git + cd reVCDOS + ``` + +2. **Configure Assets** (Optional): + The project can use the **DOS.Zone CDN** by default. However, if you want to use local assets: + * Download your assets into the `vcsky/{fetched, fetched-ru}/{data/..., audio/..., anim/..., models/...}` and `vcbr/{vc-sky-en-v6.data.br, vc-sky-en-v6.wasm.br, vc-sky-ru-v6.data.br, vc-sky-ru-v6.wasm.br}` directories. + +3. **Launch the Application**: + Choose one of the setup methods below: + * **Docker** (Recommended for most users) — fast and isolated. + * **Manual Installation** — for development and customization. + ## Setup & Running ### Option 1: Using Docker (Recommended) @@ -144,11 +161,16 @@ python server.py --port 3000 --custom_saves --login admin --password secret123 - │ ├── vc-sky-en-v6.wasm.br │ ├── vc-sky-ru-v6.data.br │ └── vc-sky-ru-v6.wasm.br -└── vcsky/ # Additional assets (optional) - ├── data/ - ├── audio/ - ├── models/ - └── anim/ +└── vcsky/ # Decompressed assets + ├── fetched/ # English version files + │ ├── data/ + │ ├── audio/ + │ ├── models/ + │ └── anim/ + └── fetched-ru/ # Russian version files + ├── data/ + ├── audio/ + └── ... ``` ## Features From ed2c72319031d4b06fdaaec3b37eab8cd81d8cca Mon Sep 17 00:00:00 2001 From: Alexey Olendor <137941487+Lolendor@users.noreply.github.com> Date: Wed, 24 Dec 2025 21:25:06 +0300 Subject: [PATCH 10/10] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 17f83e9..bcee5c7 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,14 @@ Web-based port of GTA: Vice City running in browser via WebAssembly. ``` 2. **Configure Assets** (Optional): - The project can use the **DOS.Zone CDN** by default. However, if you want to use local assets: - * Download your assets into the `vcsky/{fetched, fetched-ru}/{data/..., audio/..., anim/..., models/...}` and `vcbr/{vc-sky-en-v6.data.br, vc-sky-en-v6.wasm.br, vc-sky-ru-v6.data.br, vc-sky-ru-v6.wasm.br}` directories. - -3. **Launch the Application**: + + By default, the project uses the **DOS Zone CDN**. For local hosting, download and place assets in [(see structure)](#project-structure): + * **Resources:** `vcsky/fetched/` (or `fetched-ru/`) — `data`, `audio`, `anim`, `models` folders. + * **Binaries:** `vcbr/` — `.wasm.br` and `.data.br` files for your chosen language. +4. **Launch the Application**: Choose one of the setup methods below: * **Docker** (Recommended for most users) — fast and isolated. + * **PHP** — Simply upload the folder to your web server (FTP/Hosting). * **Manual Installation** — for development and customization. ## Setup & Running