aboutsummaryrefslogtreecommitdiff
path: root/textures/base/pack/menubg.png
blob: 7cb9c89a637584b4e53c82a7c6eb1ec7109befae (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 10 00 00 00 10 08 02 00 00 00 90 91 68 .PNG........IHDR...............h
0020 36 00 00 03 00 50 4c 54 45 00 00 00 ff 00 00 00 ff 00 ff ff 00 00 00 ff ff 00 ff 00 ff ff ff ff 6....PLTE.......................
0040 ff db db db b6 b6 b6 92 92 92 6d 6d 6d 49 49 49 24 24 24 db 00 00 b6 00 00 92 00 00 6d 00 00 49 ..........mmmIII$$$.........m..I
0060 00 00 24 00 00 00 db 00 00 b6 00 00 92 00 00 6d 00 00 49 00 00 24 00 db db 00 b6 b6 00 92 92 00 ..$............m..I..$..........
0080 6d 6d 00 49 49 00 24 24 00 00 00 db 00 00 b6 00 00 92 00 00 6d 00 00 49 00 00 24 db 00 db b6 00 mm.II.$$............m..I..$.....
00a0 b6 92 00 92 6d 00 6d 49 00 49 24 00 24 00 db db 00 b6 b6 00 92 92 00 6d 6d 00 49 49 00 24 24 ff ....m.mI.I$.$..........mm.II.$$.
00c0 db db db b6 b6 b6 92 92 92 6d 6d 6d 49 49 49 24 24 ff b6 b6 db 92 92 b6 6d 6d 92 49 49 6d 24 24 .........mmmIII$$.......mm.IIm$$
00e0 ff 92 92 db 6d 6d b6 49 49 92 24 24 ff 6d 6d db 49 49 b6 24 24 ff 49 49 db 24 24 ff 24 24 db ff ....mm.II.$$.mm.II.$$.II.$$.$$..
0100 db b6 db b6 92 b6 92 6d 92 6d 49 6d 49 24 49 24 b6 ff b6 92 db 92 6d b6 6d 49 92 49 24 6d 24 92 .......m.mImI$I$......m.mI.I$m$.
0120 ff 92 6d db 6d 49 b6 49 24 92 24 6d ff 6d 49 db 49 24 b6 24 49 ff 49 24 db 24 24 ff 24 db db ff ..m.mI.I$.$m.mI.I$.$I.I$.$$.$...
0140 b6 b6 db 92 92 b6 6d 6d 92 49 49 6d 24 24 49 b6 b6 ff 92 92 db 6d 6d b6 49 49 92 24 24 6d 92 92 ......mm.IIm$$I......mm.II.$$m..
0160 ff 6d 6d db 49 49 b6 24 24 92 6d 6d ff 49 49 db 24 24 b6 49 49 ff 24 24 db 24 24 ff ff ff db db .mm.II.$$.mm.II.$$.II.$$.$$.....
0180 db b6 b6 b6 92 92 92 6d 6d 6d 49 49 49 24 ff ff b6 db db 92 b6 b6 6d 92 92 49 6d 6d 24 ff ff 92 .......mmmIII$........m..Imm$...
01a0 db db 6d b6 b6 49 92 92 24 ff ff 6d db db 49 b6 b6 24 ff ff 49 db db 24 ff ff 24 ff db ff db b6 ..m..I..$..m..I..$..I..$..$.....
01c0 db b6 92 b6 92 6d 92 6d 49 6d 49 24 49 ff b6 ff db 92 db b6 6d b6 92 49 92 6d 24 6d ff 92 ff db .....m.mImI$I.......m..I.m$m....
01e0 6d db b6 49 b6 92 24 92 ff 6d ff db 49 db b6 24 b6 ff 49 ff db 24 db ff 24 ff db ff ff b6 db db m..I..$..m..I..$..I..$..$.......
0200 92 b6 b6 6d 92 92 49 6d 6d 24 49 49 b6 ff ff 92 db db 6d b6 b6 49 92 92 24 6d 6d 92 ff ff 6d db ...m..Imm$II......m..I..$mm...m.
0220 db 49 b6 b6 24 92 92 6d ff ff 49 db db 24 b6 b6 49 ff ff 24 db db 24 ff ff ff db b6 db b6 92 b6 .I..$..m..I..$..I..$..$.........
0240 92 6d 92 6d 49 6d 49 24 49 24 00 ff b6 92 db 92 6d b6 6d 49 92 49 24 6d 24 00 ff b6 db db 92 b6 .m.mImI$I$......m.mI.I$m$.......
0260 b6 6d 92 92 49 6d 6d 24 49 49 00 24 ff 92 b6 db 6d 92 b6 49 6d 92 24 49 6d 00 24 db b6 ff b6 92 .m..Imm$II.$....m..Im.$Im.$.....
0280 db 92 6d b6 6d 49 92 49 24 6d 24 00 49 b6 92 ff 92 6d db 6d 49 b6 49 24 92 24 00 6d b6 db ff 92 ..m.mI.I$m$.I....m.mI.I$.$.m....
02a0 b6 db 6d 92 b6 49 6d 92 24 49 6d 00 24 49 92 b6 ff 6d 92 db 49 6d b6 24 49 92 00 24 6d b6 ff db ..m..Im.$Im.$I...m..Im.$I..$m...
02c0 92 db b6 6d b6 92 49 92 6d 24 6d 49 00 49 24 92 ff b6 6d db 92 49 b6 6d 24 92 49 00 6d 24 db ff ...m..I.m$mI.I$...m..I.m$.I.m$..
02e0 b6 b6 db 92 92 b6 6d 6d 92 49 49 6d 24 24 49 00 b6 ff 92 92 db 6d 6d b6 49 49 92 24 24 6d 00 ff ......mm.IIm$$I......mm.II.$$m..
0300 b6 00 db 92 00 b6 6d 00 92 49 00 ff 00 b6 db 00 92 b6 00 6d 92 00 49 00 b6 ff 00 92 db 00 6d b6 ......m..I.........m..I.......m.
0320 00 49 92 00 00 00 00 00 00 cf 2a 02 04 00 00 02 ed 49 44 41 54 28 cf 05 c1 db 6e db 64 00 00 60 .I........*......IDAT(....n.d..`
0340 fb ff 63 27 76 1c e7 e8 26 ab dd 1c 9a 43 bb 1c 26 25 85 88 ae a8 20 41 06 88 8b 4d 08 6e 06 12 ..c'v...&....C..&%.....A...M.n..
0360 e2 b1 b8 41 e2 25 d8 24 2e 2a 98 34 c6 5a 60 24 6d ba 24 66 4d 9b c4 cd d1 76 5c 3b f1 39 7c 1f ...A.%.$.*.4.Z`$m.$fM....v\;.9|.
0380 fa f5 e7 71 0c 43 a7 92 93 c8 ce 70 81 5b db 4e 26 59 6b 5f 3f db 49 1f fa 43 03 a0 70 e1 94 af ...q.C.....p.[.N&Yk_?.I..C..p...
03a0 d5 ea 39 53 12 b5 de ad 91 18 3c 7a 2f 0f 5d 31 4f a3 21 ab 48 26 df 06 02 b4 bb 14 a3 ac 15 09 ..9S......<z/.]1O.!.H&..........
03c0 94 8c 29 75 33 e2 7d 91 18 97 39 b0 f4 cb 33 61 53 da 27 c1 c0 33 57 a7 9b a5 c3 d0 6c 2b 48 7c ..)u3.}...9...3aS.'..3W.....l+H|
03e0 77 3d 14 a9 cc 91 c7 fb d9 f3 ee 4b 6f 44 bb 59 4b fe b0 7f 75 c3 93 06 51 df af 5a 40 03 04 6f w=.........KoD.YK...u...Q..Z@..o
0400 df a2 a6 57 55 b4 40 4a 19 9d e4 2a 0f 55 55 65 f6 b8 06 67 8d c7 b7 df 34 2a 93 e6 f5 36 45 8f ...WU.@J...*.UUe...g....4*...6E.
0420 27 9b 7c 12 ed f3 00 e6 f6 55 b6 bc 7d d9 d5 82 1e 52 b9 18 ef a7 e2 6b f1 ef bf 9e 9f 8e 6d fc '.|......U..}....R.....k......m.
0440 2d b2 38 fd e5 8e 2a 55 88 a0 50 2a ee 3d 3b 7b b5 3b 03 30 cd 16 10 37 f4 f8 ab 1f 66 37 62 b8 -.8...*U..P*.=;{.;.0...7....f7b.
0460 da 13 64 1a b2 00 47 d8 9d 6c d6 1c 9b 5c 04 14 53 e8 8f 3f 77 8c c9 b2 f1 e9 d3 37 7a 13 7e ff ..d...G..l...\..S..?w......7z.~.
0480 e4 48 97 9b 0b 7b 03 ef fe 7c f3 0e 1b da 6b bb 6b 76 47 4a bb 23 48 b2 91 28 50 33 45 c3 1c f7 .H...{...|....k.kvGJ.#H..(P3E...
04a0 a3 c6 17 23 e9 77 36 c1 c0 62 34 ae 22 ce c9 1f bd 46 ad 7e d2 e9 e7 6c da eb 85 32 bc 2b 73 24 ...#.w6..b4."....F.~...l...2.+s$
04c0 13 42 36 4e 32 66 4a f7 8e eb a8 74 ba 98 48 bf bd e8 c1 6d 6c 75 2e 0c 58 3a fa b2 f9 df 97 8f .B6N2fJ....t..H....mlu..X:......
04e0 2a 1a 29 fb d3 44 15 62 fe a8 35 17 83 e7 17 a3 a7 9f d4 c6 83 d7 21 ec 81 c1 cf 61 dc 86 c7 d5 *.)..D.b..5...........!....a....
0500 34 12 5c 85 e9 98 ba 91 5a ff 68 fe 18 b8 3c 13 b6 bc 81 a1 0a c8 f2 f6 b1 cf f3 53 b3 b9 b7 93 4.\.....Z.h...<............S....
0520 b5 7d de 05 b8 cc 47 6b b0 94 64 a2 34 90 a7 20 e2 01 54 50 a6 5c bd 10 89 77 91 a1 b2 b2 fd c2 .}....Gk..d.4.....TP.\...w......
0540 8a 37 e4 ca c3 18 b1 00 93 e5 b8 c8 14 85 c9 15 8c 67 dd 1c c9 65 76 31 3c 26 ed 80 14 17 c9 b9 .7...............g...ev1<&......
0560 7d 9d 2b e7 34 d1 ae 1f d7 95 5e 8f f6 a9 6c e5 f0 0e d9 f4 87 c2 4a 30 e0 b7 1f df ff 77 c4 bf }.+.4.....^...l.......J0.....w..
0580 e8 cd 3f 84 1c 9a c1 e5 50 20 5d 8a 2b bf 5e a5 0a 33 74 66 51 65 92 40 68 c7 b2 ef fb 99 f6 b9 ..?.....P.].+.^..3tfQe.@h.......
05a0 ca 53 3a fc 20 4b f0 d7 70 8f dd 72 10 7d a4 08 62 c7 69 0d 5f 15 6a 07 36 8e 3b b8 3e e1 01 91 .S:..K..p..r.}..b.i._.j.6.;.>...
05c0 ad b6 3b 7c 3b 61 eb f2 38 1d 5e c3 f7 73 b4 74 35 39 7c 94 41 22 d8 3d 33 8f 10 17 18 0e b6 36 ..;|;a..8.^..s.t59|.A".=3......6
05e0 a6 2c 2f bd 07 55 53 bc 9d 0c 3a 9b 29 7e d5 d6 53 87 09 52 4c c3 07 b5 14 9b 64 d6 96 e0 33 bc .,/..US...:.)~..S..RL.....d...3.
0600 af fb 22 e5 b8 2b 18 70 ad 68 6a 37 33 1f e0 50 6b 1b 86 8a 90 3e 12 63 c0 14 a1 cc e5 ff 1a 78 .."..+.p.hj73..Pk....>.c.......x
0620 72 6b ea 29 29 f1 00 00 00 00 49 45 4e 44 ae 42 60 82 rk.)).....IEND.B`.
#n330'>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 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>

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.
*/

/*
SQLite format specification:
	blocks:
		(PK) INT id
		BLOB data
*/


#include "database-sqlite3.h"

#include "log.h"
#include "filesys.h"
#include "exceptions.h"
#include "settings.h"
#include "porting.h"
#include "util/string.h"
#include "content_sao.h"
#include "remoteplayer.h"

#include <cassert>

// When to print messages when the database is being held locked by another process
// Note: I've seen occasional delays of over 250ms while running minetestmapper.
#define BUSY_INFO_TRESHOLD	100	// Print first informational message after 100ms.
#define BUSY_WARNING_TRESHOLD	250	// Print warning message after 250ms. Lag is increased.
#define BUSY_ERROR_TRESHOLD	1000	// Print error message after 1000ms. Significant lag.
#define BUSY_FATAL_TRESHOLD	3000	// Allow SQLITE_BUSY to be returned, which will cause a minetest crash.
#define BUSY_ERROR_INTERVAL	10000	// Safety net: report again every 10 seconds


#define SQLRES(s, r, m) \
	if ((s) != (r)) { \
		throw DatabaseException(std::string(m) + ": " +\
				sqlite3_errmsg(m_database)); \
	}
#define SQLOK(s, m) SQLRES(s, SQLITE_OK, m)

#define PREPARE_STATEMENT(name, query) \
	SQLOK(sqlite3_prepare_v2(m_database, query, -1, &m_stmt_##name, NULL),\
		"Failed to prepare query '" query "'")

#define SQLOK_ERRSTREAM(s, m)                           \
	if ((s) != SQLITE_OK) {                             \
		errorstream << (m) << ": "                      \
			<< sqlite3_errmsg(m_database) << std::endl; \
	}

#define FINALIZE_STATEMENT(statement) SQLOK_ERRSTREAM(sqlite3_finalize(statement), \
	"Failed to finalize " #statement)

int Database_SQLite3::busyHandler(void *data, int count)
{
	s64 &first_time = reinterpret_cast<s64 *>(data)[0];
	s64 &prev_time = reinterpret_cast<s64 *>(data)[1];
	s64 cur_time = porting::getTimeMs();

	if (count == 0) {
		first_time = cur_time;
		prev_time = first_time;
	} else {
		while (cur_time < prev_time)
			cur_time += s64(1)<<32;
	}

	if (cur_time - first_time < BUSY_INFO_TRESHOLD) {
		; // do nothing
	} else if (cur_time - first_time >= BUSY_INFO_TRESHOLD &&
			prev_time - first_time < BUSY_INFO_TRESHOLD) {
		infostream << "SQLite3 database has been locked for "
			<< cur_time - first_time << " ms." << std::endl;
	} else if (cur_time - first_time >= BUSY_WARNING_TRESHOLD &&
			prev_time - first_time < BUSY_WARNING_TRESHOLD) {
		warningstream << "SQLite3 database has been locked for "
			<< cur_time - first_time << " ms." << std::endl;
	} else if (cur_time - first_time >= BUSY_ERROR_TRESHOLD &&
			prev_time - first_time < BUSY_ERROR_TRESHOLD) {
		errorstream << "SQLite3 database has been locked for "
			<< cur_time - first_time << " ms; this causes lag." << std::endl;