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/*
build/*
install/*
code/nel/tools/build_gamedata/configuration/buildsite.py
# Linux nel compile
code/nel/build/nel-config

View file

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

View file

@ -9,7 +9,25 @@ IF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
SET(Freetype_FIND_QUIETLY TRUE)
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
PATHS
/usr/local/include
@ -21,9 +39,10 @@ FIND_PATH(FREETYPE_INCLUDE_DIR
PATH_SUFFIXES freetype2
)
IF(FREETYPE_INCLUDE_DIR)
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
ENDIF(FREETYPE_INCLUDE_DIR)
# combine both include directories into one variable
IF(FREETYPE_ADDITIONAL_INCLUDE_DIR)
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_ADDITIONAL_INCLUDE_DIR})
ENDIF(FREETYPE_ADDITIONAL_INCLUDE_DIR)
FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE
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}-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)
ELSE(IOS)
# 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)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names")

View file

@ -77,6 +77,7 @@ public:
std::string Manufacturer;
std::string ProductName;
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 ();
const UFormElm& getRootNode () 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;
uint getNumParent () const;
UForm *getParentForm (uint parent) const;
@ -73,7 +73,7 @@ public:
// ** IO functions
// 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

View file

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

View file

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

View file

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

View file

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

View file

@ -53,9 +53,8 @@ public:
/** Write the form in a stream.
*
* \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

View file

@ -90,6 +90,7 @@
# if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack or later
# define NL_ISO_STDTR1_AVAILABLE
# define NL_ISO_STDTR1_HEADER(header) <header>
# define NL_ISO_STDTR1_NAMESPACE std::tr1
# endif
# ifdef _DEBUG
# define NL_DEBUG
@ -153,8 +154,16 @@
#ifdef NL_COMP_GCC
# define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
# if GCC_VERSION > 40100
# define NL_ISO_STDTR1_AVAILABLE
# define NL_ISO_STDTR1_HEADER(header) <tr1/header>
// new libc++ bundled with clang under Mac OS X 10.9+ doesn't define __GLIBCXX__
# 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
@ -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)
# include NL_ISO_STDTR1_HEADER(unordered_map)
# include NL_ISO_STDTR1_HEADER(unordered_set)
# define CHashMap std::tr1::unordered_map
# define CHashSet std::tr1::unordered_set
# define CHashMultiMap std::tr1::unordered_multimap
# define CHashMap NL_ISO_STDTR1_NAMESPACE::unordered_map
# define CHashSet NL_ISO_STDTR1_NAMESPACE::unordered_set
# 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
# include <hash_map>
# include <hash_set>

View file

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

View file

@ -289,7 +289,7 @@ int main(void)
// 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.
NLMISC::COFile saveSample(sampleConfigFile);
form->write(saveSample, false);
form->write(saveSample);
nlinfo("Saved sample config file.");
} else {
// 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.ProductName = "Stereo Debugger";
devInfo.Serial = "NL-3D-DEBUG";
devInfo.AllowAuto = false;
devicesOut.push_back(devInfo);
}

View file

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

View file

@ -816,6 +816,7 @@ void CStereoOVR::listDevices(std::vector<CStereoDeviceInfo> &devicesOut)
deviceInfoOut.Library = CStereoDeviceInfo::OVR; // "Oculus SDK";
deviceInfoOut.Manufacturer = deviceInfo.Manufacturer;
deviceInfoOut.ProductName = deviceInfo.ProductName;
deviceInfoOut.AllowAuto = true;
stringstream ser;
ser << id;
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
if (filename)
@ -137,7 +137,7 @@ void CForm::write (xmlDocPtr doc, const char *filename, bool georges4CVS)
}
// 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
COXml xmlStream;
xmlStream.init (&stream);
// 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
_Filename = CFile::getFilename (filename);
@ -101,7 +101,7 @@ void CFormDfn::write (xmlDocPtr doc, const char *filename, bool georges4CVS)
}
// Header
Header.write (node, georges4CVS);
Header.write (node);
}
// ***************************************************************************

View file

@ -38,27 +38,16 @@ CFileHeader::CFileHeader ()
MajorVersion = 0;
MinorVersion = 0;
State = Modified;
Revision = "$R";
Revision += "evision$";
}
// ***************************************************************************
void CFileHeader::write (xmlNodePtr node, bool georges4CVS) const
void CFileHeader::write (xmlNodePtr node) const
{
// Version for CVS ?
if (georges4CVS)
{
// Georges version system
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);
}
// Georges version system
char tmp[512];
smprintf (tmp, 512, "%d.%d", MajorVersion, MinorVersion);
xmlSetProp (node, (const xmlChar*)"Version", (const xmlChar*)tmp);
// State
if (State == Modified)
@ -137,23 +126,6 @@ void CFileHeader::read (xmlNodePtr root)
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
value = (const char*)xmlGetProp (root, (xmlChar*)"State");
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
xmlNodePtr node = xmlNewDocNode (doc, NULL, (const xmlChar*)"TYPE", NULL);
@ -98,7 +98,7 @@ void CType::write (xmlDocPtr doc, bool georges4CVS) const
}
// Header
Header.write (node, georges4CVS);
Header.write (node);
}
// ***************************************************************************

View file

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

View file

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

View file

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

View file

@ -47,10 +47,6 @@ SOURCE_GROUP("r2" FILES ${SRC_R2})
# on Mac, create a .App Bundle
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_ICON_FILE "ryzom.icns")
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_melee_impact)
ADD_SUBDIRECTORY(pd_parser)
ADD_SUBDIRECTORY(translation_tools)
ADD_SUBDIRECTORY(assoc_mem)
ADD_SUBDIRECTORY(leveldesign)
ADD_SUBDIRECTORY(patch_gen)
ADD_SUBDIRECTORY(pdr_util)
ADD_SUBDIRECTORY(stats_scan)
ADD_SUBDIRECTORY(sheets_packer)
IF(WITH_LIGO)
ADD_SUBDIRECTORY(translation_tools)
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)
ADD_SUBDIRECTORY(client)

View file

@ -1,26 +1,39 @@
ADD_SUBDIRECTORY(alias_synchronizer)
ADD_SUBDIRECTORY(prim_export)
ADD_SUBDIRECTORY(uni_conv)
ADD_SUBDIRECTORY(csv_transform)
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(named_items_2_csv)
IF(WIN32)
ADD_SUBDIRECTORY(export)
ADD_SUBDIRECTORY(world_editor)
IF(WITH_LIGO)
ADD_SUBDIRECTORY(export)
ADD_SUBDIRECTORY(world_editor)
ENDIF(WITH_LIGO)
IF(WITH_MFC)
ADD_SUBDIRECTORY(mission_compiler_fe)
ADD_SUBDIRECTORY(georges_dll)
ADD_SUBDIRECTORY(georges_exe)
ADD_SUBDIRECTORY(georges_plugin_sound)
IF(WITH_LIGO)
ADD_SUBDIRECTORY(mission_compiler_fe)
ENDIF(WITH_LIGO)
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(WIN32)
IF(WITH_QT)
ADD_SUBDIRECTORY(georges_editor_qt)
IF(WITH_GEORGES)
ADD_SUBDIRECTORY(georges_editor_qt)
ENDIF(WITH_GEORGES)
ENDIF(WITH_QT)
# folders not handled yet.

View file

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

View file

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

View file

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

View file

@ -513,7 +513,7 @@ void CGeorgesImpl::MakeTyp( const std::string& filename, TType type, TUI ui, con
outputXml.init (&output);
// Write
t.write (outputXml.getDocument (), theApp.Georges4CVS);
t.write (outputXml.getDocument ());
}
catch (Exception &e)
{
@ -560,7 +560,7 @@ void CGeorgesImpl::createInstanceFile (const std::string &_sxFullnameWithoutExt,
if (f.open (fullName))
{
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();
f.close();
}

View file

@ -96,7 +96,6 @@ BOOL CHeaderDialog::OnInitDialog()
IncrementVersion.Create ("Increment Version", WS_VISIBLE|WS_TABSTOP, currentPos, this, BtIncrement);
initWidget (IncrementVersion);
getNextPos (currentPos);
IncrementVersion.EnableWindow ( theApp.Georges4CVS ? FALSE : TRUE );
// Create the state combo
setStaticSize (currentPos);
@ -243,55 +242,11 @@ void CHeaderDialog::getFromDocument (const NLGEORGES::CFileHeader &header)
{
if (View)
{
if (theApp.Georges4CVS)
{
// CVS revision number
IncrementVersion.EnableWindow ( theApp.Georges4CVS ? FALSE : TRUE );
// 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);
}
// 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
setEditTextMultiLine (Comments, header.Comments.c_str());

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -74,19 +74,21 @@
die2();
}
$domainName = getPost("domain");
$nelLink = mysql_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");
$nelLink = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die2 (__FILE__. " " .__LINE__." Can't connect to database host:$DBHost user:$DBUserName");
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'";
$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
$reason = "Can't find domain '".$domainName."' (error code x)";
$res = false;
}
$req = mysql_fetch_array($result);
$req = mysqli_fetch_array($result);
$backup_patch_url = $req["backup_patch_url"];
$patch_urls = $req["patch_urls"];
@ -114,7 +116,7 @@
}
echo "</version>\n";
mysql_close($nelLink);
mysqli_close($nelLink);
unset($nelLink);
break;
@ -124,4 +126,3 @@
}
?>

View file

@ -34,16 +34,16 @@
// gather the domain information (server version, patch urls and backup patch url
global $DBHost, $DBUserName, $DBPassword, $DBName, $AutoInsertInRing;
$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));
$link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName));
mysqli_select_db ($link, $DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName));
$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));
}
$row = mysql_fetch_array($result);
$row = mysqli_fetch_array($result);
// set the cookie
setcookie ( "ryzomId" , $cookie, 0, "/");
@ -178,27 +178,28 @@
{
////////////// Temporary code alpha 0 only /////////////////////////////////////
// check if the ring user exist, and create it if not
$ringDb = mysql_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));
$ringDb = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die(errorMsgBlock(3004, 'Ring', $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."'";
$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
$query = "INSERT INTO ring_users SET user_id = '".$id."', user_name = '".$_GET["login"]."', user_type='ut_pioneer'";
$result = mysql_query ($query) or die(errorMsgBlock(3006, $query, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName, mysql_error()));
$login = mysqli_real_escape_string($ringDb, $_GET['login']);
$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)
// $query = "SELECT user_id FROM characters where user_id = '".$id."'";
// $result = mysql_query ($query) or die("Query ".$query." failed");
// if (mysql_num_rows($result) == 0)
// $result = mysqli_query ($ringDb, $query) or die("Query ".$query." failed");
// if (mysqli_num_rows($result) == 0)
// {
// // no characters record, build a default one
// $charId = ($id * 16);
// $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);
// we map the client application to the domain name
$domainName = $clientApplication;
$link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName));
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
$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
$reason = errorMsg(3007, $domainName);
mysql_close($link);
mysqli_close($link);
return false;
}
$row = mysql_fetch_array($result);
$row = mysqli_fetch_array($result);
$domainId = $row[0];
// retreive the domain info
@ -296,32 +298,34 @@
$accessPriv = strtoupper(substr($domainInfo['status'], 3));
// now, retrieve the user infos
$login = mysqli_real_escape_string($link, $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)
{
// login doesn't exist, create it
$password = mysqli_real_escape_string($link, $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
$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);
$row = mysql_fetch_array ($result);
$row = mysqli_fetch_assoc ($result);
$id = $row["UId"];
$priv = $row["Privilege"];
$extended = $row["ExtendedPrivilege"];
// add the default permission
$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;
}
@ -335,9 +339,9 @@
{
// Check if this is not an unconfirmed account
$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');
$res = false;
@ -346,7 +350,7 @@
{
// Check password to avoid revealing email address to third-party
$passwordMatchedRow = false;
while ($row = mysql_fetch_array($result))
while ($row = mysqli_fetch_assoc($result))
{
$salt = substr($row['GamePassword'],0,2);
if (($cp && $row['GamePassword'] == $password) || (!$cp && $row['GamePassword'] == crypt($password, $salt)))
@ -369,7 +373,7 @@
}
else
{
$row = mysql_fetch_array ($result);
$row = mysqli_fetch_assoc ($result);
$salt = substr($row["Password"],0,2);
if (($cp && $row["Password"] == $password) || (!$cp && $row["Password"] == crypt($password, $salt)))
{
@ -377,15 +381,16 @@
$_GET['login'] = $row['Login'];
// 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'";
$result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error()));
if (mysql_num_rows ($result) == 0)
$result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
if (mysqli_num_rows ($result) == 0)
{
if ($AcceptUnknownUser)
{
// add default permission
$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);
$res = false;
@ -400,7 +405,7 @@
else
{
// check that the access privilege for the domain
$permission = mysql_fetch_array($result);
$permission = mysqli_fetch_assoc($result);
if (!strstr($permission['AccessPrivilege'], $accessPriv))
{
@ -409,7 +414,7 @@
{
// set an additionnal privilege for this player
$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);
$res = false;
@ -435,10 +440,10 @@
// $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"];
// $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"];
// $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
// {
@ -462,7 +467,7 @@
$res = false;
}
}
mysql_close($link);
mysqli_close($link);
return $res;
}
@ -474,13 +479,14 @@
setMsgLanguage($lang);
$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));
$link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $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'";
$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)
{
@ -492,17 +498,17 @@
{
// Check if this is not an unconfirmed account
$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
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
$row = mysql_fetch_array($result);
$row = mysqli_fetch_assoc($result);
$salt = substr($row['GamePassword'], 0, 2);
}
else
@ -511,7 +517,7 @@
{
// several matching records => display a multi-language message now
$languages = array();
while ($row = mysql_fetch_array($result))
while ($row = mysqli_fetch_assoc($result))
{
$languages[$row['Language']] = true;
}
@ -523,12 +529,11 @@
}
else
{
$res_array = mysql_fetch_array($result);
$res_array = mysqli_fetch_assoc($result);
$salt = substr($res_array['Password'], 0, 2);
}
echo "1:".$salt;
mysql_close($link);
mysqli_close($link);
}
?>

View file

@ -16,9 +16,10 @@
$domainInfo = getDomainInfo($domainId);
global $DBHost, $DBUserName, $DBPassword, $DBName, $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");
global $DBHost, $RingDBUserName, $RingDBPassword, $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
$query = "SELECT session_id, state ";
@ -26,8 +27,8 @@
$query .= " WHERE (owner = '".$charId."')";
$query .= " AND (session_type = 'st_edit')";
$query .= " AND (NOT (state IN ('ss_closed', 'ss_locked')))";
$result = mysql_query ($query) or die ("Can't execute the query: ".$query);
$num = mysql_num_rows ($result);
$result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
$num = mysqli_num_rows($result);
if ($num > 1)
{
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
$query = "SELECT char_name FROM characters WHERE char_id = $charId";
$result = mysql_query ($query) or die ("Can't execute the query: ".$query);
$num = mysql_num_rows ($result);
$result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
$num = mysqli_num_rows($result);
$characterName = "";
if ($num > 0)
$characterName = mysql_result($result, 0, 0);
{
$row = mysqli_fetch_assoc($result);
$characterName = $row['char_name'];
}
global $SessionId, $SessionToolsResult;
planEditSession($charId, $domainId, "st_edit", $characterName, "");
if ($SessionToolsResult === false)
@ -55,7 +59,7 @@
}
else
{
$row = mysql_fetch_array($result);
$row = mysqli_fetch_assoc($result);
$sessionId = $row['session_id'];
$state = $row['state'];
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
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";
$result = mysql_query ($query) or die ("Can't execute the query: ".$query);
$num = mysql_num_rows ($result);
$result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
$num = mysqli_num_rows($result);
if ($num != 1)
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)
{
// the character have not is own invitation !
@ -91,4 +94,4 @@
// Join the session
joinSessionFromId($userId, $domainId, $sessionId);
?>

View file

@ -42,24 +42,25 @@
if (isset($_POST["execute"]))
{
// 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");
mysql_select_db ($RingDBName) or die ("Can't access to the table 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 table dbname:$RingDBName");
// extract the character that have the specified name
$query = "select * from characters where char_name = '".$_POST["charName"]."'";
$result = mysql_query ($query) or die ("Can't execute the query: ".$query);
$charName = mysqli_real_escape_string($link, $_POST['charName']);
$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>";
}
else
{
$row = mysql_fetch_row($result);
$currentSession = $row[0];
$currentchar = $row[1];
$row = mysqli_fetch_assoc($result);
$currentSession = $row['char_id'];
$currentchar = $row['char_name'];
// send the invitation info to the session manager
$invitePioneer = new InvitePioneerCb;

View file

@ -184,13 +184,17 @@ function displayAllShards(&$onlineShardsBySessionId)
}
// List all shards of the domain, including offline ones
global $DBName;
mysql_select_db ($DBName) or die ("Can't access to the db dbname:$DBName");
global $DBName, $DBHost, $DBUserName, $DBPassword;
$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";
$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 "<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'];
$isOnline = isset($onlineShardsBySessionId[$mainlandSessionId]);
@ -245,4 +249,4 @@ function joinMainland($userId, $domainId)
global $FSHostResult;
return $FSHostResult;
}
?>

View file

@ -108,19 +108,23 @@ function inviteOwnerInSession($charId, $domainId, $sessionId)
$RSMPort = $addr[1];
global $rsmProxy, $rsmSkel, $userId, $charId, $callbackClient, $RingDBName, /*$SessionId,*/ $SessionToolsResult;
global $DBHost, $RingDBUserName, $RingDBPassword;
$SessionId = $sessionId;
$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;
$result = mysql_query ($query) or die ("Can't execute the query: ".$query);
if (mysql_num_rows ($result) != 1)
$result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
if (mysqli_num_rows($result) != 1)
{
echo "Can't find 1 row for ring session ".$sessionId."<br>";
die();
}
$row = mysql_fetch_row($result);
$row = mysqli_fetch_row($result);
$session_type = $row[0];
$mode = ($session_type == "st_edit") ? "sps_edit_invited" : "sps_anim_invited";
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>';
}
}
?>

View file

@ -6,19 +6,20 @@
{
global $DBHost, $DBUserName, $DBPassword, $DBName;
$nelDb = mysql_connect($DBHost, $DBUserName, $DBPassword) or die("can't connect to nel db");
mysql_select_db ($DBName, $nelDb) or die("can't select nel db");
$query = "SELECT * FROM domain WHERE domain_id = '".$domainId."'";
$result = mysql_query ($query) or die("query ".$query." failed");
$link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die("can't connect to nel db");
mysqli_select_db ($link, $DBName) or die("can't select nel db");
$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);
}
$domainInfo = mysql_fetch_array($result);
$domainInfo = mysqli_fetch_array($result);
return $domainInfo;
}
?>

View file

@ -16,7 +16,7 @@
function validateCookie(&$userId, &$domainId, &$charId)
{
global $DBHost, $DBUserName, $DBPassword, $DBName, $RingDBName, $AcceptUnknownUser;
global $DBHost, $RingDBUserName, $RingDBPassword, $RingDBName, $AcceptUnknownUser;
if (!isset($_COOKIE["ryzomId"]))
{
@ -40,18 +40,20 @@
}
// check the cookie in the database
$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 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);
$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 table dbname:$RingDBName");
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>";
return false;
}
$row = mysql_fetch_array($result);
$row = mysqli_fetch_assoc($result);
if ($row["current_status"] != "cs_logged" && $row["current_status"] != "cs_online" )
{
@ -77,4 +79,4 @@
else
return 0; // temp dev: use 0 as the "ring character"
}
?>

View file

@ -94,7 +94,13 @@ void initCamera()
if (hmdDeviceCfg == std::string("Auto")
&& 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
{