️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
Find a file
Cardinal System a867772116
Some checks failed
CI (Docker image) / build (push) Has been cancelled
CI(OTAPI3) / test (push) Has been cancelled
CI(OTAPI3) / build (linux-arm) (push) Has been cancelled
CI(OTAPI3) / build (linux-arm64) (push) Has been cancelled
CI(OTAPI3) / build (linux-x64) (push) Has been cancelled
CI(OTAPI3) / build (osx-x64) (push) Has been cancelled
CI(OTAPI3) / build (win-x64) (push) Has been cancelled
i18n check trigger / extract (push) Has been cancelled
Update translation template
2025-08-25 16:50:34 +00:00
.github Merge remote-tracking branch 'upstream/general-devel' into net9-upgrade 2025-05-09 22:38:33 +10:00
.vscode Update vscode launch profile 2025-01-11 14:13:50 +10:00
docs Update changelog file for the last time 2025-03-12 06:01:47 +09:00
i18n Update translation template 2025-08-25 16:50:34 +00:00
prebuilts Update geoip database 2025-05-25 12:22:40 +09:00
scripts Fix GitHub Actions with updated Windows Server 2019 builder 2020-02-09 21:22:29 -08:00
TerrariaServerAPI@2b81ac7459 Bump submodule for TSAPI changes 2025-05-24 23:29:38 +09:00
TShockAPI i18n: Add missing GetString wrapper for GroupManager 2025-08-12 01:41:10 +08:00
TShockInstaller Update installer runtime urls for net9 2025-01-11 14:14:04 +10:00
TShockLauncher chore: Remove invalid comment on Npgsql package reference 2025-05-10 15:03:05 +02:00
TShockLauncher.Tests Update server init test to static hook 2025-01-11 20:00:23 +10:00
TShockPluginManager Merge remote-tracking branch 'upstream/general-devel' into net9-upgrade 2025-01-26 21:16:51 +10:00
.all-contributorsrc docs: update .all-contributorsrc [skip ci] 2020-05-21 02:32:18 +00:00
.dockerignore Rewrite the .dockerignore file into a denylist 2023-10-01 11:18:43 +02:00
.editorconfig Add command help text 2013-10-05 10:34:28 -04:00
.gitattributes Change changelog to use merge=union 2021-05-28 19:39:08 -07:00
.gitignore Update .gitignore 2018-03-06 17:38:41 -05:00
.gitmodules Specify branch for gitmodules by default 2022-10-06 01:11:22 -07:00
appveyor.yml Update net6 refs to net9 2025-01-11 11:19:16 +10:00
COPYING GPL should be COPYING not LICENSE. 2011-06-12 01:28:35 -06:00
crowdin.yml Tell crowdin to skip actions [skip actions] 2022-10-21 09:07:06 -07:00
Dockerfile Utilise conditional docker base image 2025-02-02 16:36:28 +10:00
README.md Update net6 refs to net9 2025-01-11 11:19:16 +10:00
README_cn.md Update net6 refs to net9 2025-01-11 11:19:16 +10:00
SECURITY.md Fix formatting issues in markdown land 2021-05-29 13:36:31 -07:00
TShock.sln Introduce integrated package manager 2022-11-28 08:16:11 -05:00

TShock for Terraria
AppVeyor Build Status GitHub Actions Build Status

查看中文版

TShock is a toolbox for Terraria servers and communities. That toolbox is jam packed with anti-cheat tools, server-side characters, groups, permissions, item bans, tons of commands, and limitless potential. It's one of a kind.

This is the readme for TShock developers and hackers. We're building out new TShock documentation for server operators and plugin developers, but this is a work-in-progress right now.

Developing TShock

If you want to contribute to TShock by sending a pull request or customize it to suit your own sparkly desires, this is the best starting point. By the end of this, you'll be able to build TShock from source, start to finish. More than that, though, you'll know how to start on the path of becoming an expert TShock developer.

This guide works assuming that you have the .NET 6 SDK installed and that you're familiar with the command line. If that doesn't describe you, you should be able to accomplish the same thing using Visual Studio 2022 or Visual Studio Code.

  1. Clone the repository: git clone https://github.com/Pryaxis/TShock.git --recurse-submodules
  2. cd TShock to enter the repo.
  3. dotnet build. No really, that will build things!

If you want to run the TShockLauncher (which runs a server), run:

  1. dotnet run --project TShockLauncher

To produce a packaged release (suitable for distribution), run:

  1. cd TShockLauncher
  2. dotnet publish -r win-x64 -f net9.0 -c Release -p:PublishSingleFile=true --self-contained false

Note that in this example, you'd be building for win-x64. You can build for win-x64, osx-x64, linux-x64, linux-arm64, linux-arm. Your release will be in the TShockLauncher/bin/Release/net9.0/ folder under the architecture you specified.

Working with Terraria

Working with Terraria in TShock and in other Terraria Server API plugins is different from most other APIs. Due to the nature of how OTAPI works, you have direct access to all public fields in the Terraria namespace. This means that you can access Terraria member methods directly. TShock and other plugins do this quite often, mostly to modify the game world, send data, and receive data. Calls to Main are one such example of direct access to Terraria. This is the equivalent to net.minecraft.server (NMS) calls in CraftBukkit.

You might find yourself wondering where these fields are. Pryaxis provides the decompiled Sources to Terraria's server, updated with each release. These sources are made available to developers of TShock. If you have submitted a pull request to TShock, reach out on Discord to get access. In lieu of this, you can download ILSpy and decompile Terraria or the server itself.

Finally, you may be interested in developing other Terraria Server API plugins. The TShockResources organization has several plugins you can look at and build on. TShock is itself a plugin, and most plugins are open source. This gives you ample room to figure out where to go next.

Need help? Join us on Discord.

Code of Conduct

By participating in the TShock for Terraria community, all members will adhere to maintaining decorum with respect to all humans, in and out of the community. Members will not engage in discussion that inappropriately disparages or marginalizes any group of people or any individual. Members will not attempt to further or advance an agenda to the point of being overbearing or close minded (such as through spreading FUD). Members will not abuse services provided to them and will follow the guidance of community leaders on a situational basis about what abuse consists of. Members will adhere to United States and international law. If members notice a violation of this code of conduct, they will not engage but will instead contact the leadership team on either the forums or Discord.

Do not attempt to circumvent or bypass the code of conduct by using clever logic or reasoning (e.g., insulting Facepunch members, because they weren't directly mentioned here).