Seperation into client and server settings and clean-up

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Seperation into client and server settings and clean-up

by Wuzzy » Fri Jan 09, 2015 08:13

IMO the minetest.conf settings could really use some cleanup. Currently it is a bit messy.

AFAIK there is not strict seperation between client and server settings, and if there is, it is not very visible. This is bad for many reasons.

minetest.conf.example only makes a semantic seperation between those and some settings are used by server AND client. Also, why should I trust minetest.conf.example on its accuracy? Doing this manually is obviously error-prone. The engine should know better which settings are server-sided and which settings are client-sided.

I suggest to split minetest.conf into two files: client.conf and server.conf.
client.conf may only contain settings which affect the client; server.conf may only contain settings which affect the server.
If client.conf contains a server setting or an unknown setting, it should be discarded and a warning should be written (at least in the log files).
If server.conf contains a client setting, do the same thing. But server.conf should be allowed to have “unknown” settings like “my_custom_setting = 1”, so they can be used by mods.
All Lua setting-related functions should only be allowed to access server-side settings.
Also, the chat command “set” should ONLY be allowed to read and write server settings. It does not really make sense to manipulate stuff like the forwards key setting of a server. ;)

minetest.conf in world folders (or was it subgames? I don't know) should be renamed to “server.conf” and only allow server settings.

You might argue that it would still be useful to change client stuff from the console. But you forget that these commands are sent to the server. If you are connected to a remote server, you can't change anything locally.
Manipulating local stuff is not possible while Minetest is running, unless in singleplayer mode. Minetest lacks any kind of *local* commands, so this is a different subject which needs to discussed elsewhere.

serverlist_url has a default value of “servers.minetest.net”. This is not an URL, it's only a hostname. The setting name and its comment in minetest.conf.example are wrong.
The clouds should be a serverside thing, too. Currently enable_clouds is strictly client-sided. cloud_height is client-sided, too, which does not make sense to me.
weather is also client-side apparently (at least this is what minetest.example.conf says. Weird. Is weather only a decorative effect?


The following settings appear both in client and server section, but their meaning is dependent on wheather Minetest runs as a client or as a server:

  • name: Singleplayer mode: meaningless; Client: Name used to connect to server; Server: Name of admin.
  • serverlist_url: Client: Serverlist which is used. Server: Serverlist to which announce to.

Here is my suggestion to clean up those settings:
  • name: Remove name setting, split into (for client) player_name (name to be used on servers) and (for server) admin_name (name of admin)
  • serverlist_url: make to “serverlist_announce_hostname” (for server to announce to) and “serverlist_fetch_hostname” (for client to download from)
  • enable_clouds: Make “enable_clouds” and “cloud_height” server-side. Add “display_clouds” as client-setting. The clouds are only shown on the client if the server has enable_clouds = true AND the client has display_clouds = true. Both are true by default.


If you know more settings which are treated in a weird way or which behave differently on clients and servers, please post them!
 

Zeno
Member
 
Posts: 140
Joined: Sun Jun 29, 2014 03:36
GitHub: Zeno-

Re: Seperation into client and server settings and clean-up

by Zeno » Fri Jan 09, 2015 09:38

Possibly related to this (I'm not sure) is one of my plans is making the client and the server much less dependent upon each other in the source code. That's probably what I'll be concentrating on soon and have mentioned this on #minetest-dev. There is a lot of shared code between the client and server (and this is good) but the separation is not clear enough (IMO). Sometimes changes in the source code that you *think* should only affect the client does in actual fact influence the server; this will always be the case because of the shared code but I'd like to make the demarcation clearer. Quite possibly this separation of settings files could be part of that... let's see what the other devs think.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 9 guests

cron