1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-20 11:47:48 +00:00

Initial commit of the FFXIV 1.0 lobby server.

This commit is contained in:
Filip Maj 2015-08-26 13:38:58 -04:00
commit c1e214175f
48 changed files with 55780 additions and 0 deletions

7
.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
FFXIVClassic_Lobby_Server/bin/
FFXIVClassic_Lobby_Server/obj/
ipch/
Blowfish/Debug/
Debug/
FFXIVClassic_Lobby_Server.opensdf
FFXIVClassic_Lobby_Server.sdf

95
Blowfish/Blowfish.vcxproj Normal file
View file

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Blowfish</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BLOWFISH_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile />
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BLOWFISH_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="blowfish.h" />
<ClInclude Include="cbasetypes.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="blowfish.cpp" />
<ClCompile Include="dllmain.cpp">
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</PrecompiledHeader>
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="blowfish.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cbasetypes.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="blowfish.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

48
Blowfish/ReadMe.txt Normal file
View file

@ -0,0 +1,48 @@
========================================================================
DYNAMIC LINK LIBRARY : Blowfish Project Overview
========================================================================
AppWizard has created this Blowfish DLL for you.
This file contains a summary of what you will find in each of the files that
make up your Blowfish application.
Blowfish.vcxproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
Blowfish.vcxproj.filters
This is the filters file for VC++ projects generated using an Application Wizard.
It contains information about the association between the files in your project
and the filters. This association is used in the IDE to show grouping of files with
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
"Source Files" filter).
Blowfish.cpp
This is the main DLL source file.
When created, this DLL does not export any symbols. As a result, it
will not produce a .lib file when it is built. If you wish this project
to be a project dependency of some other project, you will either need to
add code to export some symbols from the DLL so that an export library
will be produced, or you can set the Ignore Input Library property to Yes
on the General propert page of the Linker folder in the project's Property
Pages dialog box.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named Blowfish.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

443
Blowfish/blowfish.cpp Normal file
View file

@ -0,0 +1,443 @@
#ifdef little_endian /* Eg: Intel */
#include <dos.h>
#include <graphics.h>
#include <io.h>
#endif
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#ifdef little_endian /* Eg: Intel */
#include <alloc.h>
#endif
#include <ctype.h>
#ifdef little_endian /* Eg: Intel */
#include <dir.h>
#include <bios.h>
#endif
#ifdef big_endian
#include <Types.h>
#endif
#include "BLOWFISH.H"
#define N 16
#define noErr 0
#define DATAERROR -1
#define KEYBYTES 8
//uint32 P[N + 2];
uint32 S[4][256];
uint8 P_values[(N + 2) * 4] =
{
0x88, 0x6A, 0x3F, 0x24, 0xD3, 0x08, 0xA3, 0x85, 0x2E, 0x8A, 0x19, 0x13, 0x44, 0x73, 0x70, 0x03,
0x22, 0x38, 0x09, 0xA4, 0xD0, 0x31, 0x9F, 0x29, 0x98, 0xFA, 0x2E, 0x08, 0x89, 0x6C, 0x4E, 0xEC,
0xE6, 0x21, 0x28, 0x45, 0x77, 0x13, 0xD0, 0x38, 0xCF, 0x66, 0x54, 0xBE, 0x6C, 0x0C, 0xE9, 0x34,
0xB7, 0x29, 0xAC, 0xC0, 0xDD, 0x50, 0x7C, 0xC9, 0xB5, 0xD5, 0x84, 0x3F, 0x17, 0x09, 0x47, 0xB5,
0xD9, 0xD5, 0x16, 0x92, 0x1B, 0xFB, 0x79, 0x89
};
uint8 S_values[4 * 4 * 256] =
{
0xA6, 0x0B, 0x31, 0xD1, 0xAC, 0xB5, 0xDF, 0x98, 0xDB, 0x72, 0xFD, 0x2F, 0xB7, 0xDF, 0x1A, 0xD0,
0xED, 0xAF, 0xE1, 0xB8, 0x96, 0x7E, 0x26, 0x6A, 0x45, 0x90, 0x7C, 0xBA, 0x99, 0x7F, 0x2C, 0xF1,
0x47, 0x99, 0xA1, 0x24, 0xF7, 0x6C, 0x91, 0xB3, 0xE2, 0xF2, 0x01, 0x08, 0x16, 0xFC, 0x8E, 0x85,
0xD8, 0x20, 0x69, 0x63, 0x69, 0x4E, 0x57, 0x71, 0xA3, 0xFE, 0x58, 0xA4, 0x7E, 0x3D, 0x93, 0xF4,
0x8F, 0x74, 0x95, 0x0D, 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 0x77, 0xCE, 0xE3, 0xDF, 0x8F, 0x57, 0xE6, 0x72, 0xC3, 0x3A
};
uint32 F(uint32 x)
{
uint16 a;
uint16 b;
uint16 c;
uint16 d;
uint32 y;
d = x & 0x00FF;
x >>= 8;
c = x & 0x00FF;
x >>= 8;
b = x & 0x00FF;
x >>= 8;
a = x & 0x00FF;
//y = ((S[0][a] + S[1][b]) ^ S[2][c]) + S[3][d];
y = S[0][a] + S[1][b];
y = y ^ S[2][c];
y = y + S[3][d];
return y;
}
__declspec(dllexport) void blowfish_encipher(uint32 *xl, uint32 *xr, uint32 * P)
{
uint32 Xl;
uint32 Xr;
uint32 temp;
int16 i;
Xl = *xl;
Xr = *xr;
for (i = 0; i < N; ++i) {
Xl = Xl ^ P[i];
Xr = F(Xl) ^ Xr;
temp = Xl;
Xl = Xr;
Xr = temp;
}
temp = Xl;
Xl = Xr;
Xr = temp;
Xr = Xr ^ P[N];
Xl = Xl ^ P[N + 1];
*xl = Xl;
*xr = Xr;
}
__declspec(dllexport) void blowfish_decipher(uint32 *xl, uint32 *xr, uint32 * P)
{
uint32 Xl;
uint32 Xr;
uint32 temp;
int16 i;
Xl = *xl;
Xr = *xr;
for (i = N + 1; i > 1; --i) {
Xl = Xl ^ P[i];
Xr = F(Xl) ^ Xr;
/* Exchange Xl and Xr */
temp = Xl;
Xl = Xr;
Xr = temp;
}
/* Exchange Xl and Xr */
temp = Xl;
Xl = Xr;
Xr = temp;
Xr = Xr ^ P[1];
Xl = Xl ^ P[0];
*xl = Xl;
*xr = Xr;
}
__declspec(dllexport) int16 initializeBlowfish(char key[], int16 keybytes, uint32 * P)
{
int16 i;
int16 j;
int16 k;
uint32 data;
uint32 datal;
uint32 datar;
memcpy(P, &P_values, sizeof(P_values));
memcpy(&S, &S_values, sizeof(S_values));
j = 0;
for (i = 0; i < N + 2; ++i)
{
data = 0x00000000;
for (k = 0; k < 4; ++k)
{
data = (data << 8) | key[j];
j = j + 1;
if (j >= keybytes)
{
j = 0;
}
}
P[i] = P[i] ^ data;
}
datal = 0x00000000;
datar = 0x00000000;
for (i = 0; i < N + 2; i += 2)
{
blowfish_encipher(&datal, &datar, P);
P[i] = datal;
P[i + 1] = datar;
}
for (i = 0; i < 4; ++i)
{
for (j = 0; j < 256; j += 2)
{
blowfish_encipher(&datal, &datar, P);
S[i][j] = datal;
S[i][j + 1] = datar;
}
}
return 0;
}

18
Blowfish/blowfish.h Normal file
View file

@ -0,0 +1,18 @@
#include "cbasetypes.h"
#define MAXKEYBYTES 56 /* 448 bits */
#define little_endian 1 /* Eg: Intel */
//#define big_endian 1 /* Eg: Motorola */
#ifdef __cplusplus
extern "C"
{
#endif
int16 opensubkeyfile(void);
uint32 F(uint32 x);
__declspec(dllexport) void blowfish_encipher(uint32 *xl, uint32 *xr, uint32 * P);
__declspec(dllexport) void blowfish_decipher(uint32 *xl, uint32 *xr, uint32 * P);
__declspec(dllexport) short initializeBlowfish(char key[], int16 keybytes, uint32 * P);
#ifdef __cplusplus
}
#endif

333
Blowfish/cbasetypes.h Normal file
View file

@ -0,0 +1,333 @@
#ifndef _CBASETYPES_H_
#define _CBASETYPES_H_
#include <stdint.h>
/* +--------+-----------+--------+---------+
* | ILP32 | LP64 | ILP64 | (LL)P64 |
* +------------+--------+-----------+--------+---------+
* | ints | 32-bit | 32-bit | 64-bit | 32-bit |
* | longs | 32-bit | 64-bit | 64-bit | 32-bit |
* | long-longs | 64-bit | 64-bit | 64-bit | 64-bit |
* | pointers | 32-bit | 64-bit | 64-bit | 64-bit |
* +------------+--------+-----------+--------+---------+
* | where | -- | Tiger | Alpha | Windows |
* | used | | Unix | Cray | |
* | | | Sun & SGI | | |
* +------------+--------+-----------+--------+---------+
* Taken from http://developer.apple.com/macosx/64bit.html
*/
//////////////////////////////////////////////////////////////////////////
// basic include for all basics
// introduces types and global functions
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// setting some defines on platforms
//////////////////////////////////////////////////////////////////////////
#if (defined(__WIN32__) || defined(__WIN32) || defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(WIN32)
#define WIN32
#endif
#if defined(__MINGW32__) && !defined(MINGW)
#define MINGW
#endif
#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && !defined(CYGWIN)
#define CYGWIN
#endif
#if !defined(__64BIT__) && (defined(__x86_64__) || defined(_WIN64))
#define __64BIT__
#endif
// debug mode
#if defined(_DEBUG) && !defined(DEBUG)
#define DEBUG
#endif
// debug function name
#ifndef __NETBSD__
#if __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
# define __func__ __FUNCTION__
# else
# define __func__ ""
# endif
#endif
#endif
// disable attributed stuff on non-GNU
#if !defined(__GNUC__) && !defined(MINGW)
# define __attribute__(x)
#endif
// define a break macro for debugging.
#if defined(DEBUG)
#if defined(_MSC_VER)
#define DSP_DEBUG_BREAK_IF(_CONDITION_) if (_CONDITION_) {__debugbreak();}
#else
#include "assert.h"
#define DSP_DEBUG_BREAK_IF(_CONDITION_) assert(!(_CONDITION_));
#endif
#else
#define DSP_DEBUG_BREAK_IF(_CONDITION_)
#endif
//////////////////////////////////////////////////////////////////////////
// typedefs to compensate type size change from 32bit to 64bit
// MS implements LLP64 model, normal unix does LP64,
// only Silicon Graphics/Cray goes ILP64 so don't care (and don't support)
//////////////////////////////////////////////////////////////////////////
#include <limits.h>
// ILP64 isn't supported, so always 32 bits?
#ifndef UINT_MAX
#define UINT_MAX 0xffffffff
#endif
//////////////////////////////////////////////////////////////////////////
// Integers with guaranteed _exact_ size.
//////////////////////////////////////////////////////////////////////////
#define SIZEOF_LONG 4
#define SIZEOF_INT 4
#define HAVE_INT_8_16_32
typedef char int8;
typedef short int16;
typedef int int32;
typedef signed char sint8;
typedef signed short sint16;
typedef signed int sint32;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
#undef UINT8_MIN
#undef UINT16_MIN
#undef UINT32_MIN
//--
#define UINT8_MIN ((uint8) 0)
#define UINT16_MIN ((uint16)0)
#define UINT32_MIN ((uint32)0)
//***************
#undef SINT8_MIN
#undef SINT16_MIN
#undef SINT32_MIN
//---
#define SINT8_MIN ((sint8) 0x80)
#define SINT16_MIN ((sint16)0x8000)
#define SINT32_MIN ((sint32)0x80000000)
//****************
#undef SINT8_MAX
#undef SINT16_MAX
#undef SINT32_MAX
//--
#define SINT8_MAX ((sint8) 0x7F)
#define SINT16_MAX ((sint16)0x7FFF)
#define SINT32_MAX ((sint32)0x7FFFFFFF)
//****************
//////////////////////////////////////////////////////////////////////////
// Integers with guaranteed _minimum_ size.
// These could be larger than you expect,
// they are designed for speed.
//////////////////////////////////////////////////////////////////////////
typedef long int ppint;
typedef long int ppint8;
typedef long int ppint16;
typedef long int ppint32;
typedef unsigned long int ppuint;
typedef unsigned long int ppuint8;
typedef unsigned long int ppuint16;
typedef unsigned long int ppuint32;
//////////////////////////////////////////////////////////////////////////
// integer with exact processor width (and best speed)
//////////////////////////////
#include <stddef.h> // size_t
#if defined(WIN32) && !defined(MINGW) // does not have a signed size_t
//////////////////////////////
#if defined(_WIN64) // naive 64bit windows platform
typedef __int64 ssize_t;
#else
typedef int ssize_t;
#endif
//////////////////////////////
#endif
//////////////////////////////
//////////////////////////////////////////////////////////////////////////
// portable 64-bit integers
//////////////////////////////////////////////////////////////////////////
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 int64;
typedef signed __int64 sint64;
typedef unsigned __int64 uint64;
#define LLCONST(a) (a##i64)
#else
typedef long long int64;
typedef signed long long sint64;
typedef unsigned long long uint64;
#define LLCONST(a) (a##ll)
#endif
//////////////////////////////////////////////////////////////////////////
// pointer sized integers
//////////////////////////////////////////////////////////////////////////
#undef UINTPTR_MIN
#undef UINTPTR_MAX
#undef INTPTR_MIN
#undef INTPTR_MAX
#ifdef __64BIT__
typedef uint64 uintptr;
typedef int64 intptr;
#define UINTPTR_MIN UINT64_MIN
#define UINTPTR_MAX UINT64_MAX
#define INTPTR_MIN INT64_MIN;
#define INTPTR_MAX INT64_MAX;
#else
typedef uint32 uintptr;
typedef int32 intptr;
#define UINTPTR_MIN UINT32_MIN
#define UINTPTR_MAX UINT32_MAX
#endif
//////////////////////////////////////////////////////////////////////////
// some redefine of function redefines for some Compilers
//////////////////////////////////////////////////////////////////////////
#if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(__BORLANDC__)
#define strcasecmp stricmp
#define strncasecmp strnicmp
#define strncmpi strnicmp
#define snprintf _snprintf
#if defined(_MSC_VER) && _MSC_VER < 1400
#define vsnprintf _vsnprintf
#endif
#elif !defined(_MSC_VER)
#define strcmpi strcasecmp
#define stricmp strcasecmp
#define strncmpi strncasecmp
#define strnicmp strncasecmp
#endif
#if defined(_MSC_VER) && _MSC_VER > 1200
#define strtoull _strtoui64
#endif
// keyword replacement in windows for MSVC versions lower than 11 (2012)
#ifdef _WIN32
#if defined(_MSC_VER) && _MSC_VER < 1700
#define inline __inline
#endif
#endif
///////////////////////////////
// for those still not building c++
#ifndef __cplusplus
//////////////////////////////
// boolean types for C
typedef char bool;
#define false (1==0)
#define true (1==1)
//////////////////////////////
#endif // not cplusplus
//////////////////////////////
#ifdef __cplusplus
#include <algorithm>
#endif
#define dsp_max(a,b) (((a) > (b)) ? (a) : (b))
#define dsp_min(a,b) (((a) < (b)) ? (a) : (b))
#define dsp_cap(a, min, max) ((a >= max) ? max : (a <= min) ? min : a) // caps values to min/max
//////////////////////////////////////////////////////////////////////////
// should not happen
#ifndef NULL
#define NULL (void *)0
#endif
//////////////////////////////////////////////////////////////////////////
// number of bits in a byte
#ifndef NBBY
#define NBBY 8
#endif
//////////////////////////////////////////////////////////////////////////
// path separator
#if defined(WIN32)
#define PATHSEP '\\'
#elif defined(__APPLE__)
#define PATHSEP ':'
#else
#define PATHSEP '/'
#endif
//////////////////////////////////////////////////////////////////////////
// Assert
#if ! defined(Assert)
#if defined(RELEASE)
#define Assert(EX)
#else
#include <assert.h>
#if !defined(DEFCPP) && defined(WIN32) && !defined(MINGW)
#include <crtdbg.h>
#endif
#define Assert(EX) assert(EX)
#endif
#endif /* ! defined(Assert) */
//////////////////////////////////////////////////////////////////////////
// Has to be unsigned to avoid problems in some systems
// Problems arise when these functions expect an argument in the range [0,256[ and are fed a signed char.
#include <ctype.h>
#define ISALNUM(c) (isalnum((unsigned char)(c)))
#define ISALPHA(c) (isalpha((unsigned char)(c)))
#define ISCNTRL(c) (iscntrl((unsigned char)(c)))
#define ISDIGIT(c) (isdigit((unsigned char)(c)))
#define ISGRAPH(c) (isgraph((unsigned char)(c)))
#define ISLOWER(c) (islower((unsigned char)(c)))
#define ISPRINT(c) (isprint((unsigned char)(c)))
#define ISPUNCT(c) (ispunct((unsigned char)(c)))
#define ISSPACE(c) (isspace((unsigned char)(c)))
#define ISUPPER(c) (isupper((unsigned char)(c)))
#define ISXDIGIT(c) (isxdigit((unsigned char)(c)))
#define TOASCII(c) (toascii((unsigned char)(c)))
#define TOLOWER(c) (tolower((unsigned char)(c)))
#define TOUPPER(c) (toupper((unsigned char)(c)))
//////////////////////////////////////////////////////////////////////////
// length of a static array
#define ARRAYLENGTH(A) ( sizeof(A)/sizeof((A)[0]) )
//////////////////////////////////////////////////////////////////////////
// Make sure va_copy exists
#include <stdarg.h> // va_list, va_copy(?)
#if !defined(va_copy)
#if defined(__va_copy)
#define va_copy __va_copy
#else
#define va_copy(dst, src) ((void) memcpy(&(dst), &(src), sizeof(va_list)))
#endif
#endif
#endif /* _CBASETYPES_H_ */

19
Blowfish/dllmain.cpp Normal file
View file

@ -0,0 +1,19 @@
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}

8
Blowfish/stdafx.cpp Normal file
View file

@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// Blowfish.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

16
Blowfish/stdafx.h Normal file
View file

@ -0,0 +1,16 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// TODO: reference additional headers your program requires here

8
Blowfish/targetver.h Normal file
View file

@ -0,0 +1,8 @@
#pragma once
// Including SDKDDKVer.h defines the highest available Windows platform.
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include <SDKDDKVer.h>

View file

@ -0,0 +1,44 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FFXIVClassic_Lobby_Server", "FFXIVClassic_Lobby_Server\FFXIVClassic_Lobby_Server.csproj", "{703091E0-F69C-4177-8FAE-C258AC6A65AA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Blowfish", "Blowfish\Blowfish.vcxproj", "{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|Win32.ActiveCfg = Debug|Any CPU
{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|Any CPU.Build.0 = Release|Any CPU
{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|Win32.ActiveCfg = Release|Any CPU
{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}.Debug|Any CPU.ActiveCfg = Debug|Win32
{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}.Debug|Win32.ActiveCfg = Debug|Win32
{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}.Debug|Win32.Build.0 = Debug|Win32
{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}.Release|Any CPU.ActiveCfg = Release|Win32
{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}.Release|Mixed Platforms.Build.0 = Release|Win32
{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}.Release|Win32.ActiveCfg = Release|Win32
{2F4DF1AE-B33D-4058-A0FE-639DE9EA323A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Sockets;
using FFXIVClassic_Lobby_Server.packets;
using System.Diagnostics;
using FFXIVClassic_Lobby_Server.common;
using System.Collections.Concurrent;
using System.IO;
using Cyotek.Collections.Generic;
using System.Net;
namespace FFXIVClassic_Lobby_Server
{
class ClientConnection
{
//Connection stuff
public Blowfish blowfish;
public Socket socket;
public byte[] buffer = new byte[0xffff];
public CircularBuffer<byte> incomingStream = new CircularBuffer<byte>(1024);
public BlockingCollection<BasePacket> sendPacketQueue = new BlockingCollection<BasePacket>(100);
//Instance Stuff
public uint currentSession;
public uint currentAccount;
public void processIncoming(int bytesIn)
{
if (bytesIn == 0)
return;
incomingStream.Put(buffer, 0, bytesIn);
}
public void queuePacket(BasePacket packet)
{
sendPacketQueue.Add(packet);
}
public void flushQueuedSendPackets()
{
while (sendPacketQueue.Count > 0)
{
BasePacket packet = sendPacketQueue.Take();
byte[] packetBytes = packet.getPacketBytes();
byte[] buffer = new byte[0xffff];
Array.Copy(packetBytes, buffer, packetBytes.Length);
try {
socket.Send(packetBytes);
}
catch(Exception e)
{ Debug.WriteLine("Weird case, socket was d/ced: {0}", e); }
}
}
public String getAddress()
{
return String.Format("{0}:{1}", (socket.RemoteEndPoint as IPEndPoint).Address, (socket.RemoteEndPoint as IPEndPoint).Port);
}
public void disconnect()
{
socket.Disconnect(false);
}
}
}

View file

@ -0,0 +1,50 @@
using FFXIVClassic_Lobby_Server.common;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Lobby_Server
{
class ConfigConstants
{
public static bool OPTIONS_TIMESTAMP = false;
public static String DATABASE_HOST;
public static String DATABASE_PORT;
public static String DATABASE_NAME;
public static String DATABASE_USERNAME;
public static String DATABASE_PASSWORD;
public static bool load()
{
Console.Write("Loading config.ini file... ");
if (!File.Exists("./config.ini"))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("[FILE NOT FOUND]");
Console.ForegroundColor = ConsoleColor.Gray;
return false;
}
IniFile ini = new IniFile("./config.ini");
ConfigConstants.OPTIONS_TIMESTAMP = ini.IniReadValue("General", "showtimestamp").ToLower().Equals("true");
ConfigConstants.DATABASE_HOST = ini.IniReadValue("Database", "host");
ConfigConstants.DATABASE_PORT = ini.IniReadValue("Database", "port");
ConfigConstants.DATABASE_NAME = ini.IniReadValue("Database", "database");
ConfigConstants.DATABASE_USERNAME = ini.IniReadValue("Database", "username");
ConfigConstants.DATABASE_PASSWORD = ini.IniReadValue("Database", "password");
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("[OK]");
Console.ForegroundColor = ConsoleColor.Gray;
return true;
}
}
}

View file

@ -0,0 +1,238 @@
using FFXIVClassic_Lobby_Server.dataobjects;
using MySql.Data.MySqlClient;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Lobby_Server
{
//charState: 0 - Reserved, 1 - Deleted, 2 - Inactive, 3 - Active
class Database
{
public static void reserveCharacter(int accountId, int slot, int serverId, String name)
{
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
try
{
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = "INSERT INTO ffxiv_characters2(accountId, slot, serverId, name, charState) VALUES(@accountId, @slot, @serverId, @name, 0)";
cmd.Prepare();
cmd.Parameters.AddWithValue("@accountId", accountId);
cmd.Parameters.AddWithValue("@slot", slot);
cmd.Parameters.AddWithValue("@serverId", serverId);
cmd.Parameters.AddWithValue("@name", name);
cmd.ExecuteNonQuery();
}
catch (MySqlException e)
{
}
finally
{
conn.Close();
}
}
}
public static void makeCharacter(int accountId, String name, Character charaInfo)
{
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
try
{
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = "UPDATE ffxiv_characters2 SET data=@encodedInfo WHERE accountId=@accountId AND name=@name";
cmd.Prepare();
cmd.Parameters.AddWithValue("@accountId", accountId);
cmd.Parameters.AddWithValue("@name", name);
cmd.Parameters.AddWithValue("@encodedInfo", JsonConvert.SerializeObject(charaInfo));
cmd.ExecuteNonQuery();
}
catch (MySqlException e)
{
}
finally
{
conn.Close();
}
}
}
public static void renameCharacter(uint characterId, String newName)
{
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
try
{
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = "UPDATE ffxiv_characters2 SET name=@name WHERE id=@cid";
cmd.Prepare();
cmd.Parameters.AddWithValue("@cid", characterId);
cmd.Parameters.AddWithValue("@name", newName);
cmd.ExecuteNonQuery();
}
catch (MySqlException e)
{
}
finally
{
conn.Close();
}
}
}
public static void deleteCharacter(uint characterId, String name)
{
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
try
{
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = "UPDATE ffxiv_characters2 SET state=1 WHERE id=@cid AND name=@name";
cmd.Prepare();
cmd.Parameters.AddWithValue("@cid", characterId);
cmd.Parameters.AddWithValue("@name", name);
cmd.ExecuteNonQuery();
}
catch (MySqlException e)
{
}
finally
{
conn.Close();
}
}
}
public static List<World> getServers()
{
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
List<World> worldList = new List<World>();
try
{
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT * FROM ffxiv_servers WHERE isActive=true";
cmd.Prepare();
MySqlDataReader Reader = cmd.ExecuteReader();
if (!Reader.HasRows) return worldList;
while (Reader.Read())
{
var id = Reader.GetUInt16("id");
var name = Reader.GetString("name");
var address = Reader.GetString("address");
var port = Reader.GetUInt16("port");
var unknown = Reader.GetUInt16("unknown");
var numChars = Reader.GetUInt32("numChars");
var maxChars = Reader.GetUInt32("maxChars");
var isActive = Reader.GetBoolean("isActive");
if (isActive)
{
World world = new World();
world.id = id;
world.name = name;
world.address = address;
world.port = port;
world.unknown = unknown;
uint result = ((numChars / maxChars) *0xFF) & 0xFF;
world.population = (ushort)result;
world.isActive = isActive;
worldList.Add(world);
}
}
}
catch (MySqlException e)
{ }
finally
{
conn.Close();
}
return worldList;
}
}
public static World getServer(uint serverId)
{
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
World world = null;
try
{
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT * FROM ffxiv_servers WHERE id=%serverId";
cmd.Prepare();
cmd.Parameters.AddWithValue("@serverId", serverId);
MySqlDataReader Reader = cmd.ExecuteReader();
if (!Reader.HasRows) return world;
while (Reader.Read())
{
var id = Reader.GetUInt16("id");
var name = Reader.GetString("name");
var address = Reader.GetString("address");
var port = Reader.GetUInt16("port");
var unknown = Reader.GetUInt16("unknown");
var numChars = Reader.GetUInt32("numChars");
var maxChars = Reader.GetUInt32("maxChars");
var isActive = Reader.GetBoolean("isActive");
if (isActive)
{
world = new World();
world.id = id;
world.name = name;
world.address = address;
world.port = port;
world.unknown = unknown;
uint result = ((numChars / maxChars) * 0xFF) & 0xFF;
world.population = (ushort)result;
world.isActive = isActive;
}
}
}
catch (MySqlException e)
{
}
finally
{
conn.Close();
}
return world;
}
}
}
}

View file

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{703091E0-F69C-4177-8FAE-C258AC6A65AA}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FFXIVClassic_Lobby_Server</RootNamespace>
<AssemblyName>FFXIVClassic_Lobby_Server</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cyotek.Collections.Generic.CircularBuffer">
<HintPath>..\packages\Cyotek.CircularBuffer.1.0.0.0\lib\net20\Cyotek.Collections.Generic.CircularBuffer.dll</HintPath>
</Reference>
<Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.9.7\lib\net45\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Character.cs" />
<Compile Include="ClientConnection.cs" />
<Compile Include="common\Blowfish.cs" />
<Compile Include="common\IniFile.cs" />
<Compile Include="common\Utils.cs" />
<Compile Include="ConfigConstants.cs" />
<Compile Include="Database.cs" />
<Compile Include="PacketProcessor.cs" />
<Compile Include="packets\BasePacket.cs" />
<Compile Include="packets\CharacterRequestPacket.cs" />
<Compile Include="packets\HardCoded_Packets.cs" />
<Compile Include="packets\SubPacket.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Server.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,227 @@
using FFXIVClassic_Lobby_Server.common;
using FFXIVClassic_Lobby_Server.packets;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Lobby_Server
{
class PacketProcessor
{
List<ClientConnection> mConnections;
Boolean isAlive = true;
public PacketProcessor(List<ClientConnection> connectionList)
{
mConnections = connectionList;
}
public void update()
{
Console.WriteLine("Packet processing thread has started");
while (isAlive)
{
lock (mConnections)
{
foreach (ClientConnection client in mConnections)
{
//Receive packets
while (true)
{
if (client.incomingStream.Size < BasePacket.BASEPACKET_SIZE)
break;
try {
if (client.incomingStream.Size < BasePacket.BASEPACKET_SIZE)
break;
BasePacketHeader header = BasePacket.getHeader(client.incomingStream.Peek(BasePacket.BASEPACKET_SIZE));
if (client.incomingStream.Size < header.packetSize)
break;
BasePacket packet = new BasePacket(client.incomingStream.Get(header.packetSize));
processPacket(client, packet);
}
catch(OverflowException)
{ break; }
}
//Send packets
while (client.sendPacketQueue.Count != 0)
client.flushQueuedSendPackets();
}
}
}
}
private void processPacket(ClientConnection client, BasePacket packet)
{
if ((packet.header.packetSize == 0x288) && (packet.data[0x34] == 'T')) //Test Ticket Data
{
//Crypto handshake
ProcessStartSession(client, packet);
return;
}
BasePacket.decryptPacket(client.blowfish, ref packet);
packet.debugPrintPacket();
List<SubPacket> subPackets = packet.getSubpackets();
foreach (SubPacket subpacket in subPackets)
{
switch (subpacket.header.opcode)
{
case 0x03:
ProcessGetCharacters(client, subpacket);
break;
case 0x04:
ProcessSelectCharacter(client, subpacket);
break;
case 0x05:
ProcessSessionAcknowledgement(client, subpacket);
break;
case 0x0B:
ProcessModifyCharacter(client, subpacket);
break;
default:
Debug.WriteLine("Unknown command 0x{0:X} received.", subpacket.header.opcode);
break;
}
}
}
private void ProcessStartSession(ClientConnection client, BasePacket packet)
{
UInt32 clientTime = BitConverter.ToUInt32(packet.data, 0x74);
//We assume clientTime is 0x50E0E812, but we need to generate a proper key later
byte[] blowfishKey = { 0xB4, 0xEE, 0x3F, 0x6C, 0x01, 0x6F, 0x5B, 0xD9, 0x71, 0x50, 0x0D, 0xB1, 0x85, 0xA2, 0xAB, 0x43};
client.blowfish = new Blowfish(blowfishKey);
Console.WriteLine("Received encryption key: 0x{0:X}", clientTime);
//Respond with acknowledgment
BasePacket outgoingPacket = new BasePacket(HardCoded_Packets.g_secureConnectionAcknowledgment);
BasePacket.encryptPacket(client.blowfish, outgoingPacket);
client.queuePacket(outgoingPacket);
}
private void ProcessSessionAcknowledgement(ClientConnection client, SubPacket packet)
{
//String sessionId = Utils.unsafeAsciiBytesToString(packet.data, 0x30);
//String clientVersion = Utils.unsafeAsciiBytesToString(packet.data, 0x70);
Debug.WriteLine("Got acknowledgment for secure session.");
// Debug.WriteLine("SESSION_ID: {0}", sessionId);
// Debug.WriteLine("CLIENT_VERSION: {0}", clientVersion);
//Check if got MYSQL Conn
//auto query = string_format("SELECT userId FROM ffxiv_sessions WHERE id = '%s' AND expiration > NOW()", sessionId.c_str());
//Console.WriteLine("UserId {0} logged in.", id);
BasePacket outgoingPacket = new BasePacket("./packets/loginAck.bin");
BasePacket.encryptPacket(client.blowfish, outgoingPacket);
client.queuePacket(outgoingPacket);
}
private void ProcessGetCharacters(ClientConnection client, SubPacket packet)
{
Console.WriteLine("{0} => Get characters", client.getAddress());
BasePacket outgoingPacket = new BasePacket("./packets/getCharsPacket.bin");
BasePacket.encryptPacket(client.blowfish, outgoingPacket);
client.queuePacket(outgoingPacket);
}
private void ProcessSelectCharacter(ClientConnection client, SubPacket packet)
{
uint characterId = 0;
using (BinaryReader binReader = new BinaryReader(new MemoryStream(packet.data)))
{
binReader.BaseStream.Seek(0x8, SeekOrigin.Begin);
characterId = binReader.ReadUInt32();
binReader.Close();
}
Console.WriteLine("{0} => Select character id {1}", client.getAddress(), characterId);
String serverIp = "141.117.162.99";
ushort port = 54992;
BitConverter.GetBytes(port);
BasePacket outgoingPacket = new BasePacket("./packets/selectChar.bin");
//Write Character ID and Server info
using (BinaryWriter binWriter = new BinaryWriter(new MemoryStream(outgoingPacket.data)))
{
binWriter.Seek(0x28, SeekOrigin.Begin);
binWriter.Write(characterId);
binWriter.Seek(0x78, SeekOrigin.Begin);
binWriter.Write(System.Text.Encoding.ASCII.GetBytes(serverIp));
binWriter.Seek(0x76, SeekOrigin.Begin);
binWriter.Write(port);
binWriter.Close();
}
BasePacket.encryptPacket(client.blowfish, outgoingPacket);
client.queuePacket(outgoingPacket);
}
private void ProcessModifyCharacter(ClientConnection client, SubPacket packet)
{
packet.debugPrintSubPacket();
CharacterRequestPacket.CharacterRequest charaReq = CharacterRequestPacket.toStruct(packet.data);
var slot = charaReq.slot;
var code = charaReq.command;
var name = charaReq.characterName;
var worldId = charaReq.worldId;
switch (code)
{
case 0x01://Reserve
//Database.reserveCharacter(0, slot, worldId, name);
//Confirm Reserve
BasePacket confirmReservePacket = new BasePacket("./packets/chara/confirmReserve.bin");
BasePacket.encryptPacket(client.blowfish, confirmReservePacket);
client.queuePacket(confirmReservePacket);
Console.WriteLine("Reserving character \"{0}\"", charaReq.characterName);
break;
case 0x02://Make
Character character = Character.EncodedToCharacter(charaReq.characterInfoEncoded);
Database.makeCharacter(0, name, character);
//Confirm
BasePacket confirmMakePacket = new BasePacket("./packets/chara/confirmMake.bin");
BasePacket.encryptPacket(client.blowfish, confirmMakePacket);
client.queuePacket(confirmMakePacket);
Console.WriteLine("Character created!");
break;
case 0x03://Rename
break;
case 0x04://Delete
Database.deleteCharacter(charaReq.characterId, charaReq.characterName);
//Confirm
BasePacket deleteConfirmPacket = new BasePacket("./packets/chara/confirmDelete.bin");
BasePacket.encryptPacket(client.blowfish, deleteConfirmPacket);
client.queuePacket(deleteConfirmPacket);
Console.WriteLine("Character deleted \"{0}\"", charaReq.characterName);
break;
case 0x06://Rename Retainer
break;
}
}
}
}

View file

@ -0,0 +1,73 @@
using FFXIVClassic_Lobby_Server.packets;
using System;
using System.Diagnostics;
using System.Threading;
using FFXIVClassic_Lobby_Server.common;
using System.Runtime.InteropServices;
using MySql.Data.MySqlClient;
using System.Reflection;
namespace FFXIVClassic_Lobby_Server
{
class Program
{
static void Main(string[] args)
{
#if DEBUG
TextWriterTraceListener myWriter = new TextWriterTraceListener(System.Console.Out);
Debug.Listeners.Add(myWriter);
#endif
bool startServer = true;
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("--------FFXIV 1.0 Lobby Server--------");
Console.ForegroundColor = ConsoleColor.Gray;
Assembly assem = Assembly.GetExecutingAssembly();
Version vers = assem.GetName().Version;
Console.WriteLine("Version: " + vers.ToString());
//Load Config
if (!ConfigConstants.load())
startServer = false;
//Test DB Connection
Console.Write("Testing DB connection... ");
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
try
{
conn.Open();
conn.Close();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("[OK]");
Console.ForegroundColor = ConsoleColor.Gray;
}
catch (MySqlException e)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("[FAILED]");
Console.ForegroundColor = ConsoleColor.Gray;
startServer = false;
}
}
//Start Server if A-OK
if (startServer)
{
Server server = new Server();
server.startServer();
while (true) Thread.Sleep(10000);
}
Console.WriteLine("Press any key to continue...");
Console.ReadKey();
}
}
}

View file

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FFXIVClassic_Lobby_Server")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FFXIVClassic_Lobby_Server")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9b87f719-1e4d-4781-89c9-28d99f579253")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -0,0 +1,152 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using System.Threading;
namespace FFXIVClassic_Lobby_Server
{
class Server
{
public const int FFXIV_LOBBY_PORT = 54994;
public const int BUFFER_SIZE = 0x400;
public const int BACKLOG = 100;
private Socket mServerSocket;
private List<ClientConnection> mConnectionList = new List<ClientConnection>();
private PacketProcessor mProcessor;
private Thread mProcessorThread;
#region Socket Handling
public bool startServer()
{
IPEndPoint serverEndPoint = new System.Net.IPEndPoint(IPAddress.Parse("141.117.161.40"), FFXIV_LOBBY_PORT);
try{
mServerSocket = new System.Net.Sockets.Socket(serverEndPoint.Address.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
}
catch (Exception e)
{
throw new ApplicationException("Could not create socket, check to make sure not duplicating port", e);
}
try
{
mServerSocket.Bind(serverEndPoint);
mServerSocket.Listen(BACKLOG);
}
catch (Exception e)
{
throw new ApplicationException("Error occured while binding socket, check inner exception", e);
}
try
{
mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket);
}
catch (Exception e)
{
throw new ApplicationException("Error occured starting listeners, check inner exception", e);
}
Console.Write("Server has started @ ");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("{0}:{1}", (mServerSocket.LocalEndPoint as IPEndPoint).Address, (mServerSocket.LocalEndPoint as IPEndPoint).Port);
Console.ForegroundColor = ConsoleColor.Gray;
mProcessor = new PacketProcessor(mConnectionList);
mProcessorThread = new Thread(new ThreadStart(mProcessor.update));
mProcessorThread.Start();
return true;
}
private void acceptCallback(IAsyncResult result)
{
ClientConnection conn = null;
try
{
System.Net.Sockets.Socket s = (System.Net.Sockets.Socket)result.AsyncState;
conn = new ClientConnection();
conn.socket = s.EndAccept(result);
conn.buffer = new byte[BUFFER_SIZE];
lock (mConnectionList)
{
mConnectionList.Add(conn);
}
//Queue recieving of data from the connection
conn.socket.BeginReceive(conn.buffer, 0, conn.buffer.Length, SocketFlags.None, new AsyncCallback(receiveCallback), conn);
//Queue the accept of the next incomming connection
mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket);
Console.WriteLine("Connection {0}:{1} has connected.", (conn.socket.RemoteEndPoint as IPEndPoint).Address, (conn.socket.RemoteEndPoint as IPEndPoint).Port);
}
catch (SocketException)
{
if (conn.socket != null)
{
conn.socket.Close();
lock (mConnectionList)
{
mConnectionList.Remove(conn);
}
}
mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket);
}
catch (Exception)
{
if (conn.socket != null)
{
conn.socket.Close();
lock (mConnectionList)
{
mConnectionList.Remove(conn);
}
}
mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket);
}
}
private void receiveCallback(IAsyncResult result)
{
ClientConnection conn = (ClientConnection)result.AsyncState;
try
{
int bytesRead = conn.socket.EndReceive(result);
if (bytesRead > 0)
{
conn.processIncoming(bytesRead);
//Queue the next receive
conn.socket.BeginReceive(conn.buffer, 0, conn.buffer.Length, SocketFlags.None, new AsyncCallback(receiveCallback), conn);
}
else
{
Console.WriteLine("Connection {0}:{1} has disconnected.", (conn.socket.RemoteEndPoint as IPEndPoint).Address, (conn.socket.RemoteEndPoint as IPEndPoint).Port);
conn.socket.Close();
lock (mConnectionList)
{
mConnectionList.Remove(conn);
}
}
}
catch (SocketException)
{
if (conn.socket != null)
{
Console.WriteLine("Connection @ {0}:{1} has disconnected.", (conn.socket.RemoteEndPoint as IPEndPoint).Address, (conn.socket.RemoteEndPoint as IPEndPoint).Port);
conn.socket.Close();
lock (mConnectionList)
{
mConnectionList.Remove(conn);
}
}
}
}
#endregion
#region Packet Handling
#endregion
}
}

View file

@ -0,0 +1,74 @@
using System;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;
namespace FFXIVClassic_Lobby_Server.common
{
public class Blowfish
{
[DllImport("../../../Debug/Blowfish.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern short initializeBlowfish(byte[] key, short keySize, uint[] P, uint[,] S);
[DllImport("../../../Debug/Blowfish.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern void blowfish_encipher(ref int xl, ref int xr, uint[] P);
[DllImport("../../../Debug/Blowfish.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern void blowfish_decipher(ref int xl, ref int xr, uint[] P);
private uint[] P = new uint[16+2];
private uint[,] S = new uint[4,256];
public Blowfish(byte[] key)
{
InitBlowfish(key);
}
private int InitBlowfish(byte[] key)
{
return initializeBlowfish(key, (short)key.Length, P, S);
}
public void Encipher(byte[] data, int offset, int length)
{
if ((length - offset) % 8 != 0)
throw new ArgumentException("Needs to be a multiple of 8");
for (int i = offset; i < offset+length; i+=8)
{
int xl = (data[i + 0]) | (data[i + 1] << 8) | (data[i + 2] << 16) | (data[i + 3] << 24);
int xr = (data[i + 4]) | (data[i + 5] << 8) | (data[i + 6] << 16) | (data[i + 7] << 24);
blowfish_encipher(ref xl, ref xr, P);
data[i + 0] = (byte)(xl >> 0);
data[i + 1] = (byte)(xl >> 8);
data[i + 2] = (byte)(xl >> 16);
data[i + 3] = (byte)(xl >> 24);
data[i + 4] = (byte)(xr >> 0);
data[i + 5] = (byte)(xr >> 8);
data[i + 6] = (byte)(xr >> 16);
data[i + 7] = (byte)(xr >> 24);
}
}
public void Decipher(byte[] data, int offset, int length)
{
if ((length - offset) % 8 != 0)
throw new ArgumentException("Needs to be a multiple of 8");
for (int i = offset; i < offset + length; i += 8)
{
int xl = (data[i + 0]) | (data[i + 1] << 8) | (data[i + 2] << 16) | (data[i + 3] << 24);
int xr = (data[i + 4]) | (data[i + 5] << 8) | (data[i + 6] << 16) | (data[i + 7] << 24);
blowfish_decipher(ref xl, ref xr, P);
data[i + 0] = (byte)(xl >> 0);
data[i + 1] = (byte)(xl >> 8);
data[i + 2] = (byte)(xl >> 16);
data[i + 3] = (byte)(xl >> 24);
data[i + 4] = (byte)(xr >> 0);
data[i + 5] = (byte)(xr >> 8);
data[i + 6] = (byte)(xr >> 16);
data[i + 7] = (byte)(xr >> 24);
}
}
}
}

View file

@ -0,0 +1,63 @@
using System.Runtime.InteropServices;
using System.Text;
namespace FFXIVClassic_Lobby_Server.common
{
/// <summary>
/// Create a New INI file to store or load data
/// </summary>
public class IniFile
{
public string path;
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section,
string key, string val, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section,
string key, string def, StringBuilder retVal,
int size, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileSectionNames(StringBuilder retVal,
int size, string filePath);
/// <summary>
/// INIFile Constructor.
/// </summary>
/// <PARAM name="INIPath"></PARAM>
public IniFile(string INIPath)
{
path = INIPath;
}
/// <summary>
/// Write Data to the INI File
/// </summary>
/// <PARAM name="Section"></PARAM>
/// Section name
/// <PARAM name="Key"></PARAM>
/// Key Name
/// <PARAM name="Value"></PARAM>
/// Value Name
public void IniWriteValue(string Section, string Key, string Value)
{
WritePrivateProfileString(Section, Key, Value, this.path);
}
/// <summary>
/// Read Data Value From the Ini File
/// </summary>
/// <PARAM name="Section"></PARAM>
/// <PARAM name="Key"></PARAM>
/// <PARAM name="Path"></PARAM>
/// <returns></returns>
public string IniReadValue(string Section, string Key)
{
StringBuilder temp = new StringBuilder(255);
int i = GetPrivateProfileString(Section, Key, "", temp,
255, this.path);
return temp.ToString();
}
}
}

View file

@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Lobby_Server.common
{
static class Utils
{
private static readonly uint[] _lookup32 = CreateLookup32();
private static uint[] CreateLookup32()
{
var result = new uint[256];
for (int i = 0; i < 256; i++)
{
string s = i.ToString("X2");
result[i] = ((uint)s[0]) + ((uint)s[1] << 16);
}
return result;
}
public static string ByteArrayToHex(byte[] bytes)
{
var lookup32 = _lookup32;
var result = new char[(bytes.Length * 3) + ((bytes.Length/16) < 1 ? 1 : (bytes.Length/16)*3) + bytes.Length+60];
int numNewLines = 0;
for (int i = 0; i < bytes.Length; i++)
{
var val = lookup32[bytes[i]];
result[(3 * i) + (17 * numNewLines) + 0] = (char)val;
result[(3 * i) + (17 * numNewLines) + 1] = (char)(val >> 16);
result[(3 * i) + (17 * numNewLines) + 2] = ' ';
result[(numNewLines * (3*16+17)) + (3 * 16) + (i % 16)] = (char)bytes[i] >= 32 && (char)bytes[i] <= 126 ? (char)bytes[i] : '.';
if (i != bytes.Length - 1 && bytes.Length > 16 && i != 0 && (i+1) % 16 == 0)
{
result[(numNewLines * (3*16+17)) + (3 * 16) + (16)] = '\n';
numNewLines++;
}
}
return new string(result);
}
/*
/// <summary>
/// Grabs an instance of a class directly from the MySqlDataReader instead of manually building from GetString() etc.
/// </summary>
/// <typeparam name="T">Type of object to return</typeparam>
/// <param name="reader">Reader instance</param>
/// <returns>new T</returns>
public static T GetSQLObject<T>(this MySql.Data.MySqlClient.MySqlDataReader reader)
{
var obj = Activator.CreateInstance(typeof(T));
var fields = obj.GetType().GetFields();
foreach (var field in obj.GetType().GetFields())
{
var attrs = field.GetCustomAttributes(typeof(System.Runtime.Serialization.DataMemberAttribute), true) as System.Runtime.Serialization.DataMemberAttribute[];
if (attrs.Length == 0)
{
continue;
}
var fieldID = attrs[0].Name;
var fieldType = field.FieldType;
field.SetValue(obj, reader.GetValue(reader.GetOrdinal(fieldID)));
}
return (T)obj;
}*/
}
}

View file

@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FFXIVClassic_Lobby_Server.common;
namespace FFXIVClassic_Lobby_Server
{
class Character
{
public string name = "";
public uint id = 0;
public uint tribe = 0;
public uint size = 0;
public uint voice = 0;
public uint skinColor = 0;
public uint hairStyle = 0;
public uint hairColor = 0;
public uint eyeColor = 0;
public uint faceType = 0;
public uint faceBrow = 0;
public uint faceEye = 0;
public uint faceIris = 0;
public uint faceNose = 0;
public uint faceMouth = 0;
public uint faceJaw = 0;
public uint faceCheek = 0;
public uint faceOption1 = 0;
public uint faceOption2 = 0;
public uint guardian = 0;
public uint birthMonth = 0;
public uint birthDay = 0;
public uint allegiance = 0;
public uint weapon1 = 0;
public uint weapon2 = 0;
public uint headGear = 0;
public uint bodyGear = 0;
public uint legsGear = 0;
public uint handsGear = 0;
public uint feetGear = 0;
public uint waistGear = 0;
public uint rightEarGear = 0;
public uint leftEarGear = 0;
public uint rightFingerGear = 0;
public uint leftFingerGear = 0;
public byte[] toBytes()
{
byte[] bytes = new byte[0x120];
return bytes;
}
public static String characterToEncoded(Character chara)
{
String charaInfo = System.Convert.ToBase64String(chara.toBytes());
charaInfo.Replace("+", "-");
charaInfo.Replace("/", "_");
return charaInfo;
}
public static Character EncodedToCharacter(String charaInfo)
{
charaInfo.Replace("+", "-");
charaInfo.Replace("/", "_");
byte[] data = System.Convert.FromBase64String(charaInfo);
Console.WriteLine("------------Base64 printout------------------");
Console.WriteLine(Utils.ByteArrayToHex(data));
Console.WriteLine("------------Base64 printout------------------");
Character chara = new Character();
return chara;
}
}
}

View file

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Lobby_Server.dataobjects
{
class World
{
public ushort id;
public string address;
public ushort port;
public ushort unknown;
public ushort population;
public string name;
public bool isActive;
}
}

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cyotek.CircularBuffer" version="1.0.0.0" targetFramework="net45" />
<package id="MySql.Data" version="6.9.7" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
</packages>

View file

@ -0,0 +1,243 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Diagnostics;
using FFXIVClassic_Lobby_Server.common;
using System.IO;
namespace FFXIVClassic_Lobby_Server.packets
{
[StructLayout(LayoutKind.Sequential)]
public struct BasePacketHeader
{
public byte isAuthenticated;
public byte isEncrypted;
public ushort reserved;
public ushort packetSize;
public ushort numSubpackets;
public uint unknown1; //Id?
public uint unknown2; //Usually 0x13B
}
public class BasePacket{
public const int BASEPACKET_SIZE = 0x10;
public BasePacketHeader header;
public byte[] data;
public unsafe BasePacket(String path)
{
byte[] bytes = File.ReadAllBytes(path);
if (bytes.Length < BASEPACKET_SIZE)
throw new OverflowException("Packet Error: Packet was too small");
fixed (byte* pdata = &bytes[0])
{
header = (BasePacketHeader)Marshal.PtrToStructure(new IntPtr(pdata), typeof(BasePacketHeader));
}
if (bytes.Length < header.packetSize)
throw new OverflowException("Packet Error: Packet size didn't equal given size");
int packetSize = header.packetSize;
data = new byte[packetSize - BASEPACKET_SIZE];
Array.Copy(bytes, BASEPACKET_SIZE, data, 0, packetSize - BASEPACKET_SIZE);
}
public unsafe BasePacket(byte[] bytes)
{
if (bytes.Length < BASEPACKET_SIZE)
throw new OverflowException("Packet Error: Packet was too small");
fixed (byte* pdata = &bytes[0])
{
header = (BasePacketHeader)Marshal.PtrToStructure(new IntPtr(pdata), typeof(BasePacketHeader));
}
if (bytes.Length < header.packetSize)
throw new OverflowException("Packet Error: Packet size didn't equal given size");
int packetSize = header.packetSize;
data = new byte[packetSize - BASEPACKET_SIZE];
Array.Copy(bytes, BASEPACKET_SIZE, data, 0, packetSize - BASEPACKET_SIZE);
}
public unsafe BasePacket(byte[] bytes, ref int offset)
{
if (bytes.Length < offset + BASEPACKET_SIZE)
throw new OverflowException("Packet Error: Packet was too small");
fixed (byte* pdata = &bytes[offset])
{
header = (BasePacketHeader)Marshal.PtrToStructure(new IntPtr(pdata), typeof(BasePacketHeader));
}
int packetSize = header.packetSize;
if (bytes.Length < offset + header.packetSize)
throw new OverflowException("Packet Error: Packet size didn't equal given size");
data = new byte[packetSize - BASEPACKET_SIZE];
Array.Copy(bytes, offset + BASEPACKET_SIZE, data, 0, packetSize - BASEPACKET_SIZE);
offset += packetSize;
}
public BasePacket(BasePacketHeader header, byte[] data)
{
this.header = header;
this.data = data;
}
public List<SubPacket> getSubpackets()
{
List<SubPacket> subpackets = new List<SubPacket>(header.numSubpackets);
int offset = 0;
while (offset < data.Length)
subpackets.Add(new SubPacket(data, ref offset));
return subpackets;
}
public unsafe static BasePacketHeader getHeader(byte[] bytes)
{
BasePacketHeader header;
if (bytes.Length < BASEPACKET_SIZE)
throw new OverflowException("Packet Error: Packet was too small");
fixed (byte* pdata = &bytes[0])
{
header = (BasePacketHeader)Marshal.PtrToStructure(new IntPtr(pdata), typeof(BasePacketHeader));
}
return header;
}
public byte[] getHeaderBytes()
{
int size = Marshal.SizeOf(header);
byte[] arr = new byte[size];
IntPtr ptr = Marshal.AllocHGlobal(size);
Marshal.StructureToPtr(header, ptr, true);
Marshal.Copy(ptr, arr, 0, size);
Marshal.FreeHGlobal(ptr);
return arr;
}
public byte[] getPacketBytes()
{
byte[] outBytes = new byte[header.packetSize];
Array.Copy(getHeaderBytes(), 0, outBytes, 0, BASEPACKET_SIZE);
Array.Copy(data, 0, outBytes, BASEPACKET_SIZE, data.Length);
return outBytes;
}
#region Utility Functions
public BasePacket createPacket(List<SubPacket> subpackets, bool isAuthed, bool isEncrypted)
{
//Create Header
BasePacketHeader header = new BasePacketHeader();
byte[] data = null;
header.isAuthenticated = isAuthed?(byte)1:(byte)0;
header.isEncrypted = isEncrypted?(byte)1:(byte)0;
header.numSubpackets = (ushort)subpackets.Count;
header.packetSize = BASEPACKET_SIZE;
//Get packet size
foreach (SubPacket subpacket in subpackets)
header.packetSize += subpacket.header.subpacketSize;
data = new byte[header.packetSize-0x10];
//Add Subpackets
int offset = 0;
foreach (SubPacket subpacket in subpackets)
{
byte[] subpacketData = subpacket.getBytes();
Array.Copy(subpacketData, 0, data, offset, subpacketData.Length);
header.packetSize += (ushort)subpacketData.Length;
}
Debug.Assert(data != null && offset == data.Length && header.packetSize == 0x10 + offset);
BasePacket packet = new BasePacket(header, data);
return packet;
}
public static unsafe void encryptPacket(Blowfish blowfish, BasePacket packet)
{
byte[] data = packet.data;
int size = packet.header.packetSize;
int offset = 0;
while (offset < data.Length) {
if (data.Length < offset + SubPacket.SUBPACKET_SIZE)
throw new OverflowException("Packet Error: Subpacket was too small");
SubPacketHeader header;
fixed (byte* pdata = &data[offset])
{
header = (SubPacketHeader)Marshal.PtrToStructure(new IntPtr(pdata), typeof(SubPacketHeader));
}
if (data.Length < offset + header.subpacketSize)
throw new OverflowException("Packet Error: Subpacket size didn't equal subpacket data");
blowfish.Encipher(data, offset + 0x10, header.subpacketSize-0x10);
offset += header.subpacketSize;
}
}
public static unsafe void decryptPacket(Blowfish blowfish, ref BasePacket packet)
{
byte[] data = packet.data;
int size = packet.header.packetSize;
int offset = 0;
while (offset < data.Length)
{
if (data.Length < offset + SubPacket.SUBPACKET_SIZE)
throw new OverflowException("Packet Error: Subpacket was too small");
SubPacketHeader header;
fixed (byte* pdata = &data[offset])
{
header = (SubPacketHeader)Marshal.PtrToStructure(new IntPtr(pdata), typeof(SubPacketHeader));
}
if (data.Length < offset + header.subpacketSize)
throw new OverflowException("Packet Error: Subpacket size didn't equal subpacket data");
blowfish.Decipher(data, offset + 0x10, header.subpacketSize-0x10);
offset += header.subpacketSize;
}
}
#endregion
public void debugPrintPacket()
{
#if DEBUG
Console.BackgroundColor = ConsoleColor.DarkYellow;
Console.WriteLine("IsAuthed: {0}, IsEncrypted: {1}, Size: 0x{2:X}, Num Subpackets: {3}", header.isAuthenticated, header.isEncrypted, header.packetSize, header.numSubpackets);
Console.WriteLine("{0}", Utils.ByteArrayToHex(getHeaderBytes()));
foreach (SubPacket sub in getSubpackets())
sub.debugPrintSubPacket();
Console.BackgroundColor = ConsoleColor.Black;
#endif
}
}
}

View file

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Lobby_Server.packets
{
class CharacterRequestPacket
{
[StructLayout(LayoutKind.Sequential)]
public unsafe struct CharacterRequest
{
public uint sequence;
public uint unknown;
public uint characterId;
public uint unknown2;
public byte slot;
public byte command;
public ushort worldId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
public String characterName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x190)]
public String characterInfoEncoded;
}
public static unsafe CharacterRequest toStruct(byte[] bytes)
{
fixed (byte* pdata = &bytes[0])
{
return (CharacterRequest)Marshal.PtrToStructure(new IntPtr(pdata), typeof(CharacterRequest));
}
}
}
}

View file

@ -0,0 +1,266 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Lobby_Server.packets
{
class HardCoded_Packets
{
public static byte[] g_secureConnectionAcknowledgment =
{
0x00, 0x00, 0x00, 0x00, 0xA0, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x90, 0x02, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0C, 0x69, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xED, 0x45, 0x02, 0x00, 0x00, 0x00, 0x00,
0xC0, 0xED, 0xDF, 0xFF, 0xAF, 0xF7, 0xF7, 0xAF, 0x10, 0xEF, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF,
0x42, 0x82, 0x63, 0x52, 0x01, 0x00, 0x00, 0x00, 0x10, 0xEF, 0xDF, 0xFF, 0x53, 0x61, 0x6D, 0x70,
0x6C, 0x65, 0x20, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x52, 0x75, 0x6E, 0x52, 0x75, 0x6E,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x00, 0xF7, 0xAF, 0xAF, 0xF7, 0x00, 0x00, 0xB8, 0x6C, 0x4D, 0x02, 0x00, 0x00, 0x00, 0x00,
0x10, 0x6C, 0x4D, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2C, 0xAC, 0x01, 0x00, 0x00, 0x00, 0x00,
0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6C, 0x6C, 0x62, 0x61, 0x63, 0x6B, 0x4F, 0x62,
0x6A, 0x65, 0x63, 0x74, 0x2E, 0x2E, 0x2E, 0x5B, 0x36, 0x36, 0x2E, 0x31, 0x33, 0x30, 0x2E, 0x39,
0x39, 0x2E, 0x38, 0x32, 0x3A, 0x36, 0x33, 0x34, 0x30, 0x37, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00,
0x70, 0xEE, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0x6C, 0x4E, 0x38, 0x01, 0x00, 0x00, 0x00, 0x00,
0x32, 0xEF, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0xAF, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xC0, 0xEE, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0xFE, 0x4E, 0x38, 0x01, 0x00, 0x00, 0x00, 0x00,
0x0B, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x20, 0xEF, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF,
0x00, 0x01, 0xCC, 0xCC, 0x0C, 0x69, 0x00, 0xE0, 0xD0, 0x58, 0x33, 0x02, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x80, 0xEF, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF,
0xC0, 0xEE, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0xD0, 0xED, 0x45, 0x02, 0x00, 0x00, 0x00, 0x00,
0xF0, 0xEE, 0xDF, 0xFF, 0xAF, 0xF7, 0xF7, 0xAF, 0x20, 0xEF, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF,
0x0C, 0x69, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6C, 0x4D, 0x02, 0x00, 0x00, 0x00, 0x00,
0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x34, 0x30, 0x37, 0x00, 0x00, 0x00, 0x00,
0x90, 0xEF, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0x18, 0xBE, 0x34, 0x01, 0x00, 0x00, 0x00, 0x00,
0xD8, 0x32, 0xAC, 0x01, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x32, 0xAC, 0x01, 0x00, 0x00, 0x00, 0x00,
0x02, 0x00, 0xF7, 0xAF, 0x42, 0x82, 0x63, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x36, 0x36, 0x2E, 0x31, 0x33, 0x30, 0x2E, 0x39, 0x39, 0x2E, 0x38, 0x32, 0x00, 0x00,
0x00, 0x00, 0x36, 0x36, 0x2E, 0x31, 0x33, 0x30, 0x2E, 0x39, 0x39, 0x2E, 0x38, 0x32, 0x00, 0xFF,
0x90, 0xEF, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0x24, 0xCF, 0x76, 0x01, 0x00, 0x00, 0x00, 0x00,
0x10, 0x6C, 0x4D, 0x02, 0x00, 0x00, 0x00, 0x00, 0x70, 0x7A, 0xB7, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6C, 0x4D, 0x02, 0x00, 0x00, 0x00, 0x00,
0x90, 0xEF, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0xD1, 0xF3, 0x37, 0x01, 0x00, 0x00, 0x00, 0x00,
0x10, 0x6C, 0x4D, 0x02, 0x00, 0x00, 0x00, 0x00, 0xA0, 0x32, 0xAC, 0x01, 0x00, 0x00, 0x00, 0x00,
0xC0, 0xEF, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0xE8, 0x3E, 0x77, 0x01, 0x00, 0x00, 0x00, 0x00,
0x70, 0x99, 0xAA, 0x01, 0x0C, 0x69, 0x00, 0xE0, 0xA0, 0x32, 0xAC, 0x01, 0x00, 0x00, 0x00, 0x00,
0x58, 0x59, 0x33, 0x02, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6C, 0x4D, 0x02, 0x00, 0x00, 0x00, 0x00,
0xE0, 0xEF, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0x05, 0x3F, 0x77, 0x01, 0x00, 0x00, 0x00, 0x00,
0x0C, 0x69, 0x00, 0xE0, 0x0C, 0x69, 0x00, 0xE0, 0xA0, 0x32, 0xAC, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0xF0, 0xDF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0x23, 0x3F, 0x77, 0x01, 0x00, 0x00, 0x00, 0x00,
0xC0, 0x5A, 0x33, 0x02, 0x0C, 0x69, 0x00, 0xE0, 0xA0, 0x32, 0xAC, 0x01, 0x00, 0x00, 0x00, 0x00,
};
public static byte[] g_characterListPacket =
{
0x01, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x05, 0x00, 0xEA, 0xCE, 0x8A, 0xEE, 0x3B, 0x01, 0x00, 0x00,
0x10, 0x02, 0x03, 0x00, 0x68, 0x68, 0x00, 0xE0, 0x68, 0x68, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00,
0x14, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0xE8, 0xE0, 0x50, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //(9) 0x06 -> Item Count
0x02, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x44, 0x75, 0x72, 0x61, 0x6E, 0x64, 0x61, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x01, 0x00, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x48, 0x79, 0x70, 0x65, 0x72, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x02, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x4D, 0x61, 0x73, 0x61, 0x6D, 0x75, 0x6E, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x03, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x75, 0x6E, 0x67, 0x6E, 0x69, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x04, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x41, 0x65, 0x67, 0x69, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x05, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x53, 0x61, 0x72, 0x67, 0x61, 0x74, 0x61, 0x6E, 0x61, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x02, 0x03, 0x00, 0x68, 0x68, 0x00, 0xE0, 0x68, 0x68, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00,
0x14, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0xE8, 0xE0, 0x50, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0B, 0x00, 0x06, 0x00, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x42, 0x61, 0x6C, 0x6D, 0x75, 0x6E, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0C, 0x00, 0x07, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x52, 0x69, 0x64, 0x69, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x08, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x45, 0x78, 0x63, 0x61, 0x6C, 0x69, 0x62, 0x75, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x14, 0x00, 0x09, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x52, 0x61, 0x67, 0x6E, 0x61, 0x72, 0x6F, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x02, 0x03, 0x00, 0x68, 0x68, 0x00, 0xE0, 0x68, 0x68, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00,
0x14, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0xE8, 0xE0, 0x50, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xF0, 0x01, 0x03, 0x00, 0x68, 0x68, 0x00, 0xE0, 0x68, 0x68, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00,
0x14, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0xE8, 0xE0, 0x50, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3A, 0xF5, 0xA5, 0xE0,
0x09, 0x79, 0xC1, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x6F, 0x72, 0x6E, //(C) "Cornelius" Retainer Name
0x65, 0x6C, 0x69, 0x75, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x79, 0xC1, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xD0, 0x03, 0x03, 0x00, 0x68, 0x68, 0x00, 0xE0, 0x68, 0x68, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00,
0x14, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0xE8, 0xE0, 0x50, 0x00, 0x00, 0x00, 0x00, //(8) 0x50E0E824 -> Timestamp
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0xFC, 0xE7, 0x58, 0x01, 0x09, 0x79, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x00, 0x00, 0x00, //(4) 0x00C17909 -> Character Id
// 0x57, 0x72, 0x65, 0x6E, 0x69, 0x78, 0x20, 0x57, 0x72, 0x6F, 0x6E, 0x67, 0x00, 0x00, 0x00, 0x00, //(0) "Wrenix Wrong" -> Character Name
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x52, 0x61, 0x67, 0x6E, 0x61, 0x72, 0x6F, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //(0) "Ragnarok" -> Server Name
0x77, 0x41, 0x51, 0x41, 0x41, 0x4F, 0x6F, 0x6E, 0x49, 0x79, 0x4D, 0x4E, 0x41, 0x41, 0x41, 0x41, //(0) base64 stuff -> Character Data
0x56, 0x33, 0x4A, 0x6C, 0x62, 0x6D, 0x6C, 0x34, 0x49, 0x46, 0x64, 0x79, 0x62, 0x32, 0x35, 0x6E,
0x41, 0x42, 0x77, 0x41, 0x41, 0x41, 0x41, 0x45, 0x41, 0x41, 0x41, 0x41, 0x41, 0x77, 0x41, 0x41,
0x41, 0x41, 0x4D, 0x41, 0x41, 0x41, 0x41, 0x5F, 0x38, 0x4F, 0x41, 0x44, 0x41, 0x41, 0x48, 0x51,
0x46, 0x41, 0x41, 0x45, 0x41, 0x41, 0x41, 0x42, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x54, 0x51,
0x43, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
0x41, 0x47, 0x45, 0x67, 0x41, 0x41, 0x41, 0x41, 0x4D, 0x51, 0x41, 0x41, 0x51, 0x43, 0x51, 0x41,
0x41, 0x4D, 0x41, 0x73, 0x41, 0x41, 0x43, 0x4B, 0x56, 0x41, 0x41, 0x41, 0x41, 0x50, 0x67, 0x43,
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x43, 0x51, 0x41,
0x41, 0x41, 0x41, 0x6B, 0x41, 0x77, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
0x41, 0x4E, 0x76, 0x62, 0x31, 0x4D, 0x30, 0x35, 0x41, 0x51, 0x41, 0x41, 0x42, 0x42, 0x6F, 0x41,
0x41, 0x41, 0x45, 0x41, 0x42, 0x71, 0x6F, 0x69, 0x49, 0x75, 0x49, 0x4B, 0x41, 0x41, 0x41, 0x41,
0x63, 0x48, 0x4A, 0x32, 0x4D, 0x45, 0x6C, 0x75, 0x62, 0x6A, 0x41, 0x78, 0x41, 0x42, 0x45, 0x41,
0x41, 0x41, 0x42, 0x6B, 0x5A, 0x57, 0x5A, 0x68, 0x64, 0x57, 0x78, 0x30, 0x56, 0x47, 0x56, 0x79,
0x63, 0x6D, 0x6C, 0x30, 0x62, 0x33, 0x4A, 0x35, 0x41, 0x41, 0x77, 0x4A, 0x41, 0x68, 0x63, 0x41,
0x42, 0x41, 0x41, 0x41, 0x41, 0x41, 0x51, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
0x41, 0x67, 0x41, 0x41, 0x41, 0x41, 0x49, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0xFD, 0xE7, 0x58, 0x01, 0x0B, 0x79, 0xC1, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //(4) 0x00C17909 -> Character Id (8) -> 0x72 = Legacy account?
// 0x59, 0x72, 0x65, 0x6E, 0x69, 0x78, 0x20, 0x57, 0x72, 0x6F, 0x6E, 0x67, 0x00, 0x00, 0x00, 0x00, //(0) "Wrenix Wrong" -> Character Name
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //(4) 0x00C17909 -> Character Id (8) -> 0x72 = Legacy account?
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //(0) "Wrenix Wrong" -> Character Name
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x52, 0x61, 0x67, 0x6E, 0x61, 0x72, 0x6F, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //(0) "Ragnarok" -> Server Name
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
}
}

View file

@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using FFXIVClassic_Lobby_Server;
using FFXIVClassic_Lobby_Server.common;
namespace FFXIVClassic_Lobby_Server.packets
{
[StructLayout(LayoutKind.Sequential)]
public struct SubPacketHeader
{
public ushort subpacketSize;
public ushort unknown0; //Always 0x03
public uint sourceId;
public uint targetId;
public uint unknown1;
public ushort unknown4; //Always 0x13
public ushort opcode;
public uint unknown5;
public uint timestamp;
public uint unknown6;
}
public class SubPacket
{
public const int SUBPACKET_SIZE = 0x20;
public SubPacketHeader header;
public byte[] data;
public unsafe SubPacket(byte[] bytes, ref int offset)
{
if (bytes.Length < offset + SUBPACKET_SIZE)
throw new OverflowException("Packet Error: Subpacket was too small");
fixed (byte* pdata = &bytes[offset])
{
header = (SubPacketHeader)Marshal.PtrToStructure(new IntPtr(pdata), typeof(SubPacketHeader));
}
if (bytes.Length < offset + header.subpacketSize)
throw new OverflowException("Packet Error: Subpacket size didn't equal subpacket data");
data = new byte[header.subpacketSize - SUBPACKET_SIZE];
Array.Copy(bytes, offset + SUBPACKET_SIZE, data, 0, data.Length);
offset += header.subpacketSize;
}
public byte[] getHeaderBytes()
{
int size = Marshal.SizeOf(header);
byte[] arr = new byte[size];
IntPtr ptr = Marshal.AllocHGlobal(size);
Marshal.StructureToPtr(header, ptr, true);
Marshal.Copy(ptr, arr, 0, size);
Marshal.FreeHGlobal(ptr);
return arr;
}
public byte[] getBytes()
{
byte[] outBytes = new byte[header.subpacketSize];
Array.Copy(getHeaderBytes(), 0, outBytes, 0, SUBPACKET_SIZE);
Array.Copy(data, 0, outBytes, SUBPACKET_SIZE, data.Length);
return outBytes;
}
public void debugPrintSubPacket()
{
#if DEBUG
Console.BackgroundColor = ConsoleColor.DarkRed;
Console.WriteLine("Size: 0x{0:X}, Opcode: 0x{1:X}", header.subpacketSize, header.opcode);
Console.WriteLine("{0}", Utils.ByteArrayToHex(getHeaderBytes()));
Console.BackgroundColor = ConsoleColor.DarkMagenta;
Console.WriteLine("{0}", Utils.ByteArrayToHex(data));
Console.BackgroundColor = ConsoleColor.Black;
#endif
}
}
}

View file

@ -0,0 +1,274 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Cyotek.Collections.Generic.CircularBuffer</name>
</assembly>
<members>
<member name="T:Cyotek.Collections.Generic.CircularBuffer`1">
<summary>
Represents a first-in, first-out collection of objects using a fixed buffer and automatic overwrite support.
</summary>
<typeparam name="T">Specifies the type of elements in the buffer.</typeparam>
<remarks>
<para>The capacity of a <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> is the number of elements the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> can
hold. If an attempt is made to put more items in the buffer than available capacity, items at the start of the buffer are
automatically overwritten. This behavior can be modified via the <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite"/> property.</para>
<para>CircularBuffer{T} accepts <c>null</c> as a valid value for reference types and allows duplicate elements.</para>
<para>The <see cref="M:Cyotek.Collections.Generic.CircularBuffer`1.Get"/> methods will remove the items that are returned from the CircularBuffer{T}. To view the contents of the CircularBuffer{T} without removing items, use the <see cref="M:Cyotek.Collections.Generic.CircularBuffer`1.Peek"/> or <see cref="M:Cyotek.Collections.Generic.CircularBuffer`1.PeekLast"/> methods.</para>
</remarks>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.#ctor(System.Int32)">
<summary>
Initializes a new instance of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> class that is empty and has the specified initial capacity and default overwrite behavior.
</summary>
<param name="capacity">The maximum capcity of the buffer.</param>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.#ctor(System.Int32,System.Boolean)">
<summary>
Initializes a new instance of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> class that is empty and has the specified initial capacity and overwrite behavior.
</summary>
<param name="capacity">The maximum capcity of the buffer.</param>
<param name="allowOverwrite">If set to <c>true</c> the buffer will automatically overwrite the oldest items when full.</param>
<exception cref="T:System.ArgumentException">Thown if the <paramref name="capacity"/> is less than zero.</exception>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Clear">
<summary>
Removes all items from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
</summary>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Contains(`0)">
<summary>
Determines whether the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> contains a specific value.
</summary>
<param name="item">The object to locate in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</param>
<returns><c>true</c> if <paramref name="item"/> is found in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>; otherwise, <c>false</c>.</returns>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.CopyTo(`0[])">
<summary>
Copies the entire <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to a compatible one-dimensional array, starting at the beginning of the target array.
</summary>
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.CopyTo(`0[],System.Int32)">
<summary>
Copies the entire <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to a compatible one-dimensional array, starting at the specified index of the target array.
</summary>
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.CopyTo(System.Int32,`0[],System.Int32,System.Int32)">
<summary>
Copies a range of elements from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to a compatible one-dimensional array, starting at the specified index of the target array.
</summary>
<param name="index">The zero-based index in the source <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> at which copying begins.</param>
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
<param name="count">The number of elements to copy.</param>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Get(System.Int32)">
<summary>
Removes and returns the specified number of objects from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
</summary>
<param name="count">The number of elements to remove and return from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</param>
<returns>The objects that are removed from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Get(`0[])">
<summary>
Copies and removes the specified number elements from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to a compatible one-dimensional array, starting at the beginning of the target array.
</summary>
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
<returns>The actual number of elements copied into <paramref name="array"/>.</returns>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Get(`0[],System.Int32,System.Int32)">
<summary>
Copies and removes the specified number elements from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to a compatible one-dimensional array, starting at the specified index of the target array.
</summary>
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
<param name="count">The number of elements to copy.</param>
<returns>The actual number of elements copied into <paramref name="array"/>.</returns>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Get">
<summary>
Removes and returns the object at the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
</summary>
<returns>The object that is removed from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
<exception cref="T:System.InvalidOperationException">Thrown if the buffer is empty.</exception>
<remarks>This method is similar to the <see cref="M:Cyotek.Collections.Generic.CircularBuffer`1.Peek"/> method, but <c>Peek</c> does not modify the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</remarks>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.GetEnumerator">
<summary>
Returns an enumerator that iterates through the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
</summary>
<returns>A <see cref="T:System.Collections.Generic.IEnumerator`1"/> for the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Peek">
<summary>
Returns the object at the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> without removing it.
</summary>
<returns>The object at the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
<exception cref="T:System.InvalidOperationException">Thrown if the buffer is empty.</exception>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Peek(System.Int32)">
<summary>
Returns the specified number of objects from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
</summary>
<param name="count">The number of elements to return from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</param>
<returns>The objects that from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
<exception cref="T:System.InvalidOperationException">Thrown if the buffer is empty.</exception>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.PeekLast">
<summary>
Returns the object at the end of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> without removing it.
</summary>
<returns>The object at the end of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
<exception cref="T:System.InvalidOperationException">Thrown if the buffer is empty.</exception>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Put(`0[])">
<summary>
Copies an entire compatible one-dimensional array to the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
</summary>
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the source of the elements copied to <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
<exception cref="T:System.InvalidOperationException">Thrown if buffer does not have sufficient capacity to put in new items.</exception>
<remarks>If <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.Size"/> plus the size of <paramref name="array"/> exceeds the capacity of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> and the <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite"/> property is <c>true</c>, the oldest items in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> are overwritten with <paramref name="array"/>.</remarks>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Put(`0[],System.Int32,System.Int32)">
<summary>
Copies a range of elements from a compatible one-dimensional array to the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
</summary>
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the source of the elements copied to <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
<param name="count">The number of elements to copy.</param>
<exception cref="T:System.InvalidOperationException">Thrown if buffer does not have sufficient capacity to put in new items.</exception>
<remarks>If <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.Size"/> plus <paramref name="count"/> exceeds the capacity of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> and the <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite"/> property is <c>true</c>, the oldest items in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> are overwritten with <paramref name="array"/>.</remarks>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Put(`0)">
<summary>
Adds an object to the end of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
</summary>
<param name="item">The object to add to the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The value can be <c>null</c> for reference types.</param>
<exception cref="T:System.InvalidOperationException">Thrown if buffer does not have sufficient capacity to put in new items.</exception>
<remarks>If <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.Size"/> already equals the capacity and the <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite"/> property is <c>true</c>, the oldest item in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> is overwritten with <paramref name="item"/>.</remarks>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Skip(System.Int32)">
<summary>
Increments the starting index of the data buffer in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
</summary>
<param name="count">The number of elements to increment the data buffer start index by.</param>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.ToArray">
<summary>
Copies the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> elements to a new array.
</summary>
<returns>A new array containing elements copied from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
<remarks>The <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> is not modified. The order of the elements in the new array is the same as the order of the elements from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to its end.</remarks>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#ICollection#CopyTo(System.Array,System.Int32)">
<summary>
Copies the elements of the <see cref="T:System.Collections.ICollection"/> to an <see cref="T:System.Array"/>, starting at a particular <see cref="T:System.Array"/> index.
</summary>
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#Generic#ICollection{T}#Add(`0)">
<summary>
Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1" />.
</summary>
<param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#Generic#ICollection{T}#Remove(`0)">
<summary>
Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
</summary>
<param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
<returns><c>true</c> if <paramref name="item"/> was successfully removed from the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, <c>false</c>. This method also returns <c>false</c> if <paramref name="item"/> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1"/>.</returns>
<exception cref="T:System.NotSupportedException">Cannot remove items from collection.</exception>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#Generic#IEnumerable{T}#GetEnumerator">
<summary>
Returns an enumerator that iterates through the collection.
</summary>
<returns>A <see cref="T:System.Collections.Generic.IEnumerator`1" /> that can be used to iterate through the collection.</returns>
</member>
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#IEnumerable#GetEnumerator">
<summary>
Returns an enumerator that iterates through a collection.
</summary>
<returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite">
<summary>
Gets or sets a value indicating whether the buffer will automatically overwrite the oldest items in the buffer when the maximum capacity is reached.
</summary>
<value><c>true</c> if the oldest items in the buffer are automatically overwritten when the buffer is full; otherwise, <c>false</c>.</value>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.Capacity">
<summary>
Gets or sets the total number of elements the internal data structure can hold.
</summary>
<value>The total number of elements that the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> can contain.</value>
<exception cref="T:System.ArgumentOutOfRangeException">Thrown if the specified new capacity is smaller than the current contents of the buffer.</exception>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.Head">
<summary>
Gets the index of the beginning of the buffer data.
</summary>
<value>The index of the first element in the buffer.</value>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.IsEmpty">
<summary>
Gets a value indicating whether the buffer is empty.
</summary>
<value><c>true</c> if buffer is empty; otherwise, <c>false</c>.</value>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.IsFull">
<summary>
Gets a value indicating whether the buffer is full.
</summary>
<value><c>true</c> if the buffer is full; otherwise, <c>false</c>.</value>
<remarks>The <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.IsFull"/> property always returns <c>false</c> if the <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite"/> property is set to <c>true</c>.</remarks>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.Size">
<summary>
Gets the number of elements contained in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
</summary>
<value>The number of elements contained in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</value>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.Tail">
<summary>
Gets the index of the end of the buffer data.
</summary>
<value>The index of the last element in the buffer.</value>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#ICollection#Count">
<summary>
Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"/>.
</summary>
<value>The number of elements actually contained in the <see cref="T:System.Collections.ICollection"/>.</value>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#ICollection#IsSynchronized">
<summary>
Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread safe).
</summary>
<value><c>true</c> if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread safe); otherwise, <c>false</c>. In the default implementation of <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>, this property always returns <c>false</c>.</value>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#ICollection#SyncRoot">
<summary>
Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
</summary>
<value>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/></value>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#Generic#ICollection{T}#Count">
<summary>
Gets the number of elements contained in the <see cref="T:System.Collections.Generic.ICollection`1"/>.
</summary>
<value>The number of elements actually contained in the <see cref="T:System.Collections.Generic.ICollection`1"/>.</value>
</member>
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#Generic#ICollection{T}#IsReadOnly">
<summary>
Gets a value indicating whether the <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.
</summary>
<value><c>true</c> if the <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only; otherwise, <c>false</c>. In the default implementation of <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>, this property always returns <c>false</c>.</value>
</member>
</members>
</doc>

64
packages/MySql.Data.6.9.7/CHANGES vendored Normal file
View file

@ -0,0 +1,64 @@
6.9.7
- Changed default SSL mode to Preferred in connection string. Now the server connections will be using SSL if server allows it by default but it's possible to override this configuration.
- Changed handshake process to use bytes instead of encoded strings.
- Fix for Fabric connections (Oracle Bug #20983968).
- Fix for Fabric plugin: fabric server selection is broken when master is faulty (Oracle Bug #21203824).
6.9.6
- Fix for Incorrect query result with Entity Framework 6 (MySql bug #74918, Oracle bug #20129927).
- Fix for GetTimeZoneOffset to use date and time to calculate timediff (MySQL Bug #74905, Oracle Bug #20065691).
- Fix for MySqlSimpleMembershipProvider keeps database connections open on some operations (MySQL Bug #74662, Oracle Bug #20109419)
- Fix for Any Call to RoleExists() returns true whether or not the role exists (MySql bug #75397, Oracle bug #20325391).
- Fix for all dateTimes set as UTC Kind (MySQL Bug #74134, Oracle Bug #20200662).
- Fix for Invalid SQL query when eager loading two nested collections (MySQL Bug #70941, Oracle bug #18049862).
- Fix for chinese characters used in the connection string when connecting to MySql Server (MySQL Bug #70041, Oracle Bug #18141356).
6.9.5
- Disabled installation on-demand in Installer (Oracle Bug #19670596).
- Fix for Generated SQL requests column that doesn't exist in LINQ to Entities (MySql bug #72004, Oracle bug #19681348).
- Fix for MySQL Connector/NET generates incorrect SQL for LINQ 'StartsWith' queries (MySql bug #72058, Oracle bug #19680236).
- Fix for Exception when using IEnumerable.Contains(model.property) in Where predicate (MySql bug #73643, Oracle bug #19690370).
- Fix for Generated Sql does not contain ORDER BY statement whose is requested by LINQ (MySql bug #73549, Oracle bug #19698010).
- Fix for Web providers registration in machine.config (removed v20 suffix) (MySQL Bug #74080, Oracle Bug #19715398)
- Fix for Error of "Every derived table must have an alias" in LINQ to Entities when using EF6 + DbFirst + View + Take
(MySql Bug #72148, Oracle bug #19356006).
- Fix for 'the method or operation is not implemented' when using linq with orderby (MySQL Bug #70722, Oracle Bug #19681723).
- Fix for Exception "The given key was not present in the dictionary" when using utf16le charset in a query. (MySql #72737, Oracle Bug #19355906)
- Fix for Memory leak in a loop opening a connection to the database and executing a command (MySql Bug #73122, Oracle Bug #19467233).
- Fix for Multiple issues caused by trailing and leading white space character in params using MySql Membership Provider (MySql Bug #73411, Oracle Bug #19453313)
- Fix for bad assumption leads to modify query adding CALL statement to the beginning of the sql query even when CommandType.Text is specified (MySql Bug #72736, Oracle Bug #19325120).
6.9.4
- Added a new plugin for MySql Fabric 1.5 support
6.9.3
- Fix for Web Parts Personalization provider
- Fix for changing the PK between two int columns (MySql Bug #71418, Oracle bug #18923294).
- Fix for Error when Calling MySqlConnection.GetSchema("PROCEDURES WITH PARAMETERS", ...) (Oracle bug #19285959).
- Fix for EF provider reports ManifestProviderToken = 5.6 for server 5.7 (Oracle bug #19453814).
- Fix for Fluent API DbModelBuilder.HasColumnType is ignored in EF6 (Oracle bug #19456229).
- Fix for Setting a PK GUID identity in Code First in EF6 no longer works in Server 5.7 (Oracle bug #19456452).
- Non PKs declared as Identity GUID have no GUID autogenerated (Oracle bug #19456415).
6.9.2
- Add async/await compatible methods
- Fix for Unable to read geometry column when it has been set with a SRID value. (MySql Bug #71869, Oracle Bug #19137999)
- Fix for Exception adding a new column to an existing model as identity and PK fails when applying the migration (MySql Bug #71418, Oracle bug #18923294).
- Added SiteMap and Personalization configuration web providers to MySql.Web Nuget Package.
6.9.1
- Fix for Exception of "duplicate entry" in MySqlSessionProvider (MySql Bug #70409, Oracle bug #18657550).
6.9.0
- Added implementation of MySQLPersonalizationProvider.
- Added SiteMap Web provider.
- Added Simple Membership Web Provider.
- Fix for open sockets connections left when connection open fails, the error happens when the client try to get a connection when the max number of connections is reached in the server. (MySql #72025, Oracle Bug #18665388).

Binary file not shown.

15
packages/MySql.Data.6.9.7/Readme.txt vendored Normal file
View file

@ -0,0 +1,15 @@
Connector/Net 6.9 Release Notes
------------------------------------
Welcome to the release notes for Connector/Net 6.9
What's new in 6.9
--------------------
- Simple Membership Web Provider
- Site Map Web Provider
- Personalization Web Provider
- MySql Fabric support
Be sure and check the documentation for more information on these new features.

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,112 @@
param($installPath, $toolsPath, $package, $project)
# open json.net splash page on package install
# don't open if json.net is installed as a dependency
try
{
$url = "http://www.newtonsoft.com/json/install?version=" + $package.Version
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindow.Caption -eq "Package Manager Console")
{
# user is installing from VS NuGet console
# get reference to the window, the console host and the input history
# show webpage if "install-package newtonsoft.json" was last input
$consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow])
$props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor `
[System.Reflection.BindingFlags]::NonPublic)
$prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1
if ($prop -eq $null) { return }
$hostInfo = $prop.GetValue($consoleWindow)
if ($hostInfo -eq $null) { return }
$history = $hostInfo.WpfConsole.InputHistory.History
$lastCommand = $history | select -last 1
if ($lastCommand)
{
$lastCommand = $lastCommand.Trim().ToLower()
if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json"))
{
$dte2.ItemOperations.Navigate($url) | Out-Null
}
}
}
else
{
# user is installing from VS NuGet dialog
# get reference to the window, then smart output console provider
# show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation
$instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor `
[System.Reflection.BindingFlags]::NonPublic)
$consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor `
[System.Reflection.BindingFlags]::NonPublic)
if ($instanceField -eq $null -or $consoleField -eq $null) { return }
$instance = $instanceField.GetValue($null)
if ($instance -eq $null) { return }
$consoleProvider = $consoleField.GetValue($instance)
if ($consoleProvider -eq $null) { return }
$console = $consoleProvider.CreateOutputConsole($false)
$messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor `
[System.Reflection.BindingFlags]::NonPublic)
if ($messagesField -eq $null) { return }
$messages = $messagesField.GetValue($console)
if ($messages -eq $null) { return }
$operations = $messages -split "=============================="
$lastOperation = $operations | select -last 1
if ($lastOperation)
{
$lastOperation = $lastOperation.ToLower()
$lines = $lastOperation -split "`r`n"
$installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1
if ($installMatch)
{
$dte2.ItemOperations.Navigate($url) | Out-Null
}
}
}
}
catch
{
try
{
$pmPane = $dte2.ToolWindows.OutputWindow.OutputWindowPanes.Item("Package Manager")
$selection = $pmPane.TextDocument.Selection
$selection.StartOfDocument($false)
$selection.EndOfDocument($true)
if ($selection.Text.StartsWith("Attempting to gather dependencies information for package 'Newtonsoft.Json." + $package.Version + "'"))
{
$dte2.ItemOperations.Navigate($url) | Out-Null
}
}
catch
{
# stop potential errors from bubbling up
# worst case the splash page won't open
}
}
# still yolo

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\FFXIVClassic_Lobby_Server\packages.config" />
</repositories>

View file

@ -0,0 +1,55 @@
===Encoded Chara Info=== By Ioncannon
-Based on chara info array in Seventh Umbral
0x000: Int32;
0x004: Int32;
0x008:Name Size Int32;
0x00C:Name String; Variable size, but in file the name "Wrenix Wrong" is 0xD in size
0x019: Int32;
0x01D: Int32;
0x021:Tribe Model Int32;
0x025:Size Int32;
0x029:Colors Info Int32;
0x02D:Face Info Int32;
0x031:Hair Model Int32;
0x035:Voice Int32;
0x039:MainHand Int32;
0x03D:OffHand Int32;
0x041: Int32;
0x045: Int32;
0x049: Int32;
0x04D: Int32;
0x051: Int32;
0x055:Head Int32;
0x059:Body Int32;
0x06D:Legs Int32;
0x061:Hands Int32;
0x065:Feet Int32;
0x069:Waist Int32;
0x06D: Int32;
0x071:Right Ear Int32;
0x075:Left Ear Int32;
0x079: Int32;
0x07D: Int32;
0x081:Right Ring Int32;
0x085:Left Ring Int32;
0x09F:Tribe Byte;
0x0A0: Int32;
0x0A4:Location Str Size Int32;
0x0A8:Location String String; Variable size, but in file it is prv0Inn01\0, 0x0A in size.
0x0B2:Territory Str Size Int32;
0x0B6:Territory Str? String; Variable size, but in file it is defaultTerritory\0, 0x11 in size.
0x0C7:Guardian Byte;
0x0C8:Birth Month Byte;
0x0C9:Birth Day Byte;
0x0CA: Short;
0x0CC: Int32;
0x0D0: Int32;
0x0E4: Byte;
0x0E8:Allegiance Byte;

6
research/serverInfo.txt Normal file
View file

@ -0,0 +1,6 @@
Server Sheet
0x00:Server ID Short;
0x02: Short;
0x04:Server Pop Short;
0x10:Server Name