mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
Merged to master
This commit is contained in:
commit
d0a10d33e6
574 changed files with 58588 additions and 47883 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -121,3 +121,7 @@ cotire/
|
|||
|
||||
*objects.txt
|
||||
*exports.def
|
||||
|
||||
# doxygen output folder
|
||||
doxygen/generated/
|
||||
doxygen/*.tmp
|
|
@ -13,11 +13,12 @@ matrix:
|
|||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-6.0
|
||||
packages:
|
||||
- gcc-7
|
||||
- clang-6.0
|
||||
- g++-7
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
||||
- MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
|
||||
|
||||
# Setup cache
|
||||
cache:
|
||||
|
|
|
@ -52,5 +52,6 @@ add_subdirectory( "src/tools/exd_struct_gen" )
|
|||
add_subdirectory( "src/tools/exd_struct_test" )
|
||||
add_subdirectory( "src/tools/quest_parser" )
|
||||
add_subdirectory( "src/tools/discovery_parser" )
|
||||
add_subdirectory( "src/tools/mob_parse" )
|
||||
#add_subdirectory("src/tools/pcb_reader")
|
||||
#add_subdirectory("src/tools/event_object_parser")
|
||||
|
|
|
@ -32,7 +32,7 @@ switch( commandId )
|
|||
{
|
||||
case 0x01: // Toggle sheathe
|
||||
{
|
||||
if ( param11 == 1 )
|
||||
if( param11 == 1 )
|
||||
pPlayer->setStance( Entity::Chara::Stance::Active );
|
||||
else
|
||||
{
|
||||
|
|
103
CodeStyle.xml
Normal file
103
CodeStyle.xml
Normal file
|
@ -0,0 +1,103 @@
|
|||
<code_scheme name="Default" version="173">
|
||||
<option name="AUTODETECT_INDENTS" value="false" />
|
||||
<Objective-C>
|
||||
<option name="INDENT_NAMESPACE_MEMBERS" value="0" />
|
||||
<option name="INDENT_C_STRUCT_MEMBERS" value="2" />
|
||||
<option name="INDENT_CLASS_MEMBERS" value="2" />
|
||||
<option name="INDENT_INSIDE_CODE_BLOCK" value="2" />
|
||||
<option name="FUNCTION_BRACE_PLACEMENT" value="2" />
|
||||
<option name="BLOCK_BRACE_PLACEMENT" value="2" />
|
||||
<option name="CLASS_CONSTRUCTOR_INIT_LIST_NEW_LINE_BEFORE_COLON" value="0" />
|
||||
<option name="CLASS_CONSTRUCTOR_INIT_LIST_NEW_LINE_AFTER_COLON" value="1" />
|
||||
<option name="SUPERCLASS_LIST_ALIGN_MULTILINE" value="false" />
|
||||
<option name="SUPERCLASS_LIST_BEFORE_COLON" value="0" />
|
||||
<option name="SUPERCLASS_LIST_AFTER_COLON" value="1" />
|
||||
<option name="SPACE_WITHIN_TEMPLATE_DECLARATION_LTGT" value="true" />
|
||||
<option name="SPACE_WITHIN_TEMPLATE_CALL_LTGT" value="true" />
|
||||
<option name="SPACE_WITHIN_FUNCTION_DECLARATION_PARENTHESES" value="true" />
|
||||
<option name="SPACE_WITHIN_FUNCTION_CALL_PARENTHESES" value="true" />
|
||||
<option name="SPACE_WITHIN_LAMBDA_CAPTURE_LIST_BRACKET" value="true" />
|
||||
<option name="SPACE_BEFORE_POINTER_IN_DECLARATION" value="false" />
|
||||
<option name="SPACE_AFTER_POINTER_IN_DECLARATION" value="true" />
|
||||
<option name="SPACE_BEFORE_REFERENCE_IN_DECLARATION" value="false" />
|
||||
<option name="SPACE_AFTER_REFERENCE_IN_DECLARATION" value="true" />
|
||||
<option name="SPACE_BETWEEN_ADJACENT_BRACKETS" value="true" />
|
||||
<option name="DISCHARGED_SHORT_TERNARY_OPERATOR" value="true" />
|
||||
</Objective-C>
|
||||
<Objective-C-extensions>
|
||||
<file>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
||||
</file>
|
||||
<class>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
||||
</class>
|
||||
<extensions>
|
||||
<pair source="cpp" header="h" fileNamingConvention="NONE" />
|
||||
<pair source="c" header="h" fileNamingConvention="NONE" />
|
||||
</extensions>
|
||||
</Objective-C-extensions>
|
||||
<DBN-PSQL>
|
||||
<case-options enabled="false">
|
||||
<option name="KEYWORD_CASE" value="lower" />
|
||||
<option name="FUNCTION_CASE" value="lower" />
|
||||
<option name="PARAMETER_CASE" value="lower" />
|
||||
<option name="DATATYPE_CASE" value="lower" />
|
||||
<option name="OBJECT_CASE" value="preserve" />
|
||||
</case-options>
|
||||
<formatting-settings enabled="false" />
|
||||
</DBN-PSQL>
|
||||
<DBN-SQL>
|
||||
<case-options enabled="false">
|
||||
<option name="KEYWORD_CASE" value="lower" />
|
||||
<option name="FUNCTION_CASE" value="lower" />
|
||||
<option name="PARAMETER_CASE" value="lower" />
|
||||
<option name="DATATYPE_CASE" value="lower" />
|
||||
<option name="OBJECT_CASE" value="preserve" />
|
||||
</case-options>
|
||||
<formatting-settings enabled="false">
|
||||
<option name="STATEMENT_SPACING" value="one_line" />
|
||||
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
|
||||
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
|
||||
</formatting-settings>
|
||||
</DBN-SQL>
|
||||
<codeStyleSettings language="ObjectiveC">
|
||||
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
|
||||
<option name="BRACE_STYLE" value="2" />
|
||||
<option name="CLASS_BRACE_STYLE" value="2" />
|
||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
||||
<option name="SPACE_AROUND_LAMBDA_ARROW" value="false" />
|
||||
<option name="SPACE_WITHIN_PARENTHESES" value="true" />
|
||||
<option name="SPACE_WITHIN_IF_PARENTHESES" value="true" />
|
||||
<option name="SPACE_WITHIN_WHILE_PARENTHESES" value="true" />
|
||||
<option name="SPACE_WITHIN_FOR_PARENTHESES" value="true" />
|
||||
<option name="SPACE_WITHIN_CATCH_PARENTHESES" value="true" />
|
||||
<option name="SPACE_WITHIN_SWITCH_PARENTHESES" value="true" />
|
||||
<option name="SPACE_WITHIN_CAST_PARENTHESES" value="true" />
|
||||
<option name="SPACE_WITHIN_BRACKETS" value="true" />
|
||||
<option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACES" value="true" />
|
||||
<option name="SPACE_BEFORE_IF_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_WHILE_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_FOR_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_CATCH_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_SWITCH_PARENTHESES" value="false" />
|
||||
<option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="false" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
|
@ -13,7 +13,7 @@ Sapphire requires the following software:
|
|||
|
||||
| *Name* | *Windows* | *Linux* |
|
||||
| ------ | --------- | ------- |
|
||||
| CMake 2.6+ and C++14 capable compiler | [Visual Studio 2017](https://www.visualstudio.com/) | `gcc 4.9` and `g++ 4.9` or newer |
|
||||
| CMake 3.0.2+ and C++14 capable compiler | [Visual Studio 2017](https://www.visualstudio.com/) | `gcc 4.9` and `g++ 4.9` or newer |
|
||||
| Boost 1.63.0 | [Win32 precompiled binaries](https://sourceforge.net/projects/boost/files/boost-binaries/1.63.0/boost_1_63_0-msvc-14.0-32.exe/download) | Boost libraries from your distribution's package manager |
|
||||
| MySQL Server 5.7 | [Official Site](https://dev.mysql.com/downloads/mysql/) | MySQL server from your distribution's package manager |
|
||||
|
||||
|
@ -23,4 +23,4 @@ Please check the [wiki](https://github.com/SapphireMordred/Sapphire/wiki) for de
|
|||
|
||||
* [Sapphire on YouTube](https://www.youtube.com/channel/UCJKYuovoGsq7PxSAfrNJKbw)
|
||||
|
||||
Final Fantasy XIV © 2010-2017 SQUARE ENIX CO., LTD. All Rights Reserved. We are not affiliated with SQUARE ENIX CO., LTD. in any way.
|
||||
Final Fantasy XIV © 2010-2018 SQUARE ENIX CO., LTD. All Rights Reserved. We are not affiliated with SQUARE ENIX CO., LTD. in any way.
|
||||
|
|
2494
doxygen/Doxyfile
Normal file
2494
doxygen/Doxyfile
Normal file
File diff suppressed because it is too large
Load diff
129
doxygen/extra_stylesheet.css
Normal file
129
doxygen/extra_stylesheet.css
Normal file
|
@ -0,0 +1,129 @@
|
|||
body {
|
||||
background-color: #222;
|
||||
color: #ccc;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#nav-tree {
|
||||
background-color: #222;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
#side-nav {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#titlearea {
|
||||
border: none;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
div.header {
|
||||
background-color: #2a2a2a !important;
|
||||
}
|
||||
|
||||
h2.groupheader {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams {
|
||||
background-color: #333;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.directory tr.even {
|
||||
background-color: #3f3f3f;
|
||||
}
|
||||
|
||||
a, .contents a:visited {
|
||||
color: #548cff;
|
||||
}
|
||||
|
||||
.memtitle {
|
||||
background-color: #555 !important;
|
||||
background-image: none;
|
||||
|
||||
border-top: 1px solid #717171;
|
||||
border-left: 1px solid #717171;
|
||||
border-right: 1px solid #717171;
|
||||
}
|
||||
|
||||
.memdoc, dl.reflist dd {
|
||||
background-color: #444;
|
||||
|
||||
border-bottom: 1px solid #717171;
|
||||
border-left: 1px solid #717171;
|
||||
border-right: 1px solid #717171;
|
||||
}
|
||||
|
||||
.memproto, dl.reflist dt {
|
||||
background-color: #555;
|
||||
color: #ccc;
|
||||
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9);
|
||||
|
||||
border-top: 1px solid #717171;
|
||||
border-left: 1px solid #717171;
|
||||
border-right: 1px solid #717171;
|
||||
}
|
||||
|
||||
div.header {
|
||||
border-bottom: 1px solid #717171;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.paramname {
|
||||
color: #ff5a5a;
|
||||
}
|
||||
|
||||
.memtemplate {
|
||||
color: #6e9eff;
|
||||
}
|
||||
|
||||
.memSeparator, h2.groupheader {
|
||||
border-bottom: 1px solid #545454;
|
||||
}
|
||||
|
||||
.navelem, .navpath ul {
|
||||
background-color: #333;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.navpath ul {
|
||||
border: solid 1px #717171;
|
||||
}
|
||||
|
||||
.navpath li.footer {
|
||||
color: #548cff;
|
||||
}
|
||||
|
||||
.navpath li.navelem a, .navpath li.navelem a:visited {
|
||||
color: #ccc;
|
||||
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
.ui-resizable-e {
|
||||
background-image: none;
|
||||
background-color: #717171;
|
||||
}
|
||||
|
||||
.sm-dox {
|
||||
background-image: none;
|
||||
background-color: #333;
|
||||
}
|
||||
|
||||
.sm-dox a {
|
||||
color: #ccc;
|
||||
text-shadow: 0px 1px 1px #000;
|
||||
}
|
||||
|
||||
.sm-dox a span.sub-arrow {
|
||||
border-color: #ccc transparent transparent transparent;
|
||||
}
|
||||
|
||||
.sm-dox a, .sm-dox a:focus, .sm-dox a:active, .sm-dox a:hover, .sm-dox a.highlighted {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
#main-nav {
|
||||
border-top: 1px solid #717171;
|
||||
}
|
BIN
doxygen/logo.png
Normal file
BIN
doxygen/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
6
doxygen/pages/index.md
Normal file
6
doxygen/pages/index.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Sapphire Developer Documentation
|
||||
The intent is to provide developers with a sense of pride and enjoyment for documenting their code.
|
||||
|
||||
Please look forward to it.
|
||||
|
||||

|
1318
sql/battlenpc.sql
1318
sql/battlenpc.sql
File diff suppressed because it is too large
Load diff
278
sql/bnpctemplate.sql
Normal file
278
sql/bnpctemplate.sql
Normal file
|
@ -0,0 +1,278 @@
|
|||
-- phpMyAdmin SQL Dump
|
||||
-- version 4.5.1
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: 127.0.0.1
|
||||
-- Erstellungszeit: 13. Sep 2018 um 22:11
|
||||
-- Server-Version: 10.1.19-MariaDB
|
||||
-- PHP-Version: 5.6.28
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
--
|
||||
-- Datenbank: `sapphire`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `bnpctemplate`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `bnpctemplate`;
|
||||
CREATE TABLE `bnpctemplate` (
|
||||
`Id` int(11) NOT NULL,
|
||||
`Name` varchar(32) NOT NULL,
|
||||
`bNPCBaseId` int(10) DEFAULT NULL,
|
||||
`bNPCNameId` int(10) NOT NULL,
|
||||
`mainWeaponModel` bigint(20) DEFAULT NULL,
|
||||
`secWeaponModel` bigint(20) DEFAULT NULL,
|
||||
`aggressionMode` int(3) DEFAULT NULL,
|
||||
`enemyType` int(3) DEFAULT NULL,
|
||||
`pose` int(3) DEFAULT NULL,
|
||||
`modelChara` int(5) DEFAULT NULL,
|
||||
`displayFlags` int(10) DEFAULT NULL,
|
||||
`Look` binary(26) DEFAULT NULL,
|
||||
`Models` binary(40) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Daten für Tabelle `bnpctemplate`
|
||||
--
|
||||
|
||||
INSERT INTO `bnpctemplate` (`Id`, `Name`, `bNPCBaseId`, `bNPCNameId`, `mainWeaponModel`, `secWeaponModel`, `aggressionMode`, `enemyType`, `pose`, `modelChara`, `displayFlags`, `Look`, `Models`) VALUES
|
||||
(1, 'littleladybug_49', 49, 49, 0, 0, 1, 4, 4, 57, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(2, 'beecloud_57', 57, 395, 0, 0, 1, 4, 4, 60, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(3, 'watersprite_59', 59, 56, 0, 0, 1, 4, 4, 385, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(4, 'tinymandragora_118', 118, 405, 0, 0, 1, 4, 4, 297, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(5, 'wildjackal_138', 138, 399, 0, 0, 2, 4, 4, 160, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(6, 'woundedaurochs_323', 323, 358, 0, 0, 2, 4, 4, 138, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(7, 'megalocrab_326', 326, 561, 0, 0, 1, 4, 4, 148, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(8, 'lostlamb_338', 338, 392, 0, 0, 1, 4, 4, 287, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(9, 'pukhatchling_341', 341, 401, 0, 0, 1, 4, 4, 130, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(10, 'bogy_342', 342, 404, 0, 0, 1, 4, 4, 264, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(11, 'wharfrat_347', 347, 417, 0, 0, 1, 4, 4, 24, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(12, 'groundedpirate_348', 348, 421, 4297654473, 8590262373, 2, 4, 4, 0, 0, 0x0100013201050601623b32000001013b83010102004b004b0001, 0x170032000a000512000001000a000100080059000000000000000000000000000000000000000000),
|
||||
(13, 'groundedraider_349', 349, 418, 8591966609, 0, 2, 4, 4, 0, 0, 0x0100013201040c01300305000001010304040302004b00320001, 0x170032000a000512000001000a000100080059000000000000000000000000000000000000000000),
|
||||
(14, 'CaptainPetyrPigeontoe_350', 350, 419, 8591966609, 0, 2, 4, 4, 0, 0, 0x0100014b010304016b3b2b000001023b83000200006400320001, 0x170032000a000512000001000a000100080059000000000000000000000000000000000000000000),
|
||||
(15, 'pugil_383', 383, 640, 0, 0, 1, 4, 4, 356, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(16, 'wespe_385', 385, 641, 0, 0, 1, 4, 4, 359, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(17, 'goblingambler_769', 769, 3099, 4297588937, 0, 1, 4, 4, 6, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000100010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(18, 'strikingdummy_901', 901, 541, 0, 0, 1, 4, 0, 480, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(19, 'mosslessgoobbue_1447', 1447, 354, 0, 0, 1, 4, 4, 198, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(20, 'SkogsFru_3184', 3184, 2928, 0, 0, 1, 4, 0, 57, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(21, 'galago_5', 5, 408, 0, 0, 1, 4, 4, 31, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(22, 'nestingbuzzard_12', 12, 299, 0, 0, 1, 4, 4, 39, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(23, 'cavebat_38', 38, 364, 0, 0, 1, 4, 4, 98, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(24, 'windsprite_133', 133, 115, 0, 0, 1, 4, 4, 383, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(25, 'lightningsprite_135', 135, 117, 0, 0, 1, 4, 4, 384, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(26, 'Morabymole_205', 205, 409, 0, 0, 1, 4, 4, 282, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(27, 'firefly_306', 306, 129, 0, 0, 1, 4, 4, 78, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(28, 'rivertoad_313', 313, 349, 0, 0, 1, 4, 4, 126, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(29, 'aurelia_324', 324, 563, 0, 0, 1, 4, 4, 279, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(30, 'wilddodo_339', 339, 393, 0, 0, 1, 4, 4, 173, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(31, 'packrat_351', 351, 1101, 0, 0, 2, 4, 4, 26, 262144, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(32, 'koboldpotman_751', 751, 378, 4297588937, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000100010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(33, 'kobolddustman_752', 752, 368, 4295033233, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000200010002000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(34, 'koboldsupplicant_754', 754, 372, 4295951237, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000300010003000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(35, 'Qiqirneggdigger_771', 771, 350, 0, 0, 2, 4, 4, 14, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(36, 'Cepheus_855', 855, 1058, 0, 0, 2, 4, 4, 279, 262144, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(37, 'Barbastelle_3185', 3185, 2929, 0, 0, 1, 4, 0, 98, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(38, 'grassraptor_2', 2, 411, 0, 0, 2, 4, 4, 96, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(39, 'gigantoad_26', 26, 26, 0, 0, 2, 4, 4, 126, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(40, '2ndCohorthoplomachus_55', 55, 1821, 17180065993, 12885295205, 2, 4, 4, 0, 0, 0x0100013201020401110505000000030580040101001900320000, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(41, '2ndCohortlaquearius_61', 61, 1822, 12884967825, 0, 2, 4, 4, 0, 0, 0x0100013201010201aa9206000000029202000302003200320007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(42, '2ndCohorteques_62', 62, 1823, 12885230069, 0, 2, 4, 4, 0, 0, 0x02000132030203013c9236000000019201050300003201320007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(43, '2ndCohortsecutor_63', 63, 1824, 21475033389, 21475033439, 2, 4, 4, 0, 0, 0x0100013201010701984706000000024701020302003200320007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(44, '2ndCohortsignifer_64', 64, 1825, 30064837609, 0, 2, 4, 4, 0, 0, 0x0100013201050301113b27000000043b850103000032004b0007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(45, 'junglecoeurl_117', 117, 352, 0, 0, 2, 4, 4, 65, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(46, 'dungmidgeswarm_136', 136, 396, 0, 0, 1, 4, 4, 58, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(47, 'giantpelican_178', 178, 366, 0, 0, 2, 4, 4, 154, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(48, '2ndCohortvanguard_201', 201, 1826, 0, 0, 2, 4, 4, 214, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(49, 'Bloodshorebell_312', 312, 361, 0, 0, 2, 4, 4, 280, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(50, 'apkallu_314', 314, 341, 0, 0, 1, 4, 4, 190, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(51, 'goobbue_320', 320, 353, 0, 0, 1, 4, 4, 198, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(52, 'mildewedgoobbue_321', 321, 355, 0, 0, 2, 4, 4, 198, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(53, 'largebuffalo_322', 322, 1313, 0, 0, 2, 4, 4, 138, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(54, 'snipper_325', 325, 560, 0, 0, 2, 4, 4, 149, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(55, 'koboldpatrolman_328', 328, 379, 8592556233, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000100010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(56, 'koboldpitman_329', 329, 369, 4295033233, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000200010002000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(57, 'koboldmissionary_331', 331, 373, 4295951237, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000300010003000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(58, 'corkbulb_384', 384, 684, 0, 0, 1, 4, 4, 358, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(59, 'colibri_386', 386, 639, 0, 0, 2, 4, 4, 360, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(60, 'BloodyMary_3186', 3186, 2930, 0, 0, 1, 4, 0, 190, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(61, 'arborbuzzard_12', 12, 13, 0, 0, 2, 4, 4, 39, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(62, 'deadmansmoan_20', 20, 1854, 25772425417, 0, 2, 4, 4, 17, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(63, 'roseling_22', 22, 400, 0, 0, 1, 4, 4, 48, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(64, 'duskbat_38', 38, 363, 0, 0, 1, 4, 4, 98, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(65, 'plasmoid_46', 46, 46, 0, 0, 1, 4, 4, 80, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(66, 'axolotl_139', 139, 1831, 0, 0, 2, 4, 4, 151, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(67, 'Rothlytpelican_181', 181, 1181, 0, 0, 2, 4, 4, 157, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(68, 'sewermole_205', 205, 410, 0, 0, 1, 4, 4, 282, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(69, 'hedgemole_206', 206, 403, 0, 0, 1, 4, 4, 283, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(70, 'seawasp_312', 312, 360, 0, 0, 2, 4, 4, 280, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(71, 'fatdodo_340', 340, 394, 0, 0, 1, 4, 4, 174, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(72, 'pukhatchling_341', 341, 402, 0, 0, 1, 4, 4, 130, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(73, 'Rhotanobuccaneer_348', 348, 420, 4297654473, 8590262373, 2, 4, 4, 0, 0, 0x0100013201050601623b32000001013b83010102004b004b0001, 0x170032000a000512000001000a000100080059000000000000000000000000000000000000000000),
|
||||
(74, 'Rhotanobuccaneer_349', 349, 420, 8591966609, 0, 2, 4, 4, 0, 0, 0x0100013201040c01300305000001010304040302004b00320001, 0x170032000a000512000001000a000100080059000000000000000000000000000000000000000000),
|
||||
(75, 'preyingmantis_396', 396, 1852, 0, 0, 2, 4, 4, 376, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(76, 'killermantis_397', 397, 644, 0, 0, 2, 4, 4, 374, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(77, 'lammergeyer_403', 403, 1853, 0, 0, 2, 4, 4, 41, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(78, 'shelfscaleSahagin_765', 765, 386, 4295688693, 0, 2, 4, 4, 9, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(79, 'shelfclawSahagin_766', 766, 384, 0, 0, 2, 4, 4, 9, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(80, 'Sapsashelfspine_767', 767, 1829, 4295688693, 4295426149, 2, 4, 4, 9, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000020001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(81, 'shoaltoothSahagin_768', 768, 2526, 51539673889, 0, 2, 4, 4, 9, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000020002000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(82, 'goblinhunter_769', 769, 225, 4297588937, 0, 1, 4, 4, 6, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000100010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(83, 'shelfscaleReaver_773', 773, 347, 17182949577, 12885033061, 2, 4, 4, 0, 0, 0x05000132090101011a0101000001000100000000003200321045, 0x170066000a000f0019000f0010005100190027000000000000000000000000000000000000000000),
|
||||
(84, 'shelfclawReaver_774', 774, 345, 21474967853, 21474967903, 2, 4, 4, 0, 0, 0x0500013209020901ab15040000010115830300020064004b1045, 0x1700660008000d000800480008003f00080064000000000000000000000000000000000000000000),
|
||||
(85, 'shelfeyeReaver_776', 776, 559, 30064902745, 4295033530, 2, 4, 4, 0, 0, 0x0500013209010c01149203000001029202020202006400321445, 0x170066000a000f0019000f0010005100190027000000000000000000000000000000000000000000),
|
||||
(86, 'Sapsaelbst_2832', 2832, 2527, 0, 0, 2, 4, 4, 182, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(87, 'whelkballista_2835', 2835, 2530, 0, 0, 1, 4, 2, 679, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(88, 'freshwhelkballista_2836', 2836, 2531, 0, 0, 1, 4, 2, 679, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(89, 'reinforcedwhelkballista_2837', 2837, 2532, 0, 0, 2, 4, 2, 679, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(90, 'DarkHelmet_3187', 3187, 2931, 0, 0, 1, 4, 0, 722, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000100010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(91, 'coeurlpup_28', 28, 28, 0, 0, 2, 4, 4, 69, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(92, 'bumblebeetle_36', 36, 296, 0, 0, 1, 4, 4, 56, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(93, 'salamander_139', 139, 391, 0, 0, 2, 4, 4, 151, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(94, 'forestyarzon_159', 159, 381, 0, 0, 2, 4, 4, 76, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(95, 'wildwolf_303', 303, 1180, 0, 0, 2, 4, 4, 159, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(96, 'koboldpickman_329', 329, 370, 4295033233, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000200010002000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(97, 'koboldsidesman_330', 330, 376, 4295033533, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000400010004000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(98, 'MamoolJabreeder_343', 343, 414, 4295033033, 4295426149, 2, 4, 4, 10, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(99, 'MamoolJaexecutioner_344', 344, 413, 4295033233, 0, 2, 4, 4, 10, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(100, 'MamoolJainfiltrator_345', 345, 416, 4295033333, 0, 2, 4, 4, 10, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(101, 'MamoolJasophist_346', 346, 415, 51539673889, 0, 2, 4, 4, 10, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000020001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(102, 'stoneshell_382', 382, 638, 0, 0, 1, 4, 4, 355, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(103, 'mudpugil_383', 383, 642, 0, 0, 1, 4, 4, 356, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(104, 'uragnite_389', 389, 643, 0, 0, 1, 4, 4, 364, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(105, 'Myradrosh_3188', 3188, 2932, 0, 0, 1, 4, 0, 360, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(106, '3rdCohorthoplomachus_55', 55, 53, 17180065993, 12885295205, 2, 4, 4, 0, 0, 0x0100013201020401110505000000030580040101001900320000, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(107, '3rdCohortlaquearius_61', 61, 58, 12884967825, 0, 2, 4, 4, 0, 0, 0x0100013201010201aa9206000000029202000302003200320007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(108, '3rdCohorteques_62', 62, 59, 12885230069, 0, 2, 4, 4, 0, 0, 0x02000132030203013c9236000000019201050300003201320007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(109, '3rdCohortsecutor_63', 63, 60, 21475033389, 21475033439, 2, 4, 4, 0, 0, 0x0100013201010701984706000000024701020302003200320007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(110, '3rdCohortsignifer_64', 64, 61, 30064837609, 0, 2, 4, 4, 0, 0, 0x0100013201050301113b27000000043b850103000032004b0007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(111, 'earthsprite_131', 131, 113, 0, 0, 1, 4, 4, 386, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(112, 'basilisk_173', 173, 304, 0, 0, 2, 4, 4, 135, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(113, 'ahriman_183', 183, 242, 0, 0, 2, 4, 4, 168, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(114, 'quartzdoblyn_188', 188, 275, 0, 0, 1, 4, 4, 177, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(115, 'magitekvanguard_200', 200, 269, 0, 0, 2, 4, 4, 213, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(116, 'grenade_327', 327, 270, 0, 0, 2, 4, 4, 101, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(117, 'FlameSergeantDalvag_3183', 3183, 2927, 0, 0, 1, 4, 0, 717, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000040001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(118, 'antelopestag_4', 4, 4, 0, 0, 1, 4, 4, 62, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(119, 'ked_8', 8, 8, 0, 0, 2, 4, 4, 54, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(120, 'midlandcondor_13', 13, 566, 0, 0, 2, 4, 4, 40, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(121, 'wildhog_16', 16, 15, 0, 0, 2, 4, 4, 45, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(122, 'kedtrap_23', 23, 23, 0, 0, 2, 4, 4, 49, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(123, 'treant_24', 24, 24, 0, 0, 2, 4, 4, 104, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(124, 'adamantoise_34', 34, 34, 0, 0, 1, 4, 4, 94, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(125, 'hoverflyswarm_41', 41, 168, 0, 0, 1, 4, 4, 59, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(126, 'will-o-the-wisp_45', 45, 45, 0, 0, 1, 4, 4, 79, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(127, 'goblinthug_52', 52, 50, 8592556233, 0, 2, 4, 4, 6, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000100010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(128, 'Coeurlclawpoacher_79', 79, 140, 38654902773, 0, 2, 4, 4, 0, 0, 0x0401013208030201150c05000000000c00000000003201000000, 0x130010000900260009007c0009004d000900b2000000000000000000000000000000000000000000),
|
||||
(129, 'Coeurlclawhunter_81', 81, 139, 17179935321, 4295033530, 2, 4, 4, 0, 0, 0x04010132080301014a0c1e000000000c00000000003201000000, 0x130010000900260009007c0009004d000900b2000000000000000000000000000000000000000000),
|
||||
(130, 'Redbellylookout_84', 84, 52, 21474902217, 8590393445, 2, 4, 4, 0, 0, 0x02000132040102013a8a06000000028a02000302003201320000, 0x0900d200090010000900670009004a000900a0000000000000000000000000000000000000000000),
|
||||
(131, 'Redbellylarcener_86', 86, 172, 12885033261, 12885033311, 2, 4, 4, 0, 0, 0x0200013204010701224e06000000024e01020302003201320000, 0x0900d200090010000900670009004a000900a0000000000000000000000000000000000000000000),
|
||||
(132, 'Redbellysharpeye_87', 87, 83, 8590131801, 4295033530, 2, 4, 4, 0, 0, 0x0200013204030401282605000000022685010102003201320000, 0x0900d200090010000900670009004a000900a0000000000000000000000000000000000000000000),
|
||||
(133, 'lesserkalong_130', 130, 112, 0, 0, 1, 4, 4, 99, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(134, 'deepvoiddeathmouse_143', 143, 170, 0, 0, 1, 4, 4, 27, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(135, 'riveryarzon_159', 159, 226, 0, 0, 2, 4, 4, 76, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(136, 'bigmouthorobon_302', 302, 235, 0, 0, 1, 4, 4, 270, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(137, 'stroper_304', 304, 238, 0, 0, 2, 4, 4, 145, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(138, 'revenant_305', 305, 236, 0, 0, 2, 4, 4, 265, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(139, 'Coeurlclawcutter_311', 311, 169, 17182556361, 17180328037, 2, 4, 4, 0, 0, 0x040101320801060189241e000000032403040301003201320000, 0x130010000900260009007c0009004d000900b2000000000000000000000000000000000000000000),
|
||||
(140, 'nix_27', 27, 27, 0, 0, 2, 4, 4, 127, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(141, '5thCohorthoplomachus_55', 55, 1809, 17180065993, 12885295205, 2, 4, 4, 0, 0, 0x0100013201020401110505000000030580040101001900320000, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(142, '5thCohortlaquearius_61', 61, 1810, 12884967825, 0, 2, 4, 4, 0, 0, 0x0100013201010201aa9206000000029202000302003200320007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(143, '5thCohorteques_62', 62, 1811, 12885230069, 0, 2, 4, 4, 0, 0, 0x02000132030203013c9236000000019201050300003201320007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(144, '5thCohortsecutor_63', 63, 1812, 21475033389, 21475033439, 2, 4, 4, 0, 0, 0x0100013201010701984706000000024701020302003200320007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(145, '5thCohortsignifer_64', 64, 1813, 30064837609, 0, 2, 4, 4, 0, 0, 0x0100013201050301113b27000000043b850103000032004b0007, 0x0d009300220037000d004000070061000a009e000000000000000000000000000000000000000000),
|
||||
(146, 'mudpuppy_139', 139, 645, 0, 0, 2, 4, 4, 151, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(147, 'morbol_140', 140, 237, 0, 0, 2, 4, 4, 145, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(148, '5thCohortvanguard_201', 201, 1814, 0, 0, 2, 4, 4, 214, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(149, 'hippogryph_645', 645, 789, 0, 0, 2, 4, 4, 134, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(150, 'hapalit_647', 647, 793, 0, 0, 2, 4, 4, 188, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(151, 'gigasshramana_727', 727, 647, 4295040839, 0, 2, 10, 4, 13, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000070001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(152, 'gigasbonze_728', 728, 646, 4295106370, 0, 2, 10, 4, 13, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000070001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(153, 'gigassozu_729', 729, 648, 4295040844, 0, 2, 10, 4, 13, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000070001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(154, 'lakecobra_777', 777, 1851, 0, 0, 2, 4, 4, 235, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(155, 'LeechKing_3191', 3191, 2935, 0, 0, 1, 4, 0, 600, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(156, 'blackbat_1037', 1037, 38, 0, 0, 3, 4, 2, 98, 262144, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(157, 'caveaurelia_1038', 1038, 1210, 0, 0, 3, 4, 2, 279, 262144, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(158, 'foper_7439', 7439, 5674, 0, 0, 2, 4, 4, 1906, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(159, 'spinner_7442', 7442, 5677, 0, 0, 2, 4, 4, 1542, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(160, 'velociraptor_2', 2, 412, 0, 0, 2, 4, 4, 96, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(161, 'ringtail_6', 6, 407, 0, 0, 1, 4, 4, 32, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(162, 'highlandcondor_13', 13, 398, 0, 0, 2, 4, 4, 40, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(163, 'basaltgolem_30', 30, 365, 0, 0, 2, 4, 4, 81, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(164, 'pteroc_65', 65, 62, 0, 0, 1, 4, 4, 131, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(165, 'coeurl_117', 117, 106, 0, 0, 2, 4, 4, 65, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(166, 'syntheticdoblyn_189', 189, 1836, 0, 0, 2, 4, 4, 178, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(167, 'UGhamaroroundsman_755', 755, 1832, 17182490825, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000100010001000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(168, 'UGhamaroquarryman_756', 756, 1833, 8590000529, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000200010002000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(169, 'elitebedesman_757', 757, 2521, 30064837309, 0, 2, 8, 2, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000400010004000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(170, 'koboldpriest_758', 758, 371, 30065755013, 0, 2, 8, 4, 5, 0, 0x0000000000000000000000000000000000000000000000000000, 0x01000300010003000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(171, 'youngcoeurl_2269', 2269, 2192, 0, 0, 2, 4, 4, 65, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(172, 'bombincubator_2833', 2833, 2528, 0, 0, 1, 4, 2, 678, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(173, 'prototypebombincubator_2834', 2834, 2529, 0, 0, 1, 4, 2, 678, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(174, 'UGhamarogolem_2838', 2838, 2522, 0, 0, 2, 4, 4, 81, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(175, 'Vuokho_3189', 3189, 2933, 0, 0, 1, 4, 0, 39, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(176, 'strikingdummy_8016', 8016, 541, 0, 0, 1, 4, 0, 480, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(177, 'cocoon_6358', 6358, 6275, 0, 0, 1, 4, 0, 480, 262152, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(178, 'Shinryu_6531', 6531, 5640, 0, 0, 3, 4, 0, 1893, 262144, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(179, 'tail_6930', 6930, 5789, 0, 0, 3, 4, 0, 1926, 262187, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(180, 'cocoon_6931', 6931, 6275, 0, 0, 3, 4, 0, 2007, 262187, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(181, 'ginryu_6932', 6932, 6272, 0, 0, 3, 4, 0, 1891, 262187, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(182, '(仮)鎖_6933', 6933, 6279, 0, 0, 3, 4, 0, 2054, 262152, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(183, 'icicle_6934', 6934, 6278, 0, 0, 3, 4, 0, 764, 393224, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(184, 'eyeofthestorm_6935', 6935, 6277, 0, 0, 3, 4, 0, 1453, 262155, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(185, 'hakkinryu_7299', 7299, 6273, 0, 0, 3, 4, 0, 1985, 262187, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(186, 'massivecocoon_7302', 7302, 6276, 0, 0, 3, 4, 0, 2008, 262187, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(187, 'saitaisui_6358', 6358, 7206, 0, 0, 1, 4, 0, 480, 262152, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(188, 'Otengu_8662', 8662, 7200, 4295827266, 0, 3, 4, 0, 2187, 262144, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(189, 'tenguember_8663', 8663, 7201, 0, 0, 3, 4, 0, 2281, 262155, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(190, 'Daidarabotchi_8664', 8664, 7202, 0, 0, 3, 4, 0, 2217, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(191, 'QitianDasheng_8665', 8665, 7203, 0, 0, 3, 4, 0, 2211, 262144, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(192, 'shadowofthesage_8666', 8666, 7204, 0, 0, 3, 4, 0, 2211, 262187, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(193, 'saitaisui_8737', 8737, 7206, 4295302988, 0, 3, 4, 3, 2218, 8, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(194, 'geomantickiyofusa_8738', 8738, 7207, 4295434050, 0, 3, 4, 1, 1813, 262144, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(195, 'geomanticapa_8739', 8739, 7208, 0, 0, 3, 4, 3, 1867, 262147, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(196, 'torrent_8740', 8740, 7209, 0, 0, 3, 4, 3, 1202, 262147, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(197, 'geomanticdhara_8741', 8741, 7210, 0, 0, 3, 4, 3, 1819, 262144, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(198, 'geomanticanila_8742', 8742, 7211, 0, 0, 3, 4, 4, 1923, 262147, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(199, '_8743', 8743, 108, 0, 0, 1, 4, 0, 1453, 262152, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(200, 'riverunkiu_8744', 8744, 7212, 0, 0, 3, 4, 2, 1719, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(201, 'jinmenju_8745', 8745, 7213, 0, 0, 3, 4, 0, 1281, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(202, 'riverhikagiri_8746', 8746, 7214, 0, 0, 3, 4, 3, 572, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(203, 'riverray_8747', 8747, 7215, 0, 0, 3, 4, 0, 1346, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(204, 'riverscorpion_8748', 8748, 7216, 0, 0, 3, 4, 2, 1057, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(205, 'dragonhornbill_8749', 8749, 7217, 0, 0, 3, 4, 2, 1944, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(206, 'dragonbifang_8750', 8750, 7218, 0, 0, 3, 4, 2, 953, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(207, 'whitebaboon_8751', 8751, 7219, 0, 0, 3, 4, 2, 2270, 262144, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(208, 'dragonweasel_8752', 8752, 7220, 0, 0, 3, 4, 3, 1948, 0, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(209, 'servantofthesage_8754', 8754, 7205, 0, 0, 3, 4, 0, 2270, 262147, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000),
|
||||
(210, 'saitaisui_8780', 8780, 7206, 4295302988, 0, 1, 4, 0, 2218, 12, 0x0000000000000000000000000000000000000000000000000000, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000);
|
||||
|
||||
--
|
||||
-- Indizes der exportierten Tabellen
|
||||
--
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `bnpctemplate`
|
||||
--
|
||||
ALTER TABLE `bnpctemplate`
|
||||
ADD PRIMARY KEY (`Id`),
|
||||
ADD UNIQUE KEY `bNPCBaseId_2` (`bNPCBaseId`,`bNPCNameId`),
|
||||
ADD KEY `Name` (`Name`),
|
||||
ADD KEY `bNPCBaseId` (`bNPCBaseId`),
|
||||
ADD KEY `bNPCNameId` (`bNPCNameId`);
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für exportierte Tabellen
|
||||
--
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `bnpctemplate`
|
||||
--
|
||||
ALTER TABLE `bnpctemplate`
|
||||
MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=211;
|
|
@ -17,7 +17,7 @@ CREATE TABLE IF NOT EXISTS `characlass` (
|
|||
`ClassIdx` int(3) DEFAULT '0',
|
||||
`Exp` int(10) DEFAULT '0',
|
||||
`Lvl` int(5) DEFAULT '0',
|
||||
PRIMARY KEY (`CharacterId`)
|
||||
INDEX `CharacterId` (`CharacterId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
-- Dumping data for table sapphire.characlass: 0 rows
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
-- MySQL dump 10.13 Distrib 5.7.13, for Win64 (x86_64)
|
||||
--
|
||||
-- Host: localhost Database: sapphire
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 5.7.13-log
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `charaitemcrystal`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `charaitemcrystal`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `charaitemcrystal` (
|
||||
`CharacterId` int(20) DEFAULT '0',
|
||||
`storageId` int(10) DEFAULT '2001',
|
||||
`type` int(5) DEFAULT '0',
|
||||
`idx` int(5) NOT NULL AUTO_INCREMENT,
|
||||
`container_0` int(20) DEFAULT '0',
|
||||
`container_1` int(20) DEFAULT '0',
|
||||
`container_2` int(20) DEFAULT '0',
|
||||
`container_3` int(20) DEFAULT '0',
|
||||
`container_4` int(20) DEFAULT '0',
|
||||
`container_5` int(20) DEFAULT '0',
|
||||
`container_6` int(20) DEFAULT '0',
|
||||
`container_7` int(20) DEFAULT '0',
|
||||
`container_8` int(20) DEFAULT '0',
|
||||
`container_9` int(20) DEFAULT '0',
|
||||
`container_10` int(20) DEFAULT '0',
|
||||
`container_11` int(20) DEFAULT '0',
|
||||
`container_12` int(20) DEFAULT '0',
|
||||
`container_13` int(20) DEFAULT '0',
|
||||
`container_14` int(20) DEFAULT '0',
|
||||
`container_15` int(20) DEFAULT '0',
|
||||
`container_16` int(20) DEFAULT '0',
|
||||
`container_17` int(20) DEFAULT '0',
|
||||
`IS_DELETE` int(3) DEFAULT '0',
|
||||
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
|
||||
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`idx`),
|
||||
KEY `CharacterId` (`CharacterId`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `charaitemcrystal`
|
||||
--
|
||||
|
||||
LOCK TABLES `charaitemcrystal` WRITE;
|
||||
/*!40000 ALTER TABLE `charaitemcrystal` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `charaitemcrystal` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2016-12-09 17:37:10
|
|
@ -1,68 +0,0 @@
|
|||
-- MySQL dump 10.13 Distrib 5.7.13, for Win64 (x86_64)
|
||||
--
|
||||
-- Host: localhost Database: sapphire
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 5.7.13-log
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `charaitemcurrency`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `charaitemcurrency`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `charaitemcurrency` (
|
||||
`CharacterId` int(20) NOT NULL,
|
||||
`storageId` int(10) DEFAULT '2000',
|
||||
`type` int(5) DEFAULT '0',
|
||||
`idx` int(5) NOT NULL AUTO_INCREMENT,
|
||||
`container_0` int(20) DEFAULT '0',
|
||||
`container_1` int(20) DEFAULT '0',
|
||||
`container_2` int(20) DEFAULT '0',
|
||||
`container_3` int(20) DEFAULT '0',
|
||||
`container_4` int(20) DEFAULT '0',
|
||||
`container_5` int(20) DEFAULT '0',
|
||||
`container_6` int(20) DEFAULT '0',
|
||||
`container_7` int(20) DEFAULT '0',
|
||||
`container_8` int(20) NOT NULL DEFAULT '0',
|
||||
`container_9` int(20) NOT NULL DEFAULT '0',
|
||||
`container_10` int(20) NOT NULL DEFAULT '0',
|
||||
`container_11` int(20) NOT NULL DEFAULT '0',
|
||||
`IS_DELETE` int(3) DEFAULT '0',
|
||||
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
|
||||
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `CharacterId` (`CharacterId`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `charaitemcurrency`
|
||||
--
|
||||
|
||||
LOCK TABLES `charaitemcurrency` WRITE;
|
||||
/*!40000 ALTER TABLE `charaitemcurrency` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `charaitemcurrency` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2016-12-09 17:37:11
|
File diff suppressed because it is too large
Load diff
|
@ -49,3 +49,5 @@ ALTER TABLE `charainfo` CHANGE `Minions` `Minions` BINARY(37) NULL DEFAULT NULL;
|
|||
ALTER TABLE `charainfo` CHANGE `QuestCompleteFlags` `QuestCompleteFlags` VARBINARY(396) NULL DEFAULT NULL;
|
||||
ALTER TABLE `charainfo` ADD COLUMN `EquipDisplayFlags` INT(3) NULL DEFAULT '0' AFTER `GMRank`;
|
||||
ALTER TABLE `charainfo` ADD COLUMN `Pose` INT(3) NULL DEFAULT '0' AFTER `EquipDisplayFlags`;
|
||||
|
||||
ALTER TABLE `characlass` DROP PRIMARY KEY, ADD INDEX `CharacterId` (`CharacterId`);
|
|
@ -14,38 +14,94 @@
|
|||
namespace Core {
|
||||
namespace Common {
|
||||
|
||||
// 99 is the last spawn id that seems to spawn any actor
|
||||
const uint8_t MAX_DISPLAYED_ACTORS = 99;
|
||||
const uint8_t MAX_DISPLAYED_EOBJS = 40;
|
||||
// 99 is the last spawn id that seems to spawn any actor
|
||||
const uint8_t MAX_DISPLAYED_ACTORS = 99;
|
||||
const uint8_t MAX_DISPLAYED_EOBJS = 40;
|
||||
|
||||
const int32_t INVALID_GAME_OBJECT_ID = 0xE0000000;
|
||||
const int32_t INVALID_GAME_OBJECT_ID = 0xE0000000;
|
||||
|
||||
struct FFXIVARR_POSITION3
|
||||
{
|
||||
struct FFXIVARR_POSITION3
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
};
|
||||
|
||||
enum InventoryOperation : uint8_t
|
||||
{
|
||||
enum InventoryOperation :
|
||||
uint8_t
|
||||
{
|
||||
Discard = 0x07,
|
||||
Move = 0x08,
|
||||
Swap = 0x09,
|
||||
Merge = 0x0C,
|
||||
Split = 0x0A
|
||||
};
|
||||
};
|
||||
|
||||
enum ClientLanguage : uint8_t
|
||||
{
|
||||
enum ClientLanguage :
|
||||
uint8_t
|
||||
{
|
||||
Japanese = 1,
|
||||
English = 2,
|
||||
German = 4,
|
||||
French = 8
|
||||
};
|
||||
};
|
||||
|
||||
enum EquipSlot : uint8_t
|
||||
{
|
||||
enum ObjKind :
|
||||
uint8_t
|
||||
{
|
||||
None = 0x00,
|
||||
Player = 0x01,
|
||||
BattleNpc = 0x02,
|
||||
EventNpc = 0x03,
|
||||
Treasure = 0x04,
|
||||
Aetheryte = 0x05,
|
||||
GatheringPoint = 0x06,
|
||||
EventObj = 0x07,
|
||||
MountType = 0x08,
|
||||
Companion = 0x09, // this probably actually means minion
|
||||
Retainer = 0x0A,
|
||||
Area = 0x0B,
|
||||
Housing = 0x0C,
|
||||
Cutscene = 0x0D,
|
||||
CardStand = 0x0E,
|
||||
};
|
||||
|
||||
enum Stance :
|
||||
uint8_t
|
||||
{
|
||||
Passive = 0,
|
||||
Active = 1,
|
||||
};
|
||||
|
||||
enum class DisplayFlags :
|
||||
uint16_t
|
||||
{
|
||||
ActiveStance = 0x001,
|
||||
Invisible = 0x020,
|
||||
HideHead = 0x040,
|
||||
HideWeapon = 0x080,
|
||||
Faded = 0x100,
|
||||
Visor = 0x800,
|
||||
};
|
||||
|
||||
enum struct ActorStatus :
|
||||
uint8_t
|
||||
{
|
||||
Idle = 0x01,
|
||||
Dead = 0x02,
|
||||
Sitting = 0x03,
|
||||
Mounted = 0x04,
|
||||
Crafting = 0x05,
|
||||
Gathering = 0x06,
|
||||
Melding = 0x07,
|
||||
SMachine = 0x08,
|
||||
Carry = 0x09,
|
||||
EmoteMode = 0x0B
|
||||
};
|
||||
|
||||
enum GearSetSlot :
|
||||
uint8_t
|
||||
{
|
||||
MainHand = 0,
|
||||
OffHand = 1,
|
||||
Head = 2,
|
||||
|
@ -54,16 +110,72 @@ namespace Common {
|
|||
Waist = 5,
|
||||
Legs = 6,
|
||||
Feet = 7,
|
||||
Neck = 8,
|
||||
Ear = 9,
|
||||
Ear = 8,
|
||||
Neck = 9,
|
||||
Wrist = 10,
|
||||
Ring1 = 11,
|
||||
Ring2 = 12,
|
||||
SoulCrystal = 13,
|
||||
};
|
||||
};
|
||||
|
||||
enum InventoryType : uint16_t
|
||||
{
|
||||
enum GearModelSlot : int8_t
|
||||
{
|
||||
ModelInvalid = -1,
|
||||
ModelHead = 0,
|
||||
ModelBody = 1,
|
||||
ModelHands = 2,
|
||||
ModelLegs = 3,
|
||||
ModelFeet = 4,
|
||||
ModelEar = 5,
|
||||
ModelNeck = 6,
|
||||
ModelWrist = 7,
|
||||
ModelRing1 = 8,
|
||||
ModelRing2 = 9
|
||||
};
|
||||
|
||||
enum EquipSlotCategory : uint8_t
|
||||
{
|
||||
Unequippable = 0,
|
||||
|
||||
// main slots
|
||||
|
||||
CharaMainHand = 1,
|
||||
CharaOffHand = 2,
|
||||
CharaHead = 3,
|
||||
CharaBody = 4,
|
||||
CharaHands = 5,
|
||||
CharaWaist = 6,
|
||||
CharaLegs = 7,
|
||||
CharaFeet = 8,
|
||||
CharaEars = 9,
|
||||
CharaNeck = 10,
|
||||
CharaWrist = 11,
|
||||
CharaRing = 12,
|
||||
CharaSoulCrystal = 17,
|
||||
|
||||
// specials
|
||||
|
||||
/*! Cannot equip gear to offhand slot */
|
||||
MainTwoHandedWeapon = 13,
|
||||
/*! Can be equipped in either main or offhand slot */
|
||||
MainOrOffHand = 14, // unused
|
||||
/*! Cannot equip gear to head */
|
||||
BodyDisallowHead = 15,
|
||||
/*! Cannot equip gear to hands, legs and feet slots */
|
||||
BodyDisallowHandsLegsFeet = 16,
|
||||
/*! Cannot equip gear to feet slot */
|
||||
LegsDisallowFeet = 18,
|
||||
/*! Cannot equp gear to head, hands, legs, feet slots */
|
||||
BodyDisallowAll = 19,
|
||||
/*! Cannot equip gear to hands slot */
|
||||
BodyDisallowHands = 20,
|
||||
/*! Cannot equip gear to legs & feet slots */
|
||||
BodyDisallowLegsFeet = 21,
|
||||
};
|
||||
|
||||
enum InventoryType :
|
||||
uint16_t
|
||||
{
|
||||
Bag0 = 0,
|
||||
Bag1 = 1,
|
||||
Bag2 = 2,
|
||||
|
@ -87,7 +199,7 @@ namespace Common {
|
|||
ArmoryWaist = 3204,
|
||||
ArmoryLegs = 3205,
|
||||
ArmoryFeet = 3206,
|
||||
ArmotyNeck = 3207,
|
||||
ArmoryNeck = 3207,
|
||||
ArmoryEar = 3208,
|
||||
ArmoryWrist = 3209,
|
||||
ArmoryRing = 3300,
|
||||
|
@ -112,35 +224,92 @@ namespace Common {
|
|||
FreeCompanyBag2 = 20002,
|
||||
FreeCompanyGil = 22000,
|
||||
FreeCompanyCrystal = 22001
|
||||
};
|
||||
};
|
||||
|
||||
enum ContainerType :
|
||||
uint16_t
|
||||
{
|
||||
Unknown = 0,
|
||||
Bag = 1,
|
||||
GearSet = 2,
|
||||
CurrencyCrystal = 3,
|
||||
Armory = 4
|
||||
};
|
||||
|
||||
|
||||
enum struct ZoneingType : uint8_t
|
||||
{
|
||||
enum CurrencyType :
|
||||
uint8_t
|
||||
{
|
||||
Gil = 0x01,
|
||||
StormSeal = 0x02,
|
||||
SerpentSeal = 0x03,
|
||||
FlameSeal = 0x04,
|
||||
TomestonePhilo = 0x05,
|
||||
TomestoneMytho = 0x06,
|
||||
WolfMark = 0x07,
|
||||
TomestoneSold = 0x08,
|
||||
AlliedSeal = 0x09,
|
||||
TomestonePoet = 0x0A,
|
||||
Mgp = 0x0B,
|
||||
TomestoneLaw = 0x0C,
|
||||
TomestoneEso = 0x0D,
|
||||
TomestoneLore = 0x0E
|
||||
};
|
||||
|
||||
enum CrystalType :
|
||||
uint8_t
|
||||
{
|
||||
FireShard = 0x01,
|
||||
IceShard = 0x02,
|
||||
WindShard = 0x03,
|
||||
EarthShard = 0x04,
|
||||
LightningShard = 0x05,
|
||||
WaterShard = 0x06,
|
||||
|
||||
FireCrystal = 0x07,
|
||||
IceCrystal = 0x08,
|
||||
WindCrystal = 0x09,
|
||||
EarthCrystal = 0x0A,
|
||||
LightningCrystal = 0x0B,
|
||||
WaterCrystal = 0x0C,
|
||||
|
||||
FireCluster = 0x0D,
|
||||
IceCluster = 0x0E,
|
||||
WindCluster = 0x0F,
|
||||
EarthCluster = 0x10,
|
||||
LightningCluster = 0x11,
|
||||
WaterCluster = 0x12
|
||||
};
|
||||
|
||||
enum struct ZoneingType :
|
||||
uint8_t
|
||||
{
|
||||
None = 1,
|
||||
Teleport = 2,
|
||||
Return = 3,
|
||||
ReturnDead = 4,
|
||||
FadeIn = 5,
|
||||
};
|
||||
};
|
||||
|
||||
enum struct ResurrectType : uint8_t
|
||||
{
|
||||
enum struct ResurrectType :
|
||||
uint8_t
|
||||
{
|
||||
None = 0,
|
||||
RaiseSpell = 5,
|
||||
Return = 8
|
||||
};
|
||||
};
|
||||
|
||||
enum Gender : uint8_t
|
||||
{
|
||||
enum Gender :
|
||||
uint8_t
|
||||
{
|
||||
Male = 0,
|
||||
Female = 1,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
enum struct GCRank : uint8_t
|
||||
{
|
||||
enum struct GCRank :
|
||||
uint8_t
|
||||
{
|
||||
None = 0,
|
||||
PrivateThirdClass = 1,
|
||||
PrivateSecondClass = 2,
|
||||
|
@ -161,22 +330,23 @@ namespace Common {
|
|||
Marshal = 17,
|
||||
GrandMarshal = 18,
|
||||
Champion = 19,
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Structural representation of the packet sent by the server
|
||||
* Send the entire StatusEffect list
|
||||
*/
|
||||
struct StatusEffect
|
||||
{
|
||||
/**
|
||||
* Structural representation of the packet sent by the server
|
||||
* Send the entire StatusEffect list
|
||||
*/
|
||||
struct StatusEffect
|
||||
{
|
||||
uint16_t effect_id;
|
||||
uint16_t unknown1;
|
||||
float duration;
|
||||
uint32_t sourceActorId;
|
||||
};
|
||||
};
|
||||
|
||||
enum CharaLook : uint8_t
|
||||
{
|
||||
enum CharaLook :
|
||||
uint8_t
|
||||
{
|
||||
Race = 0x00,
|
||||
Gender = 0x01,
|
||||
Tribe = 0x04,
|
||||
|
@ -204,26 +374,28 @@ namespace Common {
|
|||
Facepaint = 0x18,
|
||||
FacepaintColor = 0x19,
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
enum MoveType : uint8_t
|
||||
{
|
||||
enum MoveType :
|
||||
uint8_t
|
||||
{
|
||||
Running = 0x00,
|
||||
Walking = 0x02,
|
||||
Strafing = 0x04,
|
||||
Jumping = 0x10,
|
||||
BackWalk = 0x06,
|
||||
};
|
||||
};
|
||||
|
||||
enum MoveState : uint8_t
|
||||
{
|
||||
None = 0x00,
|
||||
enum MoveState :
|
||||
uint8_t
|
||||
{
|
||||
No = 0x00,
|
||||
Land = 0x02,
|
||||
Fall = 0x04,
|
||||
};
|
||||
};
|
||||
|
||||
struct QuestActive
|
||||
{
|
||||
struct QuestActive
|
||||
{
|
||||
QuestActive()
|
||||
{
|
||||
c.questId = 0;
|
||||
|
@ -313,10 +485,11 @@ namespace Common {
|
|||
};
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
enum struct ActionAspect : uint8_t
|
||||
{
|
||||
enum struct ActionAspect :
|
||||
uint8_t
|
||||
{
|
||||
None = 0, // Doesn't imply unaspected
|
||||
Fire = 1,
|
||||
Ice = 2,
|
||||
|
@ -325,10 +498,11 @@ namespace Common {
|
|||
Lightning = 5,
|
||||
Water = 6,
|
||||
Unaspected = 7 // Doesn't imply magical unaspected damage - could be unaspected physical
|
||||
};
|
||||
};
|
||||
|
||||
enum class ActionType : int8_t
|
||||
{
|
||||
enum class ActionType :
|
||||
int8_t
|
||||
{
|
||||
WeaponOverride = -1, // Needs more investigation (takes the damage type of the equipped weapon)?
|
||||
Unknown_0 = 0,
|
||||
Slashing = 1,
|
||||
|
@ -339,10 +513,11 @@ namespace Common {
|
|||
Darkness = 6,
|
||||
Unknown_7 = 7,
|
||||
LimitBreak = 8,
|
||||
};
|
||||
};
|
||||
|
||||
enum ActionEffectType : uint8_t
|
||||
{
|
||||
enum ActionEffectType :
|
||||
uint8_t
|
||||
{
|
||||
Nothing = 0,
|
||||
Miss = 1,
|
||||
FullResist = 2,
|
||||
|
@ -358,21 +533,32 @@ namespace Common {
|
|||
TpLoss = 12,
|
||||
TpGain = 13,
|
||||
GpGain = 14,
|
||||
Knockback = 33,
|
||||
Mount = 38
|
||||
};
|
||||
};
|
||||
|
||||
enum class ActionHitSeverityType : uint8_t
|
||||
{
|
||||
enum class ActionHitSeverityType :
|
||||
uint8_t
|
||||
{
|
||||
NormalDamage = 0,
|
||||
CritHeal = 0,
|
||||
CritDamage = 1,
|
||||
NormalHeal = 1,
|
||||
DirectHitDamage = 2,
|
||||
CritDirectHitDamage = 3
|
||||
};
|
||||
};
|
||||
|
||||
enum class ActionCollisionType : uint8_t
|
||||
{
|
||||
enum ActionEffectDisplayType :
|
||||
uint8_t
|
||||
{
|
||||
HideActionName = 0,
|
||||
ShowActionName = 1,
|
||||
ShowItemName = 2,
|
||||
};
|
||||
|
||||
enum class ActionCollisionType :
|
||||
uint8_t
|
||||
{
|
||||
None,
|
||||
SingleTarget,
|
||||
Circle,
|
||||
|
@ -382,31 +568,35 @@ namespace Common {
|
|||
Unknown2,
|
||||
PersistentArea, // for when you set aoe like asylum
|
||||
Unknown3
|
||||
};
|
||||
};
|
||||
|
||||
enum HandleActionType : uint8_t
|
||||
{
|
||||
enum HandleActionType :
|
||||
uint8_t
|
||||
{
|
||||
Event,
|
||||
Spell,
|
||||
Teleport
|
||||
};
|
||||
};
|
||||
|
||||
enum HandleSkillType : uint8_t
|
||||
{
|
||||
enum HandleSkillType :
|
||||
uint8_t
|
||||
{
|
||||
StdDamage,
|
||||
StdHeal,
|
||||
StdDot,
|
||||
};
|
||||
};
|
||||
|
||||
enum InvincibilityType : uint8_t
|
||||
{
|
||||
enum InvincibilityType :
|
||||
uint8_t
|
||||
{
|
||||
InvincibilityNone,
|
||||
InvincibilityRefill,
|
||||
InvincibilityStayAlive,
|
||||
};
|
||||
};
|
||||
|
||||
enum PlayerStateFlag : uint8_t
|
||||
{
|
||||
enum PlayerStateFlag :
|
||||
uint8_t
|
||||
{
|
||||
HideUILockChar = 0, // as the name suggests, hides the ui and logs the char...
|
||||
InCombat = 1, // in Combat, locks gearchange/return/teleport
|
||||
Casting = 2,
|
||||
|
@ -419,18 +609,20 @@ namespace Common {
|
|||
WatchingCutscene = 50, // this is actually just a dummy, this id is different
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
enum struct FateStatus : uint8_t
|
||||
{
|
||||
enum struct FateStatus :
|
||||
uint8_t
|
||||
{
|
||||
Active = 2,
|
||||
Inactive = 4,
|
||||
Preparing = 7,
|
||||
Completed = 8,
|
||||
};
|
||||
};
|
||||
|
||||
enum struct ChatType : uint16_t
|
||||
{
|
||||
enum struct ChatType :
|
||||
uint16_t
|
||||
{
|
||||
LogKindError,
|
||||
ServerDebug,
|
||||
ServerUrgent,
|
||||
|
@ -532,25 +724,30 @@ namespace Common {
|
|||
Unused98,
|
||||
Unused99,
|
||||
Unused100
|
||||
};
|
||||
};
|
||||
|
||||
enum EquipDisplayFlags : uint8_t
|
||||
{
|
||||
enum EquipDisplayFlags :
|
||||
uint8_t
|
||||
{
|
||||
HideNothing = 0x0,
|
||||
HideHead = 0x1,
|
||||
HideWeapon = 0x2,
|
||||
HideLegacyMark = 0x4,
|
||||
|
||||
Visor = 0x40,
|
||||
};
|
||||
StoreNewItemsInArmouryChest = 0x10,
|
||||
StoreCraftedItemsInInventory = 0x20,
|
||||
|
||||
enum SkillType : uint8_t
|
||||
{
|
||||
Visor = 0x40,
|
||||
};
|
||||
|
||||
enum SkillType :
|
||||
uint8_t
|
||||
{
|
||||
Normal = 0x1,
|
||||
MountSkill = 0xD,
|
||||
};
|
||||
};
|
||||
|
||||
typedef std::vector< PlayerStateFlag > PlayerStateFlagList;
|
||||
typedef std::vector< PlayerStateFlag > PlayerStateFlagList;
|
||||
|
||||
} /* Common */
|
||||
} /* Core */
|
||||
|
|
|
@ -5,37 +5,164 @@
|
|||
namespace Core {
|
||||
namespace Common {
|
||||
|
||||
bool operator==( const ActionCategory& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const ActionCategory& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const BeastReputationRank& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const BeastReputationRank& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const BeastTribe& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const BeastTribe& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const ClassJob& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const ClassJob& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const ContentType& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const ContentType& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const EmoteCategory& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const EmoteCategory& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const ExVersion& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const ExVersion& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const GrandCompany& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const GrandCompany& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const GuardianDeity& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const GuardianDeity& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const ItemUICategory& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const ItemUICategory& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const ItemSearchCategory& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const ItemSearchCategory& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const OnlineStatus& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const OnlineStatus& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const Race& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const Race& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const Tribe& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const Tribe& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const Town& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const Town& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const Weather& t, const uint8_t& g ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const uint8_t& g, const Weather& t ) { return static_cast< uint8_t >( t ) == g; }
|
||||
bool operator==( const ActionCategory& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const ActionCategory& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const BeastReputationRank& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const BeastReputationRank& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const BeastTribe& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const BeastTribe& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const ClassJob& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const ClassJob& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const ContentType& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const ContentType& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const EmoteCategory& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const EmoteCategory& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const ExVersion& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const ExVersion& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const GrandCompany& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const GrandCompany& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const GuardianDeity& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const GuardianDeity& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const ItemUICategory& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const ItemUICategory& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const ItemSearchCategory& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const ItemSearchCategory& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const OnlineStatus& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const OnlineStatus& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const Race& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const Race& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const Tribe& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const Tribe& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const Town& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const Town& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const Weather& t, const uint8_t& g )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
|
||||
bool operator==( const uint8_t& g, const Weather& t )
|
||||
{
|
||||
return static_cast< uint8_t >( t ) == g;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,10 +9,11 @@
|
|||
namespace Core {
|
||||
namespace Common {
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//ActionCategory.exd
|
||||
enum class ActionCategory : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//ActionCategory.exd
|
||||
enum class ActionCategory :
|
||||
uint8_t
|
||||
{
|
||||
Autoattack = 1,
|
||||
Spell = 2,
|
||||
Weaponskill = 3,
|
||||
|
@ -28,12 +29,13 @@ namespace Common {
|
|||
Glamour = 13,
|
||||
ItemManipulation = 14,
|
||||
AdrenalineRush = 15,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//BeastReputationRank.exd
|
||||
enum class BeastReputationRank : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//BeastReputationRank.exd
|
||||
enum class BeastReputationRank :
|
||||
uint8_t
|
||||
{
|
||||
None = 0,
|
||||
Neutral = 1,
|
||||
Recognized = 2,
|
||||
|
@ -43,18 +45,20 @@ namespace Common {
|
|||
Honored = 6,
|
||||
Sworn = 7,
|
||||
Allied = 8,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//BeastTribe.exd
|
||||
enum class BeastTribe : uint8_t
|
||||
{
|
||||
};
|
||||
///////////////////////////////////////////////////////////
|
||||
//BeastTribe.exd
|
||||
enum class BeastTribe :
|
||||
uint8_t
|
||||
{
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//ClassJob.exd
|
||||
enum class ClassJob : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//ClassJob.exd
|
||||
enum class ClassJob :
|
||||
uint8_t
|
||||
{
|
||||
Adventurer = 0,
|
||||
Gladiator = 1,
|
||||
Pugilist = 2,
|
||||
|
@ -91,12 +95,13 @@ namespace Common {
|
|||
Astrologian = 33,
|
||||
Samurai = 34,
|
||||
Redmage = 35,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//ContentType.exd
|
||||
enum class ContentType : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//ContentType.exd
|
||||
enum class ContentType :
|
||||
uint8_t
|
||||
{
|
||||
DutyRoulette = 1,
|
||||
Dungeons = 2,
|
||||
Guildhests = 3,
|
||||
|
@ -119,40 +124,44 @@ namespace Common {
|
|||
DeepDungeons = 21,
|
||||
WondrousTails = 24,
|
||||
CustomDeliveries = 25,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//EmoteCategory.exd
|
||||
enum class EmoteCategory : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//EmoteCategory.exd
|
||||
enum class EmoteCategory :
|
||||
uint8_t
|
||||
{
|
||||
General = 1,
|
||||
Persistent = 2,
|
||||
Expressions = 3,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//ExVersion.exd
|
||||
enum class ExVersion : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//ExVersion.exd
|
||||
enum class ExVersion :
|
||||
uint8_t
|
||||
{
|
||||
ARealmReborn = 0,
|
||||
Heavensward = 1,
|
||||
Stormblood = 2,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//GrandCompany.exd
|
||||
enum class GrandCompany : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//GrandCompany.exd
|
||||
enum class GrandCompany :
|
||||
uint8_t
|
||||
{
|
||||
None = 0,
|
||||
Maelstrom = 1,
|
||||
OrderoftheTwinAdder = 2,
|
||||
ImmortalFlames = 3,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//GuardianDeity.exd
|
||||
enum class GuardianDeity : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//GuardianDeity.exd
|
||||
enum class GuardianDeity :
|
||||
uint8_t
|
||||
{
|
||||
HalonetheFury = 1,
|
||||
MenphinatheLover = 2,
|
||||
ThaliaktheScholar = 3,
|
||||
|
@ -165,12 +174,13 @@ namespace Common {
|
|||
NaldthaltheTraders = 10,
|
||||
NophicatheMatron = 11,
|
||||
AlthyktheKeeper = 12,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//ItemUICategory.exd
|
||||
enum class ItemUICategory : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//ItemUICategory.exd
|
||||
enum class ItemUICategory :
|
||||
uint8_t
|
||||
{
|
||||
PugilistsArm = 1,
|
||||
GladiatorsArm = 2,
|
||||
MaraudersArm = 3,
|
||||
|
@ -271,12 +281,13 @@ namespace Common {
|
|||
ScholarsArm = 98,
|
||||
FishersSecondaryTool = 99,
|
||||
Currency = 100,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//ItemSearchCategory.exd
|
||||
enum class ItemSearchCategory : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//ItemSearchCategory.exd
|
||||
enum class ItemSearchCategory :
|
||||
uint8_t
|
||||
{
|
||||
PrimaryArms = 1,
|
||||
PrimaryTools = 2,
|
||||
PrimaryTools1 = 3,
|
||||
|
@ -362,12 +373,13 @@ namespace Common {
|
|||
SamuraisArms = 83,
|
||||
RedMagesArms = 84,
|
||||
ScholarsArms = 85,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//OnlineStatus.exd
|
||||
enum class OnlineStatus : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//OnlineStatus.exd
|
||||
enum class OnlineStatus :
|
||||
uint8_t
|
||||
{
|
||||
Producer = 1,
|
||||
GameMaster = 2,
|
||||
GameMaster1 = 3,
|
||||
|
@ -415,24 +427,26 @@ namespace Common {
|
|||
FreeCompany = 45,
|
||||
GrandCompany = 46,
|
||||
Online = 47,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//Race.exd
|
||||
enum class Race : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//Race.exd
|
||||
enum class Race :
|
||||
uint8_t
|
||||
{
|
||||
Hyur = 1,
|
||||
Elezen = 2,
|
||||
Lalafell = 3,
|
||||
Miqote = 4,
|
||||
Roegadyn = 5,
|
||||
AuRa = 6,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//Tribe.exd
|
||||
enum class Tribe : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//Tribe.exd
|
||||
enum class Tribe :
|
||||
uint8_t
|
||||
{
|
||||
Midlander = 1,
|
||||
Highlander = 2,
|
||||
Wildwood = 3,
|
||||
|
@ -445,24 +459,26 @@ namespace Common {
|
|||
Hellsguard = 10,
|
||||
Raen = 11,
|
||||
Xaela = 12,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//Town.exd
|
||||
enum class Town : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//Town.exd
|
||||
enum class Town :
|
||||
uint8_t
|
||||
{
|
||||
Nowheresville = 0,
|
||||
LimsaLominsa = 1,
|
||||
Gridania = 2,
|
||||
Uldah = 3,
|
||||
Ishgard = 4,
|
||||
Kugane = 7,
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//Weather.exd
|
||||
enum class Weather : uint8_t
|
||||
{
|
||||
///////////////////////////////////////////////////////////
|
||||
//Weather.exd
|
||||
enum class Weather :
|
||||
uint8_t
|
||||
{
|
||||
None = 0,
|
||||
ClearSkies = 1,
|
||||
FairSkies = 2,
|
||||
|
@ -554,7 +570,7 @@ namespace Common {
|
|||
Thunder3 = 88,
|
||||
DimensionalDisruption3 = 89,
|
||||
FairSkies9 = 90,
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
|
||||
namespace Core
|
||||
namespace Core {
|
||||
class ConfigMgr
|
||||
{
|
||||
class ConfigMgr
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ConfigMgr() = default;
|
||||
|
||||
~ConfigMgr() = default;
|
||||
|
||||
bool loadConfig( const std::string& configName );
|
||||
|
@ -32,14 +32,14 @@ namespace Core
|
|||
m_propTree.put( name, defaultValue );
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
bool copyDefaultConfig( const std::string& configName );
|
||||
|
||||
boost::property_tree::ptree m_propTree;
|
||||
const std::string m_globalConfigFile = "global.ini";
|
||||
const std::string m_configFolderRoot = "./config/";
|
||||
const std::string m_configDefaultSuffix = ".default";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
#endif //SAPPHIRE_CONFIGMGR_H
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
base64.cpp and base64.h
|
||||
|
||||
Copyright (C) 2004-2008 René Nyffenegger
|
||||
Copyright (C) 2004-2008 Ren<EFBFBD> Nyffenegger
|
||||
|
||||
This source code is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author be held liable for any damages
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
|
||||
Ren<EFBFBD> Nyffenegger rene.nyffenegger@adp-gmbh.ch
|
||||
|
||||
*/
|
||||
|
||||
|
@ -29,32 +29,36 @@
|
|||
#include <iostream>
|
||||
|
||||
static const std::string base64_chars =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789+/";
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789+/";
|
||||
|
||||
|
||||
static inline bool is_base64( uint8_t c ) {
|
||||
static inline bool is_base64( uint8_t c )
|
||||
{
|
||||
return ( isalnum( c ) || ( c == '+' ) || ( c == '/' ) );
|
||||
}
|
||||
|
||||
std::string Core::Util::base64_encode( uint8_t const* bytes_to_encode, uint32_t in_len ) {
|
||||
std::string Core::Util::base64_encode( uint8_t const* bytes_to_encode, uint32_t in_len )
|
||||
{
|
||||
std::string ret;
|
||||
int32_t i = 0;
|
||||
int32_t j = 0;
|
||||
uint8_t char_array_3[3];
|
||||
uint8_t char_array_4[4];
|
||||
|
||||
while( in_len-- ) {
|
||||
char_array_3[i++] = *( bytes_to_encode++ );
|
||||
if( i == 3 ) {
|
||||
char_array_4[0] = ( char_array_3[0] & 0xfc ) >> 2;
|
||||
char_array_4[1] = ( ( char_array_3[0] & 0x03 ) << 4 ) + ( ( char_array_3[1] & 0xf0 ) >> 4 );
|
||||
char_array_4[2] = ( ( char_array_3[1] & 0x0f ) << 2 ) + ( ( char_array_3[2] & 0xc0 ) >> 6 );
|
||||
char_array_4[3] = char_array_3[2] & 0x3f;
|
||||
while( in_len-- )
|
||||
{
|
||||
char_array_3[ i++ ] = *( bytes_to_encode++ );
|
||||
if( i == 3 )
|
||||
{
|
||||
char_array_4[ 0 ] = ( char_array_3[ 0 ] & 0xfc ) >> 2;
|
||||
char_array_4[ 1 ] = ( ( char_array_3[ 0 ] & 0x03 ) << 4 ) + ( ( char_array_3[ 1 ] & 0xf0 ) >> 4 );
|
||||
char_array_4[ 2 ] = ( ( char_array_3[ 1 ] & 0x0f ) << 2 ) + ( ( char_array_3[ 2 ] & 0xc0 ) >> 6 );
|
||||
char_array_4[ 3 ] = char_array_3[ 2 ] & 0x3f;
|
||||
|
||||
for( i = 0; ( i < 4 ); i++ )
|
||||
ret += base64_chars[char_array_4[i]];
|
||||
ret += base64_chars[ char_array_4[ i ] ];
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
@ -62,15 +66,15 @@ std::string Core::Util::base64_encode( uint8_t const* bytes_to_encode, uint32_t
|
|||
if( i )
|
||||
{
|
||||
for( j = i; j < 3; j++ )
|
||||
char_array_3[j] = '\0';
|
||||
char_array_3[ j ] = '\0';
|
||||
|
||||
char_array_4[0] = ( char_array_3[0] & 0xfc ) >> 2;
|
||||
char_array_4[1] = ( ( char_array_3[0] & 0x03 ) << 4 ) + ( ( char_array_3[1] & 0xf0 ) >> 4 );
|
||||
char_array_4[2] = ( ( char_array_3[1] & 0x0f ) << 2 ) + ( ( char_array_3[2] & 0xc0 ) >> 6 );
|
||||
char_array_4[3] = char_array_3[2] & 0x3f;
|
||||
char_array_4[ 0 ] = ( char_array_3[ 0 ] & 0xfc ) >> 2;
|
||||
char_array_4[ 1 ] = ( ( char_array_3[ 0 ] & 0x03 ) << 4 ) + ( ( char_array_3[ 1 ] & 0xf0 ) >> 4 );
|
||||
char_array_4[ 2 ] = ( ( char_array_3[ 1 ] & 0x0f ) << 2 ) + ( ( char_array_3[ 2 ] & 0xc0 ) >> 6 );
|
||||
char_array_4[ 3 ] = char_array_3[ 2 ] & 0x3f;
|
||||
|
||||
for( j = 0; ( j < i + 1 ); j++ )
|
||||
ret += base64_chars[char_array_4[j]];
|
||||
ret += base64_chars[ char_array_4[ j ] ];
|
||||
|
||||
while( ( i++ < 3 ) )
|
||||
ret += '=';
|
||||
|
@ -81,7 +85,8 @@ std::string Core::Util::base64_encode( uint8_t const* bytes_to_encode, uint32_t
|
|||
|
||||
}
|
||||
|
||||
std::string Core::Util::base64_decode( std::string const& encoded_string ) {
|
||||
std::string Core::Util::base64_decode( std::string const& encoded_string )
|
||||
{
|
||||
int32_t in_len = encoded_string.size();
|
||||
int32_t i = 0;
|
||||
int32_t j = 0;
|
||||
|
@ -89,34 +94,39 @@ std::string Core::Util::base64_decode( std::string const& encoded_string ) {
|
|||
uint8_t char_array_4[4], char_array_3[3];
|
||||
std::string ret;
|
||||
|
||||
while( in_len-- && ( encoded_string[in_] != '=' ) && is_base64( encoded_string[in_] ) ) {
|
||||
char_array_4[i++] = encoded_string[in_]; in_++;
|
||||
if( i == 4 ) {
|
||||
while( in_len-- && ( encoded_string[ in_ ] != '=' ) && is_base64( encoded_string[ in_ ] ) )
|
||||
{
|
||||
char_array_4[ i++ ] = encoded_string[ in_ ];
|
||||
in_++;
|
||||
if( i == 4 )
|
||||
{
|
||||
for( i = 0; i < 4; i++ )
|
||||
char_array_4[i] = static_cast< uint8_t >( base64_chars.find( char_array_4[i] ) );
|
||||
char_array_4[ i ] = static_cast< uint8_t >( base64_chars.find( char_array_4[ i ] ) );
|
||||
|
||||
char_array_3[0] = ( char_array_4[0] << 2 ) + ( ( char_array_4[1] & 0x30 ) >> 4 );
|
||||
char_array_3[1] = ( ( char_array_4[1] & 0xf ) << 4 ) + ( ( char_array_4[2] & 0x3c ) >> 2 );
|
||||
char_array_3[2] = ( ( char_array_4[2] & 0x3 ) << 6 ) + char_array_4[3];
|
||||
char_array_3[ 0 ] = ( char_array_4[ 0 ] << 2 ) + ( ( char_array_4[ 1 ] & 0x30 ) >> 4 );
|
||||
char_array_3[ 1 ] = ( ( char_array_4[ 1 ] & 0xf ) << 4 ) + ( ( char_array_4[ 2 ] & 0x3c ) >> 2 );
|
||||
char_array_3[ 2 ] = ( ( char_array_4[ 2 ] & 0x3 ) << 6 ) + char_array_4[ 3 ];
|
||||
|
||||
for( i = 0; ( i < 3 ); i++ )
|
||||
ret += char_array_3[i];
|
||||
ret += char_array_3[ i ];
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if( i ) {
|
||||
if( i )
|
||||
{
|
||||
for( j = i; j < 4; j++ )
|
||||
char_array_4[j] = 0;
|
||||
char_array_4[ j ] = 0;
|
||||
|
||||
for( j = 0; j < 4; j++ )
|
||||
char_array_4[j] = static_cast< uint8_t >( base64_chars.find( char_array_4[j] ) );
|
||||
char_array_4[ j ] = static_cast< uint8_t >( base64_chars.find( char_array_4[ j ] ) );
|
||||
|
||||
char_array_3[0] = ( char_array_4[0] << 2 ) + ( ( char_array_4[1] & 0x30 ) >> 4 );
|
||||
char_array_3[1] = ( ( char_array_4[1] & 0xf ) << 4 ) + ( ( char_array_4[2] & 0x3c ) >> 2 );
|
||||
char_array_3[2] = ( ( char_array_4[2] & 0x3 ) << 6 ) + char_array_4[3];
|
||||
char_array_3[ 0 ] = ( char_array_4[ 0 ] << 2 ) + ( ( char_array_4[ 1 ] & 0x30 ) >> 4 );
|
||||
char_array_3[ 1 ] = ( ( char_array_4[ 1 ] & 0xf ) << 4 ) + ( ( char_array_4[ 2 ] & 0x3c ) >> 2 );
|
||||
char_array_3[ 2 ] = ( ( char_array_4[ 2 ] & 0x3 ) << 6 ) + char_array_4[ 3 ];
|
||||
|
||||
for( j = 0; ( j < i - 1 ); j++ ) ret += char_array_3[j];
|
||||
for( j = 0; ( j < i - 1 ); j++ )
|
||||
ret += char_array_3[ j ];
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
#include <string>
|
||||
|
||||
namespace Core
|
||||
{
|
||||
namespace Util
|
||||
{
|
||||
std::string base64_encode( uint8_t const*, uint32_t len );
|
||||
std::string base64_decode( std::string const& s );
|
||||
}
|
||||
namespace Core {
|
||||
namespace Util {
|
||||
std::string base64_encode( uint8_t const*, uint32_t len );
|
||||
|
||||
std::string base64_decode( std::string const& s );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,86 +8,102 @@
|
|||
#include "blowfish.h"
|
||||
#include "blowfish.h2" // holds the random digit tables
|
||||
|
||||
#define S(x,i) (SBoxes[i][x.w.byte##i])
|
||||
#define bf_F(x) (((S(x,0) + S(x,1)) ^ S(x,2)) + S(x,3))
|
||||
#define ROUND(a,b,n) (a.dword ^= bf_F(b) ^ PArray[n])
|
||||
#define S( x, i ) (SBoxes[i][x.w.byte##i])
|
||||
#define bf_F( x ) (((S(x,0) + S(x,1)) ^ S(x,2)) + S(x,3))
|
||||
#define ROUND( a, b, n ) (a.dword ^= bf_F(b) ^ PArray[n])
|
||||
|
||||
|
||||
BlowFish::BlowFish ()
|
||||
BlowFish::BlowFish()
|
||||
{
|
||||
PArray = new DWORD [18] ;
|
||||
SBoxes = new DWORD [4][256] ;
|
||||
PArray = new DWORD[18];
|
||||
SBoxes = new DWORD[4][256];
|
||||
}
|
||||
|
||||
BlowFish::~BlowFish ()
|
||||
BlowFish::~BlowFish()
|
||||
{
|
||||
delete PArray ;
|
||||
delete [] SBoxes ;
|
||||
delete PArray;
|
||||
delete[] SBoxes;
|
||||
}
|
||||
|
||||
// the low level (private) encryption function
|
||||
void BlowFish::Blowfish_encipher (DWORD *xl, DWORD *xr)
|
||||
// the low level (private) encryption function
|
||||
void BlowFish::Blowfish_encipher( DWORD* xl, DWORD* xr )
|
||||
{
|
||||
union aword Xl, Xr ;
|
||||
union aword Xl, Xr;
|
||||
|
||||
Xl.dword = *xl ;
|
||||
Xr.dword = *xr ;
|
||||
Xl.dword = *xl;
|
||||
Xr.dword = *xr;
|
||||
|
||||
Xl.dword ^= PArray [0];
|
||||
ROUND (Xr, Xl, 1) ; ROUND (Xl, Xr, 2) ;
|
||||
ROUND (Xr, Xl, 3) ; ROUND (Xl, Xr, 4) ;
|
||||
ROUND (Xr, Xl, 5) ; ROUND (Xl, Xr, 6) ;
|
||||
ROUND (Xr, Xl, 7) ; ROUND (Xl, Xr, 8) ;
|
||||
ROUND (Xr, Xl, 9) ; ROUND (Xl, Xr, 10) ;
|
||||
ROUND (Xr, Xl, 11) ; ROUND (Xl, Xr, 12) ;
|
||||
ROUND (Xr, Xl, 13) ; ROUND (Xl, Xr, 14) ;
|
||||
ROUND (Xr, Xl, 15) ; ROUND (Xl, Xr, 16) ;
|
||||
Xr.dword ^= PArray [17] ;
|
||||
Xl.dword ^= PArray[ 0 ];
|
||||
ROUND ( Xr, Xl, 1 );
|
||||
ROUND ( Xl, Xr, 2 );
|
||||
ROUND ( Xr, Xl, 3 );
|
||||
ROUND ( Xl, Xr, 4 );
|
||||
ROUND ( Xr, Xl, 5 );
|
||||
ROUND ( Xl, Xr, 6 );
|
||||
ROUND ( Xr, Xl, 7 );
|
||||
ROUND ( Xl, Xr, 8 );
|
||||
ROUND ( Xr, Xl, 9 );
|
||||
ROUND ( Xl, Xr, 10 );
|
||||
ROUND ( Xr, Xl, 11 );
|
||||
ROUND ( Xl, Xr, 12 );
|
||||
ROUND ( Xr, Xl, 13 );
|
||||
ROUND ( Xl, Xr, 14 );
|
||||
ROUND ( Xr, Xl, 15 );
|
||||
ROUND ( Xl, Xr, 16 );
|
||||
Xr.dword ^= PArray[ 17 ];
|
||||
|
||||
*xr = Xl.dword ;
|
||||
*xl = Xr.dword ;
|
||||
*xr = Xl.dword;
|
||||
*xl = Xr.dword;
|
||||
}
|
||||
|
||||
// the low level (private) decryption function
|
||||
void BlowFish::Blowfish_decipher (DWORD *xl, DWORD *xr)
|
||||
// the low level (private) decryption function
|
||||
void BlowFish::Blowfish_decipher( DWORD* xl, DWORD* xr )
|
||||
{
|
||||
union aword Xl ;
|
||||
union aword Xr ;
|
||||
union aword Xl;
|
||||
union aword Xr;
|
||||
|
||||
Xl.dword = *xl ;
|
||||
Xr.dword = *xr ;
|
||||
Xl.dword = *xl;
|
||||
Xr.dword = *xr;
|
||||
|
||||
Xl.dword ^= PArray [17] ;
|
||||
ROUND (Xr, Xl, 16) ; ROUND (Xl, Xr, 15) ;
|
||||
ROUND (Xr, Xl, 14) ; ROUND (Xl, Xr, 13) ;
|
||||
ROUND (Xr, Xl, 12) ; ROUND (Xl, Xr, 11) ;
|
||||
ROUND (Xr, Xl, 10) ; ROUND (Xl, Xr, 9) ;
|
||||
ROUND (Xr, Xl, 8) ; ROUND (Xl, Xr, 7) ;
|
||||
ROUND (Xr, Xl, 6) ; ROUND (Xl, Xr, 5) ;
|
||||
ROUND (Xr, Xl, 4) ; ROUND (Xl, Xr, 3) ;
|
||||
ROUND (Xr, Xl, 2) ; ROUND (Xl, Xr, 1) ;
|
||||
Xr.dword ^= PArray[0];
|
||||
Xl.dword ^= PArray[ 17 ];
|
||||
ROUND ( Xr, Xl, 16 );
|
||||
ROUND ( Xl, Xr, 15 );
|
||||
ROUND ( Xr, Xl, 14 );
|
||||
ROUND ( Xl, Xr, 13 );
|
||||
ROUND ( Xr, Xl, 12 );
|
||||
ROUND ( Xl, Xr, 11 );
|
||||
ROUND ( Xr, Xl, 10 );
|
||||
ROUND ( Xl, Xr, 9 );
|
||||
ROUND ( Xr, Xl, 8 );
|
||||
ROUND ( Xl, Xr, 7 );
|
||||
ROUND ( Xr, Xl, 6 );
|
||||
ROUND ( Xl, Xr, 5 );
|
||||
ROUND ( Xr, Xl, 4 );
|
||||
ROUND ( Xl, Xr, 3 );
|
||||
ROUND ( Xr, Xl, 2 );
|
||||
ROUND ( Xl, Xr, 1 );
|
||||
Xr.dword ^= PArray[ 0 ];
|
||||
|
||||
*xl = Xr.dword;
|
||||
*xr = Xl.dword;
|
||||
}
|
||||
|
||||
|
||||
// constructs the enctryption sieve
|
||||
void BlowFish::initialize (BYTE key[], int32_t keybytes)
|
||||
// constructs the enctryption sieve
|
||||
void BlowFish::initialize( BYTE key[], int32_t keybytes )
|
||||
{
|
||||
int i, j ;
|
||||
DWORD datal, datar ;
|
||||
int i, j;
|
||||
DWORD datal, datar;
|
||||
|
||||
|
||||
// first fill arrays from data tables
|
||||
for (i = 0 ; i < 18 ; i++)
|
||||
PArray [i] = bf_P [i] ;
|
||||
for( i = 0; i < 18; i++ )
|
||||
PArray[ i ] = bf_P[ i ];
|
||||
|
||||
for (i = 0 ; i < 4 ; i++)
|
||||
for( i = 0; i < 4; i++ )
|
||||
{
|
||||
for (j = 0 ; j < 256 ; j++)
|
||||
SBoxes [i][j] = bf_S [i][j] ;
|
||||
for( j = 0; j < 256; j++ )
|
||||
SBoxes[ i ][ j ] = bf_S[ i ][ j ];
|
||||
}
|
||||
|
||||
int32_t v12; // eax@6
|
||||
|
@ -104,155 +120,155 @@ void BlowFish::initialize (BYTE key[], int32_t keybytes)
|
|||
|
||||
|
||||
int32_t v10 = keybytes;
|
||||
uintptr_t v9 = (uintptr_t)key;
|
||||
uintptr_t v9 = ( uintptr_t ) key;
|
||||
int32_t v8 = 0;
|
||||
int32_t v11 = 0;
|
||||
do {
|
||||
v13 = (char)(*(BYTE *)(v8 + v9));
|
||||
do
|
||||
{
|
||||
v13 = ( char ) ( *( BYTE* ) ( v8 + v9 ) );
|
||||
v12 = v8 + 1;
|
||||
if ( v12 >= v10 )
|
||||
if( v12 >= v10 )
|
||||
v12 = 0;
|
||||
v16 = (char)*(BYTE *)(v12 + v9);
|
||||
v16 = ( char ) *( BYTE* ) ( v12 + v9 );
|
||||
v14 = v12 + 1;
|
||||
v15 = (v13 << 8) | v16;
|
||||
if ( v14 >= v10 )
|
||||
v15 = ( v13 << 8 ) | v16;
|
||||
if( v14 >= v10 )
|
||||
v14 = 0;
|
||||
v19 = (char)*(BYTE *)(v14 + v9);
|
||||
v19 = ( char ) *( BYTE* ) ( v14 + v9 );
|
||||
v17 = v14 + 1;
|
||||
v18 = (v15 << 8) | v19;
|
||||
if ( v17 >= v10 )
|
||||
v18 = ( v15 << 8 ) | v19;
|
||||
if( v17 >= v10 )
|
||||
v17 = 0;
|
||||
v21 = (char)*(BYTE *)(v17 + v9);
|
||||
v21 = ( char ) *( BYTE* ) ( v17 + v9 );
|
||||
v8 = v17 + 1;
|
||||
v20 = (v18 << 8) | v21;
|
||||
if ( v8 >= v10 )
|
||||
v20 = ( v18 << 8 ) | v21;
|
||||
if( v8 >= v10 )
|
||||
v8 = 0;
|
||||
*((DWORD *)PArray + v11++) ^= v20;
|
||||
} while ( v11 < 18 );
|
||||
*( ( DWORD* ) PArray + v11++ ) ^= v20;
|
||||
} while( v11 < 18 );
|
||||
|
||||
|
||||
datal = 0;
|
||||
datar = 0;
|
||||
|
||||
datal = 0 ;
|
||||
datar = 0 ;
|
||||
|
||||
for (i = 0 ; i < NPASS + 2 ; i += 2)
|
||||
for( i = 0; i < NPASS + 2; i += 2 )
|
||||
{
|
||||
Blowfish_encipher (&datal, &datar) ;
|
||||
PArray [i] = datal ;
|
||||
PArray [i + 1] = datar ;
|
||||
Blowfish_encipher( &datal, &datar );
|
||||
PArray[ i ] = datal;
|
||||
PArray[ i + 1 ] = datar;
|
||||
}
|
||||
|
||||
for (i = 0 ; i < 4 ; ++i)
|
||||
for( i = 0; i < 4; ++i )
|
||||
{
|
||||
for (j = 0 ; j < 256 ; j += 2)
|
||||
for( j = 0; j < 256; j += 2 )
|
||||
{
|
||||
Blowfish_encipher (&datal, &datar) ;
|
||||
SBoxes [i][j] = datal ;
|
||||
SBoxes [i][j + 1] = datar ;
|
||||
Blowfish_encipher( &datal, &datar );
|
||||
SBoxes[ i ][ j ] = datal;
|
||||
SBoxes[ i ][ j + 1 ] = datar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get output length, which must be even MOD 8
|
||||
DWORD BlowFish::GetOutputLength (DWORD lInputLong)
|
||||
// get output length, which must be even MOD 8
|
||||
DWORD BlowFish::GetOutputLength( DWORD lInputLong )
|
||||
{
|
||||
DWORD lVal ;
|
||||
DWORD lVal;
|
||||
|
||||
lVal = lInputLong % 8 ; // find out if uneven number of bytes at the end
|
||||
if (lVal != 0)
|
||||
return lInputLong + 8 - lVal ;
|
||||
lVal = lInputLong % 8; // find out if uneven number of bytes at the end
|
||||
if( lVal != 0 )
|
||||
return lInputLong + 8 - lVal;
|
||||
else
|
||||
return lInputLong ;
|
||||
return lInputLong;
|
||||
}
|
||||
|
||||
// Encode pIntput into pOutput. Input length in lSize. Returned value
|
||||
// is length of output which will be even MOD 8 bytes. Input buffer and
|
||||
// output buffer can be the same, but be sure buffer length is even MOD 8.
|
||||
DWORD BlowFish::Encode (BYTE * pInput, BYTE * pOutput, DWORD lSize)
|
||||
// Encode pIntput into pOutput. Input length in lSize. Returned value
|
||||
// is length of output which will be even MOD 8 bytes. Input buffer and
|
||||
// output buffer can be the same, but be sure buffer length is even MOD 8.
|
||||
DWORD BlowFish::Encode( BYTE* pInput, BYTE* pOutput, DWORD lSize )
|
||||
{
|
||||
DWORD lCount, lOutSize, lGoodBytes ;
|
||||
BYTE *pi, *po ;
|
||||
int i, j ;
|
||||
int SameDest = (pInput == pOutput ? 1 : 0) ;
|
||||
DWORD lCount, lOutSize, lGoodBytes;
|
||||
BYTE* pi, * po;
|
||||
int i, j;
|
||||
int SameDest = ( pInput == pOutput ? 1 : 0 );
|
||||
|
||||
lOutSize = GetOutputLength (lSize) ;
|
||||
for (lCount = 0 ; lCount < lOutSize ; lCount += 8)
|
||||
lOutSize = GetOutputLength( lSize );
|
||||
for( lCount = 0; lCount < lOutSize; lCount += 8 )
|
||||
{
|
||||
if (SameDest) // if encoded data is being written into input buffer
|
||||
if( SameDest ) // if encoded data is being written into input buffer
|
||||
{
|
||||
if (lCount < lSize - 7) // if not dealing with uneven bytes at end
|
||||
if( lCount < lSize - 7 ) // if not dealing with uneven bytes at end
|
||||
{
|
||||
Blowfish_encipher ((DWORD *) pInput,
|
||||
(DWORD *) (pInput + 4)) ;
|
||||
Blowfish_encipher( ( DWORD* ) pInput,
|
||||
( DWORD* ) ( pInput + 4 ) );
|
||||
}
|
||||
else // pad end of data with null bytes to complete encryption
|
||||
{
|
||||
po = pInput + lSize ; // point at byte past the end of actual data
|
||||
j = (int) (lOutSize - lSize) ; // number of bytes to set to null
|
||||
for (i = 0 ; i < j ; i++)
|
||||
*po++ = 0 ;
|
||||
Blowfish_encipher ((DWORD *) pInput,
|
||||
(DWORD *) (pInput + 4)) ;
|
||||
po = pInput + lSize; // point at byte past the end of actual data
|
||||
j = ( int ) ( lOutSize - lSize ); // number of bytes to set to null
|
||||
for( i = 0; i < j; i++ )
|
||||
*po++ = 0;
|
||||
Blowfish_encipher( ( DWORD* ) pInput,
|
||||
( DWORD* ) ( pInput + 4 ) );
|
||||
}
|
||||
pInput += 8 ;
|
||||
pInput += 8;
|
||||
}
|
||||
else // output buffer not equal to input buffer, so must copy
|
||||
{ // input to output buffer prior to encrypting
|
||||
if (lCount < lSize - 7) // if not dealing with uneven bytes at end
|
||||
if( lCount < lSize - 7 ) // if not dealing with uneven bytes at end
|
||||
{
|
||||
pi = pInput ;
|
||||
po = pOutput ;
|
||||
for (i = 0 ; i < 8 ; i++)
|
||||
pi = pInput;
|
||||
po = pOutput;
|
||||
for( i = 0; i < 8; i++ )
|
||||
// copy bytes to output
|
||||
*po++ = *pi++ ;
|
||||
Blowfish_encipher ((DWORD *) pOutput, // now encrypt them
|
||||
(DWORD *) (pOutput + 4)) ;
|
||||
*po++ = *pi++;
|
||||
Blowfish_encipher( ( DWORD* ) pOutput, // now encrypt them
|
||||
( DWORD* ) ( pOutput + 4 ) );
|
||||
}
|
||||
else // pad end of data with null bytes to complete encryption
|
||||
{
|
||||
lGoodBytes = lSize - lCount ; // number of remaining data bytes
|
||||
po = pOutput ;
|
||||
for (i = 0 ; i < (int) lGoodBytes ; i++)
|
||||
*po++ = *pInput++ ;
|
||||
for (j = i ; j < 8 ; j++)
|
||||
*po++ = 0 ;
|
||||
Blowfish_encipher ((DWORD *) pOutput,
|
||||
(DWORD *) (pOutput + 4)) ;
|
||||
lGoodBytes = lSize - lCount; // number of remaining data bytes
|
||||
po = pOutput;
|
||||
for( i = 0; i < ( int ) lGoodBytes; i++ )
|
||||
*po++ = *pInput++;
|
||||
for( j = i; j < 8; j++ )
|
||||
*po++ = 0;
|
||||
Blowfish_encipher( ( DWORD* ) pOutput,
|
||||
( DWORD* ) ( pOutput + 4 ) );
|
||||
}
|
||||
pInput += 8 ;
|
||||
pOutput += 8 ;
|
||||
pInput += 8;
|
||||
pOutput += 8;
|
||||
}
|
||||
}
|
||||
return lOutSize ;
|
||||
}
|
||||
return lOutSize;
|
||||
}
|
||||
|
||||
// Decode pIntput into pOutput. Input length in lSize. Input buffer and
|
||||
// output buffer can be the same, but be sure buffer length is even MOD 8.
|
||||
void BlowFish::Decode (BYTE * pInput, BYTE * pOutput, DWORD lSize)
|
||||
// Decode pIntput into pOutput. Input length in lSize. Input buffer and
|
||||
// output buffer can be the same, but be sure buffer length is even MOD 8.
|
||||
void BlowFish::Decode( BYTE* pInput, BYTE* pOutput, DWORD lSize )
|
||||
{
|
||||
DWORD lCount ;
|
||||
BYTE *pi, *po ;
|
||||
int i ;
|
||||
int SameDest = (pInput == pOutput ? 1 : 0) ;
|
||||
DWORD lCount;
|
||||
BYTE* pi, * po;
|
||||
int i;
|
||||
int SameDest = ( pInput == pOutput ? 1 : 0 );
|
||||
|
||||
for (lCount = 0 ; lCount < lSize ; lCount += 8)
|
||||
for( lCount = 0; lCount < lSize; lCount += 8 )
|
||||
{
|
||||
if (SameDest) // if encoded data is being written into input buffer
|
||||
if( SameDest ) // if encoded data is being written into input buffer
|
||||
{
|
||||
Blowfish_decipher ((DWORD *) pInput,
|
||||
(DWORD *) (pInput + 4)) ;
|
||||
pInput += 8 ;
|
||||
Blowfish_decipher( ( DWORD* ) pInput,
|
||||
( DWORD* ) ( pInput + 4 ) );
|
||||
pInput += 8;
|
||||
}
|
||||
else // output buffer not equal to input buffer
|
||||
{ // so copy input to output before decoding
|
||||
pi = pInput ;
|
||||
po = pOutput ;
|
||||
for (i = 0 ; i < 8 ; i++)
|
||||
*po++ = *pi++ ;
|
||||
Blowfish_decipher ((DWORD *) pOutput,
|
||||
(DWORD *) (pOutput + 4)) ;
|
||||
pInput += 8 ;
|
||||
pOutput += 8 ;
|
||||
pi = pInput;
|
||||
po = pOutput;
|
||||
for( i = 0; i < 8; i++ )
|
||||
*po++ = *pi++;
|
||||
Blowfish_decipher( ( DWORD* ) pOutput,
|
||||
( DWORD* ) ( pOutput + 4 ) );
|
||||
pInput += 8;
|
||||
pOutput += 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,39 +16,48 @@
|
|||
class BlowFish
|
||||
{
|
||||
private:
|
||||
DWORD * PArray ;
|
||||
DWORD* PArray;
|
||||
DWORD (* SBoxes)[256];
|
||||
void Blowfish_encipher (DWORD *xl, DWORD *xr) ;
|
||||
void Blowfish_decipher (DWORD *xl, DWORD *xr) ;
|
||||
|
||||
void Blowfish_encipher( DWORD* xl, DWORD* xr );
|
||||
|
||||
void Blowfish_decipher( DWORD* xl, DWORD* xr );
|
||||
|
||||
public:
|
||||
BlowFish () ;
|
||||
~BlowFish () ;
|
||||
void initialize (BYTE key[], int32_t keybytes) ;
|
||||
DWORD GetOutputLength (DWORD lInputLong) ;
|
||||
DWORD Encode (BYTE * pInput, BYTE * pOutput, DWORD lSize) ;
|
||||
void Decode (BYTE * pInput, BYTE * pOutput, DWORD lSize) ;
|
||||
BlowFish();
|
||||
|
||||
} ;
|
||||
~BlowFish();
|
||||
|
||||
void initialize( BYTE key[], int32_t keybytes );
|
||||
|
||||
DWORD GetOutputLength( DWORD lInputLong );
|
||||
|
||||
DWORD Encode( BYTE* pInput, BYTE* pOutput, DWORD lSize );
|
||||
|
||||
void Decode( BYTE* pInput, BYTE* pOutput, DWORD lSize );
|
||||
|
||||
};
|
||||
|
||||
// choose a byte order for your hardware
|
||||
#define ORDER_DCBA // chosing Intel in this case
|
||||
|
||||
#ifdef ORDER_DCBA // DCBA - little endian - intel
|
||||
union aword {
|
||||
union aword
|
||||
{
|
||||
DWORD dword;
|
||||
BYTE byte [4];
|
||||
struct {
|
||||
BYTE byte[4];
|
||||
struct
|
||||
{
|
||||
uint32_t byte3:8;
|
||||
uint32_t byte2:8;
|
||||
uint32_t byte1:8;
|
||||
uint32_t byte0:8;
|
||||
} w;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef ORDER_ABCD // ABCD - big endian - motorola
|
||||
union aword {
|
||||
union aword {
|
||||
DWORD dword;
|
||||
BYTE byte [4];
|
||||
struct {
|
||||
|
@ -57,11 +66,11 @@ public:
|
|||
uint32_t byte2:8;
|
||||
uint32_t byte3:8;
|
||||
} w;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef ORDER_BADC // BADC - vax
|
||||
union aword {
|
||||
union aword {
|
||||
DWORD dword;
|
||||
BYTE byte [4];
|
||||
struct {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <string.h>
|
||||
#include "md5.h"
|
||||
|
||||
#define GET_UINT32(n,b,i) \
|
||||
#define GET_UINT32( n, b, i ) \
|
||||
{ \
|
||||
(n) = ( (uint32_t) (b)[(i) ] ) \
|
||||
| ( (uint32_t) (b)[(i) + 1] << 8 ) \
|
||||
|
@ -29,7 +29,7 @@
|
|||
| ( (uint32_t) (b)[(i) + 3] << 24 ); \
|
||||
}
|
||||
|
||||
#define PUT_UINT32(n,b,i) \
|
||||
#define PUT_UINT32( n, b, i ) \
|
||||
{ \
|
||||
(b)[(i) ] = (uint8_t) ( (n) ); \
|
||||
(b)[(i) + 1] = (uint8_t) ( (n) >> 8 ); \
|
||||
|
@ -37,51 +37,51 @@
|
|||
(b)[(i) + 3] = (uint8_t) ( (n) >> 24 ); \
|
||||
}
|
||||
|
||||
void Core::Util::md5_starts( md5_context *ctx )
|
||||
void Core::Util::md5_starts( md5_context* ctx )
|
||||
{
|
||||
ctx->total[0] = 0;
|
||||
ctx->total[1] = 0;
|
||||
ctx->total[ 0 ] = 0;
|
||||
ctx->total[ 1 ] = 0;
|
||||
|
||||
ctx->state[0] = 0x67452301;
|
||||
ctx->state[1] = 0xEFCDAB89;
|
||||
ctx->state[2] = 0x98BADCFE;
|
||||
ctx->state[3] = 0x10325476;
|
||||
ctx->state[ 0 ] = 0x67452301;
|
||||
ctx->state[ 1 ] = 0xEFCDAB89;
|
||||
ctx->state[ 2 ] = 0x98BADCFE;
|
||||
ctx->state[ 3 ] = 0x10325476;
|
||||
}
|
||||
|
||||
void md5_process( Core::Util::md5_context *ctx, uint8_t data[64] )
|
||||
void md5_process( Core::Util::md5_context* ctx, uint8_t data[64] )
|
||||
{
|
||||
uint32_t X[16], A, B, C, D;
|
||||
|
||||
GET_UINT32( X[0], data, 0 );
|
||||
GET_UINT32( X[1], data, 4 );
|
||||
GET_UINT32( X[2], data, 8 );
|
||||
GET_UINT32( X[3], data, 12 );
|
||||
GET_UINT32( X[4], data, 16 );
|
||||
GET_UINT32( X[5], data, 20 );
|
||||
GET_UINT32( X[6], data, 24 );
|
||||
GET_UINT32( X[7], data, 28 );
|
||||
GET_UINT32( X[8], data, 32 );
|
||||
GET_UINT32( X[9], data, 36 );
|
||||
GET_UINT32( X[10], data, 40 );
|
||||
GET_UINT32( X[11], data, 44 );
|
||||
GET_UINT32( X[12], data, 48 );
|
||||
GET_UINT32( X[13], data, 52 );
|
||||
GET_UINT32( X[14], data, 56 );
|
||||
GET_UINT32( X[15], data, 60 );
|
||||
GET_UINT32( X[ 0 ], data, 0 );
|
||||
GET_UINT32( X[ 1 ], data, 4 );
|
||||
GET_UINT32( X[ 2 ], data, 8 );
|
||||
GET_UINT32( X[ 3 ], data, 12 );
|
||||
GET_UINT32( X[ 4 ], data, 16 );
|
||||
GET_UINT32( X[ 5 ], data, 20 );
|
||||
GET_UINT32( X[ 6 ], data, 24 );
|
||||
GET_UINT32( X[ 7 ], data, 28 );
|
||||
GET_UINT32( X[ 8 ], data, 32 );
|
||||
GET_UINT32( X[ 9 ], data, 36 );
|
||||
GET_UINT32( X[ 10 ], data, 40 );
|
||||
GET_UINT32( X[ 11 ], data, 44 );
|
||||
GET_UINT32( X[ 12 ], data, 48 );
|
||||
GET_UINT32( X[ 13 ], data, 52 );
|
||||
GET_UINT32( X[ 14 ], data, 56 );
|
||||
GET_UINT32( X[ 15 ], data, 60 );
|
||||
|
||||
#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
|
||||
#define S( x, n ) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
|
||||
|
||||
#define P(a,b,c,d,k,s,t) \
|
||||
#define P( a, b, c, d, k, s, t ) \
|
||||
{ \
|
||||
a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \
|
||||
}
|
||||
|
||||
A = ctx->state[0];
|
||||
B = ctx->state[1];
|
||||
C = ctx->state[2];
|
||||
D = ctx->state[3];
|
||||
A = ctx->state[ 0 ];
|
||||
B = ctx->state[ 1 ];
|
||||
C = ctx->state[ 2 ];
|
||||
D = ctx->state[ 3 ];
|
||||
|
||||
#define F(x,y,z) (z ^ (x & (y ^ z)))
|
||||
#define F( x, y, z ) (z ^ (x & (y ^ z)))
|
||||
|
||||
P( A, B, C, D, 0, 7, 0xD76AA478 );
|
||||
P( D, A, B, C, 1, 12, 0xE8C7B756 );
|
||||
|
@ -102,7 +102,7 @@ void md5_process( Core::Util::md5_context *ctx, uint8_t data[64] )
|
|||
|
||||
#undef F
|
||||
|
||||
#define F(x,y,z) (y ^ (z & (x ^ y)))
|
||||
#define F( x, y, z ) (y ^ (z & (x ^ y)))
|
||||
|
||||
P( A, B, C, D, 1, 5, 0xF61E2562 );
|
||||
P( D, A, B, C, 6, 9, 0xC040B340 );
|
||||
|
@ -123,7 +123,7 @@ void md5_process( Core::Util::md5_context *ctx, uint8_t data[64] )
|
|||
|
||||
#undef F
|
||||
|
||||
#define F(x,y,z) (x ^ y ^ z)
|
||||
#define F( x, y, z ) (x ^ y ^ z)
|
||||
|
||||
P( A, B, C, D, 5, 4, 0xFFFA3942 );
|
||||
P( D, A, B, C, 8, 11, 0x8771F681 );
|
||||
|
@ -144,7 +144,7 @@ void md5_process( Core::Util::md5_context *ctx, uint8_t data[64] )
|
|||
|
||||
#undef F
|
||||
|
||||
#define F(x,y,z) (y ^ (x | ~z))
|
||||
#define F( x, y, z ) (y ^ (x | ~z))
|
||||
|
||||
P( A, B, C, D, 0, 6, 0xF4292244 );
|
||||
P( D, A, B, C, 7, 10, 0x432AFF97 );
|
||||
|
@ -165,31 +165,32 @@ void md5_process( Core::Util::md5_context *ctx, uint8_t data[64] )
|
|||
|
||||
#undef F
|
||||
|
||||
ctx->state[0] += A;
|
||||
ctx->state[1] += B;
|
||||
ctx->state[2] += C;
|
||||
ctx->state[3] += D;
|
||||
ctx->state[ 0 ] += A;
|
||||
ctx->state[ 1 ] += B;
|
||||
ctx->state[ 2 ] += C;
|
||||
ctx->state[ 3 ] += D;
|
||||
}
|
||||
|
||||
void Core::Util::md5_update( md5_context *ctx, uint8_t *input, uint32_t length )
|
||||
void Core::Util::md5_update( md5_context* ctx, uint8_t* input, uint32_t length )
|
||||
{
|
||||
uint32_t left, fill;
|
||||
|
||||
if( !length ) return;
|
||||
if( !length )
|
||||
return;
|
||||
|
||||
left = ctx->total[0] & 0x3F;
|
||||
left = ctx->total[ 0 ] & 0x3F;
|
||||
fill = 64 - left;
|
||||
|
||||
ctx->total[0] += length;
|
||||
ctx->total[0] &= 0xFFFFFFFF;
|
||||
ctx->total[ 0 ] += length;
|
||||
ctx->total[ 0 ] &= 0xFFFFFFFF;
|
||||
|
||||
if( ctx->total[0] < length )
|
||||
ctx->total[1]++;
|
||||
if( ctx->total[ 0 ] < length )
|
||||
ctx->total[ 1 ]++;
|
||||
|
||||
if( left && length >= fill )
|
||||
{
|
||||
memcpy( ( void * )( ctx->buffer + left ),
|
||||
( void * )input, fill );
|
||||
memcpy( ( void* ) ( ctx->buffer + left ),
|
||||
( void* ) input, fill );
|
||||
md5_process( ctx, ctx->buffer );
|
||||
length -= fill;
|
||||
input += fill;
|
||||
|
@ -205,52 +206,52 @@ void Core::Util::md5_update( md5_context *ctx, uint8_t *input, uint32_t length )
|
|||
|
||||
if( length )
|
||||
{
|
||||
memcpy( ( void * )( ctx->buffer + left ),
|
||||
( void * )input, length );
|
||||
memcpy( ( void* ) ( ctx->buffer + left ),
|
||||
( void* ) input, length );
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t md5_padding[64] =
|
||||
{
|
||||
{
|
||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
};
|
||||
|
||||
void Core::Util::md5_finish( md5_context *ctx, uint8_t digest[16] )
|
||||
void Core::Util::md5_finish( md5_context* ctx, uint8_t digest[16] )
|
||||
{
|
||||
uint32_t last, padn;
|
||||
uint32_t high, low;
|
||||
uint8_t msglen[8];
|
||||
|
||||
high = ( ctx->total[0] >> 29 )
|
||||
| ( ctx->total[1] << 3 );
|
||||
low = ( ctx->total[0] << 3 );
|
||||
high = ( ctx->total[ 0 ] >> 29 )
|
||||
| ( ctx->total[ 1 ] << 3 );
|
||||
low = ( ctx->total[ 0 ] << 3 );
|
||||
|
||||
PUT_UINT32( low, msglen, 0 );
|
||||
PUT_UINT32( high, msglen, 4 );
|
||||
|
||||
last = ctx->total[0] & 0x3F;
|
||||
last = ctx->total[ 0 ] & 0x3F;
|
||||
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
|
||||
|
||||
md5_update( ctx, md5_padding, padn );
|
||||
md5_update( ctx, msglen, 8 );
|
||||
|
||||
PUT_UINT32( ctx->state[0], digest, 0 );
|
||||
PUT_UINT32( ctx->state[1], digest, 4 );
|
||||
PUT_UINT32( ctx->state[2], digest, 8 );
|
||||
PUT_UINT32( ctx->state[3], digest, 12 );
|
||||
PUT_UINT32( ctx->state[ 0 ], digest, 0 );
|
||||
PUT_UINT32( ctx->state[ 1 ], digest, 4 );
|
||||
PUT_UINT32( ctx->state[ 2 ], digest, 8 );
|
||||
PUT_UINT32( ctx->state[ 3 ], digest, 12 );
|
||||
}
|
||||
|
||||
/*
|
||||
* those are the standard RFC 1321 test vectors
|
||||
*/
|
||||
|
||||
void Core::Util::md5( uint8_t *text, uint8_t *hash, int32_t size )
|
||||
void Core::Util::md5( uint8_t* text, uint8_t* hash, int32_t size )
|
||||
{
|
||||
md5_context ctx;
|
||||
md5_starts( &ctx );
|
||||
md5_update( &ctx, ( uint8_t * )text, size );
|
||||
md5_update( &ctx, ( uint8_t* ) text, size );
|
||||
md5_finish( &ctx, hash );
|
||||
}
|
|
@ -1,25 +1,27 @@
|
|||
#ifndef _MD52_H
|
||||
#define _MD52_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace Core
|
||||
namespace Core {
|
||||
namespace Util {
|
||||
using md5_context = struct
|
||||
{
|
||||
namespace Util
|
||||
{
|
||||
using md5_context = struct
|
||||
{
|
||||
uint32_t total[2];
|
||||
uint32_t state[4];
|
||||
uint8_t buffer[64];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
void md5( uint8_t *text, uint8_t *hash, int32_t size );
|
||||
void md5_starts( md5_context *ctx );
|
||||
void md5_update( md5_context *ctx, uint8_t *input, uint32_t length );
|
||||
void md5_finish( md5_context *ctx, uint8_t digest[16] );
|
||||
void md5( uint8_t* text, uint8_t* hash, int32_t size );
|
||||
|
||||
static const char *msg[] =
|
||||
void md5_starts( md5_context* ctx );
|
||||
|
||||
void md5_update( md5_context* ctx, uint8_t* input, uint32_t length );
|
||||
|
||||
void md5_finish( md5_context* ctx, uint8_t digest[16] );
|
||||
|
||||
static const char* msg[] =
|
||||
{
|
||||
"",
|
||||
"a",
|
||||
|
@ -31,7 +33,7 @@ namespace Core
|
|||
"345678901234567890"
|
||||
};
|
||||
|
||||
static const char *val[] =
|
||||
static const char* val[] =
|
||||
{
|
||||
"d41d8cd98f00b204e9800998ecf8427e",
|
||||
"0cc175b9c0f1b6a831c399e269772661",
|
||||
|
@ -42,7 +44,7 @@ namespace Core
|
|||
"57edf4a22be3c955ac49da2e2107b67a"
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,141 +0,0 @@
|
|||
#include "CharaDbConnection.h"
|
||||
#include <MySqlConnector.h>
|
||||
|
||||
Core::Db::CharaDbConnection::CharaDbConnection( ConnectionInfo& connInfo ) : DbConnection( connInfo )
|
||||
{
|
||||
}
|
||||
|
||||
Core::Db::CharaDbConnection::CharaDbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* q,
|
||||
ConnectionInfo& connInfo) : DbConnection( q, connInfo )
|
||||
{
|
||||
}
|
||||
|
||||
Core::Db::CharaDbConnection::~CharaDbConnection()
|
||||
{
|
||||
}
|
||||
|
||||
void Core::Db::CharaDbConnection::doPrepareStatements()
|
||||
{
|
||||
if( !m_reconnecting )
|
||||
m_stmts.resize( MAX_STATEMENTS );
|
||||
|
||||
/// CHARA
|
||||
prepareStatement( CHARA_SEL, "SELECT ContentId, Name, Hp, Mp, Tp, Gp, Mode, Mount, InvincibleGM, Voice, "
|
||||
"Customize, ModelMainWeapon, ModelSubWeapon, ModelSystemWeapon, "
|
||||
"ModelEquip, EmoteModeType, FirstLoginTime, Language, IsNewGame, "
|
||||
"IsNewAdventurer, TerritoryType, TerritoryId, PosX, PosY, PosZ, PosR, "
|
||||
"OTerritoryType, OTerritoryId, OPosX, OPosY, OPosZ, OPosR, GuardianDeity, "
|
||||
"BirthDay, BirthMonth, Class, Status, TotalPlayTime, FirstClass, HomePoint, "
|
||||
"FavoritePoint, RestPoint, StartTown, ActiveTitle, TitleList, Achievement, "
|
||||
"Aetheryte, HowTo, Minions, Mounts, Orchestrion, EquippedMannequin, ConfigFlags, "
|
||||
"QuestCompleteFlags, OpeningSequence, QuestTracking, GrandCompany, "
|
||||
"GrandCompanyRank, Discovery, GMRank, EquipDisplayFlags, Unlocks, CFPenaltyUntil, "
|
||||
"Pose "
|
||||
"FROM charainfo WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
|
||||
|
||||
prepareStatement( CHARA_UP,
|
||||
"UPDATE charainfo SET "
|
||||
"Hp = ?, Mp = ?, Tp = ?, Gp = ?, Mode = ?, Mount = ?, InvincibleGM = ?, Voice = ?, "
|
||||
"Customize = ?, ModelMainWeapon = ?, ModelSubWeapon = ?, ModelSystemWeapon = ?, "
|
||||
"ModelEquip = ?, EmoteModeType = ?, Language = ?, IsNewGame = ?, IsNewAdventurer = ?, "
|
||||
"TerritoryType = ?, TerritoryId = ?, PosX = ?, PosY = ?, PosZ = ?, PosR = ?, "
|
||||
"OTerritoryType = ?, OTerritoryId = ?, OPosX = ?, OPosY = ?, OPosZ = ?, OPosR = ?, "
|
||||
"Class = ?, Status = ?, TotalPlayTime = ?, HomePoint = ?, FavoritePoint = ?, RestPoint = ?, "
|
||||
"ActiveTitle = ?, TitleList = ?, Achievement = ?, Aetheryte = ?, HowTo = ?, Minions = ?, Mounts = ?, Orchestrion = ?, "
|
||||
"EquippedMannequin = ?, ConfigFlags = ?, QuestCompleteFlags = ?, OpeningSequence = ?, "
|
||||
"QuestTracking = ?, GrandCompany = ?, GrandCompanyRank = ?, Discovery = ?, GMRank = ?, EquipDisplayFlags = ?, Unlocks = ?, "
|
||||
"CFPenaltyUntil = ?, Pose = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
|
||||
|
||||
prepareStatement( CHARA_SEL_MINIMAL, "SELECT Name, Customize, ModelEquip, TerritoryId, GuardianDeity, "
|
||||
"Class, ContentId, BirthDay, BirthMonth "
|
||||
"FROM charainfo WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
|
||||
prepareStatement( CHARA_INS, "INSERT INTO charainfo (AccountId, CharacterId, ContentId, Name, Hp, Mp, "
|
||||
"Customize, Voice, IsNewGame, TerritoryId, PosX, PosY, PosZ, PosR, ModelEquip, "
|
||||
"IsNewAdventurer, GuardianDeity, Birthday, BirthMonth, Class, Status, FirstClass, "
|
||||
"HomePoint, StartTown, Discovery, HowTo, QuestCompleteFlags, Unlocks, QuestTracking, "
|
||||
"Aetheryte, GMRank, Mounts, Orchestrion, UPDATE_DATE ) "
|
||||
"VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW() );",
|
||||
CONNECTION_SYNC );
|
||||
|
||||
prepareStatement( CHARA_UP_NAME, "UPDATE charainfo SET Name = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_HPMP, "UPDATE charainfo SET Hp = ?, Mp = ?, Tp = ?, Gp = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODE, "UPDATE charainfo SET Mode = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MOUNT, "UPDATE charainfo SET Mount = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_INVINCIBLE, "UPDATE charainfo SET InvincibleGM = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CUSTOMIZE, "UPDATE charainfo SET Customize = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELMAINWEAP, "UPDATE charainfo SET ModelMainWeapon = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELSUBWEAP, "UPDATE charainfo SET ModelSubWeapon = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELSYSWEAP, "UPDATE charainfo SET ModelSystemWeapon = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELEQUIP, "UPDATE charainfo SET ModelEquip = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_EMOTEMODETYPE, "UPDATE charainfo SET EmoteModeType = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_FIRSTLOGINTIME, "UPDATE charainfo SET FirstLoginTime = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_LANGUAGE, "UPDATE charainfo SET Language = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_ISNEWGAME, "UPDATE charainfo SET IsNewGame = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_ISNEWADV, "UPDATE charainfo SET IsNewAdventurer = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TERRITORY, "UPDATE charainfo SET TerritoryType = ?, TerritoryId = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_POS, "UPDATE charainfo SET OPosX = ?, OPosY = ?, OPosZ = ?, OPosR = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CLASS, "UPDATE charainfo SET Class = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_STATUS, "UPDATE charainfo SET Status = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TOTALPLAYTIME, "UPDATE charainfo SET TotalPlayTime = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_HOMEPOINT, "UPDATE charainfo SET Homepoint = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_FAVOPOINT, "UPDATE charainfo SET FavoritePoint = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TITLE, "UPDATE charainfo SET ActiveTitle = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TITLELIST, "UPDATE charainfo SET TitleList = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_ACHIEVEMENTS, "UPDATE charainfo SET Achievement = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_AETHERYTE, "UPDATE charainfo SET Aetheryte = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_HOWTO, "UPDATE charainfo SET HowTo = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MINIONS, "UPDATE charainfo SET Minions = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MOUNTS, "UPDATE charainfo SET Mounts = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GEARSET, "UPDATE charainfo SET EquippedMannequin = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CONFIGFLAGS, "UPDATE charainfo SET ConfigFlags = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_QUESTCOMPLETE, "UPDATE charainfo SET QuestCompleteFlags = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_OPENINGSEQ, "UPDATE charainfo SET OpeningSequence = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_QUESTTRACKING, "UPDATE charainfo SET QuestTracking = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GRANDCOMPANY, "UPDATE charainfo SET GrandCompany = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GRANDCOMPANYRANKS, "UPDATE charainfo SET GrandCompanyRank = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_DISCOVERY, "UPDATE charainfo SET Discovery = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GMRANK, "UPDATE charainfo SET GMRank = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_EQUIPDISPLAYFLAGS, "UPDATE charainfo SET EquipDisplayFlags = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_UNLOCKS, "UPDATE charainfo SET Unlocks = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CFPENATLY, "UPDATE charainfo SET CFPenaltyUntil = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
|
||||
/// SEARCH INFO
|
||||
prepareStatement( CHARA_SEARCHINFO_INS, "INSERT INTO charainfosearch (CharacterId, UPDATE_DATE ) VALUES ( ?, NOW() );", CONNECTION_BOTH );
|
||||
prepareStatement( CHARA_SEARCHINFO_UP_SELECTCLASS, "UPDATE charainfosearch SET SelectClassId = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_SEARCHINFO_UP_SELECTREGION, "UPDATE charainfosearch SET SelectRegion = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_SEARCHINFO_UP_SEARCHCOMMENT, "UPDATE charainfosearch SET SearchComment = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_SEARCHINFO_SEL, "SELECT * FROM charainfosearch WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
|
||||
/// QUEST INFO
|
||||
prepareStatement( CHARA_QUEST_INS, "INSERT INTO charaquestnew ( CharacterId, SlotId, QuestId, Sequence, Flags, Variables_0, "
|
||||
"Variables_1, Variables_2, Variables_3, Variables_4, "
|
||||
"Variables_5, Variables_6 ) VALUES( ?,?,?,?,?,?,?,?,?,?,?,? );", CONNECTION_ASYNC );
|
||||
|
||||
prepareStatement( CHARA_QUEST_UP, "UPDATE charaquestnew SET Sequence = ?, Flags = ?, Variables_0 = ?, "
|
||||
"Variables_1 = ?, Variables_2 = ?, Variables_3 = ?, "
|
||||
"Variables_4 = ?, Variables_5 = ?, Variables_6 = ? "
|
||||
"WHERE CharacterId = ? AND QuestId = ?;", CONNECTION_ASYNC );
|
||||
|
||||
prepareStatement( CHARA_QUEST_DEL, "DELETE FROM charaquestnew WHERE CharacterId = ? AND QuestId = ?;", CONNECTION_ASYNC );
|
||||
|
||||
prepareStatement( CHARA_QUEST_SEL, "SELECT * FROM charaquestnew WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
|
||||
/// CLASS INFO
|
||||
prepareStatement( CHARA_CLASS_SEL, "SELECT ClassIdx, Exp, Lvl FROM characlass WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
prepareStatement( CHARA_CLASS_INS, "INSERT INTO characlass ( CharacterId, ClassIdx, Exp, Lvl ) VALUES( ?,?,?,? );", CONNECTION_BOTH );
|
||||
prepareStatement( CHARA_CLASS_UP, "UPDATE characlass SET Exp = ?, Lvl = ? WHERE CharacterId = ? AND ClassIdx = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_CLASS_DEL, "DELETE FROM characlass WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
|
||||
/// INVENTORY INFO
|
||||
prepareStatement( CHARA_ITEMINV_INS, "INSERT INTO charaiteminventory ( CharacterId, storageId, UPDATE_DATE ) VALUES ( ?, ?, NOW() );", CONNECTION_BOTH );
|
||||
|
||||
/// ITEM GLOBAL
|
||||
prepareStatement( CHARA_ITEMGLOBAL_INS, "INSERT INTO charaglobalitem ( CharacterId, ItemId, catalogId, UPDATE_DATE ) VALUES ( ?, ?, ?, NOW() );", CONNECTION_BOTH );
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
#ifndef SAPPHIRE_CHARACONNECTION_H
|
||||
#define SAPPHIRE_CHARACONNECTION_H
|
||||
|
||||
#include "DbConnection.h"
|
||||
|
||||
namespace Core
|
||||
{
|
||||
namespace Db
|
||||
{
|
||||
class DbConnectionInfo;
|
||||
|
||||
enum CharaDbStatements : uint32_t
|
||||
{
|
||||
CHARA_SEL,
|
||||
CHARA_SEL_MINIMAL,
|
||||
CHARA_SEARCHINFO_SEL,
|
||||
CHARA_QUEST_SEL,
|
||||
CHARA_INS,
|
||||
CHARA_UP,
|
||||
CHARA_UP_NAME,
|
||||
CHARA_UP_HPMP,
|
||||
CHARA_UP_MODE,
|
||||
CHARA_UP_MOUNT,
|
||||
CHARA_UP_INVINCIBLE,
|
||||
CHARA_UP_CUSTOMIZE,
|
||||
CHARA_UP_MODELMAINWEAP,
|
||||
CHARA_UP_MODELSUBWEAP,
|
||||
CHARA_UP_MODELSYSWEAP,
|
||||
CHARA_UP_MODELEQUIP,
|
||||
CHARA_UP_EMOTEMODETYPE,
|
||||
CHARA_UP_FIRSTLOGINTIME,
|
||||
CHARA_UP_LANGUAGE,
|
||||
CHARA_UP_ISNEWGAME,
|
||||
CHARA_UP_ISNEWADV,
|
||||
CHARA_UP_TERRITORY,
|
||||
CHARA_UP_POS,
|
||||
CHARA_UP_CLASS,
|
||||
CHARA_UP_STATUS,
|
||||
CHARA_UP_TOTALPLAYTIME,
|
||||
CHARA_UP_HOMEPOINT,
|
||||
CHARA_UP_FAVOPOINT,
|
||||
CHARA_UP_TITLE,
|
||||
CHARA_UP_TITLELIST,
|
||||
CHARA_UP_ACHIEVEMENTS,
|
||||
CHARA_UP_AETHERYTE,
|
||||
CHARA_UP_HOWTO,
|
||||
CHARA_UP_MINIONS,
|
||||
CHARA_UP_MOUNTS,
|
||||
CHARA_UP_GEARSET,
|
||||
CHARA_UP_CONFIGFLAGS,
|
||||
CHARA_UP_QUESTCOMPLETE,
|
||||
CHARA_UP_OPENINGSEQ,
|
||||
CHARA_UP_QUESTTRACKING,
|
||||
CHARA_UP_GRANDCOMPANY,
|
||||
CHARA_UP_GRANDCOMPANYRANKS,
|
||||
CHARA_UP_DISCOVERY,
|
||||
CHARA_UP_GMRANK,
|
||||
CHARA_UP_EQUIPDISPLAYFLAGS,
|
||||
CHARA_UP_UNLOCKS,
|
||||
CHARA_UP_CFPENATLY,
|
||||
CHARA_SEARCHINFO_INS,
|
||||
CHARA_SEARCHINFO_UP_SELECTCLASS,
|
||||
CHARA_SEARCHINFO_UP_SELECTREGION,
|
||||
CHARA_SEARCHINFO_UP_SEARCHCOMMENT,
|
||||
|
||||
CHARA_QUEST_INS,
|
||||
CHARA_QUEST_UP,
|
||||
CHARA_QUEST_DEL,
|
||||
|
||||
CHARA_CLASS_SEL,
|
||||
CHARA_CLASS_INS,
|
||||
CHARA_CLASS_UP,
|
||||
CHARA_CLASS_DEL,
|
||||
|
||||
CHARA_ITEMINV_INS,
|
||||
|
||||
CHARA_ITEMGLOBAL_INS,
|
||||
|
||||
MAX_STATEMENTS
|
||||
};
|
||||
|
||||
class CharaDbConnection : public DbConnection
|
||||
{
|
||||
public:
|
||||
using Statements = CharaDbStatements;
|
||||
|
||||
CharaDbConnection( ConnectionInfo& connInfo );
|
||||
CharaDbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* q, ConnectionInfo &connInfo );
|
||||
|
||||
~CharaDbConnection();
|
||||
|
||||
void doPrepareStatements() override;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif //SAPPHIRE_CHARACONNECTION_H
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
#include <MySqlConnector.h>
|
||||
#include "Database/DbLoader.h"
|
||||
#include "Database/CharaDbConnection.h"
|
||||
#include "Database/ZoneDbConnection.h"
|
||||
#include "Database/DbWorkerPool.h"
|
||||
#include "Database/PreparedStatement.h"
|
||||
|
||||
extern Core::Db::DbWorkerPool< Core::Db::CharaDbConnection > g_charaDb;
|
||||
extern Core::Db::DbWorkerPool< Core::Db::ZoneDbConnection > g_charaDb;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
extern Core::Framework g_fw;
|
||||
|
||||
Core::Db::DbConnection::DbConnection( ConnectionInfo &connInfo ) :
|
||||
Core::Db::DbConnection::DbConnection( ConnectionInfo& connInfo ) :
|
||||
m_reconnecting( false ),
|
||||
m_prepareError( false ),
|
||||
m_queue( nullptr ),
|
||||
|
@ -140,7 +140,8 @@ boost::shared_ptr< Mysql::ResultSet > Core::Db::DbConnection::query( const std::
|
|||
}
|
||||
|
||||
|
||||
boost::shared_ptr< Mysql::ResultSet > Core::Db::DbConnection::query( boost::shared_ptr< Core::Db::PreparedStatement > stmt )
|
||||
boost::shared_ptr< Mysql::ResultSet >
|
||||
Core::Db::DbConnection::query( boost::shared_ptr< Core::Db::PreparedStatement > stmt )
|
||||
{
|
||||
boost::shared_ptr< Mysql::ResultSet > res( nullptr );
|
||||
if( !stmt )
|
||||
|
@ -204,14 +205,14 @@ bool Core::Db::DbConnection::execute( boost::shared_ptr< Core::Db::PreparedState
|
|||
boost::shared_ptr< Mysql::PreparedStatement > Core::Db::DbConnection::getPreparedStatement( uint32_t index )
|
||||
{
|
||||
assert( index < m_stmts.size() );
|
||||
auto ret = m_stmts[index];
|
||||
auto ret = m_stmts[ index ];
|
||||
if( !ret )
|
||||
nullptr;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Core::Db::DbConnection::prepareStatement( uint32_t index, const std::string &sql, Core::Db::ConnectionFlags flags )
|
||||
void Core::Db::DbConnection::prepareStatement( uint32_t index, const std::string& sql, Core::Db::ConnectionFlags flags )
|
||||
{
|
||||
m_queries.insert( PreparedStatementMap::value_type( index, std::make_pair( sql, flags ) ) );
|
||||
|
||||
|
@ -220,7 +221,7 @@ void Core::Db::DbConnection::prepareStatement( uint32_t index, const std::string
|
|||
// to save memory that will not be used.
|
||||
if( !( m_connectionFlags & flags ) )
|
||||
{
|
||||
m_stmts[index].reset();
|
||||
m_stmts[ index ].reset();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -236,7 +237,7 @@ void Core::Db::DbConnection::prepareStatement( uint32_t index, const std::string
|
|||
m_prepareError = true;
|
||||
}
|
||||
|
||||
m_stmts[index] = boost::shared_ptr< Mysql::PreparedStatement >( pStmt );
|
||||
m_stmts[ index ] = boost::shared_ptr< Mysql::PreparedStatement >( pStmt );
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -10,34 +10,37 @@
|
|||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
|
||||
namespace Mysql
|
||||
{
|
||||
class Connection;
|
||||
class ResultSet;
|
||||
class PreparedResultSet;
|
||||
class PreparedStatement;
|
||||
namespace Mysql {
|
||||
class Connection;
|
||||
|
||||
class ResultSet;
|
||||
|
||||
class PreparedResultSet;
|
||||
|
||||
class PreparedStatement;
|
||||
}
|
||||
|
||||
namespace Core
|
||||
{
|
||||
namespace Db
|
||||
{
|
||||
class DatabaseWorker;
|
||||
class PreparedStatement;
|
||||
class Operation;
|
||||
class DbWorker;
|
||||
namespace Core {
|
||||
namespace Db {
|
||||
class DatabaseWorker;
|
||||
|
||||
using PreparedStmtScopedPtr = boost::scoped_ptr< PreparedStatement >;
|
||||
class PreparedStatement;
|
||||
|
||||
enum ConnectionFlags
|
||||
{
|
||||
class Operation;
|
||||
|
||||
class DbWorker;
|
||||
|
||||
using PreparedStmtScopedPtr = boost::scoped_ptr< PreparedStatement >;
|
||||
|
||||
enum ConnectionFlags
|
||||
{
|
||||
CONNECTION_ASYNC = 0x1,
|
||||
CONNECTION_SYNC = 0x2,
|
||||
CONNECTION_BOTH = CONNECTION_ASYNC | CONNECTION_SYNC
|
||||
};
|
||||
};
|
||||
|
||||
struct ConnectionInfo
|
||||
{
|
||||
struct ConnectionInfo
|
||||
{
|
||||
std::string user;
|
||||
std::string password;
|
||||
std::string database;
|
||||
|
@ -45,53 +48,68 @@ namespace Db
|
|||
uint16_t port;
|
||||
uint8_t syncThreads;
|
||||
uint8_t asyncThreads;
|
||||
};
|
||||
};
|
||||
|
||||
using PreparedStatementMap = std::map< uint32_t, std::pair< std::string, ConnectionFlags > >;
|
||||
using PreparedStatementMap = std::map< uint32_t, std::pair< std::string, ConnectionFlags > >;
|
||||
|
||||
class DbConnection : public boost::enable_shared_from_this< DbConnection >
|
||||
{
|
||||
public:
|
||||
class DbConnection :
|
||||
public boost::enable_shared_from_this< DbConnection >
|
||||
{
|
||||
public:
|
||||
// Constructor for synchronous connections.
|
||||
DbConnection( ConnectionInfo& connInfo );
|
||||
|
||||
// Constructor for asynchronous connections.
|
||||
DbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* queue, ConnectionInfo& connInfo );
|
||||
|
||||
virtual ~DbConnection();
|
||||
|
||||
virtual uint32_t open();
|
||||
|
||||
void close();
|
||||
|
||||
bool prepareStatements();
|
||||
|
||||
bool execute( const std::string& sql );
|
||||
|
||||
bool execute( boost::shared_ptr< PreparedStatement > stmt );
|
||||
|
||||
boost::shared_ptr< Mysql::ResultSet > query( const std::string& sql );
|
||||
|
||||
boost::shared_ptr< Mysql::ResultSet > query( boost::shared_ptr< PreparedStatement > stmt );
|
||||
|
||||
void beginTransaction();
|
||||
|
||||
void rollbackTransaction();
|
||||
|
||||
void commitTransaction();
|
||||
|
||||
bool ping();
|
||||
|
||||
uint32_t getLastError();
|
||||
|
||||
bool lockIfReady();
|
||||
|
||||
void unlock();
|
||||
|
||||
boost::shared_ptr< Mysql::Connection > getConnection() { return m_pConnection; }
|
||||
boost::shared_ptr< Mysql::Connection > getConnection()
|
||||
{
|
||||
return m_pConnection;
|
||||
}
|
||||
|
||||
boost::shared_ptr< Mysql::PreparedStatement > getPreparedStatement( uint32_t index );
|
||||
|
||||
void prepareStatement( uint32_t index, const std::string& sql, ConnectionFlags flags );
|
||||
|
||||
virtual void doPrepareStatements() = 0;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
std::vector< boost::shared_ptr< Mysql::PreparedStatement > > m_stmts;
|
||||
PreparedStatementMap m_queries;
|
||||
bool m_reconnecting;
|
||||
bool m_prepareError;
|
||||
|
||||
private:
|
||||
private:
|
||||
LockedWaitQueue< boost::shared_ptr< Operation > >* m_queue;
|
||||
boost::shared_ptr< DbWorker > m_worker;
|
||||
boost::shared_ptr< Mysql::Connection > m_pConnection;
|
||||
|
@ -100,8 +118,9 @@ namespace Db
|
|||
std::mutex m_mutex;
|
||||
|
||||
DbConnection( DbConnection const& right ) = delete;
|
||||
|
||||
DbConnection& operator=( DbConnection const& right ) = delete;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "DbLoader.h"
|
||||
#include <mysqld_error.h>
|
||||
#include "CharaDbConnection.h"
|
||||
#include "ZoneDbConnection.h"
|
||||
#include "DbWorkerPool.h"
|
||||
#include "Logging/Logger.h"
|
||||
#include "Framework.h"
|
||||
|
@ -11,11 +11,11 @@ Core::Db::DbLoader::DbLoader()
|
|||
{
|
||||
}
|
||||
|
||||
template <class T>
|
||||
template< class T >
|
||||
Core::Db::DbLoader& Core::Db::DbLoader::addDb( Core::Db::DbWorkerPool< T >& pool, const ConnectionInfo& info )
|
||||
{
|
||||
|
||||
m_open.push([this, info, &pool]() -> bool
|
||||
m_open.push( [ this, info, &pool ]()->bool
|
||||
{
|
||||
|
||||
auto pLog = g_fw.get< Logger >();
|
||||
|
@ -24,7 +24,8 @@ Core::Db::DbLoader& Core::Db::DbLoader::addDb( Core::Db::DbWorkerPool< T >& pool
|
|||
|
||||
if( asyncThreads < 1 || asyncThreads > 32 )
|
||||
{
|
||||
pLog->error( "database: invalid number of worker threads specified. Please pick a value between 1 and 32." );
|
||||
pLog->error(
|
||||
"database: invalid number of worker threads specified. Please pick a value between 1 and 32." );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -44,12 +45,13 @@ Core::Db::DbLoader& Core::Db::DbLoader::addDb( Core::Db::DbWorkerPool< T >& pool
|
|||
}
|
||||
}
|
||||
|
||||
m_close.push( [&pool] { pool.close(); } );
|
||||
m_close.push( [ &pool ]
|
||||
{ pool.close(); } );
|
||||
return true;
|
||||
});
|
||||
} );
|
||||
|
||||
|
||||
m_prepare.push([this, info, &pool]() -> bool
|
||||
m_prepare.push( [ this, info, &pool ]()->bool
|
||||
{
|
||||
if( !pool.prepareStatements() )
|
||||
{
|
||||
|
@ -58,7 +60,7 @@ Core::Db::DbLoader& Core::Db::DbLoader::addDb( Core::Db::DbWorkerPool< T >& pool
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
} );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
@ -107,6 +109,6 @@ bool Core::Db::DbLoader::process( std::queue< Predicate >& queue )
|
|||
|
||||
template
|
||||
Core::Db::DbLoader&
|
||||
Core::Db::DbLoader::addDb< Core::Db::CharaDbConnection >( Core::Db::DbWorkerPool< Core::Db::CharaDbConnection >&,
|
||||
Core::Db::DbLoader::addDb< Core::Db::ZoneDbConnection >( Core::Db::DbWorkerPool< Core::Db::ZoneDbConnection >&,
|
||||
const ConnectionInfo& );
|
||||
|
||||
|
|
|
@ -8,17 +8,15 @@
|
|||
#include <string>
|
||||
#include "DbConnection.h"
|
||||
|
||||
namespace Core
|
||||
namespace Core {
|
||||
namespace Db {
|
||||
|
||||
template< class T >
|
||||
class DbWorkerPool;
|
||||
|
||||
class DbLoader
|
||||
{
|
||||
namespace Db
|
||||
{
|
||||
|
||||
template< class T >
|
||||
class DbWorkerPool;
|
||||
|
||||
class DbLoader
|
||||
{
|
||||
public:
|
||||
public:
|
||||
DbLoader();
|
||||
|
||||
template< class T >
|
||||
|
@ -33,8 +31,9 @@ namespace Core
|
|||
DATABASE_MASK_ALL = DATABASE_CHARACTER
|
||||
};
|
||||
|
||||
private:
|
||||
private:
|
||||
bool openDatabases();
|
||||
|
||||
bool prepareStatements();
|
||||
|
||||
using Predicate = std::function< bool() >;
|
||||
|
@ -45,7 +44,7 @@ namespace Core
|
|||
std::queue< Predicate > m_open;
|
||||
std::queue< Predicate > m_prepare;
|
||||
std::stack< Closer > m_close;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,34 +6,35 @@
|
|||
#include "Util/LockedWaitQueue.h"
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
namespace Core
|
||||
{
|
||||
namespace Db
|
||||
{
|
||||
class DbConnection;
|
||||
class Operation;
|
||||
namespace Core {
|
||||
namespace Db {
|
||||
class DbConnection;
|
||||
|
||||
class DbWorker
|
||||
{
|
||||
public:
|
||||
class Operation;
|
||||
|
||||
class DbWorker
|
||||
{
|
||||
public:
|
||||
DbWorker( LockedWaitQueue< boost::shared_ptr< Operation > >* newQueue, DbConnection* connection );
|
||||
|
||||
~DbWorker();
|
||||
|
||||
private:
|
||||
private:
|
||||
LockedWaitQueue< boost::shared_ptr< Operation > >* m_queue;
|
||||
DbConnection* m_pConn;
|
||||
|
||||
void workerThread();
|
||||
|
||||
std::thread m_workerThread;
|
||||
|
||||
std::atomic< bool > m_cancelationToken;
|
||||
|
||||
DbWorker( DbWorker const& right ) = delete;
|
||||
DbWorker& operator=( DbWorker const& right ) = delete;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
DbWorker& operator=( DbWorker const& right ) = delete;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif //SAPPHIRE_DBWORKER_H
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <MySqlConnector.h>
|
||||
#include "StatementTask.h"
|
||||
#include "Operation.h"
|
||||
#include "CharaDbConnection.h"
|
||||
#include "ZoneDbConnection.h"
|
||||
#include <boost/make_shared.hpp>
|
||||
#include "Framework.h"
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
|||
|
||||
extern Core::Framework g_fw;
|
||||
|
||||
class PingOperation : public Core::Db::Operation
|
||||
class PingOperation :
|
||||
public Core::Db::Operation
|
||||
{
|
||||
bool execute() override
|
||||
{
|
||||
|
@ -22,8 +23,9 @@ class PingOperation : public Core::Db::Operation
|
|||
};
|
||||
|
||||
template< class T >
|
||||
Core::Db::DbWorkerPool<T>::DbWorkerPool()
|
||||
: m_queue( new Core::LockedWaitQueue< boost::shared_ptr< Operation > >() ),
|
||||
Core::Db::DbWorkerPool< T >::DbWorkerPool()
|
||||
:
|
||||
m_queue( new Core::LockedWaitQueue< boost::shared_ptr< Operation > >() ),
|
||||
m_asyncThreads( 0 ),
|
||||
m_synchThreads( 0 )
|
||||
{
|
||||
|
@ -38,7 +40,7 @@ Core::Db::DbWorkerPool< T >::~DbWorkerPool()
|
|||
template< class T >
|
||||
void Core::Db::DbWorkerPool< T >::setConnectionInfo( const ConnectionInfo& info,
|
||||
uint8_t asyncThreads,
|
||||
uint8_t synchThreads)
|
||||
uint8_t synchThreads )
|
||||
{
|
||||
m_connectionInfo = info;
|
||||
m_asyncThreads = asyncThreads;
|
||||
|
@ -63,7 +65,7 @@ uint32_t Core::Db::DbWorkerPool< T >::open()
|
|||
if( !error )
|
||||
{
|
||||
pLog->info( "[DbPool] DatabasePool " + getDatabaseName() + " opened successfully. " +
|
||||
std::to_string( ( m_connections[IDX_SYNCH].size() + m_connections[IDX_ASYNC].size() ) ) +
|
||||
std::to_string( ( m_connections[ IDX_SYNCH ].size() + m_connections[ IDX_ASYNC ].size() ) ) +
|
||||
" total connections running." );
|
||||
}
|
||||
|
||||
|
@ -74,14 +76,14 @@ template< class T >
|
|||
void Core::Db::DbWorkerPool< T >::close()
|
||||
{
|
||||
auto pLog = g_fw.get< Logger >();
|
||||
pLog->info("[DbPool] Closing down DatabasePool " + getDatabaseName() );
|
||||
m_connections[IDX_ASYNC].clear();
|
||||
m_connections[IDX_SYNCH].clear();
|
||||
pLog->info("[DbPool] All connections on DatabasePool " + getDatabaseName() + "closed." );
|
||||
pLog->info( "[DbPool] Closing down DatabasePool " + getDatabaseName() );
|
||||
m_connections[ IDX_ASYNC ].clear();
|
||||
m_connections[ IDX_SYNCH ].clear();
|
||||
pLog->info( "[DbPool] All connections on DatabasePool " + getDatabaseName() + "closed." );
|
||||
}
|
||||
|
||||
template< class T >
|
||||
bool Core::Db::DbWorkerPool<T>::prepareStatements()
|
||||
bool Core::Db::DbWorkerPool< T >::prepareStatements()
|
||||
{
|
||||
for( auto& connections : m_connections )
|
||||
for( auto& connection : connections )
|
||||
|
@ -101,7 +103,8 @@ bool Core::Db::DbWorkerPool<T>::prepareStatements()
|
|||
}
|
||||
|
||||
template< class T >
|
||||
boost::shared_ptr< Mysql::ResultSet > Core::Db::DbWorkerPool< T >::query( const std::string& sql, boost::shared_ptr< T > connection )
|
||||
boost::shared_ptr< Mysql::ResultSet >
|
||||
Core::Db::DbWorkerPool< T >::query( const std::string& sql, boost::shared_ptr< T > connection )
|
||||
{
|
||||
if( !connection )
|
||||
connection = getFreeConnection();
|
||||
|
@ -113,7 +116,8 @@ boost::shared_ptr< Mysql::ResultSet > Core::Db::DbWorkerPool< T >::query( const
|
|||
}
|
||||
|
||||
template< class T >
|
||||
boost::shared_ptr< Mysql::PreparedResultSet > Core::Db::DbWorkerPool< T >::query( boost::shared_ptr< PreparedStatement > stmt )
|
||||
boost::shared_ptr< Mysql::PreparedResultSet >
|
||||
Core::Db::DbWorkerPool< T >::query( boost::shared_ptr< PreparedStatement > stmt )
|
||||
{
|
||||
auto connection = getFreeConnection();
|
||||
auto ret = boost::static_pointer_cast< Mysql::PreparedResultSet >( connection->query( stmt ) );
|
||||
|
@ -123,7 +127,8 @@ boost::shared_ptr< Mysql::PreparedResultSet > Core::Db::DbWorkerPool< T >::query
|
|||
}
|
||||
|
||||
template< class T >
|
||||
boost::shared_ptr< Core::Db::PreparedStatement > Core::Db::DbWorkerPool< T >::getPreparedStatement( PreparedStatementIndex index )
|
||||
boost::shared_ptr< Core::Db::PreparedStatement >
|
||||
Core::Db::DbWorkerPool< T >::getPreparedStatement( PreparedStatementIndex index )
|
||||
{
|
||||
return boost::make_shared< PreparedStatement >( index );
|
||||
}
|
||||
|
@ -143,7 +148,7 @@ void Core::Db::DbWorkerPool< T >::escapeString( std::string& str )
|
|||
template< class T >
|
||||
void Core::Db::DbWorkerPool< T >::keepAlive()
|
||||
{
|
||||
for( auto& connection : m_connections[IDX_SYNCH] )
|
||||
for( auto& connection : m_connections[ IDX_SYNCH ] )
|
||||
{
|
||||
if( connection->lockIfReady() )
|
||||
{
|
||||
|
@ -152,7 +157,7 @@ void Core::Db::DbWorkerPool< T >::keepAlive()
|
|||
}
|
||||
}
|
||||
|
||||
const auto count = m_connections[IDX_ASYNC].size();
|
||||
const auto count = m_connections[ IDX_ASYNC ].size();
|
||||
for( uint8_t i = 0; i < count; ++i )
|
||||
enqueue( boost::make_shared< PingOperation >() );
|
||||
}
|
||||
|
@ -163,8 +168,9 @@ uint32_t Core::Db::DbWorkerPool< T >::openConnections( InternalIndex type, uint8
|
|||
for( uint8_t i = 0; i < numConnections; ++i )
|
||||
{
|
||||
// Create the connection
|
||||
auto connection = [&] {
|
||||
switch (type)
|
||||
auto connection = [ & ]
|
||||
{
|
||||
switch( type )
|
||||
{
|
||||
case IDX_ASYNC:
|
||||
return boost::make_shared< T >( m_queue.get(), m_connectionInfo );
|
||||
|
@ -178,23 +184,23 @@ uint32_t Core::Db::DbWorkerPool< T >::openConnections( InternalIndex type, uint8
|
|||
if( uint32_t error = connection->open() )
|
||||
{
|
||||
// Failed to open a connection or invalid version, abort and cleanup
|
||||
m_connections[type].clear();
|
||||
m_connections[ type ].clear();
|
||||
return error;
|
||||
}
|
||||
m_connections[type].push_back( connection );
|
||||
m_connections[ type ].push_back( connection );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template< class T >
|
||||
unsigned long Core::Db::DbWorkerPool< T >::escapeString( char *to, const char *from, unsigned long length )
|
||||
unsigned long Core::Db::DbWorkerPool< T >::escapeString( char* to, const char* from, unsigned long length )
|
||||
{
|
||||
if( !to || !from || !length )
|
||||
return 0;
|
||||
|
||||
return mysql_real_escape_string(
|
||||
m_connections[IDX_SYNCH].front()->getConnection()->getRawCon(), to, from, length );
|
||||
m_connections[ IDX_SYNCH ].front()->getConnection()->getRawCon(), to, from, length );
|
||||
}
|
||||
|
||||
template< class T >
|
||||
|
@ -207,12 +213,12 @@ template< class T >
|
|||
boost::shared_ptr< T > Core::Db::DbWorkerPool< T >::getFreeConnection()
|
||||
{
|
||||
uint8_t i = 0;
|
||||
const auto numCons = m_connections[IDX_SYNCH].size();
|
||||
const auto numCons = m_connections[ IDX_SYNCH ].size();
|
||||
boost::shared_ptr< T > connection = nullptr;
|
||||
|
||||
while( true )
|
||||
{
|
||||
connection = m_connections[IDX_SYNCH][i++ % numCons];
|
||||
connection = m_connections[ IDX_SYNCH ][ i++ % numCons ];
|
||||
|
||||
if( connection->lockIfReady() )
|
||||
break;
|
||||
|
@ -277,4 +283,5 @@ void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction& trans, PreparedState
|
|||
}
|
||||
*/
|
||||
|
||||
template class Core::Db::DbWorkerPool< Core::Db::CharaDbConnection >;
|
||||
template
|
||||
class Core::Db::DbWorkerPool< Core::Db::ZoneDbConnection >;
|
||||
|
|
|
@ -7,15 +7,17 @@
|
|||
#include <ResultSet.h>
|
||||
#include "Util/LockedWaitQueue.h"
|
||||
#include "DbConnection.h"
|
||||
namespace Core
|
||||
{
|
||||
namespace Db
|
||||
{
|
||||
|
||||
namespace Core {
|
||||
namespace Db {
|
||||
|
||||
template< typename T >
|
||||
class LockedWaitQueue;
|
||||
|
||||
class Operation;
|
||||
|
||||
class PreparedStatement;
|
||||
|
||||
struct ConnectionInfo;
|
||||
|
||||
template< class T >
|
||||
|
@ -34,7 +36,7 @@ public:
|
|||
|
||||
~DbWorkerPool();
|
||||
|
||||
void setConnectionInfo( const ConnectionInfo& info, uint8_t asyncThreads, uint8_t synchThreads);
|
||||
void setConnectionInfo( const ConnectionInfo& info, uint8_t asyncThreads, uint8_t synchThreads );
|
||||
|
||||
uint32_t open();
|
||||
|
||||
|
@ -49,12 +51,17 @@ public:
|
|||
|
||||
// Async execution
|
||||
void execute( const std::string& sql );
|
||||
|
||||
void execute( boost::shared_ptr< PreparedStatement > stmt );
|
||||
|
||||
// Sync execution
|
||||
void directExecute( const std::string& sql );
|
||||
|
||||
void directExecute( boost::shared_ptr< PreparedStatement > stmt );
|
||||
boost::shared_ptr< Mysql::ResultSet > query( const std::string& sql, boost::shared_ptr< T > connection = nullptr );
|
||||
|
||||
boost::shared_ptr< Mysql::ResultSet >
|
||||
query( const std::string& sql, boost::shared_ptr< T > connection = nullptr );
|
||||
|
||||
boost::shared_ptr< Mysql::PreparedResultSet > query( boost::shared_ptr< PreparedStatement > stmt );
|
||||
|
||||
using PreparedStatementIndex = typename T::Statements;
|
||||
|
@ -68,7 +75,7 @@ public:
|
|||
private:
|
||||
uint32_t openConnections( InternalIndex type, uint8_t numConnections );
|
||||
|
||||
unsigned long escapeString( char *to, const char *from, unsigned long length );
|
||||
unsigned long escapeString( char* to, const char* from, unsigned long length );
|
||||
|
||||
void enqueue( boost::shared_ptr< Operation > op );
|
||||
|
||||
|
|
|
@ -1,38 +1,48 @@
|
|||
#ifndef SAPPHIRE_OPERATION_H
|
||||
#define SAPPHIRE_OPERATION_H
|
||||
|
||||
namespace Mysql
|
||||
{
|
||||
class Connection;
|
||||
namespace Mysql {
|
||||
class Connection;
|
||||
}
|
||||
|
||||
namespace Core
|
||||
{
|
||||
namespace Db
|
||||
{
|
||||
class DbConnection;
|
||||
class PreparedStatement;
|
||||
namespace Core {
|
||||
namespace Db {
|
||||
class DbConnection;
|
||||
|
||||
class Operation
|
||||
class PreparedStatement;
|
||||
|
||||
class Operation
|
||||
{
|
||||
public:
|
||||
Operation() :
|
||||
m_pConn( nullptr )
|
||||
{
|
||||
public:
|
||||
Operation() : m_pConn( nullptr ) { }
|
||||
virtual ~Operation() { }
|
||||
}
|
||||
|
||||
virtual ~Operation()
|
||||
{
|
||||
}
|
||||
|
||||
virtual int call()
|
||||
{
|
||||
execute();
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual bool execute() = 0;
|
||||
virtual void setConnection( DbConnection* pCon ) { m_pConn = pCon; }
|
||||
|
||||
virtual void setConnection( DbConnection* pCon )
|
||||
{
|
||||
m_pConn = pCon;
|
||||
}
|
||||
|
||||
DbConnection* m_pConn;
|
||||
|
||||
private:
|
||||
private:
|
||||
Operation( Operation const& right ) = delete;
|
||||
|
||||
Operation& operator=( Operation const& right ) = delete;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -8,9 +8,13 @@
|
|||
|
||||
Core::Db::PreparedStatement::PreparedStatement( uint32_t index ) :
|
||||
m_stmt( nullptr ),
|
||||
m_index( index ) { }
|
||||
m_index( index )
|
||||
{
|
||||
}
|
||||
|
||||
Core::Db::PreparedStatement::~PreparedStatement() { }
|
||||
Core::Db::PreparedStatement::~PreparedStatement()
|
||||
{
|
||||
}
|
||||
|
||||
void Core::Db::PreparedStatement::bindParameters()
|
||||
{
|
||||
|
@ -19,34 +23,34 @@ void Core::Db::PreparedStatement::bindParameters()
|
|||
uint8_t i = 1;
|
||||
for( ; i < m_statementData.size(); i++ )
|
||||
{
|
||||
switch( m_statementData[i].type)
|
||||
switch( m_statementData[ i ].type )
|
||||
{
|
||||
case TYPE_BOOL:
|
||||
m_stmt->setBoolean( i, m_statementData[i].data.boolean );
|
||||
m_stmt->setBoolean( i, m_statementData[ i ].data.boolean );
|
||||
break;
|
||||
case TYPE_UI:
|
||||
m_stmt->setUInt( i, m_statementData[i].data.ui32 );
|
||||
m_stmt->setUInt( i, m_statementData[ i ].data.ui32 );
|
||||
break;
|
||||
case TYPE_I:
|
||||
m_stmt->setInt( i, m_statementData[i].data.i32 );
|
||||
m_stmt->setInt( i, m_statementData[ i ].data.i32 );
|
||||
break;
|
||||
case TYPE_UI64:
|
||||
m_stmt->setUInt64( i, m_statementData[i].data.ui64 );
|
||||
m_stmt->setUInt64( i, m_statementData[ i ].data.ui64 );
|
||||
break;
|
||||
case TYPE_I64:
|
||||
m_stmt->setInt64( i, m_statementData[i].data.i64 );
|
||||
m_stmt->setInt64( i, m_statementData[ i ].data.i64 );
|
||||
break;
|
||||
case TYPE_DOUBLE:
|
||||
m_stmt->setDouble( i, m_statementData[i].data.d );
|
||||
m_stmt->setDouble( i, m_statementData[ i ].data.d );
|
||||
break;
|
||||
case TYPE_STRING:
|
||||
m_stmt->setString( i, std::string( reinterpret_cast< char* >( m_statementData[i].binary.data() ) ) );
|
||||
m_stmt->setString( i, std::string( reinterpret_cast< char* >( m_statementData[ i ].binary.data() ) ) );
|
||||
break;
|
||||
case TYPE_BINARY:
|
||||
{
|
||||
std::stringstream *is = new std::stringstream;
|
||||
std::stringstream* is = new std::stringstream;
|
||||
|
||||
for( auto entry : m_statementData[i].binary )
|
||||
for( auto entry : m_statementData[ i ].binary )
|
||||
is->rdbuf()->sputc( static_cast< char > ( entry ) );
|
||||
|
||||
m_stmt->setBlob( i, is );
|
||||
|
@ -65,17 +69,17 @@ void Core::Db::PreparedStatement::setBool( uint8_t index, const bool value )
|
|||
if( index >= m_statementData.size() )
|
||||
m_statementData.resize( index + 1 );
|
||||
|
||||
m_statementData[index].data.boolean = value;
|
||||
m_statementData[index].type = TYPE_BOOL;
|
||||
m_statementData[ index ].data.boolean = value;
|
||||
m_statementData[ index ].type = TYPE_BOOL;
|
||||
}
|
||||
|
||||
void Core::Db::PreparedStatement::setUInt( uint8_t index, uint32_t value )
|
||||
{
|
||||
if( index >= m_statementData.size() )
|
||||
m_statementData.resize(index+1);
|
||||
m_statementData.resize( index + 1 );
|
||||
|
||||
m_statementData[index].data.ui32 = value;
|
||||
m_statementData[index].type = TYPE_UI;
|
||||
m_statementData[ index ].data.ui32 = value;
|
||||
m_statementData[ index ].type = TYPE_UI;
|
||||
}
|
||||
|
||||
void Core::Db::PreparedStatement::setUInt64( uint8_t index, uint64_t value )
|
||||
|
@ -83,8 +87,8 @@ void Core::Db::PreparedStatement::setUInt64( uint8_t index, uint64_t value )
|
|||
if( index >= m_statementData.size() )
|
||||
m_statementData.resize( index + 1 );
|
||||
|
||||
m_statementData[index].data.ui64 = value;
|
||||
m_statementData[index].type = TYPE_UI64;
|
||||
m_statementData[ index ].data.ui64 = value;
|
||||
m_statementData[ index ].type = TYPE_UI64;
|
||||
}
|
||||
|
||||
void Core::Db::PreparedStatement::setInt( uint8_t index, int32_t value )
|
||||
|
@ -92,17 +96,17 @@ void Core::Db::PreparedStatement::setInt( uint8_t index, int32_t value )
|
|||
if( index >= m_statementData.size() )
|
||||
m_statementData.resize( index + 1 );
|
||||
|
||||
m_statementData[index].data.i32 = value;
|
||||
m_statementData[index].type = TYPE_I;
|
||||
m_statementData[ index ].data.i32 = value;
|
||||
m_statementData[ index ].type = TYPE_I;
|
||||
}
|
||||
|
||||
void Core::Db::PreparedStatement::setInt64( uint8_t index, int64_t value )
|
||||
{
|
||||
if( index >= m_statementData.size() )
|
||||
m_statementData.resize( index + 1);
|
||||
m_statementData.resize( index + 1 );
|
||||
|
||||
m_statementData[index].data.i64 = value;
|
||||
m_statementData[index].type = TYPE_I64;
|
||||
m_statementData[ index ].data.i64 = value;
|
||||
m_statementData[ index ].type = TYPE_I64;
|
||||
}
|
||||
|
||||
void Core::Db::PreparedStatement::setDouble( uint8_t index, double value )
|
||||
|
@ -110,8 +114,8 @@ void Core::Db::PreparedStatement::setDouble( uint8_t index, double value )
|
|||
if( index >= m_statementData.size() )
|
||||
m_statementData.resize( index + 1 );
|
||||
|
||||
m_statementData[index].data.d = value;
|
||||
m_statementData[index].type = TYPE_DOUBLE;
|
||||
m_statementData[ index ].data.d = value;
|
||||
m_statementData[ index ].type = TYPE_DOUBLE;
|
||||
}
|
||||
|
||||
void Core::Db::PreparedStatement::setString( uint8_t index, const std::string& value )
|
||||
|
@ -119,9 +123,9 @@ void Core::Db::PreparedStatement::setString( uint8_t index, const std::string& v
|
|||
if( index >= m_statementData.size() )
|
||||
m_statementData.resize( index + 1 );
|
||||
|
||||
m_statementData[index].binary.resize( value.length() + 1 );
|
||||
memcpy( m_statementData[index].binary.data(), value.c_str(), value.length() + 1 );
|
||||
m_statementData[index].type = TYPE_STRING;
|
||||
m_statementData[ index ].binary.resize( value.length() + 1 );
|
||||
memcpy( m_statementData[ index ].binary.data(), value.c_str(), value.length() + 1 );
|
||||
m_statementData[ index ].type = TYPE_STRING;
|
||||
}
|
||||
|
||||
void Core::Db::PreparedStatement::setBinary( uint8_t index, const std::vector< uint8_t >& value )
|
||||
|
@ -129,8 +133,8 @@ void Core::Db::PreparedStatement::setBinary( uint8_t index, const std::vector< u
|
|||
if( index >= m_statementData.size() )
|
||||
m_statementData.resize( index + 1 );
|
||||
|
||||
m_statementData[index].binary = value;
|
||||
m_statementData[index].type = TYPE_BINARY;
|
||||
m_statementData[ index ].binary = value;
|
||||
m_statementData[ index ].type = TYPE_BINARY;
|
||||
}
|
||||
|
||||
void Core::Db::PreparedStatement::setNull( uint8_t index )
|
||||
|
@ -138,7 +142,7 @@ void Core::Db::PreparedStatement::setNull( uint8_t index )
|
|||
if( index >= m_statementData.size() )
|
||||
m_statementData.resize( index + 1 );
|
||||
|
||||
m_statementData[index].type = TYPE_NULL;
|
||||
m_statementData[ index ].type = TYPE_NULL;
|
||||
}
|
||||
|
||||
uint32_t Core::Db::PreparedStatement::getIndex() const
|
||||
|
@ -146,7 +150,7 @@ uint32_t Core::Db::PreparedStatement::getIndex() const
|
|||
return m_index;
|
||||
}
|
||||
|
||||
void Core::Db::PreparedStatement::setMysqlPS( boost::shared_ptr< Mysql::PreparedStatement> pStmt )
|
||||
void Core::Db::PreparedStatement::setMysqlPS( boost::shared_ptr< Mysql::PreparedStatement > pStmt )
|
||||
{
|
||||
m_stmt = pStmt;
|
||||
}
|
||||
|
|
|
@ -1,32 +1,30 @@
|
|||
#ifndef SAPPHIRE_PREPAREDSTATEMENT_H
|
||||
#define SAPPHIRE_PREPAREDSTATEMENT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include "Operation.h"
|
||||
|
||||
namespace Mysql
|
||||
{
|
||||
class PreparedStatement;
|
||||
namespace Mysql {
|
||||
class PreparedStatement;
|
||||
}
|
||||
|
||||
namespace Core
|
||||
namespace Core {
|
||||
namespace Db {
|
||||
union PreparedStatementDataUnion
|
||||
{
|
||||
namespace Db
|
||||
{
|
||||
union PreparedStatementDataUnion
|
||||
{
|
||||
bool boolean;
|
||||
uint32_t ui32;
|
||||
int32_t i32;
|
||||
uint64_t ui64;
|
||||
int64_t i64;
|
||||
double d;
|
||||
};
|
||||
};
|
||||
|
||||
enum PreparedStatementValueType
|
||||
{
|
||||
enum PreparedStatementValueType
|
||||
{
|
||||
TYPE_BOOL,
|
||||
TYPE_UI,
|
||||
TYPE_UI64,
|
||||
|
@ -36,49 +34,59 @@ namespace Db
|
|||
TYPE_STRING,
|
||||
TYPE_BINARY,
|
||||
TYPE_NULL
|
||||
};
|
||||
};
|
||||
|
||||
struct PreparedStatementData
|
||||
{
|
||||
struct PreparedStatementData
|
||||
{
|
||||
PreparedStatementDataUnion data;
|
||||
PreparedStatementValueType type;
|
||||
std::vector< uint8_t > binary;
|
||||
};
|
||||
};
|
||||
|
||||
class PreparedStatement
|
||||
{
|
||||
public:
|
||||
class PreparedStatement
|
||||
{
|
||||
public:
|
||||
explicit PreparedStatement( uint32_t index );
|
||||
|
||||
~PreparedStatement();
|
||||
|
||||
void setBool( uint8_t index, bool value );
|
||||
|
||||
void setUInt( uint8_t index, uint32_t value );
|
||||
|
||||
void setUInt64( uint8_t index, uint64_t value );
|
||||
|
||||
void setInt( uint8_t index, int32_t value );
|
||||
|
||||
void setInt64( uint8_t index, int64_t value );
|
||||
|
||||
void setDouble( uint8_t index, double value );
|
||||
|
||||
void setString( uint8_t index, const std::string& value );
|
||||
|
||||
void setBinary( uint8_t index, const std::vector< uint8_t >& value );
|
||||
|
||||
void setNull( uint8_t index );
|
||||
|
||||
uint32_t getIndex() const;
|
||||
|
||||
void setMysqlPS( boost::shared_ptr< Mysql::PreparedStatement > pStmt );
|
||||
|
||||
void bindParameters();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
boost::shared_ptr< Mysql::PreparedStatement > m_stmt;
|
||||
uint32_t m_index;
|
||||
std::vector< PreparedStatementData > m_statementData;
|
||||
|
||||
PreparedStatement( PreparedStatement const& right ) = delete;
|
||||
|
||||
PreparedStatement& operator=( PreparedStatement const& right ) = delete;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif //SAPPHIRE_PREPAREDSTATEMENT_H
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "DbConnection.h"
|
||||
#include "PreparedStatement.h"
|
||||
|
||||
Core::Db::StatementTask::StatementTask( const std::string &sql, bool async )
|
||||
Core::Db::StatementTask::StatementTask( const std::string& sql, bool async )
|
||||
{
|
||||
m_sql = sql;
|
||||
m_hasResult = async; // If the operation is async, then there's a result
|
||||
|
@ -38,10 +38,10 @@ bool Core::Db::StatementTask::execute()
|
|||
}
|
||||
|
||||
|
||||
|
||||
Core::Db::PreparedStatementTask::PreparedStatementTask( boost::shared_ptr< Core::Db::PreparedStatement > stmt, bool async ) :
|
||||
m_stmt(stmt)
|
||||
//, m_result(nullptr)
|
||||
Core::Db::PreparedStatementTask::PreparedStatementTask( boost::shared_ptr< Core::Db::PreparedStatement > stmt,
|
||||
bool async ) :
|
||||
m_stmt( stmt )
|
||||
//, m_result(nullptr)
|
||||
{
|
||||
m_hasResult = async; // If the operation is async, then there's a result
|
||||
}
|
||||
|
|
|
@ -5,15 +5,14 @@
|
|||
#include <boost/shared_ptr.hpp>
|
||||
#include "Operation.h"
|
||||
|
||||
namespace Core
|
||||
{
|
||||
namespace Db
|
||||
{
|
||||
class PreparedStatement;
|
||||
namespace Core {
|
||||
namespace Db {
|
||||
class PreparedStatement;
|
||||
|
||||
class StatementTask : public Operation
|
||||
{
|
||||
public:
|
||||
class StatementTask :
|
||||
public Operation
|
||||
{
|
||||
public:
|
||||
|
||||
StatementTask( const std::string& sql, bool async = false );
|
||||
|
||||
|
@ -26,26 +25,28 @@ namespace Db
|
|||
// return m_result->get_future();
|
||||
// }
|
||||
|
||||
private:
|
||||
private:
|
||||
std::string m_sql;
|
||||
bool m_hasResult;
|
||||
// QueryResultPromise *m_result;
|
||||
};
|
||||
};
|
||||
|
||||
class PreparedStatementTask :
|
||||
public Operation
|
||||
{
|
||||
public:
|
||||
PreparedStatementTask( boost::shared_ptr< PreparedStatement > stmt, bool async = false );
|
||||
|
||||
class PreparedStatementTask : public Operation
|
||||
{
|
||||
public:
|
||||
PreparedStatementTask( boost::shared_ptr< PreparedStatement > stmt, bool async = false);
|
||||
~PreparedStatementTask();
|
||||
|
||||
bool execute() override;
|
||||
//PreparedQueryResultFuture getFuture() { return m_result->get_future(); }
|
||||
|
||||
protected:
|
||||
protected:
|
||||
boost::shared_ptr< PreparedStatement > m_stmt;
|
||||
bool m_hasResult;
|
||||
//PreparedQueryResultPromise* m_result;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
|
193
src/common/Database/ZoneDbConnection.cpp
Normal file
193
src/common/Database/ZoneDbConnection.cpp
Normal file
|
@ -0,0 +1,193 @@
|
|||
#include "ZoneDbConnection.h"
|
||||
#include <MySqlConnector.h>
|
||||
|
||||
Core::Db::ZoneDbConnection::ZoneDbConnection( ConnectionInfo& connInfo ) :
|
||||
DbConnection( connInfo )
|
||||
{
|
||||
}
|
||||
|
||||
Core::Db::ZoneDbConnection::ZoneDbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* q,
|
||||
ConnectionInfo& connInfo ) :
|
||||
DbConnection( q, connInfo )
|
||||
{
|
||||
}
|
||||
|
||||
Core::Db::ZoneDbConnection::~ZoneDbConnection()
|
||||
{
|
||||
}
|
||||
|
||||
void Core::Db::ZoneDbConnection::doPrepareStatements()
|
||||
{
|
||||
if( !m_reconnecting )
|
||||
m_stmts.resize( MAX_STATEMENTS );
|
||||
|
||||
/// CHARA
|
||||
prepareStatement( CHARA_SEL, "SELECT ContentId, Name, Hp, Mp, Tp, Gp, Mode, Mount, InvincibleGM, Voice, "
|
||||
"Customize, ModelMainWeapon, ModelSubWeapon, ModelSystemWeapon, "
|
||||
"ModelEquip, EmoteModeType, FirstLoginTime, Language, IsNewGame, "
|
||||
"IsNewAdventurer, TerritoryType, TerritoryId, PosX, PosY, PosZ, PosR, "
|
||||
"OTerritoryType, OTerritoryId, OPosX, OPosY, OPosZ, OPosR, GuardianDeity, "
|
||||
"BirthDay, BirthMonth, Class, Status, TotalPlayTime, FirstClass, HomePoint, "
|
||||
"FavoritePoint, RestPoint, StartTown, ActiveTitle, TitleList, Achievement, "
|
||||
"Aetheryte, HowTo, Minions, Mounts, Orchestrion, EquippedMannequin, ConfigFlags, "
|
||||
"QuestCompleteFlags, OpeningSequence, QuestTracking, GrandCompany, "
|
||||
"GrandCompanyRank, Discovery, GMRank, EquipDisplayFlags, Unlocks, CFPenaltyUntil, "
|
||||
"Pose "
|
||||
"FROM charainfo WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
|
||||
|
||||
prepareStatement( CHARA_UP,
|
||||
"UPDATE charainfo SET "
|
||||
"Hp = ?, Mp = ?, Tp = ?, Gp = ?, Mode = ?, Mount = ?, InvincibleGM = ?, Voice = ?, "
|
||||
"Customize = ?, ModelMainWeapon = ?, ModelSubWeapon = ?, ModelSystemWeapon = ?, "
|
||||
"ModelEquip = ?, EmoteModeType = ?, Language = ?, IsNewGame = ?, IsNewAdventurer = ?, "
|
||||
"TerritoryType = ?, TerritoryId = ?, PosX = ?, PosY = ?, PosZ = ?, PosR = ?, "
|
||||
"OTerritoryType = ?, OTerritoryId = ?, OPosX = ?, OPosY = ?, OPosZ = ?, OPosR = ?, "
|
||||
"Class = ?, Status = ?, TotalPlayTime = ?, HomePoint = ?, FavoritePoint = ?, RestPoint = ?, "
|
||||
"ActiveTitle = ?, TitleList = ?, Achievement = ?, Aetheryte = ?, HowTo = ?, Minions = ?, Mounts = ?, Orchestrion = ?, "
|
||||
"EquippedMannequin = ?, ConfigFlags = ?, QuestCompleteFlags = ?, OpeningSequence = ?, "
|
||||
"QuestTracking = ?, GrandCompany = ?, GrandCompanyRank = ?, Discovery = ?, GMRank = ?, EquipDisplayFlags = ?, Unlocks = ?, "
|
||||
"CFPenaltyUntil = ?, Pose = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
|
||||
|
||||
prepareStatement( CHARA_SEL_MINIMAL, "SELECT Name, Customize, ModelEquip, TerritoryId, GuardianDeity, "
|
||||
"Class, ContentId, BirthDay, BirthMonth "
|
||||
"FROM charainfo WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
|
||||
prepareStatement( CHARA_INS, "INSERT INTO charainfo (AccountId, CharacterId, ContentId, Name, Hp, Mp, "
|
||||
"Customize, Voice, IsNewGame, TerritoryId, PosX, PosY, PosZ, PosR, ModelEquip, "
|
||||
"IsNewAdventurer, GuardianDeity, Birthday, BirthMonth, Class, Status, FirstClass, "
|
||||
"HomePoint, StartTown, Discovery, HowTo, QuestCompleteFlags, Unlocks, QuestTracking, "
|
||||
"Aetheryte, GMRank, Mounts, Orchestrion, UPDATE_DATE ) "
|
||||
"VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW() );",
|
||||
CONNECTION_SYNC );
|
||||
|
||||
prepareStatement( CHARA_UP_NAME, "UPDATE charainfo SET Name = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_HPMP, "UPDATE charainfo SET Hp = ?, Mp = ?, Tp = ?, Gp = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODE, "UPDATE charainfo SET Mode = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MOUNT, "UPDATE charainfo SET Mount = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_INVINCIBLE, "UPDATE charainfo SET InvincibleGM = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CUSTOMIZE, "UPDATE charainfo SET Customize = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELMAINWEAP, "UPDATE charainfo SET ModelMainWeapon = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELSUBWEAP, "UPDATE charainfo SET ModelSubWeapon = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELSYSWEAP, "UPDATE charainfo SET ModelSystemWeapon = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MODELEQUIP, "UPDATE charainfo SET ModelEquip = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_EMOTEMODETYPE, "UPDATE charainfo SET EmoteModeType = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_FIRSTLOGINTIME, "UPDATE charainfo SET FirstLoginTime = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_LANGUAGE, "UPDATE charainfo SET Language = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_ISNEWGAME, "UPDATE charainfo SET IsNewGame = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_ISNEWADV, "UPDATE charainfo SET IsNewAdventurer = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TERRITORY,
|
||||
"UPDATE charainfo SET TerritoryType = ?, TerritoryId = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_POS,
|
||||
"UPDATE charainfo SET OPosX = ?, OPosY = ?, OPosZ = ?, OPosR = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CLASS, "UPDATE charainfo SET Class = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_STATUS, "UPDATE charainfo SET Status = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TOTALPLAYTIME, "UPDATE charainfo SET TotalPlayTime = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_HOMEPOINT, "UPDATE charainfo SET Homepoint = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_FAVOPOINT, "UPDATE charainfo SET FavoritePoint = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TITLE, "UPDATE charainfo SET ActiveTitle = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_TITLELIST, "UPDATE charainfo SET TitleList = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_ACHIEVEMENTS, "UPDATE charainfo SET Achievement = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_AETHERYTE, "UPDATE charainfo SET Aetheryte = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_HOWTO, "UPDATE charainfo SET HowTo = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MINIONS, "UPDATE charainfo SET Minions = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_MOUNTS, "UPDATE charainfo SET Mounts = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GEARSET, "UPDATE charainfo SET EquippedMannequin = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CONFIGFLAGS, "UPDATE charainfo SET ConfigFlags = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_QUESTCOMPLETE, "UPDATE charainfo SET QuestCompleteFlags = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_OPENINGSEQ, "UPDATE charainfo SET OpeningSequence = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_QUESTTRACKING, "UPDATE charainfo SET QuestTracking = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GRANDCOMPANY, "UPDATE charainfo SET GrandCompany = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GRANDCOMPANYRANKS, "UPDATE charainfo SET GrandCompanyRank = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_DISCOVERY, "UPDATE charainfo SET Discovery = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_GMRANK, "UPDATE charainfo SET GMRank = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_EQUIPDISPLAYFLAGS, "UPDATE charainfo SET EquipDisplayFlags = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_UNLOCKS, "UPDATE charainfo SET Unlocks = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_UP_CFPENATLY, "UPDATE charainfo SET CFPenaltyUntil = ? WHERE CharacterId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
|
||||
/// SEARCH INFO
|
||||
prepareStatement( CHARA_SEARCHINFO_INS,
|
||||
"INSERT INTO charainfosearch (CharacterId, UPDATE_DATE ) VALUES ( ?, NOW() );", CONNECTION_BOTH );
|
||||
prepareStatement( CHARA_SEARCHINFO_UP_SELECTCLASS,
|
||||
"UPDATE charainfosearch SET SelectClassId = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_SEARCHINFO_UP_SELECTREGION,
|
||||
"UPDATE charainfosearch SET SelectRegion = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_SEARCHINFO_UP_SEARCHCOMMENT,
|
||||
"UPDATE charainfosearch SET SearchComment = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_SEL_SEARCHINFO, "SELECT * FROM charainfosearch WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
|
||||
/// QUEST INFO
|
||||
prepareStatement( CHARA_QUEST_INS,
|
||||
"INSERT INTO charaquestnew ( CharacterId, SlotId, QuestId, Sequence, Flags, Variables_0, "
|
||||
"Variables_1, Variables_2, Variables_3, Variables_4, "
|
||||
"Variables_5, Variables_6 ) VALUES( ?,?,?,?,?,?,?,?,?,?,?,? );", CONNECTION_ASYNC );
|
||||
|
||||
prepareStatement( CHARA_QUEST_UP, "UPDATE charaquestnew SET Sequence = ?, Flags = ?, Variables_0 = ?, "
|
||||
"Variables_1 = ?, Variables_2 = ?, Variables_3 = ?, "
|
||||
"Variables_4 = ?, Variables_5 = ?, Variables_6 = ? "
|
||||
"WHERE CharacterId = ? AND QuestId = ?;", CONNECTION_ASYNC );
|
||||
|
||||
prepareStatement( CHARA_QUEST_DEL, "DELETE FROM charaquestnew WHERE CharacterId = ? AND QuestId = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
|
||||
prepareStatement( CHARA_SEL_QUEST, "SELECT * FROM charaquestnew WHERE CharacterId = ?;", CONNECTION_SYNC );
|
||||
|
||||
/// CLASS INFO
|
||||
prepareStatement( CHARA_CLASS_SEL, "SELECT ClassIdx, Exp, Lvl FROM characlass WHERE CharacterId = ?;",
|
||||
CONNECTION_SYNC );
|
||||
prepareStatement( CHARA_CLASS_INS, "INSERT INTO characlass ( CharacterId, ClassIdx, Exp, Lvl ) VALUES( ?,?,?,? );",
|
||||
CONNECTION_BOTH );
|
||||
prepareStatement( CHARA_CLASS_UP, "UPDATE characlass SET Exp = ?, Lvl = ? WHERE CharacterId = ? AND ClassIdx = ?;",
|
||||
CONNECTION_ASYNC );
|
||||
prepareStatement( CHARA_CLASS_DEL, "DELETE FROM characlass WHERE CharacterId = ?;", CONNECTION_ASYNC );
|
||||
|
||||
/// INVENTORY INFO
|
||||
prepareStatement( CHARA_ITEMINV_INS,
|
||||
"INSERT INTO charaiteminventory ( CharacterId, storageId, UPDATE_DATE ) VALUES ( ?, ?, NOW() );",
|
||||
CONNECTION_BOTH );
|
||||
|
||||
/// ITEM GLOBAL
|
||||
prepareStatement( CHARA_ITEMGLOBAL_INS,
|
||||
"INSERT INTO charaglobalitem ( CharacterId, ItemId, catalogId, UPDATE_DATE ) VALUES ( ?, ?, ?, NOW() );",
|
||||
CONNECTION_BOTH );
|
||||
|
||||
/// BNPC TEMPLATES
|
||||
prepareStatement( ZONE_SEL_BNPCTEMPLATES,
|
||||
"SELECT Id, Name, bNPCBaseId, bNPCNameId, mainWeaponModel, "
|
||||
"secWeaponModel, aggressionMode, enemyType, pose, "
|
||||
"modelChara, displayFlags, Look, Models "
|
||||
"FROM bnpctemplate WHERE 1;",
|
||||
CONNECTION_BOTH);
|
||||
|
||||
prepareStatement( CHARA_ITEMGLOBAL_UP,
|
||||
"UPDATE charaglobalitem SET stack = ?, durability = ?, stain = ? WHERE ItemId = ?;",
|
||||
CONNECTION_BOTH );
|
||||
|
||||
prepareStatement( CHARA_ITEMGLOBAL_DELETE,
|
||||
"UPDATE charaglobalitem SET IS_DELETE = 1 WHERE ItemId = ?;",
|
||||
CONNECTION_BOTH );
|
||||
}
|
102
src/common/Database/ZoneDbConnection.h
Normal file
102
src/common/Database/ZoneDbConnection.h
Normal file
|
@ -0,0 +1,102 @@
|
|||
#ifndef SAPPHIRE_CHARACONNECTION_H
|
||||
#define SAPPHIRE_CHARACONNECTION_H
|
||||
|
||||
#include "DbConnection.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Db {
|
||||
class DbConnectionInfo;
|
||||
|
||||
enum ZoneDbStatements : uint32_t
|
||||
{
|
||||
CHARA_SEL,
|
||||
CHARA_SEL_MINIMAL,
|
||||
CHARA_SEL_SEARCHINFO,
|
||||
CHARA_SEL_QUEST,
|
||||
CHARA_INS,
|
||||
CHARA_UP,
|
||||
CHARA_UP_NAME,
|
||||
CHARA_UP_HPMP,
|
||||
CHARA_UP_MODE,
|
||||
CHARA_UP_MOUNT,
|
||||
CHARA_UP_INVINCIBLE,
|
||||
CHARA_UP_CUSTOMIZE,
|
||||
CHARA_UP_MODELMAINWEAP,
|
||||
CHARA_UP_MODELSUBWEAP,
|
||||
CHARA_UP_MODELSYSWEAP,
|
||||
CHARA_UP_MODELEQUIP,
|
||||
CHARA_UP_EMOTEMODETYPE,
|
||||
CHARA_UP_FIRSTLOGINTIME,
|
||||
CHARA_UP_LANGUAGE,
|
||||
CHARA_UP_ISNEWGAME,
|
||||
CHARA_UP_ISNEWADV,
|
||||
CHARA_UP_TERRITORY,
|
||||
CHARA_UP_POS,
|
||||
CHARA_UP_CLASS,
|
||||
CHARA_UP_STATUS,
|
||||
CHARA_UP_TOTALPLAYTIME,
|
||||
CHARA_UP_HOMEPOINT,
|
||||
CHARA_UP_FAVOPOINT,
|
||||
CHARA_UP_TITLE,
|
||||
CHARA_UP_TITLELIST,
|
||||
CHARA_UP_ACHIEVEMENTS,
|
||||
CHARA_UP_AETHERYTE,
|
||||
CHARA_UP_HOWTO,
|
||||
CHARA_UP_MINIONS,
|
||||
CHARA_UP_MOUNTS,
|
||||
CHARA_UP_GEARSET,
|
||||
CHARA_UP_CONFIGFLAGS,
|
||||
CHARA_UP_QUESTCOMPLETE,
|
||||
CHARA_UP_OPENINGSEQ,
|
||||
CHARA_UP_QUESTTRACKING,
|
||||
CHARA_UP_GRANDCOMPANY,
|
||||
CHARA_UP_GRANDCOMPANYRANKS,
|
||||
CHARA_UP_DISCOVERY,
|
||||
CHARA_UP_GMRANK,
|
||||
CHARA_UP_EQUIPDISPLAYFLAGS,
|
||||
CHARA_UP_UNLOCKS,
|
||||
CHARA_UP_CFPENATLY,
|
||||
CHARA_SEARCHINFO_INS,
|
||||
CHARA_SEARCHINFO_UP_SELECTCLASS,
|
||||
CHARA_SEARCHINFO_UP_SELECTREGION,
|
||||
CHARA_SEARCHINFO_UP_SEARCHCOMMENT,
|
||||
|
||||
CHARA_QUEST_INS,
|
||||
CHARA_QUEST_UP,
|
||||
CHARA_QUEST_DEL,
|
||||
|
||||
CHARA_CLASS_SEL,
|
||||
CHARA_CLASS_INS,
|
||||
CHARA_CLASS_UP,
|
||||
CHARA_CLASS_DEL,
|
||||
|
||||
CHARA_ITEMINV_INS,
|
||||
|
||||
CHARA_ITEMGLOBAL_INS,
|
||||
CHARA_ITEMGLOBAL_UP,
|
||||
CHARA_ITEMGLOBAL_DELETE,
|
||||
|
||||
ZONE_SEL_BNPCTEMPLATES,
|
||||
|
||||
MAX_STATEMENTS
|
||||
};
|
||||
|
||||
class ZoneDbConnection : public DbConnection
|
||||
{
|
||||
public:
|
||||
using Statements = ZoneDbStatements;
|
||||
|
||||
ZoneDbConnection( ConnectionInfo& connInfo );
|
||||
|
||||
ZoneDbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* q, ConnectionInfo& connInfo );
|
||||
|
||||
~ZoneDbConnection();
|
||||
|
||||
void doPrepareStatements() override;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif //SAPPHIRE_CHARACONNECTION_H
|
|
@ -114,12 +114,12 @@ bool Core::Data::ExdData::loadZoneInfo()
|
|||
break;
|
||||
|
||||
sumPc += getField< uint8_t >( weatherRateFields, i + 1 );
|
||||
info.weather_rate_map[sumPc] = weatherId;
|
||||
info.weather_rate_map[ sumPc ] = weatherId;
|
||||
|
||||
i += 2;
|
||||
}
|
||||
|
||||
m_zoneInfoMap[id] = info;
|
||||
m_zoneInfoMap[ id ] = info;
|
||||
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ bool Core::Data::ExdData::loadStatusEffectInfo()
|
|||
auto& fields = row.second;
|
||||
uint32_t id = row.first;
|
||||
|
||||
StatusEffectInfo info { 0 };
|
||||
StatusEffectInfo info{ 0 };
|
||||
info.id = id;
|
||||
info.name = getField< std::string >( fields, 0 );
|
||||
info.lock_movement = getField< bool >( fields, 7 ); // 7
|
||||
|
@ -149,7 +149,7 @@ bool Core::Data::ExdData::loadStatusEffectInfo()
|
|||
info.is_fc_buff = getField< bool >( fields, 21 ); // 21
|
||||
info.invisibility = getField< bool >( fields, 22 ); // 22
|
||||
|
||||
m_statusEffectInfoMap[id] = info;
|
||||
m_statusEffectInfoMap[ id ] = info;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -204,7 +204,7 @@ bool Core::Data::ExdData::loadClassJobInfo()
|
|||
for( auto row : rows )
|
||||
{
|
||||
auto& fields = row.second;
|
||||
ClassJobInfo info { 0 };
|
||||
ClassJobInfo info{ 0 };
|
||||
|
||||
uint32_t id = row.first;
|
||||
|
||||
|
@ -230,7 +230,7 @@ bool Core::Data::ExdData::loadClassJobInfo()
|
|||
info.mod_mnd = getField< uint16_t >( fields, 15 );
|
||||
info.mod_pie = getField< uint16_t >( fields, 16 );
|
||||
|
||||
m_classJobInfoMap[id] = info;
|
||||
m_classJobInfoMap[ id ] = info;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -245,7 +245,7 @@ bool Core::Data::ExdData::loadParamGrowInfo()
|
|||
{
|
||||
auto& fields = row.second;
|
||||
|
||||
ParamGrowthInfo info { 0 };
|
||||
ParamGrowthInfo info{ 0 };
|
||||
uint32_t id = row.first;
|
||||
info.level = id;
|
||||
info.needed_exp = getField< int32_t >( fields, 0 );
|
||||
|
@ -253,10 +253,10 @@ bool Core::Data::ExdData::loadParamGrowInfo()
|
|||
info.mp_const = getField< int32_t >( fields, 4 ); // 4
|
||||
info.base_secondary = getField< int32_t >( fields, 5 );// 5
|
||||
info.quest_exp_mod = getField< uint8_t >( fields, 7 ); // 7
|
||||
info.hp_mod = getField< uint16_t >(fields, 8); // 8
|
||||
info.hp_mod = getField< uint16_t >( fields, 8 ); // 8
|
||||
|
||||
|
||||
m_paramGrowthInfoMap[id] = info;
|
||||
m_paramGrowthInfoMap[ id ] = info;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -271,7 +271,7 @@ bool Core::Data::ExdData::loadTribeInfo()
|
|||
{
|
||||
auto& fields = row.second;
|
||||
|
||||
TribeInfo info { 0 };
|
||||
TribeInfo info{ 0 };
|
||||
uint32_t id = row.first;
|
||||
info.id = id;
|
||||
info.name = getField< std::string >( fields, 0 );
|
||||
|
@ -282,7 +282,7 @@ bool Core::Data::ExdData::loadTribeInfo()
|
|||
info.mod_mnd = getField< int8_t >( fields, 8 );
|
||||
info.mod_pie = getField< int8_t >( fields, 9 );
|
||||
|
||||
m_tribeInfoMap[id] = info;
|
||||
m_tribeInfoMap[ id ] = info;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -297,7 +297,7 @@ bool Core::Data::ExdData::loadEventActionInfo()
|
|||
{
|
||||
auto& fields = row.second;
|
||||
|
||||
EventActionInfo info { 0 };
|
||||
EventActionInfo info{ 0 };
|
||||
|
||||
uint32_t id = row.first;
|
||||
|
||||
|
@ -313,7 +313,7 @@ bool Core::Data::ExdData::loadEventActionInfo()
|
|||
info.name = name;
|
||||
info.castTime = time * 1000;
|
||||
|
||||
m_EventActionInfoMap[id] = info;
|
||||
m_EventActionInfoMap[ id ] = info;
|
||||
|
||||
}
|
||||
|
||||
|
@ -343,7 +343,7 @@ bool Core::Data::ExdData::loadActionInfo()
|
|||
uint8_t unlock_level = getField< uint8_t >( fields, 11 ); // 11
|
||||
int8_t range = getField< int8_t >( fields, 14 ); // 13
|
||||
bool can_target_self = getField< bool >( fields, 15 ); // 14
|
||||
bool can_target_party = getField< bool>( fields, 16 ); // 15
|
||||
bool can_target_party = getField< bool >( fields, 16 ); // 15
|
||||
bool can_target_friendly = getField< bool >( fields, 17 ); // 16
|
||||
bool can_target_enemy = getField< bool >( fields, 18 ); // 17
|
||||
|
||||
|
@ -418,7 +418,7 @@ bool Core::Data::ExdData::loadActionInfo()
|
|||
}
|
||||
|
||||
boost::shared_ptr< Core::Data::PlaceNameInfo >
|
||||
Core::Data::ExdData::getPlaceNameInfo( uint32_t placeNameId )
|
||||
Core::Data::ExdData::getPlaceNameInfo( uint32_t placeNameId )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -438,7 +438,7 @@ boost::shared_ptr< Core::Data::PlaceNameInfo >
|
|||
}
|
||||
|
||||
boost::shared_ptr< Core::Data::ItemInfo >
|
||||
Core::Data::ExdData::getItemInfo( uint32_t catalogId )
|
||||
Core::Data::ExdData::getItemInfo( uint32_t catalogId )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -470,11 +470,11 @@ boost::shared_ptr< Core::Data::ItemInfo >
|
|||
}
|
||||
|
||||
boost::shared_ptr< Core::Data::AetheryteInfo >
|
||||
Core::Data::ExdData::getAetheryteInfo( uint32_t aetheryteId )
|
||||
Core::Data::ExdData::getAetheryteInfo( uint32_t aetheryteId )
|
||||
{
|
||||
try
|
||||
{
|
||||
return m_aetheryteInfoMap[aetheryteId];
|
||||
return m_aetheryteInfoMap[ aetheryteId ];
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
|
@ -490,9 +490,9 @@ Core::Data::ExdData::getActionInfo( uint32_t actionId )
|
|||
{
|
||||
try
|
||||
{
|
||||
return m_actionInfoMap[actionId];
|
||||
return m_actionInfoMap[ actionId ];
|
||||
}
|
||||
catch ( ... )
|
||||
catch( ... )
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -502,7 +502,7 @@ Core::Data::ExdData::getActionInfo( uint32_t actionId )
|
|||
}
|
||||
|
||||
boost::shared_ptr< Core::Data::CustomTalkInfo >
|
||||
Core::Data::ExdData::getCustomTalkInfo( uint32_t customTalkId )
|
||||
Core::Data::ExdData::getCustomTalkInfo( uint32_t customTalkId )
|
||||
{
|
||||
|
||||
try
|
||||
|
@ -524,7 +524,7 @@ boost::shared_ptr< Core::Data::CustomTalkInfo >
|
|||
}
|
||||
|
||||
boost::shared_ptr< Core::Data::QuestInfo >
|
||||
Core::Data::ExdData::getQuestInfo( uint32_t questId )
|
||||
Core::Data::ExdData::getQuestInfo( uint32_t questId )
|
||||
{
|
||||
|
||||
|
||||
|
@ -614,7 +614,7 @@ boost::shared_ptr< Core::Data::QuestInfo >
|
|||
}
|
||||
|
||||
boost::shared_ptr< Core::Data::EventItemInfo >
|
||||
Core::Data::ExdData::getEventItemInfo( uint32_t eventItemId )
|
||||
Core::Data::ExdData::getEventItemInfo( uint32_t eventItemId )
|
||||
{
|
||||
|
||||
try
|
||||
|
@ -637,7 +637,7 @@ boost::shared_ptr< Core::Data::EventItemInfo >
|
|||
}
|
||||
|
||||
boost::shared_ptr< Core::Data::LevelInfo >
|
||||
Core::Data::ExdData::getLevelInfo( uint32_t levelId )
|
||||
Core::Data::ExdData::getLevelInfo( uint32_t levelId )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -660,7 +660,8 @@ boost::shared_ptr< Core::Data::LevelInfo >
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
const std::vector<boost::shared_ptr< Core::Data::AetheryteInfo > > Core::Data::ExdData::getAetheryteInfoForZone( uint16_t zoneId )
|
||||
const std::vector< boost::shared_ptr< Core::Data::AetheryteInfo > >
|
||||
Core::Data::ExdData::getAetheryteInfoForZone( uint16_t zoneId )
|
||||
{
|
||||
std::vector< boost::shared_ptr< AetheryteInfo > > aetheryteList;
|
||||
|
||||
|
@ -676,7 +677,7 @@ const std::vector<boost::shared_ptr< Core::Data::AetheryteInfo > > Core::Data::E
|
|||
|
||||
|
||||
boost::shared_ptr< Core::Data::OpeningInfo >
|
||||
Core::Data::ExdData::getOpeningInfo( uint32_t openingId )
|
||||
Core::Data::ExdData::getOpeningInfo( uint32_t openingId )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -696,7 +697,7 @@ boost::shared_ptr< Core::Data::OpeningInfo >
|
|||
}
|
||||
|
||||
boost::shared_ptr< Core::Data::RaceInfo >
|
||||
Core::Data::ExdData::getRaceInfo( uint32_t raceId )
|
||||
Core::Data::ExdData::getRaceInfo( uint32_t raceId )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -22,10 +22,10 @@ case DataType::uint64: 9
|
|||
|
||||
namespace Core {
|
||||
|
||||
namespace Data {
|
||||
namespace Data {
|
||||
|
||||
struct ZoneInfo
|
||||
{
|
||||
struct ZoneInfo
|
||||
{
|
||||
uint16_t id;
|
||||
std::string zone_str;
|
||||
std::string zone_name;
|
||||
|
@ -34,14 +34,14 @@ namespace Core {
|
|||
int16_t discovery_index;
|
||||
bool is_two_byte;
|
||||
uint16_t weather_rate;
|
||||
std::map< uint8_t, int32_t> weather_rate_map;
|
||||
std::map< uint8_t, int32_t > weather_rate_map;
|
||||
|
||||
int32_t aetheryte_index;
|
||||
uint8_t zone_type;
|
||||
};
|
||||
};
|
||||
|
||||
struct ClassJobInfo
|
||||
{
|
||||
struct ClassJobInfo
|
||||
{
|
||||
uint8_t id;
|
||||
std::string name;
|
||||
std::string name_short;
|
||||
|
@ -55,10 +55,10 @@ namespace Core {
|
|||
uint16_t mod_int;
|
||||
uint16_t mod_mnd;
|
||||
uint16_t mod_pie;
|
||||
};
|
||||
};
|
||||
|
||||
struct QuestInfo
|
||||
{
|
||||
struct QuestInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
std::string name_intern;
|
||||
|
@ -93,26 +93,25 @@ namespace Core {
|
|||
uint8_t reward_reputation;
|
||||
|
||||
|
||||
|
||||
std::vector< std::string > script_entity;
|
||||
std::vector< uint32_t > script_value;
|
||||
};
|
||||
};
|
||||
|
||||
struct EventActionInfo
|
||||
{
|
||||
struct EventActionInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
uint32_t castTime;
|
||||
};
|
||||
};
|
||||
|
||||
struct OpeningInfo
|
||||
{
|
||||
struct OpeningInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
};
|
||||
};
|
||||
|
||||
struct ParamGrowthInfo
|
||||
{
|
||||
struct ParamGrowthInfo
|
||||
{
|
||||
uint32_t level;
|
||||
uint32_t needed_exp;
|
||||
int16_t hp_mod;
|
||||
|
@ -120,22 +119,22 @@ namespace Core {
|
|||
int16_t mp_mod;
|
||||
int32_t base_secondary;
|
||||
uint16_t quest_exp_mod;
|
||||
};
|
||||
};
|
||||
|
||||
struct CustomTalkInfo
|
||||
{
|
||||
struct CustomTalkInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name_intern;
|
||||
};
|
||||
};
|
||||
|
||||
struct PlaceNameInfo
|
||||
{
|
||||
struct PlaceNameInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string placename;
|
||||
};
|
||||
};
|
||||
|
||||
struct AetheryteInfo
|
||||
{
|
||||
struct AetheryteInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string placename;
|
||||
std::string placename_aethernet;
|
||||
|
@ -145,10 +144,10 @@ namespace Core {
|
|||
|
||||
int16_t map_coord_x;
|
||||
int16_t map_coord_y;
|
||||
};
|
||||
};
|
||||
|
||||
struct RaceInfo
|
||||
{
|
||||
struct RaceInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
uint32_t male_body;
|
||||
|
@ -166,10 +165,10 @@ namespace Core {
|
|||
int8_t mod_int;
|
||||
int8_t mod_mnd;
|
||||
int8_t mod_pie;
|
||||
};
|
||||
};
|
||||
|
||||
struct TribeInfo
|
||||
{
|
||||
struct TribeInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name;
|
||||
|
||||
|
@ -179,10 +178,10 @@ namespace Core {
|
|||
int8_t mod_int;
|
||||
int8_t mod_mnd;
|
||||
int8_t mod_pie;
|
||||
};
|
||||
};
|
||||
|
||||
struct LevelInfo
|
||||
{
|
||||
struct LevelInfo
|
||||
{
|
||||
uint32_t id;
|
||||
float x;
|
||||
float y;
|
||||
|
@ -190,17 +189,17 @@ namespace Core {
|
|||
float r;
|
||||
uint32_t actor_id;
|
||||
uint32_t zone_id;
|
||||
};
|
||||
};
|
||||
|
||||
struct ClassJobCategoryInfo
|
||||
{
|
||||
struct ClassJobCategoryInfo
|
||||
{
|
||||
uint32_t id;
|
||||
// should they add new jobs, this needs to be changed
|
||||
bool can_equip[0x33];
|
||||
};
|
||||
};
|
||||
|
||||
struct ItemInfo
|
||||
{
|
||||
struct ItemInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name; //0
|
||||
uint16_t item_level; //11
|
||||
|
@ -218,10 +217,10 @@ namespace Core {
|
|||
bool is_unique; //72
|
||||
bool is_untradeable; //73
|
||||
uint32_t class_job_index; //86
|
||||
};
|
||||
};
|
||||
|
||||
struct ActionInfo
|
||||
{
|
||||
struct ActionInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name; // 0
|
||||
uint16_t category; // 3
|
||||
|
@ -261,18 +260,18 @@ namespace Core {
|
|||
|
||||
bool is_aoe; // Internal only
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
struct EventItemInfo
|
||||
{
|
||||
struct EventItemInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name; //0
|
||||
uint32_t eventId;
|
||||
uint32_t castTime;
|
||||
};
|
||||
};
|
||||
|
||||
struct StatusEffectInfo
|
||||
{
|
||||
struct StatusEffectInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name; // 0
|
||||
bool lock_movement; // 7
|
||||
|
@ -284,13 +283,14 @@ namespace Core {
|
|||
bool inflicted_by_actor; // 17
|
||||
bool is_fc_buff; // 21
|
||||
bool invisibility; // 22
|
||||
};
|
||||
};
|
||||
|
||||
class ExdData
|
||||
{
|
||||
public:
|
||||
class ExdData
|
||||
{
|
||||
public:
|
||||
ExdData();
|
||||
~ExdData(void);
|
||||
|
||||
~ExdData( void );
|
||||
|
||||
bool init( const std::string& path );
|
||||
|
||||
|
@ -302,8 +302,8 @@ namespace Core {
|
|||
return *boost::get< T >( &fields.at( index ) );
|
||||
}
|
||||
|
||||
boost::shared_ptr<xiv::dat::GameData> m_data;
|
||||
boost::shared_ptr<xiv::exd::ExdData> m_exd_data;
|
||||
boost::shared_ptr< xiv::dat::GameData > m_data;
|
||||
boost::shared_ptr< xiv::exd::ExdData > m_exd_data;
|
||||
|
||||
xiv::exd::Exd m_questDat;
|
||||
xiv::exd::Exd m_openingDat;
|
||||
|
@ -316,40 +316,56 @@ namespace Core {
|
|||
xiv::exd::Exd m_raceDat;
|
||||
xiv::exd::Exd m_eventItemDat;
|
||||
|
||||
std::map<uint32_t, ZoneInfo> m_zoneInfoMap;
|
||||
std::map<uint8_t, ClassJobInfo> m_classJobInfoMap;
|
||||
std::map<uint32_t, ParamGrowthInfo> m_paramGrowthInfoMap;
|
||||
std::map<uint16_t, EventActionInfo> m_EventActionInfoMap;
|
||||
std::map<uint16_t, boost::shared_ptr< ActionInfo > > m_actionInfoMap;
|
||||
std::map<uint16_t, StatusEffectInfo> m_statusEffectInfoMap;
|
||||
std::map<uint32_t, boost::shared_ptr< AetheryteInfo > > m_aetheryteInfoMap;
|
||||
std::map<uint32_t, TribeInfo > m_tribeInfoMap;
|
||||
std::map< uint32_t, ZoneInfo > m_zoneInfoMap;
|
||||
std::map< uint8_t, ClassJobInfo > m_classJobInfoMap;
|
||||
std::map< uint32_t, ParamGrowthInfo > m_paramGrowthInfoMap;
|
||||
std::map< uint16_t, EventActionInfo > m_EventActionInfoMap;
|
||||
std::map< uint16_t, boost::shared_ptr< ActionInfo > > m_actionInfoMap;
|
||||
std::map< uint16_t, StatusEffectInfo > m_statusEffectInfoMap;
|
||||
std::map< uint32_t, boost::shared_ptr< AetheryteInfo > > m_aetheryteInfoMap;
|
||||
std::map< uint32_t, TribeInfo > m_tribeInfoMap;
|
||||
|
||||
bool loadZoneInfo();
|
||||
|
||||
bool loadClassJobInfo();
|
||||
|
||||
bool loadParamGrowInfo();
|
||||
|
||||
bool loadEventActionInfo();
|
||||
|
||||
bool loadActionInfo();
|
||||
|
||||
bool loadStatusEffectInfo();
|
||||
|
||||
bool loadAetheryteInfo();
|
||||
|
||||
bool loadTribeInfo();
|
||||
|
||||
boost::shared_ptr< QuestInfo > getQuestInfo( uint32_t questId );
|
||||
|
||||
boost::shared_ptr< OpeningInfo > getOpeningInfo( uint32_t openingId );
|
||||
|
||||
boost::shared_ptr< CustomTalkInfo > getCustomTalkInfo( uint32_t customTalkId );
|
||||
|
||||
boost::shared_ptr< AetheryteInfo > getAetheryteInfo( uint32_t aetheryteId );
|
||||
|
||||
boost::shared_ptr< ActionInfo > getActionInfo( uint32_t actionId );
|
||||
|
||||
boost::shared_ptr< PlaceNameInfo > getPlaceNameInfo( uint32_t placeNameId );
|
||||
|
||||
boost::shared_ptr< ItemInfo > getItemInfo( uint32_t catalogId );
|
||||
|
||||
boost::shared_ptr< RaceInfo > getRaceInfo( uint32_t raceId );
|
||||
|
||||
boost::shared_ptr< EventItemInfo > getEventItemInfo( uint32_t eventItemId );
|
||||
|
||||
boost::shared_ptr< LevelInfo > getLevelInfo( uint32_t levelId );
|
||||
|
||||
const std::vector< boost::shared_ptr< AetheryteInfo > > getAetheryteInfoForZone( uint16_t zoneId );
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <boost/variant.hpp>
|
||||
|
||||
|
||||
|
||||
Core::Data::Achievement::Achievement( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_AchievementDat.get_row( row_id );
|
||||
|
@ -244,7 +243,8 @@ Core::Data::AirshipExplorationLog::AirshipExplorationLog( uint32_t row_id, Core:
|
|||
text = exdData->getField< std::string >( row, 0 );
|
||||
}
|
||||
|
||||
Core::Data::AirshipExplorationParamType::AirshipExplorationParamType( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::AirshipExplorationParamType::AirshipExplorationParamType( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_AirshipExplorationParamTypeDat.get_row( row_id );
|
||||
name = exdData->getField< std::string >( row, 0 );
|
||||
|
@ -306,7 +306,8 @@ Core::Data::AnimaWeapon5SpiritTalk::AnimaWeapon5SpiritTalk( uint32_t row_id, Cor
|
|||
dialogue = exdData->getField< int32_t >( row, 0 );
|
||||
}
|
||||
|
||||
Core::Data::AnimaWeapon5SpiritTalkParam::AnimaWeapon5SpiritTalkParam( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::AnimaWeapon5SpiritTalkParam::AnimaWeapon5SpiritTalkParam( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_AnimaWeapon5SpiritTalkParamDat.get_row( row_id );
|
||||
prologue = exdData->getField< std::string >( row, 0 );
|
||||
|
@ -959,13 +960,15 @@ Core::Data::CompanyCraftDraft::CompanyCraftDraft( uint32_t row_id, Core::Data::E
|
|||
order = exdData->getField< uint32_t >( row, 8 );
|
||||
}
|
||||
|
||||
Core::Data::CompanyCraftDraftCategory::CompanyCraftDraftCategory( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::CompanyCraftDraftCategory::CompanyCraftDraftCategory( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_CompanyCraftDraftCategoryDat.get_row( row_id );
|
||||
name = exdData->getField< std::string >( row, 0 );
|
||||
}
|
||||
|
||||
Core::Data::CompanyCraftManufactoryState::CompanyCraftManufactoryState( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::CompanyCraftManufactoryState::CompanyCraftManufactoryState( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_CompanyCraftManufactoryStateDat.get_row( row_id );
|
||||
name = exdData->getField< std::string >( row, 0 );
|
||||
|
@ -1072,7 +1075,8 @@ Core::Data::ContentFinderCondition::ContentFinderCondition( uint32_t row_id, Cor
|
|||
icon = exdData->getField< uint32_t >( row, 37 );
|
||||
}
|
||||
|
||||
Core::Data::ContentFinderConditionTransient::ContentFinderConditionTransient( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::ContentFinderConditionTransient::ContentFinderConditionTransient( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_ContentFinderConditionTransientDat.get_row( row_id );
|
||||
description = exdData->getField< std::string >( row, 0 );
|
||||
|
@ -1602,7 +1606,8 @@ Core::Data::EurekaGrowData::EurekaGrowData( uint32_t row_id, Core::Data::ExdData
|
|||
baseResistance = exdData->getField< uint16_t >( row, 0 );
|
||||
}
|
||||
|
||||
Core::Data::EurekaSphereElementAdjust::EurekaSphereElementAdjust( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::EurekaSphereElementAdjust::EurekaSphereElementAdjust( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_EurekaSphereElementAdjustDat.get_row( row_id );
|
||||
powerModifier = exdData->getField< uint16_t >( row, 0 );
|
||||
|
@ -1828,7 +1833,8 @@ Core::Data::GatheringItem::GatheringItem( uint32_t row_id, Core::Data::ExdDataGe
|
|||
isHidden = exdData->getField< bool >( row, 2 );
|
||||
}
|
||||
|
||||
Core::Data::GatheringItemLevelConvertTable::GatheringItemLevelConvertTable( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::GatheringItemLevelConvertTable::GatheringItemLevelConvertTable( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_GatheringItemLevelConvertTableDat.get_row( row_id );
|
||||
gatheringItemLevel = exdData->getField< uint8_t >( row, 0 );
|
||||
|
@ -2024,7 +2030,8 @@ Core::Data::GcArmyExpedition::GcArmyExpedition( uint32_t row_id, Core::Data::Exd
|
|||
description = exdData->getField< std::string >( row, 9 );
|
||||
}
|
||||
|
||||
Core::Data::GcArmyExpeditionMemberBonus::GcArmyExpeditionMemberBonus( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::GcArmyExpeditionMemberBonus::GcArmyExpeditionMemberBonus( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_GcArmyExpeditionMemberBonusDat.get_row( row_id );
|
||||
race = exdData->getField< uint8_t >( row, 0 );
|
||||
|
@ -2314,6 +2321,7 @@ Core::Data::Item::Item( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
|||
isUnique = exdData->getField< bool >( row, 20 );
|
||||
isUntradable = exdData->getField< bool >( row, 21 );
|
||||
isIndisposable = exdData->getField< bool >( row, 22 );
|
||||
isEquippable = exdData->getField< bool >( row, 23 );
|
||||
priceMid = exdData->getField< uint32_t >( row, 24 );
|
||||
priceLow = exdData->getField< uint32_t >( row, 25 );
|
||||
canBeHq = exdData->getField< bool >( row, 26 );
|
||||
|
@ -2622,7 +2630,8 @@ Core::Data::MasterpieceSupplyDuty::MasterpieceSupplyDuty( uint32_t row_id, Core:
|
|||
rewardCurrency = exdData->getField< uint16_t >( row, 2 );
|
||||
}
|
||||
|
||||
Core::Data::MasterpieceSupplyMultiplier::MasterpieceSupplyMultiplier( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::MasterpieceSupplyMultiplier::MasterpieceSupplyMultiplier( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_MasterpieceSupplyMultiplierDat.get_row( row_id );
|
||||
xpMultiplier.push_back( exdData->getField< uint16_t >( row, 0 ) );
|
||||
|
@ -3369,7 +3378,8 @@ Core::Data::RacingChocoboName::RacingChocoboName( uint32_t row_id, Core::Data::E
|
|||
name = exdData->getField< std::string >( row, 0 );
|
||||
}
|
||||
|
||||
Core::Data::RacingChocoboNameCategory::RacingChocoboNameCategory( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::RacingChocoboNameCategory::RacingChocoboNameCategory( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_RacingChocoboNameCategoryDat.get_row( row_id );
|
||||
sortKey = exdData->getField< uint8_t >( row, 0 );
|
||||
|
@ -3767,7 +3777,8 @@ Core::Data::ScenarioTreeTips::ScenarioTreeTips( uint32_t row_id, Core::Data::Exd
|
|||
tips2 = exdData->getField< uint32_t >( row, 3 );
|
||||
}
|
||||
|
||||
Core::Data::ScenarioTreeTipsClassQuest::ScenarioTreeTipsClassQuest( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||
Core::Data::ScenarioTreeTipsClassQuest::ScenarioTreeTipsClassQuest( uint32_t row_id,
|
||||
Core::Data::ExdDataGenerated* exdData )
|
||||
{
|
||||
auto row = exdData->m_ScenarioTreeTipsClassQuestDat.get_row( row_id );
|
||||
quest = exdData->getField< uint32_t >( row, 0 );
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -3,35 +3,34 @@
|
|||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
namespace Core
|
||||
{
|
||||
namespace Core {
|
||||
|
||||
class ConfigMgr;
|
||||
class ConfigMgr;
|
||||
|
||||
typedef boost::shared_ptr< ConfigMgr > ConfigMgrPtr;
|
||||
typedef boost::shared_ptr< ConfigMgr > ConfigMgrPtr;
|
||||
|
||||
|
||||
namespace Network
|
||||
{
|
||||
class Hive;
|
||||
class Acceptor;
|
||||
class Connection;
|
||||
namespace Network {
|
||||
class Hive;
|
||||
|
||||
typedef boost::shared_ptr< Hive > HivePtr;
|
||||
typedef boost::shared_ptr< Acceptor > AcceptorPtr;
|
||||
typedef boost::shared_ptr< Connection > ConnectionPtr;
|
||||
class Acceptor;
|
||||
|
||||
namespace Packets
|
||||
{
|
||||
class GamePacket;
|
||||
class FFXIVPacketBase;
|
||||
class Connection;
|
||||
|
||||
typedef boost::shared_ptr< GamePacket > GamePacketPtr;
|
||||
typedef boost::shared_ptr< FFXIVPacketBase > FFXIVPacketBasePtr;
|
||||
}
|
||||
typedef boost::shared_ptr< Hive > HivePtr;
|
||||
typedef boost::shared_ptr< Acceptor > AcceptorPtr;
|
||||
typedef boost::shared_ptr< Connection > ConnectionPtr;
|
||||
|
||||
}
|
||||
namespace Packets {
|
||||
class GamePacket;
|
||||
|
||||
class FFXIVPacketBase;
|
||||
|
||||
typedef boost::shared_ptr< GamePacket > GamePacketPtr;
|
||||
typedef boost::shared_ptr< FFXIVPacketBase > FFXIVPacketBasePtr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,15 +7,14 @@
|
|||
#include <boost/shared_ptr.hpp>
|
||||
#include <cassert>
|
||||
|
||||
namespace Core
|
||||
{
|
||||
namespace Core {
|
||||
|
||||
class Framework
|
||||
{
|
||||
class Framework
|
||||
{
|
||||
using TypenameToObject = std::map< std::type_index, boost::shared_ptr< void > >;
|
||||
TypenameToObject ObjectMap;
|
||||
|
||||
public:
|
||||
public:
|
||||
template< typename T >
|
||||
boost::shared_ptr< T > get()
|
||||
{
|
||||
|
@ -28,9 +27,9 @@ namespace Core
|
|||
void set( boost::shared_ptr< T > value )
|
||||
{
|
||||
assert( value ); // why would anyone store nullptrs....
|
||||
ObjectMap[typeid( T )] = value;
|
||||
ObjectMap[ typeid( T ) ] = value;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -17,72 +17,75 @@
|
|||
namespace Core {
|
||||
|
||||
|
||||
Logger::Logger()
|
||||
{
|
||||
Logger::Logger()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Logger::~Logger()
|
||||
{
|
||||
Logger::~Logger()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Logger::setLogPath(const std::string& logPath)
|
||||
{
|
||||
void Logger::setLogPath( const std::string& logPath )
|
||||
{
|
||||
m_logFile = logPath;
|
||||
}
|
||||
}
|
||||
|
||||
void Logger::init()
|
||||
{
|
||||
void Logger::init()
|
||||
{
|
||||
|
||||
auto format = (
|
||||
boost::log::expressions::stream <<
|
||||
boost::log::expressions::format_date_time< boost::posix_time::ptime >("TimeStamp", "[%H:%M:%S]") <<
|
||||
boost::log::expressions::format_date_time< boost::posix_time::ptime >(
|
||||
"TimeStamp", "[%H:%M:%S]" ) <<
|
||||
"[" << boost::log::trivial::severity << "] " <<
|
||||
boost::log::expressions::smessage
|
||||
);
|
||||
|
||||
boost::log::add_file_log
|
||||
(
|
||||
boost::log::keywords::file_name = m_logFile + "%Y-%m-%d.log", /*< file name pattern >*/
|
||||
boost::log::keywords::rotation_size = 10 * 1024 * 1024, /*< rotate files every 10 MiB... >*/
|
||||
boost::log::keywords::time_based_rotation = boost::log::sinks::file::rotation_at_time_point(0, 0, 0), /*< ...or at midnight >*/
|
||||
boost::log::keywords::file_name =
|
||||
m_logFile + "%Y-%m-%d.log", /*< file name pattern >*/
|
||||
boost::log::keywords::rotation_size =
|
||||
10 * 1024 * 1024, /*< rotate files every 10 MiB... >*/
|
||||
boost::log::keywords::time_based_rotation = boost::log::sinks::file::rotation_at_time_point( 0, 0,
|
||||
0 ), /*< ...or at midnight >*/
|
||||
boost::log::keywords::open_mode = std::ios::app,
|
||||
boost::log::keywords::format = format,
|
||||
boost::log::keywords::auto_flush = true
|
||||
);
|
||||
|
||||
boost::log::add_console_log(std::cout, boost::log::keywords::format = format);
|
||||
boost::log::add_console_log( std::cout, boost::log::keywords::format = format );
|
||||
|
||||
boost::log::add_common_attributes();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Logger::Log(LoggingSeverity logSev, const std::string& text)
|
||||
{
|
||||
BOOST_LOG_SEV(m_lg, (boost::log::trivial::severity_level)logSev) << text;
|
||||
}
|
||||
void Logger::Log( LoggingSeverity logSev, const std::string& text )
|
||||
{
|
||||
BOOST_LOG_SEV( m_lg, ( boost::log::trivial::severity_level ) logSev ) << text;
|
||||
}
|
||||
|
||||
void Logger::error( const std::string& text )
|
||||
{
|
||||
void Logger::error( const std::string& text )
|
||||
{
|
||||
BOOST_LOG_SEV( m_lg, boost::log::trivial::severity_level::error ) << text;
|
||||
}
|
||||
}
|
||||
|
||||
void Logger::info( const std::string& text )
|
||||
{
|
||||
void Logger::info( const std::string& text )
|
||||
{
|
||||
BOOST_LOG_SEV( m_lg, boost::log::trivial::severity_level::info ) << text;
|
||||
}
|
||||
}
|
||||
|
||||
void Logger::debug( const std::string& text )
|
||||
{
|
||||
void Logger::debug( const std::string& text )
|
||||
{
|
||||
BOOST_LOG_SEV( m_lg, boost::log::trivial::severity_level::debug ) << text;
|
||||
}
|
||||
}
|
||||
|
||||
void Logger::fatal( const std::string& text )
|
||||
{
|
||||
void Logger::fatal( const std::string& text )
|
||||
{
|
||||
BOOST_LOG_SEV( m_lg, boost::log::trivial::severity_level::fatal ) << text;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -6,46 +6,48 @@
|
|||
namespace Core {
|
||||
|
||||
|
||||
enum struct LoggingSeverity : uint8_t
|
||||
{
|
||||
enum struct LoggingSeverity :
|
||||
uint8_t
|
||||
{
|
||||
trace = 0,
|
||||
debug = 1,
|
||||
info = 2,
|
||||
warning = 3,
|
||||
error = 4,
|
||||
fatal = 5
|
||||
};
|
||||
};
|
||||
|
||||
class Logger
|
||||
{
|
||||
class Logger
|
||||
{
|
||||
|
||||
private:
|
||||
private:
|
||||
boost::log::sources::severity_logger_mt< boost::log::trivial::severity_level > m_lg;
|
||||
|
||||
std::string m_logFile;
|
||||
|
||||
public:
|
||||
public:
|
||||
Logger();
|
||||
|
||||
~Logger();
|
||||
|
||||
void init();
|
||||
|
||||
void Log(LoggingSeverity logSev, const std::string& text);
|
||||
void Log( LoggingSeverity logSev, const std::string& text );
|
||||
|
||||
void error( const std::string& text );
|
||||
|
||||
void info( const std::string& text );
|
||||
|
||||
void debug( const std::string& text );
|
||||
|
||||
void fatal( const std::string& text );
|
||||
|
||||
void setLogPath(const std::string& logPath);
|
||||
|
||||
};
|
||||
void setLogPath( const std::string& logPath );
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -4,39 +4,38 @@
|
|||
#include <boost/interprocess/detail/atomic.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
namespace Core
|
||||
{
|
||||
namespace Network
|
||||
{
|
||||
namespace Core {
|
||||
namespace Network {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Acceptor::Acceptor( HivePtr hive )
|
||||
: m_hive( hive ),
|
||||
Acceptor::Acceptor( HivePtr hive )
|
||||
:
|
||||
m_hive( hive ),
|
||||
m_acceptor( hive->GetService() ),
|
||||
m_io_strand( hive->GetService() ),
|
||||
m_error_state( 0 )
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
Acceptor::~Acceptor()
|
||||
{
|
||||
}
|
||||
Acceptor::~Acceptor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool Acceptor::OnAccept( ConnectionPtr connection, const std::string & host, uint16_t port )
|
||||
{
|
||||
bool Acceptor::OnAccept( ConnectionPtr connection, const std::string& host, uint16_t port )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void Acceptor::OnError( const boost::system::error_code & error )
|
||||
{
|
||||
void Acceptor::OnError( const boost::system::error_code& error )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Acceptor::StartError( const boost::system::error_code & error )
|
||||
{
|
||||
void Acceptor::StartError( const boost::system::error_code& error )
|
||||
{
|
||||
if( boost::interprocess::ipcdetail::atomic_cas32( &m_error_state, 1, 0 ) == 0 )
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
|
@ -44,19 +43,19 @@ namespace Core
|
|||
m_acceptor.close( ec );
|
||||
OnError( error );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Acceptor::DispatchAccept( ConnectionPtr connection )
|
||||
{
|
||||
void Acceptor::DispatchAccept( ConnectionPtr connection )
|
||||
{
|
||||
m_acceptor.async_accept( connection->GetSocket(),
|
||||
connection->GetStrand().wrap( boost::bind( &Acceptor::HandleAccept,
|
||||
shared_from_this(),
|
||||
_1,
|
||||
connection ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
void Acceptor::HandleAccept( const boost::system::error_code & error, ConnectionPtr connection )
|
||||
{
|
||||
void Acceptor::HandleAccept( const boost::system::error_code& error, ConnectionPtr connection )
|
||||
{
|
||||
if( error || HasError() || m_hive->HasStopped() )
|
||||
{
|
||||
connection->StartError( error );
|
||||
|
@ -69,7 +68,8 @@ namespace Core
|
|||
connection->GetSocket().remote_endpoint().address().to_string(),
|
||||
connection->GetSocket().remote_endpoint().port() ) )
|
||||
{
|
||||
connection->OnAccept( m_acceptor.local_endpoint().address().to_string(), m_acceptor.local_endpoint().port() );
|
||||
connection->OnAccept( m_acceptor.local_endpoint().address().to_string(),
|
||||
m_acceptor.local_endpoint().port() );
|
||||
connection->Recv();
|
||||
}
|
||||
}
|
||||
|
@ -78,20 +78,20 @@ namespace Core
|
|||
connection->StartError( error );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Acceptor::Stop()
|
||||
{
|
||||
void Acceptor::Stop()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Acceptor::Accept( ConnectionPtr connection )
|
||||
{
|
||||
void Acceptor::Accept( ConnectionPtr connection )
|
||||
{
|
||||
m_io_strand.post( boost::bind( &Acceptor::DispatchAccept, shared_from_this(), connection ) );
|
||||
}
|
||||
}
|
||||
|
||||
void Acceptor::Listen( const std::string & host, const uint16_t & port )
|
||||
{
|
||||
void Acceptor::Listen( const std::string& host, const uint16_t& port )
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::asio::ip::tcp::resolver resolver( m_hive->GetService() );
|
||||
|
@ -109,22 +109,22 @@ namespace Core
|
|||
assert( true );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HivePtr Acceptor::GetHive()
|
||||
{
|
||||
return m_hive;
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::acceptor & Acceptor::GetAcceptor()
|
||||
{
|
||||
return m_acceptor;
|
||||
}
|
||||
|
||||
bool Acceptor::HasError()
|
||||
{
|
||||
return ( boost::interprocess::ipcdetail::atomic_cas32( &m_error_state, 1, 1 ) == 1 );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
HivePtr Acceptor::GetHive()
|
||||
{
|
||||
return m_hive;
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::acceptor& Acceptor::GetAcceptor()
|
||||
{
|
||||
return m_acceptor;
|
||||
}
|
||||
|
||||
bool Acceptor::HasError()
|
||||
{
|
||||
return ( boost::interprocess::ipcdetail::atomic_cas32( &m_error_state, 1, 1 ) == 1 );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,62 +7,66 @@
|
|||
#include <boost/shared_ptr.hpp>
|
||||
#include "Forwards.h"
|
||||
|
||||
namespace Core
|
||||
namespace Core {
|
||||
namespace Network {
|
||||
|
||||
class Connection;
|
||||
|
||||
class Acceptor :
|
||||
public boost::enable_shared_from_this< Acceptor >
|
||||
{
|
||||
namespace Network
|
||||
{
|
||||
|
||||
class Connection;
|
||||
|
||||
class Acceptor : public boost::enable_shared_from_this< Acceptor >
|
||||
{
|
||||
friend class Hive;
|
||||
|
||||
private:
|
||||
private:
|
||||
HivePtr m_hive;
|
||||
boost::asio::ip::tcp::acceptor m_acceptor;
|
||||
boost::asio::strand m_io_strand;
|
||||
volatile uint32_t m_error_state;
|
||||
|
||||
private:
|
||||
Acceptor( const Acceptor & rhs );
|
||||
Acceptor & operator =( const Acceptor & rhs );
|
||||
void StartError( const boost::system::error_code & error );
|
||||
void DispatchAccept( ConnectionPtr connection );
|
||||
void HandleAccept( const boost::system::error_code & error, ConnectionPtr connection );
|
||||
private:
|
||||
Acceptor( const Acceptor& rhs );
|
||||
|
||||
private:
|
||||
Acceptor& operator=( const Acceptor& rhs );
|
||||
|
||||
void StartError( const boost::system::error_code& error );
|
||||
|
||||
void DispatchAccept( ConnectionPtr connection );
|
||||
|
||||
void HandleAccept( const boost::system::error_code& error, ConnectionPtr connection );
|
||||
|
||||
private:
|
||||
// Called when a connection has connected to the server. This function
|
||||
// should return true to invoke the connection's OnAccept function if the
|
||||
// connection will be kept. If the connection will not be kept, the
|
||||
// connection's Disconnect function should be called and the function
|
||||
// should return false.
|
||||
virtual bool OnAccept( ConnectionPtr connection, const std::string & host, uint16_t port );
|
||||
virtual bool OnAccept( ConnectionPtr connection, const std::string& host, uint16_t port );
|
||||
|
||||
// Called when an error is encountered. Most typically, this is when the
|
||||
// acceptor is being closed via the Stop function or if the Listen is
|
||||
// called on an address that is not available.
|
||||
virtual void OnError( const boost::system::error_code & error );
|
||||
virtual void OnError( const boost::system::error_code& error );
|
||||
|
||||
public:
|
||||
public:
|
||||
Acceptor( HivePtr hive );
|
||||
|
||||
virtual ~Acceptor();
|
||||
|
||||
// Returns the Hive object.
|
||||
HivePtr GetHive();
|
||||
|
||||
// Returns the acceptor object.
|
||||
boost::asio::ip::tcp::acceptor & GetAcceptor();
|
||||
boost::asio::ip::tcp::acceptor& GetAcceptor();
|
||||
|
||||
// Returns the strand object.
|
||||
boost::asio::strand & GetStrand();
|
||||
boost::asio::strand& GetStrand();
|
||||
|
||||
// Returns true if this object has an error associated with it.
|
||||
bool HasError();
|
||||
|
||||
public:
|
||||
public:
|
||||
// Begin listening on the specific network interface.
|
||||
void Listen( const std::string & host, const uint16_t & port );
|
||||
void Listen( const std::string& host, const uint16_t& port );
|
||||
|
||||
// Posts the connection to the listening interface. The next client that
|
||||
// connections will be given this connection. If multiple calls to Accept
|
||||
|
@ -71,8 +75,8 @@ namespace Core
|
|||
|
||||
// Stop the Acceptor from listening.
|
||||
void Stop();
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -12,12 +12,18 @@
|
|||
// They are also defined within the Core::Common namespace to avoid collisions.
|
||||
// +---------------------------------------------------------------------------
|
||||
namespace Core {
|
||||
namespace Network {
|
||||
namespace ActorControl {
|
||||
namespace Network {
|
||||
namespace ActorControl {
|
||||
|
||||
enum ActorControlType : uint16_t
|
||||
{
|
||||
enum ActorControlType :
|
||||
uint16_t
|
||||
{
|
||||
/*! Toggles weapon status -> Sheathed/UnSheathed
|
||||
\param param1 status 0|1 */
|
||||
ToggleWeapon = 0x00,
|
||||
/*! Toggles Autoattack status on/off
|
||||
\param param1 status 0|1 */
|
||||
AutoAttack = 0x01,
|
||||
SetStatus = 0x02,
|
||||
CastStart = 0x03,
|
||||
ToggleAggro = 0x04,
|
||||
|
@ -192,6 +198,7 @@ namespace Core {
|
|||
SetMaxGearSets = 0x230,
|
||||
|
||||
SetCharaGearParamUI = 0x260,
|
||||
ToggleWireframeRendering = 0x261,
|
||||
|
||||
GearSetEquipMsg = 0x321,
|
||||
|
||||
|
@ -216,10 +223,10 @@ namespace Core {
|
|||
SetDutyActionHud = 0x5E9, // disable/enable
|
||||
SetDutyActionActive = 0x5EA,
|
||||
SetDutyActionRemaining = 0x5EB,
|
||||
};
|
||||
};
|
||||
|
||||
enum ClientTriggerType
|
||||
{
|
||||
enum ClientTriggerType
|
||||
{
|
||||
ToggleSheathe = 0x01,
|
||||
ToggleAutoAttack = 0x02,
|
||||
ChangeTarget = 0x03,
|
||||
|
@ -233,6 +240,7 @@ namespace Core {
|
|||
FinishZoning = 0xC9,
|
||||
Teleport = 0xCA,
|
||||
|
||||
Examine = 0x12C,
|
||||
MarkPlayer = 0x12D, // Mark player, visible to party only
|
||||
SetTitleReq = 0x12E,
|
||||
TitleList = 0x12F,
|
||||
|
@ -242,7 +250,7 @@ namespace Core {
|
|||
|
||||
ClearWaymarks = 0x13A,
|
||||
CameraMode = 0x13B, // param12, 1 = camera mode enable, 0 = disable
|
||||
|
||||
CharaNameReq = 0x13D, // requests character name by content id
|
||||
HuntingLogDetails = 0x194,
|
||||
|
||||
Timers = 0x1AB,
|
||||
|
@ -262,6 +270,10 @@ namespace Core {
|
|||
AchievementComp = 0x203,
|
||||
AchievementCatChat = 0x206,
|
||||
|
||||
QuestJournalUpdateQuestVisibility = 0x2BE,
|
||||
QuestJournalClosed = 0x2BF,
|
||||
|
||||
AbandonQuest = 0x320,
|
||||
|
||||
DirectorInitFinish = 0x321,
|
||||
|
||||
|
@ -285,10 +297,10 @@ namespace Core {
|
|||
OpenDuelUI = 0x898, // Open a duel ui
|
||||
DuelRequestResult = 0x899, // either accept/reject
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
} /* ActorControl */
|
||||
} /* Common */
|
||||
} /* ActorControl */
|
||||
} /* Common */
|
||||
} /* Core */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -70,12 +70,12 @@ struct FFXIVARR_PACKET_HEADER
|
|||
uint32_t unknown_24;
|
||||
};
|
||||
|
||||
inline ostream& operator << ( ostream& os, const FFXIVARR_PACKET_HEADER& hdr )
|
||||
inline ostream& operator<<( ostream& os, const FFXIVARR_PACKET_HEADER& hdr )
|
||||
{
|
||||
return os.write( reinterpret_cast< const char* >( &hdr ), sizeof hdr );
|
||||
}
|
||||
|
||||
inline istream& operator >> ( istream& is, FFXIVARR_PACKET_HEADER& hdr )
|
||||
inline istream& operator>>( istream& is, FFXIVARR_PACKET_HEADER& hdr )
|
||||
{
|
||||
return is.read( reinterpret_cast< char* >( &hdr ), sizeof hdr );
|
||||
}
|
||||
|
@ -108,20 +108,24 @@ struct FFXIVARR_PACKET_SEGMENT_HEADER
|
|||
uint16_t padding;
|
||||
};
|
||||
|
||||
inline ostream& operator << ( ostream& os, const FFXIVARR_PACKET_SEGMENT_HEADER& hdr )
|
||||
inline ostream& operator<<( ostream& os, const FFXIVARR_PACKET_SEGMENT_HEADER& hdr )
|
||||
{
|
||||
return os.write( reinterpret_cast< const char* >( &hdr ), sizeof hdr );
|
||||
}
|
||||
|
||||
inline istream& operator >> ( istream& is, FFXIVARR_PACKET_SEGMENT_HEADER& hdr )
|
||||
inline istream& operator>>( istream& is, FFXIVARR_PACKET_SEGMENT_HEADER& hdr )
|
||||
{
|
||||
return is.read( reinterpret_cast< char* >( &hdr ), sizeof hdr );
|
||||
}
|
||||
|
||||
template < int T > struct FFXIVIpcBasePacket
|
||||
template< int T >
|
||||
struct FFXIVIpcBasePacket
|
||||
{
|
||||
/** Creates a constant representing the IPC type */
|
||||
enum { _ServerIpcType = T };
|
||||
enum
|
||||
{
|
||||
_ServerIpcType = T
|
||||
};
|
||||
};
|
||||
|
||||
struct FFXIVARR_PACKET_RAW
|
||||
|
@ -167,12 +171,12 @@ struct FFXIVARR_IPC_HEADER
|
|||
uint32_t padding1;
|
||||
};
|
||||
|
||||
inline ostream& operator << ( ostream& os, const FFXIVARR_IPC_HEADER& hdr )
|
||||
inline ostream& operator<<( ostream& os, const FFXIVARR_IPC_HEADER& hdr )
|
||||
{
|
||||
return os.write( reinterpret_cast< const char* >( &hdr ), sizeof hdr );
|
||||
}
|
||||
|
||||
inline istream& operator >> ( istream& is, FFXIVARR_IPC_HEADER& hdr )
|
||||
inline istream& operator>>( istream& is, FFXIVARR_IPC_HEADER& hdr )
|
||||
{
|
||||
return is.read( reinterpret_cast< char* >( &hdr ), sizeof hdr );
|
||||
}
|
||||
|
|
|
@ -4,32 +4,33 @@
|
|||
#include <boost/bind.hpp>
|
||||
|
||||
namespace Core {
|
||||
namespace Network {
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace Network {
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Connection::Connection( HivePtr hive )
|
||||
: m_hive( hive ),
|
||||
Connection::Connection( HivePtr hive )
|
||||
:
|
||||
m_hive( hive ),
|
||||
m_socket( hive->GetService() ),
|
||||
m_io_strand( hive->GetService() ),
|
||||
m_receive_buffer_size( 32000 ),
|
||||
m_error_state( 0 )
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
Connection::~Connection()
|
||||
{
|
||||
}
|
||||
Connection::~Connection()
|
||||
{
|
||||
}
|
||||
|
||||
void Connection::Bind( const std::string & ip, uint16_t port )
|
||||
{
|
||||
void Connection::Bind( const std::string& ip, uint16_t port )
|
||||
{
|
||||
boost::asio::ip::tcp::endpoint endpoint( boost::asio::ip::address::from_string( ip ), port );
|
||||
m_socket.open( endpoint.protocol() );
|
||||
m_socket.set_option( boost::asio::ip::tcp::acceptor::reuse_address( false ) );
|
||||
m_socket.bind( endpoint );
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::StartSend()
|
||||
{
|
||||
void Connection::StartSend()
|
||||
{
|
||||
if( !m_pending_sends.empty() )
|
||||
{
|
||||
boost::asio::async_write( m_socket,
|
||||
|
@ -39,10 +40,10 @@ namespace Core {
|
|||
boost::asio::placeholders::error,
|
||||
m_pending_sends.begin() ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::StartRecv( int32_t total_bytes )
|
||||
{
|
||||
void Connection::StartRecv( int32_t total_bytes )
|
||||
{
|
||||
if( total_bytes > 0 )
|
||||
{
|
||||
m_recv_buffer.resize( total_bytes );
|
||||
|
@ -62,10 +63,10 @@ namespace Core {
|
|||
_1,
|
||||
_2 ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::StartError( const boost::system::error_code & error )
|
||||
{
|
||||
void Connection::StartError( const boost::system::error_code& error )
|
||||
{
|
||||
if( boost::interprocess::ipcdetail::atomic_cas32( &m_error_state, 1, 0 ) == 0 )
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
|
@ -73,10 +74,10 @@ namespace Core {
|
|||
m_socket.close( ec );
|
||||
OnError( error );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::HandleConnect( const boost::system::error_code & error )
|
||||
{
|
||||
void Connection::HandleConnect( const boost::system::error_code& error )
|
||||
{
|
||||
if( error || HasError() || m_hive->HasStopped() )
|
||||
{
|
||||
StartError( error );
|
||||
|
@ -93,10 +94,11 @@ namespace Core {
|
|||
StartError( error );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::HandleSend( const boost::system::error_code & error, std::list< std::vector< uint8_t > >::iterator itr )
|
||||
{
|
||||
void
|
||||
Connection::HandleSend( const boost::system::error_code& error, std::list< std::vector< uint8_t > >::iterator itr )
|
||||
{
|
||||
if( error || HasError() || m_hive->HasStopped() )
|
||||
{
|
||||
StartError( error );
|
||||
|
@ -107,10 +109,10 @@ namespace Core {
|
|||
m_pending_sends.erase( itr );
|
||||
StartSend();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::HandleRecv( const boost::system::error_code & error, int32_t actual_bytes )
|
||||
{
|
||||
void Connection::HandleRecv( const boost::system::error_code& error, int32_t actual_bytes )
|
||||
{
|
||||
if( error || HasError() || m_hive->HasStopped() )
|
||||
{
|
||||
StartError( error );
|
||||
|
@ -126,85 +128,86 @@ namespace Core {
|
|||
StartRecv( m_pending_recvs.front() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::DispatchSend( std::vector< uint8_t > buffer )
|
||||
{
|
||||
void Connection::DispatchSend( std::vector< uint8_t > buffer )
|
||||
{
|
||||
bool should_start_send = m_pending_sends.empty();
|
||||
m_pending_sends.push_back( buffer );
|
||||
if( should_start_send )
|
||||
{
|
||||
StartSend();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::DispatchRecv( int32_t total_bytes )
|
||||
{
|
||||
void Connection::DispatchRecv( int32_t total_bytes )
|
||||
{
|
||||
bool should_start_receive = m_pending_recvs.empty();
|
||||
m_pending_recvs.push_back( total_bytes );
|
||||
if( should_start_receive )
|
||||
{
|
||||
StartRecv( total_bytes );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Connection::Connect( const std::string & host, uint16_t port)
|
||||
{
|
||||
void Connection::Connect( const std::string& host, uint16_t port )
|
||||
{
|
||||
boost::asio::ip::tcp::resolver resolver( m_hive->GetService() );
|
||||
boost::asio::ip::tcp::resolver::query query( host, std::to_string( port ) );
|
||||
boost::asio::ip::tcp::resolver::iterator iterator = resolver.resolve( query );
|
||||
m_socket.async_connect( *iterator, m_io_strand.wrap( boost::bind( &Connection::HandleConnect, shared_from_this(), _1 ) ) );
|
||||
m_socket.async_connect( *iterator,
|
||||
m_io_strand.wrap( boost::bind( &Connection::HandleConnect, shared_from_this(), _1 ) ) );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::Disconnect()
|
||||
{
|
||||
void Connection::Disconnect()
|
||||
{
|
||||
OnDisconnect();
|
||||
m_socket.close();
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::Recv( int32_t total_bytes )
|
||||
{
|
||||
void Connection::Recv( int32_t total_bytes )
|
||||
{
|
||||
m_io_strand.post( boost::bind( &Connection::DispatchRecv, shared_from_this(), total_bytes ) );
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::Send( const std::vector< uint8_t > & buffer )
|
||||
{
|
||||
void Connection::Send( const std::vector< uint8_t >& buffer )
|
||||
{
|
||||
m_io_strand.post( boost::bind( &Connection::DispatchSend, shared_from_this(), buffer ) );
|
||||
}
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::socket & Connection::GetSocket()
|
||||
{
|
||||
boost::asio::ip::tcp::socket& Connection::GetSocket()
|
||||
{
|
||||
return m_socket;
|
||||
}
|
||||
}
|
||||
|
||||
boost::asio::strand & Connection::GetStrand()
|
||||
{
|
||||
boost::asio::strand& Connection::GetStrand()
|
||||
{
|
||||
return m_io_strand;
|
||||
}
|
||||
}
|
||||
|
||||
HivePtr Connection::GetHive()
|
||||
{
|
||||
HivePtr Connection::GetHive()
|
||||
{
|
||||
return m_hive;
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::SetReceiveBufferSize( int32_t size )
|
||||
{
|
||||
void Connection::SetReceiveBufferSize( int32_t size )
|
||||
{
|
||||
m_receive_buffer_size = size;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t Connection::GetReceiveBufferSize() const
|
||||
{
|
||||
int32_t Connection::GetReceiveBufferSize() const
|
||||
{
|
||||
return m_receive_buffer_size;
|
||||
}
|
||||
}
|
||||
|
||||
bool Connection::HasError()
|
||||
{
|
||||
bool Connection::HasError()
|
||||
{
|
||||
return ( boost::interprocess::ipcdetail::atomic_cas32( &m_error_state, 1, 1 ) == 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
|
@ -14,21 +14,25 @@
|
|||
|
||||
|
||||
namespace Core {
|
||||
namespace Network {
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace Network {
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class Hive;
|
||||
class Acceptor;
|
||||
class Connection;
|
||||
class Hive;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class Acceptor;
|
||||
|
||||
class Connection : public boost::enable_shared_from_this< Connection >
|
||||
{
|
||||
class Connection;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class Connection :
|
||||
public boost::enable_shared_from_this< Connection >
|
||||
{
|
||||
friend class Acceptor;
|
||||
|
||||
friend class Hive;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
HivePtr m_hive;
|
||||
boost::asio::ip::tcp::socket m_socket;
|
||||
boost::asio::strand m_io_strand;
|
||||
|
@ -40,49 +44,71 @@ namespace Core {
|
|||
|
||||
|
||||
Connection( HivePtr hive );
|
||||
|
||||
virtual ~Connection();
|
||||
|
||||
private:
|
||||
Connection( const Connection & rhs );
|
||||
Connection & operator =( const Connection & rhs );
|
||||
private:
|
||||
Connection( const Connection& rhs );
|
||||
|
||||
Connection& operator=( const Connection& rhs );
|
||||
|
||||
void StartSend();
|
||||
|
||||
void StartRecv( int32_t total_bytes );
|
||||
void StartError( const boost::system::error_code & error );
|
||||
|
||||
void StartError( const boost::system::error_code& error );
|
||||
|
||||
void DispatchSend( std::vector< uint8_t > buffer );
|
||||
|
||||
void DispatchRecv( int32_t total_bytes );
|
||||
void HandleConnect( const boost::system::error_code & error );
|
||||
void HandleSend( const boost::system::error_code & error, std::list< std::vector< uint8_t > >::iterator itr );
|
||||
void HandleRecv( const boost::system::error_code & error, int32_t actual_bytes );
|
||||
|
||||
void HandleConnect( const boost::system::error_code& error );
|
||||
|
||||
void HandleSend( const boost::system::error_code& error, std::list< std::vector< uint8_t > >::iterator itr );
|
||||
|
||||
void HandleRecv( const boost::system::error_code& error, int32_t actual_bytes );
|
||||
|
||||
|
||||
private:
|
||||
private:
|
||||
// Called when the connection has successfully connected to the local host.
|
||||
virtual void OnAccept( const std::string & host, uint16_t port ) {};
|
||||
virtual void OnAccept( const std::string& host, uint16_t port )
|
||||
{
|
||||
};
|
||||
|
||||
// Called when the connection has successfully connected to the remote host.
|
||||
virtual void OnConnect( const std::string & host, uint16_t port ) {};
|
||||
virtual void OnConnect( const std::string& host, uint16_t port )
|
||||
{
|
||||
};
|
||||
|
||||
// Called when data has been sent by the connection.
|
||||
virtual void OnSend( const std::vector< uint8_t > & buffer ) {};
|
||||
virtual void OnSend( const std::vector< uint8_t >& buffer )
|
||||
{
|
||||
};
|
||||
|
||||
// Called when data has been received by the connection.
|
||||
virtual void OnRecv( std::vector< uint8_t > & buffer ) {};
|
||||
virtual void OnRecv( std::vector< uint8_t >& buffer )
|
||||
{
|
||||
};
|
||||
|
||||
// Called when an error is encountered.
|
||||
virtual void OnError( const boost::system::error_code & error ) {};
|
||||
virtual void OnError( const boost::system::error_code& error )
|
||||
{
|
||||
};
|
||||
|
||||
// Called when the connection has been disconnected
|
||||
virtual void OnDisconnect() {};
|
||||
virtual void OnDisconnect()
|
||||
{
|
||||
};
|
||||
|
||||
public:
|
||||
public:
|
||||
// Returns the Hive object.
|
||||
HivePtr GetHive();
|
||||
|
||||
// Returns the socket object.
|
||||
boost::asio::ip::tcp::socket & GetSocket();
|
||||
boost::asio::ip::tcp::socket& GetSocket();
|
||||
|
||||
// Returns the strand object.
|
||||
boost::asio::strand & GetStrand();
|
||||
boost::asio::strand& GetStrand();
|
||||
|
||||
// Sets the application specific receive buffer size used. For stream
|
||||
// based protocols such as HTTP, you want this to be pretty large, like
|
||||
|
@ -98,13 +124,13 @@ namespace Core {
|
|||
bool HasError();
|
||||
|
||||
// Binds the socket to the specified interface.
|
||||
void Bind( const std::string & ip, uint16_t port );
|
||||
void Bind( const std::string& ip, uint16_t port );
|
||||
|
||||
// Starts an a/synchronous connect.
|
||||
void Connect( const std::string & host, uint16_t port );
|
||||
void Connect( const std::string& host, uint16_t port );
|
||||
|
||||
// Posts data to be sent to the connection.
|
||||
void Send( const std::vector< uint8_t > & buffer );
|
||||
void Send( const std::vector< uint8_t >& buffer );
|
||||
|
||||
// Posts a recv for the connection to process. If total_bytes is 0, then
|
||||
// as many bytes as possible up to GetReceiveBufferSize() will be
|
||||
|
@ -114,15 +140,15 @@ namespace Core {
|
|||
|
||||
// Posts an asynchronous disconnect event for the object to process.
|
||||
void Disconnect();
|
||||
};
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
template<class T>
|
||||
boost::shared_ptr< T > addServerToHive( const std::string& listenIp, uint32_t port, HivePtr pHive )
|
||||
{
|
||||
template< class T >
|
||||
boost::shared_ptr< T > addServerToHive( const std::string& listenIp, uint32_t port, HivePtr pHive )
|
||||
{
|
||||
try
|
||||
{
|
||||
AcceptorPtr acceptor( new Acceptor( pHive ) );
|
||||
|
@ -135,9 +161,9 @@ namespace Core {
|
|||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace Packets {
|
|||
// Must forward define these in order to enable the compiler to produce the
|
||||
// correct template functions.
|
||||
|
||||
template < typename T, typename T1 >
|
||||
template< typename T, typename T1 >
|
||||
class FFXIVIpcPacket;
|
||||
|
||||
template< class T >
|
||||
|
@ -41,6 +41,12 @@ boost::shared_ptr< ZoneChannelPacket< T > > makeZonePacket( Args... args )
|
|||
return boost::make_shared< ZoneChannelPacket< T > >( args... );
|
||||
}
|
||||
|
||||
template< class T, typename... Args >
|
||||
boost::shared_ptr< T > makeWrappedPacket( Args... args )
|
||||
{
|
||||
return boost::make_shared< T >( args... );
|
||||
}
|
||||
|
||||
template< class T, typename... Args >
|
||||
boost::shared_ptr< ChatChannelPacket< T > > makeChatPacket( Args... args )
|
||||
{
|
||||
|
@ -56,11 +62,12 @@ boost::shared_ptr< LobbyChannelPacket< T > > makeLobbyPacket( Args... args )
|
|||
/**
|
||||
* The base implementation of a game packet. Needed for parsing packets.
|
||||
*/
|
||||
template < typename T1 >
|
||||
template< typename T1 >
|
||||
class FFXIVIpcPacketBase
|
||||
{
|
||||
public:
|
||||
virtual ~FFXIVIpcPacketBase() = default;
|
||||
|
||||
/**
|
||||
* @brief Gets the IPC type of this packet. (Useful for determining the
|
||||
* type of a parsed packet.)
|
||||
|
@ -103,8 +110,15 @@ protected:
|
|||
uint16_t m_segmentType;
|
||||
|
||||
public:
|
||||
virtual uint32_t getContentSize() { return 0; };
|
||||
virtual std::vector< uint8_t > getContent() { return{}; };
|
||||
virtual uint32_t getContentSize()
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
|
||||
virtual std::vector< uint8_t > getContent()
|
||||
{
|
||||
return {};
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Gets the segment type of this packet.
|
||||
|
@ -163,8 +177,9 @@ public:
|
|||
|
||||
};
|
||||
|
||||
template < typename T, typename T1 >
|
||||
class FFXIVIpcPacket : public FFXIVIpcPacketBase< T1 >, public FFXIVPacketBase
|
||||
template< typename T, typename T1 >
|
||||
class FFXIVIpcPacket :
|
||||
public FFXIVIpcPacketBase< T1 >, public FFXIVPacketBase
|
||||
{
|
||||
public:
|
||||
FFXIVIpcPacket< T, T1 >( uint32_t sourceActorId, uint32_t targetActorId ) :
|
||||
|
@ -185,7 +200,7 @@ public:
|
|||
auto copySize = std::min< uint32_t >( sizeof( T ), rawPacket.segHdr.size - ipcHdrSize );
|
||||
|
||||
memcpy( &m_segHdr, &rawPacket.segHdr, sizeof( FFXIVARR_PACKET_SEGMENT_HEADER ) );
|
||||
memcpy( &m_data, &rawPacket.data[0] + ipcHdrSize, copySize );
|
||||
memcpy( &m_data, &rawPacket.data[ 0 ] + ipcHdrSize, copySize );
|
||||
|
||||
memset( &m_ipcHdr, 0, ipcHdrSize );
|
||||
m_ipcHdr.type = static_cast< ServerZoneIpcType >( m_data._ServerIpcType );
|
||||
|
@ -212,22 +227,28 @@ public:
|
|||
|
||||
std::vector< uint8_t > data( segmentHeaderSize + ipcHeaderSize + dataSize );
|
||||
|
||||
memcpy( &data[0], &m_segHdr, segmentHeaderSize );
|
||||
memcpy( &data[segmentHeaderSize], &m_ipcHdr, ipcHeaderSize );
|
||||
memcpy( &data[segmentHeaderSize + ipcHeaderSize], &m_data, dataSize );
|
||||
memcpy( &data[ 0 ], &m_segHdr, segmentHeaderSize );
|
||||
memcpy( &data[ segmentHeaderSize ], &m_ipcHdr, ipcHeaderSize );
|
||||
memcpy( &data[ segmentHeaderSize + ipcHeaderSize ], &m_data, dataSize );
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
virtual T1 ipcType()
|
||||
T1 ipcType() override
|
||||
{
|
||||
return static_cast< T1 >( m_data._ServerIpcType );
|
||||
};
|
||||
|
||||
/** Gets a reference to the underlying IPC data structure. */
|
||||
T& data() { return m_data; };
|
||||
T& data()
|
||||
{
|
||||
return m_data;
|
||||
};
|
||||
|
||||
const T& data() const { return m_data; }
|
||||
const T& data() const
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
protected:
|
||||
/** Initializes the fields of the header structures */
|
||||
|
@ -251,7 +272,8 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
class FFXIVRawPacket : public FFXIVPacketBase
|
||||
class FFXIVRawPacket :
|
||||
public FFXIVPacketBase
|
||||
{
|
||||
public:
|
||||
FFXIVRawPacket( uint16_t type, uint32_t size, uint32_t sourceActorId, uint32_t targetActorId ) :
|
||||
|
@ -267,7 +289,7 @@ public:
|
|||
{
|
||||
auto segmentHdrSize = sizeof( FFXIVARR_PACKET_SEGMENT_HEADER );
|
||||
|
||||
memcpy( &m_data[0], data + segmentHdrSize, size - segmentHdrSize );
|
||||
memcpy( &m_data[ 0 ], data + segmentHdrSize, size - segmentHdrSize );
|
||||
memcpy( &m_segHdr, data, segmentHdrSize );
|
||||
}
|
||||
|
||||
|
@ -285,21 +307,24 @@ public:
|
|||
{
|
||||
std::vector< uint8_t > data( sizeof( FFXIVARR_PACKET_SEGMENT_HEADER ) + m_data.size() );
|
||||
|
||||
memcpy( &data[0], &m_segHdr, sizeof( FFXIVARR_PACKET_SEGMENT_HEADER ) );
|
||||
memcpy( &data[sizeof( FFXIVARR_PACKET_SEGMENT_HEADER )], &m_data[0], m_data.size() );
|
||||
memcpy( &data[ 0 ], &m_segHdr, sizeof( FFXIVARR_PACKET_SEGMENT_HEADER ) );
|
||||
memcpy( &data[ sizeof( FFXIVARR_PACKET_SEGMENT_HEADER ) ], &m_data[ 0 ], m_data.size() );
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/** Gets a reference to the underlying IPC data structure. */
|
||||
std::vector< uint8_t >& data() { return m_data; };
|
||||
std::vector< uint8_t >& data()
|
||||
{
|
||||
return m_data;
|
||||
};
|
||||
|
||||
protected:
|
||||
/** Initializes the fields of the header structures */
|
||||
virtual void initialize()
|
||||
{
|
||||
// Zero out the structures.
|
||||
memset( &m_data[0], 0, m_data.size() );
|
||||
memset( &m_data[ 0 ], 0, m_data.size() );
|
||||
};
|
||||
|
||||
protected:
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
using namespace Core::Network::Packets;
|
||||
|
||||
PacketParseResult Core::Network::Packets::getHeader( const std::vector< uint8_t > &buffer,
|
||||
PacketParseResult Core::Network::Packets::getHeader( const std::vector< uint8_t >& buffer,
|
||||
const uint32_t offset,
|
||||
FFXIVARR_PACKET_HEADER &header )
|
||||
FFXIVARR_PACKET_HEADER& header )
|
||||
{
|
||||
const auto headerSize = sizeof( FFXIVARR_PACKET_HEADER );
|
||||
|
||||
|
@ -19,15 +19,15 @@ PacketParseResult Core::Network::Packets::getHeader( const std::vector< uint8_t
|
|||
// Copy packet header.
|
||||
memcpy( &header, buffer.data() + offset, headerSize );
|
||||
|
||||
if( !checkHeader(header) )
|
||||
if( !checkHeader( header ) )
|
||||
return Malformed;
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
PacketParseResult Core::Network::Packets::getSegmentHeader( const std::vector< uint8_t > &buffer,
|
||||
PacketParseResult Core::Network::Packets::getSegmentHeader( const std::vector< uint8_t >& buffer,
|
||||
const uint32_t offset,
|
||||
FFXIVARR_PACKET_SEGMENT_HEADER &header )
|
||||
FFXIVARR_PACKET_SEGMENT_HEADER& header )
|
||||
{
|
||||
const auto headerSize = sizeof( FFXIVARR_PACKET_SEGMENT_HEADER );
|
||||
|
||||
|
@ -42,10 +42,10 @@ PacketParseResult Core::Network::Packets::getSegmentHeader( const std::vector< u
|
|||
return Success;
|
||||
}
|
||||
|
||||
PacketParseResult Core::Network::Packets::getPackets( const std::vector< uint8_t > &buffer,
|
||||
PacketParseResult Core::Network::Packets::getPackets( const std::vector< uint8_t >& buffer,
|
||||
const uint32_t offset,
|
||||
const FFXIVARR_PACKET_HEADER &packetHeader,
|
||||
std::vector< FFXIVARR_PACKET_RAW > &packets )
|
||||
const FFXIVARR_PACKET_HEADER& packetHeader,
|
||||
std::vector< FFXIVARR_PACKET_RAW >& packets )
|
||||
{
|
||||
// sanity check: check there's enough bytes in the buffer
|
||||
const auto bytesExpected = packetHeader.size - sizeof( struct FFXIVARR_PACKET_HEADER );
|
||||
|
@ -81,8 +81,8 @@ PacketParseResult Core::Network::Packets::getPackets( const std::vector< uint8_t
|
|||
return Success;
|
||||
}
|
||||
|
||||
PacketParseResult Core::Network::Packets::getPacket( const std::vector< uint8_t > &buffer, const uint32_t offset,
|
||||
FFXIVARR_PACKET_RAW &packet )
|
||||
PacketParseResult Core::Network::Packets::getPacket( const std::vector< uint8_t >& buffer, const uint32_t offset,
|
||||
FFXIVARR_PACKET_RAW& packet )
|
||||
{
|
||||
// Copy segment header
|
||||
const auto headerResult = getSegmentHeader( buffer, offset, packet.segHdr );
|
||||
|
@ -103,7 +103,7 @@ PacketParseResult Core::Network::Packets::getPacket( const std::vector< uint8_t
|
|||
return Success;
|
||||
}
|
||||
|
||||
bool Core::Network::Packets::checkHeader( const FFXIVARR_PACKET_HEADER &header )
|
||||
bool Core::Network::Packets::checkHeader( const FFXIVARR_PACKET_HEADER& header )
|
||||
{
|
||||
// Max size of the packet is capped at 1MB for now.
|
||||
if( header.size > 1 * 1024 * 1024 )
|
||||
|
@ -116,7 +116,7 @@ bool Core::Network::Packets::checkHeader( const FFXIVARR_PACKET_HEADER &header )
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Core::Network::Packets::checkSegmentHeader( const FFXIVARR_PACKET_SEGMENT_HEADER &header )
|
||||
bool Core::Network::Packets::checkSegmentHeader( const FFXIVARR_PACKET_SEGMENT_HEADER& header )
|
||||
{
|
||||
// Max size of individual message is capped at 256KB for now.
|
||||
if( header.size > 256 * 1024 )
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
#ifndef _GAMEPACKETPARSER_H
|
||||
#define _GAMEPACKETPARSER_H
|
||||
|
||||
#include "CommonNetwork.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Network {
|
||||
namespace Packets {
|
||||
|
||||
enum PacketParseResult
|
||||
{
|
||||
enum PacketParseResult
|
||||
{
|
||||
/// Dissected game packet successfully
|
||||
Success,
|
||||
|
||||
|
@ -16,32 +17,33 @@ namespace Packets {
|
|||
|
||||
/// Invalid data detected.
|
||||
Malformed
|
||||
};
|
||||
};
|
||||
|
||||
/// Read packet header from buffer with given offset.
|
||||
/// Buffer with given offset must be pointing to start of the new FFXIV packet.
|
||||
PacketParseResult getHeader( const std::vector< uint8_t > &buffer, const uint32_t offset,
|
||||
FFXIVARR_PACKET_HEADER &header );
|
||||
/// Read packet header from buffer with given offset.
|
||||
/// Buffer with given offset must be pointing to start of the new FFXIV packet.
|
||||
PacketParseResult getHeader( const std::vector< uint8_t >& buffer, const uint32_t offset,
|
||||
FFXIVARR_PACKET_HEADER& header );
|
||||
|
||||
/// Read packet header from buffer with given offset.
|
||||
/// Buffer with given offset must be pointing to start of FFXIVARR_PACKET_SEGMENT_HEADER data.
|
||||
/// Keep in mind that this function does check for data validity. Call checkSegmentHeader() if that's needed.
|
||||
PacketParseResult getSegmentHeader( const std::vector< uint8_t > &buffer, const uint32_t offset,
|
||||
FFXIVARR_PACKET_SEGMENT_HEADER &header );
|
||||
/// Read packet header from buffer with given offset.
|
||||
/// Buffer with given offset must be pointing to start of FFXIVARR_PACKET_SEGMENT_HEADER data.
|
||||
/// Keep in mind that this function does check for data validity. Call checkSegmentHeader() if that's needed.
|
||||
PacketParseResult getSegmentHeader( const std::vector< uint8_t >& buffer, const uint32_t offset,
|
||||
FFXIVARR_PACKET_SEGMENT_HEADER& header );
|
||||
|
||||
/// Read packets from the buffer with given offset.
|
||||
/// Buffer with given offset must be pointing to end of FFXIVARR_PACKET_HEADER data.
|
||||
PacketParseResult getPackets( const std::vector< uint8_t > &buffer, const uint32_t offset,
|
||||
const FFXIVARR_PACKET_HEADER &header,
|
||||
std::vector< Packets::FFXIVARR_PACKET_RAW > &packets );
|
||||
/// Read packets from the buffer with given offset.
|
||||
/// Buffer with given offset must be pointing to end of FFXIVARR_PACKET_HEADER data.
|
||||
PacketParseResult getPackets( const std::vector< uint8_t >& buffer, const uint32_t offset,
|
||||
const FFXIVARR_PACKET_HEADER& header,
|
||||
std::vector< Packets::FFXIVARR_PACKET_RAW >& packets );
|
||||
|
||||
/// Read single packet from the buffer with given offset.
|
||||
/// Buffer with an offset must be pointing to start of FFXIVARR_PACKET_SEGMENT_HEADER data.
|
||||
PacketParseResult getPacket( const std::vector< uint8_t > &buffer, const uint32_t offset,
|
||||
FFXIVARR_PACKET_RAW &packet );
|
||||
/// Read single packet from the buffer with given offset.
|
||||
/// Buffer with an offset must be pointing to start of FFXIVARR_PACKET_SEGMENT_HEADER data.
|
||||
PacketParseResult getPacket( const std::vector< uint8_t >& buffer, const uint32_t offset,
|
||||
FFXIVARR_PACKET_RAW& packet );
|
||||
|
||||
bool checkHeader(const FFXIVARR_PACKET_HEADER &header);
|
||||
bool checkSegmentHeader(const FFXIVARR_PACKET_SEGMENT_HEADER &header);
|
||||
bool checkHeader( const FFXIVARR_PACKET_HEADER& header );
|
||||
|
||||
bool checkSegmentHeader( const FFXIVARR_PACKET_SEGMENT_HEADER& header );
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,58 +4,59 @@
|
|||
#include "Hive.h"
|
||||
|
||||
namespace Core {
|
||||
namespace Network {
|
||||
namespace Network {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Hive::Hive()
|
||||
: m_work_ptr( new boost::asio::io_service::work( m_io_service ) ),
|
||||
Hive::Hive()
|
||||
:
|
||||
m_work_ptr( new boost::asio::io_service::work( m_io_service ) ),
|
||||
m_shutdown( 0 )
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
Hive::~Hive()
|
||||
{
|
||||
}
|
||||
Hive::~Hive()
|
||||
{
|
||||
}
|
||||
|
||||
boost::asio::io_service & Hive::GetService()
|
||||
{
|
||||
boost::asio::io_service& Hive::GetService()
|
||||
{
|
||||
return m_io_service;
|
||||
}
|
||||
}
|
||||
|
||||
bool Hive::HasStopped()
|
||||
{
|
||||
bool Hive::HasStopped()
|
||||
{
|
||||
return ( boost::interprocess::ipcdetail::atomic_cas32( &m_shutdown, 1, 1 ) == 1 );
|
||||
}
|
||||
}
|
||||
|
||||
void Hive::Poll()
|
||||
{
|
||||
void Hive::Poll()
|
||||
{
|
||||
m_io_service.poll();
|
||||
}
|
||||
}
|
||||
|
||||
void Hive::Run()
|
||||
{
|
||||
void Hive::Run()
|
||||
{
|
||||
m_io_service.run();
|
||||
}
|
||||
}
|
||||
|
||||
void Hive::Stop()
|
||||
{
|
||||
void Hive::Stop()
|
||||
{
|
||||
if( boost::interprocess::ipcdetail::atomic_cas32( &m_shutdown, 1, 0 ) == 0 )
|
||||
{
|
||||
m_work_ptr.reset();
|
||||
m_io_service.run();
|
||||
m_io_service.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Hive::Reset()
|
||||
{
|
||||
void Hive::Reset()
|
||||
{
|
||||
if( boost::interprocess::ipcdetail::atomic_cas32( &m_shutdown, 0, 1 ) == 1 )
|
||||
{
|
||||
m_io_service.reset();
|
||||
m_work_ptr.reset( new boost::asio::io_service::work( m_io_service ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -6,25 +6,28 @@
|
|||
#include <boost/enable_shared_from_this.hpp>
|
||||
|
||||
namespace Core {
|
||||
namespace Network {
|
||||
namespace Network {
|
||||
|
||||
class Hive : public boost::enable_shared_from_this< Hive >
|
||||
{
|
||||
private:
|
||||
class Hive :
|
||||
public boost::enable_shared_from_this< Hive >
|
||||
{
|
||||
private:
|
||||
boost::asio::io_service m_io_service;
|
||||
boost::shared_ptr< boost::asio::io_service::work > m_work_ptr;
|
||||
volatile uint32_t m_shutdown;
|
||||
|
||||
private:
|
||||
Hive( const Hive & rhs );
|
||||
Hive & operator =( const Hive & rhs );
|
||||
private:
|
||||
Hive( const Hive& rhs );
|
||||
|
||||
public:
|
||||
Hive& operator=( const Hive& rhs );
|
||||
|
||||
public:
|
||||
Hive();
|
||||
|
||||
virtual ~Hive();
|
||||
|
||||
// Returns the io_service of this object.
|
||||
boost::asio::io_service & GetService();
|
||||
boost::asio::io_service& GetService();
|
||||
|
||||
// Returns true if the Stop function has been called.
|
||||
bool HasStopped();
|
||||
|
@ -46,9 +49,9 @@ namespace Core {
|
|||
// Restarts the networking system after Stop as been called. A new work
|
||||
// object is created ad the shutdown flag is cleared.
|
||||
void Reset();
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
#endif
|
|
@ -33,7 +33,7 @@ void Core::Network::Packets::PacketContainer::addPacket( Core::Network::Packets:
|
|||
void Core::Network::Packets::PacketContainer::fillSendBuffer( std::vector< uint8_t >& sendBuffer )
|
||||
{
|
||||
std::vector< uint8_t > tempBuffer( m_ipcHdr.size );
|
||||
memset( &tempBuffer[0], 0, m_ipcHdr.size );
|
||||
memset( &tempBuffer[ 0 ], 0, m_ipcHdr.size );
|
||||
|
||||
using namespace std::chrono;
|
||||
auto ms = duration_cast< milliseconds >( system_clock::now().time_since_epoch() );
|
||||
|
@ -43,7 +43,7 @@ void Core::Network::Packets::PacketContainer::fillSendBuffer( std::vector< uint8
|
|||
m_ipcHdr.timestamp = tick;
|
||||
m_ipcHdr.unknown_20 = 1;
|
||||
|
||||
memcpy( &tempBuffer[0], &m_ipcHdr, sizeof( FFXIVARR_PACKET_HEADER ) );
|
||||
memcpy( &tempBuffer[ 0 ], &m_ipcHdr, sizeof( FFXIVARR_PACKET_HEADER ) );
|
||||
|
||||
auto it = m_entryList.begin();
|
||||
std::size_t offset = 0;
|
||||
|
@ -53,7 +53,7 @@ void Core::Network::Packets::PacketContainer::fillSendBuffer( std::vector< uint8
|
|||
|
||||
for( ; it != m_entryList.end(); ++it )
|
||||
{
|
||||
auto pPacket = (*it);
|
||||
auto pPacket = ( *it );
|
||||
|
||||
if( m_segmentTargetOverride != 0 && pPacket->getSegmentType() == SEGMENTTYPE_IPC )
|
||||
{
|
||||
|
@ -61,11 +61,11 @@ void Core::Network::Packets::PacketContainer::fillSendBuffer( std::vector< uint8
|
|||
}
|
||||
|
||||
auto data = pPacket->getData();
|
||||
memcpy( &tempBuffer[0] + sizeof( FFXIVARR_PACKET_HEADER ) + offset, &data[0], pPacket->getSize() );
|
||||
memcpy( &tempBuffer[ 0 ] + sizeof( FFXIVARR_PACKET_HEADER ) + offset, &data[ 0 ], pPacket->getSize() );
|
||||
offset += pPacket->getSize();
|
||||
}
|
||||
|
||||
sendBuffer.assign( &tempBuffer[0], &tempBuffer[0] + m_ipcHdr.size );
|
||||
sendBuffer.assign( &tempBuffer[ 0 ], &tempBuffer[ 0 ] + m_ipcHdr.size );
|
||||
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ std::string Core::Network::Packets::PacketContainer::toString()
|
|||
std::string str = "\n";
|
||||
for( uint32_t i = 0; i < m_ipcHdr.size; i++ )
|
||||
{
|
||||
str += boost::str( boost::format( "%|02X|" ) % static_cast< int32_t >( tmpBuffer[i] & 0xFF ) ) + " ";
|
||||
str += boost::str( boost::format( "%|02X|" ) % static_cast< int32_t >( tmpBuffer[ i ] & 0xFF ) ) + " ";
|
||||
|
||||
if( ( i + 1 ) % 16 == 0 )
|
||||
str += "\n";
|
||||
|
|
|
@ -18,6 +18,7 @@ class PacketContainer
|
|||
{
|
||||
public:
|
||||
PacketContainer( uint32_t segmentTargetOverride = 0 );
|
||||
|
||||
~PacketContainer();
|
||||
|
||||
void addPacket( FFXIVPacketBasePtr entry );
|
||||
|
|
|
@ -13,7 +13,8 @@ namespace Server {
|
|||
* Structural representation of the packet sent by the server as response
|
||||
* to a tell request
|
||||
*/
|
||||
struct FFXIVIpcTell : FFXIVIpcBasePacket<Tell>
|
||||
struct FFXIVIpcTell :
|
||||
FFXIVIpcBasePacket< Tell >
|
||||
{
|
||||
uint32_t u1;
|
||||
uint16_t u2a;
|
||||
|
@ -25,11 +26,12 @@ struct FFXIVIpcTell : FFXIVIpcBasePacket<Tell>
|
|||
char msg[1031];
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* Structural representation of the packet sent by the server as response
|
||||
* to a failed tell because of unavailable target player
|
||||
*/
|
||||
struct FFXIVIpcTellErrNotFound : FFXIVIpcBasePacket<TellErrNotFound>
|
||||
struct FFXIVIpcTellErrNotFound :
|
||||
FFXIVIpcBasePacket< TellErrNotFound >
|
||||
{
|
||||
char receipientName[32];
|
||||
};
|
||||
|
|
|
@ -7,13 +7,14 @@ namespace Core {
|
|||
namespace Network {
|
||||
namespace Packets {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Lobby Connection IPC Codes
|
||||
/**
|
||||
* Server IPC Lobby Type Codes.
|
||||
*/
|
||||
enum ServerLobbyIpcType : uint16_t
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Lobby Connection IPC Codes
|
||||
/**
|
||||
* Server IPC Lobby Type Codes.
|
||||
*/
|
||||
enum ServerLobbyIpcType :
|
||||
uint16_t
|
||||
{
|
||||
LobbyError = 0x0002,
|
||||
LobbyServiceAccountList = 0x000C,
|
||||
LobbyCharList = 0x000D,
|
||||
|
@ -22,28 +23,30 @@ namespace Packets {
|
|||
LobbyServerList = 0x0015,
|
||||
LobbyRetainerList = 0x0017,
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Client IPC Lobby Type Codes.
|
||||
*/
|
||||
enum ClientLobbyIpcType : uint16_t
|
||||
{
|
||||
/**
|
||||
* Client IPC Lobby Type Codes.
|
||||
*/
|
||||
enum ClientLobbyIpcType :
|
||||
uint16_t
|
||||
{
|
||||
ReqCharList = 0x0003,
|
||||
ReqEnterWorld = 0x0004,
|
||||
ReqServiceAccountList = 0x0005,
|
||||
|
||||
ReqCharDelete = 0x000A,
|
||||
ReqCharCreate = 0x000B,
|
||||
};
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Zone Connection IPC Codes
|
||||
/**
|
||||
* Server IPC Zone Type Codes.
|
||||
*/
|
||||
enum ServerZoneIpcType : uint16_t
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Zone Connection IPC Codes
|
||||
/**
|
||||
* Server IPC Zone Type Codes.
|
||||
*/
|
||||
enum ServerZoneIpcType :
|
||||
uint16_t
|
||||
{
|
||||
|
||||
// static opcode ( the ones that rarely, if ever, change )
|
||||
Ping = 0x0065,
|
||||
|
@ -73,16 +76,20 @@ namespace Packets {
|
|||
SocialRequestResponse = 0x00BB, // updated 4.1
|
||||
CancelAllianceForming = 0x00C6, // updated 4.2
|
||||
|
||||
|
||||
|
||||
Playtime = 0x00F5, // updated 4.3
|
||||
Chat = 0x00F7, // updated 4.3
|
||||
SocialList = 0x00FD, // updated 4.3
|
||||
|
||||
UpdateSearchInfo = 0x0100, // updated 4.3
|
||||
InitSearchInfo = 0x0101, // updated 4.3
|
||||
ExamineSearchComment = 0x0102, // updated 4.1
|
||||
|
||||
ServerNotice = 0x0106, // updated 4.3
|
||||
SetOnlineStatus = 0x0107, // updated 4.3
|
||||
|
||||
|
||||
CountdownInitiate = 0x0111, // updated 4.3
|
||||
CountdownCancel = 0x0112, // updated 4.3
|
||||
|
||||
|
@ -91,15 +98,21 @@ namespace Packets {
|
|||
LogMessage = 0x00D0,
|
||||
|
||||
LinkshellList = 0x011C, // updated 4.3
|
||||
|
||||
ExamineFreeCompanyInfo = 0x013A, // updated 4.1
|
||||
CharaFreeCompanyTag = 0x013B, // updated 4.3
|
||||
FreeCompanyBoardMsg = 0x013C, // updated 4.3
|
||||
FreeCompanyInfo = 0x013D, // updated 4.3
|
||||
|
||||
StatusEffectList = 0x014E, // updated 4.3
|
||||
Effect = 0x0151, // updated 4.3
|
||||
AoeEffect8 = 0x0154, // updated 4.3
|
||||
AoeEffect16 = 0x0155, // updated 4.3
|
||||
AoeEffect24 = 0x0156, // updated 4.3
|
||||
AoeEffect32 = 0x0157, // updated 4.3
|
||||
PersistantEffect = 0x0158, // updated 4.3
|
||||
|
||||
GCAffiliation = 0xCCFC, // OUTDATED
|
||||
GCAffiliation = 0x0162, // updated 4.3
|
||||
|
||||
PlayerSpawn = 0x0172, // updated 4.3
|
||||
NpcSpawn = 0x0173, // updated 4.3
|
||||
|
@ -123,19 +136,20 @@ namespace Packets {
|
|||
PlayerStateFlags = 0x0184, // updated 4.3
|
||||
PlayerClassInfo = 0x0185, // updated 4.3
|
||||
ModelEquip = 0x0186, // updated 4.3
|
||||
|
||||
Examine = 0x0187, // updated 4.3
|
||||
CharaNameReq = 0x0189, // updated 4.3
|
||||
UpdateClassInfo = 0x018A, // updated 4.3
|
||||
|
||||
ItemInfo = 0x0190, // updated 4.3
|
||||
ContainerInfo = 0x0192, // updated 4.3
|
||||
InventoryTransactionFinish = 0x0193, // updated 4.3
|
||||
InventoryTransaction = 0x0194, // updated 4.3
|
||||
CurrencyCrystalInfo = 0x0195, // updated 4.3
|
||||
InventoryActionAck = 0x0197, // updated 4.3
|
||||
CurrencyCrystalInfo = 0xFFFF, // updated 4.3 - wrong opcode
|
||||
|
||||
UpdateInventorySlot = 0x0198, // updated 4.3
|
||||
|
||||
EventPlay = 0x01A6, // updated 4.3
|
||||
EventOpenGilShop = 0x01AD, // updated 4.3
|
||||
DirectorPlayScene = 0x01AA, // updated 4.3
|
||||
|
||||
EventStart = 0x01AF, // updated 4.3
|
||||
|
@ -186,13 +200,14 @@ namespace Packets {
|
|||
IPCTYPE_UNK_320 = 0x024C, // updated 4.3
|
||||
IPCTYPE_UNK_322 = 0x024E, // updated 4.3
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Client IPC Zone Type Codes.
|
||||
*/
|
||||
enum ClientZoneIpcType : uint16_t
|
||||
{
|
||||
/**
|
||||
* Client IPC Zone Type Codes.
|
||||
*/
|
||||
enum ClientZoneIpcType :
|
||||
uint16_t
|
||||
{
|
||||
|
||||
PingHandler = 0x0065, // unchanged 4.3
|
||||
InitHandler = 0x0066, // unchanged 4.3
|
||||
|
@ -202,7 +217,6 @@ namespace Packets {
|
|||
CFCommenceHandler = 0x006F,
|
||||
|
||||
|
||||
|
||||
CFRegisterDuty = 0x0071,
|
||||
CFRegisterRoulette = 0x0072,
|
||||
PlayTimeHandler = 0x0073, // unchanged 4.3
|
||||
|
@ -217,6 +231,8 @@ namespace Packets {
|
|||
|
||||
SocialListHandler = 0x00DB, // updated 4.3
|
||||
ReqSearchInfoHandler = 0x00E0, // updated 4.3
|
||||
ReqExamineSearchCommentHandler = 0x00E1, // updated 4.1
|
||||
|
||||
SetSearchInfoHandler = 0x00DE, // updated 4.3
|
||||
|
||||
BlackListHandler = 0x00EC, // updated 4.3
|
||||
|
@ -224,8 +240,12 @@ namespace Packets {
|
|||
|
||||
LinkshellListHandler = 0x00F4, // updated 4.3
|
||||
|
||||
SearchMarketboard = 0x0103, // updated 4.3
|
||||
ReqExamineFcInfo = 0x010F, // updated 4.1
|
||||
|
||||
FcInfoReqHandler = 0x011A, // updated 4.2
|
||||
|
||||
ReqMarketWishList = 0x012C, // updated 4.3
|
||||
|
||||
ReqJoinNoviceNetwork = 0x0129, // updated 4.2
|
||||
|
||||
|
@ -265,26 +285,28 @@ namespace Packets {
|
|||
ReqEquipDisplayFlagsChange = 0x0178, // updated 4.3
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Chat Connection IPC Codes
|
||||
/**
|
||||
* Server IPC Chat Type Codes.
|
||||
*/
|
||||
enum ServerChatIpcType : uint16_t
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Chat Connection IPC Codes
|
||||
/**
|
||||
* Server IPC Chat Type Codes.
|
||||
*/
|
||||
enum ServerChatIpcType :
|
||||
uint16_t
|
||||
{
|
||||
Tell = 0x0064, // updated for sb
|
||||
TellErrNotFound = 0x0066,
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Client IPC Chat Type Codes.
|
||||
*/
|
||||
enum ClientChatIpcType : uint16_t
|
||||
{
|
||||
/**
|
||||
* Client IPC Chat Type Codes.
|
||||
*/
|
||||
enum ClientChatIpcType :
|
||||
uint16_t
|
||||
{
|
||||
TellReq = 0x0064,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
} /* Packets */
|
||||
|
|
|
@ -9,14 +9,16 @@ namespace Network {
|
|||
namespace Packets {
|
||||
namespace Server {
|
||||
|
||||
struct FFXIVIpcRetainerList : FFXIVIpcBasePacket<LobbyRetainerList>
|
||||
struct FFXIVIpcRetainerList :
|
||||
FFXIVIpcBasePacket< LobbyRetainerList >
|
||||
{
|
||||
uint8_t padding[0x210];
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
struct FFXIVIpcServiceIdInfo : FFXIVIpcBasePacket<LobbyServiceAccountList>
|
||||
struct FFXIVIpcServiceIdInfo :
|
||||
FFXIVIpcBasePacket< LobbyServiceAccountList >
|
||||
{
|
||||
uint64_t seq;
|
||||
uint8_t padding;
|
||||
|
@ -35,7 +37,8 @@ struct FFXIVIpcServiceIdInfo : FFXIVIpcBasePacket<LobbyServiceAccountList>
|
|||
};
|
||||
|
||||
|
||||
struct FFXIVIpcServerList : FFXIVIpcBasePacket<LobbyServerList>
|
||||
struct FFXIVIpcServerList :
|
||||
FFXIVIpcBasePacket< LobbyServerList >
|
||||
{
|
||||
uint64_t seq;
|
||||
uint16_t final;
|
||||
|
@ -56,7 +59,8 @@ struct FFXIVIpcServerList : FFXIVIpcBasePacket<LobbyServerList>
|
|||
} server[6];
|
||||
};
|
||||
|
||||
struct FFXIVIpcCharList : FFXIVIpcBasePacket<LobbyCharList>
|
||||
struct FFXIVIpcCharList :
|
||||
FFXIVIpcBasePacket< LobbyCharList >
|
||||
{
|
||||
uint64_t seq;
|
||||
uint8_t counter; // current packet count * 4, count * 4 +1 on last packet.
|
||||
|
@ -96,7 +100,8 @@ struct FFXIVIpcCharList : FFXIVIpcBasePacket<LobbyCharList>
|
|||
|
||||
};
|
||||
|
||||
struct FFXIVIpcEnterWorld : FFXIVIpcBasePacket<LobbyEnterWorld>
|
||||
struct FFXIVIpcEnterWorld :
|
||||
FFXIVIpcBasePacket< LobbyEnterWorld >
|
||||
{
|
||||
uint64_t seq;
|
||||
uint32_t charId;
|
||||
|
@ -110,7 +115,8 @@ struct FFXIVIpcEnterWorld : FFXIVIpcBasePacket<LobbyEnterWorld>
|
|||
uint64_t padding4;
|
||||
};
|
||||
|
||||
struct FFXIVIpcCharCreate : FFXIVIpcBasePacket<LobbyCharCreate>
|
||||
struct FFXIVIpcCharCreate :
|
||||
FFXIVIpcBasePacket< LobbyCharCreate >
|
||||
{
|
||||
uint64_t seq;
|
||||
uint8_t unknown;
|
||||
|
@ -129,7 +135,8 @@ struct FFXIVIpcCharCreate : FFXIVIpcBasePacket<LobbyCharCreate>
|
|||
char world[32];
|
||||
};
|
||||
|
||||
struct FFXIVIpcLobbyError : FFXIVIpcBasePacket<LobbyError>
|
||||
struct FFXIVIpcLobbyError :
|
||||
FFXIVIpcBasePacket< LobbyError >
|
||||
{
|
||||
uint64_t seq;
|
||||
uint32_t error_id;
|
||||
|
|
|
@ -9,7 +9,8 @@ namespace Network {
|
|||
namespace Packets {
|
||||
namespace Client {
|
||||
|
||||
struct FFXIVIpcGmCommand1 : FFXIVIpcBasePacket< GMCommand1 >
|
||||
struct FFXIVIpcGmCommand1 :
|
||||
FFXIVIpcBasePacket< GMCommand1 >
|
||||
{
|
||||
/* 0000 */ uint32_t commandId;
|
||||
/* 0004 */ uint32_t param1;
|
||||
|
@ -18,14 +19,16 @@ struct FFXIVIpcGmCommand1 : FFXIVIpcBasePacket< GMCommand1 >
|
|||
/* 0018 */ uint32_t param3;
|
||||
};
|
||||
|
||||
struct FFXIVIpcGmCommand2 : FFXIVIpcBasePacket< GMCommand2 >
|
||||
struct FFXIVIpcGmCommand2 :
|
||||
FFXIVIpcBasePacket< GMCommand2 >
|
||||
{
|
||||
/* 0000 */ uint32_t commandId;
|
||||
/* 0004 */ char unk_4[0x10];
|
||||
/* 0014 */ char param1[0x20];
|
||||
};
|
||||
|
||||
struct FFXIVIpcClientTrigger : FFXIVIpcBasePacket< ClientTrigger >
|
||||
struct FFXIVIpcClientTrigger :
|
||||
FFXIVIpcBasePacket< ClientTrigger >
|
||||
{
|
||||
/* 0000 */ uint16_t commandId;
|
||||
/* 0002 */ uint8_t unk_2[2];
|
||||
|
@ -36,7 +39,8 @@ struct FFXIVIpcClientTrigger : FFXIVIpcBasePacket< ClientTrigger >
|
|||
/* 0018 */ uint64_t param3;
|
||||
};
|
||||
|
||||
struct FFXIVIpcSkillHandler : FFXIVIpcBasePacket< SkillHandler >
|
||||
struct FFXIVIpcSkillHandler :
|
||||
FFXIVIpcBasePacket< SkillHandler >
|
||||
{
|
||||
/* 0000 */ char pad_0000[1];
|
||||
/* 0001 */ uint8_t type;
|
||||
|
@ -47,17 +51,20 @@ struct FFXIVIpcSkillHandler : FFXIVIpcBasePacket< SkillHandler >
|
|||
/* 0010 */ uint64_t targetId;
|
||||
};
|
||||
|
||||
struct FFXIVIpcZoneLineHandler : FFXIVIpcBasePacket< ZoneLineHandler >
|
||||
struct FFXIVIpcZoneLineHandler :
|
||||
FFXIVIpcBasePacket< ZoneLineHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t zoneLineId;
|
||||
};
|
||||
|
||||
struct FFXIVIpcDiscoveryHandler : FFXIVIpcBasePacket< DiscoveryHandler >
|
||||
struct FFXIVIpcDiscoveryHandler :
|
||||
FFXIVIpcBasePacket< DiscoveryHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t positionRef;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEventHandlerReturn : FFXIVIpcBasePacket< ReturnEventHandler >
|
||||
struct FFXIVIpcEventHandlerReturn :
|
||||
FFXIVIpcBasePacket< ReturnEventHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t eventId;
|
||||
/* 0004 */ uint16_t scene;
|
||||
|
@ -65,48 +72,57 @@ struct FFXIVIpcEventHandlerReturn : FFXIVIpcBasePacket< ReturnEventHandler >
|
|||
/* 0008 */ uint16_t param2;
|
||||
/* 000A */ char pad_000A[2];
|
||||
/* 000C */ uint16_t param3;
|
||||
/* 000E */ char pad_000E[2];
|
||||
/* 0010 */ uint16_t param4;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEnterTerritoryHandler : FFXIVIpcBasePacket< EnterTeriEventHandler >
|
||||
struct FFXIVIpcEnterTerritoryHandler :
|
||||
FFXIVIpcBasePacket< EnterTeriEventHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t eventId;
|
||||
/* 0004 */ uint16_t param1;
|
||||
/* 0006 */ uint16_t param2;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEventHandlerOutsideRange : FFXIVIpcBasePacket< OutOfRangeEventHandler >
|
||||
struct FFXIVIpcEventHandlerOutsideRange :
|
||||
FFXIVIpcBasePacket< OutOfRangeEventHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t param1;
|
||||
/* 0004 */ uint32_t eventId;
|
||||
/* 0008 */ Common::FFXIVARR_POSITION3 position;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEventHandlerWithinRange : FFXIVIpcBasePacket< WithinRangeEventHandler >
|
||||
struct FFXIVIpcEventHandlerWithinRange :
|
||||
FFXIVIpcBasePacket< WithinRangeEventHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t param1;
|
||||
/* 0004 */ uint32_t eventId;
|
||||
/* 0008 */ Common::FFXIVARR_POSITION3 position;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEventHandlerEmote : FFXIVIpcBasePacket< EmoteEventHandler >
|
||||
struct FFXIVIpcEventHandlerEmote :
|
||||
FFXIVIpcBasePacket< EmoteEventHandler >
|
||||
{
|
||||
/* 0000 */ uint64_t actorId;
|
||||
/* 0008 */ uint32_t eventId;
|
||||
/* 000C */ uint16_t emoteId;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEventHandlerTalk : FFXIVIpcBasePacket< TalkEventHandler >
|
||||
struct FFXIVIpcEventHandlerTalk :
|
||||
FFXIVIpcBasePacket< TalkEventHandler >
|
||||
{
|
||||
/* 0000 */ uint64_t actorId;
|
||||
/* 0008 */ uint32_t eventId;
|
||||
};
|
||||
|
||||
struct FFXIVIpcPingHandler : FFXIVIpcBasePacket< PingHandler >
|
||||
struct FFXIVIpcPingHandler :
|
||||
FFXIVIpcBasePacket< PingHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t timestamp; // maybe lol..
|
||||
};
|
||||
|
||||
struct FFXIVIpcSetSearchInfo : FFXIVIpcBasePacket< SetSearchInfoHandler >
|
||||
struct FFXIVIpcSetSearchInfo :
|
||||
FFXIVIpcBasePacket< SetSearchInfoHandler >
|
||||
{
|
||||
union
|
||||
{
|
||||
|
@ -123,14 +139,16 @@ struct FFXIVIpcSetSearchInfo : FFXIVIpcBasePacket< SetSearchInfoHandler >
|
|||
/* 0012 */ char searchComment[193];
|
||||
};
|
||||
|
||||
struct FFXIVIpcTellHandler : FFXIVIpcBasePacket< TellReq >
|
||||
struct FFXIVIpcTellHandler :
|
||||
FFXIVIpcBasePacket< TellReq >
|
||||
{
|
||||
/* 0000 */ char pad_0000[4];
|
||||
/* 0004 */ char targetPCName[32];
|
||||
/* 0024 */ char message[1012];
|
||||
};
|
||||
|
||||
struct FFXIVIpcChatHandler : FFXIVIpcBasePacket< ChatHandler >
|
||||
struct FFXIVIpcChatHandler :
|
||||
FFXIVIpcBasePacket< ChatHandler >
|
||||
{
|
||||
/* 0000 */ char pad_0000[4];
|
||||
/* 0004 */ uint32_t sourceId;
|
||||
|
@ -139,7 +157,8 @@ struct FFXIVIpcChatHandler : FFXIVIpcBasePacket< ChatHandler >
|
|||
/* 001A */ char message[1012];
|
||||
};
|
||||
|
||||
struct FFXIVIpcLinkshellEventHandler : FFXIVIpcBasePacket< LinkshellEventHandler >
|
||||
struct FFXIVIpcLinkshellEventHandler :
|
||||
FFXIVIpcBasePacket< LinkshellEventHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t eventId;
|
||||
/* 0004 */ uint16_t scene;
|
||||
|
@ -147,13 +166,12 @@ struct FFXIVIpcLinkshellEventHandler : FFXIVIpcBasePacket< LinkshellEventHandler
|
|||
/* 0007 */ char lsName[21];
|
||||
};
|
||||
|
||||
struct FFXIVIpcInventoryModifyHandler : FFXIVIpcBasePacket< InventoryModifyHandler >
|
||||
struct FFXIVIpcInventoryModifyHandler :
|
||||
FFXIVIpcBasePacket< InventoryModifyHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t seq;
|
||||
/* 0004 */ Common::InventoryOperation action;
|
||||
/* 0005 */ char pad_0005[3];
|
||||
/* 0008 */ uint16_t splitCount; // todo: check packet handler in game and see if this is sent as a u16 or u32
|
||||
/* 000A */ char pad_000A[2];
|
||||
/* 0005 */ char pad_0005[7];
|
||||
/* 000C */ uint16_t fromContainer;
|
||||
/* 000E */ char pad_000E[2];
|
||||
/* 0010 */ uint8_t fromSlot;
|
||||
|
@ -161,6 +179,8 @@ struct FFXIVIpcInventoryModifyHandler : FFXIVIpcBasePacket< InventoryModifyHandl
|
|||
/* 0020 */ uint16_t toContainer;
|
||||
/* 0022 */ char pad_0022[2];
|
||||
/* 0024 */ uint8_t toSlot;
|
||||
/* 0025 */ uint8_t pad_0025[3];
|
||||
/* 0028 */ uint32_t splitCount;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ namespace Server {
|
|||
* Structural representation of the packet sent by the server as response
|
||||
* to a ping packet
|
||||
*/
|
||||
struct FFXIVIpcPing : FFXIVIpcBasePacket<Ping>
|
||||
struct FFXIVIpcPing :
|
||||
FFXIVIpcBasePacket< Ping >
|
||||
{
|
||||
/* 0000 */ uint64_t timeInMilliseconds;
|
||||
/* 0008 */ uint8_t unknown_8[0x38];
|
||||
|
@ -29,7 +30,8 @@ struct FFXIVIpcPing : FFXIVIpcBasePacket<Ping>
|
|||
* Structural representation of the packet sent by the server as response
|
||||
* to a ping packet
|
||||
*/
|
||||
struct FFXIVIpcInit : FFXIVIpcBasePacket<Init>
|
||||
struct FFXIVIpcInit :
|
||||
FFXIVIpcBasePacket< Init >
|
||||
{
|
||||
uint64_t unknown;
|
||||
uint32_t charId;
|
||||
|
@ -40,7 +42,8 @@ struct FFXIVIpcInit : FFXIVIpcBasePacket<Init>
|
|||
* Structural representation of the packet sent by the server
|
||||
* carrying chat messages
|
||||
*/
|
||||
struct FFXIVIpcChat : FFXIVIpcBasePacket<Chat>
|
||||
struct FFXIVIpcChat :
|
||||
FFXIVIpcBasePacket< Chat >
|
||||
{
|
||||
/* 0000 */ uint8_t padding[14]; //Maybe this is SubCode, or some kind of talker ID...
|
||||
Common::ChatType chatType;
|
||||
|
@ -48,7 +51,8 @@ struct FFXIVIpcChat : FFXIVIpcBasePacket<Chat>
|
|||
char msg[1012];
|
||||
};
|
||||
|
||||
struct FFXIVIpcChatBanned : FFXIVIpcBasePacket<ChatBanned>
|
||||
struct FFXIVIpcChatBanned :
|
||||
FFXIVIpcBasePacket< ChatBanned >
|
||||
{
|
||||
uint8_t padding[4]; // I was not sure reinterpreting ZST is valid behavior in C++.
|
||||
// client doesn't care about the data (zero sized) for this opcode anyway.
|
||||
|
@ -58,7 +62,8 @@ struct FFXIVIpcChatBanned : FFXIVIpcBasePacket<ChatBanned>
|
|||
* Structural representation of the packet sent by the server
|
||||
* carrying chat messages
|
||||
*/
|
||||
struct FFXIVIpcLogout : FFXIVIpcBasePacket<Logout>
|
||||
struct FFXIVIpcLogout :
|
||||
FFXIVIpcBasePacket< Logout >
|
||||
{
|
||||
uint32_t flags1;
|
||||
uint32_t flags2;
|
||||
|
@ -68,7 +73,8 @@ struct FFXIVIpcLogout : FFXIVIpcBasePacket<Logout>
|
|||
* Structural representation of the packet sent by the server
|
||||
* sent to show the play time
|
||||
*/
|
||||
struct FFXIVIpcPlayTime : FFXIVIpcBasePacket<Playtime>
|
||||
struct FFXIVIpcPlayTime :
|
||||
FFXIVIpcBasePacket< Playtime >
|
||||
{
|
||||
uint32_t playTimeInMinutes;
|
||||
uint32_t padding;
|
||||
|
@ -79,7 +85,8 @@ struct FFXIVIpcPlayTime : FFXIVIpcBasePacket<Playtime>
|
|||
* Structural representation of the packet sent by the server
|
||||
* with a list of players ( party list | friend list | search results )
|
||||
*/
|
||||
struct PlayerEntry {
|
||||
struct PlayerEntry
|
||||
{
|
||||
uint64_t contentId;
|
||||
uint8_t bytes[12];
|
||||
uint16_t zoneId;
|
||||
|
@ -96,7 +103,8 @@ struct PlayerEntry {
|
|||
char fcTag[9];
|
||||
};
|
||||
|
||||
struct FFXIVIpcSocialList : FFXIVIpcBasePacket<SocialList>
|
||||
struct FFXIVIpcSocialList :
|
||||
FFXIVIpcBasePacket< SocialList >
|
||||
{
|
||||
uint32_t padding;
|
||||
uint32_t padding1;
|
||||
|
@ -109,7 +117,8 @@ struct FFXIVIpcSocialList : FFXIVIpcBasePacket<SocialList>
|
|||
};
|
||||
|
||||
|
||||
struct FFXIVIpcSetSearchInfo : FFXIVIpcBasePacket<UpdateSearchInfo>
|
||||
struct FFXIVIpcSetSearchInfo :
|
||||
FFXIVIpcBasePacket< UpdateSearchInfo >
|
||||
{
|
||||
uint64_t onlineStatusFlags;
|
||||
uint64_t unknown;
|
||||
|
@ -120,7 +129,8 @@ struct FFXIVIpcSetSearchInfo : FFXIVIpcBasePacket<UpdateSearchInfo>
|
|||
uint8_t padding2;
|
||||
};
|
||||
|
||||
struct FFXIVIpcInitSearchInfo : FFXIVIpcBasePacket<InitSearchInfo>
|
||||
struct FFXIVIpcInitSearchInfo :
|
||||
FFXIVIpcBasePacket< InitSearchInfo >
|
||||
{
|
||||
uint64_t onlineStatusFlags;
|
||||
uint64_t unknown;
|
||||
|
@ -130,22 +140,35 @@ struct FFXIVIpcInitSearchInfo : FFXIVIpcBasePacket<InitSearchInfo>
|
|||
char padding[5];
|
||||
};
|
||||
|
||||
struct FFXIVIpcExamineSearchComment :
|
||||
FFXIVIpcBasePacket< ExamineSearchComment >
|
||||
{
|
||||
uint32_t charId;
|
||||
// packet only has 196 bytes after the charid
|
||||
// likely utf8
|
||||
char searchComment[195];
|
||||
char padding;
|
||||
};
|
||||
|
||||
/**
|
||||
* Structural representation of the packet sent by the server
|
||||
* to display a server notice message
|
||||
*/
|
||||
struct FFXIVIpcServerNotice : FFXIVIpcBasePacket<ServerNotice>
|
||||
struct FFXIVIpcServerNotice :
|
||||
FFXIVIpcBasePacket< ServerNotice >
|
||||
{
|
||||
/* 0000 */ uint8_t padding;
|
||||
char message[307];
|
||||
};
|
||||
|
||||
struct FFXIVIpcSetOnlineStatus : FFXIVIpcBasePacket<SetOnlineStatus>
|
||||
struct FFXIVIpcSetOnlineStatus :
|
||||
FFXIVIpcBasePacket< SetOnlineStatus >
|
||||
{
|
||||
uint64_t onlineStatusFlags;
|
||||
};
|
||||
|
||||
struct FFXIVIpcBlackList : FFXIVIpcBasePacket<BlackList>
|
||||
struct FFXIVIpcBlackList :
|
||||
FFXIVIpcBasePacket< BlackList >
|
||||
{
|
||||
struct BlEntry
|
||||
{
|
||||
|
@ -158,7 +181,8 @@ struct FFXIVIpcBlackList : FFXIVIpcBasePacket<BlackList>
|
|||
uint32_t padding2;
|
||||
};
|
||||
|
||||
struct FFXIVIpcLogMessage : FFXIVIpcBasePacket<LogMessage>
|
||||
struct FFXIVIpcLogMessage :
|
||||
FFXIVIpcBasePacket< LogMessage >
|
||||
{
|
||||
uint32_t field_0;
|
||||
uint32_t field_4;
|
||||
|
@ -172,7 +196,8 @@ struct FFXIVIpcLogMessage : FFXIVIpcBasePacket<LogMessage>
|
|||
uint32_t field_58;
|
||||
};
|
||||
|
||||
struct FFXIVIpcLinkshellList : FFXIVIpcBasePacket<LinkshellList>
|
||||
struct FFXIVIpcLinkshellList :
|
||||
FFXIVIpcBasePacket< LinkshellList >
|
||||
{
|
||||
struct LsEntry
|
||||
{
|
||||
|
@ -185,7 +210,27 @@ struct FFXIVIpcLinkshellList : FFXIVIpcBasePacket<LinkshellList>
|
|||
} entry[8];
|
||||
};
|
||||
|
||||
struct FFXIVIpcStatusEffectList : FFXIVIpcBasePacket<StatusEffectList>
|
||||
struct FFXIVIpcExamineFreeCompanyInfo :
|
||||
FFXIVIpcBasePacket< ExamineFreeCompanyInfo >
|
||||
{
|
||||
char unknown[0x20]; // likely fc allegiance/icon/housing info etc
|
||||
uint32_t charId;
|
||||
uint32_t fcTimeCreated;
|
||||
char unknown2[0x10];
|
||||
uint16_t unknown3;
|
||||
char fcName[0x14]; // 20 char limit
|
||||
uint16_t padding;
|
||||
char fcTag[0x05]; // 5 char tag limit
|
||||
uint16_t padding2; // null terminator?
|
||||
char fcLeader[0x20]; // leader name (32 bytes)
|
||||
char fcSlogan[192]; // source: https://ffxiv.gamerescape.com/wiki/Free_Company (packet cap confirms this size also)
|
||||
char padding3; // null terminator?
|
||||
char fcEstateProfile[20]; // todo: size needs confirmation
|
||||
uint32_t padding4;
|
||||
};
|
||||
|
||||
struct FFXIVIpcStatusEffectList :
|
||||
FFXIVIpcBasePacket< StatusEffectList >
|
||||
{
|
||||
uint8_t classId;
|
||||
uint8_t level1;
|
||||
|
@ -200,7 +245,8 @@ struct FFXIVIpcStatusEffectList : FFXIVIpcBasePacket<StatusEffectList>
|
|||
uint32_t padding;
|
||||
};
|
||||
|
||||
struct FFXIVGCAffiliation : FFXIVIpcBasePacket<GCAffiliation>
|
||||
struct FFXIVGCAffiliation :
|
||||
FFXIVIpcBasePacket< GCAffiliation >
|
||||
{
|
||||
uint8_t gcId;
|
||||
uint8_t gcRank[3];
|
||||
|
@ -210,7 +256,8 @@ struct FFXIVGCAffiliation : FFXIVIpcBasePacket<GCAffiliation>
|
|||
* Structural representation of the packet sent by the server
|
||||
* add a status effect
|
||||
*/
|
||||
struct FFXIVIpcAddStatusEffect : FFXIVIpcBasePacket<AddStatusEffect>
|
||||
struct FFXIVIpcAddStatusEffect :
|
||||
FFXIVIpcBasePacket< AddStatusEffect >
|
||||
{
|
||||
uint32_t unknown;
|
||||
uint32_t actor_id;
|
||||
|
@ -237,7 +284,8 @@ struct FFXIVIpcAddStatusEffect : FFXIVIpcBasePacket<AddStatusEffect>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to update certain player details / status
|
||||
*/
|
||||
struct FFXIVIpcActorControl142 : FFXIVIpcBasePacket<ActorControl142>
|
||||
struct FFXIVIpcActorControl142 :
|
||||
FFXIVIpcBasePacket< ActorControl142 >
|
||||
{
|
||||
/* 0000 */ uint16_t category;
|
||||
/* 0002 */ uint16_t padding;
|
||||
|
@ -252,7 +300,8 @@ struct FFXIVIpcActorControl142 : FFXIVIpcBasePacket<ActorControl142>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to update certain player details / status
|
||||
*/
|
||||
struct FFXIVIpcActorControl143 : FFXIVIpcBasePacket<ActorControl143>
|
||||
struct FFXIVIpcActorControl143 :
|
||||
FFXIVIpcBasePacket< ActorControl143 >
|
||||
{
|
||||
/* 0000 */ uint16_t category;
|
||||
/* 0002 */ uint16_t padding;
|
||||
|
@ -269,7 +318,8 @@ struct FFXIVIpcActorControl143 : FFXIVIpcBasePacket<ActorControl143>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to update certain player details / status
|
||||
*/
|
||||
struct FFXIVIpcActorControl144 : FFXIVIpcBasePacket<ActorControl144>
|
||||
struct FFXIVIpcActorControl144 :
|
||||
FFXIVIpcBasePacket< ActorControl144 >
|
||||
{
|
||||
/* 0000 */ uint16_t category;
|
||||
/* 0002 */ uint16_t padding;
|
||||
|
@ -285,7 +335,8 @@ struct FFXIVIpcActorControl144 : FFXIVIpcBasePacket<ActorControl144>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to update HP / MP / TP
|
||||
*/
|
||||
struct FFXIVIpcUpdateHpMpTp : FFXIVIpcBasePacket<UpdateHpMpTp>
|
||||
struct FFXIVIpcUpdateHpMpTp :
|
||||
FFXIVIpcBasePacket< UpdateHpMpTp >
|
||||
{
|
||||
/* 0000 */ uint32_t hp;
|
||||
/* 0004 */ uint16_t mp;
|
||||
|
@ -299,36 +350,88 @@ struct FFXIVIpcUpdateHpMpTp : FFXIVIpcBasePacket<UpdateHpMpTp>
|
|||
* Structural representation of the packet sent by the server
|
||||
* for battle actions
|
||||
*/
|
||||
struct effectEntry
|
||||
struct EffectEntry
|
||||
{
|
||||
Common::ActionEffectType effectType;
|
||||
Common::ActionHitSeverityType hitSeverity;
|
||||
uint8_t unknown_3;
|
||||
int8_t bonusPercent;
|
||||
int16_t value;
|
||||
uint8_t param;
|
||||
int8_t bonusPercent; // shows an additional percentage in the battle log, will not change the damage number sent & shown
|
||||
uint8_t valueMultiplier; // This multiplies whatever value is in the 'value' param by 10. Possibly a workaround for big numbers
|
||||
uint8_t unknown_6;
|
||||
uint8_t flags;
|
||||
int16_t value;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEffect : FFXIVIpcBasePacket<Effect>
|
||||
struct EffectHeader
|
||||
{
|
||||
uint32_t targetId;
|
||||
uint32_t unknown_1;
|
||||
uint32_t actionAnimationId;
|
||||
uint32_t unknown_2;
|
||||
uint32_t unknown_5;
|
||||
uint32_t unknown_6;
|
||||
uint32_t effectTargetId;
|
||||
uint64_t animationTargetId; // who the animation targets
|
||||
uint32_t actionId; // what the casting player casts, shown in battle log/ui
|
||||
|
||||
uint32_t globalEffectCounter; // seems to only increment on retail?
|
||||
float animationLockTime; // maybe? doesn't seem to do anything
|
||||
|
||||
uint32_t someTargetId; // always 00 00 00 E0, 0x0E000000 is the internal def for INVALID TARGET ID
|
||||
|
||||
uint16_t hiddenAnimation; // if 0, always shows animation, otherwise hides it. counts up by 1 for each animation skipped on a caster
|
||||
|
||||
uint16_t rotation;
|
||||
uint16_t actionTextId;
|
||||
uint8_t unknown_61;
|
||||
uint8_t unknown_62;
|
||||
uint8_t unknown_10;
|
||||
uint8_t numEffects;
|
||||
uint32_t u11;
|
||||
effectEntry effects[8];
|
||||
uint32_t effectTarget;
|
||||
uint64_t unknown_8;
|
||||
|
||||
uint16_t actionAnimationId; // the animation that is played by the casting character
|
||||
uint8_t unknown1E; // can be 0,1,2 - maybe other values? - doesn't do anything?
|
||||
|
||||
Common::ActionEffectDisplayType effectDisplayType;
|
||||
|
||||
uint8_t unknown20; // is read by handler, runs code which gets the LODWORD of animationLockTime (wtf?)
|
||||
uint8_t effectCount; // ignores effects if 0, otherwise parses all of them
|
||||
|
||||
uint32_t padding_22[2];
|
||||
};
|
||||
|
||||
struct FFXIVIpcEffect :
|
||||
FFXIVIpcBasePacket< Effect >
|
||||
{
|
||||
EffectHeader header;
|
||||
|
||||
EffectEntry effects[8];
|
||||
|
||||
uint16_t padding_6A[3];
|
||||
|
||||
uint32_t effectTargetId; // who the effect targets
|
||||
uint32_t effectFlags; // nonzero = effects do nothing, no battle log, no ui text - only shows animations
|
||||
|
||||
uint32_t padding_78;
|
||||
};
|
||||
|
||||
template< int size >
|
||||
struct FFXIVIpcAoeEffect
|
||||
{
|
||||
EffectHeader header;
|
||||
|
||||
EffectEntry effects[size];
|
||||
|
||||
uint16_t padding_6A[3];
|
||||
|
||||
uint32_t effectTargetId[size];
|
||||
Common::FFXIVARR_POSITION3 position;
|
||||
uint32_t effectFlags;
|
||||
|
||||
uint32_t padding_78;
|
||||
};
|
||||
|
||||
struct FFXIVIpcAoeEffect8 :
|
||||
FFXIVIpcBasePacket< AoeEffect8 >, FFXIVIpcAoeEffect< 8 >
|
||||
{
|
||||
};
|
||||
struct FFXIVIpcAoeEffect16 :
|
||||
FFXIVIpcBasePacket< AoeEffect16 >, FFXIVIpcAoeEffect< 16 >
|
||||
{
|
||||
};
|
||||
struct FFXIVIpcAoeEffect24 :
|
||||
FFXIVIpcBasePacket< AoeEffect24 >, FFXIVIpcAoeEffect< 24 >
|
||||
{
|
||||
};
|
||||
struct FFXIVIpcAoeEffect32 :
|
||||
FFXIVIpcBasePacket< AoeEffect32 >, FFXIVIpcAoeEffect< 32 >
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
|
@ -336,7 +439,8 @@ struct FFXIVIpcEffect : FFXIVIpcBasePacket<Effect>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to spawn an actor
|
||||
*/
|
||||
struct FFXIVIpcPlayerSpawn : FFXIVIpcBasePacket<PlayerSpawn>
|
||||
struct FFXIVIpcPlayerSpawn :
|
||||
FFXIVIpcBasePacket< PlayerSpawn >
|
||||
{
|
||||
uint16_t title;
|
||||
uint16_t u1b;
|
||||
|
@ -382,7 +486,7 @@ struct FFXIVIpcPlayerSpawn : FFXIVIpcBasePacket<PlayerSpawn>
|
|||
uint8_t spawnIndex;
|
||||
uint8_t state;
|
||||
uint8_t persistentEmote;
|
||||
uint8_t modelType; // modelType -> eventSystemDefine
|
||||
uint8_t modelType;
|
||||
uint8_t subtype;
|
||||
uint8_t voice;
|
||||
uint16_t u25c;
|
||||
|
@ -412,7 +516,8 @@ struct FFXIVIpcPlayerSpawn : FFXIVIpcBasePacket<PlayerSpawn>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to spawn an actor
|
||||
*/
|
||||
struct FFXIVIpcNpcSpawn : FFXIVIpcBasePacket<NpcSpawn>
|
||||
struct FFXIVIpcNpcSpawn :
|
||||
FFXIVIpcBasePacket< NpcSpawn >
|
||||
{
|
||||
uint32_t gimmickId; // needs to be existing in the map, mob will snap to it
|
||||
uint8_t u2b;
|
||||
|
@ -420,7 +525,7 @@ struct FFXIVIpcNpcSpawn : FFXIVIpcBasePacket<NpcSpawn>
|
|||
uint8_t gmRank;
|
||||
uint8_t u3b;
|
||||
|
||||
uint8_t u3a;
|
||||
uint8_t aggressionMode; // 1 passive, 2 aggressive
|
||||
uint8_t onlineStatus;
|
||||
uint8_t u3c;
|
||||
uint8_t pose;
|
||||
|
@ -441,8 +546,8 @@ struct FFXIVIpcNpcSpawn : FFXIVIpcBasePacket<NpcSpawn>
|
|||
uint32_t u18;
|
||||
uint32_t u19;
|
||||
uint32_t directorId;
|
||||
uint32_t ownerId;
|
||||
uint32_t u22;
|
||||
uint32_t spawnerId;
|
||||
uint32_t parentActorId;
|
||||
uint32_t hPMax;
|
||||
uint32_t hPCurr;
|
||||
uint32_t displayFlags;
|
||||
|
@ -481,13 +586,19 @@ struct FFXIVIpcNpcSpawn : FFXIVIpcBasePacket<NpcSpawn>
|
|||
uint8_t look[26];
|
||||
char fcTag[6];
|
||||
uint32_t unk30;
|
||||
uint32_t unk31;
|
||||
uint8_t bNPCPartSlot;
|
||||
uint8_t unk32;
|
||||
uint16_t unk33;
|
||||
uint32_t unk34;
|
||||
};
|
||||
|
||||
/**
|
||||
* Structural representation of the packet sent by the server
|
||||
* to show player movement
|
||||
*/
|
||||
struct FFXIVIpcActorFreeSpawn : FFXIVIpcBasePacket<ActorFreeSpawn>
|
||||
struct FFXIVIpcActorFreeSpawn :
|
||||
FFXIVIpcBasePacket< ActorFreeSpawn >
|
||||
{
|
||||
uint32_t spawnId;
|
||||
uint32_t actorId;
|
||||
|
@ -497,7 +608,8 @@ struct FFXIVIpcActorFreeSpawn : FFXIVIpcBasePacket<ActorFreeSpawn>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to show player movement
|
||||
*/
|
||||
struct FFXIVIpcActorMove : FFXIVIpcBasePacket<ActorMove>
|
||||
struct FFXIVIpcActorMove :
|
||||
FFXIVIpcBasePacket< ActorMove >
|
||||
{
|
||||
/* 0000 */ uint8_t rotation;
|
||||
/* 0001 */ uint8_t unknown_1;
|
||||
|
@ -514,7 +626,8 @@ struct FFXIVIpcActorMove : FFXIVIpcBasePacket<ActorMove>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to set an actors position
|
||||
*/
|
||||
struct FFXIVIpcActorSetPos : FFXIVIpcBasePacket<ActorSetPos>
|
||||
struct FFXIVIpcActorSetPos :
|
||||
FFXIVIpcBasePacket< ActorSetPos >
|
||||
{
|
||||
uint16_t r16;
|
||||
uint8_t waitForLoad;
|
||||
|
@ -528,12 +641,12 @@ struct FFXIVIpcActorSetPos : FFXIVIpcBasePacket<ActorSetPos>
|
|||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Structural representation of the packet sent by the server
|
||||
* to start an actors casting
|
||||
*/
|
||||
struct FFXIVIpcActorCast : FFXIVIpcBasePacket<ActorCast>
|
||||
struct FFXIVIpcActorCast :
|
||||
FFXIVIpcBasePacket< ActorCast >
|
||||
{
|
||||
uint16_t action_id;
|
||||
Common::SkillType skillType;
|
||||
|
@ -549,7 +662,8 @@ struct FFXIVIpcActorCast : FFXIVIpcBasePacket<ActorCast>
|
|||
uint16_t unknown_3;
|
||||
};
|
||||
|
||||
struct FFXIVIpcHateList : FFXIVIpcBasePacket<HateList>
|
||||
struct FFXIVIpcHateList :
|
||||
FFXIVIpcBasePacket< HateList >
|
||||
{
|
||||
uint32_t numEntries;
|
||||
struct LsEntry
|
||||
|
@ -562,7 +676,8 @@ struct FFXIVIpcHateList : FFXIVIpcBasePacket<HateList>
|
|||
uint32_t padding;
|
||||
};
|
||||
|
||||
struct FFXIVIpcUpdateClassInfo : FFXIVIpcBasePacket<UpdateClassInfo>
|
||||
struct FFXIVIpcUpdateClassInfo :
|
||||
FFXIVIpcBasePacket< UpdateClassInfo >
|
||||
{
|
||||
uint8_t classId;
|
||||
uint8_t level1;
|
||||
|
@ -576,7 +691,8 @@ struct FFXIVIpcUpdateClassInfo : FFXIVIpcBasePacket<UpdateClassInfo>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to send the titles available to the player
|
||||
*/
|
||||
struct FFXIVIpcPlayerTitleList : FFXIVIpcBasePacket<PlayerTitleList>
|
||||
struct FFXIVIpcPlayerTitleList :
|
||||
FFXIVIpcBasePacket< PlayerTitleList >
|
||||
{
|
||||
uint8_t titleList[48];
|
||||
};
|
||||
|
@ -585,7 +701,8 @@ struct FFXIVIpcPlayerTitleList : FFXIVIpcBasePacket<PlayerTitleList>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to initialize a zone for the player
|
||||
*/
|
||||
struct FFXIVIpcInitZone : FFXIVIpcBasePacket<InitZone>
|
||||
struct FFXIVIpcInitZone :
|
||||
FFXIVIpcBasePacket< InitZone >
|
||||
{
|
||||
uint16_t serverId;
|
||||
uint16_t zoneId;
|
||||
|
@ -597,7 +714,7 @@ struct FFXIVIpcInitZone : FFXIVIpcBasePacket<InitZone>
|
|||
uint8_t bitmask;
|
||||
uint16_t unknown5;
|
||||
uint16_t festivalId;
|
||||
uint16_t unknown7;
|
||||
uint16_t additionalFestivalId;
|
||||
uint32_t unknown8;
|
||||
Common::FFXIVARR_POSITION3 pos;
|
||||
};
|
||||
|
@ -607,7 +724,8 @@ struct FFXIVIpcInitZone : FFXIVIpcBasePacket<InitZone>
|
|||
* Structural representation of the packet sent by the server to initialize
|
||||
* the client UI upon initial connection.
|
||||
*/
|
||||
struct FFXIVIpcInitUI : FFXIVIpcBasePacket<InitUI>
|
||||
struct FFXIVIpcInitUI :
|
||||
FFXIVIpcBasePacket< InitUI >
|
||||
{
|
||||
// plain C types for a bit until the packet is actually fixed.
|
||||
// makes conversion between different editors easier.
|
||||
|
@ -755,7 +873,8 @@ struct FFXIVIpcInitUI : FFXIVIpcBasePacket<InitUI>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to set a players stats
|
||||
*/
|
||||
struct FFXIVIpcPlayerStats : FFXIVIpcBasePacket<PlayerStats>
|
||||
struct FFXIVIpcPlayerStats :
|
||||
FFXIVIpcBasePacket< PlayerStats >
|
||||
{
|
||||
uint32_t strength;
|
||||
uint32_t dexterity;
|
||||
|
@ -811,7 +930,8 @@ struct FFXIVIpcPlayerStats : FFXIVIpcBasePacket<PlayerStats>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to set an actors current owner
|
||||
*/
|
||||
struct FFXIVIpcActorOwner : FFXIVIpcBasePacket<ActorOwner>
|
||||
struct FFXIVIpcActorOwner :
|
||||
FFXIVIpcBasePacket< ActorOwner >
|
||||
{
|
||||
uint8_t type;
|
||||
uint8_t padding[7];
|
||||
|
@ -823,7 +943,8 @@ struct FFXIVIpcActorOwner : FFXIVIpcBasePacket<ActorOwner>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to set a players state
|
||||
*/
|
||||
struct FFXIVIpcPlayerStateFlags : FFXIVIpcBasePacket<PlayerStateFlags>
|
||||
struct FFXIVIpcPlayerStateFlags :
|
||||
FFXIVIpcBasePacket< PlayerStateFlags >
|
||||
{
|
||||
uint8_t flags[12];
|
||||
uint32_t padding;
|
||||
|
@ -833,7 +954,8 @@ struct FFXIVIpcPlayerStateFlags : FFXIVIpcBasePacket<PlayerStateFlags>
|
|||
* Structural representation of the packet sent by the server
|
||||
* containing current class information
|
||||
*/
|
||||
struct FFXIVIpcPlayerClassInfo : FFXIVIpcBasePacket<PlayerClassInfo>
|
||||
struct FFXIVIpcPlayerClassInfo :
|
||||
FFXIVIpcBasePacket< PlayerClassInfo >
|
||||
{
|
||||
uint16_t classId;
|
||||
uint8_t unknown;
|
||||
|
@ -847,7 +969,8 @@ struct FFXIVIpcPlayerClassInfo : FFXIVIpcBasePacket<PlayerClassInfo>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to update a players appearance
|
||||
*/
|
||||
struct FFXIVIpcModelEquip : FFXIVIpcBasePacket<ModelEquip>
|
||||
struct FFXIVIpcModelEquip :
|
||||
FFXIVIpcBasePacket< ModelEquip >
|
||||
{
|
||||
/* 0000 */ uint64_t mainWeapon;
|
||||
/* 0008 */ uint64_t offWeapon;
|
||||
|
@ -856,11 +979,60 @@ struct FFXIVIpcModelEquip : FFXIVIpcBasePacket<ModelEquip>
|
|||
/* 003C */ uint32_t padding2;
|
||||
};
|
||||
|
||||
struct FFXIVIpcExamine :
|
||||
FFXIVIpcBasePacket< Examine >
|
||||
{
|
||||
uint8_t unkFlag1;
|
||||
uint8_t unkFlag2;
|
||||
char classJob;
|
||||
char level;
|
||||
uint16_t padding;
|
||||
uint16_t titleId;
|
||||
char grandCompany;
|
||||
char grandCompanyRank;
|
||||
|
||||
char unknown[6];
|
||||
uint32_t u6_fromPSpawn;
|
||||
uint32_t u7_fromPSpawn;
|
||||
char padding1[8];
|
||||
uint64_t mainWeaponModel;
|
||||
uint64_t secWeaponModel;
|
||||
char unknown2[16];
|
||||
struct ItemData
|
||||
{
|
||||
uint32_t catalogId;
|
||||
uint32_t appearanceCatalogId;
|
||||
uint64_t crafterId;
|
||||
uint8_t quality;
|
||||
uint8_t unknown[3];
|
||||
struct Materia
|
||||
{
|
||||
uint16_t materiaId;
|
||||
uint16_t tier;
|
||||
} materia[5];
|
||||
} entries[14];
|
||||
char name[32];
|
||||
char padding2;
|
||||
char unk3[16];
|
||||
char look[26];
|
||||
char padding3[5];
|
||||
uint32_t models[10];
|
||||
char unknown4[200];
|
||||
};
|
||||
|
||||
struct FFXIVIpcCharaNameReq :
|
||||
FFXIVIpcBasePacket< CharaNameReq >
|
||||
{
|
||||
uint64_t contentId;
|
||||
char name[32];
|
||||
};
|
||||
|
||||
/**
|
||||
* Structural representation of the packet sent by the server
|
||||
* to update a players appearance
|
||||
*/
|
||||
struct FFXIVIpcItemInfo : FFXIVIpcBasePacket<ItemInfo>
|
||||
struct FFXIVIpcItemInfo :
|
||||
FFXIVIpcBasePacket< ItemInfo >
|
||||
{
|
||||
uint32_t sequence;
|
||||
uint32_t unknown;
|
||||
|
@ -874,7 +1046,7 @@ struct FFXIVIpcItemInfo : FFXIVIpcBasePacket<ItemInfo>
|
|||
uint8_t unknown2;
|
||||
uint16_t condition;
|
||||
uint16_t spiritBond;
|
||||
uint16_t color;
|
||||
uint16_t stain;
|
||||
uint32_t glamourCatalogId;
|
||||
uint16_t materia1;
|
||||
uint16_t materia2;
|
||||
|
@ -894,7 +1066,8 @@ struct FFXIVIpcItemInfo : FFXIVIpcBasePacket<ItemInfo>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to update a players appearance
|
||||
*/
|
||||
struct FFXIVIpcContainerInfo : FFXIVIpcBasePacket<ContainerInfo>
|
||||
struct FFXIVIpcContainerInfo :
|
||||
FFXIVIpcBasePacket< ContainerInfo >
|
||||
{
|
||||
uint32_t sequence;
|
||||
uint32_t numItems;
|
||||
|
@ -906,7 +1079,8 @@ struct FFXIVIpcContainerInfo : FFXIVIpcBasePacket<ContainerInfo>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to update a players appearance
|
||||
*/
|
||||
struct FFXIVIpcCurrencyCrystalInfo : FFXIVIpcBasePacket<CurrencyCrystalInfo>
|
||||
struct FFXIVIpcCurrencyCrystalInfo :
|
||||
FFXIVIpcBasePacket< CurrencyCrystalInfo >
|
||||
{
|
||||
uint32_t sequence;
|
||||
uint16_t containerId;
|
||||
|
@ -919,14 +1093,16 @@ struct FFXIVIpcCurrencyCrystalInfo : FFXIVIpcBasePacket<CurrencyCrystalInfo>
|
|||
uint32_t unknown3;
|
||||
};
|
||||
|
||||
struct FFXIVIpcInventoryTransactionFinish : FFXIVIpcBasePacket<InventoryTransactionFinish>
|
||||
struct FFXIVIpcInventoryTransactionFinish :
|
||||
FFXIVIpcBasePacket< InventoryTransactionFinish >
|
||||
{
|
||||
uint32_t transactionId;
|
||||
uint32_t transactionId1;
|
||||
uint64_t padding;
|
||||
};
|
||||
|
||||
struct FFXIVIpcInventoryTransaction : FFXIVIpcBasePacket<InventoryTransaction>
|
||||
struct FFXIVIpcInventoryTransaction :
|
||||
FFXIVIpcBasePacket< InventoryTransaction >
|
||||
{
|
||||
uint32_t transactionId;
|
||||
uint8_t type;
|
||||
|
@ -944,7 +1120,8 @@ struct FFXIVIpcInventoryTransaction : FFXIVIpcBasePacket<InventoryTransaction>
|
|||
};
|
||||
|
||||
|
||||
struct FFXIVIpcInventoryActionAck : FFXIVIpcBasePacket<InventoryActionAck>
|
||||
struct FFXIVIpcInventoryActionAck :
|
||||
FFXIVIpcBasePacket< InventoryActionAck >
|
||||
{
|
||||
uint32_t sequence;
|
||||
uint16_t type;
|
||||
|
@ -958,7 +1135,8 @@ struct FFXIVIpcInventoryActionAck : FFXIVIpcBasePacket<InventoryActionAck>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to update a slot in the inventory
|
||||
*/
|
||||
struct FFXIVIpcUpdateInventorySlot : FFXIVIpcBasePacket<UpdateInventorySlot>
|
||||
struct FFXIVIpcUpdateInventorySlot :
|
||||
FFXIVIpcBasePacket< UpdateInventorySlot >
|
||||
{
|
||||
uint32_t sequence;
|
||||
uint32_t unknown;
|
||||
|
@ -991,7 +1169,8 @@ struct FFXIVIpcUpdateInventorySlot : FFXIVIpcBasePacket<UpdateInventorySlot>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to start an event, not actually playing it, but registering
|
||||
*/
|
||||
struct FFXIVIpcEventStart : FFXIVIpcBasePacket<EventStart>
|
||||
struct FFXIVIpcEventStart :
|
||||
FFXIVIpcBasePacket< EventStart >
|
||||
{
|
||||
/* 0000 */ uint64_t actorId;
|
||||
/* 0008 */ uint32_t eventId;
|
||||
|
@ -1007,7 +1186,8 @@ struct FFXIVIpcEventStart : FFXIVIpcBasePacket<EventStart>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to play an event
|
||||
*/
|
||||
struct FFXIVIpcEventPlay : FFXIVIpcBasePacket<EventPlay>
|
||||
struct FFXIVIpcEventPlay :
|
||||
FFXIVIpcBasePacket< EventPlay >
|
||||
{
|
||||
uint64_t actorId;
|
||||
uint32_t eventId;
|
||||
|
@ -1021,11 +1201,12 @@ struct FFXIVIpcEventPlay : FFXIVIpcBasePacket<EventPlay>
|
|||
uint8_t unknown[8];
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* Structural representation of the packet sent by the server
|
||||
* to play an event
|
||||
*/
|
||||
struct FFXIVIpcDirectorPlayScene : FFXIVIpcBasePacket<DirectorPlayScene>
|
||||
struct FFXIVIpcDirectorPlayScene :
|
||||
FFXIVIpcBasePacket< DirectorPlayScene >
|
||||
{
|
||||
uint64_t actorId;
|
||||
uint32_t eventId;
|
||||
|
@ -1044,7 +1225,8 @@ struct FFXIVIpcDirectorPlayScene : FFXIVIpcBasePacket<DirectorPlayScene>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to finish an event
|
||||
*/
|
||||
struct FFXIVIpcEventFinish : FFXIVIpcBasePacket<EventFinish>
|
||||
struct FFXIVIpcEventFinish :
|
||||
FFXIVIpcBasePacket< EventFinish >
|
||||
{
|
||||
/* 0000 */ uint32_t eventId;
|
||||
/* 0004 */ uint8_t param1;
|
||||
|
@ -1054,12 +1236,25 @@ struct FFXIVIpcEventFinish : FFXIVIpcBasePacket<EventFinish>
|
|||
/* 000C */ uint32_t padding1;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEventOpenGilShop :
|
||||
FFXIVIpcBasePacket< EventOpenGilShop >
|
||||
{
|
||||
uint64_t actorId;
|
||||
uint32_t eventId;
|
||||
uint16_t scene;
|
||||
uint16_t padding;
|
||||
uint32_t sceneFlags;
|
||||
|
||||
uint32_t unknown_wtf[0x101];
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Structural representation of the packet sent by the server
|
||||
* to respond to a linkshell creation event
|
||||
*/
|
||||
struct FFXIVIpcEventLinkshell : FFXIVIpcBasePacket<EventLinkshell>
|
||||
struct FFXIVIpcEventLinkshell :
|
||||
FFXIVIpcBasePacket< EventLinkshell >
|
||||
{
|
||||
uint32_t eventId;
|
||||
uint8_t scene;
|
||||
|
@ -1076,7 +1271,8 @@ struct FFXIVIpcEventLinkshell : FFXIVIpcBasePacket<EventLinkshell>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to send the active quests
|
||||
*/
|
||||
struct FFXIVIpcQuestActiveList : FFXIVIpcBasePacket<QuestActiveList>
|
||||
struct FFXIVIpcQuestActiveList :
|
||||
FFXIVIpcBasePacket< QuestActiveList >
|
||||
{
|
||||
Common::QuestActive activeQuests[30];
|
||||
};
|
||||
|
@ -1085,7 +1281,8 @@ struct FFXIVIpcQuestActiveList : FFXIVIpcBasePacket<QuestActiveList>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to send update a quest slot
|
||||
*/
|
||||
struct FFXIVIpcQuestUpdate : FFXIVIpcBasePacket<QuestUpdate>
|
||||
struct FFXIVIpcQuestUpdate :
|
||||
FFXIVIpcBasePacket< QuestUpdate >
|
||||
{
|
||||
uint16_t slot;
|
||||
uint16_t padding;
|
||||
|
@ -1096,7 +1293,8 @@ struct FFXIVIpcQuestUpdate : FFXIVIpcBasePacket<QuestUpdate>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to send the completed quests mask
|
||||
*/
|
||||
struct FFXIVIpcQuestCompleteList : FFXIVIpcBasePacket<QuestCompleteList>
|
||||
struct FFXIVIpcQuestCompleteList :
|
||||
FFXIVIpcBasePacket< QuestCompleteList >
|
||||
{
|
||||
uint8_t questCompleteMask[396];
|
||||
uint8_t unknownCompleteMask[32];
|
||||
|
@ -1106,7 +1304,8 @@ struct FFXIVIpcQuestCompleteList : FFXIVIpcBasePacket<QuestCompleteList>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to finish a quest
|
||||
*/
|
||||
struct FFXIVIpcQuestFinish : FFXIVIpcBasePacket<QuestFinish>
|
||||
struct FFXIVIpcQuestFinish :
|
||||
FFXIVIpcBasePacket< QuestFinish >
|
||||
{
|
||||
uint16_t questId;
|
||||
uint8_t flag1;
|
||||
|
@ -1121,7 +1320,8 @@ struct FFXIVIpcQuestFinish : FFXIVIpcBasePacket<QuestFinish>
|
|||
* type 1 icon
|
||||
* type 5 status
|
||||
*/
|
||||
struct FFXIVIpcQuestMessage : FFXIVIpcBasePacket<QuestMessage>
|
||||
struct FFXIVIpcQuestMessage :
|
||||
FFXIVIpcBasePacket< QuestMessage >
|
||||
{
|
||||
/* 0000 */ uint32_t questId;
|
||||
/* 0000 */ uint8_t msgId;
|
||||
|
@ -1131,7 +1331,8 @@ struct FFXIVIpcQuestMessage : FFXIVIpcBasePacket<QuestMessage>
|
|||
/* 0000 */ uint32_t var2;
|
||||
};
|
||||
|
||||
struct FFXIVIpcQuestTracker : FFXIVIpcBasePacket<QuestTracker>
|
||||
struct FFXIVIpcQuestTracker :
|
||||
FFXIVIpcBasePacket< QuestTracker >
|
||||
{
|
||||
struct TrackerEntry
|
||||
{
|
||||
|
@ -1142,7 +1343,8 @@ struct FFXIVIpcQuestTracker : FFXIVIpcBasePacket<QuestTracker>
|
|||
};
|
||||
|
||||
|
||||
struct FFXIVIpcWeatherChange : FFXIVIpcBasePacket<WeatherChange>
|
||||
struct FFXIVIpcWeatherChange :
|
||||
FFXIVIpcBasePacket< WeatherChange >
|
||||
{
|
||||
uint32_t weatherId;
|
||||
float delay;
|
||||
|
@ -1152,7 +1354,8 @@ struct FFXIVIpcWeatherChange : FFXIVIpcBasePacket<WeatherChange>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to send a unviel a map
|
||||
*/
|
||||
struct FFXIVIpcDiscovery : FFXIVIpcBasePacket<Discovery>
|
||||
struct FFXIVIpcDiscovery :
|
||||
FFXIVIpcBasePacket< Discovery >
|
||||
{
|
||||
/* 0000 */ uint32_t map_part_id;
|
||||
/* 0004 */ uint32_t map_id;
|
||||
|
@ -1162,7 +1365,8 @@ struct FFXIVIpcDiscovery : FFXIVIpcBasePacket<Discovery>
|
|||
/**
|
||||
* UNKOWN TYPE
|
||||
*/
|
||||
struct FFXIVARR_IPC_UNK322 : FFXIVIpcBasePacket<IPCTYPE_UNK_322>
|
||||
struct FFXIVARR_IPC_UNK322 :
|
||||
FFXIVIpcBasePacket< IPCTYPE_UNK_322 >
|
||||
{
|
||||
/* 0000 */ uint8_t unk[8];
|
||||
};
|
||||
|
@ -1170,7 +1374,8 @@ struct FFXIVARR_IPC_UNK322 : FFXIVIpcBasePacket<IPCTYPE_UNK_322>
|
|||
/**
|
||||
* UNKOWN TYPE
|
||||
*/
|
||||
struct FFXIVARR_IPC_UNK320 : FFXIVIpcBasePacket<IPCTYPE_UNK_320>
|
||||
struct FFXIVARR_IPC_UNK320 :
|
||||
FFXIVIpcBasePacket< IPCTYPE_UNK_320 >
|
||||
{
|
||||
/* 0000 */ uint8_t unk[0x38];
|
||||
};
|
||||
|
@ -1179,7 +1384,8 @@ struct FFXIVARR_IPC_UNK320 : FFXIVIpcBasePacket<IPCTYPE_UNK_320>
|
|||
* Structural representation of the packet sent by the server
|
||||
* prepare zoning, showing screenmessage
|
||||
*/
|
||||
struct FFXIVIpcPrepareZoning : FFXIVIpcBasePacket<PrepareZoning>
|
||||
struct FFXIVIpcPrepareZoning :
|
||||
FFXIVIpcBasePacket< PrepareZoning >
|
||||
{
|
||||
uint32_t logMessage;
|
||||
uint16_t targetZone;
|
||||
|
@ -1199,7 +1405,8 @@ struct FFXIVIpcPrepareZoning : FFXIVIpcBasePacket<PrepareZoning>
|
|||
*
|
||||
* See https://gist.github.com/Minoost/c35843c4c8a7a931f31fdaac9bce64c2
|
||||
*/
|
||||
struct FFXIVIpcCFNotify : FFXIVIpcBasePacket<CFNotify>
|
||||
struct FFXIVIpcCFNotify :
|
||||
FFXIVIpcBasePacket< CFNotify >
|
||||
{
|
||||
uint32_t state1; // 3 = cancelled, 4 = duty ready
|
||||
uint32_t state2; // if state1 == 3, state2 is cancelled reason
|
||||
|
@ -1219,7 +1426,8 @@ struct FFXIVIpcCFNotify : FFXIVIpcBasePacket<CFNotify>
|
|||
* Do note that this packet has to come early in login phase (around initui packet)
|
||||
* or it won't be applied until you reconnect
|
||||
*/
|
||||
struct FFXIVIpcCFAvailableContents : FFXIVIpcBasePacket<CFAvailableContents>
|
||||
struct FFXIVIpcCFAvailableContents :
|
||||
FFXIVIpcBasePacket< CFAvailableContents >
|
||||
{
|
||||
uint8_t contents[0x48];
|
||||
};
|
||||
|
@ -1228,7 +1436,8 @@ struct FFXIVIpcCFAvailableContents : FFXIVIpcBasePacket<CFAvailableContents>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to update adventure in needs in duty roulette
|
||||
*/
|
||||
struct FFXIVIpcCFPlayerInNeed : FFXIVIpcBasePacket<CFPlayerInNeed>
|
||||
struct FFXIVIpcCFPlayerInNeed :
|
||||
FFXIVIpcBasePacket< CFPlayerInNeed >
|
||||
{
|
||||
// Ordered by roulette id
|
||||
uint8_t inNeeds[0x10];
|
||||
|
@ -1238,13 +1447,15 @@ struct FFXIVIpcCFPlayerInNeed : FFXIVIpcBasePacket<CFPlayerInNeed>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to update duty info in general
|
||||
*/
|
||||
struct FFXIVIpcCFDutyInfo : FFXIVIpcBasePacket<CFDutyInfo>
|
||||
struct FFXIVIpcCFDutyInfo :
|
||||
FFXIVIpcBasePacket< CFDutyInfo >
|
||||
{
|
||||
uint8_t penaltyTime;
|
||||
uint8_t unknown[7];
|
||||
};
|
||||
|
||||
struct FFXIVIpcCFRegisterDuty : FFXIVIpcBasePacket<CFRegisterDuty>
|
||||
struct FFXIVIpcCFRegisterDuty :
|
||||
FFXIVIpcBasePacket< CFRegisterDuty >
|
||||
{
|
||||
uint32_t unknown0; // 0x301
|
||||
uint8_t rouletteId; // if it's a daily roulette
|
||||
|
@ -1253,7 +1464,8 @@ struct FFXIVIpcCFRegisterDuty : FFXIVIpcBasePacket<CFRegisterDuty>
|
|||
};
|
||||
|
||||
|
||||
struct FFXIVIpcCFMemberStatus : FFXIVIpcBasePacket<CFMemberStatus>
|
||||
struct FFXIVIpcCFMemberStatus :
|
||||
FFXIVIpcBasePacket< CFMemberStatus >
|
||||
{
|
||||
uint16_t contentId;
|
||||
uint16_t unknown1;
|
||||
|
@ -1266,7 +1478,8 @@ struct FFXIVIpcCFMemberStatus : FFXIVIpcBasePacket<CFMemberStatus>
|
|||
uint32_t unknown3;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEorzeaTimeOffset : FFXIVIpcBasePacket<EorzeaTimeOffset>
|
||||
struct FFXIVIpcEorzeaTimeOffset :
|
||||
FFXIVIpcBasePacket< EorzeaTimeOffset >
|
||||
{
|
||||
uint64_t timestamp;
|
||||
};
|
||||
|
@ -1275,7 +1488,8 @@ struct FFXIVIpcEorzeaTimeOffset : FFXIVIpcBasePacket<EorzeaTimeOffset>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to set the gear show/hide status of a character
|
||||
*/
|
||||
struct FFXIVIpcEquipDisplayFlags : FFXIVIpcBasePacket<EquipDisplayFlags>
|
||||
struct FFXIVIpcEquipDisplayFlags :
|
||||
FFXIVIpcBasePacket< EquipDisplayFlags >
|
||||
{
|
||||
uint8_t bitmask;
|
||||
};
|
||||
|
@ -1284,7 +1498,8 @@ struct FFXIVIpcEquipDisplayFlags : FFXIVIpcBasePacket<EquipDisplayFlags>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to mount a player
|
||||
*/
|
||||
struct FFXIVIpcMount : FFXIVIpcBasePacket<Mount>
|
||||
struct FFXIVIpcMount :
|
||||
FFXIVIpcBasePacket< Mount >
|
||||
{
|
||||
uint32_t id;
|
||||
};
|
||||
|
@ -1293,7 +1508,8 @@ struct FFXIVIpcMount : FFXIVIpcBasePacket<Mount>
|
|||
* Structural representation of the packet sent by the server
|
||||
* to mount a player
|
||||
*/
|
||||
struct FFXIVIpcDirectorVars : FFXIVIpcBasePacket<DirectorVars>
|
||||
struct FFXIVIpcDirectorVars :
|
||||
FFXIVIpcBasePacket< DirectorVars >
|
||||
{
|
||||
/*! DirectorType | ContentId */
|
||||
uint32_t m_directorId;
|
||||
|
@ -1306,18 +1522,21 @@ struct FFXIVIpcDirectorVars : FFXIVIpcBasePacket<DirectorVars>
|
|||
};
|
||||
|
||||
|
||||
struct FFXIVIpcActorGauge : FFXIVIpcBasePacket<ActorGauge>
|
||||
struct FFXIVIpcActorGauge :
|
||||
FFXIVIpcBasePacket< ActorGauge >
|
||||
{
|
||||
uint8_t classJobId;
|
||||
uint8_t data[15]; // depends on classJobId
|
||||
};
|
||||
|
||||
struct FFXIVIpcPerformNote : FFXIVIpcBasePacket<PerformNote>
|
||||
struct FFXIVIpcPerformNote :
|
||||
FFXIVIpcBasePacket< PerformNote >
|
||||
{
|
||||
uint8_t data[32];
|
||||
};
|
||||
|
||||
struct FFXIVIpcWardInfo : FFXIVIpcBasePacket<WardInfo>
|
||||
struct FFXIVIpcWardInfo :
|
||||
FFXIVIpcBasePacket< WardInfo >
|
||||
{
|
||||
uint16_t unknown0;
|
||||
uint16_t wardNum; // set 1 for "Mist, Ward 2"
|
||||
|
@ -1331,7 +1550,8 @@ struct FFXIVIpcWardInfo : FFXIVIpcBasePacket<WardInfo>
|
|||
uint8_t unknown6;
|
||||
uint8_t unknown7;
|
||||
uint8_t unknown8;
|
||||
struct {
|
||||
struct
|
||||
{
|
||||
uint8_t houseSize; //1 = small, 2 = middle, 3 = big; 1
|
||||
uint8_t houseState; //1 = for sell, 2 = sold, 3 = hasOwner, 0x0A = House sharing; 2
|
||||
uint8_t iconColor; //HouseState has to be 3; 1 = Private, 2 = FC House; 4
|
||||
|
@ -1350,7 +1570,8 @@ struct FFXIVIpcWardInfo : FFXIVIpcBasePacket<WardInfo>
|
|||
} landSet[30];
|
||||
};
|
||||
|
||||
struct FFXIVIpcWardYardInfo : FFXIVIpcBasePacket<WardYardInfo>
|
||||
struct FFXIVIpcWardYardInfo :
|
||||
FFXIVIpcBasePacket< WardYardInfo >
|
||||
{
|
||||
/* consistency check? */
|
||||
uint32_t unknown1; //always 0xFFFFFFFF
|
||||
|
@ -1369,13 +1590,15 @@ struct FFXIVIpcWardYardInfo : FFXIVIpcBasePacket<WardYardInfo>
|
|||
} object[100];
|
||||
};
|
||||
|
||||
struct FFXIVIpcMSQTrackerProgress : FFXIVIpcBasePacket<MSQTrackerProgress>
|
||||
struct FFXIVIpcMSQTrackerProgress :
|
||||
FFXIVIpcBasePacket< MSQTrackerProgress >
|
||||
{
|
||||
uint32_t id;
|
||||
uint32_t padding;
|
||||
};
|
||||
|
||||
struct FFXIVIpcMSQTrackerComplete : FFXIVIpcBasePacket<MSQTrackerComplete>
|
||||
struct FFXIVIpcMSQTrackerComplete :
|
||||
FFXIVIpcBasePacket< MSQTrackerComplete >
|
||||
{
|
||||
uint32_t id;
|
||||
uint32_t padding1;
|
||||
|
@ -1384,7 +1607,8 @@ struct FFXIVIpcMSQTrackerComplete : FFXIVIpcBasePacket<MSQTrackerComplete>
|
|||
uint64_t padding4; // last 4 bytes is uint32_t but who cares
|
||||
};
|
||||
|
||||
struct FFXIVIpcObjectSpawn : FFXIVIpcBasePacket<ObjectSpawn>
|
||||
struct FFXIVIpcObjectSpawn :
|
||||
FFXIVIpcBasePacket< ObjectSpawn >
|
||||
{
|
||||
uint8_t spawnIndex;
|
||||
uint8_t objKind;
|
||||
|
@ -1409,13 +1633,15 @@ struct FFXIVIpcObjectSpawn : FFXIVIpcBasePacket<ObjectSpawn>
|
|||
int16_t unknown3E;
|
||||
};
|
||||
|
||||
struct FFXIVIpcObjectDespawn : FFXIVIpcBasePacket<ObjectDespawn>
|
||||
struct FFXIVIpcObjectDespawn :
|
||||
FFXIVIpcBasePacket< ObjectDespawn >
|
||||
{
|
||||
uint8_t spawnIndex;
|
||||
uint8_t padding[7];
|
||||
};
|
||||
|
||||
struct FFXIVIpcDuelChallenge : FFXIVIpcBasePacket<DuelChallenge>
|
||||
struct FFXIVIpcDuelChallenge :
|
||||
FFXIVIpcBasePacket< DuelChallenge >
|
||||
{
|
||||
uint8_t otherClassJobId;
|
||||
uint8_t otherLevel; // class job level
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
|
@ -7,62 +8,64 @@
|
|||
|
||||
namespace Core {
|
||||
|
||||
template<class T>
|
||||
class LockedQueue
|
||||
{
|
||||
public:
|
||||
template< class T >
|
||||
class LockedQueue
|
||||
{
|
||||
public:
|
||||
LockedQueue();
|
||||
|
||||
~LockedQueue();
|
||||
|
||||
T pop();
|
||||
|
||||
//we can pass this in by reference, instead of copying
|
||||
void push(const T object);
|
||||
void push( const T object );
|
||||
|
||||
//we can pass this in by reference
|
||||
//this will push it onto the queue, and swap the object
|
||||
// with a default-constructed T at the same time.
|
||||
void push_swap(T& object);
|
||||
void push_reset(T& object);
|
||||
void push_swap( T& object );
|
||||
|
||||
void push_reset( T& object );
|
||||
|
||||
|
||||
std::size_t size();
|
||||
|
||||
|
||||
protected:
|
||||
std::queue<T> m_queue;
|
||||
protected:
|
||||
std::queue< T > m_queue;
|
||||
std::mutex m_mutex;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
template <class T>
|
||||
LockedQueue<T>::LockedQueue()
|
||||
{
|
||||
template< class T >
|
||||
LockedQueue< T >::LockedQueue()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
std::size_t LockedQueue<T>::size()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( m_mutex);
|
||||
template< class T >
|
||||
std::size_t LockedQueue< T >::size()
|
||||
{
|
||||
std::lock_guard< std::mutex > lock( m_mutex );
|
||||
return m_queue.size();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
LockedQueue<T>::~LockedQueue()
|
||||
{
|
||||
template< class T >
|
||||
LockedQueue< T >::~LockedQueue()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
T LockedQueue<T>::pop()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( m_mutex);
|
||||
template< class T >
|
||||
T LockedQueue< T >::pop()
|
||||
{
|
||||
std::lock_guard< std::mutex > lock( m_mutex );
|
||||
|
||||
if( m_queue.empty())
|
||||
if( m_queue.empty() )
|
||||
{
|
||||
return T();
|
||||
}
|
||||
|
@ -72,27 +75,27 @@ namespace Core {
|
|||
m_queue.pop();
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void LockedQueue<T>::push(const T object)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( m_mutex);
|
||||
m_queue.push(object);
|
||||
}
|
||||
template< class T >
|
||||
void LockedQueue< T >::push( const T object )
|
||||
{
|
||||
std::lock_guard< std::mutex > lock( m_mutex );
|
||||
m_queue.push( object );
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void LockedQueue<T>::push_swap(T& object)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( m_mutex);
|
||||
template< class T >
|
||||
void LockedQueue< T >::push_swap( T& object )
|
||||
{
|
||||
std::lock_guard< std::mutex > lock( m_mutex );
|
||||
|
||||
m_queue.push(object);
|
||||
m_queue.push( object );
|
||||
|
||||
T default_ctored_object = T();
|
||||
//this is a special swap that will do a legit naive swap normally,
|
||||
// except if there exists a function called T::swap(), which is
|
||||
// specialized and possibly faster.
|
||||
boost::swap(object, default_ctored_object);
|
||||
boost::swap( object, default_ctored_object );
|
||||
|
||||
|
||||
|
||||
|
@ -101,14 +104,14 @@ namespace Core {
|
|||
// this will allow that the object on the queue is the *last* shared_ptr
|
||||
// in existance by the time this function returns.
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void LockedQueue<T>::push_reset(T& object)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( m_mutex);
|
||||
template< class T >
|
||||
void LockedQueue< T >::push_reset( T& object )
|
||||
{
|
||||
std::lock_guard< std::mutex > lock( m_mutex );
|
||||
|
||||
m_queue.push(object);
|
||||
m_queue.push( object );
|
||||
|
||||
T default_ctored_object = T();
|
||||
|
||||
|
@ -119,6 +122,6 @@ namespace Core {
|
|||
// this will allow that the object on the queue is the *last* shared_ptr
|
||||
// in existance by the time this function returns.
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -8,8 +8,7 @@
|
|||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace Core
|
||||
{
|
||||
namespace Core {
|
||||
|
||||
template< typename T >
|
||||
class LockedWaitQueue
|
||||
|
@ -18,11 +17,14 @@ private:
|
|||
std::mutex m_queueLock;
|
||||
std::queue< T > m_queue;
|
||||
std::condition_variable m_condition;
|
||||
std::atomic<bool> m_shutdown;
|
||||
std::atomic< bool > m_shutdown;
|
||||
|
||||
public:
|
||||
|
||||
LockedWaitQueue<T>() : m_shutdown(false) { }
|
||||
LockedWaitQueue< T >() :
|
||||
m_shutdown( false )
|
||||
{
|
||||
}
|
||||
|
||||
void push( const T& value )
|
||||
{
|
||||
|
@ -58,7 +60,7 @@ public:
|
|||
std::unique_lock< std::mutex > lock( m_queueLock );
|
||||
|
||||
while( m_queue.empty() && !m_shutdown )
|
||||
m_condition.wait(lock);
|
||||
m_condition.wait( lock );
|
||||
|
||||
if( m_queue.empty() || m_shutdown )
|
||||
return;
|
||||
|
@ -88,10 +90,15 @@ public:
|
|||
|
||||
private:
|
||||
template< typename E = T >
|
||||
typename std::enable_if< std::is_pointer< E >::value >::type deleteQueuedObject( E& obj ) { delete obj; }
|
||||
typename std::enable_if< std::is_pointer< E >::value >::type deleteQueuedObject( E& obj )
|
||||
{
|
||||
delete obj;
|
||||
}
|
||||
|
||||
template< typename E = T >
|
||||
typename std::enable_if< !std::is_pointer< E >::value >::type deleteQueuedObject( E const& ) { }
|
||||
typename std::enable_if< !std::is_pointer< E >::value >::type deleteQueuedObject( E const& )
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -5,14 +5,12 @@
|
|||
#include <unordered_map>
|
||||
#include <type_traits>
|
||||
|
||||
namespace Core
|
||||
namespace Core {
|
||||
namespace Util {
|
||||
template< typename T, typename ActorIdType = uint32_t >
|
||||
class SpawnIndexAllocator
|
||||
{
|
||||
namespace Util
|
||||
{
|
||||
template< typename T, typename ActorIdType = uint32_t >
|
||||
class SpawnIndexAllocator
|
||||
{
|
||||
public:
|
||||
public:
|
||||
static_assert( std::is_same< T, uint8_t >::value || std::is_same< T, uint16_t >::value ||
|
||||
std::is_same< T, uint32_t >::value || std::is_same< T, uint64_t >::value,
|
||||
"T must be uint8_t, uint16_t, uint32_t, uint64_t" );
|
||||
|
@ -20,7 +18,8 @@ namespace Util
|
|||
SpawnIndexAllocator() :
|
||||
m_maxSlotId( 0 ),
|
||||
m_reserveFirstSlot( false )
|
||||
{ }
|
||||
{
|
||||
}
|
||||
|
||||
void init( T maxSlotId, bool reserveFirstSlot = false )
|
||||
{
|
||||
|
@ -55,7 +54,7 @@ namespace Util
|
|||
auto nextId = m_availableIds.front();
|
||||
m_availableIds.pop();
|
||||
|
||||
m_actorIdToAllocatedMap[actorId] = nextId;
|
||||
m_actorIdToAllocatedMap[ actorId ] = nextId;
|
||||
|
||||
return nextId;
|
||||
}
|
||||
|
@ -77,7 +76,7 @@ namespace Util
|
|||
return static_cast< T >( -1 );
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void setupQueue()
|
||||
{
|
||||
assert( m_maxSlotId != 0 );
|
||||
|
@ -101,7 +100,7 @@ namespace Util
|
|||
|
||||
T m_maxSlotId;
|
||||
bool m_reserveFirstSlot;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ std::string Core::Util::binaryToHexString( uint8_t* pBinData, uint16_t size )
|
|||
|
||||
for( uint32_t i = 0; i < size; i++ )
|
||||
{
|
||||
outStr += boost::str( boost::format( "%|02X|" ) % ( int32_t ) ( pBinData[i] & 0xFF ) );
|
||||
outStr += boost::str( boost::format( "%|02X|" ) % ( int32_t ) ( pBinData[ i ] & 0xFF ) );
|
||||
}
|
||||
|
||||
return outStr;
|
||||
|
@ -24,7 +24,7 @@ std::string Core::Util::binaryToHexDump( uint8_t* pBinData, uint16_t size )
|
|||
int byteBlock = offsetBlock + bytesPerLine * 3 + ( bytesPerLine - 1 ) / 8 + 2;
|
||||
int lineLength = byteBlock + bytesPerLine + 1;
|
||||
|
||||
std::string line ( lineLength, ' ' );
|
||||
std::string line( lineLength, ' ' );
|
||||
int numLines = ( size + bytesPerLine - 1 ) / bytesPerLine;
|
||||
|
||||
|
||||
|
@ -32,37 +32,37 @@ std::string Core::Util::binaryToHexDump( uint8_t* pBinData, uint16_t size )
|
|||
|
||||
for( uint32_t i = 0; i < size; i += bytesPerLine )
|
||||
{
|
||||
line[0] = hexChars[( i >> 28 ) & 0xF];
|
||||
line[1] = hexChars[( i >> 24 ) & 0xF];
|
||||
line[2] = hexChars[( i >> 20 ) & 0xF];
|
||||
line[3] = hexChars[( i >> 16 ) & 0xF];
|
||||
line[4] = hexChars[( i >> 12 ) & 0xF];
|
||||
line[5] = hexChars[( i >> 8 ) & 0xF];
|
||||
line[6] = hexChars[( i >> 4 ) & 0xF];
|
||||
line[7] = hexChars[( i >> 0 ) & 0xF];
|
||||
line[ 0 ] = hexChars[ ( i >> 28 ) & 0xF ];
|
||||
line[ 1 ] = hexChars[ ( i >> 24 ) & 0xF ];
|
||||
line[ 2 ] = hexChars[ ( i >> 20 ) & 0xF ];
|
||||
line[ 3 ] = hexChars[ ( i >> 16 ) & 0xF ];
|
||||
line[ 4 ] = hexChars[ ( i >> 12 ) & 0xF ];
|
||||
line[ 5 ] = hexChars[ ( i >> 8 ) & 0xF ];
|
||||
line[ 6 ] = hexChars[ ( i >> 4 ) & 0xF ];
|
||||
line[ 7 ] = hexChars[ ( i >> 0 ) & 0xF ];
|
||||
|
||||
int hexColumn = offsetBlock;
|
||||
int charColumn = byteBlock;
|
||||
|
||||
for( int j = 0; j < bytesPerLine; j++ )
|
||||
{
|
||||
if( j > 0 && ( j & 7 ) == 0)
|
||||
if( j > 0 && ( j & 7 ) == 0 )
|
||||
{
|
||||
hexColumn++;
|
||||
}
|
||||
|
||||
if( i + j >= size )
|
||||
{
|
||||
line[hexColumn] = ' ';
|
||||
line[hexColumn + 1] = ' ';
|
||||
line[charColumn] = ' ';
|
||||
line[ hexColumn ] = ' ';
|
||||
line[ hexColumn + 1 ] = ' ';
|
||||
line[ charColumn ] = ' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t by = pBinData[i + j];
|
||||
line[hexColumn] = hexChars[( by >> 4 ) & 0xF];
|
||||
line[hexColumn + 1] = hexChars[by & 0xF];
|
||||
line[charColumn] = by < 32 ? '.' : static_cast< char >( by );
|
||||
uint8_t by = pBinData[ i + j ];
|
||||
line[ hexColumn ] = hexChars[ ( by >> 4 ) & 0xF ];
|
||||
line[ hexColumn + 1 ] = hexChars[ by & 0xF ];
|
||||
line[ charColumn ] = by < 32 ? '.' : static_cast< char >( by );
|
||||
}
|
||||
|
||||
hexColumn += 3;
|
||||
|
|
|
@ -22,19 +22,21 @@ float calcAngTo( float x, float y, float x1, float y1 );
|
|||
float calcAngFrom( float x, float y, float x1, float y1 );
|
||||
|
||||
uint16_t floatToUInt16( float val );
|
||||
|
||||
uint16_t floatToUInt16Rot( float val );
|
||||
|
||||
uint8_t floatToUInt8Rot( float val );
|
||||
|
||||
template
|
||||
<typename T>
|
||||
< typename T >
|
||||
T clamp( T val, T minimum, T maximum )
|
||||
{
|
||||
if (val > maximum)
|
||||
if( val > maximum )
|
||||
{
|
||||
return maximum;
|
||||
}
|
||||
|
||||
if (val < minimum)
|
||||
if( val < minimum )
|
||||
{
|
||||
return minimum;
|
||||
}
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
#include <string>
|
||||
|
||||
namespace Core {
|
||||
namespace Version {
|
||||
namespace Version {
|
||||
|
||||
extern const std::string GIT_HASH;
|
||||
extern const std::string VERSION;
|
||||
extern const std::string GIT_HASH;
|
||||
extern const std::string VERSION;
|
||||
|
||||
} /* Version */
|
||||
} /* Version */
|
||||
} /* Core */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 61712f8f11892d12ad6878a80b9b89b318908558
|
||||
Subproject commit b89d9a2dfcca81ab4241e791a0a78bb9ea34036c
|
|
@ -2,11 +2,14 @@
|
|||
#include "../ScriptObject.h"
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class ActionReturn6 : public ActionScript
|
||||
class ActionReturn6 :
|
||||
public ActionScript
|
||||
{
|
||||
public:
|
||||
ActionReturn6() : ActionScript( 6 )
|
||||
{}
|
||||
ActionReturn6() :
|
||||
ActionScript( 6 )
|
||||
{
|
||||
}
|
||||
|
||||
void onCastFinish( Core::Entity::Player& player, Core::Entity::Chara& targetActor ) override
|
||||
{
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class ActionSprint3 : public ActionScript
|
||||
class ActionSprint3 :
|
||||
public ActionScript
|
||||
{
|
||||
public:
|
||||
ActionSprint3() : ActionScript( 3 )
|
||||
{}
|
||||
ActionSprint3() :
|
||||
ActionScript( 3 )
|
||||
{
|
||||
}
|
||||
|
||||
void onCastFinish( Core::Entity::Player& player, Core::Entity::Chara& targetActor ) override
|
||||
{
|
||||
|
|
|
@ -10,11 +10,14 @@
|
|||
#define AETHERYTE_MENU_FAVORITE_POINT 4
|
||||
#define AETHERYTE_MENU_FAVORITE_POINT_SECURITY_TOKEN 5
|
||||
|
||||
class Aethernet : public EventScript
|
||||
class Aethernet :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
Aethernet() : EventScript( EVENTSCRIPT_AETHERNET_ID )
|
||||
{}
|
||||
Aethernet() :
|
||||
EventScript( EVENTSCRIPT_AETHERNET_ID )
|
||||
{
|
||||
}
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
|
@ -30,12 +33,13 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
player.eventActionStart( eventId, ACTION_ATTUNE, []( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
player.eventActionStart( eventId, ACTION_ATTUNE,
|
||||
[]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
{
|
||||
player.registerAetheryte( eventId & 0xFFFF );
|
||||
player.playScene( eventId, 3, 0, 0, 0 );
|
||||
},
|
||||
[] ( Entity::Player& ply, uint32_t evntId, uint64_t additional )
|
||||
[]( Entity::Player& ply, uint32_t evntId, uint64_t additional )
|
||||
{
|
||||
|
||||
}, 0 );
|
||||
|
|
|
@ -12,11 +12,14 @@
|
|||
#define AETHERYTE_MENU_FAVORITE_POINT 4
|
||||
#define AETHERYTE_MENU_FAVORITE_POINT_SECURITY_TOKEN 5
|
||||
|
||||
class Aetheryte : public EventScript
|
||||
class Aetheryte :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
Aetheryte() : EventScript( EVENTSCRIPT_AETHERYTE_ID )
|
||||
{}
|
||||
Aetheryte() :
|
||||
EventScript( EVENTSCRIPT_AETHERYTE_ID )
|
||||
{
|
||||
}
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
|
@ -28,7 +31,8 @@ public:
|
|||
{
|
||||
player.setHomepoint( result.eventId & 0xFFFF );
|
||||
player.sendQuestMessage( result.eventId, 2, 0xEA, 0, 0 );
|
||||
} else if( result.param1 == 512 ) // aethernet access
|
||||
}
|
||||
else if( result.param1 == 512 ) // aethernet access
|
||||
{
|
||||
if( result.param2 == 4 )
|
||||
{
|
||||
|
@ -48,7 +52,8 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
player.eventActionStart( eventId, ACTION_ATTUNE, []( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
player.eventActionStart( eventId, ACTION_ATTUNE,
|
||||
[]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
{
|
||||
player.registerAetheryte( eventId & 0xFFFF );
|
||||
|
||||
|
@ -62,7 +67,7 @@ public:
|
|||
player.learnAction( ACTION_TELEPORT );
|
||||
}
|
||||
},
|
||||
[] ( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
[]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
{}, 0 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class CmnDefCutSceneReplay : public EventScript
|
||||
class CmnDefCutSceneReplay :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
CmnDefCutSceneReplay() : EventScript( 721028 )
|
||||
{}
|
||||
CmnDefCutSceneReplay() :
|
||||
EventScript( 721028 )
|
||||
{
|
||||
}
|
||||
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
auto callback = [this]( Entity::Player& player, const Event::SceneResult& result )
|
||||
auto callback = [ this ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( result.param2 != 0 )
|
||||
{
|
||||
|
@ -17,7 +20,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
player.playScene( getId(), 0, 0x2000, 0, 1, callback );
|
||||
player.playScene( getId(), 0, HIDE_HOTBAR, 0, 1, callback );
|
||||
}
|
||||
|
||||
void Scene00001( Entity::Player& player, uint16_t returnScene )
|
||||
|
|
22
src/servers/Scripts/common/CmnDefHousingSignboard.cpp
Normal file
22
src/servers/Scripts/common/CmnDefHousingSignboard.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class CmnDefHousingSignboard :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
CmnDefHousingSignboard() :
|
||||
EventScript( 721031 )
|
||||
{
|
||||
}
|
||||
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 0, HIDE_HOTBAR, 0, 1 );
|
||||
}
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
};
|
|
@ -1,28 +1,31 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class CmnDefInnBed : public EventScript
|
||||
class CmnDefInnBed :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
CmnDefInnBed() : EventScript( 720916 )
|
||||
{}
|
||||
CmnDefInnBed() :
|
||||
EventScript( 720916 )
|
||||
{
|
||||
}
|
||||
|
||||
// menu
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
auto callback = [this]( Entity::Player& player, const Event::SceneResult& result )
|
||||
auto callback = [ this ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( result.param2 > 0 )
|
||||
Scene00001( player, result.param2 );
|
||||
};
|
||||
|
||||
player.playScene( getId(), 0, 0x2000, 0, 1, callback );
|
||||
player.playScene( getId(), 0, HIDE_HOTBAR, 0, 1, callback );
|
||||
}
|
||||
|
||||
// lay down
|
||||
void Scene00001( Entity::Player& player, uint16_t param )
|
||||
{
|
||||
auto callback = [this]( Entity::Player& player, const Event::SceneResult& result )
|
||||
auto callback = [ this ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
Scene00002( player, result.param2 );
|
||||
};
|
||||
|
@ -40,7 +43,7 @@ public:
|
|||
void Scene00100( Entity::Player& player )
|
||||
{
|
||||
auto callback = []( Entity::Player& player, const Event::SceneResult& result )
|
||||
{ };
|
||||
{};
|
||||
|
||||
player.playScene( getId(), 100, 0x800, 0, 0, callback );
|
||||
}
|
||||
|
|
|
@ -5,15 +5,18 @@
|
|||
#define ACTION_RENAME 3
|
||||
#define ACTION_REMOVE 4
|
||||
|
||||
class CmnDefLinkShell : public EventScript
|
||||
class CmnDefLinkShell :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
CmnDefLinkShell() : EventScript( 0xB0006 )
|
||||
{}
|
||||
CmnDefLinkShell() :
|
||||
EventScript( 0xB0006 )
|
||||
{
|
||||
}
|
||||
|
||||
void Scene00001( Entity::Player& player )
|
||||
{
|
||||
auto callback = [this]( Entity::Player& player, const Event::SceneResult& result )
|
||||
auto callback = [ this ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
switch( result.param2 )
|
||||
{
|
||||
|
|
22
src/servers/Scripts/common/CmnDefMarketBoardGridania.cpp
Normal file
22
src/servers/Scripts/common/CmnDefMarketBoardGridania.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class CmnDefMarketBoardGridania :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
CmnDefMarketBoardGridania() :
|
||||
EventScript( 0xB0027 )
|
||||
{
|
||||
}
|
||||
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 0, HIDE_HOTBAR, 0, 1 );
|
||||
}
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
};
|
|
@ -1,21 +1,24 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class CmnDefMogLetter : public EventScript
|
||||
class CmnDefMogLetter :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
CmnDefMogLetter() : EventScript( 720898 )
|
||||
{}
|
||||
CmnDefMogLetter() :
|
||||
EventScript( 720898 )
|
||||
{
|
||||
}
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
Scene00001( player );
|
||||
Scene00000( player );
|
||||
}
|
||||
|
||||
void Scene00001( Entity::Player& player )
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 1, 0,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
player.playScene( getId(), 0, 0,
|
||||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
} );
|
||||
}
|
||||
|
|
22
src/servers/Scripts/common/CmnDefNpcRepair.cpp
Normal file
22
src/servers/Scripts/common/CmnDefNpcRepair.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class CmnDefNpcRepair :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
CmnDefNpcRepair() :
|
||||
EventScript( 0xB0013 )
|
||||
{
|
||||
}
|
||||
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 0, HIDE_HOTBAR, 0, 1 );
|
||||
}
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
};
|
|
@ -1,16 +1,19 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class CmnDefWeatherForeCast : public EventScript
|
||||
class CmnDefWeatherForeCast :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
CmnDefWeatherForeCast() : EventScript( 721100 )
|
||||
{}
|
||||
CmnDefWeatherForeCast() :
|
||||
EventScript( 721100 )
|
||||
{
|
||||
}
|
||||
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 0, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
} );
|
||||
}
|
||||
|
|
22
src/servers/Scripts/common/ComDefMobHuntBoard.cpp
Normal file
22
src/servers/Scripts/common/ComDefMobHuntBoard.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class ComDefMobHuntBoard :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
ComDefMobHuntBoard() :
|
||||
EventScript( 0xB00CA )
|
||||
{
|
||||
}
|
||||
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 0, HIDE_HOTBAR, 0, 1 );
|
||||
}
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
};
|
51
src/servers/Scripts/common/GilShop.cpp
Normal file
51
src/servers/Scripts/common/GilShop.cpp
Normal file
|
@ -0,0 +1,51 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class GilShop :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
GilShop() :
|
||||
EventScript( 0x00040001 )
|
||||
{
|
||||
}
|
||||
|
||||
constexpr static auto SCENE_FLAGS = HIDE_HOTBAR | NO_DEFAULT_CAMERA;
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
player.playScene( eventId, 0, SCENE_FLAGS, 0, 2, shopCallback );
|
||||
}
|
||||
|
||||
private:
|
||||
static void shopInteractionCallback( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
// item purchase
|
||||
if( result.param1 == 768 )
|
||||
{
|
||||
// buy
|
||||
if( result.param2 == 1 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// sell
|
||||
else if( result.param2 == 2 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
player.sendDebug( "got tradeQuantity: " + std::to_string( result.param4 ) );
|
||||
player.playGilShop( result.eventId, SCENE_FLAGS, shopInteractionCallback );
|
||||
return;
|
||||
}
|
||||
|
||||
// exit
|
||||
player.playScene( result.eventId, 255, SCENE_FLAGS );
|
||||
}
|
||||
|
||||
static void shopCallback( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.playGilShop( result.eventId, SCENE_FLAGS, shopInteractionCallback );
|
||||
}
|
||||
};
|
|
@ -1,15 +1,18 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Actor/Player.h>
|
||||
|
||||
class HouFurOrchestrion : public EventScript
|
||||
class HouFurOrchestrion :
|
||||
public EventScript
|
||||
{
|
||||
public:
|
||||
HouFurOrchestrion() : EventScript( 721226 )
|
||||
{}
|
||||
HouFurOrchestrion() :
|
||||
EventScript( 721226 )
|
||||
{
|
||||
}
|
||||
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 0, 0x2000, 0, 1 );
|
||||
player.playScene( getId(), 0, HIDE_HOTBAR, 0, 1 );
|
||||
}
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
|
|
|
@ -1,26 +1,36 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Zone/InstanceContent.h>
|
||||
|
||||
class AkhAfahAmphitheatreExtreme : public InstanceContentScript
|
||||
class AkhAfahAmphitheatreExtreme :
|
||||
public InstanceContentScript
|
||||
{
|
||||
public:
|
||||
AkhAfahAmphitheatreExtreme() : InstanceContentScript( 20025 )
|
||||
{ }
|
||||
AkhAfahAmphitheatreExtreme() :
|
||||
InstanceContentScript( 20025 )
|
||||
{
|
||||
}
|
||||
|
||||
void onInit( InstanceContentPtr instance ) override
|
||||
{
|
||||
instance->registerEObj( "unknown_0", 2004238, 4772738, 4, { -1.210436f, 0.000000f, -0.715586f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_r1fc_b0472", 2004239, 4797573, 4, { 1.181316f, -0.000000f, 1.563968f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "unknown_0", 2004238, 4772738, 4, { -1.210436f, 0.000000f, -0.715586f }, 1.000000f,
|
||||
0.000000f );
|
||||
instance->registerEObj( "sgvf_r1fc_b0472", 2004239, 4797573, 4, { 1.181316f, -0.000000f, 1.563968f }, 1.000000f,
|
||||
0.000000f );
|
||||
// States -> wind_def wind_def_anim wind_pop wind_pop_anim
|
||||
instance->registerEObj( "sgvf_r1fc_b0471", 2004240, 4841629, 4, { 11.000000f, 0.000000f, -11.000000f }, 1.000000f, 0.793709f );
|
||||
instance->registerEObj( "sgvf_r1fc_b0471", 2004240, 4841629, 4, { 11.000000f, 0.000000f, -11.000000f }, 1.000000f,
|
||||
0.793709f );
|
||||
// States -> magi_def magi_def_anim magi_pop magi_pop_anim
|
||||
instance->registerEObj( "sgvf_r1fc_b0471_1", 2004349, 4841631, 4, { 12.811310f, -0.000000f, 9.376424f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_r1fc_b0471_1", 2004349, 4841631, 4, { 12.811310f, -0.000000f, 9.376424f }, 1.000000f,
|
||||
0.000000f );
|
||||
// States -> magi_def magi_def_anim magi_pop magi_pop_anim
|
||||
instance->registerEObj( "sgvf_r1fc_b0471_2", 2004350, 4841632, 4, { -8.033875f, 0.000000f, 10.406790f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_r1fc_b0471_2", 2004350, 4841632, 4, { -8.033875f, 0.000000f, 10.406790f }, 1.000000f,
|
||||
0.000000f );
|
||||
// States -> magi_def magi_def_anim magi_pop magi_pop_anim
|
||||
instance->registerEObj( "sgvf_r1fc_b0471_3", 2004351, 4841633, 4, { -8.319038f, -0.000001f, -10.997720f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_r1fc_b0471_3", 2004351, 4841633, 4, { -8.319038f, -0.000001f, -10.997720f },
|
||||
1.000000f, 0.000000f );
|
||||
// States -> magi_def magi_def_anim magi_pop magi_pop_anim
|
||||
instance->registerEObj( "Entrance", 2000182, 4738599, 5, { 9.717670f, 0.000000f, 14.522430f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "Entrance", 2000182, 4738599, 5, { 9.717670f, 0.000000f, 14.522430f }, 1.000000f,
|
||||
0.000000f );
|
||||
// States -> vf_lock_on vf_lock_of
|
||||
instance->registerEObj( "Exit", 2000139, 0, 4, { 0.000000f, 0.000000f, -15.000000f }, 1.000000f, 0.000000f );
|
||||
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Zone/InstanceContent.h>
|
||||
|
||||
class ThePalaceoftheDeadFloors101110 : public InstanceContentScript
|
||||
class ThePalaceoftheDeadFloors101110 :
|
||||
public InstanceContentScript
|
||||
{
|
||||
public:
|
||||
ThePalaceoftheDeadFloors101110() : InstanceContentScript( 60011 )
|
||||
{ }
|
||||
ThePalaceoftheDeadFloors101110() :
|
||||
InstanceContentScript( 60011 )
|
||||
{
|
||||
}
|
||||
|
||||
void onInit( InstanceContentPtr instance ) override
|
||||
{
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6527847, 4, { -300.000000f, 0.000026f, -237.000000f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6527847, 4, { -300.000000f, 0.000026f, -237.000000f },
|
||||
1.000000f, 0.000000f );
|
||||
// States -> vf_bextwall_on vf_bextwall_on2off vf_bextwall_off
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959_1", 2000608, 6544382, 4, { 301.149902f, -0.045413f, 285.247589f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959_1", 2000608, 6544382, 4, { 301.149902f, -0.045413f, 285.247589f },
|
||||
1.000000f, 0.000000f );
|
||||
// States -> vf_bextwall_on vf_bextwall_on2off vf_bextwall_off
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Zone/InstanceContent.h>
|
||||
|
||||
class ThePalaceoftheDeadFloors110 : public InstanceContentScript
|
||||
class ThePalaceoftheDeadFloors110 :
|
||||
public InstanceContentScript
|
||||
{
|
||||
public:
|
||||
ThePalaceoftheDeadFloors110() : InstanceContentScript( 60001 )
|
||||
{ }
|
||||
ThePalaceoftheDeadFloors110() :
|
||||
InstanceContentScript( 60001 )
|
||||
{
|
||||
}
|
||||
|
||||
void onInit( InstanceContentPtr instance ) override
|
||||
{
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2002872, 6324883, 4, { -300.000000f, -0.000010f, -220.000000f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2002872, 6324883, 4, { -300.000000f, -0.000010f, -220.000000f },
|
||||
1.000000f, 0.000000f );
|
||||
// States -> vf_bextwall_on vf_bextwall_on2off vf_bextwall_off
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Zone/InstanceContent.h>
|
||||
|
||||
class ThePalaceoftheDeadFloors111120 : public InstanceContentScript
|
||||
class ThePalaceoftheDeadFloors111120 :
|
||||
public InstanceContentScript
|
||||
{
|
||||
public:
|
||||
ThePalaceoftheDeadFloors111120() : InstanceContentScript( 60012 )
|
||||
{ }
|
||||
ThePalaceoftheDeadFloors111120() :
|
||||
InstanceContentScript( 60012 )
|
||||
{
|
||||
}
|
||||
|
||||
void onInit( InstanceContentPtr instance ) override
|
||||
{
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6535115, 4, { -300.000000f, 0.000026f, -237.000000f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6535115, 4, { -300.000000f, 0.000026f, -237.000000f },
|
||||
1.000000f, 0.000000f );
|
||||
// States -> vf_bextwall_on vf_bextwall_on2off vf_bextwall_off
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Zone/InstanceContent.h>
|
||||
|
||||
class ThePalaceoftheDeadFloors1120 : public InstanceContentScript
|
||||
class ThePalaceoftheDeadFloors1120 :
|
||||
public InstanceContentScript
|
||||
{
|
||||
public:
|
||||
ThePalaceoftheDeadFloors1120() : InstanceContentScript( 60002 )
|
||||
{ }
|
||||
ThePalaceoftheDeadFloors1120() :
|
||||
InstanceContentScript( 60002 )
|
||||
{
|
||||
}
|
||||
|
||||
void onInit( InstanceContentPtr instance ) override
|
||||
{
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6353850, 4, { -300.000000f, 0.000026f, -237.000000f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6353850, 4, { -300.000000f, 0.000026f, -237.000000f },
|
||||
1.000000f, 0.000000f );
|
||||
// States -> vf_bextwall_on vf_bextwall_on2off vf_bextwall_off
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Zone/InstanceContent.h>
|
||||
|
||||
class ThePalaceoftheDeadFloors121130 : public InstanceContentScript
|
||||
class ThePalaceoftheDeadFloors121130 :
|
||||
public InstanceContentScript
|
||||
{
|
||||
public:
|
||||
ThePalaceoftheDeadFloors121130() : InstanceContentScript( 60013 )
|
||||
{ }
|
||||
ThePalaceoftheDeadFloors121130() :
|
||||
InstanceContentScript( 60013 )
|
||||
{
|
||||
}
|
||||
|
||||
void onInit( InstanceContentPtr instance ) override
|
||||
{
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6535115, 4, { -300.000000f, 0.000026f, -237.000000f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6535115, 4, { -300.000000f, 0.000026f, -237.000000f },
|
||||
1.000000f, 0.000000f );
|
||||
// States -> vf_bextwall_on vf_bextwall_on2off vf_bextwall_off
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Zone/InstanceContent.h>
|
||||
|
||||
class ThePalaceoftheDeadFloors131140 : public InstanceContentScript
|
||||
class ThePalaceoftheDeadFloors131140 :
|
||||
public InstanceContentScript
|
||||
{
|
||||
public:
|
||||
ThePalaceoftheDeadFloors131140() : InstanceContentScript( 60014 )
|
||||
{ }
|
||||
ThePalaceoftheDeadFloors131140() :
|
||||
InstanceContentScript( 60014 )
|
||||
{
|
||||
}
|
||||
|
||||
void onInit( InstanceContentPtr instance ) override
|
||||
{
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6535683, 4, { -300.000000f, -0.000205f, -237.000000f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6535683, 4, { -300.000000f, -0.000205f, -237.000000f },
|
||||
1.000000f, 0.000000f );
|
||||
// States -> vf_bextwall_on vf_bextwall_on2off vf_bextwall_off
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Zone/InstanceContent.h>
|
||||
|
||||
class ThePalaceoftheDeadFloors141150 : public InstanceContentScript
|
||||
class ThePalaceoftheDeadFloors141150 :
|
||||
public InstanceContentScript
|
||||
{
|
||||
public:
|
||||
ThePalaceoftheDeadFloors141150() : InstanceContentScript( 60015 )
|
||||
{ }
|
||||
ThePalaceoftheDeadFloors141150() :
|
||||
InstanceContentScript( 60015 )
|
||||
{
|
||||
}
|
||||
|
||||
void onInit( InstanceContentPtr instance ) override
|
||||
{
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6535683, 4, { -300.000000f, -0.000205f, -237.000000f }, 1.000000f, 0.000000f );
|
||||
instance->registerEObj( "sgvf_w_lvd_b0959", 2000608, 6535683, 4, { -300.000000f, -0.000205f, -237.000000f },
|
||||
1.000000f, 0.000000f );
|
||||
// States -> vf_bextwall_on vf_bextwall_on2off vf_bextwall_off
|
||||
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue