aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-04-25 11:55:07 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-04-25 11:55:07 +0300
commit041b5e54797f03a22bd96153b8d232630c71592a (patch)
tree9925c6df9b296d4a7e6760547656fc89dddf72b4 /src
parent2c4351b9b24103393f699695e2dddc25dfb94f31 (diff)
downloadminetest-041b5e54797f03a22bd96153b8d232630c71592a.tar.gz
minetest-041b5e54797f03a22bd96153b8d232630c71592a.tar.bz2
minetest-041b5e54797f03a22bd96153b8d232630c71592a.zip
Added /#time <int> command to server for changing the time of day
Diffstat (limited to 'src')
-rw-r--r--src/server.cpp11
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)