From: Perttu Ahola Date: Mon, 25 Apr 2011 08:55:07 +0000 (+0300) Subject: Added /#time command to server for changing the time of day X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=041b5e54797f03a22bd96153b8d232630c71592a;p=zefram%2Fminetest%2Fminetest_engine.git Added /#time command to server for changing the time of day --- diff --git a/src/server.cpp b/src/server.cpp index 20a14fca..9c02389e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -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)