Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets not loading + Plugin not working #120

Open
kaajjaak opened this issue May 7, 2023 · 9 comments
Open

Assets not loading + Plugin not working #120

kaajjaak opened this issue May 7, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@kaajjaak
Copy link

kaajjaak commented May 7, 2023

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
Copy link
Owner

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

  • Which version of Minetest are you using (server and client)? As of now only 5.4.1 is supported.
  • Please send the proxy log output and configuration file.
  • Which subgame are you using? They should all work fine but I mainly test with devtest and MTG.

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
Copy link
Owner

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.

@HimbeerserverDE HimbeerserverDE added the bug Something isn't working label May 13, 2023
@RepComm
Copy link

RepComm commented Jun 8, 2023

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
Copy link
Owner

HimbeerserverDE commented Jun 8, 2023

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
Copy link

RepComm commented Jun 10, 2023

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
Copy link
Owner

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:

  • Mapping AO (active object) IDs. For example the ID of the local player always has to stay the same even when switching servers.
  • Authentication needs to be handled at the proxy layer as Minetest uses SRP. Empty passwords are used for connections to internal servers, which is why they need to be secured against direct player login.
  • Media (textures, sounds, models) can only be sent to the client once. There have been some recent improvements to this but it's still not powerful enough. Instead the media from all servers is merged and prepended with the name of the server (from the config). Any packets referencing those assets are also changed to use the prepended name.
  • Item and node definitions are similar to media but can't be overwritten at all (the client will crash if you try anyway). They are handled in a very similar way.
  • Tool capabilities and player hands are easily the most annoying part. The only way to set these dynamically (instead of changing the item definition for ":" which can't be done dynamically) is to use item metadata. As a result the proxy has to create per-server hand definitions and use a specific inventory slot to switch between them.

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
Copy link

RepComm commented Jun 17, 2023

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
Copy link
Owner

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 805dc0f (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 HimbeerserverDE/mt-multiserver-chatcommands@d5ebcb0 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
Copy link

RepComm commented Jun 17, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants