1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-24 18:47:45 +00:00
This commit is contained in:
Maru 2017-12-04 07:37:58 -02:00
commit 51f2ec961e
68 changed files with 5770 additions and 1493 deletions

5
.gitignore vendored
View file

@ -106,4 +106,7 @@ src/libraries/external/boost_*
src/servers/Server_Common/Version\.cpp
# edit and continue files
/enc_temp_folder
/enc_temp_folder
# travis-ci build mtime cache
.mtime_cache

View file

@ -1,24 +1,44 @@
---
language: c++
sudo: enabled
before_install:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo add-apt-repository universe
- sudo apt-get update
- sudo apt-get install -y software-properties-common
- sudo apt-get update
- sudo apt-get install gcc-7 g++-7 gcc-7-multilib g++-7-multilib cmake3 -y
- sudo apt-get install libboost-dev libboost-all-dev libmysqlclient-dev -y
- sudo apt-get install libmysqlcppconn-dev -y
compiler:
- g++
sudo: enabled
git:
depth: 5
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
# Setup cache
cache:
directories:
- build
- .mtime_cache
# Setup build matrix and dependencies
before_install:
- eval "${MATRIX_EVAL}"
- gem install --no-ri --no-rdoc mtime_cache
- sudo apt-get update
- sudo apt-get install -y libboost-dev libboost-all-dev
- sudo apt-get install -y libmysqlclient-dev libmysqlcppconn-dev
# Build steps
script:
- g++ --version
- mkdir build
- $CXX --version
- mtime_cache src/**/*.{%{cpp}} -c .mtime_cache/cache.json
- mkdir -p build
- cd build
- cmake .. -DSAPPHIRE_BOOST_VER="1.54.0" -DCMAKE_CXX_COMPILER=g++-7 && make -j 3
- cmake .. -DSAPPHIRE_BOOST_VER="1.54.0" && make -j 3
- cd ..
- bash sql_import.sh

View file

@ -56,6 +56,62 @@
"value": "-vc140"
}
]
},
{
"name": "x86-Debug",
"generator": "Visual Studio 15 2017",
"configurationType": "Debug",
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "-DCMAKE_BUILD_TYPE=\"Debug\"",
"buildCommandArgs": "-m -v:minimal",
"variables": [
{
"name": "Boost_COMPILER",
"value": "-vc141"
}
]
},
{
"name": "x86-Release",
"generator": "Visual Studio 15 2017",
"configurationType": "Release",
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-m -v:minimal",
"variables": [
{
"name": "Boost_COMPILER",
"value": "-vc141"
}
]
},
{
"name": "x64-Debug",
"generator": "Visual Studio 15 2017 Win64",
"configurationType": "Debug",
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "-DCMAKE_BUILD_TYPE=\"Debug\"",
"buildCommandArgs": "-m -v:minimal",
"variables": [
{
"name": "Boost_COMPILER",
"value": "-vc141"
}
]
},
{
"name": "x64-Release",
"generator": "Visual Studio 15 2017 Win64",
"configurationType": "Release",
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-m -v:minimal",
"variables": [
{
"name": "Boost_COMPILER",
"value": "-vc141"
}
]
}
]
}

View file

@ -7,6 +7,8 @@
<ListenIp>127.0.0.1</ListenIp>
<!-- Path of FFXIV dat files -->
<DataPath>C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv</DataPath>
<!-- Path of Chai script files -->
<ScriptPath>../scripts/chai</ScriptPath>
<!-- Connection settings for the mysql db -->
<Mysql>
<Host>127.0.0.1</Host>

View file

@ -48,7 +48,7 @@ CREATE TABLE `charaglobalitem` (
`buffer_4` int(3) DEFAULT '0',
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` datetime DEFAULT CURRENT_TIMESTAMP,
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`itemId`),
KEY `CharacterId` (`CharacterId`),
KEY `storageId` (`storageId`),

View file

@ -15,7 +15,7 @@ CREATE TABLE `charainfo` (
`AccountId` int(11) NOT NULL,
`CharacterId` decimal(20,0) NOT NULL,
`ContentId` bigint(20) DEFAULT NULL,
`Name` varchar(32) COLLATE latin1_general_ci DEFAULT NULL,
`Name` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
`Hp` bigint(20) DEFAULT '200',
`Mp` bigint(20) DEFAULT '200',
`Tp` bigint(20) DEFAULT '0',
@ -75,7 +75,8 @@ CREATE TABLE `charainfo` (
`GMRank` int(3) DEFAULT '0',
`Unlocks` binary(64) DEFAULT NULL,
`CFPenaltyUntil` int(11) DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`CharacterId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- Dumping data for table sapphire.charainfo: 0 rows

View file

@ -27,7 +27,7 @@ CREATE TABLE `charainfoblacklist` (
`CharacterIdList` blob,
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` date DEFAULT NULL,
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`CharacterId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

View file

@ -28,7 +28,7 @@ CREATE TABLE `charainfofriendlist` (
`InviteDataList` blob,
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` date DEFAULT NULL,
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`CharacterId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

View file

@ -27,7 +27,7 @@ CREATE TABLE `charainfolinkshell` (
`LinkshellIdList` binary(64) DEFAULT NULL,
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` date DEFAULT NULL,
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`CharacterId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

View file

@ -29,7 +29,7 @@ CREATE TABLE `charainfosearch` (
`SearchComment` binary(193) DEFAULT "",
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` date DEFAULT NULL
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

View file

@ -47,7 +47,7 @@ CREATE TABLE `charaitemcrystal` (
`container_17` int(20) DEFAULT '0',
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` datetime DEFAULT CURRENT_TIMESTAMP,
`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;

View file

@ -41,7 +41,7 @@ CREATE TABLE `charaitemcurrency` (
`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 DEFAULT CURRENT_TIMESTAMP,
`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;

View file

@ -43,7 +43,7 @@ CREATE TABLE `charaitemgearset` (
`container_13` int(20) DEFAULT '0',
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` datetime DEFAULT CURRENT_TIMESTAMP,
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`CharacterId`,`storageId`),
UNIQUE KEY `idx` (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

View file

@ -54,7 +54,7 @@ CREATE TABLE IF NOT EXISTS `charaiteminventory` (
`container_34` int(20) DEFAULT '0',
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` datetime DEFAULT CURRENT_TIMESTAMP,
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`CharacterId`,`storageId`),
UNIQUE KEY `idx` (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=161 DEFAULT CHARSET=utf8;

View file

@ -1,309 +0,0 @@
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE charaquest (
`QuestId_0` int(5) DEFAULT '0',
`Sequence_0` int(3) DEFAULT '0',
`Flags_0` int(3) DEFAULT '0',
`Variables_0_0` int(3) DEFAULT '0',
`Variables_0_1` int(3) DEFAULT '0',
`Variables_0_2` int(3) DEFAULT '0',
`Variables_0_3` int(3) DEFAULT '0',
`Variables_0_4` int(3) DEFAULT '0',
`Variables_0_5` int(3) DEFAULT '0',
`Variables_0_6` int(3) DEFAULT '0',
`QuestId_1` int(5) DEFAULT '0',
`Sequence_1` int(3) DEFAULT '0',
`Flags_1` int(3) DEFAULT '0',
`Variables_1_0` int(3) DEFAULT '0',
`Variables_1_1` int(3) DEFAULT '0',
`Variables_1_2` int(3) DEFAULT '0',
`Variables_1_3` int(3) DEFAULT '0',
`Variables_1_4` int(3) DEFAULT '0',
`Variables_1_5` int(3) DEFAULT '0',
`Variables_1_6` int(3) DEFAULT '0',
`QuestId_2` int(5) DEFAULT '0',
`Sequence_2` int(3) DEFAULT '0',
`Flags_2` int(3) DEFAULT '0',
`Variables_2_0` int(3) DEFAULT '0',
`Variables_2_1` int(3) DEFAULT '0',
`Variables_2_2` int(3) DEFAULT '0',
`Variables_2_3` int(3) DEFAULT '0',
`Variables_2_4` int(3) DEFAULT '0',
`Variables_2_5` int(3) DEFAULT '0',
`Variables_2_6` int(3) DEFAULT '0',
`QuestId_3` int(5) DEFAULT '0',
`Sequence_3` int(3) DEFAULT '0',
`Flags_3` int(3) DEFAULT '0',
`Variables_3_0` int(3) DEFAULT '0',
`Variables_3_1` int(3) DEFAULT '0',
`Variables_3_2` int(3) DEFAULT '0',
`Variables_3_3` int(3) DEFAULT '0',
`Variables_3_4` int(3) DEFAULT '0',
`Variables_3_5` int(3) DEFAULT '0',
`Variables_3_6` int(3) DEFAULT '0',
`QuestId_4` int(5) DEFAULT '0',
`Sequence_4` int(3) DEFAULT '0',
`Flags_4` int(3) DEFAULT '0',
`Variables_4_0` int(3) DEFAULT '0',
`Variables_4_1` int(3) DEFAULT '0',
`Variables_4_2` int(3) DEFAULT '0',
`Variables_4_3` int(3) DEFAULT '0',
`Variables_4_4` int(3) DEFAULT '0',
`Variables_4_5` int(3) DEFAULT '0',
`Variables_4_6` int(3) DEFAULT '0',
`QuestId_5` int(5) DEFAULT '0',
`Sequence_5` int(3) DEFAULT '0',
`Flags_5` int(3) DEFAULT '0',
`Variables_5_0` int(3) DEFAULT '0',
`Variables_5_1` int(3) DEFAULT '0',
`Variables_5_2` int(3) DEFAULT '0',
`Variables_5_3` int(3) DEFAULT '0',
`Variables_5_4` int(3) DEFAULT '0',
`Variables_5_5` int(3) DEFAULT '0',
`Variables_5_6` int(3) DEFAULT '0',
`QuestId_6` int(5) DEFAULT '0',
`Sequence_6` int(3) DEFAULT '0',
`Flags_6` int(3) DEFAULT '0',
`Variables_6_0` int(3) DEFAULT '0',
`Variables_6_1` int(3) DEFAULT '0',
`Variables_6_2` int(3) DEFAULT '0',
`Variables_6_3` int(3) DEFAULT '0',
`Variables_6_4` int(3) DEFAULT '0',
`Variables_6_5` int(3) DEFAULT '0',
`Variables_6_6` int(3) DEFAULT '0',
`QuestId_7` int(5) DEFAULT '0',
`Sequence_7` int(3) DEFAULT '0',
`Flags_7` int(3) DEFAULT '0',
`Variables_7_0` int(3) DEFAULT '0',
`Variables_7_1` int(3) DEFAULT '0',
`Variables_7_2` int(3) DEFAULT '0',
`Variables_7_3` int(3) DEFAULT '0',
`Variables_7_4` int(3) DEFAULT '0',
`Variables_7_5` int(3) DEFAULT '0',
`Variables_7_6` int(3) DEFAULT '0',
`QuestId_8` int(5) DEFAULT '0',
`Sequence_8` int(3) DEFAULT '0',
`Flags_8` int(3) DEFAULT '0',
`Variables_8_0` int(3) DEFAULT '0',
`Variables_8_1` int(3) DEFAULT '0',
`Variables_8_2` int(3) DEFAULT '0',
`Variables_8_3` int(3) DEFAULT '0',
`Variables_8_4` int(3) DEFAULT '0',
`Variables_8_5` int(3) DEFAULT '0',
`Variables_8_6` int(3) DEFAULT '0',
`QuestId_9` int(5) DEFAULT '0',
`Sequence_9` int(3) DEFAULT '0',
`Flags_9` int(3) DEFAULT '0',
`Variables_9_0` int(3) DEFAULT '0',
`Variables_9_1` int(3) DEFAULT '0',
`Variables_9_2` int(3) DEFAULT '0',
`Variables_9_3` int(3) DEFAULT '0',
`Variables_9_4` int(3) DEFAULT '0',
`Variables_9_5` int(3) DEFAULT '0',
`Variables_9_6` int(3) DEFAULT '0',
`QuestId_10` int(5) DEFAULT '0',
`Sequence_10` int(3) DEFAULT '0',
`Flags_10` int(3) DEFAULT '0',
`Variables_10_0` int(3) DEFAULT '0',
`Variables_10_1` int(3) DEFAULT '0',
`Variables_10_2` int(3) DEFAULT '0',
`Variables_10_3` int(3) DEFAULT '0',
`Variables_10_4` int(3) DEFAULT '0',
`Variables_10_5` int(3) DEFAULT '0',
`Variables_10_6` int(3) DEFAULT '0',
`QuestId_11` int(5) DEFAULT '0',
`Sequence_11` int(3) DEFAULT '0',
`Flags_11` int(3) DEFAULT '0',
`Variables_11_0` int(3) DEFAULT '0',
`Variables_11_1` int(3) DEFAULT '0',
`Variables_11_2` int(3) DEFAULT '0',
`Variables_11_3` int(3) DEFAULT '0',
`Variables_11_4` int(3) DEFAULT '0',
`Variables_11_5` int(3) DEFAULT '0',
`Variables_11_6` int(3) DEFAULT '0',
`QuestId_12` int(5) DEFAULT '0',
`Sequence_12` int(3) DEFAULT '0',
`Flags_12` int(3) DEFAULT '0',
`Variables_12_0` int(3) DEFAULT '0',
`Variables_12_1` int(3) DEFAULT '0',
`Variables_12_2` int(3) DEFAULT '0',
`Variables_12_3` int(3) DEFAULT '0',
`Variables_12_4` int(3) DEFAULT '0',
`Variables_12_5` int(3) DEFAULT '0',
`Variables_12_6` int(3) DEFAULT '0',
`QuestId_13` int(5) DEFAULT '0',
`Sequence_13` int(3) DEFAULT '0',
`Flags_13` int(3) DEFAULT '0',
`Variables_13_0` int(3) DEFAULT '0',
`Variables_13_1` int(3) DEFAULT '0',
`Variables_13_2` int(3) DEFAULT '0',
`Variables_13_3` int(3) DEFAULT '0',
`Variables_13_4` int(3) DEFAULT '0',
`Variables_13_5` int(3) DEFAULT '0',
`Variables_13_6` int(3) DEFAULT '0',
`QuestId_14` int(5) DEFAULT '0',
`Sequence_14` int(3) DEFAULT '0',
`Flags_14` int(3) DEFAULT '0',
`Variables_14_0` int(3) DEFAULT '0',
`Variables_14_1` int(3) DEFAULT '0',
`Variables_14_2` int(3) DEFAULT '0',
`Variables_14_3` int(3) DEFAULT '0',
`Variables_14_4` int(3) DEFAULT '0',
`Variables_14_5` int(3) DEFAULT '0',
`Variables_14_6` int(3) DEFAULT '0',
`QuestId_15` int(5) DEFAULT '0',
`Sequence_15` int(3) DEFAULT '0',
`Flags_15` int(3) DEFAULT '0',
`Variables_15_0` int(3) DEFAULT '0',
`Variables_15_1` int(3) DEFAULT '0',
`Variables_15_2` int(3) DEFAULT '0',
`Variables_15_3` int(3) DEFAULT '0',
`Variables_15_4` int(3) DEFAULT '0',
`Variables_15_5` int(3) DEFAULT '0',
`Variables_15_6` int(3) DEFAULT '0',
`QuestId_16` int(5) DEFAULT '0',
`Sequence_16` int(3) DEFAULT '0',
`Flags_16` int(3) DEFAULT '0',
`Variables_16_0` int(3) DEFAULT '0',
`Variables_16_1` int(3) DEFAULT '0',
`Variables_16_2` int(3) DEFAULT '0',
`Variables_16_3` int(3) DEFAULT '0',
`Variables_16_4` int(3) DEFAULT '0',
`Variables_16_5` int(3) DEFAULT '0',
`Variables_16_6` int(3) DEFAULT '0',
`QuestId_17` int(5) DEFAULT '0',
`Sequence_17` int(3) DEFAULT '0',
`Flags_17` int(3) DEFAULT '0',
`Variables_17_0` int(3) DEFAULT '0',
`Variables_17_1` int(3) DEFAULT '0',
`Variables_17_2` int(3) DEFAULT '0',
`Variables_17_3` int(3) DEFAULT '0',
`Variables_17_4` int(3) DEFAULT '0',
`Variables_17_5` int(3) DEFAULT '0',
`Variables_17_6` int(3) DEFAULT '0',
`QuestId_18` int(5) DEFAULT '0',
`Sequence_18` int(3) DEFAULT '0',
`Flags_18` int(3) DEFAULT '0',
`Variables_18_0` int(3) DEFAULT '0',
`Variables_18_1` int(3) DEFAULT '0',
`Variables_18_2` int(3) DEFAULT '0',
`Variables_18_3` int(3) DEFAULT '0',
`Variables_18_4` int(3) DEFAULT '0',
`Variables_18_5` int(3) DEFAULT '0',
`Variables_18_6` int(3) DEFAULT '0',
`QuestId_19` int(5) DEFAULT '0',
`Sequence_19` int(3) DEFAULT '0',
`Flags_19` int(3) DEFAULT '0',
`Variables_19_0` int(3) DEFAULT '0',
`Variables_19_1` int(3) DEFAULT '0',
`Variables_19_2` int(3) DEFAULT '0',
`Variables_19_3` int(3) DEFAULT '0',
`Variables_19_4` int(3) DEFAULT '0',
`Variables_19_5` int(3) DEFAULT '0',
`Variables_19_6` int(3) DEFAULT '0',
`QuestId_20` int(5) DEFAULT '0',
`Sequence_20` int(3) DEFAULT '0',
`Flags_20` int(3) DEFAULT '0',
`Variables_20_0` int(3) DEFAULT '0',
`Variables_20_1` int(3) DEFAULT '0',
`Variables_20_2` int(3) DEFAULT '0',
`Variables_20_3` int(3) DEFAULT '0',
`Variables_20_4` int(3) DEFAULT '0',
`Variables_20_5` int(3) DEFAULT '0',
`Variables_20_6` int(3) DEFAULT '0',
`QuestId_21` int(5) DEFAULT '0',
`Sequence_21` int(3) DEFAULT '0',
`Flags_21` int(3) DEFAULT '0',
`Variables_21_0` int(3) DEFAULT '0',
`Variables_21_1` int(3) DEFAULT '0',
`Variables_21_2` int(3) DEFAULT '0',
`Variables_21_3` int(3) DEFAULT '0',
`Variables_21_4` int(3) DEFAULT '0',
`Variables_21_5` int(3) DEFAULT '0',
`Variables_21_6` int(3) DEFAULT '0',
`QuestId_22` int(5) DEFAULT '0',
`Sequence_22` int(3) DEFAULT '0',
`Flags_22` int(3) DEFAULT '0',
`Variables_22_0` int(3) DEFAULT '0',
`Variables_22_1` int(3) DEFAULT '0',
`Variables_22_2` int(3) DEFAULT '0',
`Variables_22_3` int(3) DEFAULT '0',
`Variables_22_4` int(3) DEFAULT '0',
`Variables_22_5` int(3) DEFAULT '0',
`Variables_22_6` int(3) DEFAULT '0',
`QuestId_23` int(5) DEFAULT '0',
`Sequence_23` int(3) DEFAULT '0',
`Flags_23` int(3) DEFAULT '0',
`Variables_23_0` int(3) DEFAULT '0',
`Variables_23_1` int(3) DEFAULT '0',
`Variables_23_2` int(3) DEFAULT '0',
`Variables_23_3` int(3) DEFAULT '0',
`Variables_23_4` int(3) DEFAULT '0',
`Variables_23_5` int(3) DEFAULT '0',
`Variables_23_6` int(3) DEFAULT '0',
`QuestId_24` int(5) DEFAULT '0',
`Sequence_24` int(3) DEFAULT '0',
`Flags_24` int(3) DEFAULT '0',
`Variables_24_0` int(3) DEFAULT '0',
`Variables_24_1` int(3) DEFAULT '0',
`Variables_24_2` int(3) DEFAULT '0',
`Variables_24_3` int(3) DEFAULT '0',
`Variables_24_4` int(3) DEFAULT '0',
`Variables_24_5` int(3) DEFAULT '0',
`Variables_24_6` int(3) DEFAULT '0',
`QuestId_25` int(5) DEFAULT '0',
`Sequence_25` int(3) DEFAULT '0',
`Flags_25` int(3) DEFAULT '0',
`Variables_25_0` int(3) DEFAULT '0',
`Variables_25_1` int(3) DEFAULT '0',
`Variables_25_2` int(3) DEFAULT '0',
`Variables_25_3` int(3) DEFAULT '0',
`Variables_25_4` int(3) DEFAULT '0',
`Variables_25_5` int(3) DEFAULT '0',
`Variables_25_6` int(3) DEFAULT '0',
`QuestId_26` int(5) DEFAULT '0',
`Sequence_26` int(3) DEFAULT '0',
`Flags_26` int(3) DEFAULT '0',
`Variables_26_0` int(3) DEFAULT '0',
`Variables_26_1` int(3) DEFAULT '0',
`Variables_26_2` int(3) DEFAULT '0',
`Variables_26_3` int(3) DEFAULT '0',
`Variables_26_4` int(3) DEFAULT '0',
`Variables_26_5` int(3) DEFAULT '0',
`Variables_26_6` int(3) DEFAULT '0',
`QuestId_27` int(5) DEFAULT '0',
`Sequence_27` int(3) DEFAULT '0',
`Flags_27` int(3) DEFAULT '0',
`Variables_27_0` int(3) DEFAULT '0',
`Variables_27_1` int(3) DEFAULT '0',
`Variables_27_2` int(3) DEFAULT '0',
`Variables_27_3` int(3) DEFAULT '0',
`Variables_27_4` int(3) DEFAULT '0',
`Variables_27_5` int(3) DEFAULT '0',
`Variables_27_6` int(3) DEFAULT '0',
`QuestId_28` int(5) DEFAULT '0',
`Sequence_28` int(3) DEFAULT '0',
`Flags_28` int(3) DEFAULT '0',
`Variables_28_0` int(3) DEFAULT '0',
`Variables_28_1` int(3) DEFAULT '0',
`Variables_28_2` int(3) DEFAULT '0',
`Variables_28_3` int(3) DEFAULT '0',
`Variables_28_4` int(3) DEFAULT '0',
`Variables_28_5` int(3) DEFAULT '0',
`Variables_28_6` int(3) DEFAULT '0',
`QuestId_29` int(5) DEFAULT '0',
`Sequence_29` int(3) DEFAULT '0',
`Flags_29` int(3) DEFAULT '0',
`Variables_29_0` int(3) DEFAULT '0',
`Variables_29_1` int(3) DEFAULT '0',
`Variables_29_2` int(3) DEFAULT '0',
`Variables_29_3` int(3) DEFAULT '0',
`Variables_29_4` int(3) DEFAULT '0',
`Variables_29_5` int(3) DEFAULT '0',
`Variables_29_6` int(3) DEFAULT '0',
`CharacterId` int(20) DEFAULT '0',
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

View file

@ -16,5 +16,5 @@ CREATE TABLE charaquestnew (
`Variables_6` int(3) DEFAULT '0',
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` date
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

View file

@ -101,7 +101,7 @@ CREATE TABLE `charastatus` (
`CharacterId` int(20) DEFAULT NULL,
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` date DEFAULT NULL
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

48
sql/import.bat Normal file
View file

@ -0,0 +1,48 @@
@ECHO OFF
SETLOCAL
REM =============
REM IMPORT CONFIG
REM =============
REM NOTE: No spaces before or after the '='!!!
REM =============
SET PATH_MYSQL="Path\to\mysql.exe"
SET PATH_MYSQLADMIN="Path\to\mysqladmin.exe"
SET PATH_SQL="Path\to\Sapphire\sql"
SET USER=root
SET PASSWORD=
SET DBADDRESS=localhost
SET DBPORT=3306
SET DBNAME=sapphire
REM =============
IF DEFINED PASSWORD (SET PASSWORD=-p%PASSWORD%)
ECHO Deleteing old database
%PATH_MYSQLADMIN% -h %DBADDRESS% -u %USER% %PASSWORD% DROP %DBNAME%
ECHO Creating new database
%PATH_MYSQLADMIN% -h %DBADDRESS% -u %USER% %PASSWORD% CREATE %DBNAME%
ECHO Loading tables into the database
cd %PATH_SQL%
FOR %%X IN (*.sql) DO (
IF "%%X"=="update.sql" (
REM handle update.sql last
) ELSE (
ECHO Importing %%X
%PATH_MYSQL% %DBNAME% -h %DBADDRESS% -u %USER% < %%X
)
)
IF EXIST "update.sql" (
ECHO Importing update.sql
%PATH_MYSQL% %DBNAME% -h %DBADDRESS% -u %USER% < update.sql
)
ECHO Finished!
ENDLOCAL
PAUSE
@ECHO ON

View file

@ -31,7 +31,7 @@ CREATE TABLE `infolinkshell` (
`InviteIdList` blob,
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` date DEFAULT NULL,
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`LinkshellId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

View file

@ -27,7 +27,7 @@ CREATE TABLE `uniqueiddata` (
`IdName` varchar(16) DEFAULT 'NOT SET',
`IS_DELETE` int(3) DEFAULT '0',
`IS_NOT_ACTIVE_FLG` int(3) DEFAULT '0',
`UPDATE_DATE` datetime DEFAULT CURRENT_TIMESTAMP,
`UPDATE_DATE` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`NextId`)
) ENGINE=MyISAM AUTO_INCREMENT=1000447 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

View file

@ -0,0 +1,44 @@
ALTER TABLE charainfo
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charastatus
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charainfoblacklist
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charaglobalitem
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charainfofriendlist
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charainfolinkshell
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charainfosearch
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charaitemcrystal
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charaitemcurrency
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charaitemgearset
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charaiteminventory
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charaquestnew
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE infolinkshell
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE uniqueiddata
MODIFY COLUMN UPDATE_DATE DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE charainfo
ADD `Orchestrion` binary(38) DEFAULT NULL AFTER `Mounts`;

File diff suppressed because it is too large Load diff

View file

@ -27,7 +27,7 @@ void Core::Db::CharaDbConnection::doPrepareStatements()
"OTerritoryType, OTerritoryId, OPosX, OPosY, OPosZ, OPosR, GuardianDeity, "
"BirthDay, BirthMonth, Class, Status, TotalPlayTime, FirstClass, HomePoint, "
"FavoritePoint, RestPoint, StartTown, ActiveTitle, TitleList, Achievement, "
"Aetheryte, HowTo, Minions, Mounts, EquippedMannequin, ConfigFlags, "
"Aetheryte, HowTo, Minions, Mounts, Orchestrion, EquippedMannequin, ConfigFlags, "
"QuestCompleteFlags, OpeningSequence, QuestTracking, GrandCompany, "
"GrandCompanyRank, Discovery, GMRank, Unlocks, CFPenaltyUntil "
"FROM charainfo WHERE CharacterId = ?;", CONNECTION_SYNC );
@ -41,7 +41,7 @@ void Core::Db::CharaDbConnection::doPrepareStatements()
"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 = ?, "
"ActiveTitle = ?, TitleList = ?, Achievement = ?, Aetheryte = ?, HowTo = ?, Minions = ?, Mounts = ?, Orchestrion = ?, "
"EquippedMannequin = ?, ConfigFlags = ?, QuestCompleteFlags = ?, OpeningSequence = ?, "
"QuestTracking = ?, GrandCompany = ?, GrandCompanyRank = ?, Discovery = ?, GMRank = ?, Unlocks = ?, "
"CFPenaltyUntil = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );
@ -55,8 +55,8 @@ void Core::Db::CharaDbConnection::doPrepareStatements()
"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, UPDATE_DATE ) "
"VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW() );",
"Aetheryte, GMRank, Mounts, Orchestrion, UPDATE_DATE ) "
"VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW() );",
CONNECTION_SYNC );
prepareStatement( CHARA_UP_NAME, "UPDATE charainfo SET Name = ? WHERE CharacterId = ?;", CONNECTION_ASYNC );

View file

@ -136,7 +136,9 @@ namespace Packets {
IPCTYPE_UNK_320 = 0x0207, // updated 4.1
IPCTYPE_UNK_322 = 0x0209, // updated 4.1
ActorGauge = 0x249
ActorGauge = 0x0249,
PerformNote = 0x0252,
};
// TODO: Include structures for the individual packet segment types
@ -199,6 +201,7 @@ namespace Packets {
ReqEquipDisplayFlagsChange = 0x014C, // updated 4.1 ??
PerformNoteHandler = 0x0160,
};
////////////////////////////////////////////////////////////////////////////////

View file

@ -1337,6 +1337,12 @@ struct FFXIVIpcActorGauge : FFXIVIpcBasePacket<ActorGauge>
uint8_t data[15]; // depends on classJobId
};
struct FFXIVIpcPerformNote : FFXIVIpcBasePacket<PerformNote>
{
uint8_t data[32];
};
} /* Server */
} /* Packets */
} /* Network */

View file

@ -153,6 +153,8 @@ namespace Core {
std::vector< uint8_t > discovery( 411 );
std::vector< uint8_t > questComplete( 200 );
std::vector< uint8_t > unlocks( 64 );
std::vector< uint8_t > mountGuide( 13 );
std::vector< uint8_t > orchestrion( 38 );
std::vector< uint8_t > modelEquip( 40 );
std::vector< uint8_t > questTracking8( 10 );
std::vector< int16_t > questTracking = { -1, -1, -1, -1, -1 };
@ -255,6 +257,8 @@ namespace Core {
stmt->setBinary( 29, questTracking8 );
stmt->setBinary( 30, aetherytes );
stmt->setInt( 31, m_gmRank );
stmt->setBinary( 32, mountGuide );
stmt->setBinary( 33, orchestrion );
g_charaDb.directExecute( stmt );
auto stmtSearchInfo = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHARA_SEARCHINFO_INS );

View file

@ -1,11 +1,11 @@
#include "Session.h"
namespace Core {
Session::Session( void )
Session::Session()
{
}
Session::~Session( void )
Session::~Session()
{
}

View file

@ -20,8 +20,8 @@ namespace Core {
std::string newCharName;
Session( void );
~Session( void );
Session();
~Session();
uint32_t getIp() const;

View file

@ -12,7 +12,7 @@ Core::Action::Action::~Action()
}
uint32_t Core::Action::Action::getId() const
uint16_t Core::Action::Action::getId() const
{
return m_id;
}

View file

@ -13,7 +13,7 @@ namespace Core { namespace Action {
Action();
virtual ~Action();
uint32_t getId() const;
uint16_t getId() const;
Common::HandleActionType getHandleActionType() const;
@ -41,7 +41,7 @@ namespace Core { namespace Action {
virtual bool update();
protected:
uint32_t m_id;
uint16_t m_id;
Common::HandleActionType m_handleActionType;
uint64_t m_startTime;

View file

@ -26,7 +26,7 @@ Core::Action::ActionCast::ActionCast()
m_handleActionType = Common::HandleActionType::Event;
}
Core::Action::ActionCast::ActionCast( Entity::ActorPtr pActor, Entity::ActorPtr pTarget, uint32_t actionId )
Core::Action::ActionCast::ActionCast( Entity::ActorPtr pActor, Entity::ActorPtr pTarget, uint16_t actionId )
{
m_startTime = 0;
m_id = actionId;
@ -37,10 +37,7 @@ Core::Action::ActionCast::ActionCast( Entity::ActorPtr pActor, Entity::ActorPtr
m_bInterrupt = false;
}
Core::Action::ActionCast::~ActionCast()
{
}
Core::Action::ActionCast::~ActionCast() = default;
void Core::Action::ActionCast::onStart()
{

View file

@ -14,7 +14,7 @@ namespace Core { namespace Action {
ActionCast();
~ActionCast();
ActionCast( Entity::ActorPtr pActor, Entity::ActorPtr pTarget, uint32_t actionId );
ActionCast( Entity::ActorPtr pActor, Entity::ActorPtr pTarget, uint16_t actionId );
void onStart() override;
void onFinish() override;

View file

@ -50,7 +50,10 @@ bool ActionCollision::isActorApplicable( ActorPtr actorPtr, TargetFilter targetF
return ( actorApplicable && actorPtr->isAlive() );
}
std::set< Core::Entity::ActorPtr > ActionCollision::getActorsHitFromAction( FFXIVARR_POSITION3 aoePosition, std::set< ActorPtr > actorsInRange, boost::shared_ptr< Core::Data::ActionInfo > actionInfo, TargetFilter targetFilter )
std::set< Core::Entity::ActorPtr > ActionCollision::getActorsHitFromAction( FFXIVARR_POSITION3 aoePosition,
std::set< ActorPtr > actorsInRange,
boost::shared_ptr< Core::Data::ActionInfo > actionInfo,
TargetFilter targetFilter )
{
std::set< ActorPtr > actorsCollided;

View file

@ -23,11 +23,17 @@ namespace Core {
public:
static bool isActorApplicable( ActorPtr actorPtr, TargetFilter targetFilter );
static std::set< ActorPtr > getActorsHitFromAction( Common::FFXIVARR_POSITION3 aoePosition, std::set< ActorPtr > actorsInRange, boost::shared_ptr< Data::ActionInfo > actionInfo, TargetFilter targetFilter );
static std::set< ActorPtr > getActorsHitFromAction( Common::FFXIVARR_POSITION3 aoePosition,
std::set< ActorPtr > actorsInRange,
boost::shared_ptr< Data::ActionInfo > actionInfo,
TargetFilter targetFilter );
private:
static bool radiusCollision( Common::FFXIVARR_POSITION3 actorPosition, Common::FFXIVARR_POSITION3 aoePosition, uint16_t radius );
static bool boxCollision( Common::FFXIVARR_POSITION3 actorPosition, Common::FFXIVARR_POSITION3 aoePosition, uint16_t width, uint16_t height );
static bool radiusCollision( Common::FFXIVARR_POSITION3 actorPosition, Common::FFXIVARR_POSITION3 aoePosition,
uint16_t radius );
static bool boxCollision( Common::FFXIVARR_POSITION3 actorPosition, Common::FFXIVARR_POSITION3 aoePosition,
uint16_t width, uint16_t height );
};

View file

@ -26,7 +26,7 @@ Core::Action::ActionMount::ActionMount()
m_handleActionType = Common::HandleActionType::Event;
}
Core::Action::ActionMount::ActionMount( Entity::ActorPtr pActor, uint32_t mountId )
Core::Action::ActionMount::ActionMount( Entity::ActorPtr pActor, uint16_t mountId )
{
m_startTime = 0;
m_id = mountId;
@ -54,7 +54,8 @@ void Core::Action::ActionMount::onStart()
castPacket.data().action_id = m_id;
castPacket.data().skillType = Common::SkillType::MountSkill;
castPacket.data().unknown_1 = m_id;
castPacket.data().cast_time = static_cast< float >( m_castTime / 1000 ); // This is used for the cast bar above the target bar of the caster.
// This is used for the cast bar above the target bar of the caster.
castPacket.data().cast_time = static_cast< float >( m_castTime / 1000 );
castPacket.data().target_id = m_pSource->getAsPlayer()->getId();
m_pSource->sendToInRangeSet( castPacket, true );
@ -101,7 +102,7 @@ void Core::Action::ActionMount::onInterrupt()
m_pSource->getAsPlayer()->sendStateFlags();
auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt,
0x219, 1, m_id, 0 );
0x219, 1, m_id, 0 );
// Note: When cast interrupt from taking too much damage, set the last value to 1. This enables the cast interrupt effect. Example:
// auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt, 0x219, 1, m_id, 0 );

View file

@ -14,7 +14,7 @@ namespace Core { namespace Action {
ActionMount();
~ActionMount();
ActionMount( Entity::ActorPtr pActor, uint32_t mountId );
ActionMount( Entity::ActorPtr pActor, uint16_t mountId );
void onStart() override;
void onFinish() override;

View file

@ -90,7 +90,7 @@ void Core::Action::ActionTeleport::onFinish()
effectPacket.data().actionTextId = 5;
effectPacket.data().unknown_5 = 1;
effectPacket.data().numEffects = 1;
effectPacket.data().rotation = static_cast< uint16_t >( 0x8000 * ((pPlayer->getRotation() + 3.1415926)) / 3.1415926 );
effectPacket.data().rotation = static_cast< uint16_t >( 0x8000 * ( (pPlayer->getRotation() + 3.1415926) ) / 3.1415926 );
effectPacket.data().effectTarget = pPlayer->getId();
pPlayer->sendToInRangeSet( effectPacket, true );
@ -108,7 +108,7 @@ void Core::Action::ActionTeleport::onInterrupt()
m_pSource->getAsPlayer()->sendStateFlags();
auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt,
0x219, 0x04, m_id, 0 );
0x219, 0x04, m_id, 0 );
m_pSource->sendToInRangeSet( control, true );
}

View file

@ -22,7 +22,7 @@ Core::Action::EventItemAction::EventItemAction()
m_handleActionType = Common::HandleActionType::Event;
}
Core::Action::EventItemAction::EventItemAction( Entity::ActorPtr pActor, uint32_t eventId, uint32_t action,
Core::Action::EventItemAction::EventItemAction( Entity::ActorPtr pActor, uint32_t eventId, uint16_t action,
ActionCallback finishRef, ActionCallback interruptRef, uint64_t additional )
{
m_additional = additional;
@ -37,10 +37,7 @@ Core::Action::EventItemAction::EventItemAction( Entity::ActorPtr pActor, uint32_
m_bInterrupt = false;
}
Core::Action::EventItemAction::~EventItemAction()
{
}
Core::Action::EventItemAction::~EventItemAction() = default;
void Core::Action::EventItemAction::onStart()
{

View file

@ -13,7 +13,7 @@ namespace Core { namespace Action {
EventItemAction();
~EventItemAction();
EventItemAction( Entity::ActorPtr pActor, uint32_t eventId, uint32_t action,
EventItemAction( Entity::ActorPtr pActor, uint32_t eventId, uint16_t action,
ActionCallback finishRef, ActionCallback interruptRef, uint64_t additional );
void onStart() override;

View file

@ -59,13 +59,13 @@ std::string Core::Entity::Actor::getName() const
/*! \return true if the actor is of type player */
bool Core::Entity::Actor::isPlayer() const
{
return m_type == ActorType::Player;
return m_objKind == ObjKind::Player;
}
/*! \return true if the actor is of type mob */
bool Core::Entity::Actor::isMob() const
{
return m_type == ActorType::BattleNpc;
return m_objKind == ObjKind::BattleNpc;
}
/*! \return list of actors currently in range */
@ -210,7 +210,6 @@ void Core::Entity::Actor::setInvincibilityType( Common::InvincibilityType type )
m_invincibilityType = type;
}
/*! \return current status of the actor */
Core::Entity::Actor::ActorStatus Core::Entity::Actor::getStatus() const
{
@ -450,7 +449,7 @@ Core::Entity::ActorPtr Core::Entity::Actor::getClosestActor()
// arbitrary high number
float minDistance = 10000;
for( auto pCurAct : m_inRangeActors )
for( const auto& pCurAct : m_inRangeActors )
{
float distance = Math::Util::distance( getPos().x,
getPos().y,
@ -492,11 +491,11 @@ void Core::Entity::Actor::sendToInRangeSet( Network::Packets::GamePacketPtr pPac
if( m_inRangePlayers.empty() )
return;
for( auto pCurAct : m_inRangePlayers )
for( const auto &pCurAct : m_inRangePlayers )
{
assert( pCurAct );
pPacket->setValAt<uint32_t>( 0x04, m_id );
pPacket->setValAt<uint32_t>( 0x08, pCurAct->m_id );
pPacket->setValAt< uint32_t >( 0x04, m_id );
pPacket->setValAt< uint32_t >( 0x08, pCurAct->m_id );
// it might be that the player DC'd in which case the session would be invalid
pCurAct->queuePacket( pPacket );
}
@ -625,8 +624,8 @@ void Core::Entity::Actor::autoAttack( ActorPtr pTarget )
m_lastAttack = tick;
srand( static_cast< uint32_t >( tick ) );
uint32_t damage = 10 + rand() % 12;
uint32_t variation = 0 + rand() % 4;
uint16_t damage = static_cast< uint16_t >( 10 + rand() % 12 );
uint32_t variation = static_cast< uint32_t >( 0 + rand() % 4 );
ZoneChannelPacket< FFXIVIpcEffect > effectPacket( getId() );
effectPacket.data().targetId = pTarget->getId();
@ -657,7 +656,8 @@ ChaiScript Skill Handler.
\param GamePacketPtr to send
\param bool should be send to self?
*/
void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint32_t actionId, uint64_t param1, uint64_t param2, Entity::Actor& pTarget )
void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, uint64_t param1,
uint64_t param2, Entity::Actor& pTarget )
{
if ( isPlayer() )
@ -709,14 +709,16 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint32_t actionId, u
else
{
std::set< ActorPtr > actorsCollided = ActionCollision::getActorsHitFromAction( pTarget.getPos(), getInRangeActors( true ), actionInfoPtr, TargetFilter::Enemies );
auto actorsCollided = ActionCollision::getActorsHitFromAction( pTarget.getPos(), getInRangeActors( true ),
actionInfoPtr, TargetFilter::Enemies );
for ( auto pHitActor : actorsCollided )
for ( const auto& pHitActor : actorsCollided )
{
effectPacket.data().targetId = pHitActor->getId();
effectPacket.data().effectTarget = pHitActor->getId();
sendToInRangeSet( effectPacket, true ); // todo: send to range of what? ourselves? when mob script hits this is going to be lacking
// todo: send to range of what? ourselves? when mob script hits this is going to be lacking
sendToInRangeSet( effectPacket, true );
pHitActor->takeDamage( static_cast< uint32_t >( param1 ) );
@ -756,9 +758,11 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint32_t actionId, u
}
else
{
// todo: get proper packets: the following was just kind of thrown together from what we know. atm buggy (packets look "delayed" from client)
// todo: get proper packets: the following was just kind of thrown together from what we know.
// atm buggy (packets look "delayed" from client)
std::set< ActorPtr > actorsCollided = ActionCollision::getActorsHitFromAction( pTarget.getPos(), getInRangeActors( true ), actionInfoPtr, TargetFilter::Allies );
auto actorsCollided = ActionCollision::getActorsHitFromAction( pTarget.getPos(), getInRangeActors( true ),
actionInfoPtr, TargetFilter::Allies );
for ( auto pHitActor : actorsCollided )
{
@ -823,4 +827,14 @@ void Core::Entity::Actor::removeSingleStatusEffectFromId( uint32_t id )
Core::StatusEffect::StatusEffectContainerPtr Core::Entity::Actor::getStatusEffectContainer() const
{
return m_pStatusEffectContainer;
}
}
float Core::Entity::Actor::getRotation() const
{
return m_rot;
}
void Core::Entity::Actor::setRotation( float rot )
{
m_rot = rot;
}

View file

@ -20,21 +20,23 @@ namespace Entity {
class Actor : public boost::enable_shared_from_this< Actor >
{
public:
enum ActorType : uint8_t
enum ObjKind : uint8_t
{
None = 0x00,
Player = 0x01,
BattleNpc = 0x02,
EventNpc = 0x03,
unk1 = 0x04,
AetheryteNpc = 0x05,
ResourceNode = 0x06,
Treasure = 0x04,
Aetheryte = 0x05,
GatheringPoint = 0x06,
EventObj = 0x07,
Mount = 0x08,
Minion = 0x09,
Companion = 0x09,
Retainer = 0x0A,
unk2 = 0x0B,
Furniture = 0x0C,
Area = 0x0B,
Housing = 0x0C,
Cutscene = 0x0D,
CardStand = 0x0E,
};
enum Stance : uint8_t
@ -125,7 +127,7 @@ protected:
/*! Id of the actor */
uint32_t m_id;
/*! Type of the actor */
ActorType m_type;
ObjKind m_objKind;
/*! Ptr to the ZoneObj the actor belongs to */
ZonePtr m_pCurrentZone;
/*! Last tick time for the actor ( in ms ) */
@ -175,15 +177,9 @@ public:
void setPosition( const Common::FFXIVARR_POSITION3& pos );
void setPosition( float x, float y, float z );
void setRotation( float rot )
{
m_rot = rot;
}
void setRotation( float rot );
float getRotation() const
{
return m_rot;
}
float getRotation() const;
Common::FFXIVARR_POSITION3& getPos();
@ -247,7 +243,7 @@ public:
void setStatus( ActorStatus status );
void handleScriptSkill( uint32_t type, uint32_t actionId, uint64_t param1, uint64_t param2, Entity::Actor& target );
void handleScriptSkill( uint32_t type, uint16_t actionId, uint64_t param1, uint64_t param2, Entity::Actor& target );
virtual void autoAttack( ActorPtr pTarget );

View file

@ -29,7 +29,7 @@ uint32_t Core::Entity::BattleNpc::m_nextID = 1149241694;
Core::Entity::BattleNpc::BattleNpc()
{
m_id = 0;
m_type = ActorType::BattleNpc;
m_objKind = ObjKind::BattleNpc;
m_status = ActorStatus::Idle;
}
@ -38,8 +38,8 @@ Core::Entity::BattleNpc::~BattleNpc()
}
Core::Entity::BattleNpc::BattleNpc( uint32_t modelId, uint32_t nameid, const Common::FFXIVARR_POSITION3& spawnPos,
uint32_t sizeId, uint32_t type, uint32_t level, uint32_t behaviour,
Core::Entity::BattleNpc::BattleNpc( uint16_t modelId, uint16_t nameid, const Common::FFXIVARR_POSITION3& spawnPos,
uint16_t bnpcBaseId, uint32_t type, uint8_t level, uint8_t behaviour,
uint32_t mobType )
{
BattleNpc::m_nextID++;
@ -49,10 +49,10 @@ Core::Entity::BattleNpc::BattleNpc( uint32_t modelId, uint32_t nameid, const Com
m_pos = spawnPos;
m_posOrigin = spawnPos;
m_type = ActorType::BattleNpc;
m_objKind = ObjKind::BattleNpc;
m_mode = MODE_IDLE;
m_targetId = INVALID_GAME_OBJECT_ID;
m_targetId = static_cast< uint64_t >( INVALID_GAME_OBJECT_ID );
m_maxHp = 150;
m_maxMp = 100;
@ -66,14 +66,14 @@ Core::Entity::BattleNpc::BattleNpc( uint32_t modelId, uint32_t nameid, const Com
m_currentStance = Stance::Passive;
m_class = ClassJob::Gladiator;
m_level = level > 0 ? level : 70;
m_level = level > uint8_t{0} ? level : uint8_t{70};
m_modelId = modelId;
m_nameId = nameid;
m_behavior = behaviour;
m_bnpcBaseId = sizeId;
m_bnpcBaseId = bnpcBaseId;
m_status = ActorStatus::Idle;
@ -83,7 +83,7 @@ Core::Entity::BattleNpc::BattleNpc( uint32_t modelId, uint32_t nameid, const Com
m_invincibilityType = InvincibilityType::InvincibilityNone;
//m_type = static_cast< Common::ActorType >( type );
//m_type = static_cast< Common::ObjKind >( type );
}
@ -147,7 +147,7 @@ void Core::Entity::BattleNpc::spawn( Core::Entity::PlayerPtr pTarget )
spawnPacket.data().rotation = Math::Util::floatToUInt16Rot( getRotation() );
spawnPacket.data().type = static_cast< uint8_t >( m_type );
spawnPacket.data().type = static_cast< uint8_t >( m_objKind );
spawnPacket.data().state = static_cast< uint8_t >( m_status );
@ -189,7 +189,7 @@ uint8_t Core::Entity::BattleNpc::getbehavior() const
void Core::Entity::BattleNpc::hateListAdd( Core::Entity::ActorPtr pActor, int32_t hateAmount )
{
HateListEntry* hateEntry = new HateListEntry();
auto hateEntry = new HateListEntry();
hateEntry->m_hateAmount = hateAmount;
hateEntry->m_pActor = pActor;
@ -253,7 +253,7 @@ bool Core::Entity::BattleNpc::moveTo( Common::FFXIVARR_POSITION3& pos )
return true;
float rot = Math::Util::calcAngFrom( getPos().x, getPos().z, pos.x, pos.z );
float newRot = PI - rot + (PI / 2);
float newRot = PI - rot + ( PI / 2 );
face( pos );
float angle = Math::Util::calcAngFrom( getPos().x, getPos().z, pos.x, pos.z ) + PI;
@ -262,7 +262,7 @@ bool Core::Entity::BattleNpc::moveTo( Common::FFXIVARR_POSITION3& pos )
float y = ( getPos().y + pos.y ) * 0.5f; // fake value while there is no collision
float z = static_cast< float >( sinf( angle ) * 1.1f );
Common::FFXIVARR_POSITION3 newPos;
Common::FFXIVARR_POSITION3 newPos{};
newPos.x = getPos().x + x;
newPos.y = y;
@ -270,13 +270,11 @@ bool Core::Entity::BattleNpc::moveTo( Common::FFXIVARR_POSITION3& pos )
setPosition( newPos );
Common::FFXIVARR_POSITION3 tmpPos;
Common::FFXIVARR_POSITION3 tmpPos{};
tmpPos.x = getPos().x + x;
tmpPos.y = y;
tmpPos.z = getPos().z + z;
angle = angle * 2;
setPosition( tmpPos );
setRotation(newRot);
@ -384,7 +382,7 @@ void Core::Entity::BattleNpc::hateListUpdate( Core::Entity::ActorPtr pActor, int
}
}
HateListEntry* hateEntry = new HateListEntry();
auto hateEntry = new HateListEntry();
hateEntry->m_hateAmount = hateAmount;
hateEntry->m_pActor = pActor;
m_hateList.insert( hateEntry );
@ -427,7 +425,7 @@ void Core::Entity::BattleNpc::onDeath()
if( pHateEntry->m_pActor->isPlayer() ) // && pHateEntry->m_hateAmount >= plsBeHatedThisMuchAtLeast )
{
uint8_t level = pHateEntry->m_pActor->getLevel();
auto levelDiff = (int)this->m_level - (int)level;
auto levelDiff = static_cast< int32_t >( this->m_level ) - level;
auto cappedLevelDiff = Math::Util::clamp( levelDiff, 1, 6 );
auto expNeeded = g_exdData.m_paramGrowthInfoMap[m_level + cappedLevelDiff - 1].needed_exp;
@ -449,7 +447,7 @@ void Core::Entity::BattleNpc::onDeath()
// todo: this is actually retarded, we need real rand()
srand( static_cast< unsigned int> ( time( NULL ) ) );
srand( static_cast< uint32_t > ( time( nullptr ) ) );
auto pPlayer = pHateEntry->m_pActor->getAsPlayer();
pPlayer->gainExp( exp );
@ -517,7 +515,7 @@ void Core::Entity::BattleNpc::update( int64_t currTime )
{
ActorPtr pClosestActor = getClosestActor();
if( ( pClosestActor != nullptr ) && pClosestActor->isAlive() )
if( pClosestActor && pClosestActor->isAlive() )
{
distance = Math::Util::distance( getPos().x, getPos().y, getPos().z,
pClosestActor->getPos().x,
@ -543,9 +541,9 @@ void Core::Entity::BattleNpc::update( int64_t currTime )
if( pClosestActor != nullptr )
{
distance = Math::Util::distance( getPos().x, getPos().y, getPos().z,
pClosestActor->getPos().x,
pClosestActor->getPos().y,
pClosestActor->getPos().z );
pClosestActor->getPos().x,
pClosestActor->getPos().y,
pClosestActor->getPos().z );
if( distance > 4 )
moveTo( pClosestActor->getPos() );

View file

@ -27,7 +27,8 @@ public:
BattleNpc();
~BattleNpc();
BattleNpc( uint32_t modelId, uint32_t nameid, const Common::FFXIVARR_POSITION3& spawnPos, uint32_t sizeId = 0, uint32_t type = 2, uint32_t level = 0, uint32_t behaviour = 1, uint32_t mobType = 0 );
BattleNpc( uint16_t modelId, uint16_t nameid, const Common::FFXIVARR_POSITION3& spawnPos, uint16_t bnpcBaseId = 0,
uint32_t type = 2, uint8_t level = 0, uint8_t behaviour = 1, uint32_t mobType = 0 );
//BattleNpc( uint32_t modelId,
// uint32_t nameId,

View file

@ -76,7 +76,7 @@ Core::Entity::Player::Player() :
m_mount( 0 )
{
m_id = 0;
m_type = ActorType::Player;
m_objKind = ObjKind::Player;
m_currentStance = Stance::Passive;
m_onlineStatus = 0;
m_queuedZoneing = nullptr;
@ -895,9 +895,7 @@ Core::Entity::ActorPtr Core::Entity::Player::lookupTargetById( uint64_t targetId
for( auto actor : inRange )
{
if( actor->getId() == targetId )
{
targetActor = actor;
}
}
return targetActor;
}
@ -1185,6 +1183,11 @@ const uint8_t * Core::Entity::Player::getOrchestrionBitmask() const
return m_orchestrion;
}
const uint8_t * Core::Entity::Player::getMountGuideBitmask() const
{
return m_mountGuide;
}
uint64_t Core::Entity::Player::getContentId() const
{
return m_contentId;
@ -1209,26 +1212,27 @@ void Core::Entity::Player::queuePacket( Core::Network::Packets::GamePacketPtr pP
{
auto pSession = g_serverZone.getSession( m_id );
if( pSession )
{
auto pZoneCon = pSession->getZoneConnection();
if( !pSession )
return;
auto pZoneCon = pSession->getZoneConnection();
if( pZoneCon )
pZoneCon->queueOutPacket( pPacket );
if( pZoneCon )
pZoneCon->queueOutPacket( pPacket );
}
}
void Core::Entity::Player::queueChatPacket( Core::Network::Packets::GamePacketPtr pPacket )
{
auto pSession = g_serverZone.getSession( m_id );
if( pSession )
{
auto pChatCon = pSession->getChatConnection();
if( !pSession )
return;
if( pChatCon )
pChatCon->queueOutPacket( pPacket );
}
auto pChatCon = pSession->getChatConnection();
if( pChatCon )
pChatCon->queueOutPacket( pPacket );
}
bool Core::Entity::Player::isLoadingComplete() const
@ -1460,7 +1464,8 @@ void Core::Entity::Player::mount( uint32_t id )
void Core::Entity::Player::dismount()
{
sendToInRangeSet( ActorControlPacket142( getId(), ActorControlType::SetStatus, static_cast< uint8_t >( Entity::Actor::ActorStatus::Idle )), true );
sendToInRangeSet( ActorControlPacket142( getId(), ActorControlType::SetStatus,
static_cast< uint8_t >( Entity::Actor::ActorStatus::Idle )), true );
sendToInRangeSet( ActorControlPacket143( getId(), ActorControlType::Dismount, 1 ), true );
m_mount = 0;
}
@ -1473,7 +1478,8 @@ uint8_t Core::Entity::Player::getCurrentMount() const
void Core::Entity::Player::autoAttack( ActorPtr pTarget )
{
auto mainWeap = m_pInventory->getItemAt(Inventory::GearSet0, Inventory::EquipSlot::MainHand);
auto mainWeap = m_pInventory->getItemAt( Inventory::GearSet0,
Inventory::EquipSlot::MainHand );
pTarget->onActionHostile( shared_from_this() );
//uint64_t tick = Util::getTimeMs();
@ -1482,9 +1488,9 @@ void Core::Entity::Player::autoAttack( ActorPtr pTarget )
uint32_t damage = static_cast< uint32_t >( mainWeap->getAutoAttackDmg() );
uint32_t variation = 0 + rand() % 3;
if ( getClass() == ClassJob::Machinist||
getClass() == ClassJob::Bard ||
getClass() == ClassJob::Archer )
if( getClass() == ClassJob::Machinist ||
getClass() == ClassJob::Bard ||
getClass() == ClassJob::Archer )
{
ZoneChannelPacket< FFXIVIpcEffect > effectPacket(getId());
effectPacket.data().targetId = pTarget->getId();
@ -1510,7 +1516,7 @@ void Core::Entity::Player::autoAttack( ActorPtr pTarget )
ZoneChannelPacket< FFXIVIpcEffect > effectPacket(getId());
effectPacket.data().targetId = pTarget->getId();
effectPacket.data().actionAnimationId = 7;
// effectPacket.data().unknown_2 = variation;
// effectPacket.data().unknown_2 = variation;
effectPacket.data().numEffects = 1;
effectPacket.data().unknown_61 = 1;
effectPacket.data().unknown_62 = 1;
@ -1549,7 +1555,7 @@ uint32_t Core::Entity::Player::getCFPenaltyMinutes() const
auto endTimestamp = getCFPenaltyTimestamp();
// check if penalty timestamp already passed current time
if (currentTimestamp > endTimestamp)
if( currentTimestamp > endTimestamp )
return 0;
auto deltaTime = endTimestamp - currentTimestamp;
@ -1559,7 +1565,7 @@ uint32_t Core::Entity::Player::getCFPenaltyMinutes() const
void Core::Entity::Player::setCFPenaltyMinutes( uint32_t minutes )
{
auto currentTimestamp = Core::Util::getTimeSeconds();
setCFPenaltyTimestamp(static_cast< uint32_t >( currentTimestamp + minutes * 60 ));
setCFPenaltyTimestamp( static_cast< uint32_t >( currentTimestamp + minutes * 60 ) );
}
uint8_t Core::Entity::Player::getOpeningSequence() const

View file

@ -215,7 +215,7 @@ public:
/*! get the current system hand model */
uint64_t getModelSystemWeapon() const;
/*! return a const pointer to the model array */
const uint32_t * getModelArray() const;
const uint32_t* getModelArray() const;
/*! return the equipment model in a specified equipment slot */
uint32_t getModelForSlot( Inventory::EquipSlot slot );
/*! set the equipment model in a specified equipment slot */
@ -254,13 +254,13 @@ public:
/*! change class or job to given class / job */
void setClassJob( Core::Common::ClassJob classJob );
/*! returns a pointer to the class array */
uint16_t * getClassArray();
uint16_t* getClassArray();
/*! returns a const pointer to the class array */
const uint16_t * getClassArray() const;
const uint16_t* getClassArray() const;
/*! returns a pointer to the exp array */
uint32_t * getExpArray();
uint32_t* getExpArray();
/*! returns a const pointer to the exp array */
const uint32_t * getExpArray() const;
const uint32_t* getExpArray() const;
// Base Look / Stats / Params
//////////////////////////////////////////////////////////////////////////////////////////////////////
@ -283,7 +283,7 @@ public:
/*! return the grand company */
uint8_t getGc() const;
/*! return the grand company rank */
const uint8_t * getGcRankArray() const;
const uint8_t* getGcRankArray() const;
/*! set look at index */
void setLookAt( uint8_t index, uint8_t value );
/*! set the voice Id */
@ -293,7 +293,7 @@ public:
/*! set the grand company rank */
void setGcRankAt( uint8_t index, uint8_t rank );
/*! return a const pointer to the look array */
const uint8_t * getLookArray() const;
const uint8_t* getLookArray() const;
/*! returns true if the player is currently in combat */
bool isInCombat() const;
/*! sets players combat state */
@ -329,7 +329,7 @@ public:
/*! prepares zoning / fades out the screen */
void prepareZoning( uint16_t targetZone, bool fadeOut, uint8_t fadoutTime = 0, uint16_t animation = 0 );
/*! get player's title list (available titles) */
uint8_t * getTitleList();
uint8_t* getTitleList();
/*! get player's active title */
uint16_t getTitle() const;
/*! add title to player title list */
@ -360,7 +360,7 @@ public:
/*! return a const pointer to the aetheryte unlock bitmask array */
int8_t getAetheryteMaskAt( uint8_t index ) const;
/*! return a pointer to the aetheryte unlock bitmask array */
uint8_t * getAetheryteArray();
uint8_t* getAetheryteArray();
/*! set homepoint */
void setHomepoint( uint8_t aetheryteId );
/*! get homepoint */
@ -368,13 +368,13 @@ public:
/*! discover subarea subid fo map map_id, also send udpate packet */
void discover( int16_t map_id, int16_t sub_id );
/*! return a pointer to the discovery bitmask array */
uint8_t * getDiscoveryBitmask();
uint8_t* getDiscoveryBitmask();
/*! helper/debug function to reset all discovered areas */
void resetDiscovery();
/*! get a pointer to the howto bitmask array */
uint8_t * getHowToArray();
uint8_t* getHowToArray();
/*! get a const pointer to the howto bitmask array */
const uint8_t * getHowToArray() const;
const uint8_t* getHowToArray() const;
/*! update bitmask for how-to's seen */
void updateHowtosSeen( uint32_t howToId );
/*! learn an action / update the unlock bitmask. */
@ -384,9 +384,11 @@ public:
/*! check if an action is already unlocked in the bitmask. */
bool isActionLearned( uint8_t actionId ) const;
/*! return a const pointer to the unlock bitmask array */
const uint8_t * getUnlockBitmask() const;
const uint8_t* getUnlockBitmask() const;
/*! return a const pointer to the orchestrion bitmask array */
const uint8_t * getOrchestrionBitmask() const;
const uint8_t* getOrchestrionBitmask() const;
/*! return a const pointer to the mount guide bitmask array */
const uint8_t* getMountGuideBitmask() const;
// Spawn handling
@ -522,7 +524,6 @@ public:
void setEorzeaTimeOffset( uint64_t timestamp );
// Database
void updateDbAllQuests() const;
void deleteQuest( uint16_t questId ) const;
@ -575,7 +576,7 @@ private:
uint8_t m_titleList[48];
uint8_t m_howTo[33];
uint8_t m_minions[33];
uint8_t m_mounts[13];
uint8_t m_mountGuide[13];
uint8_t m_homePoint;
uint8_t m_startTown;
uint16_t m_townWarpFstFlags;

View file

@ -69,9 +69,9 @@ void Core::Entity::Player::removeEvent( uint32_t eventId )
void Core::Entity::Player::checkEvent( uint32_t eventId )
{
auto pEvent = getEvent( eventId );
if( pEvent )
if( !pEvent->hasPlayedScene() )
eventFinish( eventId, 1 );
if( pEvent && !pEvent->hasPlayedScene() )
eventFinish( eventId, 1 );
}
@ -282,7 +282,8 @@ void Core::Entity::Player::eventItemActionStart( uint32_t eventId,
void Core::Entity::Player::onLogin()
{
for( auto& child : g_serverZone.getConfig()->getChild( "Settings.Parameters.MotDArray" ) ) {
for( auto& child : g_serverZone.getConfig()->getChild( "Settings.Parameters.MotDArray" ) )
{
sendNotice( child.second.data() );
}
}

View file

@ -195,9 +195,7 @@ bool Core::Entity::Player::tryAddItem( uint16_t catalogId, uint32_t quantity )
for( uint16_t i = 0; i < 4; i++ )
{
if( m_pInventory->addItem( i, -1, catalogId, quantity ) != -1 )
{
return true;
}
}
return false;
}

View file

@ -45,7 +45,7 @@ void Core::Entity::Player::removeQuest( uint16_t questId )
{
ZoneChannelPacket< FFXIVIpcQuestUpdate > questUpdatePacket( getId() );
questUpdatePacket.data().slot = idx;
questUpdatePacket.data().slot = static_cast< uint8_t >( idx );
questUpdatePacket.data().questInfo.c.questId = 0;
questUpdatePacket.data().questInfo.c.sequence = 0xFF;
queuePacket( questUpdatePacket );
@ -62,7 +62,7 @@ void Core::Entity::Player::removeQuest( uint16_t questId )
m_questTracking[ii] = -1;
}
boost::shared_ptr<QuestActive> pQuest = m_activeQuests[idx];
boost::shared_ptr< QuestActive > pQuest = m_activeQuests[idx];
m_activeQuests[idx].reset();
m_questIdToQuestIdx.erase( questId );
@ -1023,6 +1023,7 @@ bool Core::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t optional
auto paramGrowth = g_exdData.m_paramGrowthInfoMap[questInfo->quest_level];
// TODO: use the correct formula, this one is wrong
uint32_t exp = ( questInfo->reward_exp_factor * paramGrowth.quest_exp_mod * ( 45 + 5 * questInfo->quest_level) ) / 100;
exp = exp + ( questInfo->reward_exp_factor / 100 ) * 10000;

View file

@ -152,6 +152,12 @@ bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession )
auto titleList = res->getBlobVector( "TitleList" );
memcpy( reinterpret_cast< char* >( m_titleList ), titleList.data(), titleList.size() );
auto mountGuide = res->getBlobVector( "Mounts" );
memcpy( reinterpret_cast< char* >( m_mountGuide ), mountGuide.data(), mountGuide.size() );
auto orchestrion = res->getBlobVector( "Orchestrion" );
memcpy( reinterpret_cast< char* >( m_orchestrion ), orchestrion.data(), orchestrion.size() );
auto gcRank = res->getBlobVector( "GrandCompanyRank" );
memcpy( reinterpret_cast< char* >( m_gcRank ), gcRank.data(), gcRank.size() );
@ -296,10 +302,10 @@ void Core::Entity::Player::updateSql()
"TerritoryType 18, TerritoryId 19, PosX 20, PosY 21, PosZ 22, PosR 23, "
"OTerritoryType 24, OTerritoryId 25, OPosX 26, OPosY 27, OPosZ 28, OPosR 29, "
"Class 30, Status 31, TotalPlayTime 32, HomePoint 33, FavoritePoint 34, RestPoint 35, "
"ActiveTitle 36, TitleList 37, Achievement 38, Aetheryte 39, HowTo 40, Minions 41, Mounts 42, "
"EquippedMannequin 43, ConfigFlags 44, QuestCompleteFlags 45, OpeningSequence 46, "
"QuestTracking 47, GrandCompany 48, GrandCompanyRank 49, Discovery 50, GMRank 51, Unlocks 52, "
"CFPenaltyUntil 53"*/
"ActiveTitle 36, TitleList 37, Achievement 38, Aetheryte 39, HowTo 40, Minions 41, Mounts 42, Orchestrion 43, "
"EquippedMannequin 44, ConfigFlags 45, QuestCompleteFlags 46, OpeningSequence 47, "
"QuestTracking 48, GrandCompany 49, GrandCompanyRank 50, Discovery 51, GMRank 52, Unlocks 53, "
"CFPenaltyUntil 54"*/
auto stmt = g_charaDb.getPreparedStatement( Core::Db::CharaDbStatements::CHARA_UP );
stmt->setInt( 1, getHp() );
@ -370,40 +376,44 @@ void Core::Entity::Player::updateSql()
memcpy( minionsVec.data(), m_minions, sizeof( m_minions ) );
stmt->setBinary( 41, minionsVec );
std::vector< uint8_t > mountsVec( sizeof( m_mounts ) );
memcpy( mountsVec.data(), m_mounts, sizeof( m_mounts ) );
std::vector< uint8_t > mountsVec( sizeof( m_mountGuide ) );
memcpy( mountsVec.data(), m_mountGuide, sizeof( m_mountGuide ) );
stmt->setBinary( 42, mountsVec );
stmt->setInt( 43, 0 ); // EquippedMannequin
std::vector< uint8_t > orchestrionVec( sizeof( m_orchestrion ) );
memcpy( orchestrionVec.data(), m_orchestrion, sizeof( m_orchestrion ) );
stmt->setBinary( 42, mountsVec );
stmt->setInt( 44, 0 ); // DisplayFlags
stmt->setInt( 44, 0 ); // EquippedMannequin
stmt->setInt( 45, 0 ); // DisplayFlags
std::vector< uint8_t > questCompleteVec( sizeof( m_questCompleteFlags ) );
memcpy( questCompleteVec.data(), m_questCompleteFlags, sizeof( m_questCompleteFlags ) );
stmt->setBinary( 45, questCompleteVec );
stmt->setBinary( 46, questCompleteVec );
stmt->setInt( 46, m_openingSequence );
stmt->setInt( 47, m_openingSequence );
std::vector< uint8_t > questTrackerVec( sizeof( m_questTracking ) );
memcpy( questTrackerVec.data(), m_questTracking, sizeof( m_questTracking ) );
stmt->setBinary( 47, questTrackerVec );
stmt->setBinary( 48, questTrackerVec );
stmt->setInt( 48, m_gc ); // DisplayFlags
stmt->setInt( 49, m_gc ); // DisplayFlags
stmt->setBinary( 49, { m_gcRank[0], m_gcRank[1], m_gcRank[2] } );
stmt->setBinary( 50, { m_gcRank[0], m_gcRank[1], m_gcRank[2] } );
std::vector< uint8_t > discoveryVec( sizeof( m_discovery ) );
memcpy( discoveryVec.data(), m_discovery, sizeof( m_discovery ) );
stmt->setBinary( 50, discoveryVec );
stmt->setBinary( 51, discoveryVec );
stmt->setInt( 51, m_gmRank );
stmt->setInt( 52, m_gmRank );
std::vector< uint8_t > unlockVec( sizeof( m_unlocks ) );
memcpy( unlockVec.data(), m_unlocks, sizeof( m_unlocks ) );
stmt->setBinary( 52, unlockVec );
stmt->setBinary( 53, unlockVec );
stmt->setInt( 53, m_cfPenaltyUntil );
stmt->setInt( 54, m_cfPenaltyUntil );
stmt->setInt( 54, m_id );
stmt->setInt( 55, m_id );
g_charaDb.execute( stmt );
@ -416,8 +426,6 @@ void Core::Entity::Player::updateSql()
////// Class
updateDbClass();
memset( m_orchestrion, 0, sizeof( m_orchestrion ) );
}
void Core::Entity::Player::updateDbClass() const

View file

@ -12,47 +12,45 @@ std::string Core::Event::getEventName( uint32_t eventId )
{
uint16_t eventType = eventId >> 16;
auto unknown = std::string{ "unknown" };
switch( eventType )
{
case EventType::Quest:
{
auto questInfo = g_exdData.getQuestInfo( eventId );
if( questInfo )
{
std::string name = questInfo->name_intern;
std::size_t pos = name.find_first_of( "_" );
if( !questInfo )
return unknown + "Quest";
return questInfo->name_intern.substr( 0, pos );
}
std::string name = questInfo->name_intern;
std::size_t pos = name.find_first_of( "_" );
return questInfo->name_intern.substr( 0, pos );
}
break;
case EventType::CustomTalk:
{
auto customTalkInfo = g_exdData.getCustomTalkInfo( eventId );
if( customTalkInfo )
{
std::string name = customTalkInfo->name_intern;
std::size_t pos = name.find_first_of( "_" );
if( !customTalkInfo )
return unknown + "CustomTalk";
return customTalkInfo->name_intern.substr( 0, pos );
}
std::string name = customTalkInfo->name_intern;
std::size_t pos = name.find_first_of( "_" );
return customTalkInfo->name_intern.substr( 0, pos );
}
break;
case EventType::Opening:
{
auto openingInfo = g_exdData.getOpeningInfo( eventId );
if( openingInfo )
return openingInfo->name;
return unknown + "Opening";
}
break;
case EventType::Aetheryte:
{
auto aetherInfo = g_exdData.getAetheryteInfo( eventId & 0xFFFF );
if( aetherInfo->isAetheryte )
return "Aetheryte";
return "Aethernet";
}
case EventType::ChocoPort:
{
@ -60,11 +58,9 @@ std::string Core::Event::getEventName( uint32_t eventId )
}
default:
{
return "";
return unknown;
}
}
return "";
}
uint32_t Core::Event::mapEventActorToRealActor( uint32_t eventActorId )

View file

@ -93,16 +93,15 @@ Core::Network::GameConnection::GameConnection( Core::Network::HivePtr pHive,
setZoneHandler( ClientZoneIpcType::CFRegisterRoulette, "CFRegisterRoulette", &GameConnection::cfRegisterRoulette );
setZoneHandler( ClientZoneIpcType::CFCommenceHandler, "CFDutyAccepted", &GameConnection::cfDutyAccepted);
setZoneHandler( ClientZoneIpcType::ReqEquipDisplayFlagsChange, "ReqEquipDisplayFlagsChange",&GameConnection::reqEquipDisplayFlagsHandler);
setZoneHandler( ClientZoneIpcType::ReqEquipDisplayFlagsChange, "ReqEquipDisplayFlagsChange", &GameConnection::reqEquipDisplayFlagsHandler );
setZoneHandler( ClientZoneIpcType::PerformNoteHandler, "PerformNoteHandler", &GameConnection::performNoteHandler );
setChatHandler( ClientChatIpcType::TellReq, "TellReq", &GameConnection::tellHandler);
}
Core::Network::GameConnection::~GameConnection()
{
}
Core::Network::GameConnection::~GameConnection() = default;
// overwrite the parents onConnect for our game socket needs
@ -125,39 +124,40 @@ void Core::Network::GameConnection::OnRecv( std::vector< uint8_t > & buffer )
{
// This is assumed packet always start with valid FFXIVARR_PACKET_HEADER for now.
Packets::FFXIVARR_PACKET_HEADER packetHeader;
const auto headerResult = Packets::getHeader(buffer, 0, packetHeader);
Packets::FFXIVARR_PACKET_HEADER packetHeader{};
const auto headerResult = Packets::getHeader( buffer, 0, packetHeader );
if (headerResult == Incomplete)
if( headerResult == Incomplete )
{
g_log.info("Dropping connection due to incomplete packet header.");
g_log.info("FIXME: Packet message bounary is not implemented.");
g_log.info( "Dropping connection due to incomplete packet header." );
g_log.info( "FIXME: Packet message bounary is not implemented." );
Disconnect();
return;
}
if (headerResult == Malformed)
if( headerResult == Malformed )
{
g_log.info("Dropping connection due to malformed packet header.");
g_log.info( "Dropping connection due to malformed packet header." );
Disconnect();
return;
}
// Dissect packet list
std::vector< Packets::FFXIVARR_PACKET_RAW > packetList;
const auto packetResult = Packets::getPackets(buffer, sizeof(struct FFXIVARR_PACKET_HEADER), packetHeader, packetList);
const auto packetResult = Packets::getPackets( buffer, sizeof( struct FFXIVARR_PACKET_HEADER ),
packetHeader, packetList );
if (packetResult == Incomplete)
if( packetResult == Incomplete )
{
g_log.info("Dropping connection due to incomplete packets.");
g_log.info("FIXME: Packet message bounary is not implemented.");
g_log.info( "Dropping connection due to incomplete packets." );
g_log.info( "FIXME: Packet message bounary is not implemented." );
Disconnect();
return;
}
if (packetResult == Malformed)
{
g_log.info("Dropping connection due to malformed packets.");
g_log.info( "Dropping connection due to malformed packets." );
Disconnect();
return;
}
@ -256,7 +256,7 @@ void Core::Network::GameConnection::handlePacket( Core::Network::Packets::GamePa
}
void Core::Network::GameConnection::sendPackets( Packets::PacketContainer * pPacket )
void Core::Network::GameConnection::sendPackets( Packets::PacketContainer* pPacket )
{
//g_log.Log(LoggingSeverity::info, pPacket->toString());
std::vector< uint8_t > sendBuffer;
@ -270,7 +270,7 @@ void Core::Network::GameConnection::processInQueue()
// handle the incoming game packets
while( auto pPacket = m_inQueue.pop() )
{
handlePacket(pPacket);
handlePacket( pPacket );
}
}
@ -303,7 +303,7 @@ void Core::Network::GameConnection::processOutQueue()
}
void Core::Network::GameConnection::sendSinglePacket( Packets::GamePacket * pPacket )
void Core::Network::GameConnection::sendSinglePacket( Packets::GamePacket* pPacket )
{
PacketContainer pRP = PacketContainer();
pRP.addPacket( *pPacket );
@ -337,7 +337,7 @@ void Core::Network::GameConnection::injectPacket( const std::string& packetpath,
fclose( fp );
// cycle through the packet entries and queue each one
for( int32_t k = 0x18; k < size;)
for( int32_t k = 0x18; k < size; )
{
uint32_t tmpId = pPlayer->getId();
// replace ids in the entryheader if needed
@ -360,7 +360,7 @@ void Core::Network::GameConnection::injectPacket( const std::string& packetpath,
}
void Core::Network::GameConnection::handlePackets( const Core::Network::Packets::FFXIVARR_PACKET_HEADER& ipcHeader,
const std::vector<Core::Network::Packets::FFXIVARR_PACKET_RAW>& packetData )
const std::vector< Core::Network::Packets::FFXIVARR_PACKET_RAW >& packetData )
{
// if a session is set, update the last time it recieved a game packet
if( m_pSession )
@ -368,8 +368,6 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
for( auto inPacket : packetData )
{
switch( inPacket.segHdr.type )
{
case 1:
@ -392,7 +390,8 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
}
session = g_serverZone.getSession( playerId );
}
else if( !session->isValid() || ( session->getPlayer() && session->getPlayer()->getLastPing() != 0 ) ) //TODO: Catch more things in lobby and send real errors
//TODO: Catch more things in lobby and send real errors
else if( !session->isValid() || ( session->getPlayer() && session->getPlayer()->getLastPing() != 0 ) )
{
g_log.error( "[" + std::string(id) + "] Session INVALID, disconnecting" );
Disconnect();
@ -458,58 +457,5 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
}
}
//// try to retrieve the session for this id
//auto session = g_serverZone.getSession( inPacket.segHdr.source_actor );
//auto pCon = boost::static_pointer_cast< GameConnection, Connection >( shared_from_this() );
//// check if this is a zoning notification
//if( *reinterpret_cast< uint16_t* >( &inPacket.data[2] ) == 0x9999 )
//{
// // if we already have a session in this connection, reload the player
// if( session )
// g_serverZone.updateSession( inPacket.segHdr.source_actor );
// else
// {
// // if not, create a new session
// g_serverZone.createSession( inPacket.segHdr.source_actor );
// session = g_serverZone.getSession( inPacket.segHdr.source_actor );
// }
// // set the zoneingType for the player so the correct animation can be played
// auto pPlayer = session->getPlayer();
// ZoneingType zoneType = static_cast< ZoneingType >( *reinterpret_cast< uint16_t* >( &inPacket.data[18] ) );
// switch( zoneType )
// {
// case ZoneingType::Teleport:
// pPlayer->setTeleporting( true );
// break;
// case ZoneingType::Return:
// pPlayer->setReturning( true );
// break;
// default:
// break;
// }
// // place this connection in the session
// session->setZoneConnection( pCon );
// // actually perform the zoning
// session->getPlayer()->setZone( *reinterpret_cast< uint16_t* >( &inPacket.data[16] ) );
//}
//else
//{
// if( !session )
// {
// g_serverZone.createSession( inPacket.segHdr.source_actor );
// session = g_serverZone.getSession( inPacket.segHdr.source_actor );
// session->setZoneConnection( pCon );
// }
// queueInPacket( GamePacketPtr( new GamePacket( inPacket ) ) );
//}
//// if not set, set the session for this connection
//if( !m_pSession && session )
// m_pSession = session;
}
}

View file

@ -66,7 +66,7 @@ public:
void OnError( const boost::system::error_code & error ) override;
void handlePackets( const Packets::FFXIVARR_PACKET_HEADER& ipcHeader,
const std::vector<Packets::FFXIVARR_PACKET_RAW>& packetData );
const std::vector< Packets::FFXIVARR_PACKET_RAW >& packetData );
void queueInPacket( Packets::GamePacketPtr inPacket );
void queueOutPacket( Packets::GamePacketPtr outPacket );
@ -119,6 +119,8 @@ public:
DECLARE_HANDLER( reqEquipDisplayFlagsHandler );
DECLARE_HANDLER( performNoteHandler );
DECLARE_HANDLER( tellHandler );
};

View file

@ -52,7 +52,7 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in
uint64_t param1 = inPacket.getValAt< uint64_t >( 0x24 );
uint32_t param11 = inPacket.getValAt< uint32_t >( 0x24 );
uint32_t param12 = inPacket.getValAt< uint32_t >( 0x28 );
uint32_t param2 = inPacket.getValAt< uint32_t >( 0x2c );
uint32_t param2 = inPacket.getValAt< uint32_t >( 0x2C );
uint64_t param3 = inPacket.getValAt< uint64_t >( 0x38 );
g_log.debug( "[" + std::to_string( m_pSession->getId() ) + "] Incoming action: " +
@ -115,7 +115,7 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in
}
case 0x69: // Cancel cast
{
if( pPlayer->getCurrentAction() != nullptr )
if( pPlayer->getCurrentAction() )
pPlayer->getCurrentAction()->setInterrupted();
break;
}
@ -190,8 +190,6 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in
break;
case ZoneingType::FadeIn:
break;
default:
break;
}
pPlayer->setZoningType( Common::ZoneingType::None );
@ -216,7 +214,7 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in
pow( fromAetheryte->map_coord_y - targetAetheryte->map_coord_y, 2 ) ) / 2 ) + 100 );
// cap at 999 gil
cost = cost > 999 ? 999 : cost;
cost = cost > uint16_t{999} ? uint16_t{999} : cost;
bool insufficientGil = pPlayer->getCurrency( Inventory::CurrencyType::Gil ) < cost;
// todo: figure out what param1 really does

View file

@ -39,59 +39,59 @@ using namespace Core::Network::Packets::Server;
void Core::Network::GameConnection::inventoryModifyHandler( const Packets::GamePacket& inPacket,
Entity::PlayerPtr pPlayer )
{
uint32_t seq = inPacket.getValAt< uint32_t >( 0x20 );
uint8_t action = inPacket.getValAt< uint8_t >( 0x24 );
uint8_t fromSlot = inPacket.getValAt< uint8_t >( 0x30 );
uint8_t toSlot = inPacket.getValAt< uint8_t >( 0x44 );
uint16_t fromContainer = inPacket.getValAt< uint16_t >( 0x2C );
uint16_t toContainer = inPacket.getValAt< uint16_t >( 0x40 );
uint32_t seq = inPacket.getValAt< uint32_t >( 0x20 );
uint8_t action = inPacket.getValAt< uint8_t >( 0x24 );
uint8_t fromSlot = inPacket.getValAt< uint8_t >( 0x30 );
uint8_t toSlot = inPacket.getValAt< uint8_t >( 0x44 );
uint16_t fromContainer = inPacket.getValAt< uint16_t >( 0x2C );
uint16_t toContainer = inPacket.getValAt< uint16_t >( 0x40 );
ZoneChannelPacket< FFXIVIpcInventoryActionAck > ackPacket( pPlayer->getId() );
ackPacket.data().sequence = seq;
ackPacket.data().type = 7;
pPlayer->queuePacket( ackPacket );
ZoneChannelPacket< FFXIVIpcInventoryActionAck > ackPacket( pPlayer->getId() );
ackPacket.data().sequence = seq;
ackPacket.data().type = 7;
pPlayer->queuePacket( ackPacket );
g_log.debug( inPacket.toString() );
g_log.debug( "InventoryAction: " + std::to_string( action ) );
g_log.debug( inPacket.toString() );
g_log.debug( "InventoryAction: " + std::to_string( action ) );
// TODO: other inventory operations need to be implemented
switch( action )
{
// TODO: other inventory operations need to be implemented
switch( action )
{
case 0x07: // discard item action
{
pPlayer->getInventory()->discardItem( fromContainer, fromSlot );
}
break;
case 0x07: // discard item action
{
pPlayer->getInventory()->discardItem( fromContainer, fromSlot );
}
break;
case 0x08: // move item action
{
pPlayer->getInventory()->moveItem( fromContainer, fromSlot, toContainer, toSlot );
}
break;
case 0x08: // move item action
{
pPlayer->getInventory()->moveItem( fromContainer, fromSlot, toContainer, toSlot );
}
break;
case 0x09: // swap item action
{
pPlayer->getInventory()->swapItem( fromContainer, fromSlot, toContainer, toSlot );
}
break;
case 0x09: // swap item action
{
pPlayer->getInventory()->swapItem( fromContainer, fromSlot, toContainer, toSlot );
}
break;
case 0x0C: // merge stack action
{
case 0x0C: // merge stack action
{
}
break;
}
break;
case 0x0A: // split stack action
{
case 0x0A: // split stack action
{
}
break;
}
break;
default:
default:
break;
break;
}
}
}

View file

@ -286,6 +286,7 @@ void Core::Network::GameConnection::updatePositionHandler( const Packets::GamePa
void Core::Network::GameConnection::reqEquipDisplayFlagsHandler( const Packets::GamePacket& inPacket,
Entity::PlayerPtr pPlayer )
{
g_log.info( "[" + std::to_string( pPlayer->getId() ) + "] Setting EquipDisplayFlags to " + std::to_string( inPacket.getValAt< uint8_t >( 0x20 ) ) );
pPlayer->setEquipDisplayFlags( inPacket.getValAt< uint8_t >( 0x20 ) );
}
@ -300,7 +301,7 @@ void Core::Network::GameConnection::zoneLineHandler( const Packets::GamePacket&
auto pLine = g_zoneMgr.getZonePosition( zoneLineId );
Common::FFXIVARR_POSITION3 targetPos;
Common::FFXIVARR_POSITION3 targetPos{};
uint32_t targetZone;
float rotation = 0.0f;
@ -482,6 +483,12 @@ void Core::Network::GameConnection::socialListHandler( const Packets::GamePacket
}
void Core::Network::GameConnection::socialReqSendHandler(const Packets::GamePacket& inPacket,
Entity::PlayerPtr pPlayer)
{
g_log.debug("send");
}
void Core::Network::GameConnection::chatHandler( const Packets::GamePacket& inPacket,
Entity::PlayerPtr pPlayer )
{
@ -554,7 +561,7 @@ void Core::Network::GameConnection::tellHandler( const Packets::GamePacket& inPa
if( !pSession )
{
GamePacketNew< FFXIVIpcTellErrNotFound, ServerChatIpcType > tellErrPacket( pPlayer->getId() );
ChatChannelPacket< FFXIVIpcTellErrNotFound > tellErrPacket( pPlayer->getId() );
strcpy( tellErrPacket.data().receipientName, targetPcName.c_str() );
sendSinglePacket( tellErrPacket );
@ -587,7 +594,7 @@ void Core::Network::GameConnection::tellHandler( const Packets::GamePacket& inPa
return;
}
GamePacketNew< FFXIVIpcTell, ServerChatIpcType > tellPacket( pPlayer->getId() );
ChatChannelPacket< FFXIVIpcTell > tellPacket( pPlayer->getId() );
strcpy( tellPacket.data().msg, msg.c_str() );
strcpy( tellPacket.data().receipientName, pPlayer->getName().c_str() );
// TODO: do these have a meaning?
@ -597,3 +604,14 @@ void Core::Network::GameConnection::tellHandler( const Packets::GamePacket& inPa
pTargetPlayer->queueChatPacket( tellPacket );
}
void Core::Network::GameConnection::performNoteHandler( const Packets::GamePacket& inPacket,
Entity::PlayerPtr pPlayer )
{
GamePacketNew< FFXIVIpcPerformNote, ServerZoneIpcType > performPacket( pPlayer->getId() );
uint8_t inVal = inPacket.getValAt< uint8_t >( 0x20 );
memcpy( &performPacket.data().data[0], &inVal, 32 );
pPlayer->sendToInRangeSet( performPacket );
}

View file

@ -64,8 +64,7 @@ private:
memcpy( m_data.orchestrionMask, player->getOrchestrionBitmask(), sizeof( m_data.orchestrionMask ) );
memset( m_data.mountGuideMask, 0xFF, sizeof( m_data.mountGuideMask) );
memset( m_data.fishingGuideMask, 0xFF, sizeof( m_data.fishingGuideMask ) );
memcpy( m_data.mountGuideMask, player->getMountGuideBitmask(), sizeof( m_data.mountGuideMask) );
memcpy( m_data.unlockBitmask, player->getUnlockBitmask(), sizeof( m_data.unlockBitmask ) );

View file

@ -23,7 +23,6 @@
extern Core::Logger g_log;
extern Core::Data::ExdData g_exdData;
extern Core::ServerZone g_serverZone;
extern Core::Scripting::ScriptManager g_scriptManager;
Core::Scripting::ScriptManager::ScriptManager()
{
@ -38,6 +37,8 @@ Core::Scripting::ScriptManager::~ScriptManager()
void Core::Scripting::ScriptManager::loadDir( std::string dirname, std::set<std::string>& chaiFiles )
{
g_log.info( "ScriptEngine: loading scripts from " + dirname );
boost::filesystem::path targetDir( dirname );
boost::filesystem::recursive_directory_iterator iter( targetDir ), eod;
@ -67,7 +68,8 @@ void Core::Scripting::ScriptManager::onPlayerFirstEnterWorld( Core::Entity::Play
}
}
bool Core::Scripting::ScriptManager::registerBnpcTemplate( std::string templateName, uint32_t bnpcBaseId, uint32_t bnpcNameId, uint32_t modelId, std::string aiName )
bool Core::Scripting::ScriptManager::registerBnpcTemplate( std::string templateName, uint32_t bnpcBaseId,
uint32_t bnpcNameId, uint32_t modelId, std::string aiName )
{
return g_serverZone.registerBnpcTemplate( templateName, bnpcBaseId, bnpcNameId, modelId, aiName );
}
@ -79,7 +81,7 @@ void Core::Scripting::ScriptManager::reload()
init();
}
const boost::shared_ptr<chaiscript::ChaiScript>& Core::Scripting::ScriptManager::getHandler() const
const boost::shared_ptr< chaiscript::ChaiScript >& Core::Scripting::ScriptManager::getHandler() const
{
return m_pChaiHandler;
}
@ -90,12 +92,13 @@ bool Core::Scripting::ScriptManager::onTalk( Core::Entity::PlayerPtr pPlayer, ui
std::string eventName = "onTalk";
std::string objName = Event::getEventName( eventId );
pPlayer->sendDebug("Actor: " +
std::to_string( actorId ) + " -> " + std::to_string( Core::Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) ) ) +
" \neventId: " +
std::to_string( eventId ) +
" (0x" + boost::str( boost::format( "%|08X|" )
% static_cast< uint64_t >( eventId & 0xFFFFFFF ) ) + ")" );
pPlayer->sendDebug( "Actor: " +
std::to_string( actorId ) + " -> " +
std::to_string( Core::Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) ) ) +
" \neventId: " +
std::to_string( eventId ) +
" (0x" + boost::str( boost::format( "%|08X|" )
% static_cast< uint64_t >( eventId & 0xFFFFFFF ) ) + ")" );
uint16_t eventType = eventId >> 16;
@ -107,7 +110,8 @@ bool Core::Scripting::ScriptManager::onTalk( Core::Entity::PlayerPtr pPlayer, ui
pPlayer->eventStart( actorId, eventId, Event::Event::Talk, 0, 0 );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t, Entity::Player&, uint64_t ) > >( eventName );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &,
uint32_t, Entity::Player&, uint64_t ) > >( eventName );
fn( obj, eventId, *pPlayer, actorId );
pPlayer->checkEvent( eventId );
@ -146,7 +150,8 @@ bool Core::Scripting::ScriptManager::onEnterTerritory( Core::Entity::PlayerPtr p
pPlayer->eventStart( pPlayer->getId(), eventId, Event::Event::EnterTerritory, 0, pPlayer->getZoneId() );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t, Entity::Player&, uint16_t, uint16_t ) > >( eventName );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t,
Entity::Player&, uint16_t, uint16_t ) > >( eventName );
fn( obj, eventId, *pPlayer, param1, param2 );
pPlayer->checkEvent( eventId );
@ -159,7 +164,8 @@ bool Core::Scripting::ScriptManager::onEnterTerritory( Core::Entity::PlayerPtr p
return true;
}
bool Core::Scripting::ScriptManager::onWithinRange( Entity::PlayerPtr pPlayer, uint32_t eventId, uint32_t param1, float x, float y, float z )
bool Core::Scripting::ScriptManager::onWithinRange( Entity::PlayerPtr pPlayer, uint32_t eventId, uint32_t param1,
float x, float y, float z )
{
std::string eventName = "onWithinRange";
std::string objName = Event::getEventName( eventId );
@ -173,7 +179,8 @@ bool Core::Scripting::ScriptManager::onWithinRange( Entity::PlayerPtr pPlayer, u
pPlayer->eventStart( pPlayer->getId(), eventId, Event::Event::WithinRange, 1, param1 );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t, Entity::Player&, uint32_t, float, float, float ) > >( eventName );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t, Entity::Player&, uint32_t,
float, float, float ) > >( eventName );
fn( obj, eventId, *pPlayer, param1, x, y, z );
pPlayer->checkEvent( eventId );
@ -186,7 +193,8 @@ bool Core::Scripting::ScriptManager::onWithinRange( Entity::PlayerPtr pPlayer, u
return true;
}
bool Core::Scripting::ScriptManager::onOutsideRange( Entity::PlayerPtr pPlayer, uint32_t eventId, uint32_t param1, float x, float y, float z )
bool Core::Scripting::ScriptManager::onOutsideRange( Entity::PlayerPtr pPlayer, uint32_t eventId, uint32_t param1,
float x, float y, float z )
{
std::string eventName = "onOutsideRange";
std::string objName = Event::getEventName( eventId );
@ -200,7 +208,8 @@ bool Core::Scripting::ScriptManager::onOutsideRange( Entity::PlayerPtr pPlayer,
pPlayer->eventStart( pPlayer->getId(), eventId, Event::Event::OutsideRange, 1, param1 );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t, Entity::Player&, uint32_t, float, float, float ) > >( eventName );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t, Entity::Player&, uint32_t,
float, float, float ) > >( eventName );
fn( obj, eventId, *pPlayer, param1, x, y, z );
pPlayer->checkEvent( eventId );
@ -227,7 +236,8 @@ bool Core::Scripting::ScriptManager::onEmote( Core::Entity::PlayerPtr pPlayer, u
pPlayer->eventStart( actorId, eventId, Event::Event::Emote, 0, emoteId );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t, Entity::Player&, uint64_t, uint8_t ) > >( eventName );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t, Entity::Player&,
uint64_t, uint8_t ) > >( eventName );
fn( obj, eventId, *pPlayer, actorId, emoteId );
pPlayer->checkEvent( eventId );
@ -250,17 +260,18 @@ bool Core::Scripting::ScriptManager::onEmote( Core::Entity::PlayerPtr pPlayer, u
return true;
}
bool Core::Scripting::ScriptManager::onEventHandlerReturn( Core::Entity::PlayerPtr pPlayer, uint32_t eventId, uint16_t subEvent,
uint16_t param1, uint16_t param2, uint16_t param3 )
bool Core::Scripting::ScriptManager::onEventHandlerReturn( Core::Entity::PlayerPtr pPlayer, uint32_t eventId,
uint16_t subEvent, uint16_t param1, uint16_t param2,
uint16_t param3 )
{
pPlayer->sendDebug("eventId: " +
std::to_string( eventId ) +
" ( 0x" + boost::str( boost::format( "%|08X|" ) % ( uint64_t ) ( eventId & 0xFFFFFFF ) ) + " ) " +
" scene: " + std::to_string( subEvent ) +
" p1: " + std::to_string( param1 ) +
" p2: " + std::to_string( param2 ) +
" p3: " + std::to_string( param3 ) );
pPlayer->sendDebug( "eventId: " +
std::to_string( eventId ) +
" ( 0x" + boost::str( boost::format( "%|08X|" ) % ( uint64_t ) ( eventId & 0xFFFFFFF ) ) + " ) " +
" scene: " + std::to_string( subEvent ) +
" p1: " + std::to_string( param1 ) +
" p2: " + std::to_string( param2 ) +
" p3: " + std::to_string( param3 ) );
try
{
@ -300,7 +311,8 @@ bool Core::Scripting::ScriptManager::onEventHandlerTradeReturn( Core::Entity::Pl
try
{
auto fn = m_pChaiHandler->eval< std::function< void( Entity::Player&, uint32_t, uint16_t, uint16_t, uint32_t ) > >( eventName );
auto fn = m_pChaiHandler->eval< std::function< void( Entity::Player&, uint32_t,
uint16_t, uint16_t, uint32_t ) > >( eventName );
fn( *pPlayer, eventId, subEvent, param, catalogId );
}
catch( ... )
@ -312,7 +324,7 @@ bool Core::Scripting::ScriptManager::onEventHandlerTradeReturn( Core::Entity::Pl
}
bool Core::Scripting::ScriptManager::onEventItem( Entity::PlayerPtr pPlayer, uint32_t eventItemId,
uint32_t eventId, uint32_t castTime, uint64_t targetId )
uint32_t eventId, uint32_t castTime, uint64_t targetId )
{
std::string eventName = "onEventItem";
std::string objName = Event::getEventName( eventId );
@ -325,7 +337,8 @@ bool Core::Scripting::ScriptManager::onEventItem( Entity::PlayerPtr pPlayer, uin
pPlayer->eventStart( targetId, eventId, Event::Event::Item, 0, 0 );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t, Entity::Player&, uint32_t, uint32_t, uint64_t ) > >( eventName );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, uint32_t, Entity::Player&,
uint32_t, uint32_t, uint64_t ) > >( eventName );
fn( obj, eventId, *pPlayer, eventItemId, castTime, targetId );
}
catch( std::exception& e )
@ -384,7 +397,8 @@ bool Core::Scripting::ScriptManager::onCastFinish( Entity::PlayerPtr pPlayer, En
std::string objName = "skillDef_" + std::to_string( actionId );
pPlayer->sendDebug( "Calling: " + objName + "." + eventName );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, Entity::Player&, Entity::Actor& ) > >( eventName );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, Entity::Player&,
Entity::Actor& ) > >( eventName );
fn( obj, *pPlayer, *pTarget );
}
catch( std::exception& e )
@ -431,7 +445,8 @@ bool Core::Scripting::ScriptManager::onStatusTick( Entity::ActorPtr pActor, Core
if( pActor->isPlayer() )
pActor->getAsPlayer()->sendDebug( "Calling: " + objName + "." + eventName );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, Entity::Actor&, Core::StatusEffect::StatusEffect& ) > >( eventName );
auto fn = m_pChaiHandler->eval< std::function< void( chaiscript::Boxed_Value &, Entity::Actor&,
Core::StatusEffect::StatusEffect& ) > >( eventName );
fn( obj, *pActor, effect );
}
catch( std::exception& e )

View file

@ -1,8 +1,11 @@
#include <chaiscript/chaiscript.hpp>
#include <Server_Common/Config/XMLConfig.h>
#include <Server_Common/Logging/Logger.h>
#include <Server_Common/Script/ChaiscriptStdLib.h>
#include "src/servers/Server_Zone/ServerZone.h"
#include "src/servers/Server_Zone/Script/ScriptManager.h"
#include "src/servers/Server_Zone/Zone/Zone.h"
@ -17,6 +20,7 @@
#include <boost/lexical_cast.hpp>
extern Core::Logger g_log;
extern Core::ServerZone g_serverZone;
int Core::Scripting::ScriptManager::init()
{
@ -169,8 +173,7 @@ int Core::Scripting::ScriptManager::init()
std::set< std::string > chaiFiles;
g_log.info( "ScriptEngine: Loading Scripts..." );
loadDir( "../scripts/chai", chaiFiles );
loadDir( g_serverZone.getConfig()->getValue< std::string >( "Settings.General.ScriptPath", "../scripts/chai" ), chaiFiles );
uint16_t scriptCount = 0;
uint16_t errorCount = 0;

View file

@ -129,6 +129,10 @@ bool Core::ServerZone::loadSettings( int32_t argc, char* argv[] )
{
m_pConfig->setValue< std::string >( "Settings.General.DataPath", val );
}
else if( arg == "s" || arg == "scriptpath" )
{
m_pConfig->setValue< std::string >( "Settings.General.ScriptPath", val );
}
else if( arg == "h" || arg == "dbhost" )
{
m_pConfig->setValue< std::string >( "Settings.General.Mysql.Host", val );
@ -288,7 +292,7 @@ void Core::ServerZone::mainLoop()
auto pPlayer = it->second->getPlayer();
// remove session of players marked for removel ( logoff / kick )
if( pPlayer->isMarkedForRemoval() && diff > 1 )
if( pPlayer->isMarkedForRemoval() && diff > 5 )
{
it->second->close();
// if( it->second.unique() )

View file

@ -46,7 +46,7 @@ Zone::Zone()
, m_layoutId( 0 )
, m_bPrivate( false )
, m_type( Common::RegionType::normal )
, m_currentWeather( static_cast<uint8_t>( Common::Weather::FairSkies ) )
, m_currentWeather( static_cast< uint8_t >( Common::Weather::FairSkies ) )
, m_weatherOverride( 0 )
, m_lastMobUpdate( 0 )
{
@ -54,7 +54,7 @@ Zone::Zone()
Zone::Zone( uint16_t zoneId, uint32_t layoutId, std::string name, std::string interName, bool bPrivate = false )
: m_type( Common::RegionType::normal )
, m_currentWeather( static_cast<uint8_t>( Common::Weather::FairSkies ) )
, m_currentWeather( static_cast< uint8_t >( Common::Weather::FairSkies ) )
{
m_layoutId = layoutId;
@ -197,8 +197,8 @@ void Zone::loadCellCache()
for( auto entry : cache )
{
// get cell position
uint32_t cellX = CellHandler<ZoneMgr>::getPosX( entry->getPos().x );
uint32_t cellY = CellHandler<ZoneMgr>::getPosY( entry->getPos().z );
uint32_t cellX = CellHandler< ZoneMgr >::getPosX( entry->getPos().x );
uint32_t cellY = CellHandler< ZoneMgr >::getPosY( entry->getPos().z );
// find the right cell, create it if not existing yet
if( m_pCellCache[cellX] == nullptr )
@ -314,7 +314,6 @@ void Zone::pushActor( Entity::ActorPtr pActor )
void Zone::removeActor( Entity::ActorPtr pActor )
{
if( pActor->m_pCell )
{
pActor->m_pCell->removeActor( pActor );

View file

@ -14,13 +14,9 @@ extern Core::Data::ExdData g_exdData;
namespace Core {
ZoneMgr::ZoneMgr()
{
}
ZoneMgr::ZoneMgr() = default;
ZoneMgr::~ZoneMgr()
{
}
ZoneMgr::~ZoneMgr() = default;
void ZoneMgr::loadZonePositionMap()
{

View file

@ -20,6 +20,18 @@ xiv::exd::Exd Core::Data::ExdDataGenerated::setupDatAccess( const std::string& n
return static_cast< xiv::exd::Exd >( cat.get_data_ln( lang ) );
};
void Core::Data::ExdDataGenerated::loadIdList( xiv::exd::Exd& data, std::set< uint32_t >& outIdList )
{
auto pDataRows = data.get_rows();
for( auto row : pDataRows )
{
uint32_t id = row.first;
outIdList.insert( id );
}
}
bool Core::Data::ExdDataGenerated::init( const std::string& path )
{
try

View file

@ -10,6 +10,7 @@
#include <ExdData.h>
#include <ExdCat.h>
#include <Exd.h>
#include <set>
namespace Core {
namespace Data {
@ -36,6 +37,8 @@ STRUCTS
return *boost::get< T >( &fields.at( index ) );
}
void loadIdList( xiv::exd::Exd& data, std::set< uint32_t >& outIdList );
boost::shared_ptr< xiv::dat::GameData > m_data;
boost::shared_ptr< xiv::exd::ExdData > m_exd_data;
@ -43,6 +46,10 @@ DATACCESS
DIRECTGETTERS
IDLISTS
IDLISTGETTERS
};
}

View file

@ -1,5 +1,5 @@
{
"version": "2017.10.05.0000.0000",
"version": "2017.11.15.0000.0000",
"sheets": [
{
"sheet": "Achievement",
@ -189,7 +189,7 @@
"index": 30,
"name": "Cost{Type}"
},
{
{
"index": 31,
"name": "Cost"
},
@ -2868,7 +2868,7 @@
},
{
"sheet": "DeepDungeonItem",
"defaultcolumn": "Name",
"defaultColumn": "Name",
"definitions": [
{
"name": "Icon",
@ -2877,7 +2877,7 @@
}
},
{
"index": 2,
"index": 1,
"name": "Singular"
},
{
@ -3476,6 +3476,42 @@
}
]
},
{
"sheet": "EquipRaceCategory",
"definitions": [
{
"name": "Hyur"
},
{
"index": 1,
"name": "Elezen"
},
{
"index": 2,
"name": "Lalafell"
},
{
"index": 3,
"name": "Miqo'te"
},
{
"index": 4,
"name": "Roegadyn"
},
{
"index": 5,
"name": "Au Ra"
},
{
"index": 6,
"name": "Male"
},
{
"index": 7,
"name": "Female"
}
]
},
{
"sheet": "EquipSlotCategory",
"definitions": [
@ -4500,6 +4536,26 @@
}
]
},
{
"sheet": "GCScripShopCategory",
"definitions": [
{
"name": "GrandCompany",
"converter": {
"type": "link",
"target": "GrandCompany"
}
},
{
"index": 1,
"name": "Tier"
},
{
"index": 2,
"name": "SubCategory"
}
]
},
{
"sheet": "GCScripShopItem",
"defaultColumn": "Item",
@ -4513,11 +4569,19 @@
},
{
"index": 1,
"name": "Required{Rank}"
"name": "Required{GrandCompanyRank}",
"converter": {
"type": "link",
"target": "GrandCompanyRank"
}
},
{
"index": 2,
"name": "Cost{GCSeals}"
},
{
"index": 3,
"name": "SortKey"
}
]
},
@ -6211,6 +6275,26 @@
}
]
},
{
"sheet": "MasterpieceSupplyMultiplier",
"definitions": [
{
"type": "repeat",
"count": 2,
"definition": {
"name": "XpMultiplier"
}
},
{
"index": 4,
"type": "repeat",
"count": 2,
"definition": {
"name": "CurrencyMultiplier"
}
}
]
},
{
"sheet": "Materia",
"defaultColumn": "Item[0]",
@ -7935,7 +8019,7 @@
]
},
{
"sheet": "Salvage",
"sheet": "Salvage",
"defaultColumn": "OptimalSkill",
"definitions": [
{

View file

@ -31,8 +31,8 @@ Core::Logger g_log;
Core::Data::ExdData g_exdData;
bool skipUnmapped = true;
const std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
//const std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv" );
//const std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
const std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv" );
std::map< uint8_t, std::string > g_typeMap;
@ -41,9 +41,25 @@ std::string generateDatAccessDecl( const std::string &exd )
return " xiv::exd::Exd m_" + exd + "Dat;\n";
}
std::string generateIdListDecl( const std::string &exd )
{
return " std::set< uint32_t > m_" + exd + "IdList;\n";
}
std::string generateDirectGetters( const std::string& exd )
{
return " boost::shared_ptr< " + exd + " > get" + exd + "( uint32_t " + exd + "Id );";
return " boost::shared_ptr< " + exd + " > get" + exd + "( uint32_t " + exd + "Id );\n";
}
std::string generateIdListGetter( const std::string &exd )
{
std::string IdListGetter = "const std::set< uint32_t >& get" + exd + "IdList()\n"
"{\n"
" if( m_" + exd + "IdList.size() == 0 )\n"
" loadIdList( m_" + exd + "Dat, m_" + exd + "IdList );\n"
" return m_" + exd + "IdList;\n"
"}\n";
return IdListGetter;
}
std::string generateSetDatAccessCall( const std::string &exd )
@ -288,14 +304,18 @@ int main()
g_log.fatal( "Error setting up EXD data " );
return 0;
}
g_log.info( "Generating structs, this may take several minutes..." );
g_log.info( "Go grab a coffee..." );
std::string structDefs;
std::string idListsDecl;
std::string dataDecl;
std::string getterDecl;
std::string datAccCall;
std::string getterDef;
std::string constructorDecl;
std::string forwards;
std::string idListGetters;
//BOOST_FOREACH( boost::property_tree::ptree::value_type &sheet, m_propTree.get_child( "sheets" ) )
//{
@ -310,10 +330,12 @@ int main()
forwards += "struct " + name +";\n";
structDefs += generateStruct( name );
dataDecl += generateDatAccessDecl( name );
idListsDecl += generateIdListDecl( name );
getterDecl += generateDirectGetters( name );
datAccCall += generateSetDatAccessCall( name );
getterDef += generateDirectGetterDef( name );
constructorDecl += generateConstructorsDecl( name );
idListGetters += generateIdListGetter( name );
}
// for all sheets in the json i guess....
@ -322,7 +344,10 @@ int main()
result = std::regex_replace( exdH, std::regex( "\\FORWARDS" ), forwards );
result = std::regex_replace( result, std::regex( "\\STRUCTS" ), structDefs );
result = std::regex_replace( result, std::regex( "\\DATACCESS" ), dataDecl );
result = std::regex_replace( result, std::regex( "\\IDLISTS" ), idListsDecl );
result = std::regex_replace( result, std::regex( "\\DIRECTGETTERS" ), getterDecl );
result = std::regex_replace( result, std::regex( "\\IDLISTGETTERS" ), idListGetters );
// g_log.info( result );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -25,8 +25,8 @@ Core::Logger g_log;
Core::Data::ExdDataGenerated g_exdData;
const std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
//const std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv" );
//const std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
const std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv" );
int main()
@ -41,10 +41,15 @@ int main()
return 0;
}
auto teri = g_exdData.getTerritoryType( 132 );
g_log.info( teri->name );
g_log.info( teri->bg );
auto idList = g_exdData.getTerritoryTypeIdList();
for( auto id : idList )
{
auto teri1 = g_exdData.getTerritoryType( id );
g_log.info( teri1->name );
g_log.info( teri1->bg );
}
return 0;
}