1
0

Compare commits

...

6 Commits

Author SHA1 Message Date
c047d31989 Disable builtin hunger and use default minetest.do_item_eat if
* adapted the PR https://github.com/MultiCraft/MultiCraft/pull/172
  do not remove but disable by default any refernce and only use it
  if enable explicit
* adapted commit 0a54481b29
2024-06-02 22:09:49 -04:00
cd18cab6d3 fake the user agent to the fuking server list retrieval
* closes https://codeberg.org/minenux/minetest-engine-multicraft2/issues/46
2024-06-02 21:38:01 -04:00
9057310551 use the id to send version as minetest if minetest id is choosen
* this need commit c8c06eaae54c395dc8ff76e402e31d0a51e20906
2024-06-02 21:24:40 -04:00
c94e9cdb9a remove stupid advertise about older servers 2024-06-02 21:16:09 -04:00
c8c06eaae5 Switch to MultiCraft server list an option only
* new settings to send identification
* new settings to make it optinal
* posibility to send information as need as minetest older
2024-06-02 21:07:06 -04:00
Maksym H
59b2c7be48 Version 2.0.6-release but not yet! 2024-06-02 19:31:28 -04:00
13 changed files with 96 additions and 53 deletions

View File

@ -2,9 +2,9 @@
project.ext.set("versionMajor", 2) // Version Major
project.ext.set("versionMinor", 0) // Version Minor
project.ext.set("versionPatch", 5) // Version Patch
project.ext.set("versionPatch", 6) // Version Patch
project.ext.set("versionExtra", "") // Version Extra
project.ext.set("versionCode", 100) // Android Version Code
project.ext.set("versionCode", 200) // Android Version Code
project.ext.set("developmentBuild", 0) // Whether it is a development build, or a release
// NOTE: +3 after each release!
// +1 for ARM, +1 for ARM64 and +1 for x86_64 APK's, because

View File

@ -2196,7 +2196,7 @@
"ENABLE_UPDATE_CHECKER=1",
"VERSION_MAJOR=2",
"VERSION_MINOR=0",
"VERSION_PATCH=5",
"VERSION_PATCH=6",
"VERSION_EXTRA=\"\"",
"DEVELOPMENT_BUILD=1",
);
@ -2221,10 +2221,10 @@
);
INFOPLIST_FILE = MultiCraft/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.adventure-games";
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Minetest.org. All rights reserved.";
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 Minetest.org. All rights reserved.";
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 2.0.5;
MARKETING_VERSION = 2.0.6;
OTHER_LDFLAGS = (
"$(inherited)",
"-L${SRCROOT}/../deps/freetype",
@ -2269,7 +2269,7 @@
"ENABLE_UPDATE_CHECKER=1",
"VERSION_MAJOR=2",
"VERSION_MINOR=0",
"VERSION_PATCH=5",
"VERSION_PATCH=6",
"VERSION_EXTRA=\"\"",
"DEVELOPMENT_BUILD=0",
);
@ -2294,10 +2294,10 @@
);
INFOPLIST_FILE = MultiCraft/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.adventure-games";
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 MultiCraft Studio OÜ. All rights reserved.";
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 minetest.org All rights reserved.";
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 2.0.5;
MARKETING_VERSION = 2.0.6;
OTHER_LDFLAGS = (
"$(inherited)",
"-L${SRCROOT}/../deps/freetype",

View File

@ -48,7 +48,7 @@ endif()
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
set(VERSION_MAJOR 2)
set(VERSION_MINOR 0)
set(VERSION_PATCH 5)
set(VERSION_PATCH 6)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
# Change to false for releases

View File

@ -589,14 +589,10 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed
pos = pos,
max_hear_distance = 16
}, true)
else
core.sound_play("player_eat", {
pos = pos,
max_hear_distance = 16,
gain = 0.3
}, true)
end
if enable_hunger then
local dir = user:get_look_dir()
local ppos = {x = pos.x, y = pos.y + 1.3, z = pos.z}
core.add_particlespawner({
@ -616,6 +612,8 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed
texture = def.inventory_image
})
end
if replace_with_item then
if itemstack:is_empty() then
itemstack:add_item(replace_with_item)
@ -625,7 +623,9 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed
if inv and inv:room_for_item("main", {name=replace_with_item}) then
inv:add_item("main", replace_with_item)
else
pos.y = pos.y + 0.5
local pos = user:get_pos()
if not core.is_valid_pos(pos) then return end
pos.y = floor(pos.y + 0.5)
core.add_item(pos, replace_with_item)
end
end
@ -641,8 +641,11 @@ function core.item_eat(hp_change, replace_with_item, poison)
pointed_thing.ref:right_click(user)
return user:get_wielded_item()
end
if enable_hunger then
return core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing, poison)
else
return core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)
end
end
end
end

View File

@ -151,7 +151,7 @@ local function on_version_info_received(update_info)
-- Show version info dialog (once)
maintab:hide()
local url = update_info.url or "https://multicraft.world/downloads"
local url = "" -- update_info.url or ""
if not url:find("://", 1, true) then
url = "https://" .. url
end

View File

@ -58,13 +58,10 @@ function serverlistmgr.sync()
core.handle_async(
function(param)
local http = core.get_http_api()
local url = ("%s/list?proto_version_min=%d&proto_version_max=%d&platform=%s"):format(
core.settings:get("serverlist_url"),
core.get_min_supp_proto(),
core.get_max_supp_proto(),
PLATFORM)
local url = ("%s/list"):format(
core.settings:get("serverlist_url"))
local response = http.fetch_sync({ url = url })
local response = http.fetch_sync({ url = url, user_agent = "MultiCraft/2.0.6 (Linux/6.6.6-0-liquorix-i686 x86)" })
if not response.succeeded then
return {}
end

View File

@ -17,6 +17,14 @@
--------------------------------------------------------------------------------
local minenux_developers = {
"PICCORO Lenz McKAY <mckaygerhard@gmail.com>",
"Mckay Gerhard (supertodo) <mckayshirou@gmail.com>",
"OldCoder <me@minetest.org>",
"Poikilos Jake Gustafson <tertiary@expertmultimedia.com>",
"And also VenenuX collaborators..!"
}
local multicraft_developers = {
"Maksim Gamarnik (MoNTE48) <Maksym48@pm.me>",
"Bektur Mambetov (ubulem) <berkut87@gmail.com>",
@ -122,7 +130,7 @@ return {
local fs = "image[-0.25,-0.3;2,2;" .. logofile .. "]" ..
"label[1.3,-0.25;" ..
"MultiCraft Open Source, ver. " .. version.string .. "\n" ..
"Copyright (C) 2014" .. os.date("%Y") .. " MultiCraft Development Team\n" ..
"Copyright (C) 2014" .. os.date("%Y") .. " MINENUX\n" ..
"License: GNU LGPLv3.0+ and CC BY-SA 4.0\n" ..
"Created and Powered by Minetest Engine, ver. 5.4.1]" ..
@ -137,6 +145,8 @@ return {
"tableoptions[background=#0000;highlight=#00000000;border=false]" ..
scrollbar_style("list_credits") ..
"table[0,1.5;11.75,4.05;list_credits;" ..
"#FFFF00," .. fgettext("Core Developers") .. " (MinenuX),," ..
buildCreditList(minenux_developers) .. ",,," ..
"#FFFF00," .. fgettext("Core Developers") .. " (MultiCraft),," ..
buildCreditList(multicraft_developers) .. ",,," ..
"#FFFF00," .. fgettext("Core Developers") .. " (Minetest Engine),," ..
@ -159,10 +169,10 @@ return {
end,
cbf_button_handler = function(this, fields, name, tabdata)
if fields.homepage then
core.open_url("https://multicraft.world")
core.open_url("https://minetest.org")
end
if fields.privacy then
core.open_url("https://multicraft.world/privacy")
core.open_url("https://mt.tijerazo.net")
end
--[[if fields.userdata then

View File

@ -382,21 +382,16 @@ local function main_button_handler(tabview, fields, name, tabdata)
if fav_idx and fav_idx <= #serverlist and
fav.address == gamedata.address and
fav.port == gamedata.port then
if not is_server_protocol_compat_or_error(
fav.proto_min, fav.proto_max) then
return true
elseif fav.proto_max and fav.proto_max < 37 and not is_favorite(fav) then
local dlg = create_outdated_server_dlg(fav)
dlg:set_parent(tabview)
tabview:hide()
dlg:show()
return true
end
serverlistmgr.add_favorite(fav)
gamedata.servername = fav.name
gamedata.serverdescription = fav.description
if not is_server_protocol_compat_or_error(
fav.proto_min, fav.proto_max) then
return true
end
else
gamedata.servername = ""
gamedata.serverdescription = ""

View File

@ -1039,10 +1039,13 @@ server_url (Server URL) string https://minetest.net
server_announce (Announce server) bool false
# Announce to this serverlist.
serverlist_url (Serverlist URL) string servers.multicraft.world
serverlist_url (Serverlist URL to anounce if MT server flags announce are false alongside MC server list) string servers.minetest.net
# Announce to MT serverlist.
# announce_mt (Announce to MT) bool true
announce_mt_url (Announce to MT and MC both server list) bool true
# Announce to MT serverlist.
announce_mt_id (Announce as minetest, otherwise identify as multicraft) bool true
# Remove color codes from incoming chat messages
# Use this to stop players from being able to use color in their messages

View File

@ -1222,13 +1222,19 @@
# type: bool
# server_announce = false
# Announce to this serverlist.
# Announce to this serverlist. if announce_mt flags are set this is ignored
# when mt flags are set will be send to this url and also multicraft server list
# type: string
# serverlist_url = servers.multicraft.world
# serverlist_url = servers.minetest.net
# Announce to MT serverlist.
# Announce to MT serverlist and multicraft serverlist.
# type: bool
# announce_mt = true
# announce_mt_url = true
# Announce to serverlist that gameid is minetest otehrwise send multicraft,
# multicraft server announce alway need "multicraft" as server id, minetest ignore it
# type: bool
# announce_mt_id = true
# Remove color codes from incoming chat messages
# Use this to stop players from being able to use color in their messages

View File

@ -44,7 +44,7 @@ void set_default_settings()
settings->setDefault("language", "");
settings->setDefault("name", "");
settings->setDefault("bind_address", "");
settings->setDefault("serverlist_url", "servers.muklticraft.world");
settings->setDefault("serverlist_url", "servers.minetest.net");
// Client
settings->setDefault("address", "");
@ -354,7 +354,7 @@ void set_default_settings()
settings->setDefault("chat_font_size", "0"); // Default "font_size"
// ContentDB
settings->setDefault("contentdb_url", "https://content.multicraft.world");
settings->setDefault("contentdb_url", "https://content.minetest.net");
settings->setDefault("contentdb_max_concurrent_downloads", "3");
#ifdef __ANDROID__
@ -376,7 +376,8 @@ void set_default_settings()
settings->setDefault("disable_texture_packs", "false");
settings->setDefault("disable_escape_sequences", "false");
settings->setDefault("strip_color_codes", "true");
settings->setDefault("announce_mt", "true");
settings->setDefault("announce_mt_url", "true");
settings->setDefault("announce_mt_id", "true");
#if USE_PROMETHEUS
settings->setDefault("prometheus_listener_address", "127.0.0.1:30000");
#endif

View File

@ -3304,6 +3304,9 @@ std::string Server::getStatusString()
os << "# Server: ";
// Version
if (!g_settings->getBool("announce_mt_id").empty())
os << "version=" << "0.4.16";
else
os << "version=" << g_version_string;
// Uptime
os << ", uptime=" << m_uptime_counter->get();

View File

@ -74,8 +74,13 @@ void sendAnnounce(AnnounceAction action,
bool proto_compat = g_settings->getBool("enable_protocol_compat");
server["name"] = g_settings->get("server_name");
server["description"] = g_settings->get("server_description");
if (g_settings->getBool("announce_mt_id")) {
server["version"] = "0.4.16";//g_version_string;
server["server_id"] = "minetest";
} else {
server["version"] = g_version_string;
server["server_id"] = PROJECT_NAME;
server["server_id"] = "multicraft";
}
server["proto_min"] = strict_checking ? LATEST_PROTOCOL_VERSION : (proto_compat ? SERVER_PROTOCOL_VERSION_MIN : SERVER_PROTOCOL_VERSION_MIN_NOCOMPAT);
server["proto_max"] = strict_checking ? LATEST_PROTOCOL_VERSION : SERVER_PROTOCOL_VERSION_MAX;
server["url"] = g_settings->get("server_url");
@ -91,8 +96,12 @@ void sendAnnounce(AnnounceAction action,
for (const std::string &clients_name : clients_names) {
server["clients_list"].append(clients_name);
}
if (!gameid.empty()) {
server["gameid"] = gameid;
} else {
server["gameid"] = "MultiCraft";
}
}
if (action == AA_START) {
server["dedicated"] = dedicated;
@ -109,10 +118,26 @@ void sendAnnounce(AnnounceAction action,
server["lag"] = lag;
}
const std::string json = fastWriteJson(server);
sendAnnounceInner(action, json, g_settings->get("serverlist_url"));
if (g_settings->getBool("announce_mt"))
const std::string json;
if (g_settings->getBool("announce_mt_url")) {
if (g_settings->getBool("announce_mt_id")) {
server["version"] = "0.4.16";//g_version_string;
server["server_id"] = "minetest";
}
json = fastWriteJson(server);
sendAnnounceInner(action, json, base64_decode("c2VydmVycy5taW5ldGVzdC5uZXQ"));
server["version"] = g_version_string;
server["server_id"] = "multicraft";
json = fastWriteJson(server);
sendAnnounceInner(action, json, base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk"));
} else {
json = fastWriteJson(server);
sendAnnounceInner(action, json, g_settings->get("serverlist_url"));
server["version"] = g_version_string;
server["server_id"] = "multicraft";
json = fastWriteJson(server);
sendAnnounceInner(action, json, base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk"));
}
}
#endif