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

Make the server status message customizable #7357

Merged
merged 1 commit into from Jul 1, 2018

Conversation

Projects
None yet
3 participants
@SmallJoker
Copy link
Member

commented May 20, 2018

Implements feature request in #7354

Remove now redundant setting show_statusline_on_connect
Improve documentation of minetest.get_server_status

Difference to before: The current player name is now shown in the player list too on join.

# Server: version=0.5.0-dev-debug, uptime=0.871, max_lag=0.5459, clients={Foobar}
*** Foobar joined the game.
Make the server status message customizable
Remove now redundant setting show_statusline_on_connect
Improve documentation of `minetest.get_server_status`
// Note things in chat if not in simple singleplayer mode
if (!m_simple_singleplayer_mode && g_settings->getBool("show_statusline_on_connect")) {
// Send information about server to player in chat
SendChatMessage(peer_id, ChatMessage(CHATMESSAGE_TYPE_SYSTEM, getStatusString()));

This comment has been minimized.

Copy link
@sfan5

sfan5 May 20, 2018

Member

does this make getStatusString() dead code?

This comment has been minimized.

Copy link
@SmallJoker

SmallJoker May 20, 2018

Author Member

No, it's still used (in one line) for core.get_server_status().

This comment has been minimized.

Copy link
@nerzhul

nerzhul May 20, 2018

Member

with this change we lost the CHAT_MESSAGE_TYPE_SYSTEM when sending such message

This comment has been minimized.

Copy link
@SmallJoker

SmallJoker May 20, 2018

Author Member

I know but CHATMESSAGE_TYPE_RAW (from core.chat_send_player) and CHATMESSAGE_TYPE_SYSTEM are handled exactly the same way in Client::getChatMessage.
These different types don't seem to be used anywhere outside the previously mentioned function. Is the purpose for them still in progress or is it legacy left-over?

This comment has been minimized.

Copy link
@nerzhul

nerzhul May 20, 2018

Member

it was introduced with the chat rework, intended to CSM to know which type is it and handle it as it wants, like adding colors for each type, for example

This comment has been minimized.

Copy link
@SmallJoker

SmallJoker May 20, 2018

Author Member

Sounds good, but this will definitely need the 3rd argument for chat_send_player again, so the chat message type can be specified by Lua (prepend removed in 9a3b771).
After all also the player join message is sent with that function, which should actually be marked as a server message too.

This comment has been minimized.

Copy link
@nerzhul

nerzhul Jul 1, 2018

Member

yes it's exact

@nerzhul

nerzhul approved these changes Jul 1, 2018

@nerzhul nerzhul added the One approval label Jul 1, 2018

@SmallJoker SmallJoker merged commit 6f22d14 into minetest:master Jul 1, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

nerzhul added a commit to nerzhul/minetest that referenced this pull request Jul 1, 2018

Make the server status message customizable (minetest#7357)
Remove now redundant setting show_statusline_on_connect
Improve documentation of `minetest.get_server_status`

@SmallJoker SmallJoker deleted the SmallJoker:custom_status branch Aug 16, 2018

osjc added a commit to osjc/minetest that referenced this pull request Jan 23, 2019

Make the server status message customizable (minetest#7357)
Remove now redundant setting show_statusline_on_connect
Improve documentation of `minetest.get_server_status`

luk3yx added a commit to luk3yx/minetest that referenced this pull request Mar 13, 2019

Make the server status message customizable (minetest#7357)
Remove now redundant setting show_statusline_on_connect
Improve documentation of `minetest.get_server_status`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.