aboutsummaryrefslogtreecommitdiff
path: root/textures/base/pack/no_screenshot.png
blob: 8c7089897218a4aa453493ad6d25e360501dfc5a (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 2c 00 00 00 c8 08 04 00 00 00 f8 d6 14 .PNG........IHDR...,............
0020 de 00 00 00 01 73 52 47 42 00 ae ce 1c e9 00 00 00 02 62 4b 47 44 00 85 37 5f 54 9d 00 00 00 09 .....sRGB.........bKGD..7_T.....
0040 70 48 59 73 00 00 0b 13 00 00 0b 13 01 00 9a 9c 18 00 00 00 07 74 49 4d 45 07 e0 07 19 14 31 3b pHYs.................tIME.....1;
0060 29 d8 90 1d 00 00 01 ce 49 44 41 54 78 da ed dd 41 0e c2 20 14 40 41 30 9c 98 83 70 65 dc b4 9b ).......IDATx...A....@A0...pe...
0080 5a 81 9a b6 09 76 66 63 4c 57 c5 e7 47 8d 09 31 c0 4f ea f2 18 77 af be 2c 10 57 10 16 c2 42 58 Z....vfcLW..G..1.O...w..,.W...BX
00a0 08 0b 84 85 b0 10 16 08 0b 61 f1 58 fb bf c7 87 9a 2d 0d 83 8a 89 85 ad 10 61 c1 87 d4 f9 08 56 .........a.X.....-.......a.....V
00c0 2c d1 d9 da 7f 37 99 e8 3e 72 eb 3e 4c 2c 6c 85 08 0b 61 81 b0 10 16 c2 02 61 21 2c 84 05 c2 42 ,....7..>r.>L,l...a......a!,...B
00e0 58 08 0b 84 85 b0 10 16 08 0b 61 21 2c 10 16 c2 42 58 20 2c 84 85 b0 40 58 08 0b 61 81 b0 10 16 X.........a!,...BX.,...@X..a....
0100 c2 02 61 21 2c 84 05 c2 42 58 08 0b 84 85 b0 10 16 08 0b 61 21 2c 10 16 c2 42 58 20 2c 84 85 b0 ..a!,...BX.........a!,...BX.,...
0120 60 48 b2 04 8c 39 76 32 ac 89 85 ad 10 61 21 2c 10 16 c2 42 58 20 2c 84 85 b0 40 58 08 0b 61 81 `H...9v2.....a!,...BX.,...@X..a.
0140 b0 10 16 c2 02 61 21 2c 84 05 c2 42 58 08 0b 84 85 b0 10 16 08 0b 61 21 2c 10 16 c2 42 58 20 2c .....a!,...BX.........a!,...BX.,
0160 84 85 b0 40 58 08 0b 61 81 b0 10 16 c2 02 61 21 2c 84 05 c2 42 58 08 0b 84 85 b0 10 16 08 0b 61 ...@X..a......a!,...BX.........a
0180 21 2c 10 16 c2 42 58 20 2c 84 85 b0 40 58 08 0b 61 81 b0 10 16 c2 02 61 21 2c 84 05 c2 42 58 4c !,...BX.,...@X..a......a!,...BXL
01a0 2d b5 2f 57 2b 84 89 85 b0 10 16 9c fe 19 2b 5a 21 4c 2c 84 85 b0 40 58 08 0b 61 81 b0 10 16 c2 -./W+.........+Z!L,...@X..a.....
01c0 02 61 21 2c 84 05 c2 42 58 08 0b 84 85 b0 10 16 08 0b 61 21 2c 10 16 c2 42 58 20 2c 84 85 b0 40 .a!,...BX.........a!,...BX.,...@
01e0 58 08 0b 61 81 b0 10 16 c2 02 61 21 2c 84 05 c2 42 58 08 0b 84 85 b0 10 16 08 0b 61 21 2c 58 f5 X..a......a!,...BX.........a!,X.
0200 4e 58 cd 96 88 4d 13 9d e7 26 16 b6 42 84 05 e1 eb 11 aa 75 73 d9 69 f6 b7 bf 04 26 16 1c fe 56 NX...M...&..B......us.i....&...V
0220 f8 df ef 2a 4c 2c 84 05 c2 42 58 08 0b 61 59 02 84 85 b0 78 b6 37 c1 92 0f 0a f7 fe d3 b1 00 00 ...*L,...BX..aY....x.7..........
0240 00 00 49 45 4e 44 ae 42 60 82 ..IEND.B`.
137'>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 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser 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 "l_client.h"
#include "chatmessage.h"
#include "client/client.h"
#include "client/clientevent.h"
#include "client/sound.h"
#include "client/clientenvironment.h"
#include "common/c_content.h"
#include "common/c_converter.h"
#include "cpp_api/s_base.h"
#include "gettext.h"
#include "l_internal.h"
#include "lua_api/l_nodemeta.h"
#include "gui/mainmenumanager.h"
#include "map.h"
#include "util/string.h"
#include "nodedef.h"

#define checkCSMRestrictionFlag(flag) \
	( getClient(L)->checkCSMRestrictionFlag(CSMRestrictionFlags::flag) )

// Not the same as FlagDesc, which contains an `u32 flag`
struct CSMFlagDesc {
	const char *name;
	u64 flag;
};

/*
	FIXME: This should eventually be moved somewhere else
	It also needs to be kept in sync with the definition of CSMRestrictionFlags
	in network/networkprotocol.h
*/
const static CSMFlagDesc flagdesc_csm_restriction[] = {
	{"load_client_mods",  CSM_RF_LOAD_CLIENT_MODS},
	{"chat_messages",     CSM_RF_CHAT_MESSAGES},
	{"read_itemdefs",     CSM_RF_READ_ITEMDEFS},
	{"read_nodedefs",     CSM_RF_READ_NODEDEFS},
	{"lookup_nodes",      CSM_RF_LOOKUP_NODES},
	{"read_playerinfo",   CSM_RF_READ_PLAYERINFO},
	{NULL,      0}
};

// get_current_modname()
int ModApiClient::l_get_current_modname(lua_State *L)
{
	lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_CURRENT_MOD_NAME);
	return 1;
}

// get_modpath(modname)
int ModApiClient::l_get_modpath(lua_State *L)
{
	std::string modname = readParam<std::string>(L, 1);
	// Client mods use a virtual filesystem, see Client::scanModSubfolder()
	std::string path = modname + ":";
	lua_pushstring(L, path.c_str());
	return 1;
}