Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
5f98087
Update proxy.go
smell-of-curry Jul 15, 2024
362dac6
Update player.go
smell-of-curry Jul 15, 2024
b9f4014
Update human.go
smell-of-curry Jul 15, 2024
9d94a57
Added Position check to border
smell-of-curry Jul 15, 2024
3a38063
Remove broken handlers
smell-of-curry Jul 15, 2024
087a436
Add Custom handlers
smell-of-curry Jul 15, 2024
c77c704
up
smell-of-curry Jul 15, 2024
e6ffb1f
Create release.yml
smell-of-curry Jul 16, 2024
79755c7
Update start.bat
smell-of-curry Jul 16, 2024
59b5134
Update release.yml
smell-of-curry Jul 16, 2024
4b9d915
Update release.yml
smell-of-curry Jul 16, 2024
e3e3b69
Update release.yml
smell-of-curry Jul 16, 2024
87199c7
v1.0.7
smell-of-curry Jul 16, 2024
74ecbe9
Update release.yml
smell-of-curry Jul 16, 2024
367df27
Update release.yml
smell-of-curry Jul 16, 2024
97b72c7
Update release.yml
smell-of-curry Jul 16, 2024
c9d67ab
Update release.yml
smell-of-curry Jul 16, 2024
1930ff7
Update config.go
smell-of-curry Jul 16, 2024
20f37a6
Add manifest
smell-of-curry Jul 16, 2024
00e0949
Update utils.go
smell-of-curry Jul 16, 2024
84fde43
Update release.yml
smell-of-curry Jul 16, 2024
25f0295
Update release.yml
smell-of-curry Jul 16, 2024
ef3066a
command handling & logging
smell-of-curry Jul 16, 2024
48024c3
Update availableCommandsHandler.go
smell-of-curry Jul 16, 2024
8789f24
remove logging
smell-of-curry Jul 16, 2024
e9347c9
Update customCommandRegisterHandler.go
smell-of-curry Jul 17, 2024
590dcf0
add 60 second timeout
smell-of-curry Jul 17, 2024
5a64da1
Update proxy.go
smell-of-curry Jul 17, 2024
4b54f82
Update proxy.go
smell-of-curry Jul 17, 2024
f99f2d2
dont close connections after failure
smell-of-curry Jul 18, 2024
e1a7446
Added more comments
smell-of-curry Jul 18, 2024
82c4bcd
Update proxy.go
smell-of-curry Jul 18, 2024
7ac819b
Update proxy.go
smell-of-curry Jul 18, 2024
609b15f
logging and disconnect handler
smell-of-curry Jul 18, 2024
46cf44d
revert back changes, and push ps4 tmp fix
smell-of-curry Jul 18, 2024
d3ab21f
Add reasons for kick
smell-of-curry Jul 18, 2024
b854d4f
Re-do Config reading
smell-of-curry Jul 19, 2024
b053283
Disconnect Listener on error
smell-of-curry Jul 19, 2024
d96d114
use latest gopher tunnel
smell-of-curry Jul 19, 2024
2369b5a
use latest commit
smell-of-curry Jul 19, 2024
3b51759
Fix alot in /commands
smell-of-curry Jul 20, 2024
6ea93ad
Added logging for claims loaded
smell-of-curry Jul 20, 2024
976d60e
Update placeBlockHandler.go
smell-of-curry Jul 20, 2024
469445c
Remove alot of junk
smell-of-curry Jul 20, 2024
95af070
Update and use correct block states
smell-of-curry Jul 20, 2024
9e8e161
set available commands on player data
smell-of-curry Jul 20, 2024
1d699b3
Update human.go
smell-of-curry Jul 20, 2024
749e2b9
Remap how players are fetched
smell-of-curry Jul 20, 2024
c4ad286
Improve listener, add more logging & remove junk
smell-of-curry Jul 20, 2024
f9a85bc
Update session
smell-of-curry Jul 20, 2024
e24dfe7
Use latest gopher tunnel
smell-of-curry Jul 20, 2024
9310847
Lowercase command names
smell-of-curry Jul 22, 2024
cb81553
No longer throw items in claims
smell-of-curry Jul 23, 2024
1ef2446
Create itemComponentHandler.go
smell-of-curry Jul 23, 2024
304fdd8
Delete placeBlockHandler.go
smell-of-curry Jul 23, 2024
ee4a833
Add Item Component Storage
smell-of-curry Jul 23, 2024
5e891a8
Refresh claims every 60 seconds
smell-of-curry Jul 23, 2024
9ab8cdb
Converted `MustReadURL` => `ReadURL`
smell-of-curry Jul 23, 2024
262aae8
Update Gopher Tunnel
smell-of-curry Jul 23, 2024
b88722b
Remove Claim auth input handler
smell-of-curry Jul 24, 2024
628e3e0
Use proper Remote Addr when logging details
smell-of-curry Jul 24, 2024
0f8398e
Handler Listener Close
smell-of-curry Jul 24, 2024
36fd0b3
Reformat Claim Handler
smell-of-curry Jul 25, 2024
5bfaf93
Added Inventory Content Handler
smell-of-curry Jul 25, 2024
d19edad
Create openContainer.go
smell-of-curry Jul 25, 2024
e9d7355
Add Location Logging
smell-of-curry Jul 25, 2024
7c16fc5
Add Container Logging and Managing
smell-of-curry Jul 25, 2024
ed02df8
Add Disconnect Handler
smell-of-curry Jul 25, 2024
c0b29a8
Update settings.json
smell-of-curry Jul 25, 2024
a23bfc5
Add back resource packs & unused data
smell-of-curry Jul 25, 2024
0b44cc9
Update Staff Alert Logging
smell-of-curry Jul 29, 2024
585d068
Update Logging and sleep for DisconnectPlayer
smell-of-curry Jul 29, 2024
3958b9b
Use `smellofcurry` Gopher Tunnel Branch
smell-of-curry Jul 29, 2024
b3f286a
update to new gopher tunnel
smell-of-curry Jul 29, 2024
c3cc4d5
Store Commands & Components on World Instead per player
smell-of-curry Jul 30, 2024
2e2cb5c
Add clearing of container cache after close
smell-of-curry Jul 30, 2024
a92be54
Remove Scoreboard storage
smell-of-curry Jul 30, 2024
ece3dba
Remove Form Handler
smell-of-curry Jul 30, 2024
8bf7d88
Remove useless data
smell-of-curry Jul 30, 2024
175795b
Add PlayerList Manager for managing player UUIDS
smell-of-curry Jul 31, 2024
c88c2b1
Delete textHandler.go
smell-of-curry Jul 31, 2024
43399b0
Get IdentityData from playerlist
smell-of-curry Jul 31, 2024
7078e49
Remove Items, and Custom Block storage per player
smell-of-curry Jul 31, 2024
3d0b1e6
Move GetItemEntry To world
smell-of-curry Jul 31, 2024
a969c17
Add PlayerList Manager for passing in XUID
smell-of-curry Jul 31, 2024
13d6838
meta
smell-of-curry Jul 31, 2024
a82021f
Update Gopher tunnel fork
smell-of-curry Aug 4, 2024
14d8b95
Fix data reset when switching devices
smell-of-curry Aug 4, 2024
53a02dd
Properly map error messages when failing to connect
smell-of-curry Aug 4, 2024
eda9535
Remove world seed from being sent
smell-of-curry Aug 4, 2024
a6236a0
Update player_input_handler.go
smell-of-curry Aug 4, 2024
c033d22
Remove OPs from config
smell-of-curry Aug 5, 2024
60b4d8c
Remove Command manager
smell-of-curry Aug 5, 2024
bb0b182
Remove Bot & RCON
smell-of-curry Aug 5, 2024
687cf9e
Remove Error Log Configuration
smell-of-curry Aug 5, 2024
a4ea10e
Create config.toml.example
smell-of-curry Aug 5, 2024
a4effb4
Remove Unused Code
smell-of-curry Aug 5, 2024
ca80cc1
Update README.md
smell-of-curry Aug 5, 2024
e12cc96
Remove Port and Merge with Host
smell-of-curry Aug 6, 2024
f7e6223
Update Gophertunnel to v1.39.3
smell-of-curry Aug 6, 2024
191252e
Create a Linux Executable too
smell-of-curry Aug 6, 2024
8a2fc6c
fix asset path
smell-of-curry Aug 6, 2024
19ab161
Fix name
smell-of-curry Aug 6, 2024
4a632a8
Update proxy.go
smell-of-curry Aug 7, 2024
a6cf5aa
Add `PackPaths` to `Resouces` config
smell-of-curry Aug 9, 2024
9253946
Ensure lowercased dynamic enum type name
smell-of-curry Aug 9, 2024
e639626
Added IsDisconnected to prevent double calls.
smell-of-curry Aug 9, 2024
7f2c816
Added Alert if Listener Closes
smell-of-curry Aug 9, 2024
540a803
Remove Packet Logging
smell-of-curry Aug 9, 2024
b3328cc
Add Propert Disconnect Messages
smell-of-curry Aug 9, 2024
42b75f1
Fix Staff Alerts for duplication
smell-of-curry Aug 9, 2024
cfd0b05
Standardize usage of `log.Logger`
smell-of-curry Aug 10, 2024
3ab5afc
Only send open container warning when items in containers >0
smell-of-curry Aug 10, 2024
b8132ca
Converted Container logging to nice escaped.
smell-of-curry Aug 10, 2024
cb15d6a
Remove Unused Handlers
smell-of-curry Aug 10, 2024
00bc3ff
Add Blocking of block actions in claims
smell-of-curry Aug 10, 2024
7ca6405
Redo Playerlist Manager
smell-of-curry Aug 10, 2024
358fe53
Fix broken handling of events from gophertunnel
smell-of-curry Aug 10, 2024
0783716
Add `playerlist.json.lock` to gitignore
smell-of-curry Aug 10, 2024
201d71d
Add Deferred Unlocking & Logging
smell-of-curry Aug 10, 2024
40a7b79
Add Debug Logging & Proper Mu Unlocking
smell-of-curry Aug 10, 2024
c7345e2
Properly Prevent Deadlock
smell-of-curry Aug 10, 2024
0283f8b
Ensure Unlock After returning
smell-of-curry Aug 10, 2024
e0ccfa2
Add a Secured Slots System
smell-of-curry Aug 10, 2024
f7a3b6d
Add server pinging to ensure status
smell-of-curry Aug 10, 2024
9ec9410
Use `Stdout` as default log.
smell-of-curry Aug 10, 2024
ed59c95
Update Gophertunnel to fix missing events
smell-of-curry Aug 10, 2024
a939e74
Auto Init Whitelist
smell-of-curry Aug 10, 2024
532b538
Remove Error Log in establishing `serverCnn`
smell-of-curry Aug 10, 2024
09c0f27
Only log client read error if its not disconnect
smell-of-curry Aug 10, 2024
cf4e7c6
Add Mu Locking & Marshaling just `Players`
smell-of-curry Aug 10, 2024
47d6358
Pass in Logrus Logger into Gophertunnel
smell-of-curry Aug 12, 2024
89ea7c8
Update Server Full Messages
smell-of-curry Aug 12, 2024
6655ec6
Only send Handle Packet errors if not disconnect.
smell-of-curry Aug 12, 2024
bf1f98e
Update Gopher Tunnel
smell-of-curry Aug 12, 2024
ca4c2f2
Add nil pointer handling for PacketHandlers
smell-of-curry Aug 12, 2024
65468ae
Pass LoadHandlers as a function
smell-of-curry Aug 12, 2024
eff6726
Add Recovering if panic occurs when handling packet
smell-of-curry Aug 12, 2024
733a0d6
Call Packet Handler Instead of passing
smell-of-curry Aug 12, 2024
9e7823e
Return if error occurs when reading packet
smell-of-curry Aug 12, 2024
636a079
Pass in h not has a function
smell-of-curry Aug 12, 2024
c96f53b
Add panic recovering when accepting connections
smell-of-curry Aug 12, 2024
cf1c910
Properly send staff alert if listener closes
smell-of-curry Aug 12, 2024
4adbb74
Change Default Compression Back to Flate
smell-of-curry Aug 12, 2024
f541cb0
Add Verification Of error before logging
smell-of-curry Aug 12, 2024
ccc50b7
Change ping error to WARN
smell-of-curry Aug 13, 2024
73cedff
Add Warning when reading resource packs
smell-of-curry Aug 13, 2024
f529479
Create Proper Error when starting listener
smell-of-curry Aug 13, 2024
3b48672
Log Error when closing listener
smell-of-curry Aug 13, 2024
9f64f4d
Add greater details with a listener accept error
smell-of-curry Aug 13, 2024
4b23de7
Add Panic Recovering when handling conns
smell-of-curry Aug 13, 2024
36ff4c4
Change Dial timeout to 30 seconds
smell-of-curry Aug 13, 2024
c38ff08
Reconfigured canJoinServer base
smell-of-curry Aug 13, 2024
9a3fa33
Exported initalizeConnection externally
smell-of-curry Aug 13, 2024
3df316d
Standardize Packet Error Handling
smell-of-curry Aug 13, 2024
d9ddc4f
Export packetHandling to add simplification.
smell-of-curry Aug 13, 2024
f6f9b72
No map to Minecraft conn when getting remove addr
smell-of-curry Aug 13, 2024
ff60d44
Update Gopher Tunnel
smell-of-curry Aug 13, 2024
5c69e0d
Update to v1.20.20
smell-of-curry Aug 14, 2024
bfa659f
Add `Stop` to Repeating Task
smell-of-curry Aug 17, 2024
8a2cdf0
Hold Resource Packs in cache
smell-of-curry Aug 17, 2024
ae17c8b
Added `Shutdown` and `ctx` safe close handling.
smell-of-curry Aug 17, 2024
bdeeb17
Return Error if failed to create foreign status
smell-of-curry Aug 17, 2024
da315c9
Only Disconnect once if panic
smell-of-curry Aug 17, 2024
3ace2ca
Add proper returning if packet fails
smell-of-curry Aug 17, 2024
27569c6
`handlePacketError` no longer returns
smell-of-curry Aug 17, 2024
ccab7a5
Add Proper Disconnect when handling error
smell-of-curry Aug 17, 2024
beab45d
Update proxy.go
smell-of-curry Aug 17, 2024
be2d63e
Remove proxy-sided commands
smell-of-curry Aug 17, 2024
ba42931
Update settings.json
smell-of-curry Aug 17, 2024
5c3d949
update gophertunnel v
smell-of-curry Aug 17, 2024
f7df0ee
Added Standardized SendJsonToDiscord
smell-of-curry Aug 20, 2024
a9e2f69
Added `GetXboxIconLink`
smell-of-curry Aug 20, 2024
4b4e9b8
Added logging when reading resource pack
smell-of-curry Aug 20, 2024
d504e8c
Added chat log handling
smell-of-curry Aug 20, 2024
937fb66
Update Gopher tunnel
smell-of-curry Aug 20, 2024
4479b24
Update Gopher Tunnel
smell-of-curry Aug 20, 2024
25904e7
Added Player Ping title to be sent every tick
smell-of-curry Aug 23, 2024
47c7e30
Added a XUID security check when joining
smell-of-curry Aug 23, 2024
b7a329f
Added Retry Attempts with 429 error handling
smell-of-curry Aug 23, 2024
4d3719c
Only send Ping Data every 20 ticks.
smell-of-curry Aug 24, 2024
b90d496
Dont wait 5 seconds to restart listener
smell-of-curry Aug 24, 2024
e1d72aa
Update Gopher Tunnel
smell-of-curry Aug 27, 2024
f53a331
Update Gophertunnel & Go-raknet
smell-of-curry Aug 27, 2024
0fddabf
Update go-raknet
smell-of-curry Aug 27, 2024
853dc88
Update Go-raknet
smell-of-curry Aug 27, 2024
895f971
Add Entity Tracking
smell-of-curry Sep 2, 2024
2295cd1
Add Resource Pack Lang Handling
smell-of-curry Sep 2, 2024
ad36298
Added Pokemon Name Tag Translations
smell-of-curry Sep 2, 2024
b5f5b76
Track Entities in proxy
smell-of-curry Sep 2, 2024
b5d40bb
Added `ParseCommentedJSON` to utils
smell-of-curry Sep 2, 2024
f18adea
update
smell-of-curry Sep 2, 2024
fd3b189
Add Mutex Locking to Entity Management
smell-of-curry Sep 2, 2024
f461a3f
Remove Logging for open container
smell-of-curry Sep 3, 2024
79fe5fd
Fix 429 Errors When fetching XBL Profile
smell-of-curry Sep 3, 2024
cfcf882
Update entity.go
smell-of-curry Sep 3, 2024
e618ccf
Fix Pokémon Names with Spaces
smell-of-curry Sep 5, 2024
1a470f4
Change Fatal to Error to prevent crash
smell-of-curry Sep 5, 2024
7e469c1
Added Configurable FlushRate
smell-of-curry Sep 15, 2024
a845a24
Fix nick names not displaying
smell-of-curry Sep 15, 2024
abdbbeb
Fix un needed error messages.
smell-of-curry Sep 15, 2024
0f52dd1
Upupdate raknet and gopher tunnel
smell-of-curry Sep 15, 2024
0342512
Update settings.json
smell-of-curry Sep 15, 2024
9a7ab17
update gopher tunnel
smell-of-curry Sep 21, 2024
d68d142
fix Container ID
smell-of-curry Sep 21, 2024
ed54934
merge
smell-of-curry Sep 21, 2024
af8d99e
Close Server Conn when getting error
smell-of-curry Oct 17, 2024
afe46a0
Update Modules
smell-of-curry Oct 17, 2024
1c0b593
Update to v1.21.40
smell-of-curry Oct 24, 2024
b8f92b3
Update Gopher Tunnel
smell-of-curry Nov 2, 2024
727a4af
Add debug stack to proxy crashes
smell-of-curry Nov 8, 2024
d84e7e9
Update Gopher tunnel
smell-of-curry Nov 21, 2024
29037c8
Refactor conn handling
smell-of-curry Nov 21, 2024
a8fd4f2
Add nil Checks to conn handler
smell-of-curry Dec 5, 2024
21f1875
Update Gopher tunnel
smell-of-curry Dec 5, 2024
3f591ea
Update Gopher tunnel
smell-of-curry Dec 5, 2024
bf44f50
Update Gopher Tunnel to Fix BitSet Issue
smell-of-curry Dec 6, 2024
6b0562f
Remove position update for border
smell-of-curry Dec 12, 2024
a9a46e6
Fix in-proper disconnect when dial timeout
smell-of-curry Dec 12, 2024
5af21ac
Update Gopher Tunnel
smell-of-curry Dec 14, 2024
24d0fc2
Update to v1.21.60
smell-of-curry Feb 11, 2025
75b9dc7
Convert to slog.Logger
smell-of-curry Mar 25, 2025
9b773d1
Update Gopher tunnel
smell-of-curry Mar 25, 2025
1fb8542
Add Safety to delayed tasks
smell-of-curry Mar 25, 2025
bd09b02
Remove unused world functions
smell-of-curry Mar 25, 2025
7db89e2
Add Cleanup task system
smell-of-curry Mar 25, 2025
7053676
Broke playerList saving up
smell-of-curry Mar 25, 2025
cce3c1f
Add safety to starting/stopping
smell-of-curry Mar 25, 2025
f9642c6
Clean sendDebug
smell-of-curry Mar 25, 2025
e0abf16
Update customCommandRegisterHandler.go
smell-of-curry Mar 25, 2025
ca5201c
Update config.toml.example
smell-of-curry Mar 25, 2025
ce032b1
Update settings.json
smell-of-curry Mar 25, 2025
73bc46b
fix errors
smell-of-curry Mar 25, 2025
f9c75a1
Update Gopher Tunnel
smell-of-curry Mar 29, 2025
b58111c
Added Profiling
smell-of-curry Mar 30, 2025
edaf5b1
Add Sentry Logging
smell-of-curry Mar 30, 2025
aeb5bc0
Clean up config.toml Handling
smell-of-curry Apr 17, 2025
6999864
Add EXP Backoff to xbox API fetching
smell-of-curry Apr 17, 2025
1897853
Update XUID Passing with Encryption and Name
smell-of-curry Apr 28, 2025
a0376bb
Fix Race with playerlist
smell-of-curry May 5, 2025
dbd8ed9
update to v1.21.80
smell-of-curry May 8, 2025
5e51cf8
update to proper gopher version
smell-of-curry May 9, 2025
fb7c8de
update versions
smell-of-curry May 14, 2025
ed0ffab
Fix PS5 Issues by updating go-raknet
smell-of-curry May 18, 2025
fc48c73
update go-raknet
smell-of-curry May 26, 2025
115c5f0
update gophertunnel and raknet
smell-of-curry May 28, 2025
e6e9fff
update gopher ver
smell-of-curry Jun 18, 2025
aac9ae0
update gopher tunnel
smell-of-curry Jun 19, 2025
5f8b178
update gopher tunnel
smell-of-curry Jul 4, 2025
e82cfaa
Add archive note
smell-of-curry Jul 16, 2025
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
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build and Release

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.22.4"

- name: Build Windows executable
run: GOOS=windows GOARCH=amd64 go build -o vanilla-proxy-win.exe .

- name: Build Linux executable
run: GOOS=linux GOARCH=amd64 go build -o vanilla-proxy-linux .

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false

- name: Upload Windows Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./vanilla-proxy-win.exe
asset_name: vanilla-proxy-win.exe
asset_content_type: application/octet-stream

- name: Upload Linux Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./vanilla-proxy-linux
asset_name: vanilla-proxy-linux
asset_content_type: application/octet-stream
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/whitelist.json
/config.toml
/config.toml
/playerlist.json
/playerlist.json.lock
24 changes: 24 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"cSpell.words": [
"Debugf",
"Debugln",
"Errorln",
"gophertunnel",
"hujson",
"iconcache",
"Infoln",
"logrus",
"mathgl",
"Overworld",
"playerlist",
"pokeb",
"pokebedrock",
"raknet",
"Respawn",
"Runtimes",
"sandertv",
"Warnf",
"Warnln",
"XUID"
]
}
104 changes: 83 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,94 @@
## How to start a proxy server
1. Download and install [Go](https://go.dev/dl/)
2. Download and run Minecraft [Bedrock Dedicated Server](https://www.minecraft.net/en-us/download/server/bedrock).
> [!WARNING]
> # This Project has been Archived, and is no longer maintained. For a more up to date proxy, with way more features, please use [GoBDS](https://github.com/smell-of-curry/gobds)

# Vanilla Proxy

Vanilla Proxy is a simple proxy servers that enabled Packet management and protection of BDS server attacks through a end to end proxy system.

## Overview

1. You have all the advantages of the original BDS.
2. You can modify and cancel any packets passing through the proxy using the handler system.
3. You can organize the protection of your server from DDOS attacks.
4. You can set the boards of the world. Blocks outside the border will not be displayed to the player. The coordinates of the corner must be divided by 16 so that the borders are displayed correctly.
5. Support for a whitelist that can store the player's xbox id(xuid).
6. A Player List manager that stores a players `SelfSignedID` ensuring as long as a player is signed into a XBL account, they wont get there player reset.
7. A priority slot system, that allows you to block off specific slots to be restricted for certain players in whitelist.

## Getting Started

```You must set online-mode=false in BDS server.properties```
> [!IMPORTANT]
> You must configure BDS `server.properties` to disable `online-mode` and `client-side-chunk-generation-enabled`

1. Download and install [Go](https://go.dev/dl/)
2. Download and run Minecraft [Bedrock Dedicated Server](https://www.minecraft.net/en-us/download/server/bedrock).
3. Run in the console:

```
git clone https://github.com/HyPE-Network/vanilla-proxy
git clone https://github.com/smell-of-curry/vanilla-proxy
cd vanilla-proxy
go run main.go
```

>You can also customize config.yml for yourself
## Configuration

## Overview
1. You have all the advantages of the original BDS.
2. You can modify and cancel any packets passing through the proxy using the handler system.
3. You can organize the protection of your server from ddos attacks.
4. You can set the boards of the world. Blocks outside the border will not be displayed to the player. The coordinates of the corner must be divided by 16 so that the borders are displayed correctly.
5. Support for a whitelist that can store the player's xbox id(xuid).
6. You can use a special bot for Windows with operator capabilities or send commands directly to screen on your Linux server. Screen must have the name of the original server port (for example 19132).
7. You can use rcon to execute commands automatically (let's say /whitelist add "nickname").
8. A convenient API for creating forms, commands and fake inventories that are processed on the proxy side.
Configuration in the Vanilla Proxy is all managed through the [config.toml](config.toml.example). This file holds all details including database, server connection, api, world border and more.
To get started, copy the [config.toml.example](config.toml.example) file and rename it to `config.toml`. Inside this file you can first set the `Connection` properties.

### Connection

These are the most important as this is what the proxy uses to send the upstream connections too.

- `ProxyAddress` - This is the address that the THIS proxy server will run on. This is the address that you want people to connect too.
- `RemoteAddress` - This is the address that the BDS server is running on. Ensure that the BDS server is running on a different port.

### Api

This vanilla proxy uses a API to fetch and set players connection details. Details such as connection IP, name, and XUID are saved for moderation capabilities.

- `ApiHost` - This is the API host, something like `https://pokebedrock.com` would work.
- `ApiKey` - This is a authentication token which will be passed as a password.

### Database

This proxy uses a database to fetch claims, and local player details that are important for operations. This must be managed to ensure the claims work correctly.

- `Host` - This is the host of the database, usually localhost `http://127.0.0.1`
- `Key` - This is the authentication key, which is passed as a password to ensure a authenticated session.
- `Name` - This is the database name you want to connect too, it would switch between servers, something like `black`, `white`, `testing` is used.
- `Port` - This is the database port that the server is running on, which will attach to `Host` when creating a request.

### Logging

This proxy uses a bit of logging so that the discord and the staff team are updated on the server details. Details about sign changes, and failed to ping alerts get sent to discord webhooks to ensure the staff is alerted.

- `DiscordChatLogsWebhook` - this is the endpoint you want chat logs sent too.
- `DiscordCommandLogsWebhook` - this is the endpoint where when players use commands get sent too.
- `DiscordSignLogsWebhook` this is the destination for where sign edit logs should be sent.
- `DiscordStaffAlertsWebhook` - this is a endpoint for staff alerts, things like failed to ping database, etc.

### Resources

This is still a work in progress feature, however this configuration can allow use of custom resource packs to be downloaded by players.

- `PackURLs` - this is a string array of URLs that the players must download and activate to play.
- `PackPaths` - this is a string array of pack paths that link to a folder that the player must download to play (used for local development).

### Server

Server holds less essential server configuration that changes connection aspects.

- `SecuredSlots` - A count of how many slots to reduce from BDS max player count, that will be reserved for players in the whitelist allowing a priority slot system.
- `DisableXboxAuth` - specifies if authentication of players that join is disabled. If set to true, no verification will be done to ensure that the player connecting is authenticated using their XBOX Live account.
- `Prefix` - Prefix is used to specify the current server in error logs. For example `TESTING` would be sent with a logging endpoint to tell readers this came from `TESTING` server.
- `ViewDistance` - Manages the distance players can view through the chunk handler. This is important for large servers.
- `Whitelist` - If the whitelist is turned on and limiting players from joining. Whitelist can be managed through the (whitelist.json)[whitelist.json] file.
- `FlushRate` - The flush rate of the packets, default is `50` == `time.Second / 20`, the lower the value, the more CPU usage.

### WorldBorder

## Examples
Example of a simple server with survival - [vanilla-survival](https://github.com/HyPE-Network/vanilla-survival)
> The world has borders, there is a ban on placing obsidian blocks in nether (players can teleport to distant coordinates using nether portals).
> This prohibition is made by processing the breaking of the block.
The proxy system comes with a pre-built world border that limits chunks, entities, and ticking from happening outside the world border. This is important for large servers and servers that pregenerate chunks.

## Recommendations
You can block the BDS server port using a firewall so that unauthorized players cannot enter the main server by bypassing the proxy.
- `Enabled` - if the world border is enabled.
- `MaxX` & `MaxZ` - Holds the Max location in the positive direction for the border, example `6000`
- `MinX` & `MinZ` - Holds the Minimum location in the negative direction for the border, example `-6000`
46 changes: 46 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[Connection]
ProxyAddress = "0.0.0.0:19132" # The port that players will connect to
RemoteAddress = "0.0.0.0:19134" # The port that the BDS server is hosted on

[Server]
Whitelist = true # Whether to enable whitelisting
SecuredSlots = 5 # The amount of secured slots on the server for only whitelisted players
ViewDistance = 10 # The view distance for players
DisableXboxAuth = false # Whether to disable Xbox authentication (This cant be enabled currently)
FlushRate = 10 # The flush rate for the server
Prefix = "TESTING" # The prefix for the server, used for logging and discord messages

[WorldBorder]
Enabled = true # Whether to enable the world border
MinX = -12000 # The minimum X coordinate for the world border
MaxX = 12000 # The maximum X coordinate for the world border
MinZ = -12000 # The minimum Z coordinate for the world border
MaxZ = 12000 # The maximum Z coordinate for the world border

[Api]
ApiHost = "https://pokebedrock.com" # The host for the moderation API
ApiKey = "xxxxxxxx-xxxxxxxx-xxxxxxxx" # The API key for the moderation API
XboxApiKey = "xxxxxxxx-xxxxxxxx-xxxxxxxx" # The Xbox API key for profile picture fetching

[Resources]
PackURLs = [] # Urls of resource packs to require downloaded by players
PackPaths = [] # Paths of resource packs to require downloaded by players

[Database]
Host = "http://127.0.0.1:3000" # The host for the database
Key = "xxxxxxxx-xxxxxxxx-xxxxxxxx" # The key for the database
Name = "testing" # The name of the database (Should be close to Server.Prefix)

[Encryption]
Key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # The key for the encryption

[Logging]
# Enables Discord logging for chat, command and sign logs
DiscordLoggingEnabled = false
DiscordChatLogsWebhook = "https://discord.com/api/webhooks/1111111111111111/xxxxxxxx-xxxxxxxx-xxxxxxxx"
DiscordCommandLogsWebhook = "https://discord.com/api/webhooks/1111111111111111/xxxxxxxx-xxxxxxxx-xxxxxxxx"
DiscordSignLogsWebhook = "https://discord.com/api/webhooks/1111111111111111/xxxxxxxx-xxxxxxxx-xxxxxxxx"
DiscordStaffAlertsWebhook = "https://discord.com/api/webhooks/1111111111111111/xxxxxxxx-xxxxxxxx-xxxxxxxx"
ProfilerHost = "127.0.0.1:19135" # The host for the profiler to view the server performance
# SentryDsn is optional - remove or leave empty to disable Sentry error tracking
SentryDsn = "https://[email protected]/xxxxxxx"
80 changes: 80 additions & 0 deletions custom_handlers/availableCommandsHandler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package custom_handlers

import (
"strings"

"github.com/HyPE-Network/vanilla-proxy/proxy"
"github.com/HyPE-Network/vanilla-proxy/proxy/player/human"
"github.com/sandertv/gophertunnel/minecraft/protocol"
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
)

type AvailableCommandsHandler struct {
}

type CommandRequestHandler struct {
}

// RemoveCommands removes a list of specified commands from the list of available commands.
func RemoveCommands(commands []protocol.Command, remove []string) []protocol.Command {
removeMap := make(map[string]bool)
for _, cmd := range remove {
removeMap[cmd] = true
}

filteredCommands := make([]protocol.Command, 0, len(commands))
for _, command := range commands {
if !removeMap[command.Name] {
filteredCommands = append(filteredCommands, command)
}
}

return filteredCommands
}

func (AvailableCommandsHandler) Handle(pk packet.Packet, player human.Human) (bool, packet.Packet, error) {
dataPacket := pk.(*packet.AvailableCommands)

// Define an array of command names to remove
commandsToRemove := []string{"me", "tell"}
dataPacket.Commands = RemoveCommands(dataPacket.Commands, commandsToRemove)

proxy.ProxyInstance.Worlds.SetBDSAvailableCommands(dataPacket)

return true, dataPacket, nil
}

func (CommandRequestHandler) Handle(pk packet.Packet, player human.Human) (bool, packet.Packet, error) {
dataPacket := pk.(*packet.CommandRequest)
playerData := player.GetData().GameData

var command = strings.ToLower(strings.Split(dataPacket.CommandLine[1:], " ")[0])

if command == "me" || command == "tell" || command == "w" || command == "msg" {
player.SendMessage("§cThe command /" + command + " is disabled!")
player.PlaySound("note.bass", playerData.PlayerPosition, 1, 1)
return false, pk, nil
}

minecraftCommands := proxy.ProxyInstance.Worlds.BDSAvailableCommands.Commands
// Check if {command} is a name inside {minecraftCommands}
for _, cmd := range minecraftCommands {
if cmd.Name == command {
return true, pk, nil
}
}

// Command should be a custom `-` command
textPk := &packet.Text{
TextType: packet.TextTypeChat,
NeedsTranslation: false,
SourceName: player.GetName(),
Message: "-" + strings.TrimPrefix(dataPacket.CommandLine, "/"),
Parameters: []string{},
XUID: player.GetSession().IdentityData.XUID,
PlatformChatID: "",
}
player.DataPacketToServer(textPk)

return false, dataPacket, nil
}
49 changes: 49 additions & 0 deletions custom_handlers/chatLogging.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package custom_handlers

import (
"fmt"
"strings"

"github.com/HyPE-Network/vanilla-proxy/proxy"
"github.com/HyPE-Network/vanilla-proxy/proxy/player/human"
"github.com/HyPE-Network/vanilla-proxy/utils"
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
)

type ChatLoggingHandler struct{}

func (h ChatLoggingHandler) Handle(pk packet.Packet, player human.Human) (bool, packet.Packet, error) {
dataPacket := pk.(*packet.Text)

// Only care if player is sending message
if dataPacket.TextType != packet.TextTypeChat {
return true, pk, nil
}

// Check if its a packet from the client
if dataPacket.SourceName != player.GetName() {
return true, pk, nil
}

// Ignore commands
if strings.HasPrefix(dataPacket.Message, "-") || strings.HasPrefix(dataPacket.Message, "/") {
return true, pk, nil
}

avatar_url, err := utils.GetXboxIconLink(player.GetSession().IdentityData.XUID, proxy.ProxyInstance.Config.Api.XboxApiKey)
if err != nil {
avatar_url = "https://media.forgecdn.net/avatars/121/268/636409261203329160.png"
}

// Log message to discord.
utils.SendJsonToDiscord(proxy.ProxyInstance.Config.Logging.DiscordChatLogsWebhook, map[string]any{
"username": fmt.Sprintf("[%s] %s", proxy.ProxyInstance.Config.Server.Prefix, player.GetName()),
"avatar_url": avatar_url,
"content": dataPacket.Message,
"allowed_mentions": map[string]any{
"parse": []string{},
},
})

return true, pk, nil
}
Loading