Add mcl_player_csm mod to check if a player have the official CSM enabled #3094

Open
AFCMS wants to merge 2 commits from csm-enabled into master
Member

Depend of MineClone2/MineClone2Client#2

Will allow to give a better UX for CSM users conditionally.

eg: fix MineClone2/MineClone2#1724 , with adition of CSM graphics and animations

Depend of https://git.minetest.land/MineClone2/MineClone2Client/pulls/2 Will allow to give a better UX for CSM users conditionally. eg: fix https://git.minetest.land/MineClone2/MineClone2/issues/1724 , with adition of CSM graphics and animations
AFCMS added the
#P6: low
API
enhancement
labels 2022-12-10 22:29:40 +01:00
AFCMS added 1 commit 2022-12-10 22:29:45 +01:00

Can you explain a bit more about this mod so I can understand better, please?

How do I test the Mineclone2Client for example, and what would this change enable?

Can you explain a bit more about this mod so I can understand better, please? How do I test the Mineclone2Client for example, and what would this change enable?
Author
Member

Can you explain a bit more about this mod so I can understand better, please?

MineClone2/MineClone2Client#2 makes the client mod send a message to the server then connecting.

This PR make the server understand this message and store that the client is actually using the CSM.

This is not doing anything yet, but will allow to switch between CSM and server-side graphics per-player.

> Can you explain a bit more about this mod so I can understand better, please? MineClone2/MineClone2Client#2 makes the client mod send a message to the server then connecting. This PR make the server understand this message and store that the client is actually using the CSM. This is not doing anything yet, but will allow to switch between CSM and server-side graphics per-player.
Author
Member

How to test:

  • Checkout MineClone2/MineClone2Client#2
  • Checkout this PR
  • Make sure the CSM is disabled
  • Join the game
  • Make sure /have_csm and /have_csm singleplayer returns false
  • Enable the CSM
  • Make sure /have_csm and /have_csm singleplayer returns true
**How to test:** - Checkout MineClone2/MineClone2Client#2 - Checkout this PR - Make sure the CSM is disabled - Join the game - Make sure `/have_csm` and `/have_csm singleplayer` returns false - Enable the CSM - Make sure `/have_csm` and `/have_csm singleplayer` returns true

I'm not sure what I'm doing wrong here. Checked out both branches and when adding the Mineclone2Client into my mods, it still gives me false. Any ideas?

I'm not sure what I'm doing wrong here. Checked out both branches and when adding the Mineclone2Client into my mods, it still gives me false. Any ideas?
Author
Member

I'm not sure what I'm doing wrong here. Checked out both branches and when adding the Mineclone2Client into my mods, it still gives me false. Any ideas?

MineClone2Client is a CSM, not a regular mod lol

I think it still loads as a SSM because API used have the same names, but it will surely not work as expected.

89e7f72c92/doc/client_lua_api.txt (L28)

> I'm not sure what I'm doing wrong here. Checked out both branches and when adding the Mineclone2Client into my mods, it still gives me false. Any ideas? MineClone2Client is a **CSM**, not a regular mod lol I think it still loads as a SSM because API used have the same names, but it will surely not work as expected. https://github.com/minetest/minetest/blob/89e7f72c929fbeef8ad755bc85db22ae6102787d/doc/client_lua_api.txt#L28
Ghost requested review from Ghost 2022-12-31 06:48:10 +01:00
Ghost added 1 commit 2022-12-31 06:52:32 +01:00
First-time contributor

I wasn't able to make this work in local multiplayer.

Solution

i forgot to enable enable_client_modding in the settings. me dumb

Steps to test reproduce

  1. Run a server with this PR
  2. Run a client with the CSM PR. Make sure the CSM is actually enabled in mod.conf by adding load_mineclone2_client = true. Make sure enable_client_modding is enabled in the settings.
  3. Join the server using said client. Execute /have_csm and /have_csm NAME.

Expected: true message in chat

  1. Exit the server using said client.
  2. Disable the CSM by changing true to false in mod.conf.
  3. Repeat step 3.

Expected: false message in chat

~~I wasn't able to make this work in local multiplayer.~~ ### Solution i forgot to enable `enable_client_modding` in the settings. me dumb ### Steps to test ~~reproduce~~ 1. Run a server with this PR 2. Run a client with the CSM PR. Make sure the CSM is actually enabled in `mod.conf` by adding `load_mineclone2_client = true`. Make sure `enable_client_modding` is enabled in the settings. 3. Join the server using said client. Execute `/have_csm` and `/have_csm NAME`. **Expected**: *true* message in chat 4. Exit the server using said client. 5. Disable the CSM by changing `true` to `false` in `mod.conf`. 6. Repeat step 3. **Expected**: *false* message in chat
First-time contributor

I'm assuming this is a debug preview because of /have_csm. Or is this intended to be in MCL2?

I'm assuming this is a debug preview because of `/have_csm`. Or is this intended to be in MCL2?
Author
Member

I'm assuming this is a debug preview because of /have_csm. Or is this intended to be in MCL2?

The command require the debug priv, so it can be added to mcl2, but it is a bit useless and IDK if its good to add yet another useless command to the game.

Maybe better to comment it, so if someone wants to debug/test something they just have to re-enable it.

> I'm assuming this is a debug preview because of `/have_csm`. Or is this intended to be in MCL2? The command require the debug priv, so it can be added to mcl2, but it is a bit useless and IDK if its good to add yet another useless command to the game. Maybe better to comment it, so if someone wants to debug/test something they just have to re-enable it.
Member

I'm assuming this is a debug preview because of /have_csm. Or is this intended to be in MCL2?

The command require the debug priv, so it can be added to mcl2, but it is a bit useless and IDK if its good to add yet another useless command to the game.

Maybe better to comment it, so if someone wants to debug/test something they just have to re-enable it.

I'd make it a setting, if for no other reason that someone will come along and either uncomment it, or delete it.

One of the main things is to not leave in commented code blocks -- for those two reasons -- in professional settings.

> > I'm assuming this is a debug preview because of `/have_csm`. Or is this intended to be in MCL2? > > The command require the debug priv, so it can be added to mcl2, but it is a bit useless and IDK if its good to add yet another useless command to the game. > > Maybe better to comment it, so if someone wants to debug/test something they just have to re-enable it. I'd make it a setting, if for no other reason that someone will come along and either uncomment it, or delete it. One of the main things is to not leave in commented code blocks -- for those two reasons -- in professional settings.

I never managed to successfully test this as I couldn't get the CSM working.

If anyone can, it might be good.

I never managed to successfully test this as I couldn't get the CSM working. If anyone can, it might be good.
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#3094
No description provided.