Merge with develop

--HG--
branch : feature-material-editor
hg/feature/material-editor
kaetemi 9 years ago
commit 531398bf0a

@ -114,6 +114,7 @@ ENDIF(WIN32)
FIND_PACKAGE(ZLIB REQUIRED) FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED) FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PNG REQUIRED) FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(OpenSSL REQUIRED)
FIND_PACKAGE(GIF) FIND_PACKAGE(GIF)
FIND_PACKAGE(Jpeg) FIND_PACKAGE(Jpeg)
@ -253,11 +254,6 @@ IF(WITH_QT5)
FIND_PACKAGE(Qt5LinguistTools) FIND_PACKAGE(Qt5LinguistTools)
FIND_PACKAGE(Qt5Network) FIND_PACKAGE(Qt5Network)
IF(WIN32)
# Please add option to switch off
# FIND_PACKAGE(Qt5WinExtras)
ENDIF()
IF(QT_STATIC) IF(QT_STATIC)
ADD_DEFINITIONS(-DQT_STATICPLUGIN) ADD_DEFINITIONS(-DQT_STATICPLUGIN)
@ -343,8 +339,6 @@ IF(WITH_QT5)
# Network # Network
SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Network Qt5::Xml) SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Network Qt5::Xml)
FIND_PACKAGE(OpenSSL REQUIRED)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES}) SET(QT_LIBRARIES ${QT_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
IF(WIN32) IF(WIN32)
@ -418,12 +412,8 @@ IF(WITH_NEL)
IF(CURL_STATIC) IF(CURL_STATIC)
SET(CURL_DEFINITIONS -DCURL_STATICLIB) SET(CURL_DEFINITIONS -DCURL_STATICLIB)
FIND_PACKAGE(OpenSSL QUIET)
IF(OPENSSL_FOUND)
SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF(OPENSSL_FOUND)
IF(UNIX) IF(UNIX)
# CURL depends on libidn # CURL depends on libidn

@ -282,6 +282,13 @@ inline sint nlstricmp(const std::string &lhs, const std::string &rhs) { return s
inline sint nlstricmp(const std::string &lhs, const char *rhs) { return stricmp(lhs.c_str(),rhs); } inline sint nlstricmp(const std::string &lhs, const char *rhs) { return stricmp(lhs.c_str(),rhs); }
inline sint nlstricmp(const char *lhs, const std::string &rhs) { return stricmp(lhs,rhs.c_str()); } inline sint nlstricmp(const char *lhs, const std::string &rhs) { return stricmp(lhs,rhs.c_str()); }
// macros helper to convert UTF-8 std::string and wchar_t*
#define wideToUtf8(str) (ucstring((ucchar*)str).toUtf8())
#define utf8ToWide(str) ((wchar_t*)ucstring::makeFromUtf8(str).c_str())
// wrapper for fopen to be able to open files with an UTF-8 filename
FILE* nlfopen(const std::string &filename, const std::string &mode);
/** Signed 64 bit fseek. Same interface as fseek /** Signed 64 bit fseek. Same interface as fseek
*/ */
int nlfseek64( FILE *stream, sint64 offset, int origin ); int nlfseek64( FILE *stream, sint64 offset, int origin );
@ -346,6 +353,8 @@ uint32 humanReadableToBytes (const std::string &str);
/// Convert a time into a string that is easily readable by an human, for example 3600 -> "1h" /// Convert a time into a string that is easily readable by an human, for example 3600 -> "1h"
std::string secondsToHumanReadable (uint32 time); std::string secondsToHumanReadable (uint32 time);
/// Convert a UNIX timestamp to a formatted date in ISO format
std::string timestampToHumanReadable(uint32 timestamp);
/// Get a bytes or time in string format and convert it in seconds or bytes /// Get a bytes or time in string format and convert it in seconds or bytes
uint32 fromHumanReadable (const std::string &str); uint32 fromHumanReadable (const std::string &str);
@ -357,6 +366,9 @@ std::string formatThousands(const std::string& s);
/// The program will be launched in the current directory /// The program will be launched in the current directory
bool launchProgram (const std::string &programName, const std::string &arguments, bool log = true); bool launchProgram (const std::string &programName, const std::string &arguments, bool log = true);
/// Same but with an array of strings for arguments
bool launchProgramArray (const std::string &programName, const std::vector<std::string> &arguments, bool log = true);
/// This function executes a program and wait for result (used for example for crash report). /// This function executes a program and wait for result (used for example for crash report).
/// The program will be launched in the current directory /// The program will be launched in the current directory
sint launchProgramAndWaitForResult (const std::string &programName, const std::string &arguments, bool log = true); sint launchProgramAndWaitForResult (const std::string &programName, const std::string &arguments, bool log = true);
@ -369,6 +381,10 @@ std::string getCommandOutput(const std::string &command);
/// Authorized characters in names are A-Z, a-z, 0-9 and _ /// Authorized characters in names are A-Z, a-z, 0-9 and _
std::string expandEnvironmentVariables(const std::string &s); std::string expandEnvironmentVariables(const std::string &s);
/// Functions to convert a string with arguments to array or array to string (will espace strings with spaces)
bool explodeArguments(const std::string &str, std::vector<std::string> &args);
std::string joinArguments(const std::vector<std::string> &args);
/// This function kills a program using his pid (on unix, it uses the kill() POSIX function) /// This function kills a program using his pid (on unix, it uses the kill() POSIX function)
bool killProgram(uint32 pid); bool killProgram(uint32 pid);

@ -229,7 +229,7 @@ void setCrashAlreadyReported(bool state);
*\code *\code
void function(char *filename) void function(char *filename)
{ {
FILE *fp = fopen (filename, "r"); FILE *fp = nlfopen (filename, "r");
if (fp==NULL) if (fp==NULL)
{ {
nlerror("file not found"); nlerror("file not found");

@ -722,7 +722,6 @@ struct CFile
/** Try to set the file access to read/write if not already set. /** Try to set the file access to read/write if not already set.
* return true if the file doesn't exist or if the file already have RW access. * return true if the file doesn't exist or if the file already have RW access.
* Work actually only on Windows and returns always true on other platforms.
* \return true if RW access is granted * \return true if RW access is granted
*/ */
static bool setRWAccess(const std::string &filename); static bool setRWAccess(const std::string &filename);

@ -1243,23 +1243,23 @@ bool CDriverD3D::init (uintptr_t windowIcon, emptyProc exitFunc)
createCursors(); createCursors();
_WindowClass = "NLD3D" + toString(windowIcon);
// Register a window class // Register a window class
WNDCLASSW wc; WNDCLASSA wc;
memset(&wc,0,sizeof(wc)); memset(&wc,0,sizeof(wc));
wc.style = 0; // CS_HREDRAW | CS_VREDRAW ;//| CS_DBLCLKS; wc.style = 0; // CS_HREDRAW | CS_VREDRAW ;//| CS_DBLCLKS;
wc.lpfnWndProc = (WNDPROC)WndProc; wc.lpfnWndProc = (WNDPROC)WndProc;
wc.cbClsExtra = 0; wc.cbClsExtra = 0;
wc.cbWndExtra = 0; wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandleW(NULL); wc.hInstance = GetModuleHandleA(NULL);
wc.hIcon = (HICON)windowIcon; wc.hIcon = (HICON)windowIcon;
wc.hCursor = _DefaultCursor; wc.hCursor = _DefaultCursor;
wc.hbrBackground = WHITE_BRUSH; wc.hbrBackground = WHITE_BRUSH;
_WindowClass = "NLD3D" + toString(windowIcon); wc.lpszClassName = _WindowClass.c_str();
ucstring us = _WindowClass;
wc.lpszClassName = (LPCWSTR)us.c_str();
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
if (!RegisterClassW(&wc)) if (!RegisterClassA(&wc))
{ {
DWORD error = GetLastError(); DWORD error = GetLastError();
if (error != ERROR_CLASS_ALREADY_EXISTS) if (error != ERROR_CLASS_ALREADY_EXISTS)
@ -1806,7 +1806,7 @@ emptyProc CDriverD3D::getWindowProc()
IDriver::TMessageBoxId CDriverD3D::systemMessageBox (const char* message, const char* title, TMessageBoxType type, TMessageBoxIcon icon) IDriver::TMessageBoxId CDriverD3D::systemMessageBox (const char* message, const char* title, TMessageBoxType type, TMessageBoxIcon icon)
{ {
switch (::MessageBox (_HWnd, message, title, ((type==retryCancelType)?MB_RETRYCANCEL: switch (::MessageBoxW (_HWnd, utf8ToWide(message), utf8ToWide(title), ((type==retryCancelType)?MB_RETRYCANCEL:
(type==yesNoCancelType)?MB_YESNOCANCEL: (type==yesNoCancelType)?MB_YESNOCANCEL:
(type==okCancelType)?MB_OKCANCEL: (type==okCancelType)?MB_OKCANCEL:
(type==abortRetryIgnoreType)?MB_ABORTRETRYIGNORE: (type==abortRetryIgnoreType)?MB_ABORTRETRYIGNORE:
@ -2327,13 +2327,13 @@ void CDriverD3D::setWindowIcon(const std::vector<NLMISC::CBitmap> &bitmaps)
if (winIconBig) if (winIconBig)
{ {
SendMessage(_HWnd, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall); SendMessageA(_HWnd, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall);
SendMessage(_HWnd, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconBig); SendMessageA(_HWnd, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconBig);
} }
else else
{ {
SendMessage(_HWnd, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall); SendMessageA(_HWnd, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall);
SendMessage(_HWnd, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconSmall); SendMessageA(_HWnd, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconSmall);
} }
} }

@ -2527,7 +2527,7 @@ void CDriverGL::retrieveATIDriverVersion()
// get from the registry // get from the registry
HKEY parentKey; HKEY parentKey;
// open key about current video card // open key about current video card
LONG result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E968-E325-11CE-BFC1-08002BE10318}", 0, KEY_READ, &parentKey); LONG result = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E968-E325-11CE-BFC1-08002BE10318}", 0, KEY_READ, &parentKey);
if (result == ERROR_SUCCESS) if (result == ERROR_SUCCESS)
{ {
// find last config // find last config
@ -2541,7 +2541,7 @@ void CDriverGL::retrieveATIDriverVersion()
for(;;) for(;;)
{ {
nameBufferSize = sizeof(subKeyName) / sizeof(subKeyName[0]); nameBufferSize = sizeof(subKeyName) / sizeof(subKeyName[0]);
result = RegEnumKeyEx(parentKey, keyIndex, subKeyName, &nameBufferSize, NULL, NULL, NULL, &lastWriteTime); result = RegEnumKeyExA(parentKey, keyIndex, subKeyName, &nameBufferSize, NULL, NULL, NULL, &lastWriteTime);
if (result == ERROR_NO_MORE_ITEMS) break; if (result == ERROR_NO_MORE_ITEMS) break;
if (result == ERROR_SUCCESS) if (result == ERROR_SUCCESS)
{ {
@ -2577,14 +2577,14 @@ void CDriverGL::retrieveATIDriverVersion()
if (configFound) if (configFound)
{ {
HKEY subKey; HKEY subKey;
result = RegOpenKeyEx(parentKey, latestSubKeyName, 0, KEY_READ, &subKey); result = RegOpenKeyExA(parentKey, latestSubKeyName, 0, KEY_READ, &subKey);
if (result == ERROR_SUCCESS) if (result == ERROR_SUCCESS)
{ {
// see if it is a radeon card // see if it is a radeon card
DWORD valueType; DWORD valueType;
char driverDesc[256]; char driverDesc[256];
DWORD driverDescBufSize = sizeof(driverDesc) / sizeof(driverDesc[0]); DWORD driverDescBufSize = sizeof(driverDesc) / sizeof(driverDesc[0]);
result = RegQueryValueEx(subKey, "DriverDesc", NULL, &valueType, (unsigned char *) driverDesc, &driverDescBufSize); result = RegQueryValueExA(subKey, "DriverDesc", NULL, &valueType, (unsigned char *) driverDesc, &driverDescBufSize);
if (result == ERROR_SUCCESS && valueType == REG_SZ) if (result == ERROR_SUCCESS && valueType == REG_SZ)
{ {
toLower(driverDesc); toLower(driverDesc);
@ -2592,7 +2592,7 @@ void CDriverGL::retrieveATIDriverVersion()
{ {
char driverVersion[256]; char driverVersion[256];
DWORD driverVersionBufSize = sizeof(driverVersion) / sizeof(driverVersion[0]); DWORD driverVersionBufSize = sizeof(driverVersion) / sizeof(driverVersion[0]);
result = RegQueryValueEx(subKey, "DriverVersion", NULL, &valueType, (unsigned char *) driverVersion, &driverVersionBufSize); result = RegQueryValueExA(subKey, "DriverVersion", NULL, &valueType, (unsigned char *) driverVersion, &driverVersionBufSize);
if (result == ERROR_SUCCESS && valueType == REG_SZ) if (result == ERROR_SUCCESS && valueType == REG_SZ)
{ {
int subVersionNumber[4]; int subVersionNumber[4];

@ -1672,7 +1672,7 @@ bool CDriverGL::compileEXTVertexShader(CVertexProgram *program)
} }
/* /*
FILE *f = fopen(getLogDirectory() + "test.txt", "wb"); FILE *f = nlfopen(getLogDirectory() + "test.txt", "wb");
if (f) if (f)
{ {
std::string vpText; std::string vpText;

@ -326,7 +326,7 @@ bool CDriverGL::init (uintptr_t windowIcon, emptyProc exitFunc)
} }
// Backup monitor color parameters // Backup monitor color parameters
HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL); HDC dc = CreateDCA ("DISPLAY", NULL, NULL, NULL);
if (dc) if (dc)
{ {
_NeedToRestoreGammaRamp = GetDeviceGammaRamp (dc, _GammaRampBackuped) != FALSE; _NeedToRestoreGammaRamp = GetDeviceGammaRamp (dc, _GammaRampBackuped) != FALSE;
@ -468,7 +468,7 @@ bool CDriverGL::unInit()
// Restore monitor color parameters // Restore monitor color parameters
if (_NeedToRestoreGammaRamp) if (_NeedToRestoreGammaRamp)
{ {
HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL); HDC dc = CreateDCA ("DISPLAY", NULL, NULL, NULL);
if (dc) if (dc)
{ {
if (!SetDeviceGammaRamp (dc, _GammaRampBackuped)) if (!SetDeviceGammaRamp (dc, _GammaRampBackuped))
@ -558,13 +558,13 @@ void CDriverGL::setWindowIcon(const std::vector<NLMISC::CBitmap> &bitmaps)
if (winIconBig) if (winIconBig)
{ {
SendMessage(_win, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall); SendMessageA(_win, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall);
SendMessage(_win, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconBig); SendMessageA(_win, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconBig);
} }
else else
{ {
SendMessage(_win, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall); SendMessageA(_win, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall);
SendMessage(_win, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconSmall); SendMessageA(_win, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconSmall);
} }
#elif defined(NL_OS_MAC) #elif defined(NL_OS_MAC)
@ -2622,7 +2622,7 @@ IDriver::TMessageBoxId CDriverGL::systemMessageBox (const char* message, const c
{ {
H_AUTO_OGL(CDriverGL_systemMessageBox) H_AUTO_OGL(CDriverGL_systemMessageBox)
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
switch (::MessageBox (NULL, message, title, ((type==retryCancelType)?MB_RETRYCANCEL: switch (::MessageBoxW (NULL, utf8ToWide(message), utf8ToWide(title), ((type==retryCancelType)?MB_RETRYCANCEL:
(type==yesNoCancelType)?MB_YESNOCANCEL: (type==yesNoCancelType)?MB_YESNOCANCEL:
(type==okCancelType)?MB_OKCANCEL: (type==okCancelType)?MB_OKCANCEL:
(type==abortRetryIgnoreType)?MB_ABORTRETRYIGNORE: (type==abortRetryIgnoreType)?MB_ABORTRETRYIGNORE:
@ -2847,7 +2847,7 @@ bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &proper
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
// Get a DC // Get a DC
HDC dc = CreateDC ("DISPLAY", NULL, NULL, NULL); HDC dc = CreateDCA ("DISPLAY", NULL, NULL, NULL);
if (dc) if (dc)
{ {
// The ramp // The ramp

@ -22,6 +22,7 @@
#include "nel/misc/debug.h" #include "nel/misc/debug.h"
#include "nel/misc/common.h" #include "nel/misc/common.h"
#include "nel/misc/path.h" #include "nel/misc/path.h"
#include "nel/misc/file.h"
#include "nel/3d/font_generator.h" #include "nel/3d/font_generator.h"
@ -81,6 +82,93 @@ CFontGenerator *newCFontGenerator(const std::string &fontFileName)
return new CFontGenerator(fontFileName); return new CFontGenerator(fontFileName);
} }
// Freetype will call this function to get a buffer in data
static unsigned long nlFreetypeStreamIo(FT_Stream stream, unsigned long offset, unsigned char* buffer, unsigned long count)
{
// if count is 0, we don't need to do anything
if (count > 0)
{
// get a pointer on our CIFile
CIFile *file = (CIFile*)stream->descriptor.pointer;
// try to seek to offset
if (file->seek(offset, IStream::begin))
{
try
{
// try to fill buffer with data from file
file->serialBuffer(buffer, count);
}
catch(const EFile &e)
{
nlwarning("Unable to read %u bytes from position %u of %s", (uint)count, (uint)offset, file->getStreamName().c_str());
count = 0;
}
}
else
{
nlwarning("Unable to seek to position %u of %s", (uint)offset, file->getStreamName().c_str());
count = 0;
}
}
return count;
}
// Freetype will call this function when it won't need to access to file anymore
static void nlFreetypeStreamClose(FT_Stream stream)
{
if (!stream) return;
// get a pointer on our CIFile
CIFile *file = (CIFile*)stream->descriptor.pointer;
if (file)
{
// close and delete file
file->close();
delete file;
stream->descriptor.pointer = NULL;
}
// free Freetype stream structure
free(stream);
}
// helper to open a font and use our functions to handle BNP files and UTF-8 filenames
static bool createFreetypeStream(const std::string &filename, FT_Open_Args &args)
{
CIFile *file = new CIFile();
if (!file->open(filename))
{
nlwarning("Unable to open %s", filename.c_str());
return false;
}
args.flags = FT_OPEN_STREAM;
args.stream = (FT_Stream)malloc(sizeof(*args.stream));
if (args.stream == NULL)
{
nlwarning("Unable to allocate FT_Stream for %s", filename.c_str());
delete file;
return false;
}
args.stream->base = NULL; // only used for memory streams
args.stream->size = file->getFileSize();
args.stream->pos = 0;
args.stream->descriptor.pointer = file;
args.stream->pathname.pointer = NULL; // filename is already managed by CIFile
args.stream->read = nlFreetypeStreamIo;
args.stream->close = nlFreetypeStreamClose;
return true;
}
/* /*
* Constructor * Constructor
*/ */
@ -102,7 +190,14 @@ CFontGenerator::CFontGenerator (const std::string &fontFileName, const std::stri
} }
++_LibraryInit; ++_LibraryInit;
error = FT_New_Face (_Library, fontFileName.c_str (), 0, &_Face); FT_Open_Args args;
if (!createFreetypeStream(fontFileName, args))
{
nlerror ("createFreetypeStream failed with file '%s'", fontFileName.c_str());
}
error = FT_Open_Face(_Library, &args, 0, &_Face);
if (error) if (error)
{ {
nlerror ("FT_New_Face() failed with file '%s': %s", fontFileName.c_str(), getFT2Error(error)); nlerror ("FT_New_Face() failed with file '%s': %s", fontFileName.c_str(), getFT2Error(error));
@ -117,7 +212,12 @@ CFontGenerator::CFontGenerator (const std::string &fontFileName, const std::stri
if (!fontEx.empty()) if (!fontEx.empty())
{ {
error = FT_Attach_File (_Face, fontEx.c_str ()); if (!createFreetypeStream(fontEx, args))
{
nlerror ("createFreetypeStream failed with file '%s'", fontFileName.c_str());
}
error = FT_Attach_Stream(_Face, &args);
if (error) if (error)
{ {
nlwarning ("FT_Attach_File() failed with file '%s': %s", fontEx.c_str(), getFT2Error(error)); nlwarning ("FT_Attach_File() failed with file '%s': %s", fontEx.c_str(), getFT2Error(error));

@ -26,9 +26,6 @@
#include "nel/misc/file.h" #include "nel/misc/file.h"
#include "nel/misc/hierarchical_timer.h" #include "nel/misc/hierarchical_timer.h"
// std.
#include <fstream>
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;
@ -85,8 +82,6 @@ void CLandscapeIGManager::initIG(UScene *scene, const std::string &igDesc, UDriv
string igFile = CPath::lookup(igDesc); string igFile = CPath::lookup(igDesc);
//ifstream file(igFile.c_str(), ios::in);
CIFile file; CIFile file;
// Shape to add should be empty ! // Shape to add should be empty !

@ -304,7 +304,7 @@ namespace NLGUI
return; return;
} }
FILE *fp = fopen (tmpdest.c_str(), "wb"); FILE *fp = nlfopen (tmpdest, "wb");
if (fp == NULL) if (fp == NULL)
{ {
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
@ -411,7 +411,7 @@ namespace NLGUI
return false; return false;
} }
FILE *fp = fopen (tmpdest.c_str(), "wb"); FILE *fp = nlfopen (tmpdest, "wb");
if (fp == NULL) if (fp == NULL)
{ {
curl_easy_cleanup(curl); curl_easy_cleanup(curl);

@ -27,7 +27,6 @@
#include <ctime> #include <ctime>
#include <deque> #include <deque>
#include <exception> #include <exception>
#include <fstream>
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <limits> #include <limits>

@ -152,6 +152,7 @@ FILE(GLOB NLMISC_BITMAP
FILE(GLOB NLMISC_CRYPT FILE(GLOB NLMISC_CRYPT
md5.cpp ../../include/nel/misc/md5.h md5.cpp ../../include/nel/misc/md5.h
sha1.cpp ../../include/nel/misc/sha1.h sha1.cpp ../../include/nel/misc/sha1.h
../../include/nel/misc/wang_hash.h
) )
SOURCE_GROUP("" FILES ${SRC} ${HEADERS}) SOURCE_GROUP("" FILES ${SRC} ${HEADERS})

@ -207,16 +207,11 @@ CAsyncFileManager::CFileLoad::CFileLoad (const std::string& sFileName, uint8 **p
// *************************************************************************** // ***************************************************************************
void CAsyncFileManager::CFileLoad::run (void) void CAsyncFileManager::CFileLoad::run (void)
{ {
FILE *f = fopen (_FileName.c_str(), "rb"); FILE *f = nlfopen (_FileName, "rb");
if (f != NULL) if (f != NULL)
{ {
uint8 *ptr; uint32 filesize=CFile::getFileSize (f);
long filesize=CFile::getFileSize (f); uint8 *ptr = new uint8[filesize];
//fseek (f, 0, SEEK_END);
//long filesize = ftell (f);
//nlSleep(5);
//fseek (f, 0, SEEK_SET);
ptr = new uint8[filesize];
if (fread (ptr, filesize, 1, f) != 1) if (fread (ptr, filesize, 1, f) != 1)
nlwarning("AFM: Couldn't read '%s'", _FileName.c_str()); nlwarning("AFM: Couldn't read '%s'", _FileName.c_str());
fclose (f); fclose (f);
@ -253,16 +248,11 @@ void CAsyncFileManager::CMultipleFileLoad::run (void)
{ {
for (uint32 i = 0; i < _FileNames.size(); ++i) for (uint32 i = 0; i < _FileNames.size(); ++i)
{ {
FILE *f = fopen (_FileNames[i].c_str(), "rb"); FILE *f = nlfopen (_FileNames[i], "rb");
if (f != NULL) if (f != NULL)
{ {
uint8 *ptr; uint32 filesize=CFile::getFileSize (f);
long filesize=CFile::getFileSize (f); uint8 *ptr = new uint8[filesize];
//fseek (f, 0, SEEK_END);
//long filesize = ftell (f);
//nlSleep(5);
//fseek (f, 0, SEEK_SET);
ptr = new uint8[filesize];
if (fread (ptr, filesize, 1, f) != 1) if (fread (ptr, filesize, 1, f) != 1)
nlwarning("AFM: Couldn't read '%s'", _FileNames[i].c_str()); nlwarning("AFM: Couldn't read '%s'", _FileNames[i].c_str());
fclose (f); fclose (f);

@ -136,7 +136,7 @@ bool CBigFile::add (const std::string &sBigFileName, uint32 nOptions)
CHandleFile &handle= _ThreadFileArray.get(bnp.ThreadFileId); CHandleFile &handle= _ThreadFileArray.get(bnp.ThreadFileId);
// Open the big file. // Open the big file.
handle.File = fopen (sBigFileName.c_str(), "rb"); handle.File = nlfopen (sBigFileName, "rb");
if (handle.File == NULL) if (handle.File == NULL)
return false; return false;
@ -197,7 +197,7 @@ bool CBigFile::BNP::readHeader()
// Only external use // Only external use
if (InternalUse || BigFileName.empty()) return false; if (InternalUse || BigFileName.empty()) return false;
FILE *f = fopen (BigFileName.c_str(), "rb"); FILE *f = nlfopen (BigFileName, "rb");
if (f == NULL) return false; if (f == NULL) return false;
bool res = readHeader(f); bool res = readHeader(f);
@ -348,7 +348,7 @@ bool CBigFile::BNP::appendHeader()
// Only external use // Only external use
if (InternalUse || BigFileName.empty()) return false; if (InternalUse || BigFileName.empty()) return false;
FILE *f = fopen (BigFileName.c_str(), "ab"); FILE *f = nlfopen (BigFileName, "ab");
if (f == NULL) return false; if (f == NULL) return false;
uint32 nNbFile = (uint32)SFiles.size(); uint32 nNbFile = (uint32)SFiles.size();
@ -438,10 +438,10 @@ bool CBigFile::BNP::appendFile(const std::string &filename)
SFiles.push_back(ftmp); SFiles.push_back(ftmp);
OffsetFromBeginning += ftmp.Size; OffsetFromBeginning += ftmp.Size;
FILE *f1 = fopen(BigFileName.c_str(), "ab"); FILE *f1 = nlfopen(BigFileName, "ab");
if (f1 == NULL) return false; if (f1 == NULL) return false;
FILE *f2 = fopen(filename.c_str(), "rb"); FILE *f2 = nlfopen(filename, "rb");
if (f2 == NULL) if (f2 == NULL)
{ {
fclose(f1); fclose(f1);
@ -473,7 +473,7 @@ bool CBigFile::BNP::unpack(const std::string &sDestDir, TUnpackProgressCallback
// Only external use // Only external use
if (InternalUse || BigFileName.empty()) return false; if (InternalUse || BigFileName.empty()) return false;
FILE *bnp = fopen (BigFileName.c_str(), "rb"); FILE *bnp = nlfopen (BigFileName, "rb");
if (bnp == NULL) if (bnp == NULL)
return false; return false;
@ -506,7 +506,7 @@ bool CBigFile::BNP::unpack(const std::string &sDestDir, TUnpackProgressCallback
return false; return false;
} }
out = fopen (filename.c_str(), "wb"); out = nlfopen (filename, "wb");
if (out != NULL) if (out != NULL)
{ {
nlfseek64 (bnp, rBNPFile.Pos, SEEK_SET); nlfseek64 (bnp, rBNPFile.Pos, SEEK_SET);
@ -681,7 +681,7 @@ FILE* CBigFile::getFile (const std::string &sFileName, uint32 &rFileSize,
*/ */
if(handle.File== NULL) if(handle.File== NULL)
{ {
handle.File = fopen (bnp->BigFileName.c_str(), "rb"); handle.File = nlfopen (bnp->BigFileName, "rb");
if (handle.File == NULL) if (handle.File == NULL)
{ {
nlwarning ("bnp: can't fopen big file '%s' error %d '%s'", bnp->BigFileName.c_str(), errno, strerror(errno)); nlwarning ("bnp: can't fopen big file '%s' error %d '%s'", bnp->BigFileName.c_str(), errno, strerror(errno));

@ -555,17 +555,10 @@ uint8 CBitmap::readDDS(NLMISC::IStream &f, uint mipMapSkip)
(very) bad rendered with this fix so we have to deactivate it the for moment (very) bad rendered with this fix so we have to deactivate it the for moment
*/ */
//#ifdef NL_OS_WINDOWS
// if(PixelFormat==DXTC1) //AlphaBitDepth
// {
// PixelFormat = DXTC1Alpha;
// }
//#else
if(PixelFormat==DXTC1 && _DDSSurfaceDesc[21]>0) //AlphaBitDepth if(PixelFormat==DXTC1 && _DDSSurfaceDesc[21]>0) //AlphaBitDepth
{ {
PixelFormat = DXTC1Alpha; PixelFormat = DXTC1Alpha;
} }
//#endif
if(PixelFormat!= DXTC1 && PixelFormat!= DXTC1Alpha && PixelFormat!= DXTC3 && PixelFormat!= DXTC5) if(PixelFormat!= DXTC1 && PixelFormat!= DXTC1Alpha && PixelFormat!= DXTC3 && PixelFormat!= DXTC5)
{ {

@ -199,45 +199,16 @@ bool CCmdArgs::parse(const std::string &args)
std::vector<std::string> argv; std::vector<std::string> argv;
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
char str[4096]; wchar_t str[4096];
uint len = GetModuleFileNameA(NULL, str, 4096); uint len = GetModuleFileNameW(NULL, str, 4096);
// first argument should be full path to executable
if (len && len < 4096) if (len && len < 4096)
argv.push_back(str); argv.push_back(wideToUtf8(str));
#endif #endif
std::string::size_type pos1 = 0, pos2 = 0; // convert string with arguments to array
explodeArguments(args, argv);
do
{
// Look for the first non space character
pos1 = args.find_first_not_of (" ", pos2);
if(pos1 == std::string::npos) break;
// Look for the first space or "
pos2 = args.find_first_of (" \"", pos1);
if(pos2 != std::string::npos)
{
// " ?
if(args[pos2] == '"')
{
// Look for the final \"
pos2 = args.find_first_of ("\"", pos2+1);
if(pos2 != std::string::npos)
{
// Look for the first space
pos2 = args.find_first_of (" ", pos2+1);
}
}
}
// Compute the size of the string to extract
std::string::difference_type length = (pos2 != std::string::npos) ? pos2-pos1 : std::string::npos;
std::string tmp = args.substr (pos1, length);
argv.push_back (tmp);
}
while(pos2 != std::string::npos);
return parse(argv); return parse(argv);
} }

@ -506,6 +506,21 @@ string secondsToHumanReadable (uint32 time)
return toString ("%u%s", res, divTable[div]); return toString ("%u%s", res, divTable[div]);
} }
std::string timestampToHumanReadable(uint32 timestamp)
{
char buffer[30];
time_t dtime = timestamp;
tm *tms = localtime(&dtime);
if (tms)
{
strftime(buffer, 30, "%Y-%m-%d %H:%M:%S", tms);
return std::string(buffer);
}
return "";
}
uint32 fromHumanReadable (const std::string &str) uint32 fromHumanReadable (const std::string &str)
{ {
if (str.size() == 0) if (str.size() == 0)
@ -710,50 +725,54 @@ bool abortProgram(uint32 pid)
#endif #endif
} }
bool launchProgram(const std::string &programName, const std::string &arguments, bool log)
{
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
STARTUPINFOA si;
PROCESS_INFORMATION pi;
static bool createProcess(const std::string &programName, const std::string &arguments, bool log, PROCESS_INFORMATION &pi)
{
STARTUPINFOW si;
memset(&si, 0, sizeof(si)); memset(&si, 0, sizeof(si));
memset(&pi, 0, sizeof(pi)); memset(&pi, 0, sizeof(pi));
si.cb = sizeof(si); si.cb = sizeof(si);
// Enable nlassert/nlstop to display the error reason & callstack // Enable nlassert/nlstop to display the error reason & callstack
const TCHAR *SE_TRANSLATOR_IN_MAIN_MODULE = _T("NEL_SE_TRANS"); const char *SE_TRANSLATOR_IN_MAIN_MODULE = "NEL_SE_TRANS";
TCHAR envBuf [2];
if ( GetEnvironmentVariable( SE_TRANSLATOR_IN_MAIN_MODULE, envBuf, 2 ) != 0) char envBuf[2];
if (GetEnvironmentVariableA(SE_TRANSLATOR_IN_MAIN_MODULE, envBuf, 2) != 0)
{ {
SetEnvironmentVariable( SE_TRANSLATOR_IN_MAIN_MODULE, NULL ); SetEnvironmentVariableA(SE_TRANSLATOR_IN_MAIN_MODULE, NULL);
} }
const char *sProgramName = programName.c_str(); wchar_t *sProgramName = NULL;
std::string args; std::string args;
// a .bat file must have first parameter to NULL and use 2nd parameter to pass filename // a .bat file must have first parameter to NULL and use 2nd parameter to pass filename
if (CFile::getExtension(programName) == "bat") if (CFile::getExtension(programName) == "bat")
{ {
sProgramName = NULL;
args = "\"" + programName + "\" " + arguments; args = "\"" + programName + "\" " + arguments;
} }
else else
{ {
ucstring ucProgramName;
ucProgramName.fromUtf8(programName);
sProgramName = new wchar_t[MAX_PATH];
wcscpy(sProgramName, (wchar_t*)ucProgramName.c_str());
args = arguments; args = arguments;
} }
BOOL res = CreateProcessA(sProgramName, (char*)args.c_str(), NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE | CREATE_NO_WINDOW, NULL, NULL, &si, &pi); BOOL res = CreateProcessW(sProgramName, utf8ToWide(args), NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE | CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
if (res) if (sProgramName)
{ {
//nldebug("LAUNCH: Successful launch '%s' with arg '%s'", programName.c_str(), arguments.c_str()); delete [] sProgramName;
CloseHandle( pi.hProcess ); sProgramName = NULL;
CloseHandle( pi.hThread );
return true;
} }
else
if (!res)
{ {
if (log) if (log)
{ {
@ -763,13 +782,31 @@ bool launchProgram(const std::string &programName, const std::string &arguments,
CloseHandle( pi.hProcess ); CloseHandle( pi.hProcess );
CloseHandle( pi.hThread ); CloseHandle( pi.hThread );
return false;
} }
return true;
}
#endif
bool launchProgram(const std::string &programName, const std::string &arguments, bool log)
{
#ifdef NL_OS_WINDOWS
PROCESS_INFORMATION pi;
if (!createProcess(programName, arguments, log, pi)) return false;
//nldebug("LAUNCH: Successful launch '%s' with arg '%s'", programName.c_str(), arguments.c_str());
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
return true;
#else #else
#ifdef NL_OS_MAC #ifdef NL_OS_MAC
// special OS X case with bundles // special OS X case with bundles
if (toLower(programName).find(".app") != std::string::npos) if (toLower(CFile::getExtension(programName)) == ".app")
{ {
// we need to open bundles with "open" command // we need to open bundles with "open" command
std::string command = NLMISC::toString("open \"%s\"", programName.c_str()); std::string command = NLMISC::toString("open \"%s\"", programName.c_str());
@ -794,6 +831,7 @@ bool launchProgram(const std::string &programName, const std::string &arguments,
#endif #endif
static bool firstLaunchProgram = true; static bool firstLaunchProgram = true;
if (firstLaunchProgram) if (firstLaunchProgram)
{ {
// The aim of this is to avoid defunct process. // The aim of this is to avoid defunct process.
@ -814,15 +852,7 @@ bool launchProgram(const std::string &programName, const std::string &arguments,
// convert one arg into several args // convert one arg into several args
vector<string> args; vector<string> args;
string::size_type pos1 = 0, pos2 = 0; explodeArguments(arguments, args);
do
{
pos1 = arguments.find_first_not_of (" ", pos2);
if (pos1 == string::npos) break;
pos2 = arguments.find_first_of (" ", pos1);
args.push_back (arguments.substr (pos1, pos2-pos1));
}
while (pos2 != string::npos);
// Store the size of each arg // Store the size of each arg
vector<char *> argv(args.size()+2); vector<char *> argv(args.size()+2);
@ -867,78 +897,136 @@ bool launchProgram(const std::string &programName, const std::string &arguments,
return false; return false;
} }
sint launchProgramAndWaitForResult(const std::string &programName, const std::string &arguments, bool log) bool launchProgramArray (const std::string &programName, const std::vector<std::string> &arguments, bool log)
{ {
sint res = 0;
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
STARTUPINFOA si;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
memset(&si, 0, sizeof(si)); std::string argumentsJoined = joinArguments(arguments);
memset(&pi, 0, sizeof(pi));
si.cb = sizeof(si); if (!createProcess(programName, argumentsJoined, log, pi)) return false;
// Enable nlassert/nlstop to display the error reason & callstack //nldebug("LAUNCH: Successful launch '%s' with arg '%s'", programName.c_str(), arguments.c_str());
const TCHAR *SE_TRANSLATOR_IN_MAIN_MODULE = _T("NEL_SE_TRANS"); CloseHandle( pi.hProcess );
TCHAR envBuf [2]; CloseHandle( pi.hThread );
if ( GetEnvironmentVariable( SE_TRANSLATOR_IN_MAIN_MODULE, envBuf, 2 ) != 0) return true;
#else
#ifdef NL_OS_MAC
// special OS X case with bundles
if (toLower(CFile::getExtension(programName)) == "app")
{
// we need to open bundles with "open" command
std::string command = NLMISC::toString("open \"%s\"", programName.c_str());
std::string argumentsJoined = joinArguments(arguments);
// append arguments if any
if (!argumentsJoined.empty())
{ {
SetEnvironmentVariable( SE_TRANSLATOR_IN_MAIN_MODULE, NULL ); command += NLMISC::toString(" --args %s", argumentsJoined.c_str());
} }
const char *sProgramName = programName.c_str(); int res = system(command.c_str());
std::string args; if (!res) return true;
// a .bat file must have first parameter to NULL and use 2nd parameter to pass filename if (log)
if (CFile::getExtension(programName) == "bat")
{ {
sProgramName = NULL; nlwarning ("LAUNCH: Failed launched '%s' with arg '%s' return code %d", programName.c_str(), argumentsJoined.c_str(), res);
args = "\"" + programName + "\" " + arguments;
} }
else
{ return false;
args = arguments;
} }
#endif
BOOL ok = CreateProcessA(sProgramName, (char*)args.c_str(), NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE | CREATE_NO_WINDOW, NULL, NULL, &si, &pi); static bool firstLaunchProgram = true;
if (ok) if (firstLaunchProgram)
{ {
// Successfully created the process. Wait for it to finish. // The aim of this is to avoid defunct process.
WaitForSingleObject(pi.hProcess, INFINITE); //
// From "man signal":
// Get the exit code. //------
DWORD exitCode = 0; // According to POSIX (3.3.1.3) it is unspecified what happens when SIGCHLD is set to SIG_IGN. Here
ok = GetExitCodeProcess(pi.hProcess, &exitCode); // the BSD and SYSV behaviours differ, causing BSD software that sets the action for SIGCHLD to
// SIG_IGN to fail on Linux.
//------
//
// But it works fine on my GNU/Linux so I do this because it's easier :) and I don't know exactly
// what to do to be portable.
signal(SIGCHLD, SIG_IGN);
//nldebug("LAUNCH: Successful launch '%s' with arg '%s'", programName.c_str(), arguments.c_str()); firstLaunchProgram = false;
CloseHandle(pi.hProcess); }
CloseHandle(pi.hThread);
if (ok) // Store the size of each arg
vector<char *> argv(arguments.size()+2);
uint i = 0;
argv[i] = (char *)programName.c_str();
for (; i < arguments.size(); i++)
{ {
res = (sint)exitCode; argv[i+1] = (char *) arguments[i].c_str();
} }
else argv[i+1] = NULL;
int status = vfork ();
/////////////////////////////////////////////////////////
/// WARNING : NO MORE INSTRUCTION AFTER VFORK !
/// READ VFORK manual
/////////////////////////////////////////////////////////
if (status == -1)
{ {
char *err = strerror (errno);
if (log) if (log)
nlwarning("LAUNCH: Failed launched '%s' with arg '%s'", programName.c_str(), arguments.c_str()); nlwarning("LAUNCH: Failed launched '%s' with arg '%s' err %d: '%s'", programName.c_str(), joinArguments(arguments).c_str(), errno, err);
}
else if (status == 0)
{
// Exec (the only allowed instruction after vfork)
status = execvp(programName.c_str(), &argv.front());
if (status == -1)
{
perror("Failed launched");
_exit(EXIT_FAILURE);
} }
} }
else else
{ {
if (log) //nldebug("LAUNCH: Successful launch '%s' with arg '%s'", programName.c_str(), arguments.c_str());
{
sint lastError = getLastError(); return true;
nlwarning("LAUNCH: Failed launched '%s' with arg '%s' err %d: '%s'", programName.c_str(), arguments.c_str(), lastError, formatErrorMessage(lastError).c_str());
} }
#endif
return false;
}
sint launchProgramAndWaitForResult(const std::string &programName, const std::string &arguments, bool log)
{
#ifdef NL_OS_WINDOWS
PROCESS_INFORMATION pi;
if (!createProcess(programName, arguments, log, pi)) return -1;
// Successfully created the process. Wait for it to finish.
WaitForSingleObject(pi.hProcess, INFINITE);
// Get the exit code.
DWORD exitCode = 0;
BOOL ok = GetExitCodeProcess(pi.hProcess, &exitCode);
//nldebug("LAUNCH: Successful launch '%s' with arg '%s'", programName.c_str(), arguments.c_str());
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
}
if (ok) return (sint)exitCode;
if (log)
nlwarning("LAUNCH: Failed launched '%s' with arg '%s'", programName.c_str(), arguments.c_str());
return -1;
#else #else
// program name is the only required string // program name is the only required string
std::string command = programName; std::string command = programName;
@ -947,13 +1035,13 @@ sint launchProgramAndWaitForResult(const std::string &programName, const std::st
if (!arguments.empty()) command += " " + arguments; if (!arguments.empty()) command += " " + arguments;
// execute the command // execute the command
res = system(command.c_str()); sint res = system(command.c_str());
if (res && log) if (res && log)
nlwarning ("LAUNCH: Failed launched '%s' with arg '%s' return code %d", programName.c_str(), arguments.c_str(), res); nlwarning ("LAUNCH: Failed launched '%s' with arg '%s' return code %d", programName.c_str(), arguments.c_str(), res);
#endif
return res; return res;
#endif
} }
std::string getCommandOutput(const std::string &command) std::string getCommandOutput(const std::string &command)
@ -1050,6 +1138,75 @@ std::string expandEnvironmentVariables(const std::string &s)
return ret; return ret;
} }
bool explodeArguments(const std::string &str, std::vector<std::string> &args)
{
if (str.empty()) return false;
std::string::size_type pos1 = 0, pos2 = 0;
do
{
// Look for the first non space character
pos1 = str.find_first_not_of (" ", pos2);
if (pos1 == std::string::npos) break;
// Look for the first space or "
pos2 = str.find_first_of (" \"", pos1);
if (pos2 != std::string::npos)
{
// " ?
if (str[pos2] == '"')
{
// Look for the final \"
pos2 = str.find_first_of ("\"", pos2+1);
if (pos2 != std::string::npos)
{
// Look for the first space
pos2 = str.find_first_of (" ", pos2+1);
}
}
}
// Compute the size of the string to extract
std::string::difference_type length = (pos2 != std::string::npos) ? pos2-pos1 : std::string::npos;
std::string tmp = str.substr (pos1, length);
// remove escape " from argument
if (tmp.length() > 1 && tmp[0] == '"' && tmp[tmp.length()-1] == '"') tmp = tmp.substr(1, tmp.length()-2);
args.push_back (tmp);
}
while(pos2 != std::string::npos);
return true;
}
std::string joinArguments(const std::vector<std::string> &args)
{
std::string res;
for(uint i = 0, len = (uint)args.size(); i < len; ++i)
{
const std::string &arg = args[i];
// prepend space
if (!res.empty()) res += " ";
// escape only if spaces or empty argument
if (arg.empty() || arg.find(' ') != std::string::npos)
{
res += "\"" + arg + "\"";
}
else
{
res += arg;
}
}
return res;
}
/* /*
* Display the bits (with 0 and 1) composing a byte (from right to left) * Display the bits (with 0 and 1) composing a byte (from right to left)
*/ */
@ -1099,6 +1256,14 @@ void displayDwordBits( uint32 b, uint nbits, sint beginpos, bool displayBegin, N
} }
} }
FILE* nlfopen(const std::string &filename, const std::string &mode)
{
#ifdef NL_OS_WINDOWS
return _wfopen(utf8ToWide(filename), utf8ToWide(mode));
#else
return fopen(filename.c_str(), mode.c_str());
#endif
}
int nlfseek64( FILE *stream, sint64 offset, int origin ) int nlfseek64( FILE *stream, sint64 offset, int origin )
{ {

@ -600,7 +600,7 @@ void CConfigFile::save () const
// Avoid any problem, Force Locale to default // Avoid any problem, Force Locale to default
setlocale(LC_ALL, "C"); setlocale(LC_ALL, "C");
FILE *fp = fopen (getFilename().c_str (), "w"); FILE *fp = nlfopen (getFilename(), "w");
if (fp == NULL) if (fp == NULL)
{ {
nlwarning ("CF: Couldn't create %s file", getFilename().c_str ()); nlwarning ("CF: Couldn't create %s file", getFilename().c_str ());

@ -42,7 +42,7 @@ bool CCPUTimeStat::getCPUTicks(uint64& user, uint64& nice, uint64& system, uint6
#ifdef NL_OS_UNIX #ifdef NL_OS_UNIX
const char* statfile = "/proc/stat"; const char* statfile = "/proc/stat";
FILE* f = fopen(statfile, "r"); FILE* f = nlfopen(statfile, "r");
if (f == NULL) if (f == NULL)
return false; return false;
@ -66,7 +66,7 @@ bool CCPUTimeStat::getPIDTicks(uint64& utime, uint64& stime, uint64& cutime, uin
#ifdef NL_OS_UNIX #ifdef NL_OS_UNIX
std::string statfile = NLMISC::toString("/proc/%u/stat", pid); std::string statfile = NLMISC::toString("/proc/%u/stat", pid);
FILE* f = fopen(statfile.c_str(), "r"); FILE* f = nlfopen(statfile, "r");
if (f == NULL) if (f == NULL)
return false; return false;

@ -310,9 +310,9 @@ static DWORD __stdcall GetModuleBase(HANDLE hProcess, DWORD dwReturnAddress)
&memoryBasicInfo, sizeof(memoryBasicInfo))) &memoryBasicInfo, sizeof(memoryBasicInfo)))
{ {
DWORD cch = 0; DWORD cch = 0;
char szFile[MAX_PATH] = { 0 }; wchar_t szFile[MAX_PATH] = { 0 };
cch = GetModuleFileNameA((HINSTANCE)memoryBasicInfo.AllocationBase, cch = GetModuleFileNameW((HINSTANCE)memoryBasicInfo.AllocationBase,
szFile, MAX_PATH); szFile, MAX_PATH);
if (cch && (lstrcmpA(szFile, "DBFN")== 0)) if (cch && (lstrcmpA(szFile, "DBFN")== 0))
@ -527,9 +527,9 @@ public:
string progname; string progname;
if(!shortExc.empty() || !longExc.empty()) if(!shortExc.empty() || !longExc.empty())
{ {
char name[1024]; wchar_t name[1024];
GetModuleFileNameA (NULL, name, 1023); GetModuleFileNameW (NULL, name, 1023);
progname = CFile::getFilename(name); progname = CFile::getFilename(wideToUtf8(name));
progname += " "; progname += " ";
} }
@ -1171,12 +1171,12 @@ void createDebug (const char *logPath, bool logInFile, bool eraseLastLog)
// Use an environment variable to share the value among the EXE and its child DLLs // Use an environment variable to share the value among the EXE and its child DLLs
// (otherwise there would be one distinct bool by module, and the last // (otherwise there would be one distinct bool by module, and the last
// _set_se_translator would overwrite the previous ones) // _set_se_translator would overwrite the previous ones)
const TCHAR *SE_TRANSLATOR_IN_MAIN_MODULE = _T("NEL_SE_TRANS"); const char *SE_TRANSLATOR_IN_MAIN_MODULE = "NEL_SE_TRANS";
TCHAR envBuf [2]; char envBuf [2];
if ( GetEnvironmentVariable( SE_TRANSLATOR_IN_MAIN_MODULE, envBuf, 2 ) == 0) if ( GetEnvironmentVariableA( SE_TRANSLATOR_IN_MAIN_MODULE, envBuf, 2 ) == 0)
{ {
_set_se_translator(exceptionTranslator); _set_se_translator(exceptionTranslator);
SetEnvironmentVariable( SE_TRANSLATOR_IN_MAIN_MODULE, _T("1") ); SetEnvironmentVariableA( SE_TRANSLATOR_IN_MAIN_MODULE, "1" );
} }
} }
# endif // NL_OS_WINDOWS # endif // NL_OS_WINDOWS

@ -93,7 +93,7 @@ bool loadStringFile(const std::string filename, vector<TStringInfo> &stringInfos
return true; return true;
} }
*/ */
/* FILE *fp = fopen(filename.c_str(), "rb"); /* FILE *fp = nlfopen(filename, "rb");
if (fp == NULL) if (fp == NULL)
{ {

@ -216,7 +216,7 @@ void CStdDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess
static bool consoleModeTest = false; static bool consoleModeTest = false;
if (!consoleModeTest) if (!consoleModeTest)
{ {
HANDLE handle = CreateFile ("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); HANDLE handle = CreateFileA ("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
consoleMode = handle != INVALID_HANDLE_VALUE; consoleMode = handle != INVALID_HANDLE_VALUE;
if (consoleMode) if (consoleMode)
CloseHandle (handle); CloseHandle (handle);
@ -286,20 +286,14 @@ void CStdDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess
// WARNING: READ THIS !!!!!!!!!!!!!!!! /////////////////////////// // WARNING: READ THIS !!!!!!!!!!!!!!!! ///////////////////////////
// If at the release time, it freezes here, it's a microsoft bug: // If at the release time, it freezes here, it's a microsoft bug:
// http://support.microsoft.com/support/kb/articles/q173/2/60.asp // http://support.microsoft.com/support/kb/articles/q173/2/60.asp
OutputDebugStringW((LPCWSTR)ucstring::makeFromUtf8(str2).c_str()); OutputDebugStringW(utf8ToWide(str2));
} }
else else
{ {
/*OutputDebugString(ss2.str().c_str());
OutputDebugString("\n\t\t\t");
OutputDebugString("message end: ");
OutputDebugString(&message[strlen(message) - 1024]);
OutputDebugString("\n");*/
sint count = 0; sint count = 0;
uint n = (uint)strlen(message); uint n = (uint)strlen(message);
std::string s(&str2.c_str()[0], (str2.size() - n)); std::string s(&str2.c_str()[0], (str2.size() - n));
OutputDebugStringW((LPCWSTR)ucstring::makeFromUtf8(s).c_str()); OutputDebugStringW(utf8ToWide(s));
for(;;) for(;;)
{ {
@ -307,15 +301,15 @@ void CStdDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess
if((n - count) < maxOutString ) if((n - count) < maxOutString )
{ {
s = std::string(&message[count], (n - count)); s = std::string(&message[count], (n - count));
OutputDebugStringW((LPCWSTR)ucstring::makeFromUtf8(s).c_str()); OutputDebugStringW(utf8ToWide(s));
OutputDebugStringW((LPCWSTR)ucstring::makeFromUtf8("\n").c_str()); OutputDebugStringW(L"\n");
break; break;
} }
else else
{ {
s = std::string(&message[count] , count + maxOutString); s = std::string(&message[count] , count + maxOutString);
OutputDebugStringW((LPCWSTR)ucstring::makeFromUtf8(s).c_str()); OutputDebugStringW(utf8ToWide(s));
OutputDebugStringW((LPCWSTR)ucstring::makeFromUtf8("\n\t\t\t").c_str()); OutputDebugStringW(L"\n\t\t\t");
count += maxOutString; count += maxOutString;
} }
} }
@ -329,13 +323,13 @@ void CStdDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess
if (pos+1000 < args.CallstackAndLog.size ()) if (pos+1000 < args.CallstackAndLog.size ())
{ {
splited = args.CallstackAndLog.substr (pos, 1000); splited = args.CallstackAndLog.substr (pos, 1000);
OutputDebugStringW((LPCWSTR)ucstring::makeFromUtf8(splited).c_str()); OutputDebugStringW(utf8ToWide(splited));
pos += 1000; pos += 1000;
} }
else else
{ {
splited = args.CallstackAndLog.substr (pos); splited = args.CallstackAndLog.substr (pos);
OutputDebugStringW((LPCWSTR)ucstring::makeFromUtf8(splited).c_str()); OutputDebugStringW(utf8ToWide(splited));
break; break;
} }
} }
@ -491,7 +485,7 @@ void CFileDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mes
if (_FilePointer == (FILE*)1) if (_FilePointer == (FILE*)1)
{ {
_FilePointer = fopen (_FileName.c_str(), "at"); _FilePointer = nlfopen (_FileName, "at");
if (_FilePointer == NULL) if (_FilePointer == NULL)
printf ("Can't open log file '%s': %s\n", _FileName.c_str(), strerror (errno)); printf ("Can't open log file '%s': %s\n", _FileName.c_str(), strerror (errno));
} }
@ -702,58 +696,4 @@ void CMsgBoxDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *m
} }
} }
/***************************************************************/
/******************* THE FOLLOWING CODE IS COMMENTED OUT *******/
/***************************************************************
void CStdDisplayer::display (const std::string& str)
{
// printf("%s", str.c_str ());
cout << str;
#ifdef NL_OS_WINDOWS
// display the string in the debugger is the application is started with the debugger
if (IsDebuggerPresent ())
OutputDebugString(str.c_str ());
#endif
}
void CFileDisplayer::display (const std::string& str)
{
if (_FileName.size () == 0) return;
ofstream ofs (_FileName.c_str (), ios::out | ios::app);
if (ofs.is_open ())
{
ofs << str;
ofs.close();
}
// FILE *fp = fopen (_FileName.c_str (), "a");
// if (fp == NULL) return;
// fprintf (fp, "%s", str.c_str ());
// fclose (fp);
}
void CMsgBoxDisplayer::display (const std::string& str)
{
#ifdef NL_OS_WINDOWS
CSystemUtils::copyTextToClipboard(str);
string strf = str;
strf += "\n\n(this message was copied in the clipboard)";
MessageBox (NULL, strf.c_str (), "", MB_OK | MB_ICONEXCLAMATION);
#endif
}
**************************************************************************/
} // NLMISC } // NLMISC

@ -45,32 +45,32 @@ bool CDummyWindow::init(HINSTANCE hInstance, WNDPROC winProc)
{ {
release(); release();
static const char *INVISIBLE_WINDOW_CLASS = "nl_invisible_wnd_class"; static const char *INVISIBLE_WINDOW_CLASS = "nl_invisible_wnd_class";
WNDCLASSEX wc; WNDCLASSEXA wc;
wc.cbSize = sizeof(WNDCLASSEX); wc.cbSize = sizeof(WNDCLASSEXA);
if (!GetClassInfoEx(hInstance, INVISIBLE_WINDOW_CLASS, &wc)) if (!GetClassInfoExA(hInstance, INVISIBLE_WINDOW_CLASS, &wc))
{ {
wc.cbSize = sizeof(WNDCLASSEX); wc.cbSize = sizeof(WNDCLASSEXA);
wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
wc.lpfnWndProc = nlDefaultWinProc; wc.lpfnWndProc = nlDefaultWinProc;
wc.cbClsExtra = 0; wc.cbClsExtra = 0;
wc.cbWndExtra = 0; wc.cbWndExtra = 0;
wc.hInstance = hInstance; wc.hInstance = hInstance;
wc.hIcon = 0; wc.hIcon = NULL;
wc.hCursor = 0; wc.hCursor = NULL;
wc.hbrBackground = 0; wc.hbrBackground = NULL;
wc.lpszMenuName = 0; wc.lpszMenuName = NULL;
wc.lpszClassName = INVISIBLE_WINDOW_CLASS; wc.lpszClassName = INVISIBLE_WINDOW_CLASS;
wc.hIconSm = 0; wc.hIconSm = NULL;
RegisterClassEx(&wc); RegisterClassExA(&wc);
} }
_HWnd = CreateWindow(INVISIBLE_WINDOW_CLASS, "", WS_POPUP, _HWnd = CreateWindowA(INVISIBLE_WINDOW_CLASS, "", WS_POPUP,
CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT,
CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT,
NULL, 0, NULL, 0,
hInstance, 0); hInstance, 0);
if (_HWnd) if (_HWnd)
{ {
if (winProc) SetWindowLongPtr(_HWnd, GWLP_WNDPROC, (LONG_PTR) winProc); if (winProc) SetWindowLongPtrA(_HWnd, GWLP_WNDPROC, (LONG_PTR) winProc);
return true; return true;
} }
return false; return false;

@ -32,7 +32,7 @@ NL_LIB_HANDLE nlLoadLibrary(const std::string &libName)
{ {
NL_LIB_HANDLE res = 0; NL_LIB_HANDLE res = 0;
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
res = LoadLibrary(libName.c_str()); res = LoadLibraryW(utf8ToWide(libName));
#elif defined(NL_OS_UNIX) #elif defined(NL_OS_UNIX)
res = dlopen(libName.c_str(), RTLD_NOW); res = dlopen(libName.c_str(), RTLD_NOW);
#else #else

@ -445,7 +445,7 @@ void cbInvalidEntityNamesFilename(const std::string &invalidEntityNamesFilename)
return; return;
} }
FILE *fp = fopen (fn.c_str(), "r"); FILE *fp = nlfopen (fn, "r");
if (fp == NULL) if (fp == NULL)
{ {
nlwarning ("EIT: Can't load filename '%s' for invalid entity names filename", fn.c_str()); nlwarning ("EIT: Can't load filename '%s' for invalid entity names filename", fn.c_str());

@ -243,7 +243,7 @@ bool CIFile::open(const std::string &path, bool text)
_IsInXMLPackFile = false; _IsInXMLPackFile = false;
_BigFileOffset = 0; _BigFileOffset = 0;
_AlwaysOpened = false; _AlwaysOpened = false;
_F = fopen (path.c_str(), mode); _F = nlfopen (path, mode);
if (_F != NULL) if (_F != NULL)
{ {
/* /*
@ -598,7 +598,7 @@ bool COFile::open(const std::string &path, bool append, bool text, bool useTempF
return false; return false;
} }
_F=fopen(fileToOpen.c_str(), mode); _F = nlfopen(fileToOpen, mode);
return _F!=NULL; return _F!=NULL;
} }

@ -567,7 +567,7 @@ void CI18N::readTextFile(const string &filename,
if (!readContext.IfStack.empty()) if (!readContext.IfStack.empty())
{ {
nlwarning("Preprocess: Missing %u closing #endif after parsing %s", readContext.IfStack.size(), filename.c_str() ); nlwarning("Preprocess: Missing %u closing #endif after parsing %s", (uint)readContext.IfStack.size(), filename.c_str() );
} }
} }

@ -96,7 +96,7 @@ namespace NLMISC
nlassert(_Id == 0); // init done twice nlassert(_Id == 0); // init done twice
release(); release();
// create a system wide mutex // create a system wide mutex
_SharedMemMutex = CreateMutex(NULL, FALSE, toString("NL_MUTEX_%d", (int) id).c_str()); _SharedMemMutex = CreateMutexA(NULL, FALSE, toString("NL_MUTEX_%d", (int) id).c_str());
if (!_SharedMemMutex) return false; if (!_SharedMemMutex) return false;
_Id = id; _Id = id;
return true; return true;
@ -197,7 +197,7 @@ namespace NLMISC
cds.lpData = (PVOID) msgOut.buffer(); cds.lpData = (PVOID) msgOut.buffer();
for(;;) for(;;)
{ {
LRESULT result = ::SendMessage(targetWindow, WM_COPYDATA, (WPARAM) _Parent->_LocalWindow.getWnd(), (LPARAM) &cds); LRESULT result = ::SendMessageA(targetWindow, WM_COPYDATA, (WPARAM) _Parent->_LocalWindow.getWnd(), (LPARAM) &cds);
if (result) break; if (result) break;
// retry ... // retry ...
Sleep(30); Sleep(30);

@ -59,9 +59,9 @@ void CLog::setDefaultProcessName ()
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
if ((*_ProcessName).empty()) if ((*_ProcessName).empty())
{ {
char name[1024]; wchar_t name[1024];
GetModuleFileName (NULL, name, 1023); GetModuleFileNameW(NULL, name, 1023);
(*_ProcessName) = CFile::getFilename(name); (*_ProcessName) = CFile::getFilename(wideToUtf8(name));
} }
#else #else
if ((*_ProcessName).empty()) if ((*_ProcessName).empty())

@ -165,10 +165,9 @@ static DWORD __stdcall GetModuleBase(HANDLE hProcess, DWORD dwReturnAddress)
DWORD cch = 0; DWORD cch = 0;
char szFile[MAX_PATH] = { 0 }; char szFile[MAX_PATH] = { 0 };
cch = GetModuleFileNameA((HINSTANCE)memoryBasicInfo.AllocationBase, cch = GetModuleFileNameA((HINSTANCE)memoryBasicInfo.AllocationBase, szFile, MAX_PATH);
szFile, MAX_PATH);
if (cch && (lstrcmp(szFile, "DBFN")== 0)) if (cch && (lstrcmpA(szFile, "DBFN")== 0))
{ {
char mn[] = { 'M', 'N', 0x00 }; char mn[] = { 'M', 'N', 0x00 };
#ifdef NL_OS_WIN64 #ifdef NL_OS_WIN64
@ -227,28 +226,28 @@ static void displayCallStack (CLog *log)
if (symbolPath.empty()) if (symbolPath.empty())
{ {
CHAR tmpPath[stringSize]; wchar_t tmpPath[stringSize];
symbolPath = "."; symbolPath = ".";
if (GetEnvironmentVariable ("_NT_SYMBOL_PATH", tmpPath, stringSize)) if (GetEnvironmentVariableW (L"_NT_SYMBOL_PATH", tmpPath, stringSize))
{ {
symbolPath += ";"; symbolPath += ";";
symbolPath += tmpPath; symbolPath += wideToUtf8(tmpPath);
} }
if (GetEnvironmentVariable ("_NT_ALTERNATE_SYMBOL_PATH", tmpPath, stringSize)) if (GetEnvironmentVariableW (L"_NT_ALTERNATE_SYMBOL_PATH", tmpPath, stringSize))
{ {
symbolPath += ";"; symbolPath += ";";
symbolPath += tmpPath; symbolPath += wideToUtf8(tmpPath);
} }
if (GetEnvironmentVariable ("SYSTEMROOT", tmpPath, stringSize)) if (GetEnvironmentVariableW (L"SYSTEMROOT", tmpPath, stringSize))
{ {
symbolPath += ";"; symbolPath += ";";
symbolPath += tmpPath; symbolPath += wideToUtf8(tmpPath);
symbolPath += ";"; symbolPath += ";";
symbolPath += tmpPath; symbolPath += wideToUtf8(tmpPath);
symbolPath += "\\system32"; symbolPath += "\\system32";
} }
} }

@ -159,7 +159,7 @@ bool CSharedMutex::createByName( const char *objectName )
#ifdef NL_DEBUG #ifdef NL_DEBUG
nlassert( _Mutex == NULL ); nlassert( _Mutex == NULL );
#endif #endif
_Mutex = (void *) CreateMutex( NULL, FALSE, objectName ); _Mutex = (void *) CreateMutexA( NULL, FALSE, objectName );
//nldebug( "Creating mutex %s: handle %p", objectName, _Mutex ); //nldebug( "Creating mutex %s: handle %p", objectName, _Mutex );
return ( _Mutex != NULL ); return ( _Mutex != NULL );
} }

@ -681,11 +681,11 @@ std::string CPath::getCurrentPath ()
std::string CFileContainer::getCurrentPath () std::string CFileContainer::getCurrentPath ()
{ {
char buffer [1024];
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
return standardizePath(_getcwd(buffer, 1024), false); wchar_t buffer[1024];
return standardizePath(wideToUtf8(_wgetcwd(buffer, 1024)), false);
#else #else
char buffer [1024];
return standardizePath(getcwd(buffer, 1024), false); return standardizePath(getcwd(buffer, 1024), false);
#endif #endif
} }
@ -700,7 +700,7 @@ bool CFileContainer::setCurrentPath (const std::string &path)
int res; int res;
//nldebug("Change current path to '%s' (current path is '%s')", path.c_str(), getCurrentPath().c_str()); //nldebug("Change current path to '%s' (current path is '%s')", path.c_str(), getCurrentPath().c_str());
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
res = _chdir(path.c_str()); res = _wchdir(utf8ToWide(path));
#else #else
res = chdir(path.c_str()); res = chdir(path.c_str());
#endif #endif
@ -756,11 +756,11 @@ std::string CFileContainer::getFullPath (const std::string &path, bool addFinalS
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
# define dirent WIN32_FIND_DATA # define dirent WIN32_FIND_DATAW
# define DIR void # define DIR void
static string sDir; static string sDir;
static WIN32_FIND_DATA findData; static WIN32_FIND_DATAW findData;
static HANDLE hFind; static HANDLE hFind;
DIR *opendir (const char *path) DIR *opendir (const char *path)
@ -792,13 +792,12 @@ dirent *readdir (DIR *dir)
// first visit in this directory : FindFirstFile() // first visit in this directory : FindFirstFile()
if (hFind == NULL) if (hFind == NULL)
{ {
string fullPath = CPath::standardizePath(sDir) + "*"; hFind = FindFirstFileW (utf8ToWide(CPath::standardizePath(sDir) + "*"), &findData);
hFind = FindFirstFileA (fullPath.c_str(), &findData);
} }
// directory already visited : FindNextFile() // directory already visited : FindNextFile()
else else
{ {
if (!FindNextFileA (hFind, &findData)) if (!FindNextFileW (hFind, &findData))
return NULL; return NULL;
} }
@ -845,7 +844,7 @@ string getname (dirent *de)
{ {
nlassert (de != NULL); nlassert (de != NULL);
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
return de->cFileName; return wideToUtf8(de->cFileName);
#else #else
return de->d_name; return de->d_name;
#endif // NL_OS_WINDOWS #endif // NL_OS_WINDOWS
@ -1269,7 +1268,7 @@ void CFileContainer::addSearchBigFile (const string &sBigFilename, bool recurse,
// Open and read the big file header // Open and read the big file header
nlassert(!_MemoryCompressed); nlassert(!_MemoryCompressed);
FILE *Handle = fopen (sBigFilename.c_str(), "rb"); FILE *Handle = nlfopen (sBigFilename, "rb");
if (Handle == NULL) if (Handle == NULL)
{ {
nlwarning ("PATH: CPath::addSearchBigFile(%s, %d, %d): can't open file, skip it", sBigFilename.c_str(), recurse, alternative); nlwarning ("PATH: CPath::addSearchBigFile(%s, %d, %d): can't open file, skip it", sBigFilename.c_str(), recurse, alternative);
@ -1421,7 +1420,7 @@ void CFileContainer::addSearchXmlpackFile (const string &sXmlpackFilename, bool
} }
// Open and read the xmlpack file header // Open and read the xmlpack file header
FILE *Handle = fopen (sXmlpackFilename.c_str(), "rb"); FILE *Handle = nlfopen (sXmlpackFilename, "rb");
if (Handle == NULL) if (Handle == NULL)
{ {
nlwarning ("PATH: CPath::addSearchXmlpackFile(%s, %d, %d): can't open file, skip it", sXmlpackFilename.c_str(), recurse, alternative); nlwarning ("PATH: CPath::addSearchXmlpackFile(%s, %d, %d): can't open file, skip it", sXmlpackFilename.c_str(), recurse, alternative);
@ -1766,14 +1765,14 @@ std::string CFileContainer::getWindowsDirectory()
nlwarning("not a ms windows platform"); nlwarning("not a ms windows platform");
return ""; return "";
#else #else
char winDir[MAX_PATH]; wchar_t winDir[MAX_PATH];
UINT numChar = ::GetWindowsDirectory(winDir, MAX_PATH); UINT numChar = GetWindowsDirectoryW(winDir, MAX_PATH);
if (numChar > MAX_PATH || numChar == 0) if (numChar > MAX_PATH || numChar == 0)
{ {
nlwarning("Couldn't retrieve windows directory"); nlwarning("Couldn't retrieve windows directory");
return ""; return "";
} }
return CPath::standardizePath(winDir); return CPath::standardizePath(wideToUtf8(winDir));
#endif #endif
} }
@ -1789,18 +1788,18 @@ std::string CFileContainer::getApplicationDirectory(const std::string &appName,
if (appPath.empty()) if (appPath.empty())
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
char buffer[MAX_PATH]; wchar_t buffer[MAX_PATH];
#ifdef CSIDL_LOCAL_APPDATA #ifdef CSIDL_LOCAL_APPDATA
if (local) if (local)
{ {
SHGetSpecialFolderPathA(NULL, buffer, CSIDL_LOCAL_APPDATA, TRUE); SHGetSpecialFolderPathW(NULL, buffer, CSIDL_LOCAL_APPDATA, TRUE);
} }
else else
#endif #endif
{ {
SHGetSpecialFolderPathA(NULL, buffer, CSIDL_APPDATA, TRUE); SHGetSpecialFolderPathW(NULL, buffer, CSIDL_APPDATA, TRUE);
} }
appPath = CPath::standardizePath(buffer); appPath = CPath::standardizePath(wideToUtf8(buffer));
#elif defined(NL_OS_MAC) #elif defined(NL_OS_MAC)
appPath = CPath::standardizePath(getenv("HOME")); appPath = CPath::standardizePath(getenv("HOME"));
appPath += "/Library/Application Support/"; appPath += "/Library/Application Support/";
@ -1918,7 +1917,7 @@ string CFile::getPath (const string &filename)
bool CFile::isDirectory (const string &filename) bool CFile::isDirectory (const string &filename)
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
DWORD res = GetFileAttributes(filename.c_str()); DWORD res = GetFileAttributesW(utf8ToWide(filename));
if (res == INVALID_FILE_ATTRIBUTES) if (res == INVALID_FILE_ATTRIBUTES)
{ {
// nlwarning ("PATH: '%s' is not a valid file or directory name", filename.c_str ()); // nlwarning ("PATH: '%s' is not a valid file or directory name", filename.c_str ());
@ -1941,7 +1940,7 @@ bool CFile::isDirectory (const string &filename)
bool CFile::isExists (const string &filename) bool CFile::isExists (const string &filename)
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
return (GetFileAttributes(filename.c_str()) != INVALID_FILE_ATTRIBUTES); return GetFileAttributesW(utf8ToWide(filename)) != INVALID_FILE_ATTRIBUTES;
#else // NL_OS_WINDOWS #else // NL_OS_WINDOWS
struct stat buf; struct stat buf;
return stat (filename.c_str (), &buf) == 0; return stat (filename.c_str (), &buf) == 0;
@ -1950,7 +1949,7 @@ bool CFile::isExists (const string &filename)
bool CFile::createEmptyFile (const std::string& filename) bool CFile::createEmptyFile (const std::string& filename)
{ {
FILE *file = fopen (filename.c_str(), "wb"); FILE *file = nlfopen (filename, "wb");
if (file) if (file)
{ {
@ -1964,7 +1963,14 @@ bool CFile::createEmptyFile (const std::string& filename)
bool CFile::fileExists (const string& filename) bool CFile::fileExists (const string& filename)
{ {
//H_AUTO(FileExists); //H_AUTO(FileExists);
return ! ! fstream( filename.c_str(), ios::in ); #ifdef NL_OS_WINDOWS
DWORD attr = GetFileAttributesW(utf8ToWide(filename));
// attributes are valid and file is not a directory
if (attr == INVALID_FILE_ATTRIBUTES || (attr & FILE_ATTRIBUTE_DIRECTORY)) return false;
return true;
#else
return access(filename.c_str(), R_OK) != -1;
#endif
} }
@ -2013,7 +2019,7 @@ uint32 CFile::getFileSize (const std::string &filename)
{ {
#if defined (NL_OS_WINDOWS) #if defined (NL_OS_WINDOWS)
struct _stat buf; struct _stat buf;
int result = _stat (filename.c_str (), &buf); int result = _wstat (utf8ToWide(filename), &buf);
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)
struct stat buf; struct stat buf;
int result = stat (filename.c_str (), &buf); int result = stat (filename.c_str (), &buf);
@ -2064,7 +2070,7 @@ uint32 CFile::getFileModificationDate(const std::string &filename)
// Use the WIN32 API to read the file times in UTC // Use the WIN32 API to read the file times in UTC
// create a file handle (this does not open the file) // create a file handle (this does not open the file)
HANDLE h = CreateFile(fn.c_str(), 0, 0, NULL, OPEN_EXISTING, 0, 0); HANDLE h = CreateFileW(utf8ToWide(fn), 0, 0, NULL, OPEN_EXISTING, 0, 0);
if (h == INVALID_HANDLE_VALUE) if (h == INVALID_HANDLE_VALUE)
{ {
nlwarning("Can't get modification date on file '%s' : %s", fn.c_str(), NLMISC::formatErrorMessage(NLMISC::getLastError()).c_str()); nlwarning("Can't get modification date on file '%s' : %s", fn.c_str(), NLMISC::formatErrorMessage(NLMISC::getLastError()).c_str());
@ -2134,7 +2140,7 @@ bool CFile::setFileModificationDate(const std::string &filename, uint32 modTime)
// Use the WIN32 API to set the file times in UTC // Use the WIN32 API to set the file times in UTC
// create a file handle (this does not open the file) // create a file handle (this does not open the file)
HANDLE h = CreateFile(fn.c_str(), GENERIC_WRITE|GENERIC_READ, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); HANDLE h = CreateFileW(utf8ToWide(fn), GENERIC_WRITE|GENERIC_READ, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
if (h == INVALID_HANDLE_VALUE) if (h == INVALID_HANDLE_VALUE)
{ {
nlwarning("Can't set modification date on file '%s' (error accessing file) : %s", fn.c_str(), NLMISC::formatErrorMessage(NLMISC::getLastError()).c_str()); nlwarning("Can't set modification date on file '%s' (error accessing file) : %s", fn.c_str(), NLMISC::formatErrorMessage(NLMISC::getLastError()).c_str());
@ -2219,10 +2225,10 @@ uint32 CFile::getFileCreationDate(const std::string &filename)
#if defined (NL_OS_WINDOWS) #if defined (NL_OS_WINDOWS)
struct _stat buf; struct _stat buf;
int result = _stat (fn.c_str (), &buf); int result = _wstat(utf8ToWide(fn), &buf);
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)
struct stat buf; struct stat buf;
int result = stat (fn.c_str (), &buf); int result = stat(fn.c_str (), &buf);
#endif #endif
if (result != 0) return 0; if (result != 0) return 0;
@ -2299,9 +2305,6 @@ static bool CopyMoveFile(const std::string &dest, const std::string &src, bool c
std::string sdest = CPath::standardizePath(dest,false); std::string sdest = CPath::standardizePath(dest,false);
std::string ssrc = CPath::standardizePath(src,false); std::string ssrc = CPath::standardizePath(src,false);
// return copyFile ? CopyFile(dossrc.c_str(), dosdest.c_str(), failIfExists) != FALSE
// : MoveFile(dossrc.c_str(), dosdest.c_str()) != FALSE;
if (progress) progress->progress(0.f); if (progress) progress->progress(0.f);
if(copyFile) if(copyFile)
{ {
@ -2311,13 +2314,13 @@ static bool CopyMoveFile(const std::string &dest, const std::string &src, bool c
{ {
totalSize = CFile::getFileSize(ssrc); totalSize = CFile::getFileSize(ssrc);
} }
FILE *fp1 = fopen(ssrc.c_str(), "rb"); FILE *fp1 = nlfopen(ssrc, "rb");
if (fp1 == NULL) if (fp1 == NULL)
{ {
nlwarning ("PATH: CopyMoveFile error: can't fopen in read mode '%s'", ssrc.c_str()); nlwarning ("PATH: CopyMoveFile error: can't fopen in read mode '%s'", ssrc.c_str());
return false; return false;
} }
FILE *fp2 = fopen(sdest.c_str(), "wb"); FILE *fp2 = nlfopen(sdest, "wb");
if (fp2 == NULL) if (fp2 == NULL)
{ {
nlwarning ("PATH: CopyMoveFile error: can't fopen in read write mode '%s'", sdest.c_str()); nlwarning ("PATH: CopyMoveFile error: can't fopen in read write mode '%s'", sdest.c_str());
@ -2356,7 +2359,7 @@ static bool CopyMoveFile(const std::string &dest, const std::string &src, bool c
else else
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
if (MoveFile(ssrc.c_str(), sdest.c_str()) == 0) if (MoveFileW(utf8ToWide(ssrc), utf8ToWide(sdest)) == 0)
{ {
sint lastError = NLMISC::getLastError(); sint lastError = NLMISC::getLastError();
nlwarning ("PATH: CopyMoveFile error: can't link/move '%s' into '%s', error %u (%s)", nlwarning ("PATH: CopyMoveFile error: can't link/move '%s' into '%s', error %u (%s)",
@ -2390,15 +2393,15 @@ bool CFile::copyFile(const std::string &dest, const std::string &src, bool failI
bool CFile::quickFileCompare(const std::string &fileName0, const std::string &fileName1) bool CFile::quickFileCompare(const std::string &fileName0, const std::string &fileName1)
{ {
// make sure the files both exist // make sure the files both exist
if (!fileExists(fileName0.c_str()) || !fileExists(fileName1.c_str())) if (!fileExists(fileName0) || !fileExists(fileName1))
return false; return false;
// compare time stamps // compare time stamps
if (getFileModificationDate(fileName0.c_str()) != getFileModificationDate(fileName1.c_str())) if (getFileModificationDate(fileName0) != getFileModificationDate(fileName1))
return false; return false;
// compare file sizes // compare file sizes
if (getFileSize(fileName0.c_str()) != getFileSize(fileName1.c_str())) if (getFileSize(fileName0) != getFileSize(fileName1))
return false; return false;
// everything matched so return true // everything matched so return true
@ -2408,14 +2411,14 @@ bool CFile::quickFileCompare(const std::string &fileName0, const std::string &fi
bool CFile::thoroughFileCompare(const std::string &fileName0, const std::string &fileName1,uint32 maxBufSize) bool CFile::thoroughFileCompare(const std::string &fileName0, const std::string &fileName1,uint32 maxBufSize)
{ {
// make sure the files both exist // make sure the files both exist
if (!fileExists(fileName0.c_str()) || !fileExists(fileName1.c_str())) if (!fileExists(fileName0) || !fileExists(fileName1))
return false; return false;
// setup the size variable from file length of first file // setup the size variable from file length of first file
uint32 fileSize=getFileSize(fileName0.c_str()); uint32 fileSize=getFileSize(fileName0);
// compare file sizes // compare file sizes
if (fileSize != getFileSize(fileName1.c_str())) if (fileSize != getFileSize(fileName1))
return false; return false;
// allocate a couple of data buffers for our 2 files // allocate a couple of data buffers for our 2 files
@ -2459,7 +2462,7 @@ bool CFile::moveFile(const std::string &dest, const std::string &src)
bool CFile::createDirectory(const std::string &filename) bool CFile::createDirectory(const std::string &filename)
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
return _mkdir(filename.c_str())==0; return _wmkdir(utf8ToWide(filename))==0;
#else #else
// Set full permissions.... // Set full permissions....
return mkdir(filename.c_str(), 0xFFFF)==0; return mkdir(filename.c_str(), 0xFFFF)==0;
@ -2680,11 +2683,16 @@ bool CPath::isAbsolutePath(const std::string &path)
bool CFile::setRWAccess(const std::string &filename) bool CFile::setRWAccess(const std::string &filename)
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
ucstring ucFile;
ucFile.fromUtf8(filename);
wchar_t *wideFile = (wchar_t*)ucFile.c_str();
// if the file exists and there's no write access // if the file exists and there's no write access
if (_access (filename.c_str(), 00) == 0 && _access (filename.c_str(), 06) == -1) if (_waccess (wideFile, 00) == 0 && _waccess (wideFile, 06) == -1)
{ {
// try to set the read/write access // try to set the read/write access
if (_chmod (filename.c_str(), _S_IREAD | _S_IWRITE) == -1) if (_wchmod (wideFile, _S_IREAD | _S_IWRITE) == -1)
{ {
if (INelContext::getInstance().getAlreadyCreateSharedAmongThreads()) if (INelContext::getInstance().getAlreadyCreateSharedAmongThreads())
{ {
@ -2719,15 +2727,14 @@ bool CFile::setRWAccess(const std::string &filename)
return true; return true;
} }
#ifdef NL_OS_WINDOWS
#define unlink _unlink
#endif
bool CFile::deleteFile(const std::string &filename) bool CFile::deleteFile(const std::string &filename)
{ {
setRWAccess(filename); setRWAccess(filename);
int res = unlink (filename.c_str()); #ifdef NL_OS_WINDOWS
sint res = _wunlink(utf8ToWide(filename));
#else
sint res = unlink(filename.c_str());
#endif
if (res == -1) if (res == -1)
{ {
if (INelContext::getInstance().getAlreadyCreateSharedAmongThreads()) if (INelContext::getInstance().getAlreadyCreateSharedAmongThreads())
@ -2739,14 +2746,14 @@ bool CFile::deleteFile(const std::string &filename)
return true; return true;
} }
#ifdef NL_OS_WINDOWS
#define rmdir _rmdir
#endif
bool CFile::deleteDirectory(const std::string &filename) bool CFile::deleteDirectory(const std::string &filename)
{ {
setRWAccess(filename); setRWAccess(filename);
int res = rmdir (filename.c_str()); #ifdef NL_OS_WINDOWS
sint res = _wrmdir(utf8ToWide(filename));
#else
sint res = rmdir(filename.c_str());
#endif
if (res == -1) if (res == -1)
{ {
nlwarning ("PATH: Can't delete directory '%s': (errno %d) %s", filename.c_str(), errno, strerror(errno)); nlwarning ("PATH: Can't delete directory '%s': (errno %d) %s", filename.c_str(), errno, strerror(errno));

@ -82,9 +82,10 @@ TReportResult report(const std::string &title, const std::string &subject, const
{ {
std::string reportFile = getLogDirectory() + NLMISC::toString("nel_report_%u.log", (uint)time(NULL)); std::string reportFile = getLogDirectory() + NLMISC::toString("nel_report_%u.log", (uint)time(NULL));
reportPath = CFile::findNewFile(reportFile); reportPath = CFile::findNewFile(reportFile);
std::ofstream f;
f.open(reportPath.c_str()); FILE *f = nlfopen(reportPath, "wb"); // write as binary so \n are preserved
if (!f.good())
if (!f)
{ {
#if NL_DEBUG_REPORT #if NL_DEBUG_REPORT
if (INelContext::isContextInitialised()) if (INelContext::isContextInitialised())
@ -94,8 +95,14 @@ TReportResult report(const std::string &title, const std::string &subject, const
} }
else else
{ {
f << body; size_t written = fwrite(body.c_str(), 1, body.length(), f);
f.close();
if (written != body.length())
{
nlwarning("Unable to write %u bytes to %s, only %u written", (uint)body.length(), reportPath.c_str(), (uint)written);
}
fclose(f);
} }
} }

@ -147,7 +147,7 @@ CHashKey getSHA1(const string &filename, bool forcePath)
return CHashKey(); return CHashKey();
} }
//FILE *fp = fopen (filename.c_str(), "rb"); //FILE *fp = nlfopen (filename, "rb");
//if (fp == NULL) return CHashKey(); //if (fp == NULL) return CHashKey();
err = SHA1Reset(&sha); err = SHA1Reset(&sha);

@ -51,7 +51,7 @@ void *CSharedMemory::createSharedMemory( TSharedMemId sharedMemId, uint32 size
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
// Create a file mapping backed by the virtual memory swap file (not a data file) // Create a file mapping backed by the virtual memory swap file (not a data file)
HANDLE hMapFile = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, sharedMemId ); HANDLE hMapFile = CreateFileMappingA( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, sharedMemId );
if ( (hMapFile == NULL) || (GetLastError() == ERROR_ALREADY_EXISTS) ) if ( (hMapFile == NULL) || (GetLastError() == ERROR_ALREADY_EXISTS) )
{ {
nlwarning( "SHDMEM: Cannot create file mapping for smid %s: error %u%s, mapFile %p", sharedMemId, GetLastError(), (GetLastError()==ERROR_ALREADY_EXISTS) ? " (already exists) ": "", hMapFile ); nlwarning( "SHDMEM: Cannot create file mapping for smid %s: error %u%s, mapFile %p", sharedMemId, GetLastError(), (GetLastError()==ERROR_ALREADY_EXISTS) ? " (already exists) ": "", hMapFile );
@ -97,7 +97,7 @@ void *CSharedMemory::accessSharedMemory( TSharedMemId sharedMemId )
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
// Open the existing file mapping by name // Open the existing file mapping by name
HANDLE hMapFile = OpenFileMapping( FILE_MAP_ALL_ACCESS, false, sharedMemId ); HANDLE hMapFile = OpenFileMappingA( FILE_MAP_ALL_ACCESS, false, sharedMemId );
if ( hMapFile == NULL ) if ( hMapFile == NULL )
return NULL; return NULL;
//nldebug( "SHDMEM: Opening smid %s --> mapFile %p", sharedMemId, hMapFile ); //nldebug( "SHDMEM: Opening smid %s --> mapFile %p", sharedMemId, hMapFile );

@ -1743,7 +1743,7 @@ namespace NLMISC
bool CSString::readFromFile(const CSString& fileName) bool CSString::readFromFile(const CSString& fileName)
{ {
FILE* file; FILE* file;
file=fopen(fileName.c_str(),"rb"); file = nlfopen(fileName, "rb");
if (file==NULL) if (file==NULL)
{ {
clear(); clear();
@ -1766,7 +1766,7 @@ namespace NLMISC
bool CSString::writeToFile(const CSString& fileName) const bool CSString::writeToFile(const CSString& fileName) const
{ {
FILE* file; FILE* file;
file=fopen(fileName.c_str(),"wb"); file = nlfopen(fileName, "wb");
if (file==NULL) if (file==NULL)
{ {
nlwarning("Failed to open file for writing: %s",fileName.c_str()); nlwarning("Failed to open file for writing: %s",fileName.c_str());

@ -638,7 +638,7 @@ string CSystemInfo::getOS()
else // Test for specific product on Windows NT 4.0 SP5 and earlier else // Test for specific product on Windows NT 4.0 SP5 and earlier
{ {
HKEY hKey; HKEY hKey;
TCHAR szProductType[BUFSIZE]; char szProductType[BUFSIZE];
DWORD dwBufLen=BUFSIZE; DWORD dwBufLen=BUFSIZE;
LONG lRet; LONG lRet;
@ -652,18 +652,18 @@ string CSystemInfo::getOS()
RegCloseKey( hKey ); RegCloseKey( hKey );
if ( lstrcmpi( _T("WINNT"), szProductType) == 0 ) if ( lstrcmpiA( "WINNT", szProductType) == 0 )
OSString += " Workstation"; OSString += " Workstation";
if ( lstrcmpi( _T("LANMANNT"), szProductType) == 0 ) if ( lstrcmpiA( "LANMANNT", szProductType) == 0 )
OSString += " Server"; OSString += " Server";
if ( lstrcmpi( _T("SERVERNT"), szProductType) == 0 ) if ( lstrcmpiA( "SERVERNT", szProductType) == 0 )
OSString += " Advanced Server"; OSString += " Advanced Server";
} }
} }
std::string servicePack; std::string servicePack;
if( osvi.dwMajorVersion == 4 && lstrcmpi( osvi.szCSDVersion, _T("Service Pack 6") ) == 0 ) if (osvi.dwMajorVersion == 4 && lstrcmpiA(osvi.szCSDVersion, "Service Pack 6") == 0 )
{ {
HKEY hKey; HKEY hKey;
LONG lRet; LONG lRet;
@ -768,7 +768,7 @@ string CSystemInfo::getProc ()
{ {
// get processor name // get processor name
valueSize = 1024; valueSize = 1024;
result = ::RegQueryValueEx (hKey, _T("ProcessorNameString"), NULL, NULL, (LPBYTE)value, &valueSize); result = ::RegQueryValueExA (hKey, "ProcessorNameString", NULL, NULL, (LPBYTE)value, &valueSize);
if (result == ERROR_SUCCESS) if (result == ERROR_SUCCESS)
ProcString = value; ProcString = value;
else else
@ -778,7 +778,7 @@ string CSystemInfo::getProc ()
// get processor identifier // get processor identifier
valueSize = 1024; valueSize = 1024;
result = ::RegQueryValueEx (hKey, _T("Identifier"), NULL, NULL, (LPBYTE)value, &valueSize); result = ::RegQueryValueExA (hKey, "Identifier", NULL, NULL, (LPBYTE)value, &valueSize);
if (result == ERROR_SUCCESS) if (result == ERROR_SUCCESS)
ProcString += value; ProcString += value;
else else
@ -788,7 +788,7 @@ string CSystemInfo::getProc ()
// get processor vendor // get processor vendor
valueSize = 1024; valueSize = 1024;
result = ::RegQueryValueEx (hKey, _T("VendorIdentifier"), NULL, NULL, (LPBYTE)value, &valueSize); result = ::RegQueryValueExA (hKey, "VendorIdentifier", NULL, NULL, (LPBYTE)value, &valueSize);
if (result == ERROR_SUCCESS) if (result == ERROR_SUCCESS)
ProcString += value; ProcString += value;
else else
@ -797,7 +797,7 @@ string CSystemInfo::getProc ()
ProcString += " / "; ProcString += " / ";
// get processor frequency // get processor frequency
result = ::RegQueryValueEx (hKey, _T("~MHz"), NULL, NULL, (LPBYTE)value, &valueSize); result = ::RegQueryValueExA (hKey, "~MHz", NULL, NULL, (LPBYTE)value, &valueSize);
if (result == ERROR_SUCCESS) if (result == ERROR_SUCCESS)
{ {
uint32 freq = *(int *)value; uint32 freq = *(int *)value;
@ -1062,7 +1062,7 @@ uint64 CSystemInfo::availableHDSpace (const string &filename)
return (uint64)(stfs.f_bavail * stst.st_blksize); return (uint64)(stfs.f_bavail * stst.st_blksize);
#else #else
ULARGE_INTEGER freeSpace = {0}; ULARGE_INTEGER freeSpace = {0};
BOOL bRes = ::GetDiskFreeSpaceExA(path.c_str(), &freeSpace, NULL, NULL); BOOL bRes = ::GetDiskFreeSpaceExW(utf8ToWide(path), &freeSpace, NULL, NULL);
if (!bRes) return 0; if (!bRes) return 0;
return (uint64)freeSpace.QuadPart; return (uint64)freeSpace.QuadPart;
@ -1387,12 +1387,12 @@ bool CSystemInfo::getVideoInfo (std::string &deviceName, uint64 &driverVersion)
} }
// Version dll link // Version dll link
HMODULE hmVersion = LoadLibrary (_T("version")); HMODULE hmVersion = LoadLibraryA ("version.dll");
if (hmVersion) if (hmVersion)
{ {
BOOL (WINAPI* _GetFileVersionInfo)(LPTSTR, DWORD, DWORD, LPVOID) = NULL; BOOL (WINAPI* _GetFileVersionInfo)(LPSTR, DWORD, DWORD, LPVOID) = NULL;
DWORD (WINAPI* _GetFileVersionInfoSize)(LPTSTR, LPDWORD) = NULL; DWORD (WINAPI* _GetFileVersionInfoSize)(LPSTR, LPDWORD) = NULL;
BOOL (WINAPI* _VerQueryValue)(const LPVOID, LPTSTR, LPVOID*, PUINT) = NULL; BOOL (WINAPI* _VerQueryValue)(const LPVOID, LPSTR, LPVOID*, PUINT) = NULL;
*(FARPROC*)&_GetFileVersionInfo = GetProcAddress(hmVersion, "GetFileVersionInfoA"); *(FARPROC*)&_GetFileVersionInfo = GetProcAddress(hmVersion, "GetFileVersionInfoA");
*(FARPROC*)&_GetFileVersionInfoSize = GetProcAddress(hmVersion, "GetFileVersionInfoSizeA"); *(FARPROC*)&_GetFileVersionInfoSize = GetProcAddress(hmVersion, "GetFileVersionInfoSizeA");
*(FARPROC*)&_VerQueryValue = GetProcAddress(hmVersion, "VerQueryValueA"); *(FARPROC*)&_VerQueryValue = GetProcAddress(hmVersion, "VerQueryValueA");

@ -231,11 +231,11 @@ bool CSystemUtils::supportUnicode()
{ {
init = true; init = true;
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
OSVERSIONINFO osvi; OSVERSIONINFOA osvi;
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
// get Windows version // get Windows version
if (GetVersionEx(&osvi)) if (GetVersionExA(&osvi))
{ {
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
{ {
@ -273,14 +273,14 @@ bool CSystemUtils::isScreensaverEnabled()
// SystemParametersInfoA(SPI_GETSCREENSAVEACTIVE, 0, &bRetValue, 0); // SystemParametersInfoA(SPI_GETSCREENSAVEACTIVE, 0, &bRetValue, 0);
// res = (bRetValue == TRUE); // res = (bRetValue == TRUE);
HKEY hKeyScreenSaver = NULL; HKEY hKeyScreenSaver = NULL;
LSTATUS lReturn = RegOpenKeyExA(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 0, KEY_QUERY_VALUE, &hKeyScreenSaver); LSTATUS lReturn = RegOpenKeyExA(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_QUERY_VALUE, &hKeyScreenSaver);
if (lReturn == ERROR_SUCCESS) if (lReturn == ERROR_SUCCESS)
{ {
DWORD dwType = 0L; DWORD dwType = 0L;
DWORD dwSize = KeyMaxLength; DWORD dwSize = KeyMaxLength;
unsigned char Buffer[KeyMaxLength] = {0}; unsigned char Buffer[KeyMaxLength] = {0};
lReturn = RegQueryValueExA(hKeyScreenSaver, TEXT("SCRNSAVE.EXE"), NULL, &dwType, NULL, &dwSize); lReturn = RegQueryValueExA(hKeyScreenSaver, "SCRNSAVE.EXE", NULL, &dwType, NULL, &dwSize);
// if SCRNSAVE.EXE is present, check also if it's empty // if SCRNSAVE.EXE is present, check also if it's empty
if (lReturn == ERROR_SUCCESS) if (lReturn == ERROR_SUCCESS)
res = (Buffer[0] != '\0'); res = (Buffer[0] != '\0');
@ -315,20 +315,21 @@ string CSystemUtils::getRegKey(const string &Entry)
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
HKEY hkey; HKEY hkey;
if(RegOpenKeyEx(HKEY_CURRENT_USER, RootKey.c_str(), 0, KEY_READ, &hkey) == ERROR_SUCCESS) if (RegOpenKeyExW(HKEY_CURRENT_USER, utf8ToWide(RootKey), 0, KEY_READ, &hkey) == ERROR_SUCCESS)
{ {
DWORD dwType = 0L; DWORD dwType = 0L;
DWORD dwSize = KeyMaxLength; DWORD dwSize = KeyMaxLength;
unsigned char Buffer[KeyMaxLength]; wchar_t Buffer[KeyMaxLength];
if(RegQueryValueEx(hkey, Entry.c_str(), NULL, &dwType, Buffer, &dwSize) != ERROR_SUCCESS) if (RegQueryValueExW(hkey, utf8ToWide(Entry), NULL, &dwType, (LPBYTE)Buffer, &dwSize) != ERROR_SUCCESS)
{ {
nlwarning("Can't get the reg key '%s'", Entry.c_str()); nlwarning("Can't get the reg key '%s'", Entry.c_str());
} }
else else
{ {
ret = (char*)Buffer; ret = wideToUtf8(Buffer);
} }
RegCloseKey(hkey); RegCloseKey(hkey);
} }
else else
@ -346,10 +347,14 @@ bool CSystemUtils::setRegKey(const string &ValueName, const string &Value)
HKEY hkey; HKEY hkey;
DWORD dwDisp; DWORD dwDisp;
char nstr[] = { 0x00 }; if (RegCreateKeyExW(HKEY_CURRENT_USER, utf8ToWide(RootKey), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwDisp) == ERROR_SUCCESS)
if (RegCreateKeyExA(HKEY_CURRENT_USER, RootKey.c_str(), 0, nstr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwDisp) == ERROR_SUCCESS)
{ {
if (RegSetValueExA(hkey, ValueName.c_str(), 0L, REG_SZ, (const BYTE *)Value.c_str(), (DWORD)(Value.size())+1) == ERROR_SUCCESS) ucstring utf16Value = ucstring::makeFromUtf8(Value);
// we must use the real Unicode string size in bytes
DWORD size = (utf16Value.length() + 1) * 2;
if (RegSetValueExW(hkey, utf8ToWide(ValueName), 0L, REG_SZ, (const BYTE *)utf16Value.c_str(), size) == ERROR_SUCCESS)
res = true; res = true;
RegCloseKey(hkey); RegCloseKey(hkey);
} }
@ -453,7 +458,7 @@ static void EnumerateUsingDXGI(IDXGIFactory *pDXGIFactory)
{ {
SAdapter adapter; SAdapter adapter;
adapter.id = index; adapter.id = index;
adapter.name = ucstring((ucchar*)desc.Description).toUtf8(); adapter.name = wideToUtf8(desc.Description);
adapter.memory = desc.DedicatedVideoMemory / 1024; adapter.memory = desc.DedicatedVideoMemory / 1024;
adapter.found = true; adapter.found = true;

@ -32,12 +32,12 @@ namespace NLMISC
void CWin32Util::localizeWindow(HWND wnd) void CWin32Util::localizeWindow(HWND wnd)
{ {
if (!wnd) return; if (!wnd) return;
int textLength = GetWindowTextLength(wnd); sint textLength = GetWindowTextLengthW(wnd);
if (textLength > 0) if (textLength > 0)
{ {
std::vector<char> str(textLength + 1); wchar_t str[1024];
GetWindowText(wnd, &str[0], textLength + 1); GetWindowTextW(wnd, str, 1024);
std::string winText(str.begin(), str.end() - 1); std::string winText = wideToUtf8(str);
if (CI18N::hasTranslation(winText)) if (CI18N::hasTranslation(winText))
{ {
SetWindowTextW(wnd, (const WCHAR *) CI18N::get(winText).c_str()); SetWindowTextW(wnd, (const WCHAR *) CI18N::get(winText).c_str());

@ -40,7 +40,7 @@ using namespace std;
namespace NLMISC { namespace NLMISC {
static CHARFORMAT2 CharFormat; static CHARFORMAT2A CharFormat;
CWinDisplayer::CWinDisplayer(const char *displayerName) : CWindowDisplayer(displayerName), Exit(false) CWinDisplayer::CWinDisplayer(const char *displayerName) : CWindowDisplayer(displayerName), Exit(false)
{ {
@ -149,10 +149,9 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
CWinDisplayer *cwd=(CWinDisplayer *)GetWindowLongPtr (hWnd, GWLP_USERDATA); CWinDisplayer *cwd=(CWinDisplayer *)GetWindowLongPtr (hWnd, GWLP_USERDATA);
// get the text as unicode string // get the text as unicode string
GetWindowTextW(cwd->_HInputEdit, wText, 20000); GetWindowTextW(cwd->_HInputEdit, wText, 20000);
ucstring ucs((ucchar*)wText);
// and convert it to UTF-8 encoding. // and convert it to UTF-8 encoding.
TextSend = ucs.toUtf8(); TextSend = wideToUtf8(wText);
SendMessage (cwd->_HInputEdit, WM_SETTEXT, (WPARAM)0, (LPARAM)""); SendMessageA (cwd->_HInputEdit, WM_SETTEXT, (WPARAM)0, (LPARAM)"");
const char *pos2 = TextSend.c_str(); const char *pos2 = TextSend.c_str();
string str; string str;
while (*pos2 != '\0') while (*pos2 != '\0')
@ -193,14 +192,13 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
// get the text as unicode string // get the text as unicode string
GetWindowTextW(cwd->_HInputEdit, wText, 20000); GetWindowTextW(cwd->_HInputEdit, wText, 20000);
ucstring ucs((ucchar*)wText);
// and convert it to UTF-8 encoding // and convert it to UTF-8 encoding
string str = ucs.toUtf8(); string str = wideToUtf8(wText);
nlassert (cwd->Log != NULL); nlassert (cwd->Log != NULL);
ICommand::expand (str, *cwd->Log); ICommand::expand (str, *cwd->Log);
SendMessage (cwd->_HInputEdit, WM_SETTEXT, (WPARAM)0, (LPARAM)str.c_str()); SendMessageW (cwd->_HInputEdit, WM_SETTEXT, (WPARAM)0, (LPARAM)wText);
SendMessage (cwd->_HInputEdit, EM_SETSEL, str.size(), str.size()); SendMessageA (cwd->_HInputEdit, EM_SETSEL, wcslen(wText), wcslen(wText));
return 1; return 1;
} }
@ -209,7 +207,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
if (pmf->wParam == VK_UP) if (pmf->wParam == VK_UP)
{ {
CWinDisplayer *cwd=(CWinDisplayer *)GetWindowLongPtrW (hWnd, GWLP_USERDATA); CWinDisplayer *cwd=(CWinDisplayer *)GetWindowLongPtrA (hWnd, GWLP_USERDATA);
if (cwd->_PosInHistory > 0) if (cwd->_PosInHistory > 0)
cwd->_PosInHistory--; cwd->_PosInHistory--;
@ -221,7 +219,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
ucs.fromUtf8(cwd->_History[cwd->_PosInHistory]); ucs.fromUtf8(cwd->_History[cwd->_PosInHistory]);
// set the text as unicode string // set the text as unicode string
SetWindowTextW(cwd->_HInputEdit, (LPCWSTR)ucs.c_str()); SetWindowTextW(cwd->_HInputEdit, (LPCWSTR)ucs.c_str());
SendMessage (cwd->_HInputEdit, EM_SETSEL, (WPARAM)ucs.size(), (LPARAM)ucs.size()); SendMessageA (cwd->_HInputEdit, EM_SETSEL, (WPARAM)ucs.size(), (LPARAM)ucs.size());
} }
} }
else if (pmf->wParam == VK_DOWN) else if (pmf->wParam == VK_DOWN)
@ -238,7 +236,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
ucs.fromUtf8(cwd->_History[cwd->_PosInHistory]); ucs.fromUtf8(cwd->_History[cwd->_PosInHistory]);
// set the text as unicode string // set the text as unicode string
SetWindowTextW(cwd->_HInputEdit, (LPCWSTR)ucs.c_str()); SetWindowTextW(cwd->_HInputEdit, (LPCWSTR)ucs.c_str());
SendMessage (cwd->_HInputEdit, EM_SETSEL, (WPARAM)ucs.size(), (LPARAM)ucs.size()); SendMessageA (cwd->_HInputEdit, EM_SETSEL, (WPARAM)ucs.size(), (LPARAM)ucs.size());
} }
} }
} }
@ -262,13 +260,13 @@ void CWinDisplayer::updateLabels ()
// create a button for command and label for variables // create a button for command and label for variables
if (access.value()[i].Value[0] == '@') if (access.value()[i].Value[0] == '@')
{ {
access.value()[i].Hwnd = CreateWindowW (L"BUTTON", L"", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 0, 0, 0, 0, _HWnd, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(_HWnd, GWLP_HINSTANCE), NULL); access.value()[i].Hwnd = CreateWindowA ("BUTTON", "", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 0, 0, 0, 0, _HWnd, (HMENU) NULL, (HINSTANCE) GetWindowLongPtrA(_HWnd, GWLP_HINSTANCE), NULL);
} }
else else
{ {
access.value()[i].Hwnd = CreateWindowW (L"STATIC", L"", WS_CHILD | WS_VISIBLE | SS_SIMPLE, 0, 0, 0, 0, _HWnd, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(_HWnd, GWLP_HINSTANCE), NULL); access.value()[i].Hwnd = CreateWindowA ("STATIC", "", WS_CHILD | WS_VISIBLE | SS_SIMPLE, 0, 0, 0, 0, _HWnd, (HMENU) NULL, (HINSTANCE) GetWindowLongPtrA(_HWnd, GWLP_HINSTANCE), NULL);
} }
SendMessage ((HWND)access.value()[i].Hwnd, WM_SETFONT, (WPARAM)_HFont, TRUE); SendMessageA ((HWND)access.value()[i].Hwnd, WM_SETFONT, (WPARAM)_HFont, TRUE);
needResize = true; needResize = true;
} }
@ -290,7 +288,7 @@ void CWinDisplayer::updateLabels ()
} }
} }
SendMessage ((HWND)access.value()[i].Hwnd, WM_SETTEXT, 0, (LPARAM) n.c_str()); SendMessageW ((HWND)access.value()[i].Hwnd, WM_SETTEXT, 0, (LPARAM) utf8ToWide(n));
access.value()[i].NeedUpdate = false; access.value()[i].NeedUpdate = false;
} }
} }
@ -427,14 +425,14 @@ void CWinDisplayer::open (string titleBar, bool iconified, sint x, sint y, sint
dwStyle |= WS_HSCROLL; dwStyle |= WS_HSCROLL;
_HEdit = CreateWindowExW(WS_EX_OVERLAPPEDWINDOW, RICHEDIT_CLASSW, L"", dwStyle, 0, _ToolBarHeight, w, h-_ToolBarHeight-_InputEditHeight, _HWnd, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(_HWnd, GWLP_HINSTANCE), NULL); _HEdit = CreateWindowExW(WS_EX_OVERLAPPEDWINDOW, RICHEDIT_CLASSW, L"", dwStyle, 0, _ToolBarHeight, w, h-_ToolBarHeight-_InputEditHeight, _HWnd, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(_HWnd, GWLP_HINSTANCE), NULL);
SendMessage (_HEdit, WM_SETFONT, (WPARAM)_HFont, TRUE); SendMessageA (_HEdit, WM_SETFONT, (WPARAM)_HFont, TRUE);
// set the edit text limit to lot of :) // set the edit text limit to lot of :)
SendMessage (_HEdit, EM_LIMITTEXT, -1, 0); SendMessageA (_HEdit, EM_LIMITTEXT, -1, 0);
CharFormat.cbSize = sizeof(CharFormat); CharFormat.cbSize = sizeof(CharFormat);
CharFormat.dwMask = CFM_COLOR; CharFormat.dwMask = CFM_COLOR;
SendMessage(_HEdit,EM_GETCHARFORMAT,(WPARAM)0,(LPARAM)&CharFormat); SendMessageA(_HEdit,EM_GETCHARFORMAT,(WPARAM)0,(LPARAM)&CharFormat);
CharFormat.dwEffects &= ~CFE_AUTOCOLOR; CharFormat.dwEffects &= ~CFE_AUTOCOLOR;
// create the input edit control // create the input edit control
@ -445,7 +443,7 @@ void CWinDisplayer::open (string titleBar, bool iconified, sint x, sint y, sint
LRESULT dwEvent = SendMessageW(_HInputEdit, EM_GETEVENTMASK, (WPARAM)0, (LPARAM)0); LRESULT dwEvent = SendMessageW(_HInputEdit, EM_GETEVENTMASK, (WPARAM)0, (LPARAM)0);
dwEvent |= ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE; dwEvent |= ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE;
SendMessage(_HInputEdit, EM_SETEVENTMASK, (WPARAM)0, (LPARAM)dwEvent); SendMessageA(_HInputEdit, EM_SETEVENTMASK, (WPARAM)0, (LPARAM)dwEvent);
// resize the window // resize the window
RECT rc; RECT rc;
@ -477,8 +475,8 @@ void CWinDisplayer::clear ()
bool focus = (GetFocus() == _HEdit); bool focus = (GetFocus() == _HEdit);
if (focus) if (focus)
{ {
SendMessage(_HEdit,EM_SETOPTIONS,ECOOP_AND,(LPARAM)~ECO_AUTOVSCROLL); SendMessageA(_HEdit,EM_SETOPTIONS,ECOOP_AND,(LPARAM)~ECO_AUTOVSCROLL);
SendMessage(_HEdit,EM_SETOPTIONS,ECOOP_AND,(LPARAM)~ECO_AUTOHSCROLL); SendMessageA(_HEdit,EM_SETOPTIONS,ECOOP_AND,(LPARAM)~ECO_AUTOHSCROLL);
} }
// get number of line // get number of line
@ -534,13 +532,13 @@ void CWinDisplayer::display_main ()
bool focus = (GetFocus() == _HEdit); bool focus = (GetFocus() == _HEdit);
if (focus) if (focus)
{ {
SendMessage(_HEdit,EM_SETOPTIONS,ECOOP_AND,(LPARAM)~ECO_AUTOVSCROLL); SendMessageA(_HEdit,EM_SETOPTIONS,ECOOP_AND,(LPARAM)~ECO_AUTOVSCROLL);
SendMessage(_HEdit,EM_SETOPTIONS,ECOOP_AND,(LPARAM)~ECO_AUTOHSCROLL); SendMessageA(_HEdit,EM_SETOPTIONS,ECOOP_AND,(LPARAM)~ECO_AUTOHSCROLL);
} }
// store old selection // store old selection
DWORD startSel, endSel; DWORD startSel, endSel;
SendMessage (_HEdit, EM_GETSEL, (WPARAM)&startSel, (LPARAM)&endSel); SendMessageA (_HEdit, EM_GETSEL, (WPARAM)&startSel, (LPARAM)&endSel);
// find how many lines we have to remove in the current output to add new lines // find how many lines we have to remove in the current output to add new lines
@ -554,7 +552,7 @@ void CWinDisplayer::display_main ()
if (nblineremove == _HistorySize) if (nblineremove == _HistorySize)
{ {
SendMessage (_HEdit, WM_SETTEXT, 0, (LPARAM) ""); SendMessageA (_HEdit, WM_SETTEXT, 0, (LPARAM) "");
startSel = endSel = -1; startSel = endSel = -1;
} }
else else
@ -594,31 +592,31 @@ void CWinDisplayer::display_main ()
str += ucstring::makeFromUtf8((*it).second); str += ucstring::makeFromUtf8((*it).second);
} }
SendMessage (_HEdit, EM_SETSEL, -1, -1); SendMessageA(_HEdit, EM_SETSEL, -1, -1);
if ((col>>24) == 0) if ((col>>24) == 0)
{ {
// there s a specific color // there s a specific color
CharFormat.crTextColor = RGB ((col>>16)&0xFF, (col>>8)&0xFF, col&0xFF); CharFormat.crTextColor = RGB ((col>>16)&0xFF, (col>>8)&0xFF, col&0xFF);
SendMessage((HWND) _HEdit, EM_SETCHARFORMAT, (WPARAM) SCF_SELECTION, (LPARAM) &CharFormat); SendMessageA(_HEdit, EM_SETCHARFORMAT, (WPARAM) SCF_SELECTION, (LPARAM) &CharFormat);
} }
// add the string to the edit control // add the string to the edit control
SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LPARAM) str.c_str()); SendMessageW(_HEdit, EM_REPLACESEL, FALSE, (LPARAM) str.c_str());
} }
// restore old selection // restore old selection
SendMessage (_HEdit, EM_SETSEL, startSel, endSel); SendMessageA(_HEdit, EM_SETSEL, startSel, endSel);
SendMessage(_HEdit,EM_SETMODIFY,(WPARAM)TRUE,(LPARAM)0); SendMessageA(_HEdit,EM_SETMODIFY,(WPARAM)TRUE,(LPARAM)0);
if (bottom) if (bottom)
SendMessage(_HEdit,WM_VSCROLL,(WPARAM)SB_BOTTOM,(LPARAM)0L); SendMessageA(_HEdit,WM_VSCROLL,(WPARAM)SB_BOTTOM,(LPARAM)0L);
if (focus) if (focus)
{ {
SendMessage(_HEdit,EM_SETOPTIONS,ECOOP_OR,(LPARAM)ECO_AUTOVSCROLL); SendMessageA(_HEdit,EM_SETOPTIONS,ECOOP_OR,(LPARAM)ECO_AUTOVSCROLL);
SendMessage(_HEdit,EM_SETOPTIONS,ECOOP_OR,(LPARAM)ECO_AUTOHSCROLL); SendMessageA(_HEdit,EM_SETOPTIONS,ECOOP_OR,(LPARAM)ECO_AUTOHSCROLL);
} }
} }

@ -277,10 +277,10 @@ uint64 CWinThread::getCPUMask()
std::string CWinThread::getUserName() std::string CWinThread::getUserName()
{ {
char userName[512]; wchar_t userName[512];
DWORD size = 512; DWORD size = 512;
GetUserName (userName, &size); GetUserNameW (userName, &size);
return (const char*)userName; return wideToUtf8(userName);
} }
// **** Process // **** Process
@ -333,10 +333,10 @@ class CPSAPILib
{ {
public: public:
typedef BOOL (WINAPI *EnumProcessesFunPtr)(DWORD *lpidProcess, DWORD cb, DWORD *cbNeeded); typedef BOOL (WINAPI *EnumProcessesFunPtr)(DWORD *lpidProcess, DWORD cb, DWORD *cbNeeded);
typedef DWORD (WINAPI *GetModuleFileNameExAFunPtr)(HANDLE hProcess, HMODULE hModule, LPTSTR lpFilename, DWORD nSize); typedef DWORD (WINAPI *GetModuleFileNameExWFunPtr)(HANDLE hProcess, HMODULE hModule, LPWSTR lpFilename, DWORD nSize);
typedef BOOL (WINAPI *EnumProcessModulesFunPtr)(HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded); typedef BOOL (WINAPI *EnumProcessModulesFunPtr)(HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded);
EnumProcessesFunPtr EnumProcesses; EnumProcessesFunPtr EnumProcesses;
GetModuleFileNameExAFunPtr GetModuleFileNameExA; GetModuleFileNameExWFunPtr GetModuleFileNameExW;
EnumProcessModulesFunPtr EnumProcessModules; EnumProcessModulesFunPtr EnumProcessModules;
public: public:
CPSAPILib(); CPSAPILib();
@ -353,7 +353,7 @@ CPSAPILib::CPSAPILib()
_LoadFailed = false; _LoadFailed = false;
_PSAPILibHandle = NULL; _PSAPILibHandle = NULL;
EnumProcesses = NULL; EnumProcesses = NULL;
GetModuleFileNameExA = NULL; GetModuleFileNameExW = NULL;
EnumProcessModules = NULL; EnumProcessModules = NULL;
} }
@ -373,7 +373,7 @@ bool CPSAPILib::init()
if (_LoadFailed) return false; if (_LoadFailed) return false;
if (!_PSAPILibHandle) if (!_PSAPILibHandle)
{ {
_PSAPILibHandle = LoadLibrary("psapi.dll"); _PSAPILibHandle = LoadLibraryA("psapi.dll");
if (!_PSAPILibHandle) if (!_PSAPILibHandle)
{ {
nlwarning("couldn't load psapi.dll, possibly not supported by os"); nlwarning("couldn't load psapi.dll, possibly not supported by os");
@ -381,10 +381,10 @@ bool CPSAPILib::init()
return false; return false;
} }
EnumProcesses = (EnumProcessesFunPtr) GetProcAddress(_PSAPILibHandle, "EnumProcesses"); EnumProcesses = (EnumProcessesFunPtr) GetProcAddress(_PSAPILibHandle, "EnumProcesses");
GetModuleFileNameExA = (GetModuleFileNameExAFunPtr) GetProcAddress(_PSAPILibHandle, "GetModuleFileNameExA"); GetModuleFileNameExW = (GetModuleFileNameExWFunPtr) GetProcAddress(_PSAPILibHandle, "GetModuleFileNameExW");
EnumProcessModules = (EnumProcessModulesFunPtr) GetProcAddress(_PSAPILibHandle, "EnumProcessModules"); EnumProcessModules = (EnumProcessModulesFunPtr) GetProcAddress(_PSAPILibHandle, "EnumProcessModules");
if (!EnumProcesses || if (!EnumProcesses ||
!GetModuleFileNameExA || !GetModuleFileNameExW ||
!EnumProcessModules !EnumProcessModules
) )
{ {
@ -453,12 +453,12 @@ bool CWinProcess::enumProcessModules(uint32 processId, std::vector<std::string>
} }
moduleNames.clear(); moduleNames.clear();
std::vector<std::string> resultModuleNames; std::vector<std::string> resultModuleNames;
char moduleName[MAX_PATH + 1]; wchar_t moduleName[MAX_PATH + 1];
for (uint m = 0; m < prcModules.size(); ++m) for (uint m = 0; m < prcModules.size(); ++m)
{ {
if (PSAPILib.GetModuleFileNameExA(hProcess, prcModules[m], moduleName, MAX_PATH)) if (PSAPILib.GetModuleFileNameExW(hProcess, prcModules[m], moduleName, MAX_PATH))
{ {
moduleNames.push_back(moduleName); moduleNames.push_back(wideToUtf8(moduleName));
} }
} }
CloseHandle(hProcess); CloseHandle(hProcess);
@ -563,7 +563,7 @@ public:
PROCESS_INFORMATION processInfo; PROCESS_INFORMATION processInfo;
STARTUPINFO startupInfo = {0}; STARTUPINFO startupInfo = {0};
startupInfo.cb = sizeof(STARTUPINFO); startupInfo.cb = sizeof(STARTUPINFO);
if (CreateProcess(programName.c_str(), const_cast<LPTSTR>(arguments.c_str()), NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &processInfo)) if (CreateProcessW(programName.c_str(), const_cast<LPTSTR>(arguments.c_str()), NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &processInfo))
{ {
WatchTask = new CProcessWatchTask(processInfo.hProcess); WatchTask = new CProcessWatchTask(processInfo.hProcess);
WatchThread = IThread::create(WatchTask); WatchThread = IThread::create(WatchTask);

@ -93,7 +93,7 @@ namespace NLMISC
TXMLPackInfo &packInfo = _XMLPacks[packId]; TXMLPackInfo &packInfo = _XMLPacks[packId];
// open the xml pack for later access // open the xml pack for later access
// packInfo.FileHandler = fopen(xmlPackFileName.c_str(), "rb"); // packInfo.FileHandler = nlfopen(xmlPackFileName, "rb");
// open the xml pack for parsing // open the xml pack for parsing
CIFile packFile; CIFile packFile;
@ -182,7 +182,7 @@ namespace NLMISC
fileInfo.FileName = CStringMapper::map(subFileName); fileInfo.FileName = CStringMapper::map(subFileName);
fileInfo.FileOffset = (uint32)(beginOfFile - buffer.begin()); fileInfo.FileOffset = (uint32)(beginOfFile - buffer.begin());
fileInfo.FileSize = (uint32)(endOfFile - beginOfFile); fileInfo.FileSize = (uint32)(endOfFile - beginOfFile);
// fileInfo.FileHandler = fopen(xmlPackFileName.c_str(), "rb"); // fileInfo.FileHandler = nlfopen(xmlPackFileName, "rb");
packInfo._XMLFiles.insert(make_pair(fileInfo.FileName, fileInfo)); packInfo._XMLFiles.insert(make_pair(fileInfo.FileName, fileInfo));
// advance to next line // advance to next line
@ -264,7 +264,7 @@ namespace NLMISC
rFileOffset = fileInfo.FileOffset; rFileOffset = fileInfo.FileOffset;
rCacheFileOnOpen = false; rCacheFileOnOpen = false;
rAlwaysOpened = false; rAlwaysOpened = false;
FILE *fp = fopen(parts[0].c_str(), "rb"); FILE *fp = nlfopen(parts[0], "rb");
return fp; return fp;
} }

@ -271,7 +271,7 @@ bool sendEmail (const string &smtpServer, const string &from, const string &to,
char dst_buf[dst_buf_size + 1]; char dst_buf[dst_buf_size + 1];
size_t size; size_t size;
FILE *src_stream = fopen (attachedFile.c_str(), "rb"); FILE *src_stream = nlfopen (attachedFile, "rb");
if (src_stream == NULL) if (src_stream == NULL)
{ {
nlwarning ("EMAIL: Can't attach file '%s' to the email because the file can't be open", attachedFile.c_str()); nlwarning ("EMAIL: Can't attach file '%s' to the email because the file can't be open", attachedFile.c_str());
@ -299,7 +299,7 @@ bool sendEmail (const string &smtpServer, const string &from, const string &to,
} }
// debug, display what we send into a file // debug, display what we send into a file
// { FILE *fp = fopen (CFile::findNewFile(getLogDirectory() + "mail.txt").c_str(), "wb"); // { FILE *fp = nlfopen (CFile::findNewFile(getLogDirectory() + "mail.txt"), "wb");
// fwrite (formatedBody.c_str(), 1, formatedBody.size(), fp); // fwrite (formatedBody.c_str(), 1, formatedBody.size(), fp);
// fclose (fp); } // fclose (fp); }

@ -575,7 +575,7 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName,
if (haveLongArg("writepid")) if (haveLongArg("writepid"))
{ {
// use legacy C primitives // use legacy C primitives
FILE *fp = fopen("pid.state", "wt"); FILE *fp = nlfopen("pid.state", "wt");
if (fp) if (fp)
{ {
fprintf(fp, "%u", getpid()); fprintf(fp, "%u", getpid());
@ -600,7 +600,6 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName,
ListeningPort = servicePort; ListeningPort = servicePort;
// setReportEmailFunction ((void*)sendEmail);
// setDefaultEmailParams ("gw.nevrax.com", "", "cado@nevrax.com"); // setDefaultEmailParams ("gw.nevrax.com", "", "cado@nevrax.com");
@ -623,7 +622,7 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName,
else else
{ {
// create the basic .cfg that link the default one // create the basic .cfg that link the default one
FILE *fp = fopen (cfn.c_str(), "w"); FILE *fp = nlfopen (cfn, "w");
if (fp == NULL) if (fp == NULL)
{ {
nlerror ("SERVICE: Can't create config file '%s'", cfn.c_str()); nlerror ("SERVICE: Can't create config file '%s'", cfn.c_str());

@ -110,15 +110,18 @@ bool IAudioDecoder::getInfo(const std::string &filepath, std::string &artist, st
CIFile ifile; CIFile ifile;
ifile.setCacheFileOnOpen(false); ifile.setCacheFileOnOpen(false);
ifile.allowBNPCacheFileOnOpen(false); ifile.allowBNPCacheFileOnOpen(false);
ifile.open(lookup); if (ifile.open(lookup))
return CAudioDecoderVorbis::getInfo(&ifile, artist, title); return CAudioDecoderVorbis::getInfo(&ifile, artist, title);
nlwarning("Unable to open: '%s'", filepath.c_str());
} }
else else
{ {
nlwarning("Music file type unknown: '%s'", type_lower.c_str()); nlwarning("Music file type unknown: '%s'", type_lower.c_str());
}
artist.clear(); title.clear(); artist.clear(); title.clear();
return false; return false;
}
} }
/// Get audio/container extensions that are currently supported by the nel sound library. /// Get audio/container extensions that are currently supported by the nel sound library.

@ -266,8 +266,7 @@ void CSoundDriverXAudio2::getDevices(std::vector<std::string> &devices)
for (uint i = 0; i < deviceCount; ++i) for (uint i = 0; i < deviceCount; ++i)
{ {
_XAudio2->GetDeviceDetails(i, &deviceDetails); _XAudio2->GetDeviceDetails(i, &deviceDetails);
std::basic_string<WCHAR> deviceNameW = deviceDetails.DisplayName; std::string deviceName = wideToUtf8(deviceDetails.DisplayName);
std::string deviceName = std::string(deviceNameW.begin(), deviceNameW.end());
nldebug("XA2: - %s", deviceName.c_str()); nldebug("XA2: - %s", deviceName.c_str());
devices.push_back(deviceName); devices.push_back(deviceName);
} }
@ -289,8 +288,7 @@ uint CSoundDriverXAudio2::getDeviceIndex(const std::string &device, XAUDIO2_DEVI
for (uint i = 0; i < deviceCount; ++i) for (uint i = 0; i < deviceCount; ++i)
{ {
_XAudio2->GetDeviceDetails(i, deviceDetails); _XAudio2->GetDeviceDetails(i, deviceDetails);
std::basic_string<WCHAR> deviceNameW = deviceDetails->DisplayName; std::string deviceName = wideToUtf8(deviceDetails->DisplayName);
std::string deviceName = std::string(deviceNameW.begin(), deviceNameW.end());
if (deviceName == device) if (deviceName == device)
return i; return i;
} }

@ -63,7 +63,7 @@ QVariant tiles_model::data(const QModelIndex &index, int role) const
#ifdef USE_QT5 #ifdef USE_QT5
QPixmap pixpix = wiwi.grab(wiwi.contentsRect()); QPixmap pixpix = wiwi.grab(wiwi.contentsRect());
#else #else
QPixmap::grabWidget(wiwi, wiwi.contentsRect()); QPixmap pixpix = QPixmap::grabWidget(&wiwi, wiwi.contentsRect());
#endif #endif
return pixpix; return pixpix;
} }
@ -78,7 +78,6 @@ QVariant tiles_model::data(const QModelIndex &index, int role) const
void tiles_model::sort ( int column, Qt::SortOrder order) void tiles_model::sort ( int column, Qt::SortOrder order)
{ {
qSort(tiles.begin(), tiles.end(), caseInsensitiveLessThan); qSort(tiles.begin(), tiles.end(), caseInsensitiveLessThan);
} }

@ -3,7 +3,7 @@ ADD_SUBDIRECTORY(misc)
IF(WITH_NEL_TOOLS) IF(WITH_NEL_TOOLS)
ADD_SUBDIRECTORY(memory) ADD_SUBDIRECTORY(memory)
ENDIF(WITH_NEL_TOOLS) ENDIF()
# Max plugins are under the 3d directory as well. # Max plugins are under the 3d directory as well.
# Allow to compile only max plugins without other tools. # Allow to compile only max plugins without other tools.
@ -15,21 +15,21 @@ ENDIF()
IF(WITH_NEL_TOOLS) IF(WITH_NEL_TOOLS)
IF(WITH_PACS) IF(WITH_PACS)
ADD_SUBDIRECTORY(pacs) ADD_SUBDIRECTORY(pacs)
ENDIF(WITH_PACS) ENDIF()
IF(WITH_LOGIC) IF(WITH_LOGIC)
ADD_SUBDIRECTORY(logic) ADD_SUBDIRECTORY(logic)
ENDIF(WITH_LOGIC) ENDIF()
IF(WITH_GEORGES) IF(WITH_GEORGES)
ADD_SUBDIRECTORY(georges) ADD_SUBDIRECTORY(georges)
ENDIF(WITH_GEORGES) ENDIF()
IF(WITH_SOUND) IF(WITH_SOUND)
ADD_SUBDIRECTORY(sound) ADD_SUBDIRECTORY(sound)
ENDIF(WITH_SOUND) ENDIF()
ENDIF()
IF(WITH_NEL_TESTS) IF(WITH_NEL_TESTS)
ADD_SUBDIRECTORY(nel_unit_test) ADD_SUBDIRECTORY(nel_unit_test)
ENDIF(WITH_NEL_TESTS) ENDIF()
ENDIF(WITH_NEL_TOOLS)

@ -72,7 +72,7 @@ private:
+ " </PRIMITIVE>\n" + " </PRIMITIVE>\n"
+ "</NEL_LIGO_PRIMITIVE_CLASS>"; + "</NEL_LIGO_PRIMITIVE_CLASS>";
FILE *fp = fopen(CLASS_FILE_NAME, "wt"); FILE *fp = NLMISC::nlfopen(CLASS_FILE_NAME, "wt");
nlassert(fp != NULL); nlassert(fp != NULL);
size_t s = fwrite(classfile.data(), 1, classfile.size(), fp); size_t s = fwrite(classfile.data(), 1, classfile.size(), fp);
nlassert(s == classfile.size()); nlassert(s == classfile.size());

@ -19,6 +19,7 @@
#include <nel/misc/file.h> #include <nel/misc/file.h>
#include <nel/misc/path.h> #include <nel/misc/path.h>
#include <nel/misc/common.h>
// Test suite for NLMISC::CFile behavior // Test suite for NLMISC::CFile behavior
struct CUTMiscFile : public Test::Suite struct CUTMiscFile : public Test::Suite
@ -49,7 +50,7 @@ private:
void copyFileSize(uint fileSize) void copyFileSize(uint fileSize)
{ {
// create a source file (using standard c code) // create a source file (using standard c code)
FILE *fp = fopen(_SrcFile.c_str(), "wb"); FILE *fp = NLMISC::nlfopen(_SrcFile, "wb");
nlverify(fp != NULL); nlverify(fp != NULL);
for (uint i=0; i<fileSize; ++i) for (uint i=0; i<fileSize; ++i)
@ -63,7 +64,7 @@ private:
NLMISC::CFile::copyFile(_DstFile, _SrcFile, false); NLMISC::CFile::copyFile(_DstFile, _SrcFile, false);
// verify the resulting file // verify the resulting file
fp = fopen(_DstFile.c_str(), "rb"); fp = NLMISC::nlfopen(_DstFile, "rb");
TEST_ASSERT(fp != NULL); TEST_ASSERT(fp != NULL);
if (fp) if (fp)
{ {
@ -108,7 +109,7 @@ private:
void moveFileSize(size_t fileSize) void moveFileSize(size_t fileSize)
{ {
// remove the destination if any // remove the destination if any
FILE *fp = fopen(_DstFile.c_str(), "rb"); FILE *fp = NLMISC::nlfopen(_DstFile, "rb");
if (fp != NULL) if (fp != NULL)
{ {
fclose(fp); fclose(fp);
@ -116,7 +117,7 @@ private:
} }
// create a source file (using standard c code) // create a source file (using standard c code)
fp = fopen(_SrcFile.c_str(), "wb"); fp = NLMISC::nlfopen(_SrcFile, "wb");
nlverify(fp != NULL); nlverify(fp != NULL);
for (uint i=0; i<fileSize; ++i) for (uint i=0; i<fileSize; ++i)
@ -130,12 +131,12 @@ private:
NLMISC::CFile::moveFile(_DstFile, _SrcFile); NLMISC::CFile::moveFile(_DstFile, _SrcFile);
// verify the resulting file // verify the resulting file
fp = fopen(_SrcFile.c_str(), "rb"); fp = NLMISC::nlfopen(_SrcFile, "rb");
TEST_ASSERT_MSG(fp == NULL, "The source file is not removed"); TEST_ASSERT_MSG(fp == NULL, "The source file is not removed");
if (fp) if (fp)
fclose(fp); fclose(fp);
fp = fopen(_DstFile.c_str(), "rb"); fp = NLMISC::nlfopen(_DstFile, "rb");
TEST_ASSERT(fp != NULL); TEST_ASSERT(fp != NULL);
if (fp) if (fp)
{ {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -8,6 +8,247 @@ if (outgame==nil) then
end end
------------------------------------------------------------------------------------------------------------
-- Name generator.
--nb noms:
-- matis: male 621 - female 621 - surname 621
-- fyros: given name 14269, surname 841
-- zorai: given name one 318, given name two 644, surname 1287
-- tryker: given name 4500, surname 4335
function outgame:getFyrosName()
local nameResult = "";
local fullnameResult = "";
local nbFyrosGivenNames = 0;
for _ in pairs(fyrosGivenNames) do nbFyrosGivenNames = nbFyrosGivenNames + 1 end
local givenName = fyrosGivenNames[math.random(nbFyrosGivenNames)];
local nbFyrosSurnames = 0;
for _ in pairs(fyrosSurnames) do nbFyrosSurnames = nbFyrosSurnames + 1 end
local surname = fyrosSurnames[math.random(nbFyrosSurnames)];
fullnameResult = givenName .. " " .. surname;
nameResult = surname;
return fullnameResult, nameResult
end
function outgame:getMatisName(sex)
local nameResult = "";
local fullnameResult = "";
local dbNameSex = getDbProp("UI:TEMP:NAME_SEX");
if sex ~= nil then
dbNameSex = sex
end
if tonumber( dbNameSex )== 1 then
local nbMatisMaleNames = 0;
for _ in pairs(matisMaleNames) do nbMatisMaleNames = nbMatisMaleNames + 1 end
givenName = matisMaleNames[math.random(nbMatisMaleNames)];
else
local nbMatisFemaleNames = 0;
for _ in pairs(matisFemaleNames) do nbMatisFemaleNames = nbMatisFemaleNames + 1 end
givenName = matisFemaleNames[math.random(nbMatisFemaleNames)];
end
local nbMatisSurnames = 0;
for _ in pairs(matisSurnames) do nbMatisSurnames = nbMatisSurnames + 1 end
local surname = matisSurnames[math.random(nbMatisSurnames)];
fullnameResult = givenName .. " " .. surname;
nameResult = givenName;
return fullnameResult, nameResult
end
function outgame:getTrykerName()
local nameResult = "";
local fullnameResult = "";
local nbTrykerGivenNames = 0;
for _ in pairs(trykerGivenNames) do nbTrykerGivenNames = nbTrykerGivenNames + 1 end
local givenName = trykerGivenNames[math.random(nbTrykerGivenNames)];
local nbTrykerSurnames = 0;
for _ in pairs(trykerSurnames) do nbTrykerSurnames = nbTrykerSurnames + 1 end
local surname = trykerSurnames[math.random(nbTrykerSurnames)];
fullnameResult = surname .. " " .. givenName;
nameResult = givenName;
return fullnameResult, nameResult
end
function outgame:getZoraiName()
local nameResult = "";
local fullnameResult = "";
local nbGivenNameOne = 0;
for _ in pairs(zoraiGivenNameOne) do nbGivenNameOne = nbGivenNameOne + 1 end
local givenNameOne = zoraiGivenNameOne[math.random(nbGivenNameOne)];
local nbGivenNameTwo = 0;
for _ in pairs(zoraiGivenNameTwo) do nbGivenNameTwo = nbGivenNameTwo + 1 end
local givenNameTwo = zoraiGivenNameTwo[math.random(nbGivenNameTwo)];
local nbSurnames = 0;
for _ in pairs(zoraiSurnames) do nbSurnames = nbSurnames + 1 end
local surname = zoraiSurnames[math.random(nbSurnames)];
fullnameResult = surname .. " " .. givenNameOne .. "-" .. givenNameTwo;
nameResult = givenNameOne .. givenNameTwo;
return fullnameResult, nameResult
end
function outgame:procGenerateName()
local uiNameFull = getUI("ui:outgame:appear_name:name_full");
local uiGenText = getUI("ui:outgame:appear_name:eb");
local dbNameRace = getDbProp("UI:TEMP:NAME_RACE");
local dbNameSubRace = getDbProp("UI:TEMP:NAME_SUB_RACE");
local dbNameSubRace2 = getDbProp("UI:TEMP:NAME_SUB_RACE2");
local nameResult = "";
local fullnameResult = "";
-- Look at outgame:procUpdateNameRaceLabel() for the "race" list.
-- fy ma try zo -->
local givenName = "";
if tonumber( dbNameRace ) == 1 then
-- Fyros
fullnameResult, nameResult = self:getFyrosName()
elseif tonumber( dbNameRace ) == 2 then
-- Matis
fullnameResult, nameResult = self:getMatisName()
elseif tonumber( dbNameRace ) == 3 then
-- Tryker
fullnameResult, nameResult = self:getTrykerName()
elseif tonumber( dbNameRace ) == 4 then
-- Zorai
fullnameResult, nameResult = self:getZoraiName()
elseif tonumber( dbNameRace ) == 5 then
-- Maraudeurs
tempResult_1 = "";
tempResult_2 = "";
if tonumber(dbNameSubRace) == 1 then
-- Fyros
fullnameResult, tempResult_1 = self:getFyrosName()
elseif tonumber( dbNameSubRace ) == 2 then
-- Matis F
fullnameResult, tempResult_1 = self:getMatisName(2)
elseif tonumber( dbNameSubRace ) == 3 then
-- Matis M
fullnameResult, tempResult_1 = self:getMatisName(1)
elseif tonumber( dbNameSubRace ) == 4 then
-- Tryker
fullnameResult, tempResult_1 = self:getTrykerName()
elseif tonumber( dbNameSubRace ) == 5 then
-- Zorai
fullnameResult, tempResult_1 = self:getZoraiName()
end
if tonumber(dbNameSubRace2) == 1 then
-- Fyros
fullnameResult, tempResult_2 = self:getFyrosName()
elseif tonumber( dbNameSubRace2 ) == 2 then
-- Matis F
fullnameResult, tempResult_2 = self:getMatisName(2)
elseif tonumber( dbNameSubRace2 ) == 3 then
-- Matis M
fullnameResult, tempResult_2 = self:getMatisName(1)
elseif tonumber( dbNameSubRace2 ) == 4 then
-- Tryker
fullnameResult, tempResult_2 = self:getTrykerName()
elseif tonumber( dbNameSubRace2 ) == 5 then
-- Zorai
fullnameResult, tempResult_2 = self:getZoraiName()
end
fullnameResult = tempResult_1 .. " " .. tempResult_2
nameResult = tempResult_2
end
uiNameFull.hardtext = fullnameResult;
nameResult = string.gsub(nameResult, "'", "");
nameResult = string.gsub(nameResult, " ", "");
nameResult = string.gsub(nameResult, "-", "");
nameResult = string.lower( nameResult );
nameResult = nameResult:gsub("^%l", string.upper);
uiGenText.input_string = nameResult;
end
-- Name sex slider update.
function outgame:procUpdateNameSexLabel()
local nameSexType = { "uiCP_Sex_Male", "uiCP_Sex_Female" }
local uiNameSexText = getUI("ui:outgame:appear_name:name_sex_slider:name_sex");
local uiNameSex = getDbProp("UI:TEMP:NAME_SEX");
tempstr = tostring(i18n.get(nameSexType[tonumber(uiNameSex)]));
tempstr = string.lower( tempstr );
tempstr = (tempstr:gsub("^%l", string.upper));
uiNameSexText.hardtext= tempstr;
end
-- Name race slider update.
function outgame:procUpdateNameRaceLabel()
local nameRaceType = { "Fyros", "Matis", "Tryker", "Zoraï", "uiCP_Maraudeur" }
local uiNameRaceText = getUI("ui:outgame:appear_name:name_race_slider:name_race");
local dbNameRace = getDbProp("UI:TEMP:NAME_RACE");
local uiNameSexSlider = getUI("ui:outgame:appear_name:name_sex_slider");
local uiNameSubRaceSlider = getUI("ui:outgame:appear_name:name_sub_race_slider");
local uiNameSubRace2Slider = getUI("ui:outgame:appear_name:name_sub_race2_slider");
local uiNameGenerate = getUI("ui:outgame:appear_name:generate");
-- Show/Hide sex slider
uiNameGenerate.y = "-50"
if tonumber(dbNameRace) == 2 then
uiNameSexSlider.active = true;
uiNameGenerate.y = "-65"
else
uiNameSexSlider.active = false;
end
-- Show/Hide sub race slider
if tonumber(dbNameRace) == 5 then
uiNameSubRaceSlider.active = true;
uiNameSubRace2Slider.active = true;
uiNameGenerate.y = "-105"
else
uiNameSubRaceSlider.active = false;
uiNameSubRace2Slider.active = false;
end
uiNameRaceText.hardtext= tostring(nameRaceType[tonumber(dbNameRace)]);
end
local matisF = "Matis " .. (string.lower(tostring(i18n.get("uiCP_Sex_Female")) )):gsub("^%l", string.upper);
local matisM = "Matis " .. (string.lower(tostring(i18n.get("uiCP_Sex_Male")) )):gsub("^%l", string.upper);
function outgame:procUpdateNameSubRaceLabel()
local nameSubRaceType = { "Fyros", matisF, matisM, "Tryker", "Zoraï" }
local uiNameSubRaceText = getUI("ui:outgame:appear_name:name_sub_race_slider:name_race");
local dbNameSubRace = getDbProp("UI:TEMP:NAME_SUB_RACE");
uiNameSubRaceText.hardtext= tostring(nameSubRaceType[tonumber(dbNameSubRace)]);
end
function outgame:procUpdateNameSubRace2Label()
local nameSubRace2Type = { "Fyros", matisF, matisM, "Tryker", "Zoraï" }
local uiNameSubRace2Text = getUI("ui:outgame:appear_name:name_sub_race2_slider:name_race");
local dbNameSubRace2 = getDbProp("UI:TEMP:NAME_SUB_RACE2");
uiNameSubRace2Text.hardtext= tostring(nameSubRace2Type[tonumber(dbNameSubRace2)]);
end
------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------
-- called to construct icons -- called to construct icons
function outgame:activePackElement(id, icon) function outgame:activePackElement(id, icon)

@ -2,6 +2,10 @@
<root id="outgame" x="0" y="0" w="1024" h="768" active="false" /> <root id="outgame" x="0" y="0" w="1024" h="768" active="false" />
<lua file="names_matis.lua" />
<lua file="names_fyros.lua" />
<lua file="names_zorai.lua" />
<lua file="names_tryker.lua" />
<lua file="out_v2_appear.lua" /> <lua file="out_v2_appear.lua" />
<!-- ********************** --> <!-- ********************** -->
@ -43,6 +47,18 @@
<variable entry="UI:TEMP:NAME_VALID" type="sint64" value="-1" /> <variable entry="UI:TEMP:NAME_VALID" type="sint64" value="-1" />
<!-- Name Generator. -->
<!-- We start at 1 not 0. -->
<variable entry="UI:TEMP:NAME_RACE" type="sint64" value="1" />
<!-- used for marauder names. -->
<variable entry="UI:TEMP:NAME_SUB_RACE" type="sint64" value="1" />
<variable entry="UI:TEMP:NAME_SUB_RACE2" type="sint64" value="1" />
<!-- you will have to change the max value of the slider too, since it seam not working to set it using that var directly. -->
<variable entry="UI:TEMP:NAME_RACE_NB" type="sint64" value="5" />
<!-- We start at 1 not 0. -->
<variable entry="UI:TEMP:NAME_SEX" type="sint64" value="1" />
<!-- End Name Generator. -->
<template name="char_var_dec" id="#id" > <template name="char_var_dec" id="#id" >
<variable entry="#id:PEOPLE" type="sint64" value="1" /> <variable entry="#id:PEOPLE" type="sint64" value="1" />
<variable entry="#id:VPA:SEX" type="sint64" value="1" /> <variable entry="#id:VPA:SEX" type="sint64" value="1" />
@ -1254,20 +1270,25 @@
<!-- * ENTER NAME * --> <!-- * ENTER NAME * -->
<!-- ************** --> <!-- ************** -->
<group type="modal" id="appear_name" posref="MM MM" w="400" h="450" <group type="modal" id="appear_name" posref="MM MM" w="400" h="680"
mouse_pos="false" escapable="false" exit_click_out="false" mouse_pos="false" escapable="false" exit_click_out="false"
on_active="proc" on_active_params="proc_appear_name_active" on_active="proc" on_active_params="proc_appear_name_active"
display="false" display="false"
> >
<instance template="outgame_popup" id="back" posref="TL TL" /> <instance template="outgame_popup" id="back" posref="TL TL" />
<view type="text" id="text" posref="TM TM" x="0" y="-56" color="255 255 255 255" global_color="false" fontsize="17" multi_line="true" multi_line_space="0" <view type="text" id="text" posref="TM TM" x="0" y="-56" color="255 255 255 255" global_color="false" fontsize="17" multi_line="true" multi_line_space="0"
line_maxw="350" shadow="true" hardtext="uiCP_Name_Enter" /> line_maxw="350" shadow="true" hardtext="uiCP_Name_Enter" />
<group type="edit_box" id="eb" posparent="text" posref="BM TM" x="0" y="-8" w="300" h="52" render_layer="4" child_resize_h="true" <!-- NamingPolicy -->
<ctrl style="opt_button" id="name_policy" posref="BM BM" posparent="text" x="0" y="-40" hardtext="uiCP_Name_Policy"
text_color_over="208 258 16 255" text_color_normal="255 255 46 255" text_color_pushed="108 158 16 255"
onover="play_sound" params_over="name=specie_but_over"
onclick_l="open_url" params_l="cfg_ConditionsTermsURL" />
<!-- onclick_l="open_url" params_l="cfg_NamingPolicyURL" /> -->
<group type="edit_box" id="eb" posparent="name_policy" posref="BM TM" x="0" y="-8" w="300" h="52" render_layer="4" child_resize_h="true"
onenter="proc" params="proc_appear_name_enter" onenter="proc" params="proc_appear_name_enter"
onchange="proc" onchange_params="proc_appear_name_change" onchange="proc" onchange_params="proc_appear_name_change"
prompt="" enter_loose_focus="true" reset_focus_on_hide="true" prompt="" enter_loose_focus="true" reset_focus_on_hide="true"
@ -1278,9 +1299,9 @@
fontsize="20" shadow="true" global_color="false" case="%case_first_string_letter_up" /> fontsize="20" shadow="true" global_color="false" case="%case_first_string_letter_up" />
</group> </group>
<view type="text" id="invalid" posref="BM TM" posparent="eb" x="0" y="0" color="255 255 96 255" global_color="false" fontsize="15" shadow="true" hardtext="uiCP_Name_Invalid" /> <view type="text" id="invalid" posref="TM TM" posparent="eb" x="0" y="20" color="255 255 96 255" global_color="false" fontsize="15" shadow="true" hardtext="uiCP_Name_Invalid" />
<ctrl style="valid_txt_button" id="submit" posref="BM BM" x="0" y="8" hardtext="uiCP_Name_Submit" <ctrl style="valid_txt_button" id="submit" posref="BM BM" x="0" y="15" hardtext="uiCP_Name_Submit"
onover="play_sound" params_over="name=specie_but_over" onover="play_sound" params_over="name=specie_but_over"
onclick_l="proc" params_l="proc_appear_name_enter" /> onclick_l="proc" params_l="proc_appear_name_enter" />
@ -1288,6 +1309,118 @@
onover="play_sound" params_over="name=specie_but_over" onover="play_sound" params_over="name=specie_but_over"
onclick_l="proc" params_l="proc_appear_name_cancel" /> onclick_l="proc" params_l="proc_appear_name_cancel" />
<!-- Name Generator -->
<!-- voir coter widgets.xml pour les template de checkbox et autre -->
<view type="text" id="name_generator" x="0" y="-30" posparent="eb" posref="BM BM" multi_line="false" render_layer="4"
fontsize="10" shadow="true" global_color="false" case="%case_first_string_letter_up" hardtext="uiCP_Name_Generator"
on_active="proc" on_active_params="proc_init_name_generator" />
<!-- Full generated name with spaces and quote before being clean to match the login name pattern. -->
<view type="text" id="name_full" x="0" y="-15" posparent="eb" posref="BM BM" multi_line="false" render_layer="4"
fontsize="14" color="200 200 200 255" shadow="true" global_color="false" case="%case_first_string_letter_up" />
<!-- Slider Name Race -->
<group id="name_race_slider" posparent="name_generator" posref="BM BM" x="0" y="-55" w="200" h="48" >
<view type="bitmap" id="left" posref="TL TL" texture="opt_on_l.tga" y="-6" />
<view type="bitmap" id="right" posref="TR TR" texture="opt_on_r.tga" y="-6" />
<view type="bitmap" id="middle" posref="TM TM" scale="true" sizeref="w" h="32" w="-64" y="-5" texture="opt_on_m.tga"/>
<ctrl type="button" button_type="push_button" tx_normal="blank.tga" tx_pushed="opt_on_l_over.tga" tx_over="opt_on_l_over.tga" scale="true" w="32" h="32"
color="0 0 0 0" col_over="255 255 255 128" col_pushed="255 255 255 255"
id="but_back" posref="TL TL" x="0" y="-6"
onclick_l="proc" params_l="proc_appear_name_race_sub_one" />
<ctrl type="button" button_type="push_button" tx_normal="blank.tga" tx_pushed="opt_on_r_over.tga" tx_over="opt_on_r_over.tga" scale="true" w="32" h="32"
color="0 0 0 0" col_over="255 255 255 128" col_pushed="255 255 255 255"
id="but_next" posref="TR TR" x="0" y="-6"
onclick_l="proc" params_l="proc_appear_name_race_add_one" />
<view type="text" id="name_race" case="%case_first_string_letter_up" posparent="name_generator" posref="TL TL" x="0" y="0" hardtext="Fyros" color="255 255 255 255" fontsize="11"/>
<ctrl type="scroll" id="name_race_scroll" posparent="name_race_slider" posref="MM MM" x="0" y="0" w="160" h="32"
vertical="false" align="L" min="1" max="5" value="UI:TEMP:NAME_RACE" tracksize="40"
tx_topright="" tx_middle="slider_m.tga" tx_bottomleft=""
onscroll="proc" params="proc_appear_name_race_label_change" />
</group>
<!-- Slider Name Sub Race -->
<group id="name_sub_race_slider" posparent="name_race_slider" posref="BM BM" x="0" y="-40" w="200" h="48" >
<view type="bitmap" id="left" posref="TL TL" texture="opt_on_l.tga" y="-6" />
<view type="bitmap" id="right" posref="TR TR" texture="opt_on_r.tga" y="-6" />
<view type="bitmap" id="middle" posref="TM TM" scale="true" sizeref="w" h="32" w="-64" y="-5" texture="opt_on_m.tga"/>
<ctrl type="button" button_type="push_button" tx_normal="blank.tga" tx_pushed="opt_on_l_over.tga" tx_over="opt_on_l_over.tga" scale="true" w="32" h="32"
color="0 0 0 0" col_over="255 255 255 128" col_pushed="255 255 255 255"
id="but_back" posref="TL TL" x="0" y="-6"
onclick_l="proc" params_l="proc_appear_name_sub_race_sub_one" />
<ctrl type="button" button_type="push_button" tx_normal="blank.tga" tx_pushed="opt_on_r_over.tga" tx_over="opt_on_r_over.tga" scale="true" w="32" h="32"
color="0 0 0 0" col_over="255 255 255 128" col_pushed="255 255 255 255"
id="but_next" posref="TR TR" x="0" y="-6"
onclick_l="proc" params_l="proc_appear_name_sub_race_add_one" />
<view type="text" id="surname" case="%case_first_string_letter_up" posparent="name_sub_race_slider" posref="TL TL" x="0" y="0" hardtext="uiCP_FirstName" color="255 255 255 255" fontsize="11"/>
<view type="text" id="name_race" case="%case_first_string_letter_up" posparent="name_sub_race_slider" posref="TR TL" x="-100" y="0" hardtext="Fyros" color="255 255 255 255" fontsize="11"/>
<ctrl type="scroll" id="name_race_scroll" posparent="name_sub_race_slider" posref="MM MM" x="0" y="0" w="160" h="32"
vertical="false" align="L" min="1" max="5" value="UI:TEMP:NAME_SUB_RACE" tracksize="40"
tx_topright="" tx_middle="slider_m.tga" tx_bottomleft=""
onscroll="proc" params="proc_appear_name_sub_race_label_change" />
</group>
<!-- Slider Name Sub Race2 -->
<group id="name_sub_race2_slider" posparent="name_sub_race_slider" posref="BM BM" x="0" y="-40" w="200" h="48" >
<view type="bitmap" id="left" posref="TL TL" texture="opt_on_l.tga" y="-6" />
<view type="bitmap" id="right" posref="TR TR" texture="opt_on_r.tga" y="-6" />
<view type="bitmap" id="middle" posref="TM TM" scale="true" sizeref="w" h="32" w="-64" y="-5" texture="opt_on_m.tga"/>
<ctrl type="button" button_type="push_button" tx_normal="blank.tga" tx_pushed="opt_on_l_over.tga" tx_over="opt_on_l_over.tga" scale="true" w="32" h="32"
color="0 0 0 0" col_over="255 255 255 128" col_pushed="255 255 255 255"
id="but_back" posref="TL TL" x="0" y="-6"
onclick_l="proc" params_l="proc_appear_name_sub_race2_sub_one" />
<ctrl type="button" button_type="push_button" tx_normal="blank.tga" tx_pushed="opt_on_r_over.tga" tx_over="opt_on_r_over.tga" scale="true" w="32" h="32"
color="0 0 0 0" col_over="255 255 255 128" col_pushed="255 255 255 255"
id="but_next" posref="TR TR" x="0" y="-6"
onclick_l="proc" params_l="proc_appear_name_sub_race2_add_one" />
<view type="text" id="name" case="%case_first_string_letter_up" posparent="name_sub_race2_slider" posref="TL TL" x="0" y="0" hardtext="uiCP_LastName" color="255 255 255 255" fontsize="11"/>
<view type="text" id="name_race" case="%case_first_string_letter_up" posparent="name_sub_race2_slider" posref="TR TL" x="-100" y="0" hardtext="Fyros" color="255 255 255 255" fontsize="11"/>
<ctrl type="scroll" id="name_race_scroll" posparent="name_sub_race2_slider" posref="MM MM" x="0" y="0" w="160" h="32"
vertical="false" align="L" min="1" max="5" value="UI:TEMP:NAME_SUB_RACE2" tracksize="40"
tx_topright="" tx_middle="slider_m.tga" tx_bottomleft=""
onscroll="proc" params="proc_appear_name_sub_race2_label_change" />
</group>
<!-- Slider Name Sex -->
<group id="name_sex_slider" posparent="name_race_slider" posref="BM BM" x="0" y="-40" w="200" h="48" >
<view type="bitmap" id="left" posref="TL TL" texture="opt_on_l.tga" y="-6" />
<view type="bitmap" id="right" posref="TR TR" texture="opt_on_r.tga" y="-6" />
<view type="bitmap" id="middle" posref="TM TM" scale="true" sizeref="w" h="32" w="-64" y="-5" texture="opt_on_m.tga"/>
<ctrl type="button" button_type="push_button" tx_normal="blank.tga" tx_pushed="opt_on_l_over.tga" tx_over="opt_on_l_over.tga" scale="true" w="32" h="32"
color="0 0 0 0" col_over="255 255 255 128" col_pushed="255 255 255 255"
id="but_back" posref="TL TL" x="0" y="-6"
onclick_l="proc" params_l="proc_appear_name_sex_sub_one" />
<ctrl type="button" button_type="push_button" tx_normal="blank.tga" tx_pushed="opt_on_r_over.tga" tx_over="opt_on_r_over.tga" scale="true" w="32" h="32"
color="0 0 0 0" col_over="255 255 255 128" col_pushed="255 255 255 255"
id="but_next" posref="TR TR" x="0" y="-6"
onclick_l="proc" params_l="proc_appear_name_sex_add_one" />
<view type="text" id="name_sex" posparent="name_race_slider" posref="TL TL" x="0" y="0" hardtext="uiCP_Sex_Male" case="%case_first_string_letter_up" color="255 255 255 255" fontsize="11"/>
<ctrl type="scroll" id="name_sex_scroll" posparent="name_sex_slider" posref="MM MM" x="0" y="0" w="160" h="32"
vertical="false" align="L" min="1" max="2" value="UI:TEMP:NAME_SEX" tracksize="40"
tx_topright="" tx_middle="slider_m.tga" tx_bottomleft="" />
</group>
<ctrl style="valid_txt_button" id="generate" posref="BM BM" posparent="name_race_slider" x="0" y="-100" hardtext="uiCP_Name_Generate"
onover="play_sound" params_over="name=specie_but_over"
onclick_l="proc" params_l="proc_appear_name_generate" />
<!-- End Name Generator -->
</group> </group>
@ -1396,6 +1529,24 @@
<action handler="set" params="target_property=ui:outgame:appear_name:invalid:active|value=0" /> <action handler="set" params="target_property=ui:outgame:appear_name:invalid:active|value=0" />
<action handler="set" params="target_property=ui:outgame:appear_name:eb:input_string|value=''" /> <action handler="set" params="target_property=ui:outgame:appear_name:eb:input_string|value=''" />
<action handler="set_keyboard_focus" params="target=ui:outgame:appear_name:eb|select_all=false" /> <action handler="set_keyboard_focus" params="target=ui:outgame:appear_name:eb|select_all=false" />
<!-- Name generator init. -->
<action handler="set" params="target_property=ui:outgame:appear_name:name_sex_slider:name_sex_scroll:value|value=add(@UI:TEMP:CHAR3D:VPA:SEX,1)" />
<action handler="set" params="target_property=ui:outgame:appear_name:name_race_slider:name_race_scroll:value|value=add(@UI:TEMP:CHAR3D:PEOPLE,1)" />
<action handler="set" params="target_property=ui:outgame:appear_name:name_sub_race_slider:name_race_scroll:value|value=1" />
<action handler="set" params="target_property=ui:outgame:appear_name:name_sub_race2_slider:name_race_scroll:value|value=1" />
<action handler="set" params="dblink=UI:TEMP:NAME_SEX|value=add(@UI:TEMP:CHAR3D:VPA:SEX,1)" />
<action handler="set" params="dblink=UI:TEMP:NAME_RACE|value=add(@UI:TEMP:CHAR3D:PEOPLE,1)" />
<action handler="set" params="dblink=UI:TEMP:NAME_SUB_RACE|value=1" />
<action handler="set" params="dblink=UI:TEMP:NAME_SUB2_RACE|value=1" />
<action handler="lua:outgame:procUpdateNameSexLabel()" />
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
<action handler="lua:outgame:procUpdateNameSubRaceLabel()" />
<action handler="lua:outgame:procUpdateNameSubRace2Label()" />
<!-- End Name Generator. -->
</proc> </proc>
<proc id="proc_appear_name_change"> <proc id="proc_appear_name_change">
@ -1469,6 +1620,61 @@
<action handler="set" cond="eq(@UI:TEMP:NAME_VALID,0)" params="target_property=ui:outgame:appear_name:invalid:active|value=1" /> <action handler="set" cond="eq(@UI:TEMP:NAME_VALID,0)" params="target_property=ui:outgame:appear_name:invalid:active|value=1" />
</proc> </proc>
<!-- Name Generator. -->
<proc id="proc_appear_name_generate">
<action handler="lua:outgame:procGenerateName()" />
</proc>
<!-- Name Sex. -->
<proc id="proc_appear_name_sex_label_change">
<action handler="lua:outgame:procUpdateNameSexLabel()" />
</proc>
<proc id="proc_appear_name_sex_add_one">
<action handler="set" params="dblink=UI:TEMP:NAME_SEX|value=min(add(@UI:TEMP:NAME_SEX,1),2)" />
<action handler="lua:outgame:procUpdateNameSexLabel()" />
</proc>
<proc id="proc_appear_name_sex_sub_one">
<action handler="set" params="dblink=UI:TEMP:NAME_SEX|value=max(sub(@UI:TEMP:NAME_SEX,1),1)" />
<action handler="lua:outgame:procUpdateNameSexLabel()" />
</proc>
<!-- Name Race. -->
<proc id="proc_appear_name_race_label_change">
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
</proc>
<proc id="proc_appear_name_race_add_one">
<action handler="set" params="dblink=UI:TEMP:NAME_RACE|value=min(add(@UI:TEMP:NAME_RACE,1),@UI:TEMP:NAME_RACE_NB)" />
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
</proc>
<proc id="proc_appear_name_race_sub_one">
<action handler="set" params="dblink=UI:TEMP:NAME_RACE|value=max(sub(@UI:TEMP:NAME_RACE,1),1)" />
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
</proc>
<!-- Name Sub Race. -->
<proc id="proc_appear_name_sub_race_label_change">
<action handler="lua:outgame:procUpdateNameSubRaceLabel()" />
</proc>
<proc id="proc_appear_name_sub_race_add_one">
<action handler="set" params="dblink=UI:TEMP:NAME_SUB_RACE|value=min(add(@UI:TEMP:NAME_SUB_RACE,1),5)" />
<action handler="lua:outgame:procUpdateNameSubRaceLabel()" />
</proc>
<proc id="proc_appear_name_sub_race_sub_one">
<action handler="set" params="dblink=UI:TEMP:NAME_SUB_RACE|value=max(sub(@UI:TEMP:NAME_SUB_RACE,1),1)" />
<action handler="lua:outgame:procUpdateNameSubRaceLabel()" />
</proc>
<!-- Name Sub Race2. -->
<proc id="proc_appear_name_sub_race2_label_change">
<action handler="lua:outgame:procUpdateNameSubRace2Label()" />
</proc>
<proc id="proc_appear_name_sub_race2_add_one">
<action handler="set" params="dblink=UI:TEMP:NAME_SUB_RACE2|value=min(add(@UI:TEMP:NAME_SUB_RACE2,1),5)" />
<action handler="lua:outgame:procUpdateNameSubRace2Label()" />
</proc>
<proc id="proc_appear_name_sub_race2_sub_one">
<action handler="set" params="dblink=UI:TEMP:NAME_SUB_RACE2|value=max(sub(@UI:TEMP:NAME_SUB_RACE2,1),1)" />
<action handler="lua:outgame:procUpdateNameSubRace2Label()" />
</proc>
<!-- End Name Generator. -->
<proc id="proc_appear_name_server_test"> <proc id="proc_appear_name_server_test">
<action handler="proc" params="proc_appear_name_enter2" <action handler="proc" params="proc_appear_name_enter2"
cond="and(eq(@UI:CURRENT_SCREEN,%screen_appear),eq(@UI:SERVER_RECEIVED_VALID,1))" /> cond="and(eq(@UI:CURRENT_SCREEN,%screen_appear),eq(@UI:SERVER_RECEIVED_VALID,1))" />

@ -0,0 +1,44 @@
#!/bin/sh
if [ -z "$ROOTPATH" ]
then
echo "upgd_nl.sh can only be launched from updt_nl.sh"
exit 1
fi
# determine directory where all files reside
CONTENTSPATH=$(dirname "$ROOTPATH")
MACOSPATH=$(dirname "$RYZOM_CLIENT")
SIGNPATH=$CONTENTSPATH/_CodeSignature
# all files of original Bundle are in the same directory
# we have to copy them to the right location
# client_default.cfg and ryzom.icns are already in the right location
# PkgInfo usually doesn't change so don't copy it
# Info.plist contains updated version
cp -p "$ROOTPATH/Info.plist" "$CONTENTSPATH"
cp -p "$ROOTPATH/CodeResources" "$SIGNPATH"
# executable flag for all executables
chmod +x "$ROOTPATH/Ryzom"
chmod +x "$ROOTPATH/CrashReport"
chmod +x "$ROOTPATH/RyzomClientPatcher"
chmod +x "$ROOTPATH/RyzomConfiguration"
# remove previous executables
rm -f "$MACOSPATH/Ryzom"
rm -f "$MACOSPATH/CrashReport"
rm -f "$MACOSPATH/RyzomClientPatcher"
rm -f "$MACOSPATH/RyzomConfiguration"
# copy all binaries in MacOS directory
cp -p "$ROOTPATH/Ryzom" "$MACOSPATH"
cp -p "$ROOTPATH/CrashReport" "$MACOSPATH"
cp -p "$ROOTPATH/RyzomClientPatcher" "$MACOSPATH"
cp -p "$ROOTPATH/RyzomConfiguration" "$MACOSPATH"
exit 0

@ -124,6 +124,7 @@ IF(WITH_RYZOM_CLIENT)
${LUABIND_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR}
${CURL_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
) )
TARGET_LINK_LIBRARIES(ryzom_client TARGET_LINK_LIBRARIES(ryzom_client
@ -141,6 +142,7 @@ IF(WITH_RYZOM_CLIENT)
${LUA_LIBRARIES} ${LUA_LIBRARIES}
${LUABIND_LIBRARIES} ${LUABIND_LIBRARIES}
${CURL_LIBRARIES} ${CURL_LIBRARIES}
${OPENSSL_LIBRARIES}
) )
IF(NOT APPLE AND NOT WIN32) IF(NOT APPLE AND NOT WIN32)

@ -104,48 +104,57 @@ void CCDBSynchronised::read( const string &fileName )
int linecount=1; int linecount=1;
#endif #endif
if( _Database == 0 ) if (_Database == NULL)
{ {
throw CCDBSynchronised::EDBNotInit(); throw CCDBSynchronised::EDBNotInit();
} }
ifstream f(fileName.c_str(), ios::in); CIFile f;
if( !f.is_open() )
if (!f.open(fileName, true))
{ {
nlerror("can't open file : %s\n", fileName.c_str()); nlerror("can't open file : %s\n", fileName.c_str());
} }
while( !f.eof() ) while(!f.eof())
{ {
string line; char line[1024];
getline(f,line,'\n'); f.getline(line, 1024);
#ifdef _DEBUG #ifdef _DEBUG
nlinfo("%s:%i",fileName.c_str(),linecount); nlinfo("%s:%i", fileName.c_str(), linecount);
linecount++; linecount++;
#endif #endif
char * token; char * token;
char * buffer = new char[line.size()+1]; char * buffer = new char[strlen(line)+1];
strcpy(buffer,line.c_str()); strcpy(buffer, line);
// value // value
token = strtok(buffer," \t"); token = strtok(buffer," \t");
if( token == NULL ) continue;
if (token)
{
sint64 value; sint64 value;
fromString((const char*)token, value); fromString((const char*)token, value);
// property name // property name
token = strtok(NULL," \n"); token = strtok(NULL," \n");
if( token == NULL ) continue;
if (token)
{
string propName(token); string propName(token);
// set the value of the property // set the value of the property
ICDBNode::CTextId txtId(propName); ICDBNode::CTextId txtId(propName);
_Database->setProp(txtId,value); _Database->setProp(txtId, value);
}
} }
f.close(); delete [] buffer;
}
f.close();
} // read // } // read //
@ -156,19 +165,25 @@ void CCDBSynchronised::read( const string &fileName )
//----------------------------------------------- //-----------------------------------------------
void CCDBSynchronised::write( const string &fileName ) void CCDBSynchronised::write( const string &fileName )
{ {
if( _Database != 0 ) bool res = false;
if (_Database != 0)
{
FILE * f = nlfopen(fileName, "w");
if (f)
{ {
FILE * f;
f = fopen(fileName.c_str(),"w");
ICDBNode::CTextId id; ICDBNode::CTextId id;
_Database->write(id,f); _Database->write(id,f);
fclose(f); fclose(f);
res = true;
} }
else }
if (!res)
{ {
nlwarning("<CCDBSynchronised::write> can't write %s : the database has not been initialized",fileName.c_str()); nlwarning("<CCDBSynchronised::write> can't write %s : the database has not been initialized",fileName.c_str());
} }
} // write // } // write //
@ -276,11 +291,9 @@ string CCDBSynchronised::getString( uint32 id )
{ {
return (*itStr).second; return (*itStr).second;
} }
else
{
nlwarning("<CCDBSynchronised::getString> string with id %d was not found",id); nlwarning("<CCDBSynchronised::getString> string with id %d was not found",id);
return ""; return "";
}
} // getString // } // getString //

@ -171,7 +171,7 @@ int main(int argc, char **argv)
Args.setVersion(getDisplayVersion()); Args.setVersion(getDisplayVersion());
Args.setDescription("Ryzom client"); Args.setDescription("Ryzom client");
Args.addArg("c", "config", "id", "Use this configuration to determine what directory to use by default"); Args.addArg("p", "profile", "id", "Use this profile to determine what directory to use by default");
Args.addAdditionalArg("login", "Login to use", true, false); Args.addAdditionalArg("login", "Login to use", true, false);
Args.addAdditionalArg("password", "Password to use", true, false); Args.addAdditionalArg("password", "Password to use", true, false);
Args.addAdditionalArg("shard_id", "Shard ID to use", true, false); Args.addAdditionalArg("shard_id", "Shard ID to use", true, false);
@ -206,13 +206,13 @@ int main(int argc, char **argv)
LoginShardId = std::numeric_limits<uint32>::max(); LoginShardId = std::numeric_limits<uint32>::max();
// if client_default.cfg is not in current directory, use application default directory // if client_default.cfg is not in current directory, use application default directory
if (Args.haveArg("c") || !CFile::isExists("client_default.cfg")) if (Args.haveArg("p") || !CFile::isExists("client_default.cfg"))
{ {
std::string currentPath = CPath::getApplicationDirectory("Ryzom"); std::string currentPath = CPath::getApplicationDirectory("Ryzom");
// append config ID to directory // append profile ID to directory
if (Args.haveArg("c")) if (Args.haveArg("p"))
currentPath = NLMISC::CPath::standardizePath(currentPath) + Args.getArg("c").front(); currentPath = NLMISC::CPath::standardizePath(currentPath) + Args.getArg("p").front();
if (!CFile::isExists(currentPath)) CFile::createDirectory(currentPath); if (!CFile::isExists(currentPath)) CFile::createDirectory(currentPath);
@ -275,20 +275,6 @@ int main(int argc, char **argv)
pump (); pump ();
// Delete the .bat file because it s not useful anymore
if (NLMISC::CFile::fileExists("updt_nl.bat"))
NLMISC::CFile::deleteFile("updt_nl.bat");
if (NLMISC::CFile::fileExists("bug_report.exe"))
NLMISC::CFile::deleteFile("bug_report.exe");
if (NLMISC::CFile::fileExists("bug_report_r.exe"))
NLMISC::CFile::deleteFile("bug_report_r.exe");
if (NLMISC::CFile::fileExists("bug_report_rd.exe"))
NLMISC::CFile::deleteFile("bug_report_rd.exe");
if (NLMISC::CFile::fileExists("bug_report_df.exe"))
NLMISC::CFile::deleteFile("bug_report_df.exe");
if (NLMISC::CFile::fileExists("bug_report_d.exe"))
NLMISC::CFile::deleteFile("bug_report_d.exe");
// Delete all the .ttf file in the /data directory // Delete all the .ttf file in the /data directory
{ {
vector<string> files; vector<string> files;
@ -303,10 +289,6 @@ int main(int argc, char **argv)
#else #else
// TODO for Linux : splashscreen // TODO for Linux : splashscreen
// Delete the .sh file because it s not useful anymore
if (NLMISC::CFile::fileExists("updt_nl.sh"))
NLMISC::CFile::deleteFile("updt_nl.sh");
#endif #endif
// initialize patch manager and set the ryzom full path, before it's used // initialize patch manager and set the ryzom full path, before it's used

@ -884,6 +884,7 @@ void CClientConfig::setValues()
READ_STRING_FV(CreateAccountURL) READ_STRING_FV(CreateAccountURL)
READ_STRING_FV(EditAccountURL) READ_STRING_FV(EditAccountURL)
READ_STRING_FV(ConditionsTermsURL) READ_STRING_FV(ConditionsTermsURL)
READ_STRING_FV(NamingPolicyURL)
READ_STRING_FV(BetaAccountURL) READ_STRING_FV(BetaAccountURL)
READ_STRING_FV(ForgetPwdURL) READ_STRING_FV(ForgetPwdURL)
READ_STRING_FV(FreeTrialURL) READ_STRING_FV(FreeTrialURL)
@ -1931,7 +1932,7 @@ void CClientConfig::init(const string &configFileName)
if(!CFile::fileExists(configFileName)) if(!CFile::fileExists(configFileName))
{ {
// create the basic .cfg // create the basic .cfg
FILE *fp = fopen(configFileName.c_str(), "w"); FILE *fp = nlfopen(configFileName, "w");
if (fp == NULL) if (fp == NULL)
nlerror("CFG::init: Can't create config file '%s'", configFileName.c_str()); nlerror("CFG::init: Can't create config file '%s'", configFileName.c_str());
@ -2221,9 +2222,11 @@ bool CClientConfig::getDefaultConfigLocation(std::string& p_name) const
defaultConfigPath = Args.getProgramPath(); defaultConfigPath = Args.getProgramPath();
#endif #endif
std::string currentPath = CPath::standardizePath(CPath::getCurrentPath());
// look in the current working directory first // look in the current working directory first
if (CFile::isExists(defaultConfigFileName)) if (CFile::isExists(currentPath + defaultConfigFileName))
p_name = defaultConfigFileName; p_name = currentPath + defaultConfigFileName;
// look in startup directory // look in startup directory
else if (CFile::isExists(Args.getStartupPath() + defaultConfigFileName)) else if (CFile::isExists(Args.getStartupPath() + defaultConfigFileName))

@ -160,6 +160,7 @@ struct CClientConfig
string CreateAccountURL; string CreateAccountURL;
string EditAccountURL; string EditAccountURL;
string ConditionsTermsURL; string ConditionsTermsURL;
string NamingPolicyURL;
string BetaAccountURL; string BetaAccountURL;
string ForgetPwdURL; string ForgetPwdURL;
string FreeTrialURL; string FreeTrialURL;

@ -695,7 +695,7 @@ NLMISC_COMMAND(bugReport, "Call the bug report tool with dump", "<AddScreenshot>
if (ClientCfg.Local) if (ClientCfg.Local)
sys += "ShardName OFFLINE "; sys += "ShardName OFFLINE ";
FILE *fp = fopen (std::string(getLogDirectory() + "bug_report.txt").c_str(), "wb"); FILE *fp = nlfopen (getLogDirectory() + "bug_report.txt", "wb");
if (fp != NULL) if (fp != NULL)
{ {
string res = addSlashR(getDebugInformation()); string res = addSlashR(getDebugInformation());

@ -15,9 +15,12 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdpch.h" #include "stdpch.h"
#include <curl/curl.h>
#include "http_client_curl.h" #include "http_client_curl.h"
#include <curl/curl.h>
#include <openssl/ssl.h>
using namespace NLMISC; using namespace NLMISC;
using namespace NLNET; using namespace NLNET;
using namespace std; using namespace std;
@ -58,16 +61,73 @@ bool CCurlHttpClient::authenticate(const std::string &user, const std::string &p
const char *CAFilename = "ssl_ca_cert.pem"; // this is the certificate "Thawte Server CA" const char *CAFilename = "ssl_ca_cert.pem"; // this is the certificate "Thawte Server CA"
static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm)
{
string path = CPath::lookup(CAFilename);
nldebug("Cert path '%s'", path.c_str());
CIFile file;
if (!file.open(CAFilename))
{
nlwarning("Unable to open %s", CAFilename);
return CURLE_SSL_CACERT;
}
CURLcode res = CURLE_OK;
std::vector<uint8> buffer(file.getFileSize());
file.serialBuffer(&buffer[0], file.getFileSize());
// get a BIO
BIO *bio = BIO_new_mem_buf(&buffer[0], file.getFileSize());
if (bio)
{
// use it to read the PEM formatted certificate from memory into an X509
// structure that SSL can use
X509 *cert = NULL;
PEM_read_bio_X509(bio, &cert, 0, NULL);
if (cert)
{
// get a pointer to the X509 certificate store (which may be empty!)
X509_STORE *store = SSL_CTX_get_cert_store((SSL_CTX *)sslctx);
// add our certificate to this store
if (X509_STORE_add_cert(store, cert) == 0)
{
nlwarning("Error adding certificate");
res = CURLE_SSL_CACERT;
}
// decrease reference counts
X509_free(cert);
}
else
{
nlwarning("PEM_read_bio_X509 failed...");
res = CURLE_SSL_CACERT;
}
// decrease reference counts
BIO_free(bio);
}
// all set to go
return CURLE_OK ;
}
// *************************************************************************** // ***************************************************************************
bool CCurlHttpClient::verifyServer(bool verify) bool CCurlHttpClient::verifyServer(bool verify)
{ {
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYHOST, verify ? 2 : 0); curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYHOST, verify ? 2 : 0);
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYPEER, verify ? 1 : 0); curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYPEER, verify ? 1 : 0);
curl_easy_setopt(_Curl, CURLOPT_SSLCERTTYPE, "PEM"); curl_easy_setopt(_Curl, CURLOPT_SSLCERTTYPE, "PEM");
//curl_easy_setopt(_Curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); // would allow to provide the CA in memory instead of using CURLOPT_CAINFO, but needs to include and link OpenSSL // would allow to provide the CA in memory instead of using CURLOPT_CAINFO, but needs to include and link OpenSSL
string path = CPath::lookup(CAFilename); curl_easy_setopt(_Curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);
nldebug("cert path '%s'", path.c_str()); // don't use that anymore, because CA can't be loaded from BNP and doesn't support UTF-8 under Windows
curl_easy_setopt(_Curl, CURLOPT_CAINFO, path.c_str()); // curl_easy_setopt(_Curl, CURLOPT_CAINFO, path.c_str());
curl_easy_setopt(_Curl, CURLOPT_CAPATH, NULL); curl_easy_setopt(_Curl, CURLOPT_CAPATH, NULL);
return true; return true;
} }

@ -271,7 +271,7 @@ static INT_PTR CALLBACK ExitClientErrorDialogProc(HWND hwndDlg, UINT uMsg, WPARA
GetWindowRect (GetDesktopWindow (), &rectDesktop); GetWindowRect (GetDesktopWindow (), &rectDesktop);
SetWindowPos (hwndDlg, HWND_TOPMOST, (rectDesktop.right-rectDesktop.left-rect.right+rect.left)/2, (rectDesktop.bottom-rectDesktop.top-rect.bottom+rect.top)/2, 0, 0, SWP_NOSIZE); SetWindowPos (hwndDlg, HWND_TOPMOST, (rectDesktop.right-rectDesktop.left-rect.right+rect.left)/2, (rectDesktop.bottom-rectDesktop.top-rect.bottom+rect.top)/2, 0, 0, SWP_NOSIZE);
HICON exitClientDlgIcon = LoadIcon(HInstance, MAKEINTRESOURCE(IDI_MAIN_ICON)); HICON exitClientDlgIcon = LoadIcon(HInstance, MAKEINTRESOURCE(IDI_MAIN_ICON));
::SendMessage(hwndDlg, WM_SETICON, (WPARAM) ICON_BIG, (LPARAM) exitClientDlgIcon); ::SendMessageA(hwndDlg, WM_SETICON, (WPARAM) ICON_BIG, (LPARAM) exitClientDlgIcon);
} }
break; break;
case WM_COMMAND: case WM_COMMAND:

@ -3937,13 +3937,15 @@ public:
s += getSystemInformation(); s += getSystemInformation();
string progname; string progname;
char name[1024] = ""; std::string moduleName;
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
GetModuleFileName (NULL, name, 1023); wchar_t name[1024];
GetModuleFileNameW(NULL, name, 1023);
moduleName = wideToUtf8(name);
#else #else
// TODO for Linux // TODO for Linux
#endif #endif
progname = CFile::getFilename(name); progname = CFile::getFilename(moduleName);
progname += " "; progname += " ";
progname += "Statistic Report"; progname += "Statistic Report";

@ -2704,7 +2704,7 @@ void CInterfaceManager::log(const ucstring &str, const std::string &cat)
{ {
// Open file with the name of the player // Open file with the name of the player
const string fileName= "save/log_" + PlayerSelectedFileName + ".txt"; const string fileName= "save/log_" + PlayerSelectedFileName + ".txt";
FILE *f = fopen(fileName.c_str(), "at"); FILE *f = nlfopen(fileName, "at");
if (f != NULL) if (f != NULL)
{ {
const string finalString = string(NLMISC::IDisplayer::dateToHumanString()) + " (" + NLMISC::toUpper(cat) + ") * " + str.toUtf8(); const string finalString = string(NLMISC::IDisplayer::dateToHumanString()) + " (" + NLMISC::toUpper(cat) + ") * " + str.toUtf8();

@ -196,11 +196,6 @@ public:
InitMouseWithCursor (true); InitMouseWithCursor (true);
Driver->showCursor (true); Driver->showCursor (true);
if (false) //supportUnicode())
{
}
else
{
bool oggSupported = false; bool oggSupported = false;
bool mp3Supported = false; bool mp3Supported = false;
@ -219,12 +214,12 @@ public:
std::vector<std::string> filters; std::vector<std::string> filters;
// supported formats // supported formats
filters.push_back("All Supported Files"); filters.push_back("All Supported Files"); // TODO: translate
std::string filter; std::string filter;
if (mp3Supported) filter += "*.mp3;*.mp2;*.mp1;"; if (mp3Supported) filter += "*.mp3;*.mp2;*.mp1;";
if (oggSupported) filter += "*.ogg;"; if (oggSupported) filter += "*.ogg;";
filter += "*.m3u"; filter += "*.m3u;*.m3u8";
filters.push_back(filter); filters.push_back(filter);
@ -243,8 +238,8 @@ public:
} }
// playlist // playlist
filters.push_back("Playlist Files (*.m3u)"); filters.push_back("Playlist Files (*.m3u;*.m3u8)");
filters.push_back("*.m3u"); filters.push_back("*.m3u;*.m3u8");
// all files // all files
filters.push_back("All Files (*.*)"); filters.push_back("All Files (*.*)");
@ -252,23 +247,23 @@ public:
filters.push_back(""); filters.push_back("");
static char szFilter[1024] = { '\0' }; static wchar_t szFilter[1024] = { '\0' };
uint offset = 0; uint offset = 0;
for(uint i = 0; i < filters.size(); ++i) for(uint i = 0; i < filters.size(); ++i)
{ {
strcpy(szFilter + offset, filters[i].c_str()); wcscpy(szFilter + offset, utf8ToWide(filters[i]));
// move offset to string length + 1 for \0 // move offset to string length + 1 for \0
offset += filters[i].length() + 1; offset += filters[i].length() + 1;
} }
// Filename buffer // Filename buffer
char buffer[65535]; wchar_t buffer[1024];
buffer[0]=0; buffer[0]=0;
OPENFILENAME ofn; OPENFILENAMEW ofn;
memset (&ofn, 0, sizeof(OPENFILENAME)); memset (&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME); ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = Driver ? Driver->getDisplay():NULL; ofn.hwndOwner = Driver ? Driver->getDisplay():NULL;
@ -277,25 +272,27 @@ public:
ofn.nFilterIndex = 0; ofn.nFilterIndex = 0;
ofn.lpstrFile = buffer; ofn.lpstrFile = buffer;
ofn.nMaxFile = sizeof(buffer); ofn.nMaxFile = sizeof(buffer);
ofn.lpstrTitle = "Play songs"; ofn.lpstrTitle = (wchar_t*)NLMISC::CI18N::get("uiPlaySongs").c_str();
ofn.Flags = OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT|OFN_ENABLESIZING|OFN_EXPLORER; ofn.Flags = OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT|OFN_ENABLESIZING|OFN_EXPLORER;
if (Driver) if (Driver)
Driver->beginDialogMode(); Driver->beginDialogMode();
if (GetOpenFileName (&ofn)) if (GetOpenFileNameW (&ofn))
{ {
bool useUtf8 = false;
// Skip the directory name // Skip the directory name
const char *bufferPtr = buffer; const wchar_t *bufferPtr = buffer;
// Multi filename ? // Multi filename ?
string path; string path;
if (ofn.nFileOffset>strlen(buffer)) if (ofn.nFileOffset>wcslen(buffer))
{ {
// Backup the path and point to the next filename // Backup the path and point to the next filename
path = buffer; path = wideToUtf8(buffer);
path += "\\"; path += "\\";
bufferPtr+=strlen(bufferPtr)+1; bufferPtr += wcslen(bufferPtr)+1;
} }
// Get selected files and playlists // Get selected files and playlists
@ -304,32 +301,50 @@ public:
while (*bufferPtr) while (*bufferPtr)
{ {
// Concat the directory name with the filename // Concat the directory name with the filename
if (toLower(CFile::getExtension(bufferPtr)) == "m3u") std::string ext = toLower(CFile::getExtension(wideToUtf8(bufferPtr)));
playlists.push_back (path+bufferPtr); if (ext == "m3u" || ext == "m3u8")
{
playlists.push_back (path + wideToUtf8(bufferPtr));
}
else else
filenames.push_back (path+bufferPtr); {
bufferPtr+=strlen(bufferPtr)+1; filenames.push_back (path + wideToUtf8(bufferPtr));
}
bufferPtr += wcslen(bufferPtr) + 1;
} }
// Sort songs by filename // Sort songs by filename
sort (filenames.begin(), filenames.end()); sort (filenames.begin(), filenames.end());
static uint8 utf8Header[] = { 0xefu, 0xbbu, 0xbfu };
// Add playlist // Add playlist
uint i; uint i;
for (i=0; i<playlists.size(); i++) for (i=0; i<playlists.size(); i++)
{ {
// Get the path of the playlist // Get the path of the playlist
string basePlaylist = CFile::getPath (playlists[i]); string basePlaylist = CFile::getPath (playlists[i]);
FILE *file = fopen (playlists[i].c_str(), "r"); FILE *file = nlfopen (playlists[i], "r");
bool useUtf8 = CFile::getExtension(playlists[i]) == "m3u8";
if (file) if (file)
{ {
char line[512]; char line[512];
while (fgets (line, 512, file)) while (fgets (line, 512, file))
{ {
// Not a comment line // Not a comment line
string lineStr = trim (std::string(line)); string lineStr = trim(std::string(line));
// id a UTF-8 BOM header is present, parse as UTF-8
if (!useUtf8 && lineStr.length() >= 3 && memcmp(line, utf8Header, 3) == 0)
useUtf8 = true;
if (!useUtf8) lineStr = ucstring(line).toUtf8();
if (lineStr[0] != '#') if (lineStr[0] != '#')
filenames.push_back (basePlaylist+lineStr); filenames.push_back (CPath::makePathAbsolute(lineStr, basePlaylist));
} }
fclose (file); fclose (file);
} }
@ -350,7 +365,6 @@ public:
if (Driver) if (Driver)
Driver->endDialogMode(); Driver->endDialogMode();
}
// Restore mouse // Restore mouse
InitMouseWithCursor (wasHardware); InitMouseWithCursor (wasHardware);

@ -1787,7 +1787,7 @@ class CAHReboot : public IActionHandler
} }
catch (const std::exception &e) catch (const std::exception &e)
{ {
im->messageBoxWithHelp(ucstring(e.what()), "ui:login", "login_quit"); im->messageBoxWithHelp(ucstring::makeFromUtf8(e.what()), "ui:login", "login_quit");
} }
} }
}; };
@ -1857,17 +1857,7 @@ class CAHOpenURL : public IActionHandler
// TODO: for Linux and Mac OS // TODO: for Linux and Mac OS
#endif #endif
/* if (sParams == "cfg_EditAccountURL")
if (sParams == "cfg_CreateAccountURL")
{
url = ClientCfg.CreateAccountURL;
if (!installTag.empty())
{
url += string("/?from=")+installTag;
}
}
else */if (sParams == "cfg_EditAccountURL")
{ {
url = ClientCfg.EditAccountURL; url = ClientCfg.EditAccountURL;
} }
@ -1896,6 +1886,10 @@ class CAHOpenURL : public IActionHandler
{ {
url = ClientCfg.ConditionsTermsURL; url = ClientCfg.ConditionsTermsURL;
} }
else if (sParams == "cfg_NamingPolicyURL")
{
url = ClientCfg.NamingPolicyURL;
}
else else
{ {
nlwarning("no URL found"); nlwarning("no URL found");

@ -119,14 +119,20 @@ CPatchManager::CPatchManager() : State("t_state"), DataScanState("t_data_scan_st
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
UpdateBatchFilename = "updt_nl.bat"; UpdateBatchFilename = "updt_nl.bat";
UpgradeBatchFilename = "upgd_nl.bat";
#else #else
UpdateBatchFilename = "updt_nl.sh"; UpdateBatchFilename = "updt_nl.sh";
UpgradeBatchFilename = "upgd_nl.sh";
#endif #endif
// use application directory by default std::string rootPath;
std::string rootPath = Args.getProgramPath();
if (!CFile::fileExists(rootPath + "client_default.cfg")) if (ClientCfg.getDefaultConfigLocation(rootPath))
{
// use same directory as client_default.cfg
rootPath = CFile::getPath(rootPath);
}
else
{ {
// use current directory // use current directory
rootPath = CPath::getCurrentPath(); rootPath = CPath::getCurrentPath();
@ -161,18 +167,18 @@ CPatchManager::CPatchManager() : State("t_state"), DataScanState("t_data_scan_st
ForceRemovePatchCategories.push_back("main_exedll_linux64"); ForceRemovePatchCategories.push_back("main_exedll_linux64");
ForceRemovePatchCategories.push_back("main_exedll_osx"); ForceRemovePatchCategories.push_back("main_exedll_osx");
#elif defined(NL_OS_WIN32) #elif defined(NL_OS_WIN32)
ForceRemovePatchCategories.push_back("main_exedll_win34"); ForceRemovePatchCategories.push_back("main_exedll_win64");
ForceRemovePatchCategories.push_back("main_exedll_linux32"); ForceRemovePatchCategories.push_back("main_exedll_linux32");
ForceRemovePatchCategories.push_back("main_exedll_linux64"); ForceRemovePatchCategories.push_back("main_exedll_linux64");
ForceRemovePatchCategories.push_back("main_exedll_osx"); ForceRemovePatchCategories.push_back("main_exedll_osx");
#elif defined(NL_OS_APPLE) #elif defined(NL_OS_MAC)
ForceRemovePatchCategories.push_back("main_exedll_win32"); ForceRemovePatchCategories.push_back("main_exedll_win32");
ForceRemovePatchCategories.push_back("main_exedll_win34"); ForceRemovePatchCategories.push_back("main_exedll_win64");
ForceRemovePatchCategories.push_back("main_exedll_linux32"); ForceRemovePatchCategories.push_back("main_exedll_linux32");
ForceRemovePatchCategories.push_back("main_exedll_linux64"); ForceRemovePatchCategories.push_back("main_exedll_linux64");
#elif defined(NL_OS_UNIX) && defined(_LP64) #elif defined(NL_OS_UNIX) && defined(_LP64)
ForceRemovePatchCategories.push_back("main_exedll_win32"); ForceRemovePatchCategories.push_back("main_exedll_win32");
ForceRemovePatchCategories.push_back("main_exedll_win34"); ForceRemovePatchCategories.push_back("main_exedll_win64");
ForceRemovePatchCategories.push_back("main_exedll_linux32"); ForceRemovePatchCategories.push_back("main_exedll_linux32");
ForceRemovePatchCategories.push_back("main_exedll_osx"); ForceRemovePatchCategories.push_back("main_exedll_osx");
#else #else
@ -189,6 +195,12 @@ void CPatchManager::setClientRootPath(const std::string& clientRootPath)
ClientRootPath = CPath::standardizePath(clientRootPath); ClientRootPath = CPath::standardizePath(clientRootPath);
ClientPatchPath = CPath::standardizePath(ClientRootPath + "unpack"); ClientPatchPath = CPath::standardizePath(ClientRootPath + "unpack");
// Delete the .sh file because it's not useful anymore
std::string fullUpdateBatchFilename = ClientRootPath + UpdateBatchFilename;
if (NLMISC::CFile::fileExists(fullUpdateBatchFilename))
NLMISC::CFile::deleteFile(fullUpdateBatchFilename);
WritableClientDataPath = CPath::standardizePath(ClientRootPath + "data"); WritableClientDataPath = CPath::standardizePath(ClientRootPath + "data");
#ifdef NL_OS_MAC #ifdef NL_OS_MAC
@ -698,7 +710,7 @@ bool CPatchManager::getThreadState (ucstring &stateOut, vector<ucstring> &stateL
// verbose log // verbose log
if (isVerboseLog() && !stateLogOut.empty()) if (isVerboseLog() && !stateLogOut.empty())
for (uint32 i = 0; i < stateLogOut.size(); ++i) for (uint32 i = 0; i < stateLogOut.size(); ++i)
nlinfo("%s", stateLogOut[i].toString().c_str()); nlinfo("%s", stateLogOut[i].toUtf8().c_str());
return changed; return changed;
} }
@ -737,15 +749,21 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
{ {
// For all optional categories check if there is a 'file to patch' in it // For all optional categories check if there is a 'file to patch' in it
const CBNPCategory &rCat = rDescCats.getCategory(i); const CBNPCategory &rCat = rDescCats.getCategory(i);
nlwarning("Category = %s", rCat.getName().c_str());
nlinfo("Category = %s", rCat.getName().c_str());
if (!rCat.getUnpackTo().empty()) if (!rCat.getUnpackTo().empty())
for (uint32 j = 0; j < rCat.fileCount(); ++j) for (uint32 j = 0; j < rCat.fileCount(); ++j)
{ {
string rFilename = ClientPatchPath + rCat.getFile(j); string rFilename = ClientPatchPath + rCat.getFile(j);
nlwarning("\tFileName = %s", rFilename.c_str());
nlinfo("\tFileName = %s", rFilename.c_str());
// Extract to patch // Extract to patch
vector<string> vFilenames; vector<string> vFilenames;
bool result = false; bool result = false;
try try
{ {
result = bnpUnpack(rFilename, ClientPatchPath, vFilenames); result = bnpUnpack(rFilename, ClientPatchPath, vFilenames);
@ -766,45 +784,62 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
{ {
for (uint32 fff = 0; fff < vFilenames.size (); fff++) for (uint32 fff = 0; fff < vFilenames.size (); fff++)
{ {
string SrcPath = ClientPatchPath;
string DstPath = CPath::standardizePath(rCat.getUnpackTo()); // to be sure there is a / at the end
NLMISC::CFile::createDirectoryTree(DstPath);
// this file must be moved // this file must be moved
#ifdef NL_OS_WINDOWS string fullDstPath = CPath::standardizePath(rCat.getUnpackTo()); // to be sure there is a / at the end
SrcPath = CPath::standardizeDosPath(SrcPath); NLMISC::CFile::createDirectoryTree(fullDstPath);
DstPath = CPath::standardizeDosPath(DstPath);
#endif
std::string SrcName = SrcPath + vFilenames[fff]; std::string FileName = vFilenames[fff];
std::string DstName = DstPath + vFilenames[fff];
bool succeeded = false; bool succeeded = false;
if (!useBatchFile) if (!useBatchFile)
{ {
// don't check result, because it's possible the olk file doesn't exist // don't check result, because it's possible the olk file doesn't exist
CFile::deleteFile(DstName); CFile::deleteFile(fullDstPath + FileName);
// try to move it, if fails move it later in a script // try to move it, if fails move it later in a script
if (CFile::moveFile(DstName, SrcName)) if (CFile::moveFile(fullDstPath + FileName, ClientPatchPath + FileName))
succeeded = true; succeeded = true;
} }
// if we didn't succeed to delete or move the file, create a batch file anyway // if we didn't succeed to delete or move the file, create a batch file anyway
if (!succeeded) if (!succeeded)
{ {
// write windows .bat format else write sh format string batchRelativeDstPath;
// should be always true
if (fullDstPath.compare(0, ClientRootPath.length(), ClientRootPath) == 0)
{
batchRelativeDstPath = fullDstPath.substr(ClientRootPath.length()) + FileName;
}
else
{
batchRelativeDstPath = fullDstPath + FileName;
}
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
// only fix backslashes for .bat
batchRelativeDstPath = CPath::standardizeDosPath(batchRelativeDstPath);
// use DSTPATH and SRCPATH variables and append filenames
string realDstPath = toString("\"%%ROOTPATH%%\\%s\"", batchRelativeDstPath.c_str());
string realSrcPath = toString("\"%%UNPACKPATH%%\\%s\"", FileName.c_str());
content += toString(":loop%u\n", nblab); content += toString(":loop%u\n", nblab);
content += toString("attrib -r -a -s -h \"%s\"\n", DstName.c_str()); content += toString("attrib -r -a -s -h %s\n", realDstPath.c_str());
content += toString("del \"%s\"\n", DstName.c_str()); content += toString("del %s\n", realDstPath.c_str());
content += toString("if exist \"%s\" goto loop%u\n", DstName.c_str(), nblab); content += toString("if exist %s goto loop%u\n", realDstPath.c_str(), nblab);
content += toString("move \"%s\" \"%s\"\n", SrcName.c_str(), DstPath.c_str()); content += toString("move %s %s\n", realSrcPath.c_str(), realDstPath.c_str());
#else #else
content += toString("rm -rf \"%s\"\n", DstName.c_str()); // use DSTPATH and SRCPATH variables and append filenames
content += toString("mv %s \"%s\"\n", SrcName.c_str(), DstPath.c_str()); string realDstPath = toString("\"$ROOTPATH/%s\"", batchRelativeDstPath.c_str());
string realSrcPath = toString("\"$UNPACKPATH/%s\"", FileName.c_str());
content += toString("rm -rf %s\n", realDstPath.c_str());
content += toString("mv %s %s\n", realSrcPath.c_str(), realDstPath.c_str());
#endif #endif
content += "\n";
} }
nblab++; nblab++;
@ -813,7 +848,7 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
} }
} }
std::string patchDirectory = CPath::standardizeDosPath(ClientRootPath + "patch"); std::string patchDirectory = CPath::standardizePath(ClientRootPath + "patch");
// Finalize batch file // Finalize batch file
if (NLMISC::CFile::isExists(patchDirectory) && NLMISC::CFile::isDirectory(patchDirectory)) if (NLMISC::CFile::isExists(patchDirectory) && NLMISC::CFile::isDirectory(patchDirectory))
@ -837,9 +872,9 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
if (!succeeded) if (!succeeded)
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
patchContent += toString("del \"%s\"\n", CPath::standardizeDosPath(vFileList[i]).c_str()); patchContent += toString("del \"%%ROOTPATH%%\\patch\\%s\"\n", vFileList[i].c_str());
#else #else
patchContent += toString("rm -f \"%s\"\n", CPath::standardizePath(vFileList[i]).c_str()); patchContent += toString("rm -f \"$ROOTPATH/patch/%s\"\n", vFileList[i].c_str());
#endif #endif
} }
} }
@ -847,14 +882,14 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
if (!patchContent.empty()) if (!patchContent.empty())
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
content += toString(":looppatch\n"); content += ":looppatch\n";
content += patchContent; content += patchContent;
content += toString("rd /Q /S \"" + patchDirectory + "\"\n"); content += "rd /Q /S \"%%ROOTPATH%%\\patch\"\n";
content += toString("if exist \"" + patchDirectory + "\" goto looppatch\n"); content += "if exist \"%%ROOTPATH%%\\patch\" goto looppatch\n";
#else #else
content += toString("rm -rf \"" + patchDirectory + "\"\n"); content += "rm -rf \"$ROOTPATH/patch\"\n";
#endif #endif
} }
else else
@ -867,9 +902,11 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
{ {
deleteBatchFile(); deleteBatchFile();
// batch full path
std::string batchFilename = ClientRootPath + UpdateBatchFilename; std::string batchFilename = ClientRootPath + UpdateBatchFilename;
FILE *fp = fopen (batchFilename.c_str(), "wt"); // write windows .bat format else write sh format
FILE *fp = nlfopen (batchFilename, "wt");
if (fp == NULL) if (fp == NULL)
{ {
@ -877,31 +914,79 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
throw Exception (err); throw Exception (err);
} }
string contentPrefix;
//use bat if windows if not use sh //use bat if windows if not use sh
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
fprintf(fp, "@echo off\n"); contentPrefix += "@echo off\n";
contentPrefix += "set RYZOM_CLIENT=\"%1\"\n";
contentPrefix += "set UNPACKPATH=\"%2\"\n";
contentPrefix += "set ROOTPATH=\"%3\"\n";
contentPrefix += toString("set UPGRADE_FILE=\"%%ROOTPATH%%\\%s\"\n", UpgradeBatchFilename.c_str());
contentPrefix += "\n";
contentPrefix += "set LOGIN=%4\n";
contentPrefix += "set PASSWORD=%5\n";
contentPrefix += "set SHARDID=%6\n";
#else #else
fprintf(fp, "#!/bin/sh\n"); contentPrefix += "#!/bin/sh\n";
contentPrefix += "export RYZOM_CLIENT=$1\n";
contentPrefix += "export UNPACKPATH=$2\n";
contentPrefix += "export ROOTPATH=$3\n";
contentPrefix += toString("export UPGRADE_FILE=$ROOTPATH/%s\n", UpgradeBatchFilename.c_str());
contentPrefix += "\n";
contentPrefix += "LOGIN=$4\n";
contentPrefix += "PASSWORD=$5\n";
contentPrefix += "SHARDID=$6\n";
#endif #endif
// append content of script contentPrefix += "\n";
fprintf(fp, content.c_str());
if (wantRyzomRestart) string contentSuffix;
// if we need to restart Ryzom, we need to launch it in batch
std::string additionalParams;
if (Args.haveLongArg("profile"))
{ {
additionalParams = "--profile " + Args.getLongArg("profile").front();
}
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
fprintf(fp, "start \"\" \"%s\" %%1 %%2 %%3\n", CPath::standardizeDosPath(RyzomFilename).c_str()); // launch upgrade script if present (it'll execute additional steps like moving or deleting files)
contentSuffix += "if exist \"%UPGRADE_FILE%\" call \"%UPGRADE_FILE%\"\n";
if (wantRyzomRestart)
{
// client shouldn't be in memory anymore else it couldn't be overwritten
contentSuffix += toString("start \"\" /D \"%%ROOTPATH%%\" \"%%RYZOM_CLIENT%%\" %s %%LOGIN%% %%PASSWORD%% %%SHARDID%%\n", additionalParams.c_str());
}
#else #else
// wait until client is not in memory if (wantRyzomRestart)
fprintf(fp, "until ! pgrep %s > /dev/null; do sleep 1; done\n", CFile::getFilename(RyzomFilename).c_str()); {
// wait until client not in memory anymore
contentSuffix += toString("until ! pgrep %s > /dev/null; do sleep 1; done\n", CFile::getFilename(RyzomFilename).c_str());
}
// launch upgrade script if present (it'll execute additional steps like moving or deleting files)
contentSuffix += "if [ -e \"$UPGRADE_FILE\" ]; then chmod +x \"$UPGRADE_FILE\" && \"$UPGRADE_FILE\"; fi\n\n";
// be sure file is executable // be sure file is executable
fprintf(fp, "chmod +x \"%s\"\n", RyzomFilename.c_str()); contentSuffix += "chmod +x \"$RYZOM_CLIENT\"\n\n";
if (wantRyzomRestart)
{
// change to previous client directory
contentSuffix += "cd \"$ROOTPATH\"\n\n";
// launch new client // launch new client
fprintf(fp, "\"%s\" $1 $2 $3\n", RyzomFilename.c_str()); contentSuffix += toString("\"$RYZOM_CLIENT\" %s $LOGIN $PASSWORD $SHARDID\n", additionalParams.c_str());
#endif
} }
#endif
// append content of script
fputs(contentPrefix.c_str(), fp);
fputs(content.c_str(), fp);
fputs(contentSuffix.c_str(), fp);
bool writeError = ferror(fp) != 0; bool writeError = ferror(fp) != 0;
bool diskFull = ferror(fp) && errno == 28 /* ENOSPC */; bool diskFull = ferror(fp) && errno == 28 /* ENOSPC */;
@ -940,19 +1025,40 @@ void CPatchManager::executeBatchFile()
batchFilename += UpdateBatchFilename; batchFilename += UpdateBatchFilename;
#ifdef NL_OS_UNIX // make script executable
// make script executable under UNIX CFile::setRWAccess(batchFilename);
chmod(batchFilename.c_str(), S_IRWXU);
std::vector<std::string> arguments;
// 3 first parameters are Ryzom client full path, patch directory full path and client root directory full path
#ifdef NL_OS_WINDOWS
arguments.push_back(CPath::standardizeDosPath(RyzomFilename));
arguments.push_back(CPath::standardizeDosPath(ClientPatchPath));
arguments.push_back(CPath::standardizeDosPath(ClientRootPath));
#else
arguments.push_back(RyzomFilename);
arguments.push_back(ClientPatchPath);
arguments.push_back(ClientRootPath);
#endif #endif
std::string arguments = LoginLogin + " " + LoginPassword; // append login, password and shard
if (!LoginLogin.empty())
{
arguments.push_back(LoginLogin);
if (!LoginPassword.empty())
{
arguments.push_back(LoginPassword);
if (!r2Mode) if (!r2Mode)
{ {
arguments += " " + toString(LoginShardId); arguments.push_back(toString(LoginShardId));
}
}
} }
if (!launchProgram(batchFilename, arguments, false)) // launchProgram with array of strings as argument will escape arguments with spaces
if (!launchProgramArray(batchFilename, arguments, false))
{ {
// error occurs during the launch // error occurs during the launch
string str = toString("Can't execute '%s': code=%d %s (error code 30)", batchFilename.c_str(), errno, strerror(errno)); string str = toString("Can't execute '%s': code=%d %s (error code 30)", batchFilename.c_str(), errno, strerror(errno));
@ -1025,7 +1131,7 @@ void CPatchManager::setRWAccess (const string &filename, bool bThrowException)
{ {
s = CI18N::get("uiAttribErr") + " " + CFile::getFilename(filename) + " (" + toString(errno) + "," + strerror(errno) + ")"; s = CI18N::get("uiAttribErr") + " " + CFile::getFilename(filename) + " (" + toString(errno) + "," + strerror(errno) + ")";
setState(true, s); setState(true, s);
throw Exception (s.toString()); throw Exception (s.toUtf8());
} }
} }
@ -1039,7 +1145,7 @@ string CPatchManager::deleteFile (const string &filename, bool bThrowException,
{ {
s = CI18N::get("uiDelNoFile"); s = CI18N::get("uiDelNoFile");
setState(true, s); setState(true, s);
return s.toString(); return s.toUtf8();
} }
if (!NLMISC::CFile::deleteFile(filename)) if (!NLMISC::CFile::deleteFile(filename))
@ -1048,8 +1154,8 @@ string CPatchManager::deleteFile (const string &filename, bool bThrowException,
if(bWarning) if(bWarning)
setState(true, s); setState(true, s);
if(bThrowException) if(bThrowException)
throw Exception (s.toString()); throw Exception (s.toUtf8());
return s.toString(); return s.toUtf8();
} }
return ""; return "";
} }
@ -1064,7 +1170,7 @@ void CPatchManager::renameFile (const string &src, const string &dst)
{ {
s = CI18N::get("uiRenameErr") + " " + src + " -> " + dst + " (" + toString(errno) + "," + strerror(errno) + ")"; s = CI18N::get("uiRenameErr") + " " + src + " -> " + dst + " (" + toString(errno) + "," + strerror(errno) + ")";
setState(true, s); setState(true, s);
throw Exception (s.toString()); throw Exception (s.toUtf8());
} }
} }
@ -1302,7 +1408,7 @@ void CPatchManager::downloadFileWithCurl (const string &source, const string &de
setRWAccess(dest, false); setRWAccess(dest, false);
NLMISC::CFile::deleteFile(dest.c_str()); NLMISC::CFile::deleteFile(dest.c_str());
} }
FILE *fp = fopen (dest.c_str(), "wb"); FILE *fp = nlfopen (dest, "wb");
if (fp == NULL) if (fp == NULL)
{ {
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL); curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL);
@ -1441,8 +1547,8 @@ void CPatchManager::decompressFile (const string &filename)
string dest = filename.substr(0, filename.size ()-4); string dest = filename.substr(0, filename.size ()-4);
setRWAccess(dest, false); setRWAccess(dest, false);
//if(isVerboseLog()) nlinfo("Calling fopen('%s','wb')", dest.c_str()); //if(isVerboseLog()) nlinfo("Calling nlfopen('%s','wb')", dest.c_str());
FILE *fp = fopen (dest.c_str(), "wb"); FILE *fp = nlfopen (dest, "wb");
if (fp == NULL) if (fp == NULL)
{ {
string err = toString("Can't open file '%s' : code=%d %s, (error code 32)", dest.c_str(), errno, strerror(errno)); string err = toString("Can't open file '%s' : code=%d %s, (error code 32)", dest.c_str(), errno, strerror(errno));
@ -1512,21 +1618,18 @@ void CPatchManager::applyDate (const string &sFilename, uint32 nDate)
// change the file time // change the file time
if(nDate != 0) if(nDate != 0)
{ {
// _utimbuf utb;
// utb.actime = utb.modtime = nDate;
setRWAccess(sFilename, false); setRWAccess(sFilename, false);
ucstring s = CI18N::get("uiChangeDate") + " " + NLMISC::CFile::getFilename(sFilename) + " " + toString(NLMISC::CFile::getFileModificationDate (sFilename)) + ucstring s = CI18N::get("uiChangeDate") + " " + NLMISC::CFile::getFilename(sFilename) + " " + timestampToHumanReadable(NLMISC::CFile::getFileModificationDate (sFilename)) +
" -> " + toString(nDate); " -> " + timestampToHumanReadable(nDate);
setState(true,s); setState(true,s);
if (!NLMISC::CFile::setFileModificationDate(sFilename, nDate)) if (!NLMISC::CFile::setFileModificationDate(sFilename, nDate))
// if (_utime (sFilename.c_str (), &utb) == -1)
{ {
int err = NLMISC::getLastError(); int err = NLMISC::getLastError();
s = CI18N::get("uiChgDateErr") + " " + sFilename + " (" + toString(err) + ", " + formatErrorMessage(err) + ")"; s = CI18N::get("uiChgDateErr") + " " + CFile::getFilename(sFilename) + " (" + toString(err) + ", " + formatErrorMessage(err) + ")";
setState(true,s); setState(true,s);
} }
s = CI18N::get("uiNowDate") + " " + sFilename + " " + toString(NLMISC::CFile::getFileModificationDate (sFilename)); s = CI18N::get("uiNowDate") + " " + CFile::getFilename(sFilename) + " " + timestampToHumanReadable(NLMISC::CFile::getFileModificationDate (sFilename));
setState(true,s); setState(true,s);
} }
} }
@ -1744,7 +1847,7 @@ bool CPatchManager::bnpUnpack(const string &srcBigfile, const string &dstPath, v
if (!bnpFile.readHeader()) if (!bnpFile.readHeader())
{ {
ucstring s = CI18N::get("uiUnpackErrHead") + " " + SourceName; ucstring s = CI18N::get("uiUnpackErrHead") + " " + CFile::getFilename(SourceName);
setState(true,s); setState(true,s);
return false; return false;
} }
@ -1783,14 +1886,14 @@ int CPatchManager::validateProgress(void *foo, double t, double d, double /* ult
if (units.empty()) if (units.empty())
{ {
units.push_back("B"); // there is no translation for byte unit... units.push_back(CI18N::get("uiByte").toUtf8());
units.push_back(CI18N::get("uiKb").toUtf8()); units.push_back(CI18N::get("uiKb").toUtf8());
units.push_back(CI18N::get("uiMb").toUtf8()); units.push_back(CI18N::get("uiMb").toUtf8());
} }
CPatchManager *pPM = CPatchManager::getInstance(); CPatchManager *pPM = CPatchManager::getInstance();
double pour1 = t!=0.0?d*100.0/t:0.0; double pour1 = t!=0.0?d*100.0/t:0.0;
ucstring sTranslate = CI18N::get("uiLoginGetFile") + ucstring::makeFromUtf8(toString(" %s : %s / %s (%5.02f %%)", NLMISC::CFile::getFilename(pPM->CurrentFile).c_str(), ucstring sTranslate = CI18N::get("uiLoginGetFile") + ucstring::makeFromUtf8(toString(" %s : %s / %s (%.02f %%)", NLMISC::CFile::getFilename(pPM->CurrentFile).c_str(),
NLMISC::bytesToHumanReadableUnits((uint64)d, units).c_str(), NLMISC::bytesToHumanReadableUnits((uint64)t, units).c_str(), pour1)); NLMISC::bytesToHumanReadableUnits((uint64)d, units).c_str(), NLMISC::bytesToHumanReadableUnits((uint64)t, units).c_str(), pour1));
pPM->setState(false, sTranslate); pPM->setState(false, sTranslate);
if (foo) if (foo)
@ -1805,7 +1908,7 @@ void CPatchManager::MyPatchingCB::progress(float f)
{ {
CPatchManager *pPM = CPatchManager::getInstance(); CPatchManager *pPM = CPatchManager::getInstance();
double p = 100.0*f; double p = 100.0*f;
ucstring sTranslate = CI18N::get("uiApplyingDelta") + toString(" %s (%5.02f %%)", CFile::getFilename(patchFilename).c_str(), p); ucstring sTranslate = CI18N::get("uiApplyingDelta") + ucstring::makeFromUtf8(toString(" %s (%.02f %%)", CFile::getFilename(patchFilename).c_str(), p));
pPM->setState(false, sTranslate); pPM->setState(false, sTranslate);
} }
@ -1981,7 +2084,7 @@ void CPatchManager::clearDataScanLog()
// *************************************************************************** // ***************************************************************************
void CPatchManager::getCorruptedFileInfo(const SFileToPatch &ftp, ucstring &sTranslate) void CPatchManager::getCorruptedFileInfo(const SFileToPatch &ftp, ucstring &sTranslate)
{ {
sTranslate = CI18N::get("uiCorruptedFile") + " " + ftp.FileName + " (" + sTranslate = CI18N::get("uiCorruptedFile") + " " + ucstring::makeFromUtf8(ftp.FileName) + " (" +
toString("%.1f ", (float)ftp.FinalFileSize/1000000.f) + CI18N::get("uiMb") + ")"; toString("%.1f ", (float)ftp.FinalFileSize/1000000.f) + CI18N::get("uiMb") + ")";
} }
@ -2068,7 +2171,7 @@ void CCheckThread::run ()
for (i = 0; i < rDescFiles.fileCount(); ++i) for (i = 0; i < rDescFiles.fileCount(); ++i)
{ {
CPatchManager::SFileToPatch ftp; CPatchManager::SFileToPatch ftp;
sTranslate = CI18N::get("uiCheckingFile") + " " + rDescFiles.getFile(i).getFileName(); sTranslate = CI18N::get("uiCheckingFile") + " " + ucstring::makeFromUtf8(rDescFiles.getFile(i).getFileName());
pPM->setState(true, sTranslate); pPM->setState(true, sTranslate);
// get list of patch to apply to this file. don't to a full checksum test if possible // get list of patch to apply to this file. don't to a full checksum test if possible
nlwarning(rDescFiles.getFile(i).getFileName().c_str()); nlwarning(rDescFiles.getFile(i).getFileName().c_str());
@ -2192,7 +2295,7 @@ void CCheckThread::run ()
if (bnpFile.readHeader()) if (bnpFile.readHeader())
{ {
// read the file inside the bnp and calculate the sha1 // read the file inside the bnp and calculate the sha1
FILE *bnp = fopen (sBNPFilename.c_str(), "rb"); FILE *bnp = nlfopen (sBNPFilename, "rb");
if (bnp != NULL) if (bnp != NULL)
{ {
for (uint32 k = 0; k < bnpFile.SFiles.size(); ++k) for (uint32 k = 0; k < bnpFile.SFiles.size(); ++k)
@ -3068,7 +3171,7 @@ bool CPatchManager::extract(const std::string& patchPath,
uint nblab = 0; uint nblab = 0;
pPM->deleteFile(updateBatchFilename, false, false); pPM->deleteFile(updateBatchFilename, false, false);
FILE *fp = fopen (updateBatchFilename.c_str(), "wt"); FILE *fp = nlfopen (updateBatchFilename, "wt");
if (fp == 0) if (fp == 0)
{ {
@ -3080,7 +3183,8 @@ bool CPatchManager::extract(const std::string& patchPath,
fprintf(fp, "@echo off\n"); fprintf(fp, "@echo off\n");
fprintf(fp, "ping 127.0.0.1 -n 7 -w 1000 > nul\n"); // wait fprintf(fp, "ping 127.0.0.1 -n 7 -w 1000 > nul\n"); // wait
#else #else
// TODO: for Linux and OS X fprintf(fp, "#!/bin/sh\n");
fprintf(fp, "sleep 7\n"); // wait
#endif #endif
// Unpack files with category ExtractPath non empty // Unpack files with category ExtractPath non empty

@ -433,6 +433,7 @@ private:
/// Now deprecated : the launcher is the client ryzom /// Now deprecated : the launcher is the client ryzom
std::string RyzomFilename; std::string RyzomFilename;
std::string UpdateBatchFilename; std::string UpdateBatchFilename;
std::string UpgradeBatchFilename;
// Where the client get all delta and desc file // Where the client get all delta and desc file
std::string ClientPatchPath; // Temporary path std::string ClientPatchPath; // Temporary path

@ -95,7 +95,7 @@ bool CXDPFileReader::init(const std::string &sFilename, sint32 nLowerBound, sint
{ {
// First open the file with a normal function // First open the file with a normal function
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
int fd = _open(sFilename.c_str(), _O_BINARY | _O_RDONLY); int fd = _wopen(utf8ToWide(sFilename), _O_BINARY | _O_RDONLY);
#else #else
int fd = open(sFilename.c_str(), O_RDONLY); int fd = open(sFilename.c_str(), O_RDONLY);
#endif #endif
@ -143,7 +143,7 @@ bool CXDPFileReader::init(const std::string &sFilename, sint32 nLowerBound, sint
} }
else else
{ {
_File = fopen(sFilename.c_str(), "rb"); _File = nlfopen(sFilename, "rb");
if (_File == NULL) if (_File == NULL)
return false; return false;
fseek(_File, nLowerBound, SEEK_SET); fseek(_File, nLowerBound, SEEK_SET);
@ -560,7 +560,7 @@ CXDeltaPatch::TApplyResult CXDeltaPatch::apply(const std::string &sFileToPatch,
errorMsg = toString("output file %s already exists", sFileOutput.c_str()); errorMsg = toString("output file %s already exists", sFileOutput.c_str());
return ApplyResult_Error; return ApplyResult_Error;
} }
FILE *outFILE = fopen(sFileOutput.c_str(), "wb"); FILE *outFILE = nlfopen(sFileOutput, "wb");
if (outFILE == NULL) if (outFILE == NULL)
{ {
errorMsg = toString("cant create %s", sFileOutput.c_str()); errorMsg = toString("cant create %s", sFileOutput.c_str());
@ -572,7 +572,7 @@ CXDeltaPatch::TApplyResult CXDeltaPatch::apply(const std::string &sFileToPatch,
bool ftpPresent = false; bool ftpPresent = false;
if (pFromSource) if (pFromSource)
{ {
ftpFILE = fopen(sFileToPatch.c_str(), "rb"); ftpFILE = nlfopen(sFileToPatch, "rb");
if (ftpFILE == NULL) if (ftpFILE == NULL)
{ {
errorMsg = toString("expecting file %s", sFileToPatch.c_str()); errorMsg = toString("expecting file %s", sFileToPatch.c_str());

@ -84,7 +84,7 @@ static void setPermanentBanFileMarker(const std::string &path, bool on)
// simply touch a file // simply touch a file
COFile f(path); COFile f(path);
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
SetFileAttributes(path.c_str(), FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM); SetFileAttributesW(utf8ToWide(path), FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM);
#endif #endif
} }
catch(const EStream &e) catch(const EStream &e)
@ -141,7 +141,7 @@ static void markBNPFile(std::string &path)
uint32 nFileSize=CFile::getFileSize(path); uint32 nFileSize=CFile::getFileSize(path);
if (!nFileSize) return; if (!nFileSize) return;
FILE *f = fopen(path.c_str(), "rb+"); FILE *f = nlfopen(path, "rb+");
if (!f) return; if (!f) return;
// Result // Result
if (nlfseek64 (f, nFileSize-4, SEEK_SET) != 0) if (nlfseek64 (f, nFileSize-4, SEEK_SET) != 0)

@ -1384,7 +1384,7 @@ bool CClientEditionModule::loadUserComponent(const std::string& filename, bool m
uint32 timeStamp = 0; uint32 timeStamp = 0;
if (! compressed) if (! compressed)
{ {
FILE* file = fopen(filename.c_str(),"rb"); FILE* file = nlfopen(filename, "rb");
if (!file) if (!file)
{ {
nlwarning("Try to open an invalid file %s (access error)", filename.c_str()); nlwarning("Try to open an invalid file %s (access error)", filename.c_str());
@ -1491,7 +1491,7 @@ bool CClientEditionModule::loadUserComponent(const std::string& filename, bool m
else else
{ {
// Get Uncompressed File length (4 last byte of a gz) // Get Uncompressed File length (4 last byte of a gz)
FILE* file = fopen(filename.c_str(),"rb"); FILE* file = nlfopen(filename, "rb");
if (!file) if (!file)
{ {
nlwarning("Try to open an invalid file %s (access error)", filename.c_str()); nlwarning("Try to open an invalid file %s (access error)", filename.c_str());
@ -1653,7 +1653,7 @@ void CClientEditionModule::saveUserComponentFile(const std::string& filename, bo
if (!mustCompress) if (!mustCompress)
{ {
{ {
FILE* output = fopen(uncompressedName.c_str(), "wb"); FILE* output = nlfopen(uncompressedName, "wb");
if (output) if (output)
{ {
fwrite(component->UncompressedData, sizeof(char) , component->UncompressedDataLength, output); fwrite(component->UncompressedData, sizeof(char) , component->UncompressedDataLength, output);

@ -154,7 +154,7 @@ bool unpack7Zip(const std::string &sevenZipFile, const std::string &destFileName
SzArEx_GetFileNameUtf16(&db, 0, &filename[0]); SzArEx_GetFileNameUtf16(&db, 0, &filename[0]);
// write the extracted file // write the extracted file
FILE *outputHandle = fopen(destFileName.c_str(), "wb+"); FILE *outputHandle = nlfopen(destFileName, "wb+");
if (outputHandle == 0) if (outputHandle == 0)
{ {

@ -1020,7 +1020,7 @@ void CSheetManager::dumpVisualSlots()
// *************************************************************************** // ***************************************************************************
void CSheetManager::dumpVisualSlotsIndex() void CSheetManager::dumpVisualSlotsIndex()
{ {
FILE * vsIndexFile = fopen(std::string(getLogDirectory() + "vs_index.txt").c_str(),"w"); FILE * vsIndexFile = nlfopen(getLogDirectory() + "vs_index.txt", "w");
if( vsIndexFile ) if( vsIndexFile )
{ {
for (uint i=0; i < SLOTTYPE::NB_SLOT; ++i) for (uint i=0; i < SLOTTYPE::NB_SLOT; ++i)

@ -1028,17 +1028,18 @@ void CSoundManager::loadProperties(const string &soundName, USource *source)
// Search for the file. // Search for the file.
string filePath = CPath::lookup(soundName+".sdf"); string filePath = CPath::lookup(soundName+".sdf");
ifstream file(filePath.c_str(), ios::in);
CIFile file;
// Try to open the file. // Try to open the file.
if(file.is_open()) if (file.open(filePath))
{ {
char tmpBuff[260]; char tmpBuff[260];
char delimiterBox[] = "\t "; char delimiterBox[] = "\t ";
// While the end of the file is not reached. // While the end of the file is not reached.
while(!file.eof()) while(!file.eof())
{ {
// Get a line (teh line should not be more than _MAX_LINE_SIZE). // Get a line (the line should not be more than _MAX_LINE_SIZE).
file.getline(tmpBuff, 260); file.getline(tmpBuff, 260);
char *token = strtok(tmpBuff, delimiterBox); char *token = strtok(tmpBuff, delimiterBox);
while(token != NULL) while(token != NULL)

@ -0,0 +1,15 @@
#!/bin/sh
if [ -z "$ROOTPATH" ]
then
echo "upgd_nl.sh can only be launched from updt_nl.sh"
exit 1
fi
# executable flag for all executables
chmod +x $ROOTPATH/ryzom_client
chmod +x $ROOTPATH/crash_report
chmod +x $ROOTPATH/ryzom_client_patcher
chmod +x $ROOTPATH/ryzom_configuration
exit 0

@ -98,7 +98,7 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="properties" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="properties" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/fauna_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/fauna_zone_properties"/>
<COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//"/> <COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//"/>
<COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//root"/> <COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//root"/>
<COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//property_rep"/> <COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//property_rep"/>
@ -128,7 +128,7 @@
<!-- For now, fauna don't have AI profile--> <!-- For now, fauna don't have AI profile-->
<!-- <PARAMETER NAME= "ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <!-- <PARAMETER NAME= "ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" <COMBO_FILES CONTEXT_NAME="default"
PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_movement"/> </PARAMETER> PATH="L:/leveldesign/world_editor_files/npc/ai_movement"/> </PARAMETER>
--> -->
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
<DYNAMIC_CHILD CLASS_NAME="state_event_handler"/> <DYNAMIC_CHILD CLASS_NAME="state_event_handler"/>
@ -147,7 +147,7 @@
<PARAMETER NAME="group_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="group_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="groups_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="groups_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/event_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/event_type"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
<DYNAMIC_CHILD CLASS_NAME="event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="event_handler_action"/>
@ -159,7 +159,7 @@
<DEFAULT_VALUE VALUE="ACTION_ZONE"/> <DEFAULT_VALUE VALUE="ACTION_ZONE"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="params" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="params" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/fauna_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/fauna_zone_properties"/>
</PARAMETER> </PARAMETER>
</PRIMITIVE> </PRIMITIVE>
@ -175,7 +175,7 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="parameters" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="500" SHOW_HS="true" FILE_EXTENSION="cs"/> <PARAMETER NAME="parameters" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="500" SHOW_HS="true" FILE_EXTENSION="cs"/>
<PARAMETER NAME="action" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="action" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/action_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/action_type"/>
</PARAMETER> </PARAMETER>
<DYNAMIC_CHILD CLASS_NAME="event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="event_handler_action"/>
<DYNAMIC_CHILD CLASS_NAME="action_zone"/> <DYNAMIC_CHILD CLASS_NAME="action_zone"/>
@ -256,6 +256,8 @@
<PARAMETER NAME="name" TYPE="string" VISIBLE="true"/> <PARAMETER NAME="name" TYPE="string" VISIBLE="true"/>
<PARAMETER NAME="require_skill/min_level/max_level" TYPE="string_array" VISIBLE="true"/> <PARAMETER NAME="require_skill/min_level/max_level" TYPE="string_array" VISIBLE="true"/>
<PARAMETER NAME="require_character_age" TYPE="string" VISIBLE="true"/>
<PARAMETER NAME="require_max_player_id" TYPE="string" VISIBLE="true"/>
<PARAMETER NAME="require_mission_done" TYPE="string_array" VISIBLE="true"/> <PARAMETER NAME="require_mission_done" TYPE="string_array" VISIBLE="true"/>
<PARAMETER NAME="require_mission_not_done" TYPE="string_array" VISIBLE="true"/> <PARAMETER NAME="require_mission_not_done" TYPE="string_array" VISIBLE="true"/>
<PARAMETER NAME="require_mission_running" TYPE="string_array" VISIBLE="true"/> <PARAMETER NAME="require_mission_running" TYPE="string_array" VISIBLE="true"/>
@ -688,6 +690,7 @@
<DYNAMIC_CHILD CLASS_NAME="recv_named_item"/> <DYNAMIC_CHILD CLASS_NAME="recv_named_item"/>
<DYNAMIC_CHILD CLASS_NAME="recv_xp"/> <DYNAMIC_CHILD CLASS_NAME="recv_xp"/>
<DYNAMIC_CHILD CLASS_NAME="destroy_item"/> <DYNAMIC_CHILD CLASS_NAME="destroy_item"/>
<DYNAMIC_CHILD CLASS_NAME="unlearn_brick"/>
</PRIMITIVE> </PRIMITIVE>
@ -1027,6 +1030,12 @@
<PARAMETER NAME="guild" TYPE="boolean" VISIBLE="true" /> <PARAMETER NAME="guild" TYPE="boolean" VISIBLE="true" />
</PRIMITIVE> </PRIMITIVE>
<PRIMITIVE CLASS_NAME="unlearn_brick" TYPE="node" AUTO_INIT="false" DELETABLE="true" NUMBERIZE="false">
<PARAMETER NAME="name" TYPE="string" VISIBLE="true" AUTONAME="unlearn_brick $action$"/>
<PARAMETER NAME="bricks" TYPE="string_array" VISIBLE="true"/>
<PARAMETER NAME="npc_name" TYPE="string" VISIBLE="true"/>
<PARAMETER NAME="group" TYPE="boolean" VISIBLE="true"/>
</PRIMITIVE>
<!-- Fin actions --> <!-- Fin actions -->
<!-- *************************************** --> <!-- *************************************** -->
@ -1099,10 +1108,11 @@
<DYNAMIC_CHILD CLASS_NAME="recv_named_item"/> <DYNAMIC_CHILD CLASS_NAME="recv_named_item"/>
<DYNAMIC_CHILD CLASS_NAME="recv_xp"/> <DYNAMIC_CHILD CLASS_NAME="recv_xp"/>
<DYNAMIC_CHILD CLASS_NAME="destroy_item"/> <DYNAMIC_CHILD CLASS_NAME="destroy_item"/>
<DYNAMIC_CHILD CLASS_NAME="unlearn_brick"/>
</PRIMITIVE> </PRIMITIVE>
<PRIMITIVE CLASS_NAME="kill" TYPE="node" PARENT_CLASS="objective_parent"> <PRIMITIVE CLASS_NAME="kill" TYPE="node" PARENT_CLASS="objective_parent">
<PARAMETER NAME="name" TYPE="string" VISIBLE="true" AUTONAME="kill $fauna/quantity$$race/quantity$$group$$npc$$faction/quantity$"/> <PARAMETER NAME="name" TYPE="string" VISIBLE="true" AUTONAME="kill $fauna/quantity$$race/quantity$$group$$npc$$faction/quantity$$clan_name/min_level/max_level/quantity$"/>
<PARAMETER NAME="fauna/quantity" TYPE="string_array" VISIBLE="true"/> <PARAMETER NAME="fauna/quantity" TYPE="string_array" VISIBLE="true"/>
<PARAMETER NAME="race/quantity" TYPE="string_array" VISIBLE="true"/> <PARAMETER NAME="race/quantity" TYPE="string_array" VISIBLE="true"/>
@ -1110,6 +1120,7 @@
<PARAMETER NAME="npc" TYPE="string_array" VISIBLE="true"/> <PARAMETER NAME="npc" TYPE="string_array" VISIBLE="true"/>
<PARAMETER NAME="npc_by_name/quantity" TYPE="string" VISIBLE="true"/> <PARAMETER NAME="npc_by_name/quantity" TYPE="string" VISIBLE="true"/>
<PARAMETER NAME="faction/quantity" TYPE="string" VISIBLE="true"/> <PARAMETER NAME="faction/quantity" TYPE="string" VISIBLE="true"/>
<PARAMETER NAME="clan_name/min_level/max_level/quantity" TYPE="string_array" VISIBLE="true"/>
<PARAMETER NAME="place" TYPE="string" VISIBLE="true"/> <PARAMETER NAME="place" TYPE="string" VISIBLE="true"/>
</PRIMITIVE> </PRIMITIVE>
@ -1555,15 +1566,15 @@
</PARAMETER> </PARAMETER>
--> -->
<PARAMETER NAME="item_parts" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="item_part" LOOKUP="true"> <PARAMETER NAME="item_parts" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="item_part" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/deposit_system/item_parts"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/deposit_system/item_parts"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="mps" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="mp" LOOKUP="true"> <PARAMETER NAME="mps" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="mp" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/deposit_system/mps"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/deposit_system/mps"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="craft_civ" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="craft_civ" LOOKUP="true"> <PARAMETER NAME="craft_civ" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="craft_civ" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/deposit_system/craft_civs"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/deposit_system/craft_civs"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="exact_mp_item" TYPE="string_array" VISIBLE="true" FILENAME="false"/> <PARAMETER NAME="exact_mp_item" TYPE="string_array" VISIBLE="true" FILENAME="false"/>
@ -1585,13 +1596,13 @@
</PARAMETER> </PARAMETER>
<!-- Deposit <!-- Deposit
<PARAMETER NAME="item_parts" TYPE="string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="item_part" LOOKUP="true" WIDGET_HEIGHT="100"> <PARAMETER NAME="item_parts" TYPE="string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="item_part" LOOKUP="true" WIDGET_HEIGHT="100">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/deposit_system/item_parts"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/deposit_system/item_parts"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="mps" TYPE="string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="mp" LOOKUP="true" WIDGET_HEIGHT="100"> <PARAMETER NAME="mps" TYPE="string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="mp" LOOKUP="true" WIDGET_HEIGHT="100">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/deposit_system/mps"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/deposit_system/mps"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="craft_civ" TYPE="string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="craft_civ" LOOKUP="true" WIDGET_HEIGHT="100"> <PARAMETER NAME="craft_civ" TYPE="string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="craft_civ" LOOKUP="true" WIDGET_HEIGHT="100">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/deposit_system/craft_civ"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/deposit_system/craft_civ"/>
</PARAMETER> </PARAMETER>
--> -->
@ -1693,7 +1704,7 @@
</PARAMETER> </PARAMETER>
--> -->
<PARAMETER NAME="ecotype" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="ecotype" LOOKUP="true"> <PARAMETER NAME="ecotype" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="ecotype" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/deposit_system/ecotypes"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/deposit_system/ecotypes"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
</PRIMITIVE> </PRIMITIVE>
@ -1854,7 +1865,7 @@
<PARAMETER NAME="ConstArray" TYPE="const_string_array" VISIBLE="true" FILENAME="true" WIDGET_HEIGHT="100" FILE_EXTENSION="flora" LOOKUP="true"> <PARAMETER NAME="ConstArray" TYPE="const_string_array" VISIBLE="true" FILENAME="true" WIDGET_HEIGHT="100" FILE_EXTENSION="flora" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_elem/plant/flora_template/forest"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_elem/plant/flora_template/forest"/>
<COMBO_VALUES CONTEXT_NAME="jungle"> <COMBO_VALUES CONTEXT_NAME="jungle">
<CONTEXT_VALUE VALUE="jungle0"/> <CONTEXT_VALUE VALUE="jungle0"/>
</COMBO_VALUES> </COMBO_VALUES>
@ -1877,7 +1888,7 @@
<PARAMETER NAME="ConstArray2" TYPE="const_string_array" VISIBLE="true" FILENAME="true" WIDGET_HEIGHT="100" FILE_EXTENSION="flora" LOOKUP="true" AUTONAME="$ConstArray$"> <PARAMETER NAME="ConstArray2" TYPE="const_string_array" VISIBLE="true" FILENAME="true" WIDGET_HEIGHT="100" FILE_EXTENSION="flora" LOOKUP="true" AUTONAME="$ConstArray$">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_elem/plant/flora_template/forest"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_elem/plant/flora_template/forest"/>
<COMBO_VALUES CONTEXT_NAME="jungle"> <COMBO_VALUES CONTEXT_NAME="jungle">
<CONTEXT_VALUE VALUE="jungle0"/> <CONTEXT_VALUE VALUE="jungle0"/>
</COMBO_VALUES> </COMBO_VALUES>
@ -1986,11 +1997,11 @@
<PARAMETER NAME="name" TYPE="string" VISIBLE="true"> <PARAMETER NAME="name" TYPE="string" VISIBLE="true">
</PARAMETER> </PARAMETER>
<PARAMETER NAME="form" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="flora" LOOKUP="true"> <PARAMETER NAME="form" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="flora" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="forest" PATH="l:/leveldesign/game_elem/plant/flora_template/forest"/> <COMBO_FILES CONTEXT_NAME="forest" PATH="L:/leveldesign/game_elem/plant/flora_template/forest"/>
<COMBO_FILES CONTEXT_NAME="jungle" PATH="l:/leveldesign/game_elem/plant/flora_template/jungle"/> <COMBO_FILES CONTEXT_NAME="jungle" PATH="L:/leveldesign/game_elem/plant/flora_template/jungle"/>
<COMBO_FILES CONTEXT_NAME="desert" PATH="l:/leveldesign/game_elem/plant/flora_template/desert"/> <COMBO_FILES CONTEXT_NAME="desert" PATH="L:/leveldesign/game_elem/plant/flora_template/desert"/>
<COMBO_FILES CONTEXT_NAME="lacustre" PATH="l:/leveldesign/game_elem/plant/flora_template/lacustre"/> <COMBO_FILES CONTEXT_NAME="lacustre" PATH="L:/leveldesign/game_elem/plant/flora_template/lacustre"/>
<COMBO_FILES CONTEXT_NAME="prime_roots" PATH="l:/leveldesign/game_elem/plant/flora_template/primes_racines"/> <COMBO_FILES CONTEXT_NAME="prime_roots" PATH="L:/leveldesign/game_elem/plant/flora_template/primes_racines"/>
</PARAMETER> </PARAMETER>
<DYNAMIC_CHILD CLASS_NAME="flora_exclude"/> <DYNAMIC_CHILD CLASS_NAME="flora_exclude"/>
<GENERATED_CHILD CLASS_NAME="prim"/> <GENERATED_CHILD CLASS_NAME="prim"/>
@ -2003,11 +2014,11 @@
<PARAMETER NAME="name" TYPE="string" VISIBLE="true"> <PARAMETER NAME="name" TYPE="string" VISIBLE="true">
</PARAMETER> </PARAMETER>
<PARAMETER NAME="form" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="flora" LOOKUP="true"> <PARAMETER NAME="form" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="flora" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="forest" PATH="l:/leveldesign/game_elem/plant/flora_template/forest"/> <COMBO_FILES CONTEXT_NAME="forest" PATH="L:/leveldesign/game_elem/plant/flora_template/forest"/>
<COMBO_FILES CONTEXT_NAME="jungle" PATH="l:/leveldesign/game_elem/plant/flora_template/jungle"/> <COMBO_FILES CONTEXT_NAME="jungle" PATH="L:/leveldesign/game_elem/plant/flora_template/jungle"/>
<COMBO_FILES CONTEXT_NAME="desert" PATH="l:/leveldesign/game_elem/plant/flora_template/desert"/> <COMBO_FILES CONTEXT_NAME="desert" PATH="L:/leveldesign/game_elem/plant/flora_template/desert"/>
<COMBO_FILES CONTEXT_NAME="lacustre" PATH="l:/leveldesign/game_elem/plant/flora_template/lacustre"/> <COMBO_FILES CONTEXT_NAME="lacustre" PATH="L:/leveldesign/game_elem/plant/flora_template/lacustre"/>
<COMBO_FILES CONTEXT_NAME="prime_roots" PATH="l:/leveldesign/game_elem/plant/flora_template/primes_racines"/> <COMBO_FILES CONTEXT_NAME="prime_roots" PATH="L:/leveldesign/game_elem/plant/flora_template/primes_racines"/>
</PARAMETER> </PARAMETER>
<DYNAMIC_CHILD CLASS_NAME="flora_exclude"/> <DYNAMIC_CHILD CLASS_NAME="flora_exclude"/>
<GENERATED_CHILD CLASS_NAME="prim"/> <GENERATED_CHILD CLASS_NAME="prim"/>
@ -2022,11 +2033,11 @@
<PARAMETER NAME="name" TYPE="string" VISIBLE="true"> <PARAMETER NAME="name" TYPE="string" VISIBLE="true">
</PARAMETER> </PARAMETER>
<PARAMETER NAME="form" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="plant" LOOKUP="true"> <PARAMETER NAME="form" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="plant" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="forest" PATH="l:/leveldesign/game_elem/plant/ecosystem/forest"/> <COMBO_FILES CONTEXT_NAME="forest" PATH="L:/leveldesign/game_elem/plant/ecosystem/forest"/>
<COMBO_FILES CONTEXT_NAME="jungle" PATH="l:/leveldesign/game_elem/plant/ecosystem/jungle"/> <COMBO_FILES CONTEXT_NAME="jungle" PATH="L:/leveldesign/game_elem/plant/ecosystem/jungle"/>
<COMBO_FILES CONTEXT_NAME="desert" PATH="l:/leveldesign/game_elem/plant/ecosystem/desert"/> <COMBO_FILES CONTEXT_NAME="desert" PATH="L:/leveldesign/game_elem/plant/ecosystem/desert"/>
<COMBO_FILES CONTEXT_NAME="lacustre" PATH="l:/leveldesign/game_elem/plant/ecosystem/lacustre"/> <COMBO_FILES CONTEXT_NAME="lacustre" PATH="L:/leveldesign/game_elem/plant/ecosystem/lacustre"/>
<COMBO_FILES CONTEXT_NAME="prime_roots" PATH="l:/leveldesign/game_elem/plant/ecosystem/primes_racines"/> <COMBO_FILES CONTEXT_NAME="prime_roots" PATH="L:/leveldesign/game_elem/plant/ecosystem/primes_racines"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="radius" TYPE="string" VISIBLE="true"> <PARAMETER NAME="radius" TYPE="string" VISIBLE="true">
<DEFAULT_VALUE VALUE="1"/> <DEFAULT_VALUE VALUE="1"/>
@ -2100,7 +2111,7 @@
<PARAMETER NAME="group_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="group_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="groups_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="groups_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:\leveldesign\world_editor_files/npc/event_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\world_editor_files/npc/event_type"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
<DYNAMIC_CHILD CLASS_NAME="fauna_event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="fauna_event_handler_action"/>
@ -2120,7 +2131,7 @@
<!-- For now, fauna don't have AI profile--> <!-- For now, fauna don't have AI profile-->
<!-- <PARAMETER NAME= "ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <!-- <PARAMETER NAME= "ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" <COMBO_FILES CONTEXT_NAME="default"
PATH="l:\leveldesign\world_editor_files/npc/ai_movement"/> </PARAMETER> PATH="L:/leveldesign\world_editor_files/npc/ai_movement"/> </PARAMETER>
--> -->
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
<DYNAMIC_CHILD CLASS_NAME="group_fauna"/> <DYNAMIC_CHILD CLASS_NAME="group_fauna"/>
@ -2140,7 +2151,7 @@
<PARAMETER NAME="group_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="group_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="groups_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="groups_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:\leveldesign\world_editor_files/npc/event_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\world_editor_files/npc/event_type"/>
</PARAMETER> </PARAMETER>
<DYNAMIC_CHILD CLASS_NAME="fauna_event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="fauna_event_handler_action"/>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
@ -2155,7 +2166,7 @@
<!-- <PARAMETER NAME="params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> --> <!-- <PARAMETER NAME="params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> -->
<PARAMETER NAME="params" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="params" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:\leveldesign\world_editor_files/fauna_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\world_editor_files/fauna_zone_properties"/>
</PARAMETER> </PARAMETER>
</PRIMITIVE> </PRIMITIVE>
@ -2169,7 +2180,7 @@
<!-- <PARAMETER NAME="params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> --> <!-- <PARAMETER NAME="params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> -->
<PARAMETER NAME="params" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="params" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:\leveldesign\world_editor_files/npc_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\world_editor_files/npc_zone_properties"/>
</PARAMETER> </PARAMETER>
</PRIMITIVE> </PRIMITIVE>
@ -2185,7 +2196,7 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="parameters" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="500" SHOW_HS="true" FILE_EXTENSION="cs"/> <PARAMETER NAME="parameters" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="500" SHOW_HS="true" FILE_EXTENSION="cs"/>
<PARAMETER NAME="action" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="action" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:\leveldesign\world_editor_files/npc/action_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\world_editor_files/npc/action_type"/>
</PARAMETER> </PARAMETER>
<DYNAMIC_CHILD CLASS_NAME="fauna_event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="fauna_event_handler_action"/>
<DYNAMIC_CHILD CLASS_NAME="fauna_action_zone"/> <DYNAMIC_CHILD CLASS_NAME="fauna_action_zone"/>
@ -2459,22 +2470,22 @@
<DEFAULT_VALUE VALUE="0"/> <DEFAULT_VALUE VALUE="0"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="creature_code" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true"> <PARAMETER NAME="creature_code" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true">
<COMBO_FILES CONTEXT_NAME="forest" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/> <COMBO_FILES CONTEXT_NAME="forest" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/>
<COMBO_FILES CONTEXT_NAME="desert" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/> <COMBO_FILES CONTEXT_NAME="desert" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/>
<COMBO_FILES CONTEXT_NAME="jungle" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/> <COMBO_FILES CONTEXT_NAME="jungle" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/>
<COMBO_FILES CONTEXT_NAME="invasion" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/> <COMBO_FILES CONTEXT_NAME="invasion" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/>
<COMBO_FILES CONTEXT_NAME="lacustre" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/> <COMBO_FILES CONTEXT_NAME="lacustre" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/>
<COMBO_FILES CONTEXT_NAME="prime_roots" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/> <COMBO_FILES CONTEXT_NAME="prime_roots" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/>
<COMBO_FILES CONTEXT_NAME="goo" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/> <COMBO_FILES CONTEXT_NAME="goo" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/>
<COMBO_FILES CONTEXT_NAME="invasion" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/> <COMBO_FILES CONTEXT_NAME="invasion" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/>
</PARAMETER> </PARAMETER>
</PRIMITIVE> </PRIMITIVE>
<!-- *********************************************************************************** --> <!-- *********************************************************************************** -->
@ -2513,10 +2524,10 @@
--> -->
<!-- <PARAMETER NAME= "keywords" TYPE="string_array" VISIBLE="true"/> --> <!-- <PARAMETER NAME= "keywords" TYPE="string_array" VISIBLE="true"/> -->
<PARAMETER NAME="ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_movement"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/ai_movement"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="ai_activity" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="ai_activity" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_activity"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/ai_activity"/>
<DEFAULT_VALUE VALUE="no_change"/> <DEFAULT_VALUE VALUE="no_change"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
@ -2573,7 +2584,7 @@
</PARAMETER> </PARAMETER>
--> -->
<PARAMETER NAME="sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true"> <PARAMETER NAME="sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Kami/kamikeep"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Kami/kamikeep"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
</PRIMITIVE> </PRIMITIVE>
@ -2592,7 +2603,7 @@
</PARAMETER> </PARAMETER>
--> -->
<PARAMETER NAME="sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true"> <PARAMETER NAME="sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Kami/kamiguide"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Kami/kamiguide"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
</PRIMITIVE> </PRIMITIVE>
@ -2614,21 +2625,21 @@
<DEFAULT_VALUE VALUE="deposit"/> <DEFAULT_VALUE VALUE="deposit"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="type" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="deposit" LOOKUP="true"> <PARAMETER NAME="type" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="deposit" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="desert" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="desert" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="desert" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="desert" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="desert" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="desert" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="forest" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="forest" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="forest" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="forest" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="forest" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="forest" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="jungle" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="jungle" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="jungle" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="jungle" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="jungle" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="jungle" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="lacustre" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="lacustre" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="lacustre" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="lacustre" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="lacustre" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="lacustre" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="prime_roots" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="prime_roots" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="prime_roots" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="prime_roots" PATH="L:/leveldesign/game_element/deposit"/>
<COMBO_FILES CONTEXT_NAME="prime_roots" PATH="l:/leveldesign/game_element/deposit"/> <COMBO_FILES CONTEXT_NAME="prime_roots" PATH="L:/leveldesign/game_element/deposit"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="deposit_type" TYPE="string" VISIBLE="false"> <PARAMETER NAME="deposit_type" TYPE="string" VISIBLE="false">
<DEFAULT_VALUE VALUE="flora"/> <DEFAULT_VALUE VALUE="flora"/>
@ -2720,10 +2731,10 @@
--> -->
<PARAMETER NAME="keywords" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="keywords" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_movement"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/ai_movement"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="ai_activity" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="ai_activity" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_activity"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/ai_activity"/>
<DEFAULT_VALUE VALUE="no_change"/> <DEFAULT_VALUE VALUE="no_change"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="ai_profile_params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="ai_profile_params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
@ -2761,10 +2772,10 @@
--> -->
<PARAMETER NAME="keywords" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="keywords" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_movement"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/ai_movement"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="ai_activity" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="ai_activity" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_activity"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/ai_activity"/>
<DEFAULT_VALUE VALUE="no_change"/> <DEFAULT_VALUE VALUE="no_change"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="ai_profile_params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="ai_profile_params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
@ -2802,10 +2813,10 @@
--> -->
<PARAMETER NAME="keywords" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="keywords" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_movement"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/ai_movement"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="ai_activity" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="ai_activity" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_activity"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/ai_activity"/>
<DEFAULT_VALUE VALUE="no_change"/> <DEFAULT_VALUE VALUE="no_change"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="ai_profile_params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="ai_profile_params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
@ -2828,10 +2839,10 @@
<PARAMETER NAME="grp_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="grp_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="grps_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="grps_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="ai_movement" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_movement"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/ai_movement"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="ai_activity" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="ai_activity" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/ai_activity"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/ai_activity"/>
<DEFAULT_VALUE VALUE="no_change"/> <DEFAULT_VALUE VALUE="no_change"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="ai_profile_params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="ai_profile_params" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
@ -2869,7 +2880,7 @@
<PARAMETER NAME="group_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="group_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="groups_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="groups_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/event_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/event_type"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
<DYNAMIC_CHILD CLASS_NAME="npc_event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="npc_event_handler_action"/>
@ -2888,7 +2899,7 @@
<PARAMETER NAME="group_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="group_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="groups_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="groups_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/event_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/event_type"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
<DYNAMIC_CHILD CLASS_NAME="npc_event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="npc_event_handler_action"/>
@ -2907,7 +2918,7 @@
<PARAMETER NAME="state_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="state_keyword_filter" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="states_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="states_by_name" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/event_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/event_type"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
<DYNAMIC_CHILD CLASS_NAME="npc_event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="npc_event_handler_action"/>
@ -2924,7 +2935,7 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="parameters" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="500" SHOW_HS="true" FILE_EXTENSION="cs"/> <PARAMETER NAME="parameters" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="500" SHOW_HS="true" FILE_EXTENSION="cs"/>
<PARAMETER NAME="action" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="action" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/action_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc/action_type"/>
</PARAMETER> </PARAMETER>
<DYNAMIC_CHILD CLASS_NAME="npc_event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="npc_event_handler_action"/>
<DYNAMIC_CHILD CLASS_NAME="fauna_action_zone"/> <DYNAMIC_CHILD CLASS_NAME="fauna_action_zone"/>
@ -2953,17 +2964,17 @@
<PARAMETER NAME="bot_equipment" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="bot_equipment" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="bot_chat_parameters" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="bot_chat_parameters" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="bot_sheet_client" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true" EDITABLE="true"> <PARAMETER NAME="bot_sheet_client" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true" EDITABLE="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\bestiary\creature"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\bestiary\creature"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\world\3dset"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\world\3dset"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\objects"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\objects"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\bestiary\bot_object"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\bestiary\bot_object"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="bot_vertical_pos" TYPE="const_string" VISIBLE="true"> <PARAMETER NAME="bot_vertical_pos" TYPE="const_string" VISIBLE="true">
<DEFAULT_VALUE VALUE="auto"/> <DEFAULT_VALUE VALUE="auto"/>
@ -3015,17 +3026,17 @@
<PARAMETER NAME="keywords" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="keywords" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="equipment" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="equipment" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="sheet_client" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true" EDITABLE="true"> <PARAMETER NAME="sheet_client" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true" EDITABLE="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\bestiary\creature"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\bestiary\creature"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\world\3dset"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\world\3dset"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\objects"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\objects"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\bestiary\bot_object"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\bestiary\bot_object"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="is_stuck" TYPE="boolean" VISIBLE="true"> <PARAMETER NAME="is_stuck" TYPE="boolean" VISIBLE="true">
<DEFAULT_VALUE VALUE="false"/> <DEFAULT_VALUE VALUE="false"/>
@ -3060,11 +3071,11 @@
<PARAMETER NAME="effect" TYPE="string" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="effect" TYPE="string" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="neighbours" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="neighbours" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="sheet_socle" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true"> <PARAMETER NAME="sheet_socle" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\objects"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\objects"/>
</PARAMETER> </PARAMETER>
<!-- <!--
<PARAMETER NAME="sheet_spire" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true"> <PARAMETER NAME="sheet_spire" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\objects"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\objects"/>
</PARAMETER> </PARAMETER>
--> -->
<PARAMETER NAME="sheet_spire" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="sheet_spire" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
@ -3108,17 +3119,17 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="sheet_client" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true" EDITABLE="true"> <PARAMETER NAME="sheet_client" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true" EDITABLE="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\bestiary\creature"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\bestiary\creature"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\world\3dset"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\world\3dset"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\objects"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\objects"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\bestiary\bot_object"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\bestiary\bot_object"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/>
</PARAMETER> </PARAMETER>
</PRIMITIVE> </PRIMITIVE>
@ -3231,7 +3242,7 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="continent" LOOKUP="true"> <PARAMETER NAME="sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="continent" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/world"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world"/>
</PARAMETER> </PARAMETER>
<!-- <PARAMETER NAME="alias" TYPE="string" VISIBLE="true"> <!-- <PARAMETER NAME="alias" TYPE="string" VISIBLE="true">
@ -3662,7 +3673,7 @@
<DEFAULT_VALUE VALUE="OUTPOST"/> <DEFAULT_VALUE VALUE="OUTPOST"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="owner_tribe" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="owner_tribe" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/families"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/families"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
@ -3678,7 +3689,7 @@
<PARAMETER NAME="tribe_squads2" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="tribe_squads2" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="outpost_sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="outpost" LOOKUP="true"> <PARAMETER NAME="outpost_sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="outpost" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/outpost/outpost"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/outpost/outpost"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="PVP_Type" TYPE="const_string" VISIBLE="true" FILENAME="false" LOOKUP="false"> <PARAMETER NAME="PVP_Type" TYPE="const_string" VISIBLE="true" FILENAME="false" LOOKUP="false">
@ -3751,7 +3762,7 @@
<DEFAULT_VALUE VALUE="OUTPOST_MANAGER_EVENT"/> <DEFAULT_VALUE VALUE="OUTPOST_MANAGER_EVENT"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="event" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/outpost/manager/event_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/outpost/manager/event_type"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
<DYNAMIC_CHILD CLASS_NAME="npc_event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="npc_event_handler_action"/>
@ -3765,7 +3776,7 @@
<DEFAULT_VALUE VALUE="OUTPOST_MANAGER_EVENT_ACTION"/> <DEFAULT_VALUE VALUE="OUTPOST_MANAGER_EVENT_ACTION"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="action" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="action" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/outpost/manager/action_type"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/outpost/manager/action_type"/>
</PARAMETER> </PARAMETER>
<DYNAMIC_CHILD CLASS_NAME="outpost_manager_event_handler_action"/> <DYNAMIC_CHILD CLASS_NAME="outpost_manager_event_handler_action"/>
</PRIMITIVE> </PRIMITIVE>
@ -3819,7 +3830,7 @@
</COMBO_VALUES> </COMBO_VALUES>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="outpost_building" LOOKUP="true"> <PARAMETER NAME="sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="outpost_building" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/outpost/building"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/outpost/building"/>
<DEFAULT_VALUE VALUE="empty.outpost_building"/> <DEFAULT_VALUE VALUE="empty.outpost_building"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
@ -3866,7 +3877,7 @@
</PARAMETER> </PARAMETER>
--> -->
<PARAMETER NAME="continent_name" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="continent_name" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/continents"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/continents"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
@ -3991,12 +4002,12 @@
--> -->
<PARAMETER NAME="family" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="family" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/families"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/families"/>
</PARAMETER> </PARAMETER>
<!-- Sample .. <!-- Sample ..
<PARAMETER NAME="item_parts" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="item_part" LOOKUP="true"> <PARAMETER NAME="item_parts" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="item_part" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/deposit_system/item_parts"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/deposit_system/item_parts"/>
</PARAMETER> </PARAMETER>
--> -->
@ -4019,10 +4030,10 @@
</PARAMETER> </PARAMETER>
--> -->
<PARAMETER NAME="food" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="food" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/fauna_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/fauna_zone_properties"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="rest" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="rest" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/fauna_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/fauna_zone_properties"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="energy_0_25" TYPE="string" VISIBLE="true" FILENAME="false"> <PARAMETER NAME="energy_0_25" TYPE="string" VISIBLE="true" FILENAME="false">
@ -4052,7 +4063,7 @@
</PARAMETER> </PARAMETER>
--> -->
<PARAMETER NAME="family" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="family" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/families"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/families"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="energy_0_25" TYPE="string" VISIBLE="true" FILENAME="false"> <PARAMETER NAME="energy_0_25" TYPE="string" VISIBLE="true" FILENAME="false">
@ -4098,7 +4109,7 @@
<DYNAMIC_CHILD CLASS_NAME="group_template_npc_ml"/> <DYNAMIC_CHILD CLASS_NAME="group_template_npc_ml"/>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
<PARAMETER NAME="flags" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="flags" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc_zone_properties"/>
</PARAMETER> </PARAMETER>
</PRIMITIVE> </PRIMITIVE>
@ -4118,18 +4129,18 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="bot_equipment" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="bot_equipment" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="bot_sheet_look" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true" EDITABLE="true"> <PARAMETER NAME="bot_sheet_look" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true" EDITABLE="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\bestiary\creature"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\bestiary\creature"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\world\3dset"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\world\3dset"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\objects"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\objects"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\bestiary\bot_object"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\bestiary\bot_object"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\desert"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\desert"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\forest"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\forest"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\goo"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\goo"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\invasion"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\invasion"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\jungle"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\jungle"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\lacustre"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\lacustre"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\prime_roots"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\prime_roots"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="grp_parameters" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="grp_parameters" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
@ -4189,7 +4200,7 @@
<PARAMETER NAME="name" TYPE="string" VISIBLE="true"/> <PARAMETER NAME="name" TYPE="string" VISIBLE="true"/>
<PARAMETER NAME="is tribe" TYPE="boolean" VISIBLE="true"/> <PARAMETER NAME="is tribe" TYPE="boolean" VISIBLE="true"/>
<PARAMETER NAME="squad sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="outpost_squad" LOOKUP="true"> <PARAMETER NAME="squad sheet" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="outpost_squad" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign/game_element/outpost/squad"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/game_element/outpost/squad"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="bot_sheets" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="bot_sheets" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="ai_type" TYPE="string" VISIBLE="false"> <PARAMETER NAME="ai_type" TYPE="string" VISIBLE="false">
@ -4214,18 +4225,18 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="sheet_look" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true"> <PARAMETER NAME="sheet_look" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true">
<COMBO_FILES CONTEXT_NAME="global" PATH="l:/leveldesign/Game_elem/Creature/Npc/bestiary/creature"/> <COMBO_FILES CONTEXT_NAME="global" PATH="L:/leveldesign/Game_elem/Creature/Npc/bestiary/creature"/>
<COMBO_FILES CONTEXT_NAME="global" PATH="l:/leveldesign/Game_elem/Creature/Npc/world/3dset"/> <COMBO_FILES CONTEXT_NAME="global" PATH="L:/leveldesign/Game_elem/Creature/Npc/world/3dset"/>
<COMBO_FILES CONTEXT_NAME="global" PATH="l:/leveldesign/Game_elem/Creature/objects"/> <COMBO_FILES CONTEXT_NAME="global" PATH="L:/leveldesign/Game_elem/Creature/objects"/>
<COMBO_FILES CONTEXT_NAME="global" PATH="l:/leveldesign/Game_elem/Creature/Npc/bestiary/bot_object"/> <COMBO_FILES CONTEXT_NAME="global" PATH="L:/leveldesign/Game_elem/Creature/Npc/bestiary/bot_object"/>
<COMBO_FILES CONTEXT_NAME="global" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary"/> <COMBO_FILES CONTEXT_NAME="global" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary"/>
<COMBO_FILES CONTEXT_NAME="desert" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/> <COMBO_FILES CONTEXT_NAME="desert" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/desert"/>
<COMBO_FILES CONTEXT_NAME="forest" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/> <COMBO_FILES CONTEXT_NAME="forest" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/forest"/>
<COMBO_FILES CONTEXT_NAME="goo" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/> <COMBO_FILES CONTEXT_NAME="goo" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/goo"/>
<COMBO_FILES CONTEXT_NAME="invasion" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/> <COMBO_FILES CONTEXT_NAME="invasion" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/invasion"/>
<COMBO_FILES CONTEXT_NAME="jungle" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/> <COMBO_FILES CONTEXT_NAME="jungle" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/jungle"/>
<COMBO_FILES CONTEXT_NAME="lacustre" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/> <COMBO_FILES CONTEXT_NAME="lacustre" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/lacustre"/>
<COMBO_FILES CONTEXT_NAME="prime_roots" PATH="l:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/> <COMBO_FILES CONTEXT_NAME="prime_roots" PATH="L:/leveldesign/Game_elem/Creature/Fauna/bestiary/prime_roots"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="level_delta" TYPE="string" VISIBLE="true"> <PARAMETER NAME="level_delta" TYPE="string" VISIBLE="true">
@ -4307,18 +4318,18 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="equipment" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/> <PARAMETER NAME="equipment" TYPE="string_array" VISIBLE="true" WIDGET_HEIGHT="100"/>
<PARAMETER NAME="sheet_look" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true"> <PARAMETER NAME="sheet_look" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="creature" LOOKUP="true" SORT_ENTRIES="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\bestiary\creature"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\bestiary\creature"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\world\3dset"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\world\3dset"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\objects"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\objects"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Npc\bestiary\bot_object"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Npc\bestiary\bot_object"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\desert"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\desert"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\forest"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\forest"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\goo"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\goo"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\invasion"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\invasion"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\jungle"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\jungle"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\lacustre"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\lacustre"/>
<COMBO_FILES CONTEXT_NAME="default" PATH="l:/leveldesign\Game_elem\Creature\Fauna\bestiary\prime_roots"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign\Game_elem\Creature\Fauna\bestiary\prime_roots"/>
</PARAMETER> </PARAMETER>
<STATIC_CHILD CLASS_NAME="alias" NAME="alias"/> <STATIC_CHILD CLASS_NAME="alias" NAME="alias"/>
</PRIMITIVE> </PRIMITIVE>
@ -4493,7 +4504,7 @@
--> -->
<PARAMETER NAME="family" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true"> <PARAMETER NAME="family" TYPE="const_string" VISIBLE="true" FILENAME="true" FILE_EXTENSION="html" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/families"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/families"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="energy" TYPE="string" VISIBLE="true" FILENAME="false"> <PARAMETER NAME="energy" TYPE="string" VISIBLE="true" FILENAME="false">
@ -4635,7 +4646,7 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="properties" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="properties" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/fauna_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/fauna_zone_properties"/>
</PARAMETER> </PARAMETER>
<PARAMETER NAME="vertical_pos" TYPE="const_string" VISIBLE="true"> <PARAMETER NAME="vertical_pos" TYPE="const_string" VISIBLE="true">
@ -4670,7 +4681,7 @@
</PARAMETER> </PARAMETER>
<PARAMETER NAME="properties" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="properties" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc_zone_properties"/>
<COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//property_rep"/> <COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//property_rep"/>
</PARAMETER> </PARAMETER>
@ -4704,7 +4715,7 @@
--> -->
<PARAMETER NAME="properties" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="properties" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc_zone_properties"/>
<COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//property_rep"/> <COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//property_rep"/>
</PARAMETER> </PARAMETER>
@ -4738,7 +4749,7 @@
--> -->
<PARAMETER NAME="properties" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true"> <PARAMETER NAME="properties" TYPE="const_string_array" VISIBLE="true" FILENAME="true" FILE_EXTENSION="zone" LOOKUP="true">
<COMBO_FILES CONTEXT_NAME="default" PATH="R:/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc_zone_properties"/> <COMBO_FILES CONTEXT_NAME="default" PATH="L:/leveldesign/world_editor_files/npc_zone_properties"/>
<COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//property_rep"/> <COMBO_FILES CONTEXT_NAME="default" PRIM_PATH="//property_rep"/>
</PARAMETER> </PARAMETER>

@ -65,7 +65,7 @@ public:
/*bool write(char *filename) /*bool write(char *filename)
{ {
FILE *outf=fopen(filename,"wb"); FILE *outf=nlfopen(filename, "wb");
if (outf==NULL) if (outf==NULL)
return false; return false;

@ -26,11 +26,11 @@ using namespace NLMISC;
/****************************************************************\ /****************************************************************\
buildTableFormat() buildTableFormat()
\****************************************************************/ \****************************************************************/
void CSTLoader::buildTableFormat( string fileName, list<pair<string,TDataType> >& tableFormat ) void CSTLoader::buildTableFormat(const string &fileName, list<pair<string,TDataType> >& tableFormat )
{ {
_File = new ifstream(fileName.c_str(), ios::in); _File = nlfopen(fileName, "rb");
if( !_File->is_open() ) if (!_File)
{ {
nlerror("can't open file : %s\n", fileName.c_str()); nlerror("can't open file : %s\n", fileName.c_str());
} }
@ -40,7 +40,7 @@ void CSTLoader::buildTableFormat( string fileName, list<pair<string,TDataType> >
//================ //================
char readBuffer[4096]; char readBuffer[4096];
char * token; char * token;
_File->getline(readBuffer, 4096); if (fgets(readBuffer, 4096, _File) == NULL) return;
// extract first token // extract first token
//==================== //====================
@ -102,13 +102,17 @@ void CSTLoader::readData( list<list<string> >& data )
char * token; char * token;
bool firstToken = true; bool firstToken = true;
while( !_File->eof() ) while( !feof(_File) )
{ {
// list of current object values // list of current object values
list<string> lineData; list<string> lineData;
// read a line // read a line
_File->getline(readBuffer, 4096); if (fgets(readBuffer, 4096, _File) == NULL)
{
// EOF
break;
}
// check all tokens of the current line // check all tokens of the current line
do do
@ -146,16 +150,16 @@ void CSTLoader::readData( list<list<string> >& data )
/****************************************************************\ /****************************************************************\
generateDerivedClasses() generateDerivedClasses()
\****************************************************************/ \****************************************************************/
void CSTLoader::generateDerivedClasses(ofstream &file, std::list< std::pair<std::string, TDataType> > &format, std::list< std::list< std::string> > &data ) void CSTLoader::generateDerivedClasses(const std::list< std::pair<std::string, TDataType> > &format, const std::list< std::list< std::string> > &data )
{ {
std::string content;
std::list< std::list< std::string> >::const_iterator it_dl = data.begin();
std::list< std::list< std::string> >::iterator it_dl = data.begin();
while ( it_dl != data.end() ) while ( it_dl != data.end() )
{ {
std::list< std::pair<std::string, TDataType> >::iterator it_def = format.begin(); std::list< std::pair<std::string, TDataType> >::const_iterator it_def = format.begin();
std::list<std::string>::iterator it_val = (*it_dl).begin(); std::list<std::string>::const_iterator it_val = (*it_dl).begin();
// sint32 size = data.size(); // sint32 size = data.size();
// sint32 size2 = (*it_dl).size(); // sint32 size2 = (*it_dl).size();
@ -165,55 +169,25 @@ void CSTLoader::generateDerivedClasses(ofstream &file, std::list< std::pair<std:
if ( (*it_dl).size() ) if ( (*it_dl).size() )
{ {
file << "From Item : Define " << convertName( *it_val ) << endl; content += "From Item : Define " + convertName( *it_val ) + "\n";
it_val++; it_val++;
it_def++; it_def++;
file << "{" << endl; content += "{\n";
file << "\tComponent:" << endl; content += "\tComponent:\n";
} }
std::list< std::pair<std::string,TDataType> >::iterator it_obj = format.begin(); std::list< std::pair<std::string,TDataType> >::const_iterator it_obj = format.begin();
it_obj++; it_obj++;
while ( it_obj != format.end() ) while ( it_obj != format.end() )
{ {
file << "\t\t"; content += "\t\t" + convertFromType((*it_obj).second);
switch ( (*it_obj).second ) content += "<'" + (*it_obj).first + "', Static>;\n";
{
case UINT8:
file << "uint8";
break;
case SINT8:
file << "sint8";
break;
case UINT16:
file << "uint16";
break;
case SINT16:
file << "sint16";
break;
case UINT32:
file << "uint32";
break;
case SINT32:
file << "sint32";
break;
case FLOAT:
file << "Float";
break;
case STRING:
file << "String";
break;
case BOOL:
file << "Bool";
break;
}
file << "<'" << (*it_obj).first << "', Static>;" << endl;
it_obj++; it_obj++;
} }
file << "\tEnd" << endl << endl; content += "\tEnd\n";
file << "\t StaticInit()" << endl; content += "\t StaticInit()\n";
while ( it_def != format.end() && it_val != (*it_dl).end() ) while ( it_def != format.end() && it_val != (*it_dl).end() )
{ {
@ -222,50 +196,52 @@ void CSTLoader::generateDerivedClasses(ofstream &file, std::list< std::pair<std:
std::string test2 = (*it_def).first; std::string test2 = (*it_def).first;
#endif #endif
file << "\t\t" << (*it_def).first << " = "; content += "\t\t" + (*it_def).first + " = ";
switch ( (*it_def).second ) switch ( (*it_def).second )
{ {
case UINT8: case UINT8:
file << "new uint8(" << convertName(*it_val); content += "new uint8(" + convertName(*it_val);
break; break;
case SINT8: case SINT8:
file << "new sint8(" << convertName(*it_val); content += "new sint8(" + convertName(*it_val);
break; break;
case UINT16: case UINT16:
file << "new uint16(" << convertName(*it_val); content += "new uint16(" + convertName(*it_val);
break; break;
case SINT16: case SINT16:
file << "new sint16(" << convertName(*it_val); content += "new sint16(" + convertName(*it_val);
break; break;
case UINT32: case UINT32:
file << "new uint32(" << convertName(*it_val); content += "new uint32(" + convertName(*it_val);
break; break;
case SINT32: case SINT32:
file << "new sint32(" << convertName(*it_val); content += "new sint32(" + convertName(*it_val);
break; break;
case FLOAT: case FLOAT:
file << "new Float(" <<convertName(*it_val); content += "new Float(" + convertName(*it_val);
break; break;
case STRING: case STRING:
file << "'" << (*it_val) << "'"; content += "'" + (*it_val) + "'";
break; break;
case BOOL: case BOOL:
file << "new Bool(" << (*it_val); content += "new Bool(" + (*it_val);
break; break;
default: default:
file << "ERROR: unsuported type " << (*it_def).second << std::endl; content += "ERROR: unsuported type " + toString((uint)(*it_def).second) + "\n";
break; break;
} }
file << ");" << endl; content += ");\n";
it_def++; it_def++;
it_val++; it_val++;
} }
file << "\tEnd" << endl; content += "\tEnd\n";
file << "}" << endl; content += "}\n";
it_dl++; it_dl++;
} }
fwrite(content.c_str(), 1, content.length(), _File);
} }
@ -274,15 +250,15 @@ void CSTLoader::generateDerivedClasses(ofstream &file, std::list< std::pair<std:
/****************************************************************\ /****************************************************************\
init() init()
\****************************************************************/ \****************************************************************/
void CSTLoader::init(string fileName, const map<string,TDataType>& fileFormat) void CSTLoader::init(const string &fileName, const map<string,TDataType>& fileFormat)
{ {
_FileFormat = fileFormat; _FileFormat = fileFormat;
_FileName = fileName; _FileName = fileName;
_File = new ifstream(fileName.c_str(), ios::in); _File = nlfopen(fileName, "rb");
if( !_File->is_open() ) if (!_File)
{ {
nlerror("can't open file : %s\n", fileName.c_str()); nlerror("can't open file : %s\n", fileName.c_str());
} }
@ -291,7 +267,8 @@ void CSTLoader::init(string fileName, const map<string,TDataType>& fileFormat)
// read first line // read first line
char readBuffer[4096]; char readBuffer[4096];
char * token; char * token;
_File->getline(readBuffer, 4096);
if (fgets(readBuffer, 4096, _File) == NULL) return;
// extract first token // extract first token
token = strtok(readBuffer, _Seps.c_str()); token = strtok(readBuffer, _Seps.c_str());
@ -316,7 +293,7 @@ void CSTLoader::init(string fileName, const map<string,TDataType>& fileFormat)
\****************************************************************/ \****************************************************************/
bool CSTLoader::readLine() bool CSTLoader::readLine()
{ {
if( _File->eof() ) if (feof(_File))
{ {
return false; return false;
} }
@ -333,7 +310,7 @@ bool CSTLoader::readLine()
_Tokens.clear(); _Tokens.clear();
// read a line // read a line
_File->getline(readBuffer, 4096); if (fgets(readBuffer, 4096, _File) == NULL) return false;
// if the line is empty we consider we are at end of file // if the line is empty we consider we are at end of file
if( strlen(readBuffer) == 0) if( strlen(readBuffer) == 0)
@ -429,3 +406,21 @@ bool CSTLoader::readLine()
return true; return true;
} }
std::string CSTLoader::convertFromType(TDataType type)
{
switch (type)
{
case UINT8: return "uint8";
case SINT8: return "sint8";
case UINT16: return "uint16";
case SINT16: return "sint16";
case UINT32: return "uint32";
case SINT32: return "sint32";
case FLOAT: return "Float";
case STRING: return "String";
case BOOL: return "Bool";
default: break;
}
return "";
}

@ -25,7 +25,6 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include <string> #include <string>
#include <fstream>
/** /**
@ -55,7 +54,7 @@ public:
private: private:
/// cst file /// cst file
std::ifstream * _File; FILE *_File;
/// name of the cst file (used for debug information) /// name of the cst file (used for debug information)
std::string _FileName; std::string _FileName;
@ -101,7 +100,7 @@ public:
* \param fileName the name of the file * \param fileName the name of the file
* \param fileFormat the name of the columns and their data type * \param fileFormat the name of the columns and their data type
*/ */
void buildTableFormat( std::string fileName, std::list<std::pair< std::string,TDataType> >& tableFormat ); void buildTableFormat( const std::string &fileName, std::list<std::pair< std::string,TDataType> >& tableFormat );
/** /**
@ -117,7 +116,7 @@ public:
* \param fileName the name of the file * \param fileName the name of the file
* \param fileFormat the name of the columns and their data type * \param fileFormat the name of the columns and their data type
*/ */
void init( std::string fileName, const std::map<std::string,TDataType>& fileFormat); void init( const std::string &fileName, const std::map<std::string,TDataType>& fileFormat);
/** /**
@ -213,77 +212,50 @@ public:
/// close file /// close file
void close() void close()
{ {
_File->close(); fclose(_File);
delete _File; _File = NULL;
} }
void Load(std::string fileName,std::ofstream &script_file) void Load(const std::string &fileName)
{ {
// Generates the base class // Generates the base class
std::list< std::pair<std::string,TDataType> > format; std::list< std::pair<std::string,TDataType> > format;
buildTableFormat( fileName, format ); buildTableFormat( fileName, format );
generateBaseClass( script_file, format); generateBaseClass( format);
// Generates a derived class for each type of object // Generates a derived class for each type of object
std::list< std::list<std::string> > data; std::list< std::list<std::string> > data;
readData( data ); readData( data );
generateDerivedClasses( script_file, format, data ); generateDerivedClasses( format, data );
} }
void generateBaseClass(std::ofstream &file, std::list< std::pair<std::string,TDataType> > &/* format */) void generateBaseClass(const std::list< std::pair<std::string,TDataType> > &/* format */)
{ {
file << "From Agent : Define Item" << std::endl; std::string content;
file << "{" << std::endl; content += "From Agent : Define Item\n";
/* file << "\tComponent:" << std::endl; content += "{\n";
/* content += "\tComponent:\n";
std::list< std::pair<std::string,TDataType> >::iterator it_obj = format.begin(); std::list< std::pair<std::string,TDataType> >::iterator it_obj = format.begin();
it_obj++; it_obj++;
while ( it_obj != format.end() ) while ( it_obj != format.end() )
{ {
file << "\t\t"; content += "\t\t" + convertFromType((*it_obj).second);
switch ( (*it_obj).second ) content += "<'" + (*it_obj).first + "', Static>;\n";
{
case UINT8:
file << "uint8";
break;
case SINT8:
file << "sint8";
break;
case UINT16:
file << "uint16";
break;
case SINT16:
file << "sint16";
break;
case UINT32:
file << "uint32";
break;
case SINT32:
file << "sint32";
break;
case FLOAT:
file << "Float";
break;
case STRING:
file << "String";
break;
case BOOL:
file << "Bool";
break;
}
file << "<'" << (*it_obj).first << "', Static>;" << std::endl;
it_obj++; it_obj++;
} }
file << "\tEnd" << std::endl;*/ content += "\tEnd\n"; */
file << "}" << std::endl; content += "}\n";
file << std::endl; content += "\n";
fwrite(content.c_str(), 1, content.length(), _File);
} }
void generateDerivedClasses(std::ofstream &, std::list< std::pair<std::string, TDataType> > &, std::list< std::list< std::string> > &); void generateDerivedClasses(const std::list< std::pair<std::string, TDataType> > &, const std::list< std::list< std::string> > &);
TDataType convertType(std::string type_str) TDataType convertType(const std::string &type_str)
{ {
if ( type_str == "UINT8") if ( type_str == "UINT8")
return UINT8; return UINT8;
@ -306,11 +278,13 @@ public:
return (TDataType)0; return (TDataType)0;
} }
std::string convertName(std::string &name) std::string convertFromType(TDataType type);
std::string convertName(const std::string &name) const
{ {
int i = 0; int i = 0;
char buffer[1024]; char buffer[1024];
std::string::iterator it_c = name.begin(); std::string::const_iterator it_c = name.begin();
while ( it_c != name.end() ) while ( it_c != name.end() )
{ {
char c = *it_c; char c = *it_c;

@ -26,13 +26,6 @@
#include "utils.h" #include "utils.h"
#include "file_description_container.h" #include "file_description_container.h"
#ifdef NL_OS_WINDOWS
#include <time.h>
#include <sys/types.h>
//#include <sys/stat.h>
#include <stdio.h>
#endif
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------
// namespaces // namespaces
@ -110,23 +103,10 @@ void CFileDescriptionContainer::addFile(const string& fileName, uint32 timeStamp
void CFileDescriptionContainer::addFile(const string& fileName) void CFileDescriptionContainer::addFile(const string& fileName)
{ {
//#ifdef NL_OS_WINDOWS
//
// struct _stat buffer;
// uint32 result= _stat(fileName.c_str(),&buffer);
// if (result==0)
// {
// addFile(fileName, uint32(buffer.st_mtime), buffer.st_size);
// }
//
//#else
if (CFile::fileExists(fileName)) if (CFile::fileExists(fileName))
{ {
addFile(fileName,CFile::getFileModificationDate(fileName),CFile::getFileSize(fileName)); addFile(fileName,CFile::getFileModificationDate(fileName),CFile::getFileSize(fileName));
} }
//#endif
} }
void CFileDescriptionContainer::addFileSpec(const string& fileSpec,bool recurse) void CFileDescriptionContainer::addFileSpec(const string& fileSpec,bool recurse)

@ -79,7 +79,7 @@ bool CHttpClient::send(const std::string& buffer, bool verbose)
if(verbose) if(verbose)
{ {
nldebug("Sending '%s' to '%s'", buffer.c_str(), _Sock.remoteAddr().asString().c_str()); nldebug("Sending '%s' to '%s'", trim(buffer).c_str(), _Sock.remoteAddr().asString().c_str());
} }
uint32 size = (uint32)buffer.size(); uint32 size = (uint32)buffer.size();

@ -520,7 +520,7 @@ uint32 CPersistentDataRecord::getNumValues() const
} }
} }
// restore the original values of teh state variables // restore the original values of the state variables
_ArgOffset=oldArgOffset; _ArgOffset=oldArgOffset;
_TokenOffset=oldTokenOffset; _TokenOffset=oldTokenOffset;
_ReadingStructStack=oldRSS; _ReadingStructStack=oldRSS;
@ -1117,10 +1117,11 @@ bool CPersistentDataRecord::readFromFile(const std::string &fileName)
{ {
H_AUTO(pdrReadFromFile) H_AUTO(pdrReadFromFile)
// TODO: see why code is different under Linux and Windows
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
// open the file // open the file
FILE* inf= fopen(fileName.c_str(), "rb"); FILE* inf= nlfopen(fileName, "rb");
DROP_IF( inf==NULL, "Failed to open input file " << fileName, return false); DROP_IF( inf==NULL, "Failed to open input file " << fileName, return false);
// get the file size // get the file size

@ -671,14 +671,6 @@ struct TTypeLimits<uint32>
}; };
static uint32 floor(uint32 value) { return value; } static uint32 floor(uint32 value) { return value; }
}; };
/*
#ifdef NL_OS_WINDOWS
template <>
struct TTypeLimits<unsigned int> : public TTypeLimits<uint32>
{
};
#endif
*/
template <> template <>
struct TTypeLimits<uint64> struct TTypeLimits<uint64>
{ {
@ -728,12 +720,7 @@ struct TTypeLimits<sint32>
}; };
static sint32 floor(sint32 value) { return value; } static sint32 floor(sint32 value) { return value; }
}; };
/*#ifdef NL_OS_WINDOWS
template <>
struct TTypeLimits<int> : public TTypeLimits<sint32>
{
};
#endif*/
template <> template <>
struct TTypeLimits<sint64> struct TTypeLimits<sint64>
{ {

@ -40,6 +40,8 @@
#include "creature_manager/creature_manager.h" #include "creature_manager/creature_manager.h"
#include "world_instances.h" #include "world_instances.h"
#include "server_share/used_continent.h"
#include "game_share/shard_names.h"
using namespace NLMISC; using namespace NLMISC;
using namespace NLNET; using namespace NLNET;
@ -1007,36 +1009,39 @@ NLMISC_COMMAND(getTarget, "get target of player", "<uid>")
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(getMoney, "get money of player", "<uid>") NLMISC_COMMAND(getMoney, "get money of player", "<uid>")
{ {
GET_ACTIVE_CHARACTER GET_ACTIVE_CHARACTER
string value = toString("%"NL_I64"u", c->getMoney()); string value = toString("%"NL_I64"u", c->getMoney());
log.displayNL(value.c_str()); log.displayNL(value.c_str());
return true;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(getPvpPoints, "get pvp points of player", "<uid>") NLMISC_COMMAND(getPvpPoints, "get pvp points of player", "<uid>")
{ {
GET_ACTIVE_CHARACTER GET_ACTIVE_CHARACTER
string value = toString("%u", c->getPvpPoint()); string value = toString("%u", c->getPvpPoint());
log.displayNL(value.c_str()); log.displayNL(value.c_str());
return true;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(getCivCultOrg, "get civ cult and organization of player", "<uid>") NLMISC_COMMAND(getCivCultOrg, "get civ cult and organization of player", "<uid>")
{ {
GET_ACTIVE_CHARACTER GET_ACTIVE_CHARACTER
std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance = c->getAllegiance(); std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance = c->getAllegiance();
log.displayNL("%s|%s|%u", PVP_CLAN::toString(allegiance.first).c_str(), PVP_CLAN::toString(allegiance.second).c_str(), c->getOrganization()); log.displayNL("%s|%s|%u", PVP_CLAN::toString(allegiance.first).c_str(), PVP_CLAN::toString(allegiance.second).c_str(), c->getOrganization());
return true;
} }

@ -1139,6 +1139,66 @@ public:
}; };
REGISTER_STEP_CONTENT(CActionLearnBrick, "learn_brick"); REGISTER_STEP_CONTENT(CActionLearnBrick, "learn_brick");
// ---------------------------------------------------------------------------
class CActionUnlearnBrick : public IStepContent
{
string _BotGiver;
vector<string> _Bricks;
bool _Group;
void getPredefParam(uint32 &numEntry, CPhrase::TPredefParams &predef)
{
numEntry = 0;
}
public:
void init(CMissionData &md, IPrimitive *prim)
{
_BotGiver = md.getProperty(prim, "npc_name", true, false);
vector<string> vs;
vs = md.getPropertyArray(prim, "bricks", true, false);
for (uint i=0; i<vs.size(); ++i)
{
if (!vs[i].empty())
_Bricks.push_back(vs[i]);
}
string s;
s = md.getProperty(prim, "group", true, false);
_Group = (NLMISC::toLower(s) == "true");
IStepContent::init(md, prim);
}
string genCode(CMissionData &md)
{
string ret;
// if (_Bricks.empty())
// return ret;
ret = "unlearn_brick : ";
for (uint i=0; i<_Bricks.size(); ++i)
{
ret += _Bricks[i];
if (i < _Bricks.size()-1)
ret += "; ";
}
if (!_BotGiver.empty())
ret += " : "+_BotGiver;
if (_Group)
ret += " : group";
ret += NL;
return ret;
}
};
REGISTER_STEP_CONTENT(CActionUnlearnBrick, "unlearn_brick");
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
class CActionBotChat : public IStepContent class CActionBotChat : public IStepContent
{ {

@ -1,6 +1,7 @@
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${QT_INCLUDES} ${QT_INCLUDES}
${LIBXML2_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/qtpropertybrowser) ${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/qtpropertybrowser)
FILE(GLOB SRC *.cpp *.h) FILE(GLOB SRC *.cpp *.h)
@ -49,7 +50,7 @@ SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC})
ADD_LIBRARY(studio_plugin_georges_editor MODULE ${SRC} ${OVQT_PLUG_GEORGES_EDITOR_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_GEORGES_EDITOR_UI_HDRS} ${OVQT_PLUGIN_GEORGES_EDITOR_RC_SRCS}) ADD_LIBRARY(studio_plugin_georges_editor MODULE ${SRC} ${OVQT_PLUG_GEORGES_EDITOR_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_GEORGES_EDITOR_UI_HDRS} ${OVQT_PLUGIN_GEORGES_EDITOR_RC_SRCS})
TARGET_LINK_LIBRARIES(studio_plugin_georges_editor studio_plugin_core nelmisc nelgeorges qt_property_browser ${QT_LIBRARIES}) TARGET_LINK_LIBRARIES(studio_plugin_georges_editor studio_plugin_core nelmisc nelgeorges qt_property_browser ${QT_LIBRARIES} ${LIBXML2_LIBRARIES})
NL_DEFAULT_PROPS(studio_plugin_georges_editor "Tools: Studio Plugin: Georges Editor") NL_DEFAULT_PROPS(studio_plugin_georges_editor "Tools: Studio Plugin: Georges Editor")
NL_ADD_RUNTIME_FLAGS(studio_plugin_georges_editor) NL_ADD_RUNTIME_FLAGS(studio_plugin_georges_editor)

@ -19,6 +19,9 @@
#include "nel/gui/interface_group.h" #include "nel/gui/interface_group.h"
#include "nel/gui/widget_manager.h" #include "nel/gui/widget_manager.h"
#include <libxml/xmlstring.h>
#include <libxml/tree.h>
namespace GUIEditor namespace GUIEditor
{ {
bool WidgetSerializer::serialize( const std::string &masterGroup ) bool WidgetSerializer::serialize( const std::string &masterGroup )

@ -1,6 +1,7 @@
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${QT_INCLUDES} ${QT_INCLUDES}
${LIBXML2_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/qtpropertybrowser ${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/qtpropertybrowser
) )
@ -59,6 +60,7 @@ TARGET_LINK_LIBRARIES( studio_plugin_world_editor
qt_property_browser qt_property_browser
${QT_LIBRARIES} ${QT_LIBRARIES}
${QT_QTOPENGL_LIBRARY} ${QT_QTOPENGL_LIBRARY}
${LIBXML2_LIBRARIES}
) )
NL_DEFAULT_PROPS(studio_plugin_world_editor "Tools: Studio Plugin: World Editor") NL_DEFAULT_PROPS(studio_plugin_world_editor "Tools: Studio Plugin: World Editor")

@ -41,6 +41,10 @@
#include <QGraphicsView> #include <QGraphicsView>
#include <QPersistentModelIndex> #include <QPersistentModelIndex>
// libxml
#include <libxml/xmlstring.h>
#include <libxml/tree.h>
namespace WorldEditor namespace WorldEditor
{ {

@ -26,8 +26,7 @@
#include <nel/ligo/primitive_utils.h> #include <nel/ligo/primitive_utils.h>
#include <nel/ligo/ligo_config.h> #include <nel/ligo/ligo_config.h>
#include <libxml/tree.h>
// Qt includes
namespace WorldEditor namespace WorldEditor
{ {

Loading…
Cancel
Save