diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-04-25 11:55:07 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-04-25 11:55:07 +0300 |
commit | 041b5e54797f03a22bd96153b8d232630c71592a (patch) | |
tree | 9925c6df9b296d4a7e6760547656fc89dddf72b4 | |
parent | 2c4351b9b24103393f699695e2dddc25dfb94f31 (diff) | |
download | minetest-041b5e54797f03a22bd96153b8d232630c71592a.tar.gz minetest-041b5e54797f03a22bd96153b8d232630c71592a.tar.bz2 minetest-041b5e54797f03a22bd96153b8d232630c71592a.zip |
Added /#time <int> command to server for changing the time of day
-rw-r--r-- | src/server.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp index 20a14fca3..9c02389e2 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) |