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

[CSM] Add settings API #5454

Closed
HybridDog opened this issue Mar 25, 2017 · 15 comments
Closed

[CSM] Add settings API #5454

HybridDog opened this issue Mar 25, 2017 · 15 comments
Labels
@ Client Script API Feature request Issues that request the addition or enhancement of a feature

Comments

@HybridDog
Copy link
Contributor

l noticed that minetest.setting_get doesn't work.
l need this function to get the player name and other settings.
It's executed at load time, so according to the documentation it should work.

@HybridDog HybridDog changed the title attempt to call field 'setting_get' (a nil value) [CSM] attempt to call field 'setting_get' (a nil value) Mar 25, 2017
@HybridDog HybridDog changed the title [CSM] attempt to call field 'setting_get' (a nil value) Attempt to call field 'setting_get' (a nil value) Mar 25, 2017
@Desour
Copy link
Member

Desour commented Mar 25, 2017

Also settingtypes.txt doesn't work yet.
related: #5394

@paramat paramat changed the title Attempt to call field 'setting_get' (a nil value) [CSM] Attempt to call field 'setting_get' (a nil value) Mar 26, 2017
@nerzhul
Copy link
Member

nerzhul commented Mar 26, 2017

sorry, but it's a bad usecase to use settings to get player name. We will have a lcoalplayer reference instead for this when roadmap 2 will be finished

@rubenwardy
Copy link
Member

Are there any usecases for this apart from mod settings? Might be worth only letting CSM access settings starting with client.

@HybridDog
Copy link
Contributor Author

You may want to get the smooth lighting setting and whatnot.

@nerzhul
Copy link
Member

nerzhul commented Mar 28, 2017

@HybridDog i think we can offer setting getter to mods, but not setting setter

@HybridDog
Copy link
Contributor Author

This issue is about the getter.

@sofar
Copy link
Contributor

sofar commented Apr 2, 2017

We want to make sure mods (sent by the server) can't scrape all user settings and send them to the server. So indeed what @rubenwardy said, you probably only want to allow a few settings to be read, if any.

@rubenwardy rubenwardy marked this as a duplicate of #6186 Jul 28, 2017
@rubenwardy rubenwardy changed the title [CSM] Attempt to call field 'setting_get' (a nil value) [CSM] Add settings API Jul 28, 2017
@paramat
Copy link
Contributor

paramat commented Jul 28, 2017

so according to the documentation it should work.

That's not official documentation of the function, that may just be copy-paste.
Many settings are probably best hidden from CSM.

@raymoo
Copy link
Contributor

raymoo commented Jul 29, 2017

What if mods can only read specific settings plus all settings with names that are modname.settingname?

@paramat
Copy link
Contributor

paramat commented Jul 29, 2017

Mods may have settings that control things that need to be secret on a server. Likewise we need to be careful about accessing other settings a client should not know and could abuse.

@raymoo
Copy link
Contributor

raymoo commented Jul 29, 2017

If it's a secret then don't send it to the client.

@Desour
Copy link
Member

Desour commented Jul 29, 2017

Related: #5941

@paramat paramat added Feature request Issues that request the addition or enhancement of a feature Core dev consideration needed and removed Controversial labels Oct 11, 2018
@paramat
Copy link
Contributor

paramat commented Oct 11, 2018

1+ year bump, any core dev support?

@Desour
Copy link
Member

Desour commented Oct 11, 2018

The link in the first post is outdated, here's a permalink:

`minetest.setting_get(name)` and `minetest.setting_getbool(name)` can be used
to read custom or existing settings at load time, if necessary.

@paramat
Copy link
Contributor

paramat commented Oct 14, 2018

The future of CSM is highly uncertain at the moment. I feel it's best to wait until we know SSCSM is going ahead before adding new CSM features (as it may be wasted work). So i am 👎 until SSCSM progresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client Script API Feature request Issues that request the addition or enhancement of a feature
Projects
None yet
Development

No branches or pull requests

8 participants