From b65a5aceb0d6552d8ba4878bed5326c614dd3046 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 16 Oct 2011 14:57:53 +0300 Subject: Use the logger; also, default to not showing much crap in console. Use --info-on-stderr to enable crap. --- src/servercommand.cpp | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'src/servercommand.cpp') diff --git a/src/servercommand.cpp b/src/servercommand.cpp index 6c864e2c4..98777adcc 100644 --- a/src/servercommand.cpp +++ b/src/servercommand.cpp @@ -20,6 +20,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "utility.h" #include "settings.h" +#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")" + void cmd_status(std::wostringstream &os, ServerCommandContext *ctx) { @@ -94,10 +96,17 @@ void cmd_grantrevoke(std::wostringstream &os, std::string playername = wide_to_narrow(ctx->parms[1]); u64 privs = ctx->server->getPlayerAuthPrivs(playername); - if(ctx->parms[0] == L"grant") + if(ctx->parms[0] == L"grant"){ + actionstream<player->getName()<<" grants " + <parms[2])<<" to " + <player->getName()<<" revokes " + <parms[2])<<" from " + <server->setPlayerAuthPrivs(playername, privs); @@ -123,6 +132,9 @@ void cmd_time(std::wostringstream &os, u32 time = stoi(wide_to_narrow(ctx->parms[1])); ctx->server->setTimeOfDay(time); os<player->getName()<<" sets time " + <player->getName() + <<" shuts down server"<server->requestShutdown(); os<paramstring); + actionstream<player->getName() + <<" sets: "<parseConfigLine(confline); ctx->server->saveConfig(); @@ -186,6 +202,11 @@ void cmd_teleport(std::wostringstream &os, } v3f dest(stoi(coords[0])*10, stoi(coords[1])*10, stoi(coords[2])*10); + + actionstream<player->getName()<<" teleports from " + <player->getPosition()/BS)<<" to " + <player->setPosition(dest); ctx->server->SendMovePlayer(ctx->player); @@ -226,6 +247,9 @@ void cmd_banunban(std::wostringstream &os, ServerCommandContext *ctx) ctx->server->setIpBanned(ip_string, player->getName()); os<getName()); + + actionstream<player->getName()<<" bans " + <getName()<<" / "<server->getBanDescription(ip_or_name); ctx->server->unsetIpBanned(ip_or_name); os<player->getName()<<" unbans " + <