MagicStorage icon indicating copy to clipboard operation
MagicStorage copied to clipboard

multiplayer Crossplay Linux <-> Windows not possible due to compression issue

Open saschahi opened this issue 5 years ago • 10 comments

It works fine in singleplayer (windows) It works fine with a locally hosted multiplayer (windows) But all hell breaks loose on Multiplayer (Server on Linux)

you can still craft the magicstorage stuff, but once you place it you get into problems: for each Magicstorage-Item you place you get a console error

  • [22:46:21] [1/WARN] [Terraria]: Error on message Terraria.MessageBuffer If you open the magicstorage it shows it has 0/0 space and no items are in it regardless of how many magicstorage storages are around it. BUT you can still put items into the storage and the nearest storage changes color to indicate it has been filled.

you can't take items out of the storage anymore (because the interface shows none) and if you leave the server and join it again you get giant holes in the world where the magicstorage was once was, giant dirt walls to the sky limit and other not-so-fun world related issues

saschahi avatar Jan 02 '20 22:01 saschahi

Can confirm, same issue. In a Linux host, Magic Storage items bug the server. Reopening the server causes that chunk to disappear. It is important to note that the chunk still exists. (Single player) In a Windows host of the same world, no such issue exists, and Magic Storage behaves as expected.

junetried avatar Jan 02 '20 23:01 junetried

found out: it's because of these 2: https://github.com/blushiemagic/MagicStorage/blob/master/Components/TEStorageUnit.cs#L385 and https://github.com/blushiemagic/MagicStorage/blob/master/Components/TEStorageUnit.cs#L429

because: Mono and .Net Handle Deflatestream differently.

fix: remove the compression / use different compression (?)

(found this out because of an older issue with basically the same problem)

the commit that "destroyed" crossplay: https://github.com/blushiemagic/MagicStorage/commit/bcd349952a435274d3a85fbb42dbad977a482975

saschahi avatar Jan 03 '20 00:01 saschahi

So is there a workaround?

bennolor avatar Jan 05 '20 20:01 bennolor

there is, I made a working version without the compression. I haven't uploaded it to github but it's on my discord channels #info channel. Invite code is 9dauEnQ

saschahi avatar Jan 05 '20 20:01 saschahi

tModLoader is missing libMonoPosixHelper.so for linux. Add it to the lib64 folder or install mono.

zackbcom avatar Jan 28 '20 20:01 zackbcom

Adding libMonoPosixHelper.so like @zackbcom said fixed it for me. For those running their server via their own docker container, it's just a matter of installing mono in your build stage and then copying libMonoPosixHelper.so to your final stage. No need for the entirety of mono to bloat your image.

https://github.com/Rfvgyhn/tmodloader-docker/blob/4917f9ff132eaff4cb5fea4f023ec3f835fb0e4c/Dockerfile#L6-L12

rfvgyhn avatar Feb 21 '20 18:02 rfvgyhn

@zackbcom 's solution seems work but the server console still outputing Error on message Terraria.MessageBuffer while placing storage items onto the world. (But it still works)

david50407 avatar Feb 24 '20 12:02 david50407

Copying libMonoPosixHelper.so into the lib and lib64 folder doesn't solve anything for me with 0.4.3.5, on an Linode server running Debian 9, running the server either through ./tModLoaderServer or mono tModLoaderServer.exe.

I placed three storage units in a single row connected to each other, then a storage heart on top of the middle unit. Each placement created a Terraria.MessageBuffer error, using the storage units did the "vanities hidden, locked in place, wings out" behavior, and the storage heart showed a capacity of 0. After leaving, I was then unable to connect to the server in all but one attempt (freezing or crashing when receiving tile data), and in that one attempt, every block and wall displayed as its left facing variant until they were updated (in this case, by removing the storage objects). This is with libMonoPosixHelper.so.

0.4.3.1 seems to work, although it still displays Terraria.MessageBuffer errors. The modified version of 0.4.3.5 from saschahi seems to work with no issues after some brief testing.

0dot0repeating avatar Jun 25 '20 08:06 0dot0repeating

@brouzoufman easiest way (works on ubuntu 18.04 I don't use debian so you might need to change minor parts)

  1. "sudo apt-get install mono-complete"
  2. start tmodloader with "./tModLoaderServer.exe" instead of "./tModLoaderServer" that worked for me

saschahi avatar Jun 25 '20 08:06 saschahi

This also affects Linux clients connecting to a Windows host.

Including libMonoPosixHelper.so in lib64 does indeed "solve" the problem, should we ask upstream to bundle that library?

For reference, the official mono download page is here, distros not listed there will require you to either manually build the file or get it from the distro package repository.

TLATER avatar Aug 23 '20 01:08 TLATER