aboutsummaryrefslogtreecommitdiff
Commit message (Expand)AuthorAge
...
* Support different types of speed restrictions; add documentationywang2021-11-07
* round speed limit if neededywang2021-11-05
* make distant signal aspect dropdown labels consistent with the ones for the m...ywang2021-11-05
* Do not allow adjusting Ks signals with trackworkersywang2021-11-05
* Re-add Zs 3(v) indicators; swap green and yellow lights for realismywang2021-11-05
* Use realistic Ra 10 signal signywang2021-11-05
* On-Track Collision system: Fix train teleportation when using split_at_index(...orwell962021-11-04
* LuaATC: remove accidental mesecons hard-dependencyorwell962021-11-04
* LuaATC: Fix position of error label, use consistent name "LuaATC" instead of ...orwell962021-11-02
* LuaATC: Add Mesecons LuaATC Controller (similar to Mesecons Luacontroller)orwell962021-11-02
* LuaATC PCNaming: Allow naming active components using the toolorwell962021-11-02
* Route Formspec: When cancelling route, disable ARS only temporarily, not perm...orwell962021-10-26
* Coupler types: Better output when there are no couplers on a wagonorwell962021-10-25
* Coupling: Add concept of coupler types, allow coupling only when coupler type...orwell962021-10-25
* Train Coupling: Change behavior so that train direction of initiating train i...orwell962021-10-25
* Disable position-based collision and coupling system for very short trains (s...orwell962021-07-07
* Rework train same-track collision system and deterministic couplingorwell962021-07-07
* Shutdown callback: don't save advtrains save files when MT crashed within adv...orwell962021-07-07
* Make the collision mode configurableGabriel Pérez-Cerezo2021-06-30
* Train-World collisions: Collide only with 'normal'-drawtype nodes.orwell962021-06-29
* Entity Damage: Correct sign entity nameorwell962021-06-29
* Trains splitting: retain important properties (door state, line, texts etc)orwell962021-05-22
* Serialization: strip trailing \r also in nodedb callbackrelease-2.3.1orwell962021-05-07
* Merge commit 'd4593491efbcab47efd918d7918b97b4621828b3'orwell962021-05-03
|\
| * Strip trailing \r's also for first and last lineorwell962021-05-03
| * Make strict loading the defaultorwell962021-05-03
| * Strip trailing \r from lines (possibly fixes windows migration)orwell962021-05-03
* | Deregister player from train on death in all cases (fixes #119)release-2.3.0orwell962021-04-25
* | Prevent splitting trains when they're off track (fixes #178)orwell962021-04-25
* | Hopefully fix #177orwell962021-04-25
* | Fix undeclared globals warnings (#176)orwell962021-04-25
* | Add check for box inventoryGabriel Pérez-Cerezo2021-04-11
* | Add /at_whereis command to check the position of a train.Gabriel Pérez-Cerezo2021-04-10
* | Update serialize_liborwell962021-04-04
|\|
| * Open files in binary mode; also serialize carriage returnorwell962021-04-04
| * Add documentation and licenseorwell962021-03-22
| * Fix init.lua functions to do what is documented on errororwell962021-03-22
* | Remove sounds = default.sound_stone_defaults() as default is no longer a depe...orwell962021-04-04
* | Make mesecons_switch a proper optional dependency (H#175)Blockhead2021-03-31
* | Increase size of LuaATC code input forms to 15x12 unitsorwell962021-03-22
* | Remove "Last punched" from LuaATC init code fshlqkj2021-03-22
* | Rework route ui formspec layouthlqkj2021-03-22
* | Rework active_common formspec layouthlqkj2021-03-22
* | Rework envsetup formspec layouthlqkj2021-03-22
* | Use mono font to ATC rail command fieldshlqkj2021-03-22
* | Rework stoprail formspec layout and add mono stylehlqkj2021-03-22
* | Do not return early after setting station info on stop railBlockhead2021-03-22
* | Do not crash when operating signals without interlockingBlockhead2021-03-22
* | Add 'serialize_lib/' from commit 'a6e8b8b4353863ad563a4d5187f40fea702ea2de'orwell962021-03-13
|\|
| * mod.conf: Add more information about the mod, not just the nameorwell962021-03-13
='n455' href='#n455'>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 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039
--Minetest
--Copyright (C) 2018-20 rubenwardy
--
--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.

if not core.get_http_api then
	function create_store_dlg()
		return messagebox("store",
				fgettext("ContentDB is not available when Minetest was compiled without cURL"))
	end
	return
end

-- Unordered preserves the original order of the ContentDB API,
-- before the package list is ordered based on installed state.
local store = { packages = {}, packages_full = {}, packages_full_unordered = {} }

local http = core.get_http_api()

-- Screenshot
local screenshot_dir = core.get_cache_path() .. DIR_DELIM .. "cdb"
assert(core.create_dir(screenshot_dir))
local screenshot_downloading = {}
local screenshot_downloaded = {}

-- Filter
local search_string = ""
local cur_page = 1
local num_per_page = 5
local filter_type = 1
local filter_types_titles = {
	fgettext("All packages"),
	fgettext("Games"),
	fgettext("Mods"),
	fgettext("Texture packs"),
}

local number_downloading = 0
local download_queue = {}

local filter_types_type = {
	nil,
	"game",
	"mod",
	"txp",
}

local REASON_NEW = "new"
local REASON_UPDATE = "update"
local REASON_DEPENDENCY = "dependency"


local function get_download_url(package, reason)
	local base_url = core.settings:get("contentdb_url")
	local ret = base_url .. ("/packages/%s/%s/releases/%d/download/"):format(package.author, package.name, package.release)
	if reason then
		ret = ret .. "?reason=" .. reason
	end
	return ret
end


local function download_package(param)
	if core.download_file(param.url, param.filename) then
		return {
			filename = param.filename,
			successful = true,
		}
	else
		core.log("error", "downloading " .. dump(param.url) .. " failed")
		return {
			successful = false,
		}
	end
end

local function start_install(package, reason)
	local params = {
		package = package,
		url = get_download_url(package, reason),