mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
CWE Directory Reorganization
Rearrange directory structure of CWE to be loosely equivalent to the H'uru Plasma repository. Part 1: Movement of directories and files.
This commit is contained in:
101
Sources/Plasma/NucleusLib/pnIni/Intern.h
Normal file
101
Sources/Plasma/NucleusLib/pnIni/Intern.h
Normal file
@ -0,0 +1,101 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Intern.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_INTERN_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Intern.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_INTERN_H
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Ini
|
||||
*
|
||||
***/
|
||||
|
||||
struct IniValue {
|
||||
ARRAY(wchar *) fArgs;
|
||||
IniKey * fKey;
|
||||
unsigned fIndex;
|
||||
unsigned fLineNum;
|
||||
|
||||
IniValue (IniKey * key, unsigned lineNum);
|
||||
~IniValue ();
|
||||
};
|
||||
|
||||
struct IniKey {
|
||||
HASHLINK(IniKey) fLink;
|
||||
ARRAY(IniValue *) fValues;
|
||||
IniSection * fSection;
|
||||
wchar fName[1]; // variable length
|
||||
// no more fields
|
||||
|
||||
IniKey (IniSection * section, const wchar name[]);
|
||||
~IniKey ();
|
||||
|
||||
unsigned GetHash () const;
|
||||
bool operator== (const CHashKeyStrPtrI & rhs) const;
|
||||
};
|
||||
|
||||
struct IniSection {
|
||||
HASHTABLEDECL(IniKey, CHashKeyStrPtrI, fLink) fKeys;
|
||||
HASHLINK(IniSection) fLink;
|
||||
wchar fName[1]; // variable length
|
||||
// no more fields
|
||||
|
||||
IniSection (const wchar name[]);
|
||||
~IniSection ();
|
||||
|
||||
unsigned GetHash () const;
|
||||
bool operator== (const CHashKeyStrPtrI & rhs) const;
|
||||
};
|
||||
|
||||
struct Ini {
|
||||
HASHTABLEDECL(IniSection, CHashKeyStrPtrI, fLink) fSections;
|
||||
|
||||
~Ini ();
|
||||
};
|
63
Sources/Plasma/NucleusLib/pnIni/Pch.h
Normal file
63
Sources/Plasma/NucleusLib/pnIni/Pch.h
Normal file
@ -0,0 +1,63 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Pch.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PCH_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Pch.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PCH_H
|
||||
|
||||
|
||||
#include "pnUtils/pnUtils.h"
|
||||
#include "pnProduct/pnProduct.h"
|
||||
#include "pnNetBase/pnNetBase.h"
|
||||
#include "pnAsyncCore/pnAsyncCore.h"
|
||||
|
||||
#include "Private/pnIniAllIncludes.h"
|
||||
#include "Intern.h"
|
||||
|
||||
|
||||
#include <malloc.h>
|
56
Sources/Plasma/NucleusLib/pnIni/Private/pnIniAllIncludes.h
Normal file
56
Sources/Plasma/NucleusLib/pnIni/Private/pnIniAllIncludes.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Private/pnIniAllIncludes.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PRIVATE_PNINIALLINCLUDES_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Private/pnIniAllIncludes.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PRIVATE_PNINIALLINCLUDES_H
|
||||
|
||||
|
||||
#include "pnIniCore.h"
|
||||
#include "pnIniChange.h"
|
||||
#include "pnIniSrv.h"
|
81
Sources/Plasma/NucleusLib/pnIni/Private/pnIniChange.h
Normal file
81
Sources/Plasma/NucleusLib/pnIni/Private/pnIniChange.h
Normal file
@ -0,0 +1,81 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Private/pnIniChange.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PRIVATE_PNINICHANGE_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Private/pnIniChange.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PRIVATE_PNINICHANGE_H
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Change notifications for files in the "./Config" directory
|
||||
*
|
||||
***/
|
||||
|
||||
struct IniChangeReg;
|
||||
|
||||
typedef void (* FIniFileChangeCallback)(const wchar fullPath[]);
|
||||
|
||||
void IniChangeInitialize (
|
||||
const wchar dir[] = L"Config"
|
||||
);
|
||||
void IniChangeDestroy ();
|
||||
|
||||
void IniChangeAdd (
|
||||
const wchar filename[], // just filename, no path or extension
|
||||
FIniFileChangeCallback callback,
|
||||
IniChangeReg ** reg
|
||||
);
|
||||
void IniChangeRemove (
|
||||
IniChangeReg * reg,
|
||||
bool wait
|
||||
);
|
||||
void IniChangeSignal (
|
||||
IniChangeReg * reg,
|
||||
bool wait
|
||||
);
|
786
Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp
Normal file
786
Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp
Normal file
@ -0,0 +1,786 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#include "../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Internal functions
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
static wchar * TrimWhitespace (wchar * name) {
|
||||
while (isspace((char) *name))
|
||||
++name;
|
||||
|
||||
for (wchar * term = name; *term; ++term) {
|
||||
if (isspace((char) *term)) {
|
||||
*term = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IniValue
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
IniValue::IniValue (IniKey * key, unsigned lineNum)
|
||||
: fKey(key)
|
||||
, fLineNum(lineNum)
|
||||
{
|
||||
fIndex = key->fValues.Add(this);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
IniValue::~IniValue () {
|
||||
wchar ** cur = fArgs.Ptr();
|
||||
wchar ** end = fArgs.Term();
|
||||
for (; cur < end; ++cur)
|
||||
FREE(*cur);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
static void AddValueString (
|
||||
IniValue * value,
|
||||
const wchar src[]
|
||||
) {
|
||||
unsigned chars = StrLen(src) + 1;
|
||||
wchar * dst = ALLOCA(wchar, chars);
|
||||
StrTokenize(&src, dst, chars, L" \t\r\n\"");
|
||||
value->fArgs.Add(StrDup(dst));
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IniKey
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
IniKey::IniKey (IniSection * section, const wchar name[])
|
||||
: fSection(section)
|
||||
{
|
||||
StrCopy(fName, name, (unsigned) -1);
|
||||
fSection->fKeys.Add(this);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
IniKey::~IniKey () {
|
||||
IniValue ** cur = fValues.Ptr();
|
||||
IniValue ** end = fValues.Term();
|
||||
for (; cur < end; ++cur)
|
||||
DEL(*cur);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
inline unsigned IniKey::GetHash () const {
|
||||
return StrHashI(fName);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
inline bool IniKey::operator== (const CHashKeyStrPtrI & rhs) const {
|
||||
return !StrCmpI(fName, rhs.GetString());
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
static IniValue * AddKeyValue (
|
||||
IniSection * section,
|
||||
wchar * string,
|
||||
unsigned lineNum
|
||||
) {
|
||||
string = TrimWhitespace(string);
|
||||
|
||||
// Find or create the key
|
||||
IniKey * key = section->fKeys.Find(string);
|
||||
if (!key) {
|
||||
key = new(ALLOC(
|
||||
sizeof(*key) - sizeof(key->fName) + StrBytes(string)
|
||||
)) IniKey(section, string);
|
||||
}
|
||||
|
||||
// Add a new value holder for the key
|
||||
return NEW(IniValue)(key, lineNum);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IniSection
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
IniSection::IniSection (const wchar name[]) {
|
||||
StrCopy(fName, name, (unsigned) -1);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
IniSection::~IniSection () {
|
||||
fKeys.Clear();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
inline unsigned IniSection::GetHash () const {
|
||||
return StrHashI(fName);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
inline bool IniSection::operator== (const CHashKeyStrPtrI & rhs) const {
|
||||
return !StrCmpI(fName, rhs.GetString());
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
static IniSection * AddSection (
|
||||
Ini * ini,
|
||||
wchar * string
|
||||
) {
|
||||
// Find or create the section
|
||||
IniSection * section = ini->fSections.Find(string);
|
||||
if (!section) {
|
||||
section = new(ALLOC(
|
||||
sizeof(*section) - sizeof(section->fName) + StrBytes(string)
|
||||
)) IniSection(string);
|
||||
ini->fSections.Add(section);
|
||||
}
|
||||
return section;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Ini
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
Ini::~Ini () {
|
||||
fSections.Clear();
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* ParseBuffer
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
static void ParseBuffer (
|
||||
Ini * ini,
|
||||
const wchar buffer[]
|
||||
) {
|
||||
|
||||
const wchar SECTION_OPEN_CHAR = '[';
|
||||
const wchar SECTION_CLOSE_CHAR = ']';
|
||||
const wchar EQUIVALENCE_CHAR = '=';
|
||||
const wchar VALUE_SEPARATOR = ',';
|
||||
const wchar COMMENT_CHAR = ';';
|
||||
const wchar QUOTE_CHAR = '\"';
|
||||
const wchar NEWLINE = '\n';
|
||||
|
||||
enum {
|
||||
STATE_BEGIN,
|
||||
STATE_NEWLINE,
|
||||
STATE_SECTION,
|
||||
STATE_STRIP_TRAILING,
|
||||
STATE_KEY,
|
||||
STATE_VALUE,
|
||||
} state = STATE_BEGIN;
|
||||
|
||||
IniSection * section = nil;
|
||||
IniValue * value = nil;
|
||||
const wchar * start = nil;
|
||||
bool valInQuotes = false;
|
||||
wchar dst[512];
|
||||
dst[0] = 0;
|
||||
|
||||
for (unsigned lineNum = 1;; ++buffer) {
|
||||
|
||||
// Get next character
|
||||
unsigned chr = *buffer;
|
||||
if (!chr)
|
||||
break;
|
||||
if (chr == '\r')
|
||||
continue;
|
||||
if (chr == '\n')
|
||||
++lineNum;
|
||||
if (chr == '\t')
|
||||
chr = ' ';
|
||||
|
||||
switch (state) {
|
||||
case STATE_BEGIN:
|
||||
ASSERT(chr == UNICODE_BOM);
|
||||
state = STATE_NEWLINE;
|
||||
break;
|
||||
|
||||
case STATE_NEWLINE:
|
||||
if (chr == NEWLINE)
|
||||
break;
|
||||
if (chr == ' ')
|
||||
break;
|
||||
if (chr == SECTION_OPEN_CHAR) {
|
||||
start = buffer + 1;
|
||||
state = STATE_SECTION;
|
||||
}
|
||||
else if (chr == COMMENT_CHAR) {
|
||||
state = STATE_STRIP_TRAILING;
|
||||
}
|
||||
else {
|
||||
start = buffer;
|
||||
state = STATE_KEY;
|
||||
}
|
||||
break;
|
||||
|
||||
case STATE_SECTION:
|
||||
if (chr == NEWLINE) {
|
||||
state = STATE_NEWLINE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (chr == SECTION_CLOSE_CHAR) {
|
||||
StrCopy(dst, start, min(buffer - start + 1, arrsize(dst)));
|
||||
section = AddSection(ini, dst);
|
||||
state = STATE_STRIP_TRAILING;
|
||||
}
|
||||
break;
|
||||
|
||||
case STATE_STRIP_TRAILING:
|
||||
if (chr == NEWLINE)
|
||||
state = STATE_NEWLINE;
|
||||
break;
|
||||
|
||||
case STATE_KEY:
|
||||
if (chr == NEWLINE) {
|
||||
state = STATE_NEWLINE;
|
||||
break;
|
||||
}
|
||||
if (chr != EQUIVALENCE_CHAR)
|
||||
break;
|
||||
|
||||
if (!section) {
|
||||
state = STATE_STRIP_TRAILING;
|
||||
break;
|
||||
}
|
||||
|
||||
StrCopy(dst, start, min(buffer - start + 1, arrsize(dst)));
|
||||
value = AddKeyValue(section, dst, lineNum);
|
||||
start = buffer + 1;
|
||||
state = STATE_VALUE;
|
||||
valInQuotes = false;
|
||||
break;
|
||||
|
||||
case STATE_VALUE:
|
||||
if (chr == QUOTE_CHAR)
|
||||
valInQuotes = !valInQuotes;
|
||||
if ((valInQuotes || chr != VALUE_SEPARATOR) && (chr != NEWLINE))
|
||||
break;
|
||||
if (!value) {
|
||||
state = chr == NEWLINE ? STATE_NEWLINE : STATE_STRIP_TRAILING;
|
||||
break;
|
||||
}
|
||||
if (valInQuotes) {
|
||||
state = chr == NEWLINE ? STATE_NEWLINE : STATE_STRIP_TRAILING;
|
||||
break;
|
||||
}
|
||||
|
||||
StrCopy(dst, start, min(buffer - start + 1, arrsize(dst)));
|
||||
AddValueString(value, dst);
|
||||
if (chr == VALUE_SEPARATOR)
|
||||
start = buffer + 1;
|
||||
else
|
||||
state = STATE_NEWLINE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// cleanup current value
|
||||
if (state == STATE_VALUE) {
|
||||
StrCopy(dst, start, min(buffer - start + 1, arrsize(dst)));
|
||||
AddValueString(value, dst);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* ParseFile
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
static void IniFileNotifyProc (
|
||||
AsyncFile ,
|
||||
EAsyncNotifyFile ,
|
||||
AsyncNotifyFile * ,
|
||||
void **
|
||||
) {
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
static bool ParseFile (
|
||||
Ini * ini,
|
||||
const wchar fileName[]
|
||||
) {
|
||||
// Open file
|
||||
qword fileSize;
|
||||
qword fileLastWriteTime;
|
||||
EFileError error;
|
||||
AsyncFile file = AsyncFileOpen(
|
||||
fileName,
|
||||
IniFileNotifyProc,
|
||||
&error,
|
||||
kAsyncFileReadAccess,
|
||||
kAsyncFileModeOpenExisting,
|
||||
kAsyncFileShareRead,
|
||||
nil,
|
||||
&fileSize,
|
||||
&fileLastWriteTime
|
||||
);
|
||||
if (!file)
|
||||
return false;
|
||||
|
||||
bool result;
|
||||
if (fileSize > 256 * 1024) {
|
||||
result = false;
|
||||
}
|
||||
else if (!fileSize) {
|
||||
result = true;
|
||||
}
|
||||
else {
|
||||
// Read entire file into memory and NULL terminate wchar
|
||||
byte * buffer = (byte *) ALLOC((unsigned) fileSize + sizeof(wchar));
|
||||
AsyncFileRead(file, 0, buffer, (unsigned) fileSize, kAsyncFileRwSync, nil);
|
||||
* (wchar *) &buffer[fileSize] = 0;
|
||||
|
||||
// Convert to unicode if necessary
|
||||
if (* (wchar *) buffer != UNICODE_BOM) {
|
||||
byte * src = buffer;
|
||||
// Allocate two extra spaces for UNICODE_BOM and terminator
|
||||
unsigned newBufferSize = ((unsigned) fileSize + 2) * sizeof(wchar);
|
||||
|
||||
// Allocate new buffer
|
||||
wchar * dst = (wchar *) ALLOC(newBufferSize);
|
||||
|
||||
// If it's UTF-8 file,convert to Unicode
|
||||
if (StrCmpI((char *)buffer, UTF8_BOM, StrLen(UTF8_BOM)) == 0) {
|
||||
// StrUtf8ToUnicode will convert UTF8_BOM to UNICODE_BOM
|
||||
StrUtf8ToUnicode(dst, (char *)src, newBufferSize);
|
||||
}
|
||||
else {
|
||||
// do simple conversion to Unicode
|
||||
dst[0] = UNICODE_BOM;
|
||||
for (unsigned index = 0;; ++index) {
|
||||
if (0 == (dst[index + 1] = src[index]))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
FREE(src);
|
||||
buffer = (byte *) dst;
|
||||
}
|
||||
|
||||
ParseBuffer(ini, (const wchar *) buffer);
|
||||
FREE(buffer);
|
||||
result = true;
|
||||
}
|
||||
|
||||
AsyncFileClose(file, kAsyncFileDontTruncate);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
Ini * IniOpen (
|
||||
const wchar fileName[]
|
||||
) {
|
||||
Ini * ini = NEW(Ini);
|
||||
if (!ParseFile(ini, fileName)) {
|
||||
IniClose(ini);
|
||||
return nil;
|
||||
}
|
||||
return ini;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
void IniClose (Ini * ini) {
|
||||
DEL(ini);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
const IniSection * IniGetFirstSection (
|
||||
const Ini * ini,
|
||||
wchar * name,
|
||||
unsigned chars
|
||||
) {
|
||||
if (chars)
|
||||
*name = 0;
|
||||
if (!ini)
|
||||
return nil;
|
||||
|
||||
const IniSection * section = ini->fSections.Head();
|
||||
if (section)
|
||||
StrCopy(name, section->fName, chars);
|
||||
return section;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
const IniSection * IniGetNextSection (
|
||||
const IniSection * section,
|
||||
wchar * name,
|
||||
unsigned chars
|
||||
) {
|
||||
if (chars)
|
||||
*name = 0;
|
||||
if (!section)
|
||||
return nil;
|
||||
|
||||
section = section->fLink.Next();
|
||||
if (section)
|
||||
StrCopy(name, section->fName, chars);
|
||||
return section;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
const IniSection * IniGetSection (
|
||||
const Ini * ini,
|
||||
const wchar name[]
|
||||
) {
|
||||
if (!ini)
|
||||
return nil;
|
||||
|
||||
return ini->fSections.Find(
|
||||
CHashKeyStrPtrI(name)
|
||||
);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
const IniKey * IniGetFirstKey (
|
||||
const IniSection * section,
|
||||
wchar * name,
|
||||
unsigned chars
|
||||
) {
|
||||
if (chars)
|
||||
*name = 0;
|
||||
if (!section)
|
||||
return nil;
|
||||
|
||||
const IniKey * key = section->fKeys.Head();
|
||||
if (key)
|
||||
StrCopy(name, key->fName, chars);
|
||||
return key;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
const IniKey * IniGetFirstKey (
|
||||
const Ini * ini,
|
||||
const wchar sectionName[],
|
||||
wchar * name,
|
||||
unsigned chars
|
||||
) {
|
||||
if (const IniSection * section = IniGetSection(ini, sectionName))
|
||||
return IniGetFirstKey(section, name, chars);
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
const IniKey * IniGetNextKey (
|
||||
const IniKey * key,
|
||||
wchar * name,
|
||||
unsigned chars
|
||||
) {
|
||||
if (chars)
|
||||
*name = 0;
|
||||
if (!key)
|
||||
return nil;
|
||||
|
||||
key = key->fLink.Next();
|
||||
if (key)
|
||||
StrCopy(name, key->fName, chars);
|
||||
return key;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
const IniKey * IniGetKey (
|
||||
const IniSection * section,
|
||||
const wchar name[]
|
||||
) {
|
||||
if (!section)
|
||||
return nil;
|
||||
|
||||
return section->fKeys.Find(
|
||||
CHashKeyStrPtrI(name)
|
||||
);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
const IniValue * IniGetFirstValue (
|
||||
const IniKey * key,
|
||||
unsigned * lineNum
|
||||
) {
|
||||
if (lineNum)
|
||||
*lineNum = 0;
|
||||
|
||||
const IniValue * value = nil;
|
||||
for (;;) {
|
||||
if (!key)
|
||||
break;
|
||||
|
||||
value = key->fValues[0];
|
||||
if (lineNum)
|
||||
*lineNum = value->fLineNum;
|
||||
break;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
const IniValue * IniGetFirstValue (
|
||||
const IniSection * section,
|
||||
const wchar keyName[],
|
||||
unsigned * lineNum
|
||||
) {
|
||||
const IniValue * value = nil;
|
||||
if (lineNum)
|
||||
*lineNum = 0;
|
||||
|
||||
for (;;) {
|
||||
if (!section)
|
||||
break;
|
||||
|
||||
const IniKey * key = section->fKeys.Find(
|
||||
CHashKeyStrPtrI(keyName)
|
||||
);
|
||||
value = IniGetFirstValue(key, lineNum);
|
||||
break;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
const IniValue * IniGetFirstValue (
|
||||
const Ini * ini,
|
||||
const wchar sectionName[],
|
||||
const wchar keyName[],
|
||||
unsigned * lineNum
|
||||
) {
|
||||
const IniValue * value = nil;
|
||||
if (lineNum)
|
||||
*lineNum = 0;
|
||||
|
||||
for (;;) {
|
||||
if (!ini)
|
||||
break;
|
||||
|
||||
const IniSection * section = ini->fSections.Find(
|
||||
CHashKeyStrPtrI(sectionName)
|
||||
);
|
||||
|
||||
value = IniGetFirstValue(section, keyName, lineNum);
|
||||
break;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
const IniValue * IniGetNextValue (
|
||||
const IniValue * value,
|
||||
unsigned * lineNum
|
||||
) {
|
||||
if (lineNum)
|
||||
*lineNum = 0;
|
||||
|
||||
const IniKey * key = value->fKey;
|
||||
if (value->fIndex + 1 < key->fValues.Count()) {
|
||||
value = key->fValues[value->fIndex + 1];
|
||||
if (lineNum)
|
||||
*lineNum = value->fLineNum;
|
||||
}
|
||||
else {
|
||||
value = nil;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
bool IniGetUnsigned (
|
||||
const IniValue * value,
|
||||
unsigned * result,
|
||||
unsigned index,
|
||||
unsigned defaultValue
|
||||
) {
|
||||
ASSERT(result);
|
||||
|
||||
for (;;) {
|
||||
if (!value)
|
||||
break;
|
||||
|
||||
wchar str[32];
|
||||
if (!IniGetString(value, str, arrsize(str), index, nil))
|
||||
break;
|
||||
|
||||
if (!str[0])
|
||||
break;
|
||||
|
||||
*result = StrToUnsigned(str, nil, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
*result = defaultValue;
|
||||
return false;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
bool IniGetString (
|
||||
const IniValue * value,
|
||||
wchar * result,
|
||||
unsigned resultChars,
|
||||
unsigned index,
|
||||
const wchar defaultValue[]
|
||||
) {
|
||||
ASSERT(result);
|
||||
|
||||
bool found = value && index < value->fArgs.Count();
|
||||
|
||||
if (found)
|
||||
StrCopy(result, value->fArgs[index], resultChars);
|
||||
else if (defaultValue)
|
||||
StrCopy(result, defaultValue, resultChars);
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
bool IniGetUuid (
|
||||
const IniValue * value,
|
||||
Uuid * uuid,
|
||||
unsigned index,
|
||||
const Uuid & defaultValue
|
||||
) {
|
||||
wchar str[128];
|
||||
if (IniGetString(value, str, arrsize(str), index, nil))
|
||||
return GuidFromString(str, uuid);
|
||||
else
|
||||
*uuid = defaultValue;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
unsigned IniGetBoundedValue (
|
||||
const IniValue * value,
|
||||
const wchar section[],
|
||||
const wchar key[],
|
||||
unsigned index,
|
||||
unsigned minVal,
|
||||
unsigned maxVal,
|
||||
unsigned defVal
|
||||
) {
|
||||
REF(key);
|
||||
REF(section);
|
||||
|
||||
if (!value)
|
||||
return defVal;
|
||||
|
||||
unsigned result;
|
||||
IniGetUnsigned(value, &result, index, defVal);
|
||||
if ((result < minVal) || (result > maxVal)) {
|
||||
result = defVal;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
unsigned IniGetBoundedValue (
|
||||
const Ini * ini,
|
||||
const wchar section[],
|
||||
const wchar key[],
|
||||
unsigned index,
|
||||
unsigned minVal,
|
||||
unsigned maxVal,
|
||||
unsigned defVal
|
||||
) {
|
||||
unsigned lineNum;
|
||||
const IniValue * value = IniGetFirstValue(
|
||||
ini,
|
||||
section,
|
||||
key,
|
||||
&lineNum
|
||||
);
|
||||
|
||||
return IniGetBoundedValue(
|
||||
value,
|
||||
section,
|
||||
key,
|
||||
index,
|
||||
minVal,
|
||||
maxVal,
|
||||
defVal
|
||||
);
|
||||
}
|
170
Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.h
Normal file
170
Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.h
Normal file
@ -0,0 +1,170 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PRIVATE_PNINICORE_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PRIVATE_PNINICORE_H
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Ini file parsing functions
|
||||
*
|
||||
***/
|
||||
|
||||
struct Ini;
|
||||
struct IniKey;
|
||||
struct IniValue;
|
||||
struct IniSection;
|
||||
|
||||
|
||||
// File
|
||||
Ini * IniOpen (
|
||||
const wchar filename[]
|
||||
);
|
||||
void IniClose (
|
||||
Ini * ini
|
||||
);
|
||||
|
||||
// Section
|
||||
const IniSection * IniGetFirstSection (
|
||||
const Ini * ini,
|
||||
wchar * name,
|
||||
unsigned chars
|
||||
);
|
||||
const IniSection * IniGetNextSection (
|
||||
const IniSection * section,
|
||||
wchar * name,
|
||||
unsigned chars
|
||||
);
|
||||
const IniSection * IniGetSection (
|
||||
const Ini * ini,
|
||||
const wchar name[]
|
||||
);
|
||||
|
||||
// Key
|
||||
const IniKey * IniGetFirstKey (
|
||||
const IniSection * section,
|
||||
wchar * name,
|
||||
unsigned chars
|
||||
);
|
||||
const IniKey * IniGetFirstKey (
|
||||
const Ini * ini,
|
||||
const wchar sectionName[],
|
||||
wchar * name,
|
||||
unsigned chars
|
||||
);
|
||||
const IniKey * IniGetNextKey (
|
||||
const IniKey * key,
|
||||
wchar * name,
|
||||
unsigned chars
|
||||
);
|
||||
const IniKey * IniGetKey (
|
||||
const IniSection * ini,
|
||||
const wchar name[]
|
||||
);
|
||||
|
||||
// Value
|
||||
const IniValue * IniGetFirstValue (
|
||||
const IniKey * key,
|
||||
unsigned * iter
|
||||
);
|
||||
const IniValue * IniGetFirstValue (
|
||||
const IniSection * section,
|
||||
const wchar keyName[],
|
||||
unsigned * iter
|
||||
);
|
||||
const IniValue * IniGetFirstValue (
|
||||
const Ini * ini,
|
||||
const wchar sectionName[],
|
||||
const wchar keyName[],
|
||||
unsigned * iter
|
||||
);
|
||||
const IniValue * IniGetNextValue (
|
||||
const IniValue * value,
|
||||
unsigned * iter
|
||||
);
|
||||
|
||||
// Data
|
||||
bool IniGetUnsigned (
|
||||
const IniValue * value,
|
||||
unsigned * result,
|
||||
unsigned index = 0,
|
||||
unsigned defaultValue = 0
|
||||
);
|
||||
bool IniGetString (
|
||||
const IniValue * value,
|
||||
wchar * result,
|
||||
unsigned resultChars,
|
||||
unsigned index = 0,
|
||||
const wchar defaultValue[] = nil
|
||||
);
|
||||
bool IniGetUuid (
|
||||
const IniValue * value,
|
||||
Uuid * result,
|
||||
unsigned index = 0,
|
||||
const Uuid & defaultValue = kNilGuid
|
||||
);
|
||||
|
||||
// Bounded values
|
||||
unsigned IniGetBoundedValue (
|
||||
const Ini * ini,
|
||||
const wchar sectionName[],
|
||||
const wchar keyName[],
|
||||
unsigned index,
|
||||
unsigned minVal,
|
||||
unsigned maxVal,
|
||||
unsigned defVal
|
||||
);
|
||||
unsigned IniGetBoundedValue (
|
||||
const IniValue * value,
|
||||
unsigned index,
|
||||
unsigned minVal,
|
||||
unsigned maxVal,
|
||||
unsigned defVal
|
||||
);
|
56
Sources/Plasma/NucleusLib/pnIni/Private/pnIniSrv.cpp
Normal file
56
Sources/Plasma/NucleusLib/pnIni/Private/pnIniSrv.cpp
Normal file
@ -0,0 +1,56 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Private/pnIniSrv.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#include "../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
|
||||
|
||||
#endif
|
77
Sources/Plasma/NucleusLib/pnIni/Private/pnIniSrv.h
Normal file
77
Sources/Plasma/NucleusLib/pnIni/Private/pnIniSrv.h
Normal file
@ -0,0 +1,77 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Private/pnIniSrv.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PRIVATE_PNINISRV_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnIni/Private/pnIniSrv.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PRIVATE_PNINISRV_H
|
||||
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* ServerRights API
|
||||
*
|
||||
***/
|
||||
|
||||
// These values may never change because server modules
|
||||
// must use the same values as plServer.exe
|
||||
enum EServerRights {
|
||||
kSrvRightsNone = 0,
|
||||
kSrvRightsBasic = 1,
|
||||
kSrvRightsServer = 2,
|
||||
kNumSrvRights
|
||||
};
|
||||
|
||||
EServerRights SrvIniGetServerRightsByNode (NetAddressNode addrNode);
|
||||
EServerRights SrvIniGetServerRights (const NetAddress & addr);
|
||||
void SrvIniParseServerRights (Ini * ini);
|
||||
|
||||
|
||||
#endif
|
53
Sources/Plasma/NucleusLib/pnIni/pnIni.h
Normal file
53
Sources/Plasma/NucleusLib/pnIni/pnIni.h
Normal file
@ -0,0 +1,53 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnIni/pnIni.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PNINI_H
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PNINI_H
|
||||
|
||||
#include "Private/pnIniAllIncludes.h"
|
||||
|
||||
#endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNINI_PNINI_H
|
Reference in New Issue
Block a user