Restructure repository to include all source folders

Move git root from Client/ to src/ to track all source code:
- Client: Game client source (moved to Client/Client/)
- Server: Game server source
- GameTools: Development tools
- CryptoSource: Encryption utilities
- database: Database scripts
- Script: Game scripts
- rylCoder_16.02.2008_src: Legacy coder tools
- GMFont, Game: Additional resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-29 20:17:20 +09:00
parent 5d3cd64a25
commit dd97ddec92
11602 changed files with 1446576 additions and 0 deletions

View File

@@ -0,0 +1,220 @@
#ifndef _MATH_CONVERT_INLINE_H_
#define _MATH_CONVERT_INLINE_H_
#include <cstdlib>
#include <tchar.h>
inline void Math::Convert::Hex08ToStr( char *szDest, BYTE hex )
{
*((WORD *) szDest) = m_FastHeToBi[ hex ]; szDest += 2;
*(szDest) = '\0';
}
inline void Math::Convert::Hex16ToStr( char *szDest, WORD hex )
{
LPBYTE pSrc = (LPBYTE) &hex;
#ifdef BIG_ENDIAN
*((WORD *) (szDest + 0)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 2)) = m_FastHeToBi[ *(pSrc++) ];
#else
*((WORD *) (szDest + 2)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 0)) = m_FastHeToBi[ *(pSrc++) ];
#endif
*(szDest + 4) = '\0';
}
inline void Math::Convert::Hex32ToStr( char *szDest, DWORD hex )
{
LPBYTE pSrc = (LPBYTE) &hex;
#ifdef BIG_ENDIAN
*((WORD *) (szDest + 0)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 2)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 4)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 6)) = m_FastHeToBi[ *(pSrc++) ];
#else
*((WORD *) (szDest + 6)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 4)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 2)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 0)) = m_FastHeToBi[ *(pSrc++) ];
#endif
*(szDest + 8) = '\0';
}
inline void Math::Convert::Hex64ToStr( char *szDest, DWORD64 hex )
{
LPBYTE pSrc = (LPBYTE) &hex;
#ifdef BIG_ENDIAN
*((WORD *) (szDest + 0)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 2)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 4)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 6)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 8)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 10)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 12)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 14)) = m_FastHeToBi[ *(pSrc++) ];
#else
*((WORD *) (szDest + 14)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 12)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 10)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 8)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 6)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 4)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 2)) = m_FastHeToBi[ *(pSrc++) ];
*((WORD *) (szDest + 0)) = m_FastHeToBi[ *(pSrc++) ];
#endif
*(szDest + 16) = '\0';
}
//
// this function returns the equivalent binary value for an individual character specified in the ascii format
inline UCHAR Math::Convert::BiToHe(char cBin)
{
if((cBin >= '0') && (cBin <= '9'))
{
return (cBin - '0');
}
else if((cBin >= 'A') && (cBin <= 'F'))
{
return (cBin - 'A' + 0xA);
}
if((cBin >= 'a') && (cBin <= 'f'))
{
return (cBin -'a' + 0xA);
}
return cBin;
}
inline void Math::Convert::AcToHe(char *szDst, char *szSrc, int iCount)
{
while(iCount--)
{
*szDst = BiToHe(*szSrc) << 4;
*szSrc++;
*szDst += BiToHe(*szSrc);
*szSrc++;
*szDst++;
}
}
inline BYTE Math::Convert::StrToHex08(const char *szSrc)
{
const char* pStart = szSrc + 2;
BYTE cHex = 0;
unsigned char c1, c2;
for (int i=0; i<1; ++i)
{
c1 = BiToHe(*pStart++);
c1 <<= (8*(7-i)+4);
c2 = BiToHe(*pStart++);
c2 <<= (8*(7-i));
cHex += (c1 + c2);
}
return cHex;
}
inline WORD Math::Convert::StrToHex16(const char *szSrc)
{
const char* pStart = szSrc + 2;
WORD sHex = 0;
for (int i=0; i<2; i++)
{
WORD s1 = BiToHe(*pStart++);
s1 <<= (8*(1-i)+4);
WORD s2 = BiToHe(*pStart++);
s2 <<= (8*(1-i));
WORD sRet = s1 + s2;
sHex += sRet;
}
return sHex;
}
// convert string to hexadecimal value
inline DWORD Math::Convert::StrToHex32(const char *szSrc)
{
const char* pStart = szSrc + 2;
DWORD nHex = 0;
for (int i=0; i<4; i++)
{
DWORD n1 = BiToHe(*pStart++);
n1 <<= (8*(3-i)+4);
DWORD n2 = BiToHe(*pStart++);
n2 <<= (8*(3-i));
DWORD nRet = n1 + n2;
nHex += nRet;
}
return nHex;
}
// convert string to hexadecimal value
inline DWORD64 Math::Convert::StrToHex64(const char *szSrc)
{
const char* pStart = szSrc + 2;
DWORD64 dlHex = 0;
for (int i=0; i<8; i++)
{
DWORD64 dl1 = BiToHe(*pStart++);
dl1 <<= (8*(7-i)+4);
DWORD64 dl2 = BiToHe(*pStart++);
dl2 <<= (8*(7-i));
DWORD64 dlRet = dl1 + dl2;
dlHex += dlRet;
}
return dlHex;
}
inline BYTE Math::Convert::Atoc(char *szSrc)
{
return (0 == strncmp(szSrc, "0x", 2)) ? StrToHex08(szSrc) : (BYTE) _ttol(szSrc);
}
//
// TCHAR *<2A><> <20><>Ĩ<EFBFBD>ô<EFBFBD>! (By Standil)
//
inline WORD Math::Convert::Atos(char *szSrc)
{
return (0 == strncmp(szSrc, "0x", 2)) ? StrToHex16(szSrc) : _ttoi(szSrc);
}
//
// TCHAR *<2A><> <20><>Ĩ<EFBFBD>ô<EFBFBD>! (By Standil)
//
inline DWORD Math::Convert::Atoi(char *szSrc)
{
return (0 == strncmp(szSrc, "0x", 2)) ? StrToHex32(szSrc) : _ttol(szSrc);
}
//
// TCHAR *<2A><> <20><>Ĩ<EFBFBD>ô<EFBFBD>! (By Standil)
//
inline DWORD64 Math::Convert::Atol64( char *szSrc )
{
return (0 == strncmp(szSrc, "0x", 2)) ? StrToHex64(szSrc) : _ttoi64(szSrc);
}
#endif

View File

@@ -0,0 +1,83 @@
// FastMath.cpp: implementation of the CFastMath class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Math.h"
///////////////////////////////////////////////////////////////////////////////////////////////
// utility functions
// 0 -0x7FFFFFFF.
unsigned long Math::Random::ComplexRandom(int nExtent)
{
if (nExtent < 1)
{
return 1;
}
static unsigned long x = 1;
static unsigned long c = 0;
static unsigned long a = 2083801278UL;
#define addto(rh,rl,ah,al) (rl) = ((rl) + (al)) & 0xFFFFFFFFUL; \
(rh) = ((rh) + (ah) + (((rl) < (al)) ? 1 : 0)) & 0xFFFFFFFFUL
unsigned long xl = (x & 0xFFFFUL);
unsigned long xh = (x >> 16) & 0xFFFFUL;
unsigned long al = (a & 0xFFFFUL);
unsigned long ah = (a >> 16) & 0xFFFFUL;
unsigned long tmp;
x = c;
c = 0;
tmp = xl * al;
addto(c, x, 0, tmp);
tmp = xl * ah;
addto(c, x, (tmp >> 16), (tmp & 0xFFFFUL) << 16);
tmp = xh * ah;
addto(c, x, tmp, 1);
tmp = xh * al;
addto(c, x, (tmp >> 16), (tmp & 0xFFFFUL) << 16);
return (x % nExtent); // return x & 0x7FFFFFFFUL;
}
// This table only works on Little Endian(Byte Order) machine.
const unsigned short Math::Convert::m_FastHeToBi[0x100] =
{
0x3030, 0x3130, 0x3230, 0x3330, 0x3430, 0x3530, 0x3630, 0x3730,
0x3830, 0x3930, 0x4130, 0x4230, 0x4330, 0x4430, 0x4530, 0x4630,
0x3031, 0x3131, 0x3231, 0x3331, 0x3431, 0x3531, 0x3631, 0x3731,
0x3831, 0x3931, 0x4131, 0x4231, 0x4331, 0x4431, 0x4531, 0x4631,
0x3032, 0x3132, 0x3232, 0x3332, 0x3432, 0x3532, 0x3632, 0x3732,
0x3832, 0x3932, 0x4132, 0x4232, 0x4332, 0x4432, 0x4532, 0x4632,
0x3033, 0x3133, 0x3233, 0x3333, 0x3433, 0x3533, 0x3633, 0x3733,
0x3833, 0x3933, 0x4133, 0x4233, 0x4333, 0x4433, 0x4533, 0x4633,
0x3034, 0x3134, 0x3234, 0x3334, 0x3434, 0x3534, 0x3634, 0x3734,
0x3834, 0x3934, 0x4134, 0x4234, 0x4334, 0x4434, 0x4534, 0x4634,
0x3035, 0x3135, 0x3235, 0x3335, 0x3435, 0x3535, 0x3635, 0x3735,
0x3835, 0x3935, 0x4135, 0x4235, 0x4335, 0x4435, 0x4535, 0x4635,
0x3036, 0x3136, 0x3236, 0x3336, 0x3436, 0x3536, 0x3636, 0x3736,
0x3836, 0x3936, 0x4136, 0x4236, 0x4336, 0x4436, 0x4536, 0x4636,
0x3037, 0x3137, 0x3237, 0x3337, 0x3437, 0x3537, 0x3637, 0x3737,
0x3837, 0x3937, 0x4137, 0x4237, 0x4337, 0x4437, 0x4537, 0x4637,
0x3038, 0x3138, 0x3238, 0x3338, 0x3438, 0x3538, 0x3638, 0x3738,
0x3838, 0x3938, 0x4138, 0x4238, 0x4338, 0x4438, 0x4538, 0x4638,
0x3039, 0x3139, 0x3239, 0x3339, 0x3439, 0x3539, 0x3639, 0x3739,
0x3839, 0x3939, 0x4139, 0x4239, 0x4339, 0x4439, 0x4539, 0x4639,
0x3041, 0x3141, 0x3241, 0x3341, 0x3441, 0x3541, 0x3641, 0x3741,
0x3841, 0x3941, 0x4141, 0x4241, 0x4341, 0x4441, 0x4541, 0x4641,
0x3042, 0x3142, 0x3242, 0x3342, 0x3442, 0x3542, 0x3642, 0x3742,
0x3842, 0x3942, 0x4142, 0x4242, 0x4342, 0x4442, 0x4542, 0x4642,
0x3043, 0x3143, 0x3243, 0x3343, 0x3443, 0x3543, 0x3643, 0x3743,
0x3843, 0x3943, 0x4143, 0x4243, 0x4343, 0x4443, 0x4543, 0x4643,
0x3044, 0x3144, 0x3244, 0x3344, 0x3444, 0x3544, 0x3644, 0x3744,
0x3844, 0x3944, 0x4144, 0x4244, 0x4344, 0x4444, 0x4544, 0x4644,
0x3045, 0x3145, 0x3245, 0x3345, 0x3445, 0x3545, 0x3645, 0x3745,
0x3845, 0x3945, 0x4145, 0x4245, 0x4345, 0x4445, 0x4545, 0x4645,
0x3046, 0x3146, 0x3246, 0x3346, 0x3446, 0x3546, 0x3646, 0x3746,
0x3846, 0x3946, 0x4146, 0x4246, 0x4346, 0x4446, 0x4546, 0x4646,
};

View File

@@ -0,0 +1,92 @@
// FastMath.h: interface for the CFastMath class.
//
//////////////////////////////////////////////////////////////////////
#ifndef _CUSTOM_MATH_FUNCTIONS_H_
#define _CUSTOM_MATH_FUNCTIONS_H_
#include <winsock2.h>
#include <windows.h>
#include <cmath>
namespace Math
{
namespace Convert
{
extern const unsigned short m_FastHeToBi[0x100];
// SPX, IPX <20>ּ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20>Լ<EFBFBD>
inline unsigned char BiToHe(char cBin);
inline void AcToHe(char *szDst, char *szSrc, int iCount);
// String<6E><67> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ٲ<EFBFBD>(String<6E><67> 0x<30><78> <20><><EFBFBD><EFBFBD> Hex string<6E>̴<EFBFBD>.)
inline BYTE StrToHex08(const char *szSrc);
inline WORD StrToHex16(const char *szSrc);
inline DWORD StrToHex32(const char *szSrc);
inline DWORD64 StrToHex64(const char *szSrc);
// String<6E><67> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ٲ<EFBFBD>(0x<30><78> <20>ٴ<EFBFBD><D9B4><EFBFBD>, <20><><EFBFBD><EFBFBD> <20>ʴ<EFBFBD><CAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ٲ<EFBFBD> <20><> <20>ִ<EFBFBD>)
inline BYTE Atoc(char *szSrc);
inline WORD Atos(char *szSrc);
inline DWORD Atoi(char *szSrc);
inline DWORD64 Atol64(char *szSrc);
// <20><><EFBFBD><EFBFBD> Hex String<6E><67><EFBFBD><EFBFBD> <20>ٲ<EFBFBD>
inline void Hex08ToStr(char *szDest, BYTE hex);
inline void Hex16ToStr(char *szDest, WORD hex);
inline void Hex32ToStr(char *szDest, DWORD hex);
inline void Hex64ToStr(char *szDest, DWORD64 hex);
};
namespace Random
{
// <20><><EFBFBD>ϰ<EFBFBD><CFB0><EFBFBD> 0 ~ nExtent - 1<><31> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>´<EFBFBD>.
unsigned long ComplexRandom(int nExtent); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
};
namespace HashFunc
{
// -------------------------------------------------------------------------------------------------
// String-to-Hash <20>Լ<EFBFBD><D4BC><EFBFBD> : http://www.cs.yorku.ca/~oz/hash.html <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
inline unsigned long djb2Hash(const unsigned char *str); // first reported by dan bernstein
inline unsigned long sdbmHash(const unsigned char *str); // this is one of the algorithms used in berkeley db
inline unsigned long looseHash(const unsigned char *str); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ؽ<EFBFBD>. <20>׳<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
};
};
#include "Convert.inl"
inline unsigned long Math::HashFunc::djb2Hash(const unsigned char *str)
{
unsigned long hash = 5381;
int c;
while (c = *str++) { hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ }
return hash;
}
inline unsigned long Math::HashFunc::sdbmHash(const unsigned char *str)
{
unsigned long hash = 0;
int c;
while (c = *str++) { hash = c + (hash << 6) + (hash << 16) - hash; }
return hash;
}
inline unsigned long Math::HashFunc::looseHash(const unsigned char *str)
{
unsigned int hash = 0;
int c;
while (c = *str++) { hash += c; }
return hash;
}
#endif // !defined(AFX_FASTMATH_H__ED69578B_18C1_42EA_9C5E_888DC38101C2__INCLUDED_)