-
-
Notifications
You must be signed in to change notification settings - Fork 36
[upcoming] 4. Producing OTAPI on your own
Contents |
---|
1. Prerequisites |
2. Producing a patched server OTAPI.dll |
↳ Patcher options |
↳ Running the server |
5. Producing the launcher, a patched OTAPI.exe |
Creating a OTAPI.dll or OTAPI.exe is totally built into the new OTAPI.Patcher CLI program as a set of questions. Simply clone the upcoming branch, restore nuget packages and run the OTAPI.Patcher.
- .NET5 SDK
- Terminal or powershell, with git and dotnet working
- Open a terminal or powershell window clone OTAPI's upcoming branch
git clone -b upcoming https://github.com/DeathCradle/Open-Terraria-API.git
- Move into the checked-out project root
cd Open-Terraria-API
- Restore submodules
git submodule update --init --recursive
- Restore NuGet packages
dotnet restore OTAPI.Mods.sln
dotnet restore OTAPI.Server.Launcher.sln
dotnet restore OTAPI.Client.Launcher.sln
- Clean and build the mod patching solution. Rebuilding will ensure any changes to external scripts are copied during project building.
dotnet clean OTAPI.Mods.sln
dotnet build OTAPI.Mods.sln
- Move to the output directory, where all the assemblies are located
cd OTAPI.Patcher/bin/Debug/net5.0
- Run the project and wait for it to ask what you wish to patch.
dotnet run --project ../../../OTAPI.Patcher.csproj --framework net5.0
The patcher will currently present you the following options, depending on what you wish to do will also determine how you later run the output assembly.
- [p] - OTAPI PC Server
This will download TerrariaServer for PC, patch it and produce a OTAPI.dll
- [m] - OTAPI Mobile Server
This will download TerrariaServer for Mobile, patch it and produce a OTAPI.dll.
- [c] - OTAPI Client
This will search for a pre-installed Terraria directory as part of known Steam or GOG locations.
It will produce a OTAPI.exe that is later used to run the modded game.
To run the server there is an example OTAPI.Server.Launcher project that demos that you can compile and register to events provided by OTAPI.dll and OTAPI.Runtime.dll.
-
Ensure you patched a server, not client
-
Move back to the root of the OTAPI folder you cloned via get (if you are still in the patcher's output directory)
cd ../../../../
- Build the Server launcher project
dotnet build OTAPI.Server.Launcher.sln
- Move to the output assemblies
cd OTAPI.Server.Launcher/bin/Debug/net5.0
- Start the example server!
dotnet OTAPI.Server.Launcher.dll
The patching process is quite similar to the server, however since this is not a server it requires basically a self-dependent .net5 framework and all the game files that will still require the base game to extract data and patch. To do this you can usually run the launcher in debug mode, or in a published x64 folder.
- Open a terminal or powershell window clone OTAPI's upcoming branch
git clone -b upcoming https://github.com/DeathCradle/Open-Terraria-API.git
- Move into the checked-out project root
cd Open-Terraria-API
- Restore submodules
git submodule update --init --recursive
- Restore NuGet packages
dotnet restore OTAPI.Client.Launcher.sln
-
Open OTAPI.Client.Launcher.sln in Visual Studio/Code.
-
Clean and build the
OTAPI.Client.Launcher
solution. Rebuilding will ensure any changes to external scripts are copied during project building. -
Debug the
OTAPI.Client.Launcher
project. This will show the OTAPI Launcher GUI, and you can continue to use it while debugging.