1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
GokuWeedLord 2017-11-19 00:39:33 +11:00
commit 7161de22ac
7 changed files with 43 additions and 50 deletions

View file

@ -1,4 +1,4 @@
# Sapphire - FINAL FANTASY XIV Server Emulator # Sapphire - FINAL FANTASY XIV Server Emulator
[![Discord Server](https://img.shields.io/badge/discord-Sapphire-7289DA.svg)](https://discord.gg/KfrZCkx) [![Discord Server](https://img.shields.io/badge/discord-Sapphire-7289DA.svg)](https://discord.gg/KfrZCkx)
[![Linux Build Status](https://travis-ci.org/SapphireMordred/Sapphire.svg?branch=master)](https://travis-ci.org/SapphireMordred/Sapphire) [![Linux Build Status](https://travis-ci.org/SapphireMordred/Sapphire.svg?branch=master)](https://travis-ci.org/SapphireMordred/Sapphire)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/lil7lxa3ty165emm?svg=true)](https://ci.appveyor.com/project/SapphireMordred/Sapphire) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/lil7lxa3ty165emm?svg=true)](https://ci.appveyor.com/project/SapphireMordred/Sapphire)
@ -16,7 +16,6 @@ Sapphire requires the following software:
| CMake 2.6+ and C++14 capable compiler | [Visual Studio 2017](https://www.visualstudio.com/) | `gcc 4.9` and `g++ 4.9` or newer | | CMake 2.6+ and C++14 capable compiler | [Visual Studio 2017](https://www.visualstudio.com/) | `gcc 4.9` and `g++ 4.9` or newer |
| Boost 1.63.0 | [Win32 precompiled binaries](https://sourceforge.net/projects/boost/files/boost-binaries/1.63.0/boost_1_63_0-msvc-14.0-32.exe/download) | Boost libraries from your distribution's package manager | | Boost 1.63.0 | [Win32 precompiled binaries](https://sourceforge.net/projects/boost/files/boost-binaries/1.63.0/boost_1_63_0-msvc-14.0-32.exe/download) | Boost libraries from your distribution's package manager |
| MySQL Server 5.7 | [Official Site](https://dev.mysql.com/downloads/mysql/) | MySQL server from your distribution's package manager | | MySQL Server 5.7 | [Official Site](https://dev.mysql.com/downloads/mysql/) | MySQL server from your distribution's package manager |
| C# Compiler(used for various tools) | [Visual Studio 2017](https://www.visualstudio.com/) \| [Mono](http://www.mono-project.com/) | [Mono](http://www.mono-project.com/) from your distribution's package manager |
**Windows** **Windows**
Set the environment variables ``BOOST_ROOT_DIR`` and ``BOOST_LIB_DIR`` to ``[boost main folder]`` and ``[boost main folder]/lib32-msvc-14.0`` respectively **or** copy your boost installation into the project's ``src/lib`` folder. Set the environment variables ``BOOST_ROOT_DIR`` and ``BOOST_LIB_DIR`` to ``[boost main folder]`` and ``[boost main folder]/lib32-msvc-14.0`` respectively **or** copy your boost installation into the project's ``src/lib`` folder.

View file

@ -1,5 +1,7 @@
#include "CommonGen.h" #include "CommonGen.h"
#include <stdint.h>
namespace Core { namespace Core {
namespace Common { namespace Common {

View file

@ -1,5 +1,8 @@
#ifndef _COMMON_GEN_H_ #ifndef _COMMON_GEN_H_
#define _COMMON_GEN_H_ #define _COMMON_GEN_H_
#include <stdint.h>
/* This file has been automatically generated. /* This file has been automatically generated.
Changes will be lost upon regeneration. Changes will be lost upon regeneration.
To change the content edit tools/exd_common_gen */ To change the content edit tools/exd_common_gen */
@ -25,7 +28,6 @@ namespace Common {
Glamour = 13, Glamour = 13,
ItemManipulation = 14, ItemManipulation = 14,
AdrenalineRush = 15, AdrenalineRush = 15,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -41,14 +43,12 @@ namespace Common {
Honored = 6, Honored = 6,
Sworn = 7, Sworn = 7,
Allied = 8, Allied = 8,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//BeastTribe.exd //BeastTribe.exd
enum class BeastTribe : uint8_t enum class BeastTribe : uint8_t
{ {
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -91,7 +91,6 @@ namespace Common {
Astrologian = 33, Astrologian = 33,
Samurai = 34, Samurai = 34,
Redmage = 35, Redmage = 35,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -120,7 +119,6 @@ namespace Common {
DeepDungeons = 21, DeepDungeons = 21,
WondrousTails = 24, WondrousTails = 24,
CustomDeliveries = 25, CustomDeliveries = 25,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -130,7 +128,6 @@ namespace Common {
General = 1, General = 1,
Persistent = 2, Persistent = 2,
Expressions = 3, Expressions = 3,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -140,7 +137,6 @@ namespace Common {
ARealmReborn = 0, ARealmReborn = 0,
Heavensward = 1, Heavensward = 1,
Stormblood = 2, Stormblood = 2,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -151,7 +147,6 @@ namespace Common {
Maelstrom = 1, Maelstrom = 1,
OrderoftheTwinAdder = 2, OrderoftheTwinAdder = 2,
ImmortalFlames = 3, ImmortalFlames = 3,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -170,7 +165,6 @@ namespace Common {
NaldthaltheTraders = 10, NaldthaltheTraders = 10,
NophicatheMatron = 11, NophicatheMatron = 11,
AlthyktheKeeper = 12, AlthyktheKeeper = 12,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -277,7 +271,6 @@ namespace Common {
ScholarsArm = 98, ScholarsArm = 98,
FishersSecondaryTool = 99, FishersSecondaryTool = 99,
Currency = 100, Currency = 100,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -369,7 +362,6 @@ namespace Common {
SamuraisArms = 83, SamuraisArms = 83,
RedMagesArms = 84, RedMagesArms = 84,
ScholarsArms = 85, ScholarsArms = 85,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -423,7 +415,6 @@ namespace Common {
FreeCompany = 45, FreeCompany = 45,
GrandCompany = 46, GrandCompany = 46,
Online = 47, Online = 47,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -436,7 +427,6 @@ namespace Common {
Miqote = 4, Miqote = 4,
Roegadyn = 5, Roegadyn = 5,
AuRa = 6, AuRa = 6,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -455,7 +445,6 @@ namespace Common {
Hellsguard = 10, Hellsguard = 10,
Raen = 11, Raen = 11,
Xaela = 12, Xaela = 12,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -468,7 +457,6 @@ namespace Common {
Uldah = 3, Uldah = 3,
Ishgard = 4, Ishgard = 4,
Kugane = 7, Kugane = 7,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -565,9 +553,7 @@ namespace Common {
Thunder3 = 88, Thunder3 = 88,
DimensionalDisruption3 = 89, DimensionalDisruption3 = 89,
FairSkies9 = 90, FairSkies9 = 90,
}; };
} }
} }
#endif #endif

View file

@ -174,7 +174,7 @@ namespace Core {
float x, y, z, o; float x, y, z, o;
int32_t startTown = 0; int32_t startTown = 0;
switch( m_class ) switch( static_cast< Core::Common::ClassJob >( m_class ) )
{ {
case Core::Common::ClassJob::Conjurer: case Core::Common::ClassJob::Conjurer:
case Core::Common::ClassJob::Lancer: case Core::Common::ClassJob::Lancer:

View file

@ -48,7 +48,7 @@ Core::StatusEffect::StatusEffectContainer::~StatusEffectContainer()
void Core::StatusEffect::StatusEffectContainer::addStatusEffect( StatusEffectPtr pEffect ) void Core::StatusEffect::StatusEffectContainer::addStatusEffect( StatusEffectPtr pEffect )
{ {
uint8_t nextSlot = getFreeSlot(); int8_t nextSlot = getFreeSlot();
// if there is no slot left, do not add the effect // if there is no slot left, do not add the effect
if( nextSlot == -1 ) if( nextSlot == -1 )
return; return;

View file

@ -1,5 +1,9 @@
[14:21:11][info] Setting up EXD data #ifndef _COMMON_GEN_H_
[14:21:12][info] /* This file has been automatically generated. #define _COMMON_GEN_H_
#include <stdint.h>
/* This file has been automatically generated.
Changes will be lost upon regeneration. Changes will be lost upon regeneration.
To change the content edit tools/exd_common_gen */ To change the content edit tools/exd_common_gen */
namespace Core { namespace Core {
@ -7,7 +11,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//ActionCategory.exd //ActionCategory.exd
enum ActionCategory : uint8_t enum class ActionCategory : uint8_t
{ {
Autoattack = 1, Autoattack = 1,
Spell = 2, Spell = 2,
@ -28,7 +32,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//BeastReputationRank.exd //BeastReputationRank.exd
enum BeastReputationRank : uint8_t enum class BeastReputationRank : uint8_t
{ {
None = 0, None = 0,
Neutral = 1, Neutral = 1,
@ -43,21 +47,13 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//BeastTribe.exd //BeastTribe.exd
enum BeastTribe : uint8_t enum class BeastTribe : uint8_t
{ {
Amaljaa = 1,
Sylphs = 2,
Kobolds = 3,
Sahagin = 4,
Ixal = 5,
VanuVanu = 6,
Vath = 7,
Moogles = 8,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//ClassJob.exd //ClassJob.exd
enum ClassJob : uint8_t enum class ClassJob : uint8_t
{ {
Adventurer = 0, Adventurer = 0,
Gladiator = 1, Gladiator = 1,
@ -99,7 +95,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//ContentType.exd //ContentType.exd
enum ContentType : uint8_t enum class ContentType : uint8_t
{ {
DutyRoulette = 1, DutyRoulette = 1,
Dungeons = 2, Dungeons = 2,
@ -122,11 +118,12 @@ namespace Common {
GoldSaucer = 19, GoldSaucer = 19,
DeepDungeons = 21, DeepDungeons = 21,
WondrousTails = 24, WondrousTails = 24,
CustomDeliveries = 25,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//EmoteCategory.exd //EmoteCategory.exd
enum EmoteCategory : uint8_t enum class EmoteCategory : uint8_t
{ {
General = 1, General = 1,
Persistent = 2, Persistent = 2,
@ -135,7 +132,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//ExVersion.exd //ExVersion.exd
enum ExVersion : uint8_t enum class ExVersion : uint8_t
{ {
ARealmReborn = 0, ARealmReborn = 0,
Heavensward = 1, Heavensward = 1,
@ -144,7 +141,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//GrandCompany.exd //GrandCompany.exd
enum GrandCompany : uint8_t enum class GrandCompany : uint8_t
{ {
None = 0, None = 0,
Maelstrom = 1, Maelstrom = 1,
@ -154,7 +151,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//GuardianDeity.exd //GuardianDeity.exd
enum GuardianDeity : uint8_t enum class GuardianDeity : uint8_t
{ {
HalonetheFury = 1, HalonetheFury = 1,
MenphinatheLover = 2, MenphinatheLover = 2,
@ -172,7 +169,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//ItemUICategory.exd //ItemUICategory.exd
enum ItemUICategory : uint8_t enum class ItemUICategory : uint8_t
{ {
PugilistsArm = 1, PugilistsArm = 1,
GladiatorsArm = 2, GladiatorsArm = 2,
@ -273,11 +270,12 @@ namespace Common {
RedMagesArm = 97, RedMagesArm = 97,
ScholarsArm = 98, ScholarsArm = 98,
FishersSecondaryTool = 99, FishersSecondaryTool = 99,
Currency = 100,
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//ItemSearchCategory.exd //ItemSearchCategory.exd
enum ItemSearchCategory : uint8_t enum class ItemSearchCategory : uint8_t
{ {
PrimaryArms = 1, PrimaryArms = 1,
PrimaryTools = 2, PrimaryTools = 2,
@ -368,7 +366,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//OnlineStatus.exd //OnlineStatus.exd
enum OnlineStatus : uint8_t enum class OnlineStatus : uint8_t
{ {
Producer = 1, Producer = 1,
GameMaster = 2, GameMaster = 2,
@ -421,7 +419,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//Race.exd //Race.exd
enum Race : uint8_t enum class Race : uint8_t
{ {
Hyur = 1, Hyur = 1,
Elezen = 2, Elezen = 2,
@ -433,7 +431,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//Tribe.exd //Tribe.exd
enum Tribe : uint8_t enum class Tribe : uint8_t
{ {
Midlander = 1, Midlander = 1,
Highlander = 2, Highlander = 2,
@ -451,7 +449,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//Town.exd //Town.exd
enum Town : uint8_t enum class Town : uint8_t
{ {
Nowheresville = 0, Nowheresville = 0,
LimsaLominsa = 1, LimsaLominsa = 1,
@ -463,7 +461,7 @@ namespace Common {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//Weather.exd //Weather.exd
enum Weather : uint8_t enum class Weather : uint8_t
{ {
ClearSkies = 1, ClearSkies = 1,
FairSkies = 2, FairSkies = 2,
@ -554,7 +552,9 @@ namespace Common {
Quicklevin = 87, Quicklevin = 87,
Thunder3 = 88, Thunder3 = 88,
DimensionalDisruption3 = 89, DimensionalDisruption3 = 89,
FairSkies9 = 90,
}; };
} }
} }
#endif

View file

@ -21,7 +21,7 @@ Core::Data::ExdData g_exdData;
//const std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" ); //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( "C:\\Data\\Games\\Final Fantasy XIV\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv" );
std::string generateEnum( const std::string& exd, int8_t nameIndex, const std::string& type, bool useLang = true ) std::string generateEnum( const std::string& exd, int8_t nameIndex, const std::string& type, bool useLang = true )
{ {
@ -66,9 +66,13 @@ std::string generateEnum( const std::string& exd, int8_t nameIndex, const std::s
result += " " + str + " = " + std::to_string( id ) + ",\n"; result += " " + str + " = " + std::to_string( id ) + ",\n";
} }
/*
result += result +=
" bool operator==( const " + exd + "& t, const " + type + "& g ) { return static_cast< " + type + " >( t ) == g; }\n" " bool operator==( const " + exd + "& t, const " + type + "& g ) { return static_cast< " + type + " >( t ) == g; }\n"
" bool operator==( const " + type + "& g, const " + exd + "& t ) { return static_cast< " + type + " >( t ) == g; }\n"; " bool operator==( const " + type + "& g, const " + exd + "& t ) { return static_cast< " + type + " >( t ) == g; }\n";
*/
result += " };\n"; result += " };\n";
return result; return result;
@ -85,11 +89,13 @@ int main()
if( !g_exdData.init( datLocation ) ) if( !g_exdData.init( datLocation ) )
{ {
g_log.fatal( "Error setting up EXD data " ); g_log.fatal( "Error setting up EXD data " );
return 0; return 1;
} }
std::string result = "#ifndef _COMMON_GEN_H_\n#define _COMMON_GEN_H_\n"; std::string result = "#ifndef _COMMON_GEN_H_\n#define _COMMON_GEN_H_\n";
result += "\n#include <stdint.h>\n\n";
result += result +=
"/* This file has been automatically generated.\n Changes will be lost upon regeneration.\n To change the content edit tools/exd_common_gen */\n"; "/* This file has been automatically generated.\n Changes will be lost upon regeneration.\n To change the content edit tools/exd_common_gen */\n";