Broadcast message function

This commit is contained in:
Jamie Cameron
2013-02-10 12:56:42 -08:00
parent 8b22e61768
commit 35a635cb85
3 changed files with 14 additions and 0 deletions

View File

@@ -59,6 +59,11 @@ print &ui_table_row($text{'cmds_weather'},
&ui_textbox("secs", 5, 5)." ".
&ui_submit($text{'cmds_weatherb'}, 'weather'));
# Broadcast message
print &ui_table_row($text{'cmds_say'},
&ui_textbox("text", undef, 40)." ".
&ui_submit($text{'cmds_sayb'}, 'say'));
print &ui_table_end();
print &ui_form_end();

View File

@@ -234,6 +234,9 @@ cmds_etimeadd=Time to add must be a number between 0 and 24000
cmds_timedone=Changed game time
cmds_gamemodedone=Changed default game mode to $1
cmds_difficultydone=Changed game difficulty
cmds_say=Broadcast message
cmds_sayb=Send
cmds_msgdone=Sent message to all players
manual_title=Edit Configuration File
manual_desc=This page allows you to manually edit the Minecraft server configuration file <tt>$1</tt>. Be careful, as no validation will be done on your input. Any changes will not be activated until the server is restarted.

View File

@@ -67,6 +67,12 @@ elsif ($in{'weather'}) {
&error(&html_escape($out));
$msg = &text('cmds_weatherdone', $in{'wtype'}, $in{'secs'});
}
elsif ($in{'say'}) {
# Broadcast message
$in{'text'} =~ /\S/ || &error($text{'conn_etext'});
&send_server_command("/say $in{'text'}");
$msg = $text{'cmds_msgdone'};
}
else {
&error($text{'conn_ebutton'});
}