Added /#time <int> command to server for changing the time of day

This commit is contained in:
Perttu Ahola 2011-04-25 11:55:07 +03:00
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)