summaryrefslogtreecommitdiff
path: root/fonts/lucida_sans_6.xml
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere-weblate@hungry.com>2016-10-25 21:36:17 +0000
committerest31 <MTest31@outlook.com>2016-12-14 00:27:19 +0100
commitef4eb46b617d7602ef9aa91e777fd3a03cd6bd73 (patch)
tree272e6c51a085290f777041e932a0d587596de922 /fonts/lucida_sans_6.xml
parenta2c446725505f822b4bfe1f0dd3c652f127b20d0 (diff)
downloadminetest-ef4eb46b617d7602ef9aa91e777fd3a03cd6bd73.tar.gz
minetest-ef4eb46b617d7602ef9aa91e777fd3a03cd6bd73.tar.bz2
minetest-ef4eb46b617d7602ef9aa91e777fd3a03cd6bd73.zip
Translated using Weblate (Norwegian Bokmål)
Currently translated at 1.4% (13 of 918 strings)
Diffstat (limited to 'fonts/lucida_sans_6.xml')
0 files changed, 0 insertions, 0 deletions
1'>121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
/*
Minetest-c55
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2011 Ciaran Gultnieks <ciaran@ciarang.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/


#include "servercommand.h"
#include "utility.h"

void cmd_status(std::wostringstream &os,
	ServerCommandContext *ctx)
{
	os<<ctx->server->getStatusString();
}

void cmd_privs(std::wostringstream &os,
	ServerCommandContext *ctx)
{
	if(ctx->parms.size() == 1)
	{
		// Show our own real privs, without any adjustments
		// made for admin status
		os<<L"-!- " + privsToString(ctx->player->privs);
		return;
	}

	if((ctx->privs & PRIV_PRIVS) == 0)
	{
		os<<L"-!- You don't have permission to do that";
		return;
	}
		
	Player *tp = ctx->env->getPlayer(wide_to_narrow(ctx->parms[1]).c_str());
	if(tp == NULL)
	{
		os<<L"-!- No such player";
		return;
	}
	
	os<<L"-!- " + privsToString(tp->privs);
}

void cmd_grantrevoke(std::wostringstream &os,
	ServerCommandContext *ctx)
{
	if(ctx->parms.size() != 3)
	{
		os<<L"-!- Missing parameter";
		return;
	}

	if((ctx->privs & PRIV_PRIVS) == 0)
	{
		os<<L"-!- You don't have permission to do that";
		return;
	}

	u64 newprivs = stringToPrivs(ctx->parms[2]);
	if(newprivs == PRIV_INVALID)
	{
		os<<L"-!- Invalid privileges specified";
		return;
	}

	Player *tp = ctx->env->getPlayer(wide_to_narrow(ctx->parms[1]).c_str());
	if(tp == NULL)
	{
		os<<L"-!- No such player";
		return;
	}

	if(ctx->parms[0] == L"grant")
		tp->privs |= newprivs;
	else
		tp->privs &= ~newprivs;
	
	os<<L"-!- Privileges change to ";
	os<<privsToString(tp->privs);
}

void cmd_time(std::wostringstream &os,
	ServerCommandContext *ctx)
{
	if(ctx->parms.size() != 2)
	{
		os<<L"-!- Missing parameter";
		return;
	}

	if((ctx->privs & PRIV_SETTIME) ==0)
	{
		os<<L"-!- You don't have permission to do that";
		return;
	}

	u32 time = stoi(wide_to_narrow(ctx->parms[1]));
	ctx->server->setTimeOfDay(time);
	os<<L"-!- time_of_day changed.";
}

void cmd_shutdown(std::wostringstream &os,
	ServerCommandContext *ctx)
{
	if((ctx->privs & PRIV_SERVER) ==0)
	{
		os<<L"-!- You don't have permission to do that";
		return;
	}

	dstream<<DTIME<<" Server: Operator requested shutdown."
		<<std::endl;
	ctx->server->requestShutdown();
					
	os<<L"*** Server shutting down (operator request)";
	ctx->flags |= 2;
}

void cmd_setting(std::wostringstream &os,
	ServerCommandContext *ctx)
{
	if((ctx->privs & PRIV_SERVER) ==0)
	{
		os<<L"-!- You don't have permission to do that";
		return;
	}

	std::string confline = wide_to_narrow(ctx->parms[1] + L" = " + ctx->parms[2]);
	g_settings.parseConfigLine(confline);
	os<< L"-!- Setting changed.";
}

void cmd_teleport(std::wostringstream &os,
	ServerCommandContext *ctx)
{