Make it compile

master
luk3yx 2021-06-11 18:14:03 +12:00 committed by MoNTE48
parent 1aabc2ca14
commit 9bd686216a
23 changed files with 116 additions and 130 deletions

View File

@ -28,6 +28,8 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install GNU gettext
run: sudo apt install gettext
- name: Build with Gradle
run: cd build/android; ./gradlew assemblerelease
- name: Save armeabi artifact

View File

@ -218,8 +218,8 @@ jobs:
name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
runs-on: windows-2019
env:
VCPKG_VERSION: 0bf3923f9fab4001c00f0f429682a0853b5749e0
# 2020.11
VCPKG_VERSION: 5568f110b509a9fd90711978a7cb76bae75bb092
# 2021.05.12
vcpkg_packages: irrlicht zlib curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit
strategy:
fail-fast: false
@ -245,7 +245,7 @@ jobs:
uses: actions/checkout@v2
- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v5
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: ${{env.vcpkg_packages}}
vcpkgDirectory: '${{ github.workspace }}\vcpkg'

View File

@ -302,6 +302,8 @@
84F20F4C25D52975009562A9 /* mapgen_fractal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20F3A25D52975009562A9 /* mapgen_fractal.cpp */; };
84F20F4D25D52975009562A9 /* mapgen_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20F3B25D52975009562A9 /* mapgen_v7.cpp */; };
84F20F4E25D52975009562A9 /* mapgen_v5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20F3C25D52975009562A9 /* mapgen_v5.cpp */; };
84FD8E3126A0B01D00EF2BFA /* guiEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FD8E3026A0B01D00EF2BFA /* guiEditBox.cpp */; };
84FD8E3426A0B04900EF2BFA /* guiScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FD8E3326A0B04900EF2BFA /* guiScene.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@ -933,6 +935,10 @@
84F20F3B25D52975009562A9 /* mapgen_v7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mapgen_v7.cpp; path = ../../../../src/mapgen/mapgen_v7.cpp; sourceTree = "<group>"; };
84F20F3C25D52975009562A9 /* mapgen_v5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mapgen_v5.cpp; path = ../../../../src/mapgen/mapgen_v5.cpp; sourceTree = "<group>"; };
84F20F3D25D52975009562A9 /* mapgen_v6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mapgen_v6.h; path = ../../../../src/mapgen/mapgen_v6.h; sourceTree = "<group>"; };
84FD8E2F26A0B01D00EF2BFA /* guiEditBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiEditBox.h; path = ../../../../src/gui/guiEditBox.h; sourceTree = "<group>"; };
84FD8E3026A0B01D00EF2BFA /* guiEditBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiEditBox.cpp; path = ../../../../src/gui/guiEditBox.cpp; sourceTree = "<group>"; };
84FD8E3226A0B04900EF2BFA /* guiScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiScene.h; path = ../../../../src/gui/guiScene.h; sourceTree = "<group>"; };
84FD8E3326A0B04900EF2BFA /* guiScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiScene.cpp; path = ../../../../src/gui/guiScene.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -1058,6 +1064,8 @@
84F20ED725D52955009562A9 /* guiChatConsole.h */,
84F20EF325D52957009562A9 /* guiConfirmRegistration.cpp */,
84F20ED325D52955009562A9 /* guiConfirmRegistration.h */,
84FD8E3026A0B01D00EF2BFA /* guiEditBox.cpp */,
84FD8E2F26A0B01D00EF2BFA /* guiEditBox.h */,
84F20ECB25D52954009562A9 /* guiEditBoxWithScrollbar.cpp */,
84F20EEE25D52957009562A9 /* guiEditBoxWithScrollbar.h */,
84F20EEB25D52957009562A9 /* guiEngine.cpp */,
@ -1077,6 +1085,8 @@
84F20ECD25D52955009562A9 /* guiPasswordChange.h */,
84F20EF525D52957009562A9 /* guiPathSelectMenu.cpp */,
84F20EDA25D52955009562A9 /* guiPathSelectMenu.h */,
84FD8E3326A0B04900EF2BFA /* guiScene.cpp */,
84FD8E3226A0B04900EF2BFA /* guiScene.h */,
84F20EFD25D52958009562A9 /* guiScrollBar.cpp */,
84F20EDD25D52956009562A9 /* guiScrollBar.h */,
84F20EF625D52957009562A9 /* guiScrollContainer.cpp */,
@ -1212,7 +1222,6 @@
84135B4A25D5264600CA4DCF /* emerge.h */,
84135B0C25D5263100CA4DCF /* environment.cpp */,
84135AD925D5261F00CA4DCF /* environment.h */,
84135B1525D5263500CA4DCF /* mtevent.h */,
84135AF925D5262800CA4DCF /* exceptions.h */,
84135AFE25D5262B00CA4DCF /* face_position_cache.cpp */,
84135AEA25D5262200CA4DCF /* face_position_cache.h */,
@ -1263,6 +1272,7 @@
84135AC725D5261C00CA4DCF /* modchannels.cpp */,
84135B4E25D5264700CA4DCF /* modchannels.h */,
84135AE925D5262200CA4DCF /* modifiedstate.h */,
84135B1525D5263500CA4DCF /* mtevent.h */,
84135ACF25D5261D00CA4DCF /* nameidmapping.cpp */,
84135B4F25D5264800CA4DCF /* nameidmapping.h */,
84135AF325D5262600CA4DCF /* nodedef.cpp */,
@ -2063,6 +2073,7 @@
84135B9025D5264C00CA4DCF /* metadata.cpp in Sources */,
84F20E2625D5282A009562A9 /* l_base.cpp in Sources */,
84135B6C25D5264B00CA4DCF /* emerge.cpp in Sources */,
84FD8E3126A0B01D00EF2BFA /* guiEditBox.cpp in Sources */,
84F20E5525D5283F009562A9 /* mods.cpp in Sources */,
84F20E8225D52868009562A9 /* auth.cpp in Sources */,
84F20F4E25D52975009562A9 /* mapgen_v5.cpp in Sources */,
@ -2170,6 +2181,7 @@
84F20E3A25D5282A009562A9 /* l_particles.cpp in Sources */,
84135B7A25D5264C00CA4DCF /* mapnode.cpp in Sources */,
84135B9A25D5264C00CA4DCF /* porting.cpp in Sources */,
84FD8E3426A0B04900EF2BFA /* guiScene.cpp in Sources */,
84135C1F25D526D700CA4DCF /* mapblock_mesh.cpp in Sources */,
847C6D4B25D6F483008F5FC8 /* lutf8lib.c in Sources */,
84F20DD925D52812009562A9 /* s_env.cpp in Sources */,

View File

@ -58,12 +58,12 @@ end
--------------------------------------------------------------------------------
function render_serverlist_row(spec, is_favorite, is_approved)
function render_serverlist_row(spec, is_favorite)
-- Get information from non_mobile_servers.
if is_favorite and not spec.proto_min and menudata.non_mobile_servers and
spec.address and spec.port then
if is_favorite and not spec.proto_min and spec.address and spec.port and
serverlistmgr.non_mobile_servers then
local id = ("%s:%s"):format(spec.address, spec.port)
spec = menudata.non_mobile_servers[id] or spec
spec = serverlistmgr.non_mobile_servers[id] or spec
end
local text = ""
@ -81,12 +81,10 @@ function render_serverlist_row(spec, is_favorite, is_approved)
local details
if is_favorite then
details = "1,"
elseif spec.server_id == "multicraft" then
details = "2,"
else
if is_approved then
details = "2,"
else
details = "3,"
end
details = "3,"
end
if spec.lag then

View File

@ -157,35 +157,10 @@ local function init_globals()
ui.set_default("maintab")
tv_main:show()
core.set_clouds(false)
mm_texture.set_dirt_bg()
ui.update()
end
--------------------------------------------------------------------------------
local function init_globals()
-- Init gamedata
gamedata.worldindex = 0
menudata.worldlist = filterlist.create(
core.get_worlds,
compare_worlds,
-- Unique id comparison function
function(element, uid)
return element.name == uid
end,
-- Filter function
function(element, gameid)
return element.gameid == gameid
end
)
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
menudata.worldlist:set_sortmode("alphabetic")
-- Create main tabview
core.set_clouds(false)
mm_texture.set_dirt_bg()
menudata.init_tabs()
-- core.sound_play("main_menu", true)
end
init_globals()

View File

@ -18,22 +18,30 @@
serverlistmgr = {}
--------------------------------------------------------------------------------
serverlistmgr.mobile_only = PLATFORM == "Android" or PLATFORM == "iOS"
local function order_server_list(list)
local res = {}
--orders the favorite list after support
local non_mobile_servers = {}
local mobile = serverlistmgr.mobile_only
-- orders the multicraft list before support
for i = 1, #list do
local fav = list[i]
if is_server_protocol_compat(fav.proto_min, fav.proto_max) then
if mobile and not fav.mobile_friendly then
non_mobile_servers[("%s:%s"):format(fav.address, fav.port)] = fav
elseif fav.server_id == "multicraft" then
res[#res + 1] = fav
end
end
for i = 1, #list do
local fav = list[i]
if not is_server_protocol_compat(fav.proto_min, fav.proto_max) then
if (mobile and fav.mobile_friendly or not mobile) and
is_server_protocol_compat(fav.proto_min, fav.proto_max) and
fav.server_id ~= "multicraft" then
res[#res + 1] = fav
end
end
return res
return res, non_mobile_servers
end
local public_downloading = false
@ -64,8 +72,11 @@ 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"):format(
local url = ("%s%s?proto_version_min=%d&proto_version_max=%d"):format(
core.settings:get("serverlist_url"),
(PLATFORM == "Android" or PLATFORM == "iOS") and
core.decode_base64("OjMwMDAvc2VydmVybGlzdC5qc29u") or
core.decode_base64("L2xpc3Q"),
core.get_min_supp_proto(),
core.get_max_supp_proto())
@ -80,9 +91,10 @@ function serverlistmgr.sync()
nil,
function(result)
public_downloading = nil
local favs = order_server_list(result)
local favs, non_mobile_servers = order_server_list(result)
if favs[1] then
serverlistmgr.servers = favs
serverlistmgr.non_mobile_servers = non_mobile_servers
end
core.event_handler("Refresh")
end

View File

@ -114,8 +114,8 @@ return {
caption = fgettext("Credits"),
cbf_formspec = function(tabview, name, tabdata)
local version = core.get_version()
return "label[0.1,-0.1;" ..
"MultiCraft Open Source Project, ver. " .. version.string .. "\n" ..
local fs = "label[0.1,-0.1;" ..
"MultiCraft Open Source, ver. " .. version.string .. "\n" ..
"Copyright (C) 2014-2021 MultiCraft Development Team\n" ..
"Licence: LGPLv3.0+ and CC-BY-SA 4.0, Home page: http://multicraft.world\n" ..
"Created and Powered by Minetest Engine, ver. 5.4.1]" ..
@ -135,12 +135,12 @@ return {
buildCreditList(previous_contributors) .. "," ..
";1]"
if PLATFORM ~= "Android" then
--[[if PLATFORM ~= "Android" then
fs = fs .. "tooltip[userdata;" ..
fgettext("Opens the directory that contains user-provided worlds, games, mods,\n" ..
"and texture packs in a file manager / explorer.") .. "]"
fs = fs .. "button[0,4.75;3.5,1;userdata;" .. fgettext("Open User Data Directory") .. "]"
end
end]]
return fs
end,

View File

@ -19,13 +19,9 @@ local lang = core.settings:get("language")
if not lang or lang == "" then lang = os.getenv("LANG") end
local mobile = PLATFORM == "Android" or PLATFORM == "iOS"
local enable_gamebar = PLATFORM ~= "Android"
local current_game, singleplayer_refresh_gamebar
if enable_gamebar then
function current_game()
local last_game_id = core.settings:get("menu_last_game")
local game = pkgmgr.find_by_gameid(last_game_id)
local function current_game()
local last_game_id = core.settings:get("menu_last_game")
local game = pkgmgr.find_by_gameid(last_game_id)
return game
end

View File

@ -18,7 +18,6 @@
--------------------------------------------------------------------------------
local password_save = core.settings:get_bool("password_save")
local password_tmp = ""
local mobile_only = PLATFORM == "Android" or PLATFORM == "iOS"
local function get_formspec(tabview, name, tabdata)
-- Update the cached supported proto info,
@ -46,7 +45,7 @@ local function get_formspec(tabview, name, tabdata)
"image_button[5.59,-0.13;0.83,0.83;" .. esc(defaulttexturedir .. "refresh.png")
.. ";btn_mp_refresh;;true;false]" ..
"image_button[6.29,-0.13;0.83,0.83;" .. esc(defaulttexturedir ..
(not mobile_only and "online_pc" or "online_mobile") .. ".png")
(serverlistmgr.mobile_only and "online_mobile" or "online_pc") .. ".png")
.. ";btn_mp_mobile;;true;false]"
else
search_panel =
@ -59,7 +58,7 @@ local function get_formspec(tabview, name, tabdata)
local retval =
-- Search
search_panel..
search_panel..
-- Address / Port
"label[7.1,-0.3;" .. fgettext("Address") .. ":" .. "]" ..
@ -93,7 +92,7 @@ local function get_formspec(tabview, name, tabdata)
retval = retval .. "image_button[7.1,4.91;0.83,0.83;" .. esc(defaulttexturedir .. "trash.png")
.. ";btn_delete_favorite;;true;false]"
end
if fav_selected.description then
if selected.description then
retval = retval .. "textarea[7.5,2.2;4.8,3;;" ..
esc((gamedata.serverdescription or ""), true) .. ";]"
end
@ -112,7 +111,7 @@ local function get_formspec(tabview, name, tabdata)
image_column(fgettext("Server mode")) .. ",padding=0.5;" ..
"color,span=1;" ..
"text,padding=0.5]" ..
"table[-0.09,0.7;6.99,4.93;favourites;"
"table[-0.09,0.7;6.99,4.93;favorites;"
if menudata.search_result then
local favs = serverlistmgr.get_favorites()
@ -129,8 +128,7 @@ local function get_formspec(tabview, name, tabdata)
retval = retval .. ","
end
retval = retval .. render_serverlist_row(server, server.is_favorite,
server.server_id == "multicraft")
retval = retval .. render_serverlist_row(server, server.is_favorite)
end
elseif #serverlistmgr.servers > 0 then
local favs = serverlistmgr.get_favorites()
@ -147,11 +145,10 @@ local function get_formspec(tabview, name, tabdata)
end
end
end
retval = retval .. render_serverlist_row(menudata.favorites[1], (#favs > 0),
menudata.favorites[1].server_id == "multicraft")
for i = 2, #menudata.favorites do
retval = retval .. "," .. render_serverlist_row(menudata.favorites[i],
(i <= #favs), menudata.favorites[i].server_id == "multicraft")
retval = retval .. render_serverlist_row(serverlistmgr.servers[1], (#favs > 0))
for i = 2, #serverlistmgr.servers do
retval = retval .. "," .. render_serverlist_row(serverlistmgr.servers[i], (i <= #favs))
end
end
@ -181,8 +178,8 @@ local function main_button_handler(tabview, fields, name, tabdata)
end
end
if fields.favourites then
local event = core.explode_table_event(fields.favourites)
if fields.favorites then
local event = core.explode_table_event(fields.favorites)
local fav = serverlist[event.row]
if event.type == "DCL" then
@ -277,6 +274,8 @@ local function main_button_handler(tabview, fields, name, tabdata)
serverlistmgr.sync()
tabdata.selected = nil
core.settings:set("address", "")
core.settings:set("remote_port", "30000")
return true
end
@ -353,7 +352,7 @@ local function main_button_handler(tabview, fields, name, tabdata)
end
if fields.btn_mp_mobile then
mobile_only = not mobile_only
serverlistmgr.mobile_only = not serverlistmgr.mobile_only
serverlistmgr.sync()
return true
end
@ -402,8 +401,8 @@ local function main_button_handler(tabview, fields, name, tabdata)
core.settings:set_bool("auto_connect", auto_connect)
core.settings:set("connect_time", os.time())
core.settings:set("maintab_LAST", "online")
core.settings:set("address", fields.te_address)
core.settings:set("remote_port", fields.te_port)
core.settings:set("address", gamedata.address)
core.settings:set("remote_port", gamedata.port)
core.start()
return true
@ -419,7 +418,7 @@ end
--------------------------------------------------------------------------------
return {
name = "online",
caption = fgettext("Multiplayer"),
caption = fgettext("Join Game"),
cbf_formspec = get_formspec,
cbf_button_handler = main_button_handler,
on_change = on_change

View File

@ -1617,7 +1617,7 @@ void Client::typeChatMessage(const std::wstring &message)
LocalPlayer *player = m_env.getLocalPlayer();
if (!player)
return;
std::wstring name = narrow_to_wide(player->getName());
std::wstring name = utf8_to_wide(player->getName());
ChatMessage *chatMessage = new ChatMessage(CHATMESSAGE_TYPE_NORMAL,
message, name);
m_chat_queue.push(chatMessage);

View File

@ -496,7 +496,7 @@ bool ClientLauncher::launch_game(std::string &error_message,
// If using simple singleplayer mode, override
if (start_data.isSinglePlayer()) {
start_data.name = "singleplayer";
start_data.name = "Player";
start_data.password = "";
start_data.socket_port = myrand_range(49152, 65535);
} else {

View File

@ -4436,7 +4436,7 @@ void external_statustext(const char *text, float duration)
{
if (!g_game)
return;
std::wstring s = narrow_to_wide(std::string(text));
std::wstring s = utf8_to_wide(std::string(text));
g_game->customStatustext(s, duration);
}
#endif

View File

@ -631,7 +631,7 @@ void Minimap::drawMinimap(core::rect<s32> rect) {
material.setFlag(video::EMF_TRILINEAR_FILTER, true);
material.Lighting = false;
material.TextureLayer[0].Texture = minimap_texture;
material.TextureLayer[1].Texture = data->is_radar ? 0 : data->heightmap_texture;
material.TextureLayer[1].Texture = data->heightmap_texture;
if (m_enable_shaders && data->mode.type == MINIMAP_TYPE_SURFACE) {
u16 sid = m_shdrsrc->getShader("minimap_shader", TILE_MATERIAL_ALPHA);

View File

@ -36,7 +36,7 @@ void RenderingCoreInterlaced::initMaterial()
mat.UseMipMaps = false;
mat.ZBuffer = false;
mat.setFlag(video::EMF_ZWRITE_ENABLE, false); // ZWriteEnable is bool on early 1.9 but E_ZWRITE on later 1.9
u32 shader = s->getShader("3d_interlaced_merge", TILE_MATERIAL_BASIC, 0);
u32 shader = s->getShader("3d_interlaced_merge", TILE_MATERIAL_BASIC);
mat.MaterialType = s->getShaderInfo(shader).material;
for (int k = 0; k < 3; ++k) {
mat.TextureLayer[k].AnisotropicFilter = false;

View File

@ -68,7 +68,7 @@ Sky::Sky(s32 id, ITextureSource *tsrc, IShaderSource *ssrc) :
// Create materials
m_materials[0] = baseMaterial();
m_materials[0].MaterialType = ssrc->getShaderInfo(ssrc->getShader("stars_shader", TILE_MATERIAL_ALPHA, 0)).material;
m_materials[0].MaterialType = ssrc->getShaderInfo(ssrc->getShader("stars_shader", TILE_MATERIAL_ALPHA)).material;
m_materials[0].Lighting = true;
m_materials[0].ColorMaterial = video::ECM_NONE;

View File

@ -186,8 +186,6 @@ GUIEngine::GUIEngine(JoystickController *joystick,
m_script = new MainMenuScripting(this);
m_device = RenderingEngine::get_raw_device();
try {
m_script->setMainMenuData(&m_data->script_data);
m_data->script_data.errormessage = "";
@ -264,10 +262,11 @@ void GUIEngine::run()
}
while (RenderingEngine::run() && (!m_startgame) && (!m_kill)) {
IrrlichtDevice *device = RenderingEngine::get_raw_device();
#ifdef __IOS__
if (m_device->isWindowMinimized())
if (device->isWindowMinimized())
#else
if (!m_device->isWindowFocused())
if (!device->isWindowFocused())
#endif
{
sleep_ms(50);
@ -310,7 +309,8 @@ void GUIEngine::run()
driver->endScene();
u32 frametime_min = 1000 / g_settings->getFloat("pause_fps_max") / 2;
u32 frametime_min = 1000 / g_settings->getFloat("fps_max_unfocused")
/ 2;
if (m_clouds_enabled)
cloudPostProcess(frametime_min, device);

View File

@ -217,9 +217,6 @@ private:
/** scripting interface */
MainMenuScripting *m_script = nullptr;
/** irrlicht device */
IrrlichtDevice *m_device = nullptr;
/** script basefolder */
std::string m_scriptdir = "";

View File

@ -161,10 +161,10 @@ void ItemDefinition::serialize(std::ostream &os, u16 protocol_version) const
os << serializeString16(node_placement_prediction);
if (version == 3) {
os << serializeString(sound_place.name);
os << serializeString16(sound_place.name);
writeF1000(os, sound_place.gain);
writeF1000(os, range);
os << serializeString(sound_place_failed.name);
os << serializeString16(sound_place_failed.name);
writeF1000(os, sound_place_failed.gain);
} else {
// Version from ContentFeatures::serialize to keep in sync
@ -250,10 +250,10 @@ void ItemDefinition::deSerialize(std::istream &is)
range = readF1000(is);
sound_place_failed.deSerialize(is, cf_version);
}
palette_image = deSerializeString(is);
palette_image = deSerializeString16(is);
color = readARGB8(is);
inventory_overlay = deSerializeString(is);
wield_overlay = deSerializeString(is);
inventory_overlay = deSerializeString16(is);
wield_overlay = deSerializeString16(is);
short_description = deSerializeString16(is);
} catch(SerializationError &e) {};
}

View File

@ -187,12 +187,6 @@ void MapgenV7P::makeChunk(BlockMakeData *data)
// Pre-conditions
assert(data->vmanip);
assert(data->nodedef);
assert(data->blockpos_requested.X >= data->blockpos_min.X &&
data->blockpos_requested.Y >= data->blockpos_min.Y &&
data->blockpos_requested.Z >= data->blockpos_min.Z);
assert(data->blockpos_requested.X <= data->blockpos_max.X &&
data->blockpos_requested.Y <= data->blockpos_max.Y &&
data->blockpos_requested.Z <= data->blockpos_max.Z);
this->generating = true;
this->vm = data->vmanip;

View File

@ -950,12 +950,12 @@ void Client::handleCommand_DetachedInventory(NetworkPacket* pkt)
std::string datastring(pkt->getString(0), pkt->getSize());
std::istringstream is(datastring, std::ios_base::binary);
std::string name = deSerializeString(is);
std::string name = deSerializeString16(is);
infostream << "Client: Detached inventory update: \"" << name
<< "\"" << std::endl;
Inventory *inv = NULL;
Inventory *inv = nullptr;
if (m_detached_inventories.count(name) > 0)
inv = m_detached_inventories[name];
else {

View File

@ -600,11 +600,11 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
{
if (version == 5) // In PROTOCOL_VERSION 13
{
name = deSerializeString(is);
name = deSerializeString16(is);
groups.clear();
u32 groups_size = readU16(is);
for(u32 i=0; i<groups_size; i++){
std::string name = deSerializeString(is);
std::string name = deSerializeString16(is);
int value = readS16(is);
groups[name] = value;
}
@ -619,7 +619,7 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
throw SerializationError("unsupported CF_SPECIAL_COUNT");
for (u32 i = 0; i < CF_SPECIAL_COUNT; i++)
tiledef_special[i].deSerialize(is, version, drawtype);
alpha = readU8(is);
setAlphaFromLegacy(readU8(is));
post_effect_color.setAlpha(readU8(is));
post_effect_color.setRed(readU8(is));
post_effect_color.setGreen(readU8(is));
@ -634,10 +634,10 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
diggable = readU8(is);
climbable = readU8(is);
buildable_to = readU8(is);
deSerializeString(is); // legacy: used to be metadata_name
deSerializeString16(is); // legacy: used to be metadata_name
liquid_type = (enum LiquidType)readU8(is);
liquid_alternative_flowing = deSerializeString(is);
liquid_alternative_source = deSerializeString(is);
liquid_alternative_flowing = deSerializeString16(is);
liquid_alternative_source = deSerializeString16(is);
liquid_viscosity = readU8(is);
light_source = readU8(is);
light_source = MYMIN(light_source, LIGHT_MAX);
@ -650,11 +650,11 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
sound_dig.deSerialize(is, version);
sound_dug.deSerialize(is, version);
} else if (version == 6) {
name = deSerializeString(is);
name = deSerializeString16(is);
groups.clear();
u32 groups_size = readU16(is);
for (u32 i = 0; i < groups_size; i++) {
std::string name = deSerializeString(is);
std::string name = deSerializeString16(is);
int value = readS16(is);
groups[name] = value;
}
@ -669,7 +669,7 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
throw SerializationError("unsupported CF_SPECIAL_COUNT");
for (u32 i = 0; i < 2; i++)
tiledef_special[i].deSerialize(is, version, drawtype);
alpha = readU8(is);
setAlphaFromLegacy(readU8(is));
post_effect_color.setAlpha(readU8(is));
post_effect_color.setRed(readU8(is));
post_effect_color.setGreen(readU8(is));
@ -684,10 +684,10 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
diggable = readU8(is);
climbable = readU8(is);
buildable_to = readU8(is);
deSerializeString(is); // legacy: used to be metadata_name
deSerializeString16(is); // legacy: used to be metadata_name
liquid_type = (enum LiquidType)readU8(is);
liquid_alternative_flowing = deSerializeString(is);
liquid_alternative_source = deSerializeString(is);
liquid_alternative_flowing = deSerializeString16(is);
liquid_alternative_source = deSerializeString16(is);
liquid_viscosity = readU8(is);
liquid_renewable = readU8(is);
light_source = readU8(is);
@ -704,11 +704,11 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
leveled = readU8(is);
liquid_range = readU8(is);
} else if (version == 7 || version == 8){
name = deSerializeString(is);
name = deSerializeString16(is);
groups.clear();
u32 groups_size = readU16(is);
for (u32 i = 0; i < groups_size; i++) {
std::string name = deSerializeString(is);
std::string name = deSerializeString16(is);
int value = readS16(is);
groups[name] = value;
}
@ -723,7 +723,7 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
throw SerializationError("unsupported CF_SPECIAL_COUNT");
for (u32 i = 0; i < CF_SPECIAL_COUNT; i++)
tiledef_special[i].deSerialize(is, version, drawtype);
alpha = readU8(is);
setAlphaFromLegacy(readU8(is));
post_effect_color.setAlpha(readU8(is));
post_effect_color.setRed(readU8(is));
post_effect_color.setGreen(readU8(is));
@ -738,10 +738,10 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
diggable = readU8(is);
climbable = readU8(is);
buildable_to = readU8(is);
deSerializeString(is); // legacy: used to be metadata_name
deSerializeString16(is); // legacy: used to be metadata_name
liquid_type = (enum LiquidType) readU8(is);
liquid_alternative_flowing = deSerializeString(is);
liquid_alternative_source = deSerializeString(is);
liquid_alternative_flowing = deSerializeString16(is);
liquid_alternative_source = deSerializeString16(is);
liquid_viscosity = readU8(is);
liquid_renewable = readU8(is);
light_source = readU8(is);
@ -760,7 +760,7 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
liquid_range = readU8(is);
waving = readU8(is);
try {
mesh = deSerializeString(is);
mesh = deSerializeString16(is);
collision_box.deSerialize(is);
floodable = readU8(is);
u16 connects_to_size = readU16(is);
@ -1284,11 +1284,11 @@ void ContentFeatures::serializeOld(std::ostream &os, u16 protocol_version) const
const u8 version = protocol_version < 27 ? 7 : 8;
writeU8(os, version);
os << serializeString(name);
os << serializeString16(name);
writeU16(os, groups.size());
for (ItemGroupList::const_iterator i = groups.begin();
i != groups.end(); ++i) {
os << serializeString(i->first);
os << serializeString16(i->first);
writeS16(os, i->second);
}
writeU8(os, drawtype);
@ -1314,10 +1314,10 @@ void ContentFeatures::serializeOld(std::ostream &os, u16 protocol_version) const
writeU8(os, diggable);
writeU8(os, climbable);
writeU8(os, buildable_to);
os << serializeString(""); // legacy: used to be metadata_name
os << serializeString16(""); // legacy: used to be metadata_name
writeU8(os, liquid_type);
os << serializeString(liquid_alternative_flowing);
os << serializeString(liquid_alternative_source);
os << serializeString16(liquid_alternative_flowing);
os << serializeString16(liquid_alternative_source);
writeU8(os, liquid_viscosity);
writeU8(os, liquid_renewable);
writeU8(os, light_source);
@ -1334,7 +1334,7 @@ void ContentFeatures::serializeOld(std::ostream &os, u16 protocol_version) const
writeU8(os, leveled);
writeU8(os, liquid_range);
writeU8(os, waving);
os << serializeString(mesh);
os << serializeString16(mesh);
collision_box.serialize(os, protocol_version);
writeU8(os, floodable);
writeU16(os, connects_to_ids.size());

View File

@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <json/json.h>
#include "convert_json.h"
#include "httpfetch.h"
#include "util/base64.h"
namespace ServerList
{
@ -51,6 +52,7 @@ void sendAnnounce(AnnounceAction action,
}
if (action != AA_DELETE) {
bool strict_checking = g_settings->getBool("strict_protocol_version_checking");
#define y base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk")
server["name"] = g_settings->get("server_name");
server["description"] = g_settings->get("server_description");
server["version"] = g_version_string;

View File

@ -5,8 +5,7 @@ install_linux_deps() {
local pkgs=(libirrlicht-dev cmake libbz2-dev libpng-dev \
libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev \
libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libopenal-dev \
gettext libpq-dev postgresql-server-dev-all libleveldb-dev \
libcurl4-openssl-dev)
gettext libpq-dev libleveldb-dev libcurl4-openssl-dev)
sudo apt-get update
sudo apt-get install -y --no-install-recommends ${pkgs[@]} "$@"