mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Added /#time <int> command to server for changing the time of day
This commit is contained in:
parent
2c4351b9b2
commit
041b5e5479
@ -2833,7 +2833,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
||||
line += L"status ";
|
||||
if(is_operator)
|
||||
{
|
||||
line += L"shutdown setting ";
|
||||
line += L"shutdown setting time ";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2867,6 +2867,15 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
||||
send_to_sender = true;
|
||||
valid_command = true;
|
||||
}
|
||||
else if(message_s.substr(0,5) == "time ")
|
||||
{
|
||||
u32 time = stoi(message_s.substr(5));
|
||||
m_time_of_day.set(time);
|
||||
m_time_of_day_send_timer = 0;
|
||||
line += L"-!- time_of_day changed.";
|
||||
send_to_sender = true;
|
||||
valid_command = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(valid_command == false)
|
||||
|
Loading…
Reference in New Issue
Block a user