HimbeerserverDE / mt-multiserver-proxy

mt-multiserver-proxy is a reverse proxy designed for linking multiple Minetest servers together
MIT License
25 stars 5 forks source link

Assets not loading + Plugin not working #120

Open kaajjaak opened 1 year ago

kaajjaak commented 1 year ago

When joining the game, all the blocks just say unknown node and in chat it says ERROR[Main]: Client: ignoring duplicate media announcement sent by server: "ServerName1_player.png" the same with this for a bunch of assets. I also tried installing the commands plugin, however there were no install instructions, i tried compiling it to an .so file and putting that file in the plugins directory of the mt-multiserver-proxy, however that didn't change anything.

Can you please help me fix this?

HimbeerserverDE commented 1 year ago

Of course I can (hopefully), but I need additional information:

Compiling the plugin to a .so file is the right way to do it (see doc/plugins.md for more details). Did the proxy print "load plugins" on startup? Did it output an error related to plugin.Open? If not, have you tried typing ">help" in chat to verify it is loaded?

I can't tell why the node definitions and assets are broken. I'll try to reproduce the issue if I'm able to compile MT 5.4.1.

HimbeerserverDE commented 1 year ago

I just tested it and the chat command plugin and block textures work fine, but I was able to replicate the media announcement error message. It does not seem to be a fatal error as the listed textures load properly. It's probably caused by the proxy sending the builtin textures before the servers do, resulting in the same media hashes being announced multiple times.

RepComm commented 1 year ago

Can confirm that happens when running a later version than 5.4.1. Latest 5.7.0 shows unknown nodes everywhere and the same error messages in chat

What would need to be updated in theory to get this project stable for latest 5.7.0?

HimbeerserverDE commented 1 year ago

The serialization and packet formats needed to be updated, plus some version number constants. I just did that. The latest commit is (exclusively) compatible with Minetest 5.7.0. @kaajjaak, please update the proxy and the chat command plugin and check again.

Commits for each Minetest version:

RepComm commented 1 year ago

Functional block textures, error message not present for 5.7.0 server/client on fedora 36. Will be testing on Ubuntu soon.

The only issue I can see is the inventory textures are rendering as notexture. I'm going to have to learn Go so I can understand how this awesome project is working under the hood!

Very nice work!

HimbeerserverDE commented 1 year ago

Thanks!

I'm going to assume you're running Minetest Game and are talking about the recipes tab. This should be fixed now (though it should work with any subgame).

This project was actually the main reason I decided to learn Go. It's a fantastic language for many programs, especially for networking code. If you want to learn it, the official tour is a good place to start. Reading existing code and trying to understand it is also a good idea.

You can read the docs to get a basic idea of what the proxy does. Trying to multiplex multiple Minetest servers presents a number of challenges, including the following:

On top of this the Minetest network protocol is quite annoying to deserialize since packet formats can change depending on the values of other fields in the packet. There have been several pull requests to add server hopping functionality into the engine directly, but none of them have made it into the upstream project.

If you have any questions about the exact things the proxy does or about the code itself, feel free to ask!

RepComm commented 1 year ago

Hi, I've been putting together a whole bunch of podman containers to run this and have finally got to running mt-multiserver-proxy in its own container.

I can connect via my client, however loading stops at Item definitions, and the proxy logs: ./start.sh 2023/06/17 05:48:39 load config 2023/06/17 05:48:39 [proxy] load plugins 2023/06/17 05:48:39 [proxy] listen [::]:10209 2023/06/17 05:50:18 [10.89.0.104:43818] -> connect 2023/06/17 05:50:18 [10.89.0.104:43818 repcomm] -> set password 2023/06/17 05:50:19 [content Hub] <- invalid serializeVer

I swapped OSes recently and needed to rebuild mt-multiserver-proxy today, so I wonder if I have commits that break something.

Is there a way for me to compile from the specific commit you made for 5.7.0 ? @latest is broken for me

HimbeerserverDE commented 1 year ago

The last log message indicates that the hub server sent a serialization version that is not compatible with the proxy (only 29 is supported for 5.7.0) while trying to fetch content definitions and media resources. The value the server sends is min(client_max, server_max). The proxy sends 29 as its supported maximum and a 5.7.0 server should use 29 as its server_max.

The only way this can lead to any serialization version other than 29 being sent back to the proxy is for the server to have a lower version.

Please confirm that you're running Minetest 5.7.0 on the client and all servers. OS packages tend to be out of date.

The new commits fix the issue of unknown items showing up in the recipes tab in the inventory. They shouldn't break connectivity, but you can downgrade to 805dc0f732289e22ce701efb3114dd36ca914caa (first commit to support 5.7.0 connections) using

go install github.com/HimbeerserverDE/mt-multiserver-proxy/cmd/mt-multiserver-proxy@v0.0.0-20230608181740-805dc0f73228

The chat commands need to be downgraded to https://github.com/HimbeerserverDE/mt-multiserver-chatcommands/commit/d5ebcb007eb134a02d8715599f8b1c8b0d07504a if you want them to load, a simple

git checkout d5ebcb007eb134a02d8715599f8b1c8b0d07504a

and rebuild of the plugin should do.

In case you're wondering how the v0.0.0-20230608181740-805dc0f73228 came to be: this is called a pseudo version. They are used if there are no tagged releases on the repository. The format is v0.0.0-YYYYmmddHHMMSS-XXXXXXXXXXXX. The timestamp is in UTC and XXXXXXXXXXXX is the first 12 characters of the commit hash. I made a script to calculate it: https://github.com/HimbeerserverDE/bspwm-setup/blob/main/bin/gopseudover.

Unfortunately I don't have much time to test anything at the moment. I can have a more detailed look at it in about a week from now.

RepComm commented 1 year ago

Can confirm that minetest server was at lower version 5.4.1

I assume my ubuntu container would pull latest minetest after apt-get update, which I guess was a mistake.

I had to add the minetestdevs ppa:

RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:minetestdevs/stable
RUN apt-get update
RUN apt-get install -y minetest
COPY minetest.conf /root/minetest.conf

Then I needed to configure my squid-cache container to allow 3rd party PPAs, otherwise it would 403 error and apt-get would default to installing 5.4.1 minetest, without giving me a lot of notice.

squid-deb-proxy.conf :

# allow access only to official archive mirrors
#http_access deny !to_archive_mirrors
http_access allow !to_archive_mirrors

#...

# don't cache domains not listed in the mirrors file
#cache deny !to_archive_mirrors
cache allow !to_archive_mirrors

All is functional now, even on mt-multiserver-proxy@latest

You have been such a huge help, thank you! Let me know if I can contribute in some fashion.

-- less related, do you have a donation link somewhere?