Skip to content

magaflaca/MobileCrossplay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MobileCrossplay

TShock plugin that lets mobile Terraria clients (1.4.5.x) connect to a 1.4.5.6 server running TShock v6.1 / .NET 9, bypassing the version mismatch kick.

How it works

When a client connects, Terraria sends a ConnectRequest packet (type 1) containing a version string like "Terraria317". The server compares that string against its own ("Terraria319") and kicks the player if they don't match.

This plugin hooks NetGetData at high priority and intercepts that packet before the server processes it. If the client's version string is in the allow-list, it gets rewritten in-buffer to the server's string — the server then accepts the connection normally without any further changes.

Protocol version table (relevant range)

Terraria version Protocol string Notes
1.4.5.0 Terraria311
1.4.5.1 Terraria312
1.4.5.2 Terraria315
1.4.5.3 Terraria316
1.4.5.4 Terraria317
1.4.5.5 Terraria318
1.4.5.6 Terraria319 ← server target (TShock v6.1)

These numbers were verified by reading the version string the real client sends. If your mobile client reports a different number, enable verbose mode and check the console output.


Requirements

  • TShock v6.1 for Terraria 1.4.5.6
  • .NET 9 runtime (bundled with TShock v6)

Installation

  1. Download MobileCrossplay.dll from the Releases page.
  2. Drop it into your server's ServerPlugins/ folder.
  3. Restart the server. You should see:
    [MobileCrossplay] Plugin started. Server: Terraria319
    [MobileCrossplay] Allowed client versions: Terraria311, Terraria312, Terraria313, Terraria314, Terraria315, Terraria316, Terraria317, Terraria318
    
    
    

Commands

Requires the mobilecrossplay.admin permission (superadmins have it by default).

Command Description
/crossplay info Shows server version, number of currently connected mobile clients, and verbose status
/crossplay versions Lists all allowed client version strings
/crossplay verbose Toggles verbose logging (prints every client's version string on connect, useful for debugging unknown versions)

Alias: /mcp


Configuration

A config file is created automatically at tshock/MobileCrossplay.json on the first run. You can edit this file to add new client versions without having to recompile the plugin:

{
  "ServerVersionString": "Terraria319",
  "AllowedClientVersions": {
    "Terraria311": "1.4.5.0 (mobile/PC)",
    "Terraria312": "1.4.5.1 (mobile/PC)",
    "Terraria313": "1.4.5.x (PC)",
    "Terraria314": "1.4.5.y (mobile)",
    "Terraria315": "1.4.5.2 (mobile/PC)",
    "Terraria316": "1.4.5.3 (mobile/PC)",
    "Terraria317": "1.4.5.4 (mobile/PC)",
    "Terraria318": "1.4.5.5 (mobile/PC)"
  },
  "Verbose": false
}

Set "Verbose": true to print every incoming client's version string to the console.


Building from source

Requirements

  • Visual Studio 2022 (v17+) with .NET 9 support
  • TShock v6.1 DLLs as references

Steps

  1. Clone the repo and open MobileCrossplay.sln.
  2. Create a lib/ folder inside MobileCrossplay/ and copy the following DLLs from your TShock v6 installation (same folder as TerrariaServer.exe):
    MobileCrossplay/
    └── MobileCrossplay/
        ├── lib/
        │   ├── TShock.dll
        │   ├── TerrariaServerAPI.dll
        │   └── OTAPI.dll
        ├── MobileCrossplay.cs
        └── MobileCrossplay.csproj
    
  3. Build in Release mode (Ctrl+Shift+B).
  4. Output: MobileCrossplay/bin/Release/MobileCrossplay.dll

Troubleshooting

Mobile client still gets kicked

  1. Run /crossplay verbose on the server console (or set "Verbose": true in MobileCrossplay.json).
  2. Attempt to connect from mobile.
  3. Look for a line like:
    [MobileCrossplay] [Verbose] Slot 0 connected with version: "TerrariaXXX"
    
  4. If that number isn't in the allow-list, simply add it to the "AllowedClientVersions" dictionary inside tshock/MobileCrossplay.json and restart the server or reload the plugin:
    "TerrariaXXX": "1.4.5.X (mobile)"

Build error: TShock.dll not found

Make sure the lib/ folder exists inside MobileCrossplay/ and contains all three DLLs. The .csproj references them with relative paths (lib\TShock.dll).


Caveats

  • This plugin only rewrites the version handshake string — it does not translate packets. It works because minor 1.4.5.x point releases share the same packet structure. If Re-Logic introduces a breaking packet format change between versions, players might experience subtle issues or crashes after connecting.
  • Tested with TShock v6 / Terraria 1.4.5.6. If TShock updates its target version, you can simply update ServerVersionString in the MobileCrossplay.json file.

License

MIT — see LICENSE.


Credits

About

TShock plugin that lets "old" Terraria clients (1.4.5.x) connect to a 1.4.5.6 server running TShock v6.1, bypassing the version mismatch kick.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages