Merged in nimetu/ryzomcore/shard-admin-tool-mysqli-class (pull request #49)

mysqli class for shard admin tool
This commit is contained in:
Matthew Lagoe 2014-02-05 13:14:50 -08:00
commit cfd1f7e60f
51 changed files with 274 additions and 283 deletions

View file

@ -160,6 +160,7 @@ code/build/*
code/build-2010/* code/build-2010/*
build/* build/*
install/* install/*
code/nel/tools/build_gamedata/configuration/buildsite.py
# Linux nel compile # Linux nel compile
code/nel/build/nel-config code/nel/build/nel-config

View file

@ -41,10 +41,8 @@ INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
# Force out of source builds. # Force out of source builds.
CHECK_OUT_OF_SOURCE() CHECK_OUT_OF_SOURCE()
# Specify Mac OS X deployment target before including Darwin.cmake # To be able to specify a different deployment target on Mac OS X :
IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) # export MACOSX_DEPLOYMENT_TARGET=10.6
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6")
ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(RyzomCore CXX C) PROJECT(RyzomCore CXX C)

View file

@ -9,7 +9,25 @@ IF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
SET(Freetype_FIND_QUIETLY TRUE) SET(Freetype_FIND_QUIETLY TRUE)
ENDIF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS) ENDIF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
FIND_PATH(FREETYPE_INCLUDE_DIR FIND_PATH(FREETYPE_INCLUDE_DIRS
freetype
PATHS
$ENV{FREETYPE_DIR}/include
/usr/local/include
/usr/include
/sw/include
/opt/local/include
/opt/csw/include
/opt/include
PATH_SUFFIXES freetype2
)
IF(NOT FREETYPE_INCLUDE_DIRS)
SET(FREETYPE_INCLUDE_DIRS "")
ENDIF(NOT FREETYPE_INCLUDE_DIRS)
# ft2build.h does not reside in the freetype include dir
FIND_PATH(FREETYPE_ADDITIONAL_INCLUDE_DIR
ft2build.h ft2build.h
PATHS PATHS
/usr/local/include /usr/local/include
@ -21,9 +39,10 @@ FIND_PATH(FREETYPE_INCLUDE_DIR
PATH_SUFFIXES freetype2 PATH_SUFFIXES freetype2
) )
IF(FREETYPE_INCLUDE_DIR) # combine both include directories into one variable
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR}) IF(FREETYPE_ADDITIONAL_INCLUDE_DIR)
ENDIF(FREETYPE_INCLUDE_DIR) SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_ADDITIONAL_INCLUDE_DIR})
ENDIF(FREETYPE_ADDITIONAL_INCLUDE_DIR)
FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE
NAMES freetype libfreetype freetype219 freetype246 NAMES freetype libfreetype freetype219 freetype246

View file

@ -786,11 +786,15 @@ MACRO(NL_SETUP_BUILD)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SIMULATOR_SYSROOT}") ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SIMULATOR_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-mios-simulator-version-min=${IOS_VERSION}") ADD_PLATFORM_FLAGS("${XARCH}-mios-simulator-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") IF(CMAKE_OSX_DEPLOYMENT_TARGET)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET)
ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86) ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
ELSE(IOS) ELSE(IOS)
# Always force -mmacosx-version-min to override environement variable # Always force -mmacosx-version-min to override environement variable
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") IF(CMAKE_OSX_DEPLOYMENT_TARGET)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET)
ENDIF(IOS) ENDIF(IOS)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names") SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names")

View file

@ -77,6 +77,7 @@ public:
std::string Manufacturer; std::string Manufacturer;
std::string ProductName; std::string ProductName;
std::string Serial; // A unique device identifier std::string Serial; // A unique device identifier
bool AllowAuto; // Allow this device to be automatically selected when no device is configured
}; };
/** /**

View file

@ -44,7 +44,7 @@ public:
UFormElm& getRootNode (); UFormElm& getRootNode ();
const UFormElm& getRootNode () const; const UFormElm& getRootNode () const;
const std::string &getComment () const; const std::string &getComment () const;
void write (class NLMISC::IStream &stream, bool georges4CVS); void write (class NLMISC::IStream &stream);
void getDependencies (std::set<std::string> &dependencies) const; void getDependencies (std::set<std::string> &dependencies) const;
uint getNumParent () const; uint getNumParent () const;
UForm *getParentForm (uint parent) const; UForm *getParentForm (uint parent) const;
@ -73,7 +73,7 @@ public:
// ** IO functions // ** IO functions
// Set the filename before saving the form // Set the filename before saving the form
void write (xmlDocPtr doc, const char *filename, bool georges4CVS); void write (xmlDocPtr doc, const char *filename);
// ** Parent access // ** Parent access

View file

@ -161,7 +161,7 @@ public:
}; };
// ** IO functions // ** IO functions
void write (xmlDocPtr root, const char *filename, bool georges4CVS); void write (xmlDocPtr root, const char *filename);
// Count parent DFN // Count parent DFN
uint countParentDfn (uint32 round=0) const; uint countParentDfn (uint32 round=0) const;

View file

@ -63,7 +63,7 @@ private:
TTypeMap _MapType; TTypeMap _MapType;
// Map of filename / CRefPtr<CFormDfnCFormDfn> // Map of filename / CRefPtr<CFormDfnCFormDfn>
TFormDfnMap _MapFormDfn; TFormDfnMap _MapFormDfn;
// Map of form / CRefPtr<CForm> // Map of form / CRefPtr<CForm>
TFormMap _MapForm; TFormMap _MapForm;

View file

@ -54,9 +54,6 @@ public:
/// State of the form /// State of the form
TState State; TState State;
/// CVS Revision string
std::string Revision;
/// Comments of the form /// Comments of the form
std::string Comments; std::string Comments;
@ -65,7 +62,7 @@ public:
/// ** IO functions /// ** IO functions
void read (xmlNodePtr root); void read (xmlNodePtr root);
void write (xmlNodePtr node, bool georges4CVS) const; void write (xmlNodePtr node) const;
// Get state string // Get state string
static const char *getStateString (TState state); static const char *getStateString (TState state);

View file

@ -55,7 +55,7 @@ public:
static bool uiCompatible (TType type, TUI ui); static bool uiCompatible (TType type, TUI ui);
// ** IO functions // ** IO functions
void write (xmlDocPtr doc, bool georges4CVS) const; void write (xmlDocPtr doc) const;
// Header // Header
CFileHeader Header; CFileHeader Header;

View file

@ -53,9 +53,8 @@ public:
/** Write the form in a stream. /** Write the form in a stream.
* *
* \param stream is the stream used to write the form * \param stream is the stream used to write the form
* \param georges4CVS should be true if you use Georges with CVS false else
*/ */
virtual void write (NLMISC::IStream &stream, bool georges4CVS) = 0; virtual void write (NLMISC::IStream &stream) = 0;
/** /**
* Access form parents * Access form parents

View file

@ -90,6 +90,7 @@
# if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack or later # if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack or later
# define NL_ISO_STDTR1_AVAILABLE # define NL_ISO_STDTR1_AVAILABLE
# define NL_ISO_STDTR1_HEADER(header) <header> # define NL_ISO_STDTR1_HEADER(header) <header>
# define NL_ISO_STDTR1_NAMESPACE std::tr1
# endif # endif
# ifdef _DEBUG # ifdef _DEBUG
# define NL_DEBUG # define NL_DEBUG
@ -153,8 +154,16 @@
#ifdef NL_COMP_GCC #ifdef NL_COMP_GCC
# define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) # define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
# if GCC_VERSION > 40100 # if GCC_VERSION > 40100
# define NL_ISO_STDTR1_AVAILABLE // new libc++ bundled with clang under Mac OS X 10.9+ doesn't define __GLIBCXX__
# define NL_ISO_STDTR1_HEADER(header) <tr1/header> # ifdef __GLIBCXX__
# define NL_ISO_STDTR1_AVAILABLE
# define NL_ISO_STDTR1_HEADER(header) <tr1/header>
# define NL_ISO_STDTR1_NAMESPACE std::tr1
# else
# define NL_ISO_STDTR1_AVAILABLE
# define NL_ISO_STDTR1_HEADER(header) <header>
# define NL_ISO_STDTR1_NAMESPACE std
# endif
# endif # endif
#endif #endif
@ -331,9 +340,9 @@ typedef unsigned int uint; // at least 32bits (depend of processor)
#elif defined(NL_ISO_STDTR1_AVAILABLE) // use std::tr1 for CHash* classes, if available (gcc 4.1+ and VC9 with TR1 feature pack) #elif defined(NL_ISO_STDTR1_AVAILABLE) // use std::tr1 for CHash* classes, if available (gcc 4.1+ and VC9 with TR1 feature pack)
# include NL_ISO_STDTR1_HEADER(unordered_map) # include NL_ISO_STDTR1_HEADER(unordered_map)
# include NL_ISO_STDTR1_HEADER(unordered_set) # include NL_ISO_STDTR1_HEADER(unordered_set)
# define CHashMap std::tr1::unordered_map # define CHashMap NL_ISO_STDTR1_NAMESPACE::unordered_map
# define CHashSet std::tr1::unordered_set # define CHashSet NL_ISO_STDTR1_NAMESPACE::unordered_set
# define CHashMultiMap std::tr1::unordered_multimap # define CHashMultiMap NL_ISO_STDTR1_NAMESPACE::unordered_multimap
#elif defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 70 && NL_COMP_VC_VERSION <= 90) // VC7 through 9 #elif defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 70 && NL_COMP_VC_VERSION <= 90) // VC7 through 9
# include <hash_map> # include <hash_map>
# include <hash_set> # include <hash_set>

View file

@ -316,14 +316,14 @@ public:
// output the oldest part of the buffer first // output the oldest part of the buffer first
for (uint i=_Mean.getCurrentFrame(); i<_Mean.getNumFrame(); ++i) for (uint i=_Mean.getCurrentFrame(); i<_Mean.getNumFrame(); ++i)
{ {
str << _Mean.getLastFrames()[i]; str << (T)_Mean.getLastFrames()[i];
if (i < _Mean.getNumFrame()-1 || _Mean.getCurrentFrame() != 0) if (i < _Mean.getNumFrame()-1 || _Mean.getCurrentFrame() != 0)
str << ","; str << ",";
} }
// then output the newest part // then output the newest part
for (uint i = 0; i < _Mean.getCurrentFrame(); i++) for (uint i = 0; i < _Mean.getCurrentFrame(); i++)
{ {
str << _Mean.getLastFrames()[i]; str << (T)_Mean.getLastFrames()[i];
if (i < _Mean.getCurrentFrame()-1) if (i < _Mean.getCurrentFrame()-1)
str << ","; str << ",";
} }

View file

@ -289,7 +289,7 @@ int main(void)
// and finally save the form out in case we made changes. // and finally save the form out in case we made changes.
// if you're accessing a form read-only (not using set*) you can skip this. // if you're accessing a form read-only (not using set*) you can skip this.
NLMISC::COFile saveSample(sampleConfigFile); NLMISC::COFile saveSample(sampleConfigFile);
form->write(saveSample, false); form->write(saveSample);
nlinfo("Saved sample config file."); nlinfo("Saved sample config file.");
} else { } else {
// CPath didn't find the file, just print an error and exit. // CPath didn't find the file, just print an error and exit.

View file

@ -453,6 +453,7 @@ void CStereoDebugger::listDevices(std::vector<CStereoDeviceInfo> &devicesOut)
devInfo.Manufacturer = "NeL"; devInfo.Manufacturer = "NeL";
devInfo.ProductName = "Stereo Debugger"; devInfo.ProductName = "Stereo Debugger";
devInfo.Serial = "NL-3D-DEBUG"; devInfo.Serial = "NL-3D-DEBUG";
devInfo.AllowAuto = false;
devicesOut.push_back(devInfo); devicesOut.push_back(devInfo);
} }

View file

@ -612,6 +612,7 @@ void CStereoLibVR::listDevices(std::vector<CStereoDeviceInfo> &devicesOut)
deviceInfoOut.Factory = static_cast<IStereoDeviceFactory *>(handle); deviceInfoOut.Factory = static_cast<IStereoDeviceFactory *>(handle);
deviceInfoOut.Class = CStereoDeviceInfo::StereoHMD; deviceInfoOut.Class = CStereoDeviceInfo::StereoHMD;
deviceInfoOut.Library = CStereoDeviceInfo::LibVR; deviceInfoOut.Library = CStereoDeviceInfo::LibVR;
deviceInfoOut.AllowAuto = true;
//TODO: manufacturer, produc name //TODO: manufacturer, produc name
//TODO: serial //TODO: serial
devicesOut.push_back(deviceInfoOut); devicesOut.push_back(deviceInfoOut);

View file

@ -816,6 +816,7 @@ void CStereoOVR::listDevices(std::vector<CStereoDeviceInfo> &devicesOut)
deviceInfoOut.Library = CStereoDeviceInfo::OVR; // "Oculus SDK"; deviceInfoOut.Library = CStereoDeviceInfo::OVR; // "Oculus SDK";
deviceInfoOut.Manufacturer = deviceInfo.Manufacturer; deviceInfoOut.Manufacturer = deviceInfo.Manufacturer;
deviceInfoOut.ProductName = deviceInfo.ProductName; deviceInfoOut.ProductName = deviceInfo.ProductName;
deviceInfoOut.AllowAuto = true;
stringstream ser; stringstream ser;
ser << id; ser << id;
deviceInfoOut.Serial = ser.str(); // can't get the real serial from the sdk... deviceInfoOut.Serial = ser.str(); // can't get the real serial from the sdk...

View file

@ -104,7 +104,7 @@ CForm::~CForm ()
// *************************************************************************** // ***************************************************************************
void CForm::write (xmlDocPtr doc, const char *filename, bool georges4CVS) void CForm::write (xmlDocPtr doc, const char *filename)
{ {
// Save the filename // Save the filename
if (filename) if (filename)
@ -137,7 +137,7 @@ void CForm::write (xmlDocPtr doc, const char *filename, bool georges4CVS)
} }
// Header // Header
Header.write (node, georges4CVS); Header.write (node);
} }
// *************************************************************************** // ***************************************************************************
@ -259,14 +259,14 @@ const std::string &CForm::getComment () const
// *************************************************************************** // ***************************************************************************
void CForm::write (class NLMISC::IStream &stream, bool georges4CVS) void CForm::write (class NLMISC::IStream &stream)
{ {
// Xml stream // Xml stream
COXml xmlStream; COXml xmlStream;
xmlStream.init (&stream); xmlStream.init (&stream);
// Write the file // Write the file
write (xmlStream.getDocument (), NULL, georges4CVS); write (xmlStream.getDocument (), NULL);
} }
// *************************************************************************** // ***************************************************************************

View file

@ -41,7 +41,7 @@ void warning (bool exception, const char *format, ... );
// *************************************************************************** // ***************************************************************************
void CFormDfn::write (xmlDocPtr doc, const char *filename, bool georges4CVS) void CFormDfn::write (xmlDocPtr doc, const char *filename)
{ {
// Save filename // Save filename
_Filename = CFile::getFilename (filename); _Filename = CFile::getFilename (filename);
@ -101,7 +101,7 @@ void CFormDfn::write (xmlDocPtr doc, const char *filename, bool georges4CVS)
} }
// Header // Header
Header.write (node, georges4CVS); Header.write (node);
} }
// *************************************************************************** // ***************************************************************************

View file

@ -38,27 +38,16 @@ CFileHeader::CFileHeader ()
MajorVersion = 0; MajorVersion = 0;
MinorVersion = 0; MinorVersion = 0;
State = Modified; State = Modified;
Revision = "$R";
Revision += "evision$";
} }
// *************************************************************************** // ***************************************************************************
void CFileHeader::write (xmlNodePtr node, bool georges4CVS) const void CFileHeader::write (xmlNodePtr node) const
{ {
// Version for CVS ? // Georges version system
if (georges4CVS) char tmp[512];
{ smprintf (tmp, 512, "%d.%d", MajorVersion, MinorVersion);
// Georges version system xmlSetProp (node, (const xmlChar*)"Version", (const xmlChar*)tmp);
xmlSetProp (node, (const xmlChar*)"Revision", (const xmlChar*)Revision.c_str ());
}
else
{
// Georges version system
char tmp[512];
smprintf (tmp, 512, "%d.%d", MajorVersion, MinorVersion);
xmlSetProp (node, (const xmlChar*)"Version", (const xmlChar*)tmp);
}
// State // State
if (State == Modified) if (State == Modified)
@ -137,23 +126,6 @@ void CFileHeader::read (xmlNodePtr root)
MinorVersion = 0; MinorVersion = 0;
} }
// Get the revision
value = (const char*)xmlGetProp (root, (xmlChar*)"Revision");
if (value)
{
// Set the value
Revision = value;
// Delete the value
xmlFree ((void*)value);
}
else
{
// Set default
Revision = "$R";
Revision += "evision$";
}
// Get the version // Get the version
value = (const char*)xmlGetProp (root, (xmlChar*)"State"); value = (const char*)xmlGetProp (root, (xmlChar*)"State");
if (value) if (value)

View file

@ -54,7 +54,7 @@ CType::~CType ()
// *************************************************************************** // ***************************************************************************
void CType::write (xmlDocPtr doc, bool georges4CVS) const void CType::write (xmlDocPtr doc) const
{ {
// Create the first node // Create the first node
xmlNodePtr node = xmlNewDocNode (doc, NULL, (const xmlChar*)"TYPE", NULL); xmlNodePtr node = xmlNewDocNode (doc, NULL, (const xmlChar*)"TYPE", NULL);
@ -98,7 +98,7 @@ void CType::write (xmlDocPtr doc, bool georges4CVS) const
} }
// Header // Header
Header.write (node, georges4CVS); Header.write (node);
} }
// *************************************************************************** // ***************************************************************************

View file

@ -4104,7 +4104,8 @@ namespace NLGUI
{ {
setTitle(_TitlePrefix); setTitle(_TitlePrefix);
} }
} }
}
// *************************************************************************** // ***************************************************************************

View file

@ -364,7 +364,7 @@ namespace GeorgesQt
// ((CForm*)(UForm*)Form)->Header.MinorVersion++; // ((CForm*)(UForm*)Form)->Header.MinorVersion++;
// }*/ // }*/
// //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); // //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS);
m_form->write(file, false); m_form->write(file);
setWindowTitle(windowTitle().remove("*")); setWindowTitle(windowTitle().remove("*"));
m_modified = false; m_modified = false;
// //if (strcmp (xmlStream.getErrorString (), "") != 0) // //if (strcmp (xmlStream.getErrorString (), "") != 0)

View file

@ -1200,7 +1200,7 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType
} }
else else
{ {
form->write(output, true); form->write(output);
output.close(); output.close();
if (!CPath::exists(filename + ext)) if (!CPath::exists(filename + ext))

View file

@ -47,10 +47,6 @@ SOURCE_GROUP("r2" FILES ${SRC_R2})
# on Mac, create a .App Bundle # on Mac, create a .App Bundle
if(APPLE) if(APPLE)
IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6")
ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
SET(MACOSX_BUNDLE_INFO_STRING "Ryzom Core Client") SET(MACOSX_BUNDLE_INFO_STRING "Ryzom Core Client")
SET(MACOSX_BUNDLE_ICON_FILE "ryzom.icns") SET(MACOSX_BUNDLE_ICON_FILE "ryzom.icns")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "") SET(MACOSX_BUNDLE_GUI_IDENTIFIER "")

View file

@ -3,13 +3,22 @@ ADD_SUBDIRECTORY(make_alias_file)
ADD_SUBDIRECTORY(make_anim_by_race) ADD_SUBDIRECTORY(make_anim_by_race)
ADD_SUBDIRECTORY(make_anim_melee_impact) ADD_SUBDIRECTORY(make_anim_melee_impact)
ADD_SUBDIRECTORY(pd_parser) ADD_SUBDIRECTORY(pd_parser)
ADD_SUBDIRECTORY(translation_tools)
ADD_SUBDIRECTORY(assoc_mem) ADD_SUBDIRECTORY(assoc_mem)
ADD_SUBDIRECTORY(leveldesign) ADD_SUBDIRECTORY(leveldesign)
ADD_SUBDIRECTORY(patch_gen)
ADD_SUBDIRECTORY(pdr_util) IF(WITH_LIGO)
ADD_SUBDIRECTORY(stats_scan) ADD_SUBDIRECTORY(translation_tools)
ADD_SUBDIRECTORY(sheets_packer) ENDIF(WITH_LIGO)
IF(WITH_NET)
ADD_SUBDIRECTORY(stats_scan)
ADD_SUBDIRECTORY(pdr_util)
ADD_SUBDIRECTORY(patch_gen)
ENDIF(WITH_NET)
IF(WITH_LIGO AND WITH_NET)
ADD_SUBDIRECTORY(sheets_packer)
ENDIF(WITH_LIGO AND WITH_NET)
IF(WITH_RYZOM_CLIENT) IF(WITH_RYZOM_CLIENT)
ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(client)

View file

@ -1,26 +1,39 @@
ADD_SUBDIRECTORY(alias_synchronizer)
ADD_SUBDIRECTORY(prim_export)
ADD_SUBDIRECTORY(uni_conv) ADD_SUBDIRECTORY(uni_conv)
ADD_SUBDIRECTORY(csv_transform) ADD_SUBDIRECTORY(csv_transform)
ADD_SUBDIRECTORY(icon_search) ADD_SUBDIRECTORY(icon_search)
ADD_SUBDIRECTORY(mission_compiler_lib) IF(WITH_LIGO)
ADD_SUBDIRECTORY(alias_synchronizer)
ADD_SUBDIRECTORY(prim_export)
ADD_SUBDIRECTORY(mission_compiler_lib)
ENDIF(WITH_LIGO)
ADD_SUBDIRECTORY(mp_generator) ADD_SUBDIRECTORY(mp_generator)
ADD_SUBDIRECTORY(named_items_2_csv) ADD_SUBDIRECTORY(named_items_2_csv)
IF(WIN32) IF(WIN32)
ADD_SUBDIRECTORY(export) IF(WITH_LIGO)
ADD_SUBDIRECTORY(world_editor) ADD_SUBDIRECTORY(export)
ADD_SUBDIRECTORY(world_editor)
ENDIF(WITH_LIGO)
IF(WITH_MFC) IF(WITH_MFC)
ADD_SUBDIRECTORY(mission_compiler_fe) IF(WITH_LIGO)
ADD_SUBDIRECTORY(georges_dll) ADD_SUBDIRECTORY(mission_compiler_fe)
ADD_SUBDIRECTORY(georges_exe) ENDIF(WITH_LIGO)
ADD_SUBDIRECTORY(georges_plugin_sound) IF(WITH_GEORGES)
ADD_SUBDIRECTORY(georges_dll)
ADD_SUBDIRECTORY(georges_exe)
IF(WITH_SOUND)
ADD_SUBDIRECTORY(georges_plugin_sound)
ENDIF(WITH_SOUND)
ENDIF(WITH_GEORGES)
ENDIF(WITH_MFC) ENDIF(WITH_MFC)
ENDIF(WIN32) ENDIF(WIN32)
IF(WITH_QT) IF(WITH_QT)
ADD_SUBDIRECTORY(georges_editor_qt) IF(WITH_GEORGES)
ADD_SUBDIRECTORY(georges_editor_qt)
ENDIF(WITH_GEORGES)
ENDIF(WITH_QT) ENDIF(WITH_QT)
# folders not handled yet. # folders not handled yet.

View file

@ -73,7 +73,6 @@ CGeorgesEditApp::CGeorgesEditApp() : MemStream (false, false, 1024*1024)
ResizeMain = true; ResizeMain = true;
ExeStandalone = false; ExeStandalone = false;
StartExpanded = true; StartExpanded = true;
Georges4CVS = true;
FormClipBoardFormatStruct = RegisterClipboardFormat ("GeorgesFormStruct"); FormClipBoardFormatStruct = RegisterClipboardFormat ("GeorgesFormStruct");
FormClipBoardFormatVirtualStruct = RegisterClipboardFormat ("GeorgesFormVirtualStruct"); FormClipBoardFormatVirtualStruct = RegisterClipboardFormat ("GeorgesFormVirtualStruct");
@ -547,11 +546,6 @@ bool CGeorgesEditApp::loadCfg ()
if (start_expanded) if (start_expanded)
StartExpanded = start_expanded->asInt () != 0; StartExpanded = start_expanded->asInt () != 0;
// Georges4CVS
CConfigFile::CVar *georges_for_cvs = cf.getVarPtr ("GeorgesForCvs");
if (georges_for_cvs)
Georges4CVS = georges_for_cvs->asInt () != 0;
// MaxUndo // MaxUndo
CConfigFile::CVar *max_undo = cf.getVarPtr ("MaxUndo"); CConfigFile::CVar *max_undo = cf.getVarPtr ("MaxUndo");
if (max_undo) if (max_undo)
@ -633,11 +627,6 @@ bool CGeorgesEditApp::saveCfg ()
if (start_expanded) if (start_expanded)
start_expanded->setAsInt (StartExpanded); start_expanded->setAsInt (StartExpanded);
// Georges4CVS
CConfigFile::CVar *georges_for_cvs= cf.getVarPtr ("GeorgesForCvs");
if (georges_for_cvs)
georges_for_cvs->setAsInt (Georges4CVS);
// MaxUndo // MaxUndo
CConfigFile::CVar *max_undo= cf.getVarPtr ("MaxUndo"); CConfigFile::CVar *max_undo= cf.getVarPtr ("MaxUndo");
if (max_undo) if (max_undo)

View file

@ -99,9 +99,6 @@ public:
// If true, expand document's content node at loading // If true, expand document's content node at loading
bool StartExpanded; bool StartExpanded;
// Georges for CVS
bool Georges4CVS;
// Clipboards ID // Clipboards ID
UINT FormClipBoardFormatStruct; UINT FormClipBoardFormatStruct;
UINT FormClipBoardFormatVirtualStruct; UINT FormClipBoardFormatVirtualStruct;

View file

@ -766,7 +766,7 @@ BOOL CGeorgesEditDoc::OnSaveDocument(LPCTSTR lpszPathName)
Type->Header.MinorVersion++; Type->Header.MinorVersion++;
flushValueChange (); flushValueChange ();
} }
Type->write (xmlStream.getDocument (), theApp.Georges4CVS); Type->write (xmlStream.getDocument ());
modify (NULL, NULL, false); modify (NULL, NULL, false);
flushValueChange (); flushValueChange ();
UpdateAllViews (NULL); UpdateAllViews (NULL);
@ -782,7 +782,7 @@ BOOL CGeorgesEditDoc::OnSaveDocument(LPCTSTR lpszPathName)
Dfn->Header.MinorVersion++; Dfn->Header.MinorVersion++;
flushValueChange (); flushValueChange ();
} }
Dfn->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); Dfn->write (xmlStream.getDocument (), lpszPathName);
modify (NULL, NULL, false); modify (NULL, NULL, false);
UpdateAllViews (NULL); UpdateAllViews (NULL);
return TRUE; return TRUE;
@ -797,7 +797,7 @@ BOOL CGeorgesEditDoc::OnSaveDocument(LPCTSTR lpszPathName)
((CForm*)(UForm*)Form)->Header.MinorVersion++; ((CForm*)(UForm*)Form)->Header.MinorVersion++;
flushValueChange (); flushValueChange ();
} }
((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); ((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName);
if (strcmp (xmlStream.getErrorString (), "") != 0) if (strcmp (xmlStream.getErrorString (), "") != 0)
{ {
char message[512]; char message[512];

View file

@ -513,7 +513,7 @@ void CGeorgesImpl::MakeTyp( const std::string& filename, TType type, TUI ui, con
outputXml.init (&output); outputXml.init (&output);
// Write // Write
t.write (outputXml.getDocument (), theApp.Georges4CVS); t.write (outputXml.getDocument ());
} }
catch (Exception &e) catch (Exception &e)
{ {
@ -560,7 +560,7 @@ void CGeorgesImpl::createInstanceFile (const std::string &_sxFullnameWithoutExt,
if (f.open (fullName)) if (f.open (fullName))
{ {
ox.init(&f); ox.init(&f);
((NLGEORGES::CForm*)((UForm*)Form))->write (ox.getDocument(), _sxFullnameWithoutExt.c_str (), theApp.Georges4CVS); ((NLGEORGES::CForm*)((UForm*)Form))->write (ox.getDocument(), _sxFullnameWithoutExt.c_str ());
ox.flush(); ox.flush();
f.close(); f.close();
} }

View file

@ -96,7 +96,6 @@ BOOL CHeaderDialog::OnInitDialog()
IncrementVersion.Create ("Increment Version", WS_VISIBLE|WS_TABSTOP, currentPos, this, BtIncrement); IncrementVersion.Create ("Increment Version", WS_VISIBLE|WS_TABSTOP, currentPos, this, BtIncrement);
initWidget (IncrementVersion); initWidget (IncrementVersion);
getNextPos (currentPos); getNextPos (currentPos);
IncrementVersion.EnableWindow ( theApp.Georges4CVS ? FALSE : TRUE );
// Create the state combo // Create the state combo
setStaticSize (currentPos); setStaticSize (currentPos);
@ -243,55 +242,11 @@ void CHeaderDialog::getFromDocument (const NLGEORGES::CFileHeader &header)
{ {
if (View) if (View)
{ {
if (theApp.Georges4CVS) // Nel standard version number
{ ComboState.SetCurSel (header.State);
// CVS revision number char name[512];
IncrementVersion.EnableWindow ( theApp.Georges4CVS ? FALSE : TRUE ); smprintf (name, 512, "Version %d.%d", header.MajorVersion, header.MinorVersion);
LabelVersion.SetWindowText (name);
// Performs some checks
bool ok = false;
const char *revision = header.Revision.c_str ();
char name[32];
char name2[512];
if (strncmp (revision, "$Revision: ", 11) == 0)
{
// String start
const char *start = revision + 11;
// String end
const char *end = strchr (start, '$');
if (end)
{
// Build a string
int length = std::min (31, (int)(end-start));
memcpy (name, start, length);
name[length] = 0;
// Nice version
smprintf (name2, 512, "CVS Revision %s", name);
// Set the label
LabelVersion.SetWindowText (name2);
// Success
ok = true;
}
}
// Revision not found ?
if (!ok)
{
LabelVersion.SetWindowText ("CVS Revision number not found");
}
}
else
{
// Nel standard version number
ComboState.SetCurSel (header.State);
char name[512];
smprintf (name, 512, "Version %d.%d", header.MajorVersion, header.MinorVersion);
LabelVersion.SetWindowText (name);
}
// Set comments // Set comments
setEditTextMultiLine (Comments, header.Comments.c_str()); setEditTextMultiLine (Comments, header.Comments.c_str());

View file

@ -39,7 +39,6 @@ CSettingsDialog::CSettingsDialog(CWnd* pParent /*=NULL*/)
TypeDfnSubDirectory = _T(""); TypeDfnSubDirectory = _T("");
MaxUndo = 0; MaxUndo = 0;
StartExpanded = TRUE; StartExpanded = TRUE;
Georges4CVS = TRUE;
//}}AFX_DATA_INIT //}}AFX_DATA_INIT
} }
@ -55,7 +54,6 @@ void CSettingsDialog::DoDataExchange(CDataExchange* pDX)
DDX_Text(pDX, IDC_TYP_DFN_PATH, TypeDfnSubDirectory); DDX_Text(pDX, IDC_TYP_DFN_PATH, TypeDfnSubDirectory);
DDX_Text(pDX, IDC_MAX_UNDO, MaxUndo); DDX_Text(pDX, IDC_MAX_UNDO, MaxUndo);
DDX_Check(pDX, IDC_START_EXPANDED, StartExpanded); DDX_Check(pDX, IDC_START_EXPANDED, StartExpanded);
DDX_Check(pDX, IDC_GEORGES_4_CVS, Georges4CVS);
//}}AFX_DATA_MAP //}}AFX_DATA_MAP
} }
@ -93,7 +91,6 @@ BOOL CSettingsDialog::OnInitDialog()
DefaultDfn = theApp.DefaultDfn.c_str (); DefaultDfn = theApp.DefaultDfn.c_str ();
DefaultType = theApp.DefaultType.c_str (); DefaultType = theApp.DefaultType.c_str ();
StartExpanded = theApp.StartExpanded; StartExpanded = theApp.StartExpanded;
Georges4CVS = theApp.Georges4CVS;
UpdateData (FALSE); UpdateData (FALSE);
@ -110,7 +107,6 @@ void CSettingsDialog::OnOK()
theApp.TypeDfnSubDirectory = TypeDfnSubDirectory; theApp.TypeDfnSubDirectory = TypeDfnSubDirectory;
theApp.RememberListSize = RememberListSize; theApp.RememberListSize = RememberListSize;
theApp.StartExpanded = StartExpanded ? TRUE : FALSE; theApp.StartExpanded = StartExpanded ? TRUE : FALSE;
theApp.Georges4CVS = Georges4CVS ? TRUE : FALSE;
theApp.MaxUndo = MaxUndo; theApp.MaxUndo = MaxUndo;
theApp.DefaultDfn = DefaultDfn; theApp.DefaultDfn = DefaultDfn;
theApp.DefaultType = DefaultType; theApp.DefaultType = DefaultType;

View file

@ -44,7 +44,6 @@ public:
CString TypeDfnSubDirectory; CString TypeDfnSubDirectory;
UINT MaxUndo; UINT MaxUndo;
BOOL StartExpanded; BOOL StartExpanded;
BOOL Georges4CVS;
//}}AFX_DATA //}}AFX_DATA
NLMISC::CConfigFile ConfigFile; NLMISC::CConfigFile ConfigFile;

View file

@ -269,7 +269,7 @@ namespace NLQT
((CForm*)(UForm*)Form)->Header.MinorVersion++; ((CForm*)(UForm*)Form)->Header.MinorVersion++;
}*/ }*/
//((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS);
_form->write(file, false); _form->write(file);
setWindowTitle(windowTitle().remove("*")); setWindowTitle(windowTitle().remove("*"));
_modified = false; _modified = false;
//if (strcmp (xmlStream.getErrorString (), "") != 0) //if (strcmp (xmlStream.getErrorString (), "") != 0)

View file

@ -19,6 +19,7 @@
#include <afxdlgs.h> #include <afxdlgs.h>
#include <set> #include <set>
#include "resource.h"
namespace NLGEORGES namespace NLGEORGES
{ {

View file

@ -24,6 +24,7 @@
// //
#include "PageBase.h" #include "PageBase.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CPageComplex dialog // CPageComplex dialog

View file

@ -22,6 +22,7 @@
#endif // _MSC_VER > 1000 #endif // _MSC_VER > 1000
// LoadingDialog.h : header file // LoadingDialog.h : header file
// //
#include "resource.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CLoadingDialog dialog // CLoadingDialog dialog

View file

@ -21,6 +21,7 @@
#include "std_sound_plugin.h" #include "std_sound_plugin.h"
#include "listener_view.h" #include "listener_view.h"
#include "nel/sound/u_audio_mixer.h" #include "nel/sound/u_audio_mixer.h"
#include "resource.h"
#include "../georges_dll/plugin_interface.h" #include "../georges_dll/plugin_interface.h"

View file

@ -11,6 +11,5 @@ SuperUser = 1;
UserType = { UserType = {
}; };
StartExpanded = 1; StartExpanded = 1;
GeorgesForCvs = 1;
SamplePath = "L:\sound_files\samplebanks"; SamplePath = "L:\sound_files\samplebanks";
PackedSheetPath = "L:\sound_files\"; PackedSheetPath = "L:\sound_files\";

View file

@ -1,6 +1,10 @@
# Deprecated, no longer used
ADD_SUBDIRECTORY(ai_build_wmap) IF(WITH_LIGO)
ADD_SUBDIRECTORY(build_world_packed_col) ADD_SUBDIRECTORY(ai_build_wmap)
ENDIF(WITH_LIGO)
IF(WITH_3D)
ADD_SUBDIRECTORY(build_world_packed_col)
ENDIF(WITH_3D)
# Not done yet. # Not done yet.
#admin #admin

View file

@ -40,7 +40,6 @@
//var used to access the DB; //var used to access the DB;
global $cfg; global $cfg;
sleep(15);
try{ try{
//SETUP THE WWW DB //SETUP THE WWW DB
$dbw = new DBLayer("install", "web"); $dbw = new DBLayer("install", "web");

View file

@ -74,19 +74,21 @@
die2(); die2();
} }
$domainName = getPost("domain"); $domainName = getPost("domain");
$nelLink = mysql_connect($DBHost, $DBUserName, $DBPassword) or die2 (__FILE__. " " .__LINE__." Can't connect to database host:$DBHost user:$DBUserName"); $nelLink = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die2 (__FILE__. " " .__LINE__." Can't connect to database host:$DBHost user:$DBUserName");
mysql_select_db ($DBName, $nelLink) or die2 (__FILE__. " " .__LINE__." Can't access to the table dbname:$DBName"); mysqli_select_db ($nelLink, $DBName) or die2 (__FILE__. " " .__LINE__." Can't access to the table dbname:$DBName");
$domainName = mysqli_real_escape_string($nelLink, $domainName);
$query = "SELECT backup_patch_url, patch_urls FROM domain WHERE domain_name='$domainName'"; $query = "SELECT backup_patch_url, patch_urls FROM domain WHERE domain_name='$domainName'";
$result = mysql_query ($query, $nelLink) or die2 (__FILE__. " " .__LINE__." Can't execute the query: ".$query); $result = mysqli_query ($nelLink, $query) or die2 (__FILE__. " " .__LINE__." Can't execute the query: ".$query);
if (mysql_num_rows($result) != 1) if (mysqli_num_rows($result) != 1)
{ {
// unrecoverable error, we must giveup // unrecoverable error, we must giveup
$reason = "Can't find domain '".$domainName."' (error code x)"; $reason = "Can't find domain '".$domainName."' (error code x)";
$res = false; $res = false;
} }
$req = mysql_fetch_array($result); $req = mysqli_fetch_array($result);
$backup_patch_url = $req["backup_patch_url"]; $backup_patch_url = $req["backup_patch_url"];
$patch_urls = $req["patch_urls"]; $patch_urls = $req["patch_urls"];
@ -114,7 +116,7 @@
} }
echo "</version>\n"; echo "</version>\n";
mysql_close($nelLink); mysqli_close($nelLink);
unset($nelLink); unset($nelLink);
break; break;
@ -124,4 +126,3 @@
} }
?>

View file

@ -34,16 +34,16 @@
// gather the domain information (server version, patch urls and backup patch url // gather the domain information (server version, patch urls and backup patch url
global $DBHost, $DBUserName, $DBPassword, $DBName, $AutoInsertInRing; global $DBHost, $DBUserName, $DBPassword, $DBName, $AutoInsertInRing;
$link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName)); $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName));
mysql_select_db ($DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName)); mysqli_select_db ($link, $DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName));
$query = "SELECT * FROM domain WHERE domain_id=$domainId"; $query = "SELECT * FROM domain WHERE domain_id=$domainId";
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
if( mysql_num_rows($result) != 1) if( mysqli_num_rows($result) != 1)
{ {
die(errorMsgBlock(3001, $domainId)); die(errorMsgBlock(3001, $domainId));
} }
$row = mysql_fetch_array($result); $row = mysqli_fetch_array($result);
// set the cookie // set the cookie
setcookie ( "ryzomId" , $cookie, 0, "/"); setcookie ( "ryzomId" , $cookie, 0, "/");
@ -178,27 +178,28 @@
{ {
////////////// Temporary code alpha 0 only ///////////////////////////////////// ////////////// Temporary code alpha 0 only /////////////////////////////////////
// check if the ring user exist, and create it if not // check if the ring user exist, and create it if not
$ringDb = mysql_connect($DBHost, $RingDBUserName, $RingDBPassword) or die(errorMsgBlock(3004, 'Ring', $DBHost, $RingDBUserName)); $ringDb = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die(errorMsgBlock(3004, 'Ring', $DBHost, $RingDBUserName));
mysql_select_db ($domainInfo['ring_db_name'], $ringDb) or die(errorMsgBlock(3005, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName)); mysqli_select_db ($ringDb, $domainInfo['ring_db_name']) or die(errorMsgBlock(3005, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName));
$query = "SELECT user_id FROM ring_users where user_id = '".$id."'"; $query = "SELECT user_id FROM ring_users where user_id = '".$id."'";
$result = mysql_query ($query) or die(errorMsgBlock(3006, $query, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName, mysql_error())); $result = mysqli_query ($ringDb, $query) or die(errorMsgBlock(3006, $query, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName, mysqli_error($ringDb)));
if (mysql_num_rows($result) == 0) if (mysqli_num_rows($result) == 0)
{ {
// no ring user record, build one // no ring user record, build one
$query = "INSERT INTO ring_users SET user_id = '".$id."', user_name = '".$_GET["login"]."', user_type='ut_pioneer'"; $login = mysqli_real_escape_string($ringDb, $_GET['login']);
$result = mysql_query ($query) or die(errorMsgBlock(3006, $query, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName, mysql_error())); $query = "INSERT INTO ring_users SET user_id = '$id', user_name = '$login', user_type='ut_pioneer'";
$result = mysqli_query ($ringDb, $query) or die(errorMsgBlock(3006, $query, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName, mysqli_error($ringDb)));
} }
// // check that there is a character record (deprecated) // // check that there is a character record (deprecated)
// $query = "SELECT user_id FROM characters where user_id = '".$id."'"; // $query = "SELECT user_id FROM characters where user_id = '".$id."'";
// $result = mysql_query ($query) or die("Query ".$query." failed"); // $result = mysqli_query ($ringDb, $query) or die("Query ".$query." failed");
// if (mysql_num_rows($result) == 0) // if (mysqli_num_rows($result) == 0)
// { // {
// // no characters record, build a default one // // no characters record, build a default one
// $charId = ($id * 16); // $charId = ($id * 16);
// $query = "INSERT INTO characters SET char_id='".$charId."', char_name='".$_GET["login"]."_default', user_id = '".$id."'"; // $query = "INSERT INTO characters SET char_id='".$charId."', char_name='".$_GET["login"]."_default', user_id = '".$id."'";
// $result = mysql_query ($query) or die("Query ".$query." failed"); // $result = mysqli_query ($ringDb, $query) or die("Query ".$query." failed");
// } // }
} }
@ -269,24 +270,25 @@
setMsgLanguage($lang); setMsgLanguage($lang);
// we map the client application to the domain name $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName));
$domainName = $clientApplication; mysqli_select_db ($link, $DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName));
// we map the client application to the domain name
$domainName = mysqli_real_escape_string($link, $clientApplication);
$link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName));
mysql_select_db ($DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName));
// retreive the domain id // retreive the domain id
$query = "SELECT domain_id FROM domain WHERE domain_name='$domainName'"; $query = "SELECT domain_id FROM domain WHERE domain_name='$domainName'";
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
if (mysql_num_rows($result) == 0) if (mysqli_num_rows($result) == 0)
{ {
// unrecoverable error, we must giveup // unrecoverable error, we must giveup
$reason = errorMsg(3007, $domainName); $reason = errorMsg(3007, $domainName);
mysql_close($link); mysqli_close($link);
return false; return false;
} }
$row = mysql_fetch_array($result); $row = mysqli_fetch_array($result);
$domainId = $row[0]; $domainId = $row[0];
// retreive the domain info // retreive the domain info
@ -296,32 +298,34 @@
$accessPriv = strtoupper(substr($domainInfo['status'], 3)); $accessPriv = strtoupper(substr($domainInfo['status'], 3));
// now, retrieve the user infos // now, retrieve the user infos
$login = mysqli_real_escape_string($link, $login);
$query = "SELECT * FROM user where Login='$login'"; $query = "SELECT * FROM user where Login='$login'";
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
if (mysql_num_rows ($result) == 0) if (mysqli_num_rows ($result) == 0)
{ {
if ($AcceptUnknownUser) if ($AcceptUnknownUser)
{ {
// login doesn't exist, create it // login doesn't exist, create it
$password = mysqli_real_escape_string($link, $password);
$query = "INSERT INTO user (Login, Password) VALUES ('$login', '$password')"; $query = "INSERT INTO user (Login, Password) VALUES ('$login', '$password')";
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
// get the user to have his UId // get the user to have his UId
$query = "SELECT * FROM user WHERE Login='$login'"; $query = "SELECT * FROM user WHERE Login='$login'";
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
if (mysql_num_rows ($result) == 1) if (mysqli_num_rows ($result) == 1)
{ {
$reason = errorMsg(3008, $login); $reason = errorMsg(3008, $login);
$row = mysql_fetch_array ($result); $row = mysqli_fetch_assoc ($result);
$id = $row["UId"]; $id = $row["UId"];
$priv = $row["Privilege"]; $priv = $row["Privilege"];
$extended = $row["ExtendedPrivilege"]; $extended = $row["ExtendedPrivilege"];
// add the default permission // add the default permission
$query = "INSERT INTO permission (UId, ClientApplication, AccessPrivilege) VALUES ('$id', 'r2', '$accessPriv')"; $query = "INSERT INTO permission (UId, ClientApplication, AccessPrivilege) VALUES ('$id', 'r2', '$accessPriv')";
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
$res = false; $res = false;
} }
@ -335,9 +339,9 @@
{ {
// Check if this is not an unconfirmed account // Check if this is not an unconfirmed account
$query = "SELECT GamePassword, Email, Language FROM signup_data WHERE login='$login'"; $query = "SELECT GamePassword, Email, Language FROM signup_data WHERE login='$login'";
$result = mysql_query($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
if (mysql_num_rows($result) == 0) if (mysqli_num_rows($result) == 0)
{ {
$reason = errorMsg(2001, $login, 'checkUserValidity'); $reason = errorMsg(2001, $login, 'checkUserValidity');
$res = false; $res = false;
@ -346,7 +350,7 @@
{ {
// Check password to avoid revealing email address to third-party // Check password to avoid revealing email address to third-party
$passwordMatchedRow = false; $passwordMatchedRow = false;
while ($row = mysql_fetch_array($result)) while ($row = mysqli_fetch_assoc($result))
{ {
$salt = substr($row['GamePassword'],0,2); $salt = substr($row['GamePassword'],0,2);
if (($cp && $row['GamePassword'] == $password) || (!$cp && $row['GamePassword'] == crypt($password, $salt))) if (($cp && $row['GamePassword'] == $password) || (!$cp && $row['GamePassword'] == crypt($password, $salt)))
@ -369,7 +373,7 @@
} }
else else
{ {
$row = mysql_fetch_array ($result); $row = mysqli_fetch_assoc ($result);
$salt = substr($row["Password"],0,2); $salt = substr($row["Password"],0,2);
if (($cp && $row["Password"] == $password) || (!$cp && $row["Password"] == crypt($password, $salt))) if (($cp && $row["Password"] == $password) || (!$cp && $row["Password"] == crypt($password, $salt)))
{ {
@ -377,15 +381,16 @@
$_GET['login'] = $row['Login']; $_GET['login'] = $row['Login'];
// check if the user can use this application // check if the user can use this application
$clientApplication = mysqli_real_escape_string($link, $clientApplication);
$query = "SELECT * FROM permission WHERE UId='".$row["UId"]."' AND ClientApplication='$clientApplication'"; $query = "SELECT * FROM permission WHERE UId='".$row["UId"]."' AND ClientApplication='$clientApplication'";
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
if (mysql_num_rows ($result) == 0) if (mysqli_num_rows ($result) == 0)
{ {
if ($AcceptUnknownUser) if ($AcceptUnknownUser)
{ {
// add default permission // add default permission
$query = "INSERT INTO permission (UId, ClientApplication, ShardId, AccessPrivilege) VALUES ('".$row["UId"]."', '$clientApplication', -1, '$domainStatus')"; $query = "INSERT INTO permission (UId, ClientApplication, ShardId, AccessPrivilege) VALUES ('".$row["UId"]."', '$clientApplication', -1, '$domainStatus')";
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
$reason = errorMsg(3010); $reason = errorMsg(3010);
$res = false; $res = false;
@ -400,7 +405,7 @@
else else
{ {
// check that the access privilege for the domain // check that the access privilege for the domain
$permission = mysql_fetch_array($result); $permission = mysqli_fetch_assoc($result);
if (!strstr($permission['AccessPrivilege'], $accessPriv)) if (!strstr($permission['AccessPrivilege'], $accessPriv))
{ {
@ -409,7 +414,7 @@
{ {
// set an additionnal privilege for this player // set an additionnal privilege for this player
$query = "UPDATE permission set AccessPrivilege='".$permission['AccessPrivilege'].",$accessPriv' WHERE prim=".$permission['prim']; $query = "UPDATE permission set AccessPrivilege='".$permission['AccessPrivilege'].",$accessPriv' WHERE prim=".$permission['prim'];
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
$reason = errorMsg(3012, $accessPriv); $reason = errorMsg(3012, $accessPriv);
$res = false; $res = false;
@ -435,10 +440,10 @@
// $reason = $reason."was just disconnected. Now you can retry the identification (error code 54)"; // $reason = $reason."was just disconnected. Now you can retry the identification (error code 54)";
// //
// $query = "update shard set NbPlayers=NbPlayers-1 where ShardId=".$row["ShardId"]; // $query = "update shard set NbPlayers=NbPlayers-1 where ShardId=".$row["ShardId"];
// $result = mysql_query ($query) or die ("Can't execute the query: '$query' errno:".mysql_errno().": ".mysql_error()); // $result = mysqli_query ($link, $query) or die ("Can't execute the query: '$query' errno:".mysqli_errno($link).": ".mysqli_error($link));
// //
// $query = "update user set ShardId=-1, State='Offline' where UId=".$row["UId"]; // $query = "update user set ShardId=-1, State='Offline' where UId=".$row["UId"];
// $result = mysql_query ($query) or die ("Can't execute the query: '$query' errno:".mysql_errno().": ".mysql_error()); // $result = mysqli_query ($link, $query) or die ("Can't execute the query: '$query' errno:".mysqli_errno($link).": ".mysqli_error($link));
// } // }
// else // else
// { // {
@ -462,7 +467,7 @@
$res = false; $res = false;
} }
} }
mysql_close($link); mysqli_close($link);
return $res; return $res;
} }
@ -474,13 +479,14 @@
setMsgLanguage($lang); setMsgLanguage($lang);
$link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName)); $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName));
mysql_select_db ($DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName)); mysqli_select_db ($link, $DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName));
$login = mysqli_real_escape_string($link, $login);
$query = "SELECT Password FROM user WHERE Login='$login'"; $query = "SELECT Password FROM user WHERE Login='$login'";
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
if (mysql_num_rows ($result) != 1) if (mysqli_num_rows ($result) != 1)
{ {
if ($AcceptUnknownUser) if ($AcceptUnknownUser)
{ {
@ -492,17 +498,17 @@
{ {
// Check if this is not an unconfirmed account // Check if this is not an unconfirmed account
$query = "SELECT GamePassword, Language FROM signup_data WHERE login='$login'"; $query = "SELECT GamePassword, Language FROM signup_data WHERE login='$login'";
$result = mysql_query($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); $result = mysqli_query($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
if (mysql_num_rows($result) == 0) if (mysqli_num_rows($result) == 0)
{ {
// no user record, reject it // no user record, reject it
die (errorMsgBlock(2001, $login, 'askSalt')); die (errorMsgBlock(2001, $login, 'askSalt'));
} }
else if (mysql_num_rows($result) == 1) else if (mysqli_num_rows($result) == 1)
{ {
// one unconfirmed record, let the client send the encrypted password to get the corresponding email address // one unconfirmed record, let the client send the encrypted password to get the corresponding email address
$row = mysql_fetch_array($result); $row = mysqli_fetch_assoc($result);
$salt = substr($row['GamePassword'], 0, 2); $salt = substr($row['GamePassword'], 0, 2);
} }
else else
@ -511,7 +517,7 @@
{ {
// several matching records => display a multi-language message now // several matching records => display a multi-language message now
$languages = array(); $languages = array();
while ($row = mysql_fetch_array($result)) while ($row = mysqli_fetch_assoc($result))
{ {
$languages[$row['Language']] = true; $languages[$row['Language']] = true;
} }
@ -523,12 +529,11 @@
} }
else else
{ {
$res_array = mysql_fetch_array($result); $res_array = mysqli_fetch_assoc($result);
$salt = substr($res_array['Password'], 0, 2); $salt = substr($res_array['Password'], 0, 2);
} }
echo "1:".$salt; echo "1:".$salt;
mysql_close($link); mysqli_close($link);
} }
?>

View file

@ -16,9 +16,10 @@
$domainInfo = getDomainInfo($domainId); $domainInfo = getDomainInfo($domainId);
global $DBHost, $DBUserName, $DBPassword, $DBName, $RingDBName; global $DBHost, $RingDBUserName, $RingDBPassword, $RingDBName;
$link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die ("Can't connect to database host:$DBHost user:$DBUserName");
mysql_select_db ($RingDBName) or die ("Can't access to the db dbname:$RingDBName"); $link = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die ("Can't connect to database host:$DBHost user:$RingDBUserName");
mysqli_select_db($link, $RingDBName) or die ("Can't access to the db dbname:$RingDBName");
// Find out if the character has an open editing session // Find out if the character has an open editing session
$query = "SELECT session_id, state "; $query = "SELECT session_id, state ";
@ -26,8 +27,8 @@
$query .= " WHERE (owner = '".$charId."')"; $query .= " WHERE (owner = '".$charId."')";
$query .= " AND (session_type = 'st_edit')"; $query .= " AND (session_type = 'st_edit')";
$query .= " AND (NOT (state IN ('ss_closed', 'ss_locked')))"; $query .= " AND (NOT (state IN ('ss_closed', 'ss_locked')))";
$result = mysql_query ($query) or die ("Can't execute the query: ".$query); $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
$num = mysql_num_rows ($result); $num = mysqli_num_rows($result);
if ($num > 1) if ($num > 1)
{ {
echo "Error: more than one editing sessions for char".$charId; echo "Error: more than one editing sessions for char".$charId;
@ -39,11 +40,14 @@
{ {
// Not found => first, create an editing session for this character, start the session and invite himself // Not found => first, create an editing session for this character, start the session and invite himself
$query = "SELECT char_name FROM characters WHERE char_id = $charId"; $query = "SELECT char_name FROM characters WHERE char_id = $charId";
$result = mysql_query ($query) or die ("Can't execute the query: ".$query); $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
$num = mysql_num_rows ($result); $num = mysqli_num_rows($result);
$characterName = ""; $characterName = "";
if ($num > 0) if ($num > 0)
$characterName = mysql_result($result, 0, 0); {
$row = mysqli_fetch_assoc($result);
$characterName = $row['char_name'];
}
global $SessionId, $SessionToolsResult; global $SessionId, $SessionToolsResult;
planEditSession($charId, $domainId, "st_edit", $characterName, ""); planEditSession($charId, $domainId, "st_edit", $characterName, "");
if ($SessionToolsResult === false) if ($SessionToolsResult === false)
@ -55,7 +59,7 @@
} }
else else
{ {
$row = mysql_fetch_array($result); $row = mysqli_fetch_assoc($result);
$sessionId = $row['session_id']; $sessionId = $row['session_id'];
$state = $row['state']; $state = $row['state'];
echo "Found your session: $sessionId ($state)<br>"; echo "Found your session: $sessionId ($state)<br>";
@ -73,13 +77,12 @@
} }
// check that we character have a participation in the session and invite him if needed // check that we character have a participation in the session and invite him if needed
mysql_select_db ($RingDBName) or die ("Can't access to the db dbname:$RingDBName");
$query = "SELECT count(*) FROM session_participant WHERE session_id = $sessionId AND char_id = $charId"; $query = "SELECT count(*) FROM session_participant WHERE session_id = $sessionId AND char_id = $charId";
$result = mysql_query ($query) or die ("Can't execute the query: ".$query); $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
$num = mysql_num_rows ($result); $num = mysqli_num_rows($result);
if ($num != 1) if ($num != 1)
die ("Invalid result whil checking participation for char $charId in session $sessionId<br>"); die ("Invalid result whil checking participation for char $charId in session $sessionId<br>");
$value = mysql_fetch_array($result); $value = mysqli_fetch_row($result);
if ($value[0] == 0) if ($value[0] == 0)
{ {
// the character have not is own invitation ! // the character have not is own invitation !
@ -91,4 +94,4 @@
// Join the session // Join the session
joinSessionFromId($userId, $domainId, $sessionId); joinSessionFromId($userId, $domainId, $sessionId);
?>

View file

@ -42,24 +42,25 @@
if (isset($_POST["execute"])) if (isset($_POST["execute"]))
{ {
// lookup in the database to convert character name into // lookup in the database to convert character name into
global $DBHost, $DBUserName, $DBPassword, $RingDBName; global $DBHost, $RingDBUserName, $RingDBPassword, $RingDBName;
$link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die ("Can't connect to database host:$DBHost user:$DBUserName"); $link = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die ("Can't connect to database host:$DBHost user:$RingDBUserName");
mysql_select_db ($RingDBName) or die ("Can't access to the table dbname:$RingDBName"); mysqli_select_db($link, $RingDBName) or die ("Can't access to the table dbname:$RingDBName");
// extract the character that have the specified name // extract the character that have the specified name
$query = "select * from characters where char_name = '".$_POST["charName"]."'"; $charName = mysqli_real_escape_string($link, $_POST['charName']);
$result = mysql_query ($query) or die ("Can't execute the query: ".$query); $query = "select char_id, char_name from characters where char_name = '$charName'";
$result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
if (mysql_num_rows ($result) == 0) if (mysqli_num_rows($result) == 0)
{ {
echo "<h1>Can't find the character ".$_POST["charName"]."<h1>"; echo "<h1>Can't find the character ".$_POST["charName"]."<h1>";
} }
else else
{ {
$row = mysql_fetch_row($result); $row = mysqli_fetch_assoc($result);
$currentSession = $row[0]; $currentSession = $row['char_id'];
$currentchar = $row[1]; $currentchar = $row['char_name'];
// send the invitation info to the session manager // send the invitation info to the session manager
$invitePioneer = new InvitePioneerCb; $invitePioneer = new InvitePioneerCb;

View file

@ -184,13 +184,17 @@ function displayAllShards(&$onlineShardsBySessionId)
} }
// List all shards of the domain, including offline ones // List all shards of the domain, including offline ones
global $DBName; global $DBName, $DBHost, $DBUserName, $DBPassword;
mysql_select_db ($DBName) or die ("Can't access to the db dbname:$DBName"); $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die("Can't connect to nel database");
mysqli_select_db($link, $DBName) or die ("Can't access to the db dbname:$DBName");
$domainId = (int) $domainId;
$query = "select * from shard where domain_id = $domainId"; $query = "select * from shard where domain_id = $domainId";
$resShards = mysql_query ($query) or die ("Can't execute the query: ".$query." ".mysql_error()); $resShards = mysqli_query($link, $query) or die ("Can't execute the query: ".$query." ".mysqli_error($link));
echo "Select a shard to join:<br>"; echo "Select a shard to join:<br>";
//echo "<form name='far_tp' action='join_shard.php' method='post'>"; //echo "<form name='far_tp' action='join_shard.php' method='post'>";
while ($rowShard = mysql_fetch_array($resShards)) while ($rowShard = mysqli_fetch_assoc($resShards))
{ {
$mainlandSessionId = $rowShard['FixedSessionId']; $mainlandSessionId = $rowShard['FixedSessionId'];
$isOnline = isset($onlineShardsBySessionId[$mainlandSessionId]); $isOnline = isset($onlineShardsBySessionId[$mainlandSessionId]);
@ -245,4 +249,4 @@ function joinMainland($userId, $domainId)
global $FSHostResult; global $FSHostResult;
return $FSHostResult; return $FSHostResult;
} }
?>

View file

@ -108,19 +108,23 @@ function inviteOwnerInSession($charId, $domainId, $sessionId)
$RSMPort = $addr[1]; $RSMPort = $addr[1];
global $rsmProxy, $rsmSkel, $userId, $charId, $callbackClient, $RingDBName, /*$SessionId,*/ $SessionToolsResult; global $rsmProxy, $rsmSkel, $userId, $charId, $callbackClient, $RingDBName, /*$SessionId,*/ $SessionToolsResult;
global $DBHost, $RingDBUserName, $RingDBPassword;
$SessionId = $sessionId; $SessionId = $sessionId;
$DomainId = $domainId; $DomainId = $domainId;
mysql_select_db ($RingDBName) or die ("Can't access to the db dbname:$RingDBName"); $link = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die("Can't connect to ring database");
mysqli_select_db($link, $RingDBName) or die ("Can't access to the db dbname:$RingDBName");
$sessionId = (int) $sessionId;
$query = "select session_type from sessions where session_id=".$sessionId; $query = "select session_type from sessions where session_id=".$sessionId;
$result = mysql_query ($query) or die ("Can't execute the query: ".$query); $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
if (mysql_num_rows ($result) != 1) if (mysqli_num_rows($result) != 1)
{ {
echo "Can't find 1 row for ring session ".$sessionId."<br>"; echo "Can't find 1 row for ring session ".$sessionId."<br>";
die(); die();
} }
$row = mysql_fetch_row($result); $row = mysqli_fetch_row($result);
$session_type = $row[0]; $session_type = $row[0];
$mode = ($session_type == "st_edit") ? "sps_edit_invited" : "sps_anim_invited"; $mode = ($session_type == "st_edit") ? "sps_edit_invited" : "sps_anim_invited";
echo "Inviting character ".$charId." of user ".$userId." in session ".$sessionId."<br>"; echo "Inviting character ".$charId." of user ".$userId." in session ".$sessionId."<br>";
@ -184,4 +188,4 @@ class InviteOwnerCb extends CRingSessionManagerWeb
echo '<p><p><a href="web_start.php">Back to menu</a>'; echo '<p><p><a href="web_start.php">Back to menu</a>';
} }
} }
?>

View file

@ -6,19 +6,20 @@
{ {
global $DBHost, $DBUserName, $DBPassword, $DBName; global $DBHost, $DBUserName, $DBPassword, $DBName;
$nelDb = mysql_connect($DBHost, $DBUserName, $DBPassword) or die("can't connect to nel db"); $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die("can't connect to nel db");
mysql_select_db ($DBName, $nelDb) or die("can't select nel db"); mysqli_select_db ($link, $DBName) or die("can't select nel db");
$query = "SELECT * FROM domain WHERE domain_id = '".$domainId."'";
$result = mysql_query ($query) or die("query ".$query." failed"); $domainId = (int)$domainId;
$query = "SELECT * FROM domain WHERE domain_id = $domainId";
$result = mysqli_query($link, $query) or die("query ($query) failed");
if (mysql_num_rows($result) == 0) if (mysqli_num_rows($result) == 0)
{ {
die("Can't find row for domain ".$domainId); die("Can't find row for domain ".$domainId);
} }
$domainInfo = mysql_fetch_array($result); $domainInfo = mysqli_fetch_array($result);
return $domainInfo; return $domainInfo;
} }
?>

View file

@ -16,7 +16,7 @@
function validateCookie(&$userId, &$domainId, &$charId) function validateCookie(&$userId, &$domainId, &$charId)
{ {
global $DBHost, $DBUserName, $DBPassword, $DBName, $RingDBName, $AcceptUnknownUser; global $DBHost, $RingDBUserName, $RingDBPassword, $RingDBName, $AcceptUnknownUser;
if (!isset($_COOKIE["ryzomId"])) if (!isset($_COOKIE["ryzomId"]))
{ {
@ -40,18 +40,20 @@
} }
// check the cookie in the database // check the cookie in the database
$link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die ("Can't connect to database host:$DBHost user:$DBUserName"); $link = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die ("Can't connect to database host:$DBHost user:$RingDBUserName");
mysql_select_db ($RingDBName) or die ("Can't access to the table dbname:$RingDBName"); mysqli_select_db($link, $RingDBName) or die ("Can't access to the table dbname:$RingDBName");
$query = "SELECT user_id, current_status, current_domain_id FROM ring_users where cookie='$cookie'";
$result = mysql_query ($query) or die ("Can't execute the query: ".$query);
if (mysql_num_rows ($result) == 0) $cookie = mysqli_real_escape_string($link, $cookie);
$query = "SELECT user_id, current_status, current_domain_id FROM ring_users where cookie='$cookie'";
$result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
if (mysqli_num_rows($result) == 0)
{ {
echo "Can't find cookie $cookie in database<BR>"; echo "Can't find cookie $cookie in database<BR>";
return false; return false;
} }
$row = mysql_fetch_array($result); $row = mysqli_fetch_assoc($result);
if ($row["current_status"] != "cs_logged" && $row["current_status"] != "cs_online" ) if ($row["current_status"] != "cs_logged" && $row["current_status"] != "cs_online" )
{ {
@ -77,4 +79,4 @@
else else
return 0; // temp dev: use 0 as the "ring character" return 0; // temp dev: use 0 as the "ring character"
} }
?>

View file

@ -94,7 +94,13 @@ void initCamera()
if (hmdDeviceCfg == std::string("Auto") if (hmdDeviceCfg == std::string("Auto")
&& devices.begin() != devices.end()) && devices.begin() != devices.end())
{ {
deviceInfo = &devices[0]; for (std::vector<NL3D::CStereoDeviceInfo>::iterator it(devices.begin()), end(devices.end()); it != end; ++it)
{
if (it->AllowAuto)
{
deviceInfo = &devices[0];
}
}
} }
else else
{ {