From c2d0b6206c5bd28408cff9c7b3f6fbc9d599469a Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 30 Nov 2019 13:39:15 +0800 Subject: [PATCH 1/6] Correct tool name to zone_elevation --- code/nel/tools/3d/zone_elevation/main.rc | 4 ++-- code/nel/tools/pacs/build_rbank/build_surf.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/nel/tools/3d/zone_elevation/main.rc b/code/nel/tools/3d/zone_elevation/main.rc index 05cf7c976..e4e8f736a 100644 --- a/code/nel/tools/3d/zone_elevation/main.rc +++ b/code/nel/tools/3d/zone_elevation/main.rc @@ -27,10 +27,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", AUTHOR - VALUE "FileDescription", "NeL Zone Heightmap" + VALUE "FileDescription", "NeL Zone Elevation" VALUE "FileVersion", NL_VERSION VALUE "LegalCopyright", COPYRIGHT - VALUE "OriginalFilename", "zone_heightmap" NL_FILEEXT ".exe" + VALUE "OriginalFilename", "zone_elevation" NL_FILEEXT ".exe" VALUE "ProductName", "NeL Tools" VALUE "ProductVersion", NL_PRODUCT_VERSION END diff --git a/code/nel/tools/pacs/build_rbank/build_surf.cpp b/code/nel/tools/pacs/build_rbank/build_surf.cpp index 7172bae3d..c7425e943 100644 --- a/code/nel/tools/pacs/build_rbank/build_surf.cpp +++ b/code/nel/tools/pacs/build_rbank/build_surf.cpp @@ -883,7 +883,7 @@ void NLPACS::CZoneTessellation::checkSameLandscapeHmBinds(const NL3D::CLandscape // or at least the welding of zones should just keep the same welding as the non heightmapped one nlwarning("ERROR: The zone %s has a different bind strucutre in the landscape and in the landscape_with_No_Heightmap", zoneName.c_str()); nlwarning("ERROR: Hint: Check your heightmap: it may be too precise or has too much noise, causing the zonewelder to behav differently..."); - nlwarning("ERROR: Use the 'zone_heightmap' tool to resolve this!"); + nlwarning("TIP: Use the 'zone_elevation' tool on the welded no-heightmap zones to resolve this!"); nlwarning("More Details (information landscape / information landscape_with_No_Heightmap):"); for(uint j=0;j Date: Sat, 30 Nov 2019 17:22:17 +0800 Subject: [PATCH 2/6] Fix crash in georges edit due to string change --- .../tools/leveldesign/georges_dll/georges_edit.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp index db3d4655c..2941acdc0 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp @@ -1091,27 +1091,27 @@ bool CGeorgesEditApp::SerialIntoMemStream (const char *formName, CGeorgesEditDoc { if (array) { - (safe_cast (node))->write (nodeXml, doc->getFormPtr(), NULL); + (safe_cast (node))->write (nodeXml, doc->getFormPtr(), std::string()); } else { if (type == UFormDfn::EntryDfn) { - (safe_cast (node))->write (nodeXml, doc->getFormPtr(), NULL); + (safe_cast (node))->write (nodeXml, doc->getFormPtr(), std::string()); } else if (type == UFormDfn::EntryVirtualDfn) { - (safe_cast (node))->write (nodeXml, doc->getFormPtr(), NULL); + (safe_cast (node))->write (nodeXml, doc->getFormPtr(), std::string()); } else if (type == UFormDfn::EntryType) { - (safe_cast (node))->write (nodeXml, doc->getFormPtr(), NULL); + (safe_cast (node))->write (nodeXml, doc->getFormPtr(), std::string()); } } } else { - (safe_cast (node))->write (nodeXml, doc->getFormPtr(), NULL); + (safe_cast (node))->write (nodeXml, doc->getFormPtr(), std::string()); } } From d934f5769ad1323645bbaff8631008f285419c8c Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 1 Dec 2019 11:25:46 +0800 Subject: [PATCH 3/6] Fix initialization --- code/nel/src/misc/streamed_package_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/misc/streamed_package_manager.cpp b/code/nel/src/misc/streamed_package_manager.cpp index ecfb988b8..3fe497e3e 100644 --- a/code/nel/src/misc/streamed_package_manager.cpp +++ b/code/nel/src/misc/streamed_package_manager.cpp @@ -27,7 +27,7 @@ namespace NLMISC NLMISC_SAFE_SINGLETON_IMPL(CStreamedPackageManager); -CStreamedPackageManager::CStreamedPackageManager() +CStreamedPackageManager::CStreamedPackageManager() : Provider(NULL) { // init } From 174aff62d7a5c92b840deca9c137a98fe7da152f Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 30 Nov 2019 19:52:53 +0800 Subject: [PATCH 4/6] Fix buffer overflow --- code/nel/tools/pacs/build_indoor_rbank/mouline.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp b/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp index 57592a431..73e140464 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp +++ b/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp @@ -16,6 +16,7 @@ #include #include +#include #include "nel/pacs/collision_mesh_build.h" #include "nel/pacs/local_retriever.h" @@ -278,24 +279,26 @@ void linkExteriorToInterior(CLocalRetriever &lr) for (i=0; i Date: Sat, 30 Nov 2019 20:05:59 +0800 Subject: [PATCH 5/6] Why is this duplicate?! --- code/nel/src/pacs/build_indoor.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/code/nel/src/pacs/build_indoor.cpp b/code/nel/src/pacs/build_indoor.cpp index ca14eb7cf..222c18311 100644 --- a/code/nel/src/pacs/build_indoor.cpp +++ b/code/nel/src/pacs/build_indoor.cpp @@ -17,6 +17,8 @@ #include "stdpacs.h" #include "nel/pacs/build_indoor.h" +#include + #include "nel/pacs/collision_mesh_build.h" #include "nel/pacs/local_retriever.h" #include "nel/pacs/exterior_mesh.h" @@ -518,24 +520,26 @@ void linkExteriorToInterior(CLocalRetriever &lr) for (i=0; i Date: Sat, 30 Nov 2019 20:11:32 +0800 Subject: [PATCH 6/6] Patch more dangerous strcat buffers --- code/nel/src/pacs/build_indoor.cpp | 3 +++ code/nel/src/pacs/local_retriever.cpp | 15 ++++++++----- code/nel/tools/3d/zone_welder/zone_welder.cpp | 22 ++++++++++++------- .../tools/pacs/build_indoor_rbank/mouline.cpp | 3 +++ .../world_editor/generate_primitive.cpp | 18 ++++++++------- 5 files changed, 39 insertions(+), 22 deletions(-) diff --git a/code/nel/src/pacs/build_indoor.cpp b/code/nel/src/pacs/build_indoor.cpp index 222c18311..5b4c870d7 100644 --- a/code/nel/src/pacs/build_indoor.cpp +++ b/code/nel/src/pacs/build_indoor.cpp @@ -1,6 +1,9 @@ // NeL - MMORPG Framework // Copyright (C) 2010 Winch Gate Property Limited // +// This source file has been modified by the following contributors: +// Copyright (C) 2019 Jan BOON (Kaetemi) +// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the diff --git a/code/nel/src/pacs/local_retriever.cpp b/code/nel/src/pacs/local_retriever.cpp index 6ee2da559..9a73e8b28 100644 --- a/code/nel/src/pacs/local_retriever.cpp +++ b/code/nel/src/pacs/local_retriever.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2010 Winch Gate Property Limited // // This source file has been modified by the following contributors: -// Copyright (C) 2015 Jan BOON (Kaetemi) +// Copyright (C) 2015-2019 Jan BOON (Kaetemi) // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as @@ -19,6 +19,8 @@ #include "stdpacs.h" +#include + #include "nel/misc/plane.h" #include "nel/pacs/local_retriever.h" @@ -269,15 +271,16 @@ void NLPACS::CLocalRetriever::dumpSurface(uint surf, const CVector &vect) const { const CRetrievableSurface::TLoop &loop = surface._Loops[i]; nlinfo("-- loop %d: %d chains length=%.2f", i, loop.size(), loop.Length); - static char wbuffer[256]; - static char buffer[10240]; - sprintf(buffer, " chains:"); + char wbuffer[256]; + stringstream ss; + sprintf(wbuffer, " chains:"); + ss << wbuffer; for (j=0; j // Copyright (C) 2010 Winch Gate Property Limited // +// This source file has been modified by the following contributors: +// Copyright (C) 2019 Jan BOON (Kaetemi) +// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the @@ -18,6 +21,10 @@ #include "../zone_lib/zone_utility.h" #include +#include +#include +#include + #include "nel/misc/types_nl.h" #include "nel/misc/file.h" #include "nel/misc/common.h" @@ -27,8 +34,6 @@ #include "nel/3d/zone_smoother.h" #include "nel/3d/zone_tgt_smoother.h" #include "nel/3d/zone_corner_smoother.h" -#include -#include using namespace NL3D; @@ -579,7 +584,8 @@ void weldZones(const char *center) if (adjZonePatchs[patchIndex].BindEdges[edgeIndex].NPatchs!=0) { // Build an error message - char error[8000]; + char buf[2048]; + stringstream sserror; // Zone name string nameCenter, nameAdj; @@ -587,10 +593,11 @@ void weldZones(const char *center) getZoneNameByCoord (adjZonesId[i]&0xff, (adjZonesId[i]>>8)+1, nameAdj); // Main message - smprintf (error, 2048, + smprintf(buf, 2048, "Bind Error: try to bind the patch n %d in zone n %s with patch n %d in zone %s\n" "This patch is already binded with the following patches : ", ptch+1, nameAdj.c_str(), patchIndex+1, nameCenter.c_str() ); + sserror << buf; // Sub message for (uint i=0; i // Copyright (C) 2010 Winch Gate Property Limited // +// This source file has been modified by the following contributors: +// Copyright (C) 2019 Jan BOON (Kaetemi) +// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/generate_primitive.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/generate_primitive.cpp index a7364a60e..c841a458c 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/generate_primitive.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/generate_primitive.cpp @@ -1,6 +1,9 @@ // Ryzom - MMORPG Framework // Copyright (C) 2010 Winch Gate Property Limited // +// This source file has been modified by the following contributors: +// Copyright (C) 2019 Jan BOON (Kaetemi) +// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the @@ -16,6 +19,8 @@ #include "stdafx.h" +#include + #include "editor_primitive.h" #include "generate_primitive.h" #include "world_editor.h" @@ -361,18 +366,15 @@ bool CGeneratePrimitive::generate (std::vector< std::vector > &dest } // Error ? - if (!_FileNotFound.empty ()) + if (!_FileNotFound.empty()) { // Continue ? - char message[2048]; - message[0] = 0; - for (uint i=0; i<_FileNotFound.size (); i++) + stringstream ssmessage; + for (uint i = 0; i < _FileNotFound.size(); i++) { - strcat (message, _FileNotFound[i].c_str ()); - strcat (message, "\n"); + ssmessage << _FileNotFound[i] << "\n"; } - - if (!theApp.yesNoMessage ("Can't load some files:\n%s\nContinue ?", message)) + if (!theApp.yesNoMessage("Can't load some files:\n%s\nContinue ?", ssmessage.str())) { return false; }