1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-24 13:47:46 +00:00

Merge remote-tracking branch 'upstream/native_scripting' into fix/set-classjob

This commit is contained in:
Adam 2017-12-27 12:52:23 +11:00
commit 0bbcf9ac29
204 changed files with 876 additions and 694 deletions

2
.gitignore vendored
View file

@ -104,7 +104,7 @@ src/libraries/external/boost_*
*.idb
# sapphire version
src/servers/Server_Common/Version\.cpp
src/common/Version\.cpp
# edit and continue files
/enc_temp_folder

View file

@ -23,7 +23,7 @@ set(SAPPHIRE_BOOST_FOLDER_NAME boost_1_60_0)
##########################################################################
# Common and library path
set(SERVER_COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/servers/Server_Common")
set(SERVER_COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/common")
set(LIBRARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/libraries")
##########################################################################
@ -37,9 +37,9 @@ include( "cmake/compiler.cmake" )
##############################
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
git_describe(VERSION --tags --dirty=-d)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/servers/Server_Common/Version.cpp.in"
"${CMAKE_CURRENT_SOURCE_DIR}/src/servers/Server_Common/Version.cpp" @ONLY)
git_describe(VERSION --all --dirty=-d)
configure_file("${SERVER_COMMON_DIR}/Version.cpp.in"
"${SERVER_COMMON_DIR}/Version.cpp" @ONLY)
##########################################################################
# Common include folders
@ -61,10 +61,12 @@ add_subdirectory("src/servers")
add_subdirectory("src/libraries/sapphire/datReader")
add_subdirectory("src/libraries/sapphire/mysqlConnector")
add_subdirectory("src/common")
add_subdirectory("src/tools/exd_common_gen")
add_subdirectory("src/tools/exd_struct_gen")
add_subdirectory("src/tools/exd_struct_test")
add_subdirectory("src/tools/quest_parser")
add_subdirectory("src/tools/pcb_reader")
#add_subdirectory("src/tools/pcb_reader")
add_subdirectory("scripts/native")

View file

@ -5,10 +5,11 @@ file(GLOB SCRIPT_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
file(GLOB_RECURSE SCRIPT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
include_directories("${CMAKE_SOURCE_DIR}/src/servers/")
include_directories("${CMAKE_SOURCE_DIR}/src/servers/Server_Zone/")
include_directories("${CMAKE_SOURCE_DIR}/src/servers/sapphire_zone/")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Yc${CMAKE_CURRENT_SOURCE_DIR}/ScriptObject.h /FI${CMAKE_CURRENT_SOURCE_DIR}/ScriptObject.h")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Yc\"${CMAKE_CURRENT_SOURCE_DIR}/ScriptObject.h\" /FI\"${CMAKE_CURRENT_SOURCE_DIR}/ScriptObject.h\"")
endif()
message( "exec: ${EXECUTABLE_OUTPUT_DIRECTORY}" )
@ -37,11 +38,11 @@ foreach(_sourcefile ${SCRIPT_FILES})
)
endif()
target_link_libraries("${_file}" server_zone)
target_link_libraries("${_file}" sapphire_zone)
add_custom_command(TARGET "${_file}" POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/${_file}.exp"
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/${_file}.lib"
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/${_file}.ilk"
)
endforeach(_sourcefile ${SCRIPT_FILES})
endforeach(_sourcefile ${SCRIPT_FILES})

View file

@ -0,0 +1,259 @@
// This is an automatically generated C++ script template
// Content needs to be added by hand to make it function
// In order for this script to be loaded, change its extension to .cpp
// and move it to the correct folder in <root>/scripts/native/
#include <ScriptObject.h>
// Quest Script: ManFst004_00124
// Quest Name: Close to Home
// Quest ID: 65660
// Start NPC: 1001140
// End NPC: 1000100
class ManFst004 : public EventScript
{
private:
// Basic quest information
// Quest vars / flags used
// GetQuestBitFlag8
// GetQuestUI8AL
// GetQuestUI8BH
// GetQuestUI8BL
// GetQuestUI8CH
// Steps in this quest ( 0 is before accepting,
// 1 is first, 255 means ready for turning it in
enum Sequence : uint8_t
{
Seq0 = 0,
Seq1 = 1,
SeqFinish = 255,
};
// Quest rewards
static constexpr auto RewardExpFactor = 100;
static constexpr auto RewardGil = 107;
// Entities found in the script data of the quest
static constexpr auto Actor0 = 1001140;
static constexpr auto Actor1 = 2;
static constexpr auto Actor2 = 1000323;
static constexpr auto Actor20 = 1000159;
static constexpr auto Actor3 = 1000768;
static constexpr auto Actor4 = 1000100;
static constexpr auto BindActor0 = 6229224;
static constexpr auto Item0 = 2000120;
static constexpr auto LocActor0 = 1003159;
static constexpr auto LocMarker01 = 2153091;
static constexpr auto LocMarker02 = 2153104;
static constexpr auto LocMarker03 = 2153111;
static constexpr auto LocMarker04 = 2154539;
static constexpr auto LocMarker05 = 2154540;
static constexpr auto LocMarker06 = 2154541;
static constexpr auto LocMarker07 = 2210446;
static constexpr auto LocMarker08 = 2210454;
static constexpr auto LocMarker09 = 2210461;
static constexpr auto LocMotion0 = 799;
static constexpr auto Poprange0 = 2280858;
static constexpr auto RewardDesion = 1;
static constexpr auto Seq0Actor0 = 0;
static constexpr auto Seq0Actor0Lq = 50;
static constexpr auto Seq1Actor0 = 4;
static constexpr auto Seq1Actor1 = 1;
static constexpr auto Seq1Actor1Wait = 51;
static constexpr auto Seq1Actor2 = 2;
static constexpr auto Seq1Actor3 = 3;
static constexpr auto Seq1Actor3Npctradeno = 99;
static constexpr auto Seq1Actor3Npctradeok = 100;
static constexpr auto Seq2Actor4 = 5;
static constexpr auto Territorytype0 = 132;
static constexpr auto UnlockDesion = 14;
public:
ManFst004() : EventScript( "Close to Home", 65660 ){};
~ManFst004(){};
//////////////////////////////////////////////////////////////////////
// Event Handlers
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
auto actor = Event::mapEventActorToRealActor( actorId );
if( actor == ManFst004::Actor0 )
{
Scene00000( player );
}
else if( actor == ManFst004::Actor1 )
{
// starting the Aetheryte eventaction
// player.eventStart( actorId, 0x050002, 7, 0, 0);
// starting the eventaction 0x13 ( attuning )
player.eventActionStart( 0x050002, 0x13,
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
player.sendQuestMessage( 0x050002, 0, 1, 0, 0 );
player.registerAetheryte( 2 );
player.learnAction( 1 );
Scene00051( player );
},
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional ) {},
eventId );
}
else if( actor == ManFst004::Actor2 )
{
Scene00002( player );
}
else if( actor == ManFst004::Actor3 )
{
Scene00003( player );
}
else if( actor == ManFst004::Actor4 )
{
Scene00005( player );
}
}
private:
void checkQuestCompletion( Entity::Player& player, uint32_t varIdx )
{
if( varIdx == 3 )
{
player.sendQuestMessage( m_id, 1, 0, 0, 0 );
}
else if( varIdx == 2 )
{
player.sendQuestMessage( m_id, 2, 0, 0, 0 );
}
else
{
player.sendQuestMessage( m_id, 0, 0, 0, 0 );
}
auto questId = m_id;
auto QUEST_VAR_ATTUNE = player.getQuestUI8AL( questId );
auto QUEST_VAR_CLASS = player.getQuestUI8BH( questId );
auto QUEST_VAR_TRADE = player.getQuestUI8BL( questId );
if( QUEST_VAR_ATTUNE == 1 && QUEST_VAR_CLASS == 1 && QUEST_VAR_TRADE == 1 )
{
player.updateQuest( questId, SeqFinish );
}
}
//////////////////////////////////////////////////////////////////////
// Available Scenes in this quest, not necessarly all are used
void Scene00000( Entity::Player& player )
{
player.eventPlay( m_id, 0, 0x2000,
[&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{
if( param2 == 1 ) // accept quest
{
Scene00050( player );
}
});
}
void Scene00001( Entity::Player& player )
{
player.eventPlay( m_id, 1, 0,
[&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{
player.setQuestUI8AL( m_id, 1 );
checkQuestCompletion( player, 0 );
});
}
void Scene00002( Entity::Player& player )
{
player.eventPlay( m_id, 2, 0,
[&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{
player.setQuestUI8BH( m_id, 1 );
checkQuestCompletion( player, 3 );
});
}
void Scene00003( Entity::Player& player )
{
player.eventPlay( m_id, 3, 0,
[&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{
if( param2 == 1 )
{
Scene00100( player );
}
else
{
Scene00099( player );
}
});
}
void Scene00004( Entity::Player& player )
{
player.eventPlay( m_id, 4, 0, 0, 0 );
}
void Scene00005( Entity::Player& player )
{
player.eventPlay( m_id, 5, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0, 0,
[&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{
if( param2 == 1 ) // finish quest
{
if( player.giveQuestRewards( m_id, 0 ) )
{
player.finishQuest( m_id );
}
}
});
}
void Scene00050( Entity::Player& player )
{
player.eventPlay( m_id, 50, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0/*unk*/, 0/*unk*/,
[&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{
// accepting quest "close to home"
player.updateQuest( m_id, 1 );
player.setQuestUI8CH( m_id, 1 ); // receive key item
// event is done, need to teleport to real zone.
player.setZone( 132 );
//player.setZone(183); back to starting griania for debug purpose
});
}
void Scene00051( Entity::Player& player )
{
player.eventPlay( m_id, 51, 0,
[&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{
Scene00001( player );
});
}
void Scene00099( Entity::Player& player )
{
player.eventPlay( m_id, 99, 0,
[&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{
Scene00004( player );
});
}
void Scene00100( Entity::Player& player )
{
player.eventPlay( m_id, 100, 0,
[&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{
player.setQuestUI8CH( m_id, 0 ); // remove key item, since we have just traded it
player.setQuestUI8BL( m_id, 1 );
checkQuestCompletion( player, 2 );
});
}
};
EXPORT_SCRIPTOBJECT( ManFst004 );

View file

@ -1,9 +1,13 @@
cmake_minimum_required(VERSION 2.6)
project(Sapphire)
file(GLOB UTILS_PUBLIC_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*")
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
file(GLOB UTILS_PUBLIC_INCLUDE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/*.h")
file(GLOB UTILS_SOURCE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Config/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Crypt/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Database/*.cpp"
@ -13,23 +17,24 @@ file(GLOB UTILS_SOURCE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/Network/PacketDef/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Script/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Util/*.cpp")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_library(Common ${UTILS_PUBLIC_INCLUDE_FILES} ${UTILS_SOURCE_FILES})
add_library(common ${UTILS_PUBLIC_INCLUDE_FILES} ${UTILS_SOURCE_FILES})
set_target_properties(Common PROPERTIES
set_target_properties(common PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ON
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/"
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/"
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/"
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/"
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/../../bin/"
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/../../bin/"
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_CURRENT_SOURCE_DIR}/../../bin/"
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_CURRENT_SOURCE_DIR}/../../bin/"
)
if (UNIX)
target_link_libraries( Common xivdat mysqlclient mysqlConnector )
target_link_libraries( common xivdat mysqlclient mysqlConnector )
else()
target_link_libraries( Common xivdat mysqlConnector libmysql )
target_link_libraries( common xivdat mysqlConnector libmysql )
endif()

View file

@ -1,7 +1,6 @@
#ifndef _COMMON_H
#define _COMMON_H
#include <stdint.h>
#include <cstdint>
#include <vector>

View file

@ -1,3 +1,5 @@
#ifndef _BLOWFISH_H
#define _BLOWFISH_H
// blowfish.h interface file for blowfish.cpp
// _THE BLOWFISH ENCRYPTION ALGORITHM_
// by Bruce Schneier
@ -7,7 +9,7 @@
#define MAXKEYBYTES 56 // 448 bits max
#define NPASS 16 // SBox passes
#define DWORD uint32_t
#define DWORD uint32_t
#define WORD unsigned short
#define BYTE uint8_t
@ -70,3 +72,4 @@ public:
} w;
};
#endif
#endif

View file

@ -1,7 +1,6 @@
#include <stdint.h>
#ifndef _MD52_H
#define _MD52_H
#include <stdint.h>
namespace Core
{

View file

@ -0,0 +1,12 @@
#ifndef _DATABASEDEF_H
#define _DATABASEDEF_H
#include "src/libraries/sapphire/mysqlConnector/MySqlConnector.h"
#include <common/Database/DbLoader.h>
#include <common/Database/CharaDbConnection.h>
#include <common/Database/DbWorkerPool.h>
#include <common/Database/PreparedStatement.h>
extern Core::Db::DbWorkerPool< Core::Db::CharaDbConnection > g_charaDb;
#endif

View file

@ -2,7 +2,7 @@
#include "DbWorker.h"
#include "src/libraries/sapphire/mysqlConnector/MySqlConnector.h"
#include "src/servers/Server_Common/Logging/Logger.h"
#include <common/Logging/Logger.h>
#include "PreparedStatement.h"
#include <boost/make_shared.hpp>

View file

@ -6,8 +6,7 @@
#include <mutex>
#include <string>
#include <vector>
#include "src/servers/Server_Common/Util/LockedWaitQueue.h"
#include <Server_Common/Util/LockedWaitQueue.h>
#include <common/Util/LockedWaitQueue.h>
#include <boost/scoped_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>

View file

@ -2,7 +2,7 @@
#include <mysqld_error.h>
#include "CharaDbConnection.h"
#include "DbWorkerPool.h"
#include "src/servers/Server_Common/Logging/Logger.h"
#include <common/Logging/Logger.h>
extern Core::Logger g_log;

View file

@ -1,6 +1,6 @@
#include "DbWorker.h"
#include "Operation.h"
#include <Server_Common/Util/LockedWaitQueue.h>
#include <common/Util/LockedWaitQueue.h>
Core::Db::DbWorker::DbWorker( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* newQueue, DbConnection* pConn )
{

View file

@ -3,7 +3,7 @@
#include <atomic>
#include <thread>
#include <Server_Common/Util/LockedWaitQueue.h>
#include <common/Util/LockedWaitQueue.h>
#include <boost/shared_ptr.hpp>
namespace Core

View file

@ -7,7 +7,7 @@
#include "CharaDbConnection.h"
#include <boost/make_shared.hpp>
#include <Server_Common/Logging/Logger.h>
#include <common/Logging/Logger.h>
extern Core::Logger g_log;
class PingOperation : public Core::Db::Operation
@ -273,4 +273,4 @@ void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction& trans, PreparedState
}
*/
template class Core::Db::DbWorkerPool< Core::Db::CharaDbConnection >;
template class Core::Db::DbWorkerPool< Core::Db::CharaDbConnection >;

View file

@ -5,7 +5,7 @@
#include <string>
#include <vector>
#include <ResultSet.h>
#include <Server_Common/Util/LockedWaitQueue.h>
#include <common/Util/LockedWaitQueue.h>
#include "DbConnection.h"
namespace Core
{

View file

@ -1,6 +1,6 @@
#include "src/servers/Server_Common/Network/Hive.h"
#include <common/Network/Hive.h>
#include "Acceptor.h"
#include "src/servers/Server_Common/Network/Connection.h"
#include <common/Network/Connection.h>
#include <boost/interprocess/detail/atomic.hpp>
#include <boost/bind.hpp>
@ -127,4 +127,4 @@ namespace Core
}
}
}
}

View file

@ -5,7 +5,7 @@
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/shared_ptr.hpp>
#include "src/servers/Server_Common/Forwards.h"
#include <common/Forwards.h>
namespace Core
{
@ -75,4 +75,4 @@ namespace Core
}
}
#endif
#endif

View file

@ -9,7 +9,7 @@
#include <list>
#include <boost/cstdint.hpp>
#include "src/servers/Server_Common/Forwards.h"
#include <common/Forwards.h>
#include "Acceptor.h"
@ -141,4 +141,4 @@ namespace Core {
}
#endif
#endif

View file

@ -5,7 +5,7 @@
#include <time.h>
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#include "Server_Common/Util/Util.h"
#include <common/Util/Util.h>
Core::Network::Packets::GamePacket::GamePacket( uint16_t subType, uint16_t size, uint32_t id1, uint32_t id2, uint16_t type )
{

View file

@ -2,7 +2,7 @@
#define _GAMEPACKET_H_
#include "CommonNetwork.h"
#include "src/servers/Server_Common/Forwards.h"
#include <common/Forwards.h>
#include <stdint.h>
#include <string.h>

View file

@ -1,6 +1,6 @@
#include "PacketContainer.h"
#include "GamePacket.h"
#include "src/servers/Server_Common/Common.h"
#include <common/Common.h>
#include <boost/format.hpp>

View file

@ -3,7 +3,7 @@
#include <vector>
#include "src/servers/Server_Common/Common.h"
#include <common/Common.h>
#include "CommonNetwork.h"
#include "GamePacket.h"

View file

@ -1,8 +1,8 @@
#ifndef _CORE_NETWORK_PACKETS_CHAT_SERVER_IPC_H
#define _CORE_NETWORK_PACKETS_CHAT_SERVER_IPC_H
#include "src/servers/Server_Common/Common.h"
#include "src/servers/Server_Common/Network/CommonNetwork.h"
#include <common/Common.h>
#include <common/Network/CommonNetwork.h>
namespace Core {
namespace Network {

View file

@ -107,7 +107,7 @@ namespace Packets {
EventLinkshell = 0x1169,
QuestMessage = 0x0179,
QuestMessage = 0x0188, // updated 4.1
QuestActiveList = 0x017D, // updated 4.1
QuestUpdate = 0x017E, // updated 4.1
QuestCompleteList = 0x017F, // updated 4.1

View file

@ -1,8 +1,8 @@
#ifndef _CORE_NETWORK_PACKETS_LOBBY_SERVER_IPC_H
#define _CORE_NETWORK_PACKETS_LOBBY_SERVER_IPC_H
#include "src/servers/Server_Common/Common.h"
#include "src/servers/Server_Common/Network/CommonNetwork.h"
#include <common/Common.h>
#include <common/Network/CommonNetwork.h>
namespace Core {
namespace Network {
@ -140,4 +140,4 @@ struct FFXIVIpcLobbyError : FFXIVIpcBasePacket<LobbyError>
}
}
}
#endif
#endif

View file

@ -7,8 +7,8 @@
#ifndef _CORE_NETWORK_PACKETS_ZONE_SERVER_IPC_H
#define _CORE_NETWORK_PACKETS_ZONE_SERVER_IPC_H
#include "src/servers/Server_Common/Common.h"
#include "src/servers/Server_Common/Network/CommonNetwork.h"
#include <common/Common.h>
#include <common/Network/CommonNetwork.h>
namespace Core {
namespace Network {
@ -486,71 +486,6 @@ struct FFXIVIpcNpcSpawn : FFXIVIpcBasePacket<NpcSpawn>
uint32_t unk30;
};
struct FFXIVIpcActorSpawn : FFXIVIpcBasePacket<ActorSpawn>
{
uint32_t unknown_0;
uint32_t nameId;
uint32_t bnpcBaseId;
uint32_t unknown_C[2];
uint32_t ownerId;
uint32_t unknown_E[2];
uint64_t targetId;
uint32_t fateId;
uint8_t gmRank;
uint8_t spawnIndex;
uint8_t status; /** 1 = alive, 2 = dead, 3 = use pose*/
uint8_t pose; /** sitting, dancing, etc */
uint8_t mobAgressive; /** 0 passive, 2 agressive */
uint8_t mobTypeIcon; /** normal, nm, etc */
uint8_t type; /** 0 = nothing, 1 = player, 2 = npc*/
uint8_t unknown_33;
uint32_t unknown_34;
uint8_t voice;
uint8_t scale;
uint8_t v1;
uint8_t v2;
uint32_t unknown_38_1;
int32_t unknown_89;
int32_t unknown_90;
uint64_t mainWeaponModel;
uint64_t secWeaponModel;
uint64_t craftToolModel;
uint16_t rotation;
uint16_t model; /** 0 if look array is being used */
uint16_t title;
uint8_t typeFlags; /** has something to do with type 4 for mobs */
uint8_t minion;
uint8_t unknown_60; /** for players 01 */
uint8_t unknown_61; /** for players 09 */
uint8_t level;
uint8_t classJob;
uint32_t hPCurr;
uint16_t mPCurr;
uint16_t tPCurr;
uint32_t hPMax;
uint16_t mPMax;
uint16_t tPMax;
Common::OnlineStatus statusIcon;
uint8_t unknown_B0[17];
uint8_t persistantPose;
uint8_t unknown_C0;
uint32_t displayFlags;
Common::StatusEffect effect[30];
uint8_t currentMount;
uint8_t mountHead;
uint8_t mountBody;
uint8_t mountFeet;
uint32_t mountColor;
uint32_t unknown_236;
char name[32];
uint8_t look[28];
uint32_t models[10];
Common::FFXIVARR_POSITION3 pos;
char fcTag[6];
uint8_t unknown_250[10];
};
/**
* Structural representation of the packet sent by the server
* to show player movement
@ -1136,8 +1071,8 @@ struct FFXIVIpcQuestActiveList : FFXIVIpcBasePacket<QuestActiveList>
*/
struct FFXIVIpcQuestUpdate : FFXIVIpcBasePacket<QuestUpdate>
{
/* 0000 */ uint8_t slot;
/* 0001 */ uint8_t padding[3];
uint16_t slot;
uint16_t padding;
Common::QuestActive questInfo;
};

View file

@ -1,7 +1,7 @@
#ifndef _UTILMATH_H
#define _UTILMATH_H
#include "src/servers/Server_Common/Common.h"
#include <common/Common.h>
#define PI 3.14159265358979323846f

10
src/common/Version.cpp Normal file
View file

@ -0,0 +1,10 @@
#include "Version.h"
namespace Core {
namespace Version {
const std::string GIT_HASH = "d799f2e3c2d745f9d9e07d6e37664fc031b7c264";
const std::string VERSION = "-128-NOTFOUND";
} /* Version */
} /* Core */

View file

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.6)
project (Sapphire_root)
project (Sapphire)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
@ -9,7 +9,6 @@ set(PROJECT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
include_directories("${PROJECT_INCLUDE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}")
add_subdirectory(${PROJECT_SOURCE_DIR}/Server_Common)
add_subdirectory(${PROJECT_SOURCE_DIR}/Server_Lobby)
add_subdirectory(${PROJECT_SOURCE_DIR}/Server_REST)
add_subdirectory(${PROJECT_SOURCE_DIR}/Server_Zone)
add_subdirectory(${PROJECT_SOURCE_DIR}/sapphire_lobby)
add_subdirectory(${PROJECT_SOURCE_DIR}/sapphire_api)
add_subdirectory(${PROJECT_SOURCE_DIR}/sapphire_zone)

View file

@ -1,12 +0,0 @@
#ifndef _DATABASEDEF_H
#define _DATABASEDEF_H
#include "src/libraries/sapphire/mysqlConnector/MySqlConnector.h"
#include <Server_Common/Database/DbLoader.h>
#include <Server_Common/Database/CharaDbConnection.h>
#include <Server_Common/Database/DbWorkerPool.h>
#include <Server_Common/Database/PreparedStatement.h>
extern Core::Db::DbWorkerPool< Core::Db::CharaDbConnection > g_charaDb;
#endif

View file

@ -1,91 +0,0 @@
#ifndef _ACTORSPAWN_H
#define _ACTORSPAWN_H
#include <Server_Common/Network/GamePacketNew.h>
#include <Server_Common/Util/UtilMath.h>
#include "Actor/Player.h"
#include "Forwards.h"
namespace Core {
namespace Network {
namespace Packets {
namespace Server {
/**
* @brief The packet sent to spawn an actor.
*/
class ActorSpawnPacket :
public GamePacketNew< FFXIVIpcActorSpawn, ServerZoneIpcType >
{
public:
ActorSpawnPacket( Entity::PlayerPtr pPlayer, Entity::PlayerPtr pTarget ) :
GamePacketNew< FFXIVIpcActorSpawn, ServerZoneIpcType >( pPlayer->getId(), pTarget->getId() )
{
initialize( pPlayer, pTarget );
};
private:
void initialize( Entity::PlayerPtr pPlayer, Entity::PlayerPtr pTarget )
{
// TODO: temporary gm rank
m_data.gmRank = 0xff;
m_data.classJob = static_cast< uint8_t >( pPlayer->getClass() );
m_data.status = static_cast< uint8_t >( pPlayer->getStatus() );
m_data.hPCurr = pPlayer->getHp();
m_data.mPCurr = pPlayer->getMp();
m_data.tPCurr = pPlayer->getTp();
m_data.hPMax = pPlayer->getMaxHp();
m_data.mPMax = pPlayer->getMaxMp();
m_data.tPMax = 3000;
m_data.level = pPlayer->getLevel();
memcpy( m_data.look, pPlayer->getLookArray(), 26 );
m_data.mainWeaponModel = pPlayer->getModelMainWeapon();
m_data.secWeaponModel = pPlayer->getModelSubWeapon();
m_data.models[0] = pPlayer->getModelForSlot( Inventory::EquipSlot::Head );
m_data.models[1] = pPlayer->getModelForSlot( Inventory::EquipSlot::Body );
m_data.models[2] = pPlayer->getModelForSlot( Inventory::EquipSlot::Hands );
m_data.models[3] = pPlayer->getModelForSlot( Inventory::EquipSlot::Legs );
m_data.models[4] = pPlayer->getModelForSlot( Inventory::EquipSlot::Feet );
strcpy( m_data.name, pPlayer->getName().c_str() );
m_data.pos.x = pPlayer->getPos().x;
m_data.pos.y = pPlayer->getPos().y;
m_data.pos.z = pPlayer->getPos().z;
m_data.voice = pPlayer->getVoiceId();
m_data.rotation = Math::Util::floatToUInt16Rot( pPlayer->getRotation() );
m_data.statusIcon = pPlayer->getOnlineStatus();
if( pTarget == pPlayer )
{
m_data.spawnIndex = 0x00;
}
else
{
m_data.spawnIndex = pTarget->getSpawnIdForActorId( pPlayer->getId() );
}
// 0x20 == spawn hidden to be displayed by the spawneffect control
m_data.displayFlags = pPlayer->getStance();
if( pPlayer->getZoningType() != Common::ZoneingType::None )
{
m_data.displayFlags |= 0x20;
}
m_data.targetId = pPlayer->getTargetId();
m_data.type = 1;
m_data.unknown_33 = 4;
//m_data.unknown_38 = 0x70;
//m_data.unknown_60 = 3;
//m_data.unknown_61 = 7;
};
};
}
}
}
}
#endif /*_ACTORSPAWN_H*/

View file

@ -6,10 +6,10 @@ file(GLOB SERVER_PUBLIC_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*")
file(GLOB SERVER_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}*.c*")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/")
add_executable(server_rest ${SERVER_PUBLIC_INCLUDE_FILES} ${SERVER_SOURCE_FILES})
add_dependencies(server_rest Common xivdat)
add_executable(sapphire_api ${SERVER_PUBLIC_INCLUDE_FILES} ${SERVER_SOURCE_FILES})
add_dependencies(sapphire_api common xivdat)
set_target_properties(server_rest PROPERTIES
set_target_properties(sapphire_api PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ON
@ -21,13 +21,13 @@ set_target_properties(server_rest PROPERTIES
)
if (UNIX)
target_link_libraries (server_rest Common xivdat pthread mysqlclient mysqlConnector dl z)
target_link_libraries (sapphire_api common xivdat pthread mysqlclient mysqlConnector dl z)
else()
# ignore unchecked iterators warnings from msvc
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
target_link_libraries (server_rest Common xivdat libmysql mysqlConnector zlib1)
target_link_libraries (sapphire_api common xivdat libmysql mysqlConnector zlib1)
endif()
target_link_libraries( server_rest ${Boost_LIBRARIES} ${Boost_LIBRARIES} )
target_link_libraries( sapphire_api ${Boost_LIBRARIES} ${Boost_LIBRARIES} )

View file

@ -1,10 +1,10 @@
#include "PlayerMinimal.h"
#include <Server_Common/Util/Util.h>
#include <Server_Common/Common.h>
#include <Server_Common/Exd/ExdData.h>
#include <common/Util/Util.h>
#include <common/Common.h>
#include <common/Exd/ExdData.h>
#include <Server_Common/Database/DatabaseDef.h>
#include <common/Database/DatabaseDef.h>
extern Core::Data::ExdData g_exdData;

View file

@ -1,5 +1,5 @@
#include "SapphireAPI.h"
#include <src/servers/Server_Common/Crypt/base64.h>
#include <common/Crypt/base64.h>
#include "Session.h"
#include "PlayerMinimal.h"
#include <time.h>
@ -11,7 +11,7 @@
#include <boost/foreach.hpp>
#include <boost/shared_ptr.hpp>
#include <Server_Common/Database/DatabaseDef.h>
#include <common/Database/DatabaseDef.h>
#include <boost/make_shared.hpp>
Core::Network::SapphireAPI::SapphireAPI()

View file

@ -6,21 +6,20 @@
#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <src/servers/Server_Common/Logging/Logger.h>
#include <src/servers/Server_Common/Config/XMLConfig.h>
#include <common/Logging/Logger.h>
#include <common/Config/XMLConfig.h>
#include <src/servers/Server_Common/Network/Connection.h>
#include <src/servers/Server_Common/Network/Hive.h>
#include <src/servers/Server_Common/Network/Acceptor.h>
#include <common/Network/Connection.h>
#include <common/Network/Hive.h>
#include <common/Network/Acceptor.h>
#include <src/servers/Server_Common/Exd/ExdData.h>
#include <src/servers/Server_Common/Crypt/base64.h>
#include <common/Exd/ExdData.h>
#include <common/Crypt/base64.h>
#include <Server_Common/Database/DbLoader.h>
#include <Server_Common/Database/CharaDbConnection.h>
#include <Server_Common/Database/DbWorkerPool.h>
#include <Server_Common/Database/PreparedStatement.h>
#include <common/Database/DbLoader.h>
#include <common/Database/CharaDbConnection.h>
#include <common/Database/DbWorkerPool.h>
#include <common/Database/PreparedStatement.h>
//Added for the default_resource example
#include <fstream>

View file

@ -7,10 +7,10 @@ file(GLOB SERVER_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}*.c*")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/")
add_executable(server_lobby ${SERVER_PUBLIC_INCLUDE_FILES} ${SERVER_SOURCE_FILES})
add_dependencies(server_lobby Common xivdat)
add_executable(sapphire_lobby ${SERVER_PUBLIC_INCLUDE_FILES} ${SERVER_SOURCE_FILES})
add_dependencies(sapphire_lobby common xivdat)
set_target_properties(server_lobby PROPERTIES
set_target_properties(sapphire_lobby PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ON
@ -22,9 +22,9 @@ set_target_properties(server_lobby PROPERTIES
)
if (UNIX)
target_link_libraries(server_lobby Common xivdat pthread mysqlclient mysqlConnector dl z)
target_link_libraries(sapphire_lobby common xivdat pthread mysqlclient mysqlConnector dl z)
else()
target_link_libraries(server_lobby Common xivdat libmysql mysqlConnector zlib1)
target_link_libraries(sapphire_lobby common xivdat libmysql mysqlConnector zlib1)
endif()
target_link_libraries(server_lobby ${Boost_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries(sapphire_lobby ${Boost_LIBRARIES} ${Boost_LIBRARIES})

View file

@ -1,29 +1,21 @@
#include <src/servers/Server_Common/Common.h>
#include <src/servers/Server_Common/Network/CommonNetwork.h>
#include <src/servers/Server_Common/Util/Util.h>
#include <src/servers/Server_Common/Logging/Logger.h>
#include <src/servers/Server_Common/Network/GamePacket.h>
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Network/PacketDef/Lobby/ServerLobbyDef.h>
#include "Server_Common/Network/GamePacketParser.h"
#include <src/servers/Server_Common/Crypt/md5.h>
#include <boost/format.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/foreach.hpp>
#include "GameConnection.h"
#include "ServerLobby.h"
#include "LobbyPacketContainer.h"
#include <common/Common.h>
#include <common/Network/CommonNetwork.h>
#include <common/Util/Util.h>
#include <common/Logging/Logger.h>
#include <common/Network/GamePacket.h>
#include <common/Network/GamePacketNew.h>
#include <common/Network/PacketDef/Lobby/ServerLobbyDef.h>
#include <common/Network/GamePacketParser.h>
#include <common/Crypt/md5.h>
#include <common/Crypt/blowfish.h>
#include <boost/property_tree/json_parser.hpp>
#include "ServerLobby.h"
#include "RestConnector.h"
#include "LobbySession.h"
#include "Forwards.h"
#include "src/servers/Server_Common/Crypt/blowfish.h"
extern Core::Logger g_log;
extern Core::ServerLobby g_serverLobby;

View file

@ -1,17 +1,16 @@
#ifndef GAMECONNECTION_H
#define GAMECONNECTION_H
#include <src/servers/Server_Common/Network/Connection.h>
#include <src/servers/Server_Common/Network/Acceptor.h>
#include <src/servers/Server_Common/Network/CommonNetwork.h>
#include <common/Network/Connection.h>
#include <common/Network/Acceptor.h>
#include <common/Network/CommonNetwork.h>
#include <common/Network/GamePacket.h>
#include <common/Network/PacketContainer.h>
#include <common/Util/LockedQueue.h>
#include <src/servers/Server_Common/Network/GamePacket.h>
#include <src/servers/Server_Common/Network/PacketContainer.h>
#include "LobbyPacketContainer.h"
#include <src/servers/Server_Common/Util/LockedQueue.h>
#include "Forwards.h"
#define DECLARE_HANDLER( x ) void x( Packets::GamePacketPtr pInPacket, Entity::PlayerPtr pPlayer )
@ -84,4 +83,4 @@ public:
}
#endif
#endif

View file

@ -1,7 +1,7 @@
#include "LobbyPacketContainer.h"
#include <src/servers/Server_Common/Network/GamePacket.h>
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Crypt/blowfish.h>
#include <common/Network/GamePacket.h>
#include <common/Network/GamePacketNew.h>
#include <common/Crypt/blowfish.h>
namespace Core {
namespace Network {

View file

@ -4,8 +4,8 @@
#include <vector>
#include <string.h>
#include <src/servers/Server_Common/Network/CommonNetwork.h>
#include <src/servers/Server_Common/Util/Util.h>
#include <common/Network/CommonNetwork.h>
#include <common/Util/Util.h>
#include "Forwards.h"

View file

@ -1,8 +1,8 @@
#include "RestConnector.h"
#include "LobbySession.h"
#include "ServerLobby.h"
#include <src/servers/Server_Common/Logging/Logger.h>
#include <src/servers/Server_Common/Crypt/base64.h>
#include <common/Logging/Logger.h>
#include <common/Crypt/base64.h>
#include <time.h>
#include <iomanip>

View file

@ -3,12 +3,12 @@
#include <time.h>
#include <map>
#include <src/servers/Server_Common/Network/Hive.h>
#include <src/servers/Server_Common/Network/Acceptor.h>
#include <common/Network/Hive.h>
#include <common/Network/Acceptor.h>
#include <src/servers/Server_Common/Version.h>
#include <src/servers/Server_Common/Logging/Logger.h>
#include <src/servers/Server_Common/Config/XMLConfig.h>
#include <common/Version.h>
#include <common/Logging/Logger.h>
#include <common/Config/XMLConfig.h>
//#include "LobbySession.h"

View file

@ -6,7 +6,7 @@
#include <map>
#include <boost/shared_ptr.hpp>
#include <src/servers/Server_Common/Config/XMLConfig.h>
#include <common/Config/XMLConfig.h>
#include "Forwards.h"

View file

@ -1,6 +1,6 @@
#include "Action.h"
#include <Server_Common/Util/Util.h>
#include <common/Util/Util.h>
Core::Action::Action::Action()

View file

@ -1,10 +1,11 @@
#ifndef _ACTION_H_
#define _ACTION_H_
#include <Server_Common/Common.h>
#include <common/Common.h>
#include "../Forwards.h"
namespace Core { namespace Action {
namespace Core {
namespace Action {
class Action
{

View file

@ -1,10 +1,10 @@
#include "ActionCast.h"
#include <Server_Common/Common.h>
#include <Server_Common/Util/Util.h>
#include <Server_Common/Util/UtilMath.h>
#include <Server_Common/Exd/ExdData.h>
#include <Server_Common/Logging/Logger.h>
#include <common/Common.h>
#include <common/Util/Util.h>
#include <common/Util/UtilMath.h>
#include <common/Exd/ExdData.h>
#include <common/Logging/Logger.h>
#include "Network/PacketWrappers/ActorControlPacket142.h"
#include "Network/PacketWrappers/ActorControlPacket143.h"

View file

@ -1,6 +1,6 @@
#include <Server_Common/Util/Util.h>
#include <Server_Common/Exd/ExdData.h>
#include <Server_Common/Util/UtilMath.h>
#include <common/Util/Util.h>
#include <common/Exd/ExdData.h>
#include <common/Util/UtilMath.h>
#include "ActionCollision.h"
#include "Actor/Actor.h"

Some files were not shown because too many files have changed in this diff Show more