From 32080028d6e47857c404f28f5425523232ffaf3a Mon Sep 17 00:00:00 2001 From: anavoi Date: Sat, 15 Mar 2025 21:34:59 +0100 Subject: [PATCH 1/7] docs: clarify readme and add new instructions --- README.md | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 4ba11ed..2e19ad2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # GBSU (Gang Beasts Server Utility) -This mod allows you to connect to a Gang Beast server in recent versions (through LAN or Internet) by utilizing developer methods found in the game assembly. +This mod allows you to connect to a Gang Beasts server in recent versions (through LAN or Internet) by utilizing developer methods found in the game assembly. **NOTICE: This is not a "Cement" mod, and we don't want to be affiliated with their developers. This mod is standalone, and will work best on its own!** @@ -8,48 +8,46 @@ This mod allows you to connect to a Gang Beast server in recent versions (throug - Custom score handling made by the server (we don't want to use the game's score handler) # Installation -The mod is made for the game version **1.17.39_WS_8af7688** running on Unity **v2020.3.5.8426922** (check your version in the Settings menu in-game) -Other versions *MIGHT* work with the mod. Try at your own risk.* - -1. Check whether your game is Mono or IL2CPP: Go to 'Gang Beasts_Data' - - If you have a il2cpp_data folder: your game is **IL2CPP** - - If you have a folder called `MonoBleedingEdge` or the `Gang Beasts_Data/Managed` folder contains a file called 'Assembly-CSharp.dll': your game is **Mono** - -2. **Follow the instructions based on the game type:** +1. Check your game version in the "Settings" menu in-game. If the version is **1.17.39_WS_8af7688**, we fully support it. +2. Check whether your game is Mono or IL2CPP: Go to 'Gang Beasts_Data' + - If you have a folder called `MonoBleedingEdge` or the `Gang Beasts_Data/Managed` folder contains a file called 'Assembly-CSharp.dll': your game is **Mono**. Continue to [Mono instructions](#mono). + - If you have a il2cpp_data folder: your game is **IL2CPP**. Continue to [IL2CPP instructions](#il2cpp). ## Mono -Go to https://github.com/BepInEx/BepInEx/releases and get the latest stable release for Mono x64 (on Windows). - -1. As of March 2025, what we recommend doing is getting `BepInEx_win_x64_5.4.23.2.zip`. -2. Extract the zip file contents into your root game folder (not in the 'Gang Beasts_Data' folder!) +1. [Download the latest **BepInEx 5 stable** release for Mono x64](https://github.com/BepInEx/BepInEx/releases). As of March 2025, we recommend getting `BepInEx_win_x64_5.4.23.2.zip` +2. Extract the zip file contents into your root game folder (where the Gang Beasts.exe file is, and not in the 'Gang Beasts_Data' folder!) 3. Launch the game once. -4. Get the mod from our releases page. +4. Get the mod from our [releases page](https://git.gaboule.com/Gaboule/GBSU/releases). 5. Put the .dll file in the `BepInEx/plugins` folder. 6. Launch the game with launch arguments `-ip 1.2.3.4` and `-port 5999` with the IP address and port of the server you want to host or connect to. -7. You're good to go! Learn how to use the mod in [usage](#usage) + - To set those arguments on Steam, [please refer to this guide](https://help.steampowered.com/en/faqs/view/7D01-D2DD-D75E-2955). +7. You're good to go! Learn how to use the mod in [usage](#usage). ## IL2CPP -**WIP**: The mod will be ported to MelonLoader and recent game versions in the future. +**WIP**: You're currently out of luck! The mod doesn't support your game version at the moment. It will be ported to MelonLoader in the future. Try downgrading your game by getting older versions in Steam Betas or by using [DepotDownloader](https://github.com/SteamRE/DepotDownloader). # Usage Press `Right Shift` to open the mod GUI. Because of how the game is made, you need to be very careful when executing the steps else you will need to restart it. (will be fixed in future versions) ## Server (host) -1. Open the mod menu and press **Host** while you're in the main menu. -2. Don't pay attention to what's displayed on the game. It will be an infinite loading screen after the first round. +### Setting up the server +1. Open the `Gang Beasts_Data` folder in the "server" game instance files. +2. Create two new folders: `Config/Rotation` +3. Download the [one of the config files](https://git.gaboule.com/Gaboule/GBSU/src/branch/main/docs/configs) and place it inside the `Rotation` folder. +4. Rename the file to `config.json` + +### Configuring your custom server settings +* If you set `"random": true`, the map order will be randomized. +* Some maps may have different names in-game compared to their actual titles. Make sure to refer to the [`allmaps` configs](https://git.gaboule.com/Gaboule/GBSU/src/branch/main/docs/configs) for the map names. + +### Launching the server +Once the config file is in place, host your server by pressing the **Host** button in the mod menu. Don't pay attention to what's displayed on the game. It will be an infinite loading screen after the first round. ## Client (player) 1. In the game menu, choose **Online**. -2. Make sure to use a different color than your friends. +2. If you're planning to team up with friends, make sure your [server config]() is set to the `gang` gamemode and choose a shared color. Otherwise, use a different color than your friends. 3. Open the mod menu and press **Join**. -# Known Issues -- Scores tab on the server is expected be wrong. This is a temporary implementation and the scores will be reworked. -- The server is not headless. -- If you want to play on your server, you need to launch a different game instance. It is not possible to connect to the server after launching it at the moment. -- Getting the current scene isn't the most efficient way at the moment. - - # Troubleshooting ## I press the Host/Join button and nothing works! 1. Make sure you're in Online mode if you're **joining** a server. From 0fe4de92faf2291b8f8141cf5a23a928ebfcfef6 Mon Sep 17 00:00:00 2001 From: anavoi Date: Sat, 15 Mar 2025 21:40:32 +0100 Subject: [PATCH 2/7] style: in-game guide formatting Make the in-game guide look nicer by formatting Add link to source code for further reference --- Addons/GBSUGui.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Addons/GBSUGui.cs b/Addons/GBSUGui.cs index fdd06f2..0dde94c 100644 --- a/Addons/GBSUGui.cs +++ b/Addons/GBSUGui.cs @@ -70,15 +70,15 @@ public class GBSUGui : MonoBehaviour GUI.skin.label.alignment = TextAnchor.UpperLeft; GUILayout.Label($@"==Guide== -CLI arguments have to be set to join or host: -ip, -port, -servername, -serverpassword +Set CLI arguments: -ip, -port, -servername, -serverpassword [Hosting] 1. Create a config in Gang Beasts_Data/Config/Rotation/config.json -2.Press the 'Host' button while in the Main Menu. +2. Press the 'Host' button while in the Main Menu [Joining] 1. Go to Online -2. Press the 'Join' button."); +2. Press the 'Join' button"); if (GUI.Button(new Rect(320f, 10f, 55f, 30f), "KILL")) { Application.Quit(0); @@ -139,14 +139,18 @@ CLI arguments have to be set to join or host: -ip, -port, -servername, -serverpa QualitySettings.vSyncCount = vsync_switch; } - GUI.Label(new Rect(20f, 365f, 365f, 400f), $@"Current map: {currentmap} + GUI.Label(new Rect(20f, 365f, 365f, 400f), $@" + +Current map: {currentmap} Lobby State: {LobbyManager.Instance.LobbyStates.SelfState} Game State: {_internalCurrentState} Vsync: {QualitySettings.vSyncCount} Target FPS: {Application.targetFrameRate} {UpdateScoreDisplay()} -Made with <3 by anavoi at Gaboule Community (gaboule.com)"); +Made with <3 by anavoi at Gaboule Community (gaboule.com) +Free and open-source software under GPLv3. Our source code is availaible at git.gaboule.com/Gaboule/GBSU +Please refer to the documentation for more information."); GUI.DragWindow(new Rect(0, 0, 10000, 10000)); } From 7af5036fb174516b5b956e8a393cba58bf9d49d1 Mon Sep 17 00:00:00 2001 From: anavoi Date: Sat, 15 Mar 2025 21:42:45 +0100 Subject: [PATCH 3/7] docs: added server config files --- docs/configs/allmaps_gang.json | 93 +++++++++++++++++++++++++++++++++ docs/configs/allmaps_melee.json | 93 +++++++++++++++++++++++++++++++++ docs/configs/waves.json | 21 ++++++++ 3 files changed, 207 insertions(+) create mode 100644 docs/configs/allmaps_gang.json create mode 100644 docs/configs/allmaps_melee.json create mode 100644 docs/configs/waves.json diff --git a/docs/configs/allmaps_gang.json b/docs/configs/allmaps_gang.json new file mode 100644 index 0000000..1bf54f8 --- /dev/null +++ b/docs/configs/allmaps_gang.json @@ -0,0 +1,93 @@ +{ + "random": true, + "games": [ + { + "mode": "gang", + "map": "rooftop" + }, + { + "mode": "gang", + "map": "ring" + }, + { + "mode": "gang", + "map": "blimp" + }, + { + "mode": "gang", + "map": "containers" + }, + { + "mode": "gang", + "map": "elevators" + }, + { + "mode": "gang", + "map": "girders" + }, + { + "mode": "gang", + "map": "gondola" + }, + { + "mode": "gang", + "map": "grind" + }, + { + "mode": "gang", + "map": "incinerator" + }, + { + "mode": "gang", + "map": "ring" + }, + { + "mode": "gang", + "map": "towers" + }, + { + "mode": "gang", + "map": "train" + }, + { + "mode": "gang", + "map": "trucks" + }, + { + "mode": "gang", + "map": "aquarium" + }, + { + "mode": "gang", + "map": "billboard" + }, + { + "mode": "gang", + "map": "buoy" + }, + { + "mode": "gang", + "map": "chute" + }, + { + "mode": "gang", + "map": "billboard" + }, + { + "mode": "gang", + "map": "lighthouse" + }, + { + "mode": "gang", + "map": "subway" + }, + { + "mode": "gang", + "map": "vents" + }, + { + "mode": "gang", + "map": "wheel" + } + ] +} diff --git a/docs/configs/allmaps_melee.json b/docs/configs/allmaps_melee.json new file mode 100644 index 0000000..56b8c4f --- /dev/null +++ b/docs/configs/allmaps_melee.json @@ -0,0 +1,93 @@ +{ + "random": true, + "games": [ + { + "mode": "melee", + "map": "rooftop" + }, + { + "mode": "melee", + "map": "ring" + }, + { + "mode": "melee", + "map": "blimp" + }, + { + "mode": "melee", + "map": "containers" + }, + { + "mode": "melee", + "map": "elevators" + }, + { + "mode": "melee", + "map": "girders" + }, + { + "mode": "melee", + "map": "gondola" + }, + { + "mode": "melee", + "map": "grind" + }, + { + "mode": "melee", + "map": "incinerator" + }, + { + "mode": "melee", + "map": "ring" + }, + { + "mode": "melee", + "map": "towers" + }, + { + "mode": "melee", + "map": "train" + }, + { + "mode": "melee", + "map": "trucks" + }, + { + "mode": "melee", + "map": "aquarium" + }, + { + "mode": "melee", + "map": "billboard" + }, + { + "mode": "melee", + "map": "buoy" + }, + { + "mode": "melee", + "map": "chute" + }, + { + "mode": "melee", + "map": "billboard" + }, + { + "mode": "melee", + "map": "lighthouse" + }, + { + "mode": "melee", + "map": "subway" + }, + { + "mode": "melee", + "map": "vents" + }, + { + "mode": "melee", + "map": "wheel" + } + ] +} diff --git a/docs/configs/waves.json b/docs/configs/waves.json new file mode 100644 index 0000000..438f935 --- /dev/null +++ b/docs/configs/waves.json @@ -0,0 +1,21 @@ +{ + "random": true, + "games": [ + { + "mode": "waves", + "map": "rooftop" + }, + { + "mode": "waves", + "map": "incinerator" + }, + { + "mode": "waves", + "map": "subway" + }, + { + "mode": "waves", + "map": "grind" + } + ] +} From c095d824abcfe9dc00bea16d10c69b3afa520217 Mon Sep 17 00:00:00 2001 From: anavoi Date: Sat, 15 Mar 2025 21:44:45 +0100 Subject: [PATCH 4/7] fix: resize menu for better score visibility --- Addons/GBSUGui.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Addons/GBSUGui.cs b/Addons/GBSUGui.cs index 0dde94c..daf5943 100644 --- a/Addons/GBSUGui.cs +++ b/Addons/GBSUGui.cs @@ -15,7 +15,7 @@ public class GBSUGui : MonoBehaviour { private bool menu_shown; //private string _currentMap; - public Rect gmenu = new(Screen.width / 2, 0, 385f, 590f); + public Rect gmenu = new(Screen.width / 2, 0, 385f, 690f); readonly IInputSystem inputSystem = UnityInput.Current; string serverip = null; From 86a95a8e889a8f06768bd1de0de084ce66ae7eb8 Mon Sep 17 00:00:00 2001 From: anavoi Date: Sat, 15 Mar 2025 21:48:38 +0100 Subject: [PATCH 5/7] style: minor formatting improvements --- Addons/GBSUGui.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Addons/GBSUGui.cs b/Addons/GBSUGui.cs index daf5943..561fb51 100644 --- a/Addons/GBSUGui.cs +++ b/Addons/GBSUGui.cs @@ -148,8 +148,10 @@ Vsync: {QualitySettings.vSyncCount} Target FPS: {Application.targetFrameRate} {UpdateScoreDisplay()} -Made with <3 by anavoi at Gaboule Community (gaboule.com) -Free and open-source software under GPLv3. Our source code is availaible at git.gaboule.com/Gaboule/GBSU + +Made with <3 by anavoi at Gaboule Community +Free and open-source software under GPLv3. +Our source code is availaible at git.gaboule.com/Gaboule/GBSU Please refer to the documentation for more information."); GUI.DragWindow(new Rect(0, 0, 10000, 10000)); From 3acfb446d1fb3a6809ac5cbd3f529add208eb7aa Mon Sep 17 00:00:00 2001 From: anavoi Date: Sat, 15 Mar 2025 21:52:34 +0100 Subject: [PATCH 6/7] perf: deprecate internalCurrentState tracking It isn't used at the moment. --- Addons/GBSUGui.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Addons/GBSUGui.cs b/Addons/GBSUGui.cs index 561fb51..f30cfb2 100644 --- a/Addons/GBSUGui.cs +++ b/Addons/GBSUGui.cs @@ -21,8 +21,6 @@ public class GBSUGui : MonoBehaviour string serverip = null; int serverport = 0; string currentmap; - string _internalCurrentState; - Traverse _internalCurrentStateTraverse; int vsync_switch; bool hosting = false; private void Start() @@ -36,7 +34,6 @@ public class GBSUGui : MonoBehaviour int.TryParse(CommandLineParser.Instance.GetValueForKey("-port", true), out serverport); } - _internalCurrentStateTraverse = Traverse.Create(nameof(GameManagerNew)).Field("internalCurrentState"); vsync_switch = QualitySettings.vSyncCount; } private void Update() @@ -48,7 +45,6 @@ public class GBSUGui : MonoBehaviour } currentmap = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name; - _internalCurrentState = _internalCurrentStateTraverse.GetValue() as string; } private void ToggleMenu() @@ -143,7 +139,6 @@ Set CLI arguments: -ip, -port, -servername, -serverpassword Current map: {currentmap} Lobby State: {LobbyManager.Instance.LobbyStates.SelfState} -Game State: {_internalCurrentState} Vsync: {QualitySettings.vSyncCount} Target FPS: {Application.targetFrameRate} {UpdateScoreDisplay()} From 6dd459582fbff8c0b4e52ff18903353e27ae9cc7 Mon Sep 17 00:00:00 2001 From: anavoi Date: Sat, 15 Mar 2025 21:52:46 +0100 Subject: [PATCH 7/7] 1.0.1 --- GBSU.csproj | 2 +- Plugin.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GBSU.csproj b/GBSU.csproj index 804559c..866ce81 100644 --- a/GBSU.csproj +++ b/GBSU.csproj @@ -4,7 +4,7 @@ netstandard2.0 GBSU Gang Beasts Server Utility - 1.0.0 + 1.0.1 true latest diff --git a/Plugin.cs b/Plugin.cs index db2622f..f1e871c 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -67,5 +67,5 @@ public class Plugin : BaseUnityPlugin public const string PluginGUID = "com.gaboule.plugins.gbsu"; public const string PluginName = "Gang Beasts Server Utility"; - public const string PluginVersion = "1.0.0"; + public const string PluginVersion = "1.0.1"; }