1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-30 08:07:46 +00:00

Merge branch 'master' of https://github.com/DantestyleXD/Sapphire into Gridania_subquests

This commit is contained in:
Dantestyle 2018-06-11 22:04:40 +02:00
commit 5a1812773d
45 changed files with 440 additions and 555 deletions

View file

@ -17,25 +17,7 @@ Sapphire requires the following software:
| 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 |
**Windows** Please check the [wiki](https://github.com/SapphireMordred/Sapphire/wiki) for detailed installation/build instructions for your OS.
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.
Visual Studio 2017 users: open `Visual Studio Installer` and ensure `Individual Components > SDKs, libraries, and frameworks > Windows Universal C Runtime` is installed. You may also need to install `Individual Components > Compilers, build tools, and runtimes > VC++ 2015.3 v140 toolset for desktop (x86, 64)`.
To enable [Edit and Continue](https://msdn.microsoft.com/en-us/library/esaeyddf.aspx) ensure you define `-DCMAKE_BUILD_TYPE="Debug"` when generating with CMake.
If you installed CMake outside of Visual Studio and have it in your `PATH` environment variable, navigate to Sapphire folder and `cmake -DCMAKE_BUILD_TYPE="Debug" && cmake --build .`.
Otherwise:
* In *Visual Studio 2017*: Open the project via ``File`` > ``Open`` > ``Folder`` and wait, till CMake automatically finishes cache generation. Right click any CMakeLists.txt and select build to build a application.
To configure debug startup parameters, select ``Debug and Launch settings``, the application you want to set up parameters for, and add a ``args`` json array containing your launch parameters in ``configurations``.
If Visual Studio fails to generate a CMake Cache or does not show options to build, make sure that the newest version of it is installed and all environment variables are set correctly. Keep in mind that generating a cache can take a while on some machines.
The solution `Sapphire.sln` is also generated in the main Sapphire folder.
**Linux**
`cmake . -DSAPPHIRE_BOOST_VER="your.boost.ver" && make -j JOBS` where `JOBS` is number of cores on your system.
`-j JOBS` can be omitted if your system lacks resources (spoiler: your system probably lacks resources if running on 1GB RAM or lower, or if the build fails due to being out of memory)
## Links ## Links

View file

@ -553,6 +553,7 @@ namespace Common {
AetherReductionDlg = 0x17D, AetherReductionDlg = 0x17D,
Unk6 = 0x19C, Unk6 = 0x19C,
EObjAnimation = 0x19D,
SetTitle = 0x1F4, SetTitle = 0x1F4,
@ -562,6 +563,7 @@ namespace Common {
SetFavorite = 0x1FC, SetFavorite = 0x1FC,
LearnTeleport = 0x1FD, LearnTeleport = 0x1FD,
OpenRecommendationGuide = 0x200,
ArmoryErrorMsg = 0x201, ArmoryErrorMsg = 0x201,
AchievementPopup = 0x203, AchievementPopup = 0x203,

View file

@ -1,6 +1,3 @@
/**
* Structural definitions common to all FFXIV:ARR packets.
*/
#ifndef _CORE_NETWORK_PACKETS_COMMON_H #ifndef _CORE_NETWORK_PACKETS_COMMON_H
#define _CORE_NETWORK_PACKETS_COMMON_H #define _CORE_NETWORK_PACKETS_COMMON_H
@ -25,7 +22,7 @@ namespace Packets {
* *
* std::stringstream buf; * std::stringstream buf;
* buf << pkt_hdr; * buf << pkt_hdr;
* for (int i = 0; i < n; i++) * for( int i = 0; i < n; i++ )
* { * {
* buf << pkt_seg_hdr[i]; * buf << pkt_seg_hdr[i];
* buf << {pkt_seg_data[i]}; * buf << {pkt_seg_data[i]};
@ -46,6 +43,8 @@ namespace Packets {
* *
* 0 4 8 12 14 16 * 0 4 8 12 14 16
* +-------------------------------+---------------+-------+-------+ * +-------------------------------+---------------+-------+-------+
* | unknown_0 | unknown_8 |
* +-------------------------------+---------------+-------+-------+
* | timestamp | size | cType | count | * | timestamp | size | cType | count |
* +---+---+-------+---------------+---------------+-------+-------+ * +---+---+-------+---------------+---------------+-------+-------+
* | ? |CMP| ? | ? | * | ? |CMP| ? | ? |
@ -54,13 +53,10 @@ namespace Packets {
*/ */
struct FFXIVARR_PACKET_HEADER struct FFXIVARR_PACKET_HEADER
{ {
/** Unknown data, no actual use has been determined */
uint64_t unknown_0; uint64_t unknown_0;
uint64_t unknown_8; uint64_t unknown_8;
/** /** Represents the number of milliseconds since epoch that the packet was sent. */
* Represents the number of milliseconds since epoch that the packet was
* sent.
*/
uint64_t timestamp; uint64_t timestamp;
/** The size of the packet header and its payload */ /** The size of the packet header and its payload */
uint32_t size; uint32_t size;
@ -74,14 +70,14 @@ struct FFXIVARR_PACKET_HEADER
uint32_t unknown_24; uint32_t unknown_24;
}; };
inline ostream& operator<<(ostream& os, const FFXIVARR_PACKET_HEADER& hdr) inline ostream& operator << ( ostream& os, const FFXIVARR_PACKET_HEADER& hdr )
{ {
return os.write(reinterpret_cast<const char*>(&hdr), sizeof hdr); return os.write( reinterpret_cast< const char* >( &hdr ), sizeof hdr );
} }
inline istream& operator>>(istream& is, FFXIVARR_PACKET_HEADER& hdr) inline istream& operator >> ( istream& is, FFXIVARR_PACKET_HEADER& hdr )
{ {
return is.read(reinterpret_cast<char*>(&hdr), sizeof hdr); return is.read( reinterpret_cast< char* >( &hdr ), sizeof hdr );
} }
/** /**
@ -92,7 +88,7 @@ inline istream& operator>>(istream& is, FFXIVARR_PACKET_HEADER& hdr)
* *
* 0 4 8 12 16 * 0 4 8 12 16
* +---------------+---------------+---------------+-------+-------+ * +---------------+---------------+---------------+-------+-------+
* | size | source_actor | target_actor | type | ? | * | size | source_actor | target_actor | type | pad |
* +---------------+---------------+---------------+-------+-------+ * +---------------+---------------+---------------+-------+-------+
* | | * | |
* : type-specific data of length, size, follows : * : type-specific data of length, size, follows :
@ -109,22 +105,20 @@ struct FFXIVARR_PACKET_SEGMENT_HEADER
uint32_t target_actor; uint32_t target_actor;
/** The segment type. (1, 2, 3, 7, 8, 9, 10) */ /** The segment type. (1, 2, 3, 7, 8, 9, 10) */
uint16_t type; uint16_t type;
uint16_t _reserved_E; uint16_t padding;
}; };
inline ostream& operator<<(ostream& os, const FFXIVARR_PACKET_SEGMENT_HEADER& hdr) inline ostream& operator << ( ostream& os, const FFXIVARR_PACKET_SEGMENT_HEADER& hdr )
{ {
return os.write(reinterpret_cast<const char*>(&hdr), sizeof hdr); return os.write( reinterpret_cast< const char* >( &hdr ), sizeof hdr );
} }
inline istream& operator>>(istream& is, FFXIVARR_PACKET_SEGMENT_HEADER& hdr) inline istream& operator >> ( istream& is, FFXIVARR_PACKET_SEGMENT_HEADER& hdr )
{ {
return is.read(reinterpret_cast<char*>(&hdr), sizeof hdr); return is.read( reinterpret_cast< char* >( &hdr ), sizeof hdr );
} }
// TODO: Include structures for the individual packet segment types template < int T > struct FFXIVIpcBasePacket
template <int T> struct FFXIVIpcBasePacket
{ {
/** Creates a constant representing the IPC type */ /** Creates a constant representing the IPC type */
enum { _ServerIpcType = T }; enum { _ServerIpcType = T };
@ -133,7 +127,7 @@ template <int T> struct FFXIVIpcBasePacket
struct FFXIVARR_PACKET_RAW struct FFXIVARR_PACKET_RAW
{ {
FFXIVARR_PACKET_SEGMENT_HEADER segHdr; FFXIVARR_PACKET_SEGMENT_HEADER segHdr;
std::vector<uint8_t> data; std::vector< uint8_t > data;
}; };
/** /**
@ -142,7 +136,7 @@ struct FFXIVARR_PACKET_RAW
* *
* 0 4 6 8 12 16 * 0 4 6 8 12 16
* +-------+-------+------+----------+---------------+---------------+ * +-------+-------+------+----------+---------------+---------------+
* | 14 00 | type | ?? | serverId | timestamp | ??? | * | 14 00 | type | pad | serverId | timestamp | pad1 |
* +-------+-------+------+----------+---------------+---------------+ * +-------+-------+------+----------+---------------+---------------+
* | | * | |
* : data : * : data :
@ -153,24 +147,22 @@ struct FFXIVARR_IPC_HEADER
{ {
uint16_t reserved; uint16_t reserved;
uint16_t type; uint16_t type;
uint16_t unknown_2; uint16_t padding;
uint16_t serverId; uint16_t serverId;
uint32_t timestamp; uint32_t timestamp;
uint32_t unknown_C; uint32_t padding1;
}; };
inline ostream& operator<<(ostream& os, const FFXIVARR_IPC_HEADER& hdr) inline ostream& operator << ( ostream& os, const FFXIVARR_IPC_HEADER& hdr )
{ {
return os.write(reinterpret_cast<const char*>(&hdr), sizeof hdr); return os.write( reinterpret_cast< const char* >( &hdr ), sizeof hdr );
} }
inline istream& operator>>(istream& is, FFXIVARR_IPC_HEADER& hdr) inline istream& operator >> ( istream& is, FFXIVARR_IPC_HEADER& hdr )
{ {
return is.read(reinterpret_cast<char*>(&hdr), sizeof hdr); return is.read( reinterpret_cast< char* >( &hdr ), sizeof hdr );
} }
} /* Packets */ } /* Packets */
} /* Network */ } /* Network */
} /* Core */ } /* Core */

View file

@ -7,23 +7,24 @@
#include <boost/format.hpp> #include <boost/format.hpp>
#include "Util/Util.h" #include "Util/Util.h"
Core::Network::Packets::GamePacket::GamePacket( uint16_t subType, uint16_t size, uint32_t id1, uint32_t id2, uint16_t type ) Core::Network::Packets::GamePacket::GamePacket( uint16_t subType, uint16_t size,
uint32_t id1, uint32_t id2, uint16_t type )
{ {
m_dataBuf = std::vector<uint8_t>( size ); m_dataBuf = std::vector< uint8_t >( size );
memset( &m_segHdr, 0, sizeof( m_segHdr ) ); memset( &m_segHdr, 0, sizeof( m_segHdr ) );
setHeader( size, type, id1, id2, subType, 0x00 ); setHeader( size, type, id1, id2, subType, 0x00 );
} }
void Core::Network::Packets::GamePacket::setHeader( uint16_t size, uint16_t type, uint32_t id1, uint32_t id2, uint16_t subType, uint32_t unknown ) void Core::Network::Packets::GamePacket::setHeader( uint16_t size, uint16_t type, uint32_t id1,
uint32_t id2, uint16_t subType, uint32_t unknown )
{ {
m_segHdr.size = size; m_segHdr.size = size;
m_segHdr.type = type; m_segHdr.type = type;
m_segHdr.source_actor = id1; m_segHdr.source_actor = id1;
m_segHdr.target_actor = id2; m_segHdr.target_actor = id2;
m_segHdr._reserved_E = 0x00; //m_segHdr._reserved_E = 0x00;
m_subType = subType; m_subType = subType;
m_timeStamp = static_cast< uint32_t >( time( nullptr ) ); m_timeStamp = static_cast< uint32_t >( time( nullptr ) );
@ -40,7 +41,7 @@ void Core::Network::Packets::GamePacket::setHeader( uint16_t size, uint16_t type
Core::Network::Packets::GamePacket::GamePacket( char * pData, uint16_t size, bool bWriteStamp ) Core::Network::Packets::GamePacket::GamePacket( char * pData, uint16_t size, bool bWriteStamp )
{ {
m_dataBuf = std::vector<uint8_t>( size ); m_dataBuf = std::vector< uint8_t >( size );
memcpy( &m_dataBuf[0], pData, size ); memcpy( &m_dataBuf[0], pData, size );
m_unknown2 = 0; m_unknown2 = 0;
@ -65,9 +66,12 @@ Core::Network::Packets::GamePacket::GamePacket( const Packets::FFXIVARR_PACKET_R
{ {
m_segHdr = packetData.segHdr; m_segHdr = packetData.segHdr;
m_dataBuf = std::vector<uint8_t>( m_segHdr.size ); m_dataBuf = std::vector< uint8_t >( m_segHdr.size );
memcpy( &m_dataBuf[0] + sizeof( Packets::FFXIVARR_PACKET_SEGMENT_HEADER ),
&packetData.data[0],
m_segHdr.size - sizeof( Packets::FFXIVARR_PACKET_SEGMENT_HEADER ) );
memcpy( &m_dataBuf[0] + sizeof( Packets::FFXIVARR_PACKET_SEGMENT_HEADER ), &packetData.data[0], m_segHdr.size - sizeof( Packets::FFXIVARR_PACKET_SEGMENT_HEADER ) );
memcpy( &m_dataBuf[0], &m_segHdr, sizeof( Packets::FFXIVARR_PACKET_SEGMENT_HEADER ) ); memcpy( &m_dataBuf[0], &m_segHdr, sizeof( Packets::FFXIVARR_PACKET_SEGMENT_HEADER ) );
m_subType = *reinterpret_cast< uint16_t* >( &m_dataBuf[0] + 0x12 ); m_subType = *reinterpret_cast< uint16_t* >( &m_dataBuf[0] + 0x12 );
@ -88,7 +92,7 @@ Core::Network::Packets::GamePacket::~GamePacket()
void Core::Network::Packets::GamePacket::savePacket() void Core::Network::Packets::GamePacket::savePacket()
{ {
char filename[20]; char filename[20];
sprintf( filename, "dump_0x%x.dat", m_subType ); sprintf( filename, "dump_0x%x_%i.dat", m_subType, Util::getTimeMs() );
FILE * fp = nullptr; FILE * fp = nullptr;
fp = fopen( filename, "wb" ); fp = fopen( filename, "wb" );
fwrite( &m_dataBuf[0], 1, m_segHdr.size, fp ); fwrite( &m_dataBuf[0], 1, m_segHdr.size, fp );
@ -98,5 +102,5 @@ void Core::Network::Packets::GamePacket::savePacket()
std::string Core::Network::Packets::GamePacket::toString() const std::string Core::Network::Packets::GamePacket::toString() const
{ {
return Core::Util::binaryToHexDump( const_cast<uint8_t *>( &m_dataBuf[0] ), getSize() ); return Core::Util::binaryToHexDump( const_cast< uint8_t* >( &m_dataBuf[0] ), getSize() );
} }

View file

@ -16,11 +16,11 @@ namespace Packets {
// Must forward define these in order to enable the compiler to produce the // Must forward define these in order to enable the compiler to produce the
// correct template functions. // correct template functions.
template <typename T, typename T1> template < typename T, typename T1 >
class GamePacketNew; class GamePacketNew;
template <typename T, typename T1> template < typename T, typename T1 >
std::ostream& operator<< ( std::ostream& os, const GamePacketNew<T, T1>& packet ); std::ostream& operator << ( std::ostream& os, const GamePacketNew< T, T1 >& packet );
template< class T > template< class T >
using ZoneChannelPacket = GamePacketNew< T, ServerZoneIpcType >; using ZoneChannelPacket = GamePacketNew< T, ServerZoneIpcType >;
@ -31,16 +31,16 @@ using ChatChannelPacket = GamePacketNew< T, ServerChatIpcType >;
/** /**
* The base implementation of a game packet. Needed for parsing packets. * The base implementation of a game packet. Needed for parsing packets.
*/ */
template <typename T1> template < typename T1 >
class GamePacketNewBase class FFXIVIpcPacketBase
{ {
public: public:
virtual ~GamePacketNewBase() = default; virtual ~FFXIVIpcPacketBase() = default;
/** /**
* @brief Gets the IPC type of this packet. (Useful for determining the * @brief Gets the IPC type of this packet. (Useful for determining the
* type of a parsed packet.) * type of a parsed packet.)
*/ */
virtual T1 ipcType( void ) = 0; virtual T1 ipcType() = 0;
}; };
/** /**
@ -49,8 +49,8 @@ public:
* type that represents just the IPC data portion (the bytes after the initial * type that represents just the IPC data portion (the bytes after the initial
* 32 byte header information.) * 32 byte header information.)
*/ */
template <typename T, typename T1> template < typename T, typename T1 >
class GamePacketNew : public GamePacketNewBase<T1> class GamePacketNew : public FFXIVIpcPacketBase< T1 >
{ {
public: public:
/** /**
@ -58,7 +58,7 @@ public:
* @param sourceActorId The source actor id. * @param sourceActorId The source actor id.
* @param targetActorId The target actor id. * @param targetActorId The target actor id.
*/ */
GamePacketNew<T, T1>( uint32_t sourceActorId, uint32_t targetActorId ) GamePacketNew< T, T1 >( uint32_t sourceActorId, uint32_t targetActorId )
{ {
initialize(); initialize();
m_segHdr.source_actor = sourceActorId; m_segHdr.source_actor = sourceActorId;
@ -69,7 +69,7 @@ public:
* @brief Constructs a new game packet with the specified actors. * @brief Constructs a new game packet with the specified actors.
* @param sourceActorId The source and target actor id. * @param sourceActorId The source and target actor id.
*/ */
GamePacketNew<T, T1>( uint32_t bothActorId ) GamePacketNew< T, T1 >( uint32_t bothActorId )
{ {
initialize(); initialize();
m_segHdr.source_actor = bothActorId; m_segHdr.source_actor = bothActorId;
@ -96,7 +96,7 @@ protected:
}; };
public: public:
virtual T1 ipcType( void ) virtual T1 ipcType()
{ {
return static_cast< T1 >( m_data._ServerIpcType ); return static_cast< T1 >( m_data._ServerIpcType );
}; };
@ -109,7 +109,7 @@ public:
* @param actorId The source actor id. * @param actorId The source actor id.
* @return This IPC packet object (can be used for chaining). * @return This IPC packet object (can be used for chaining).
*/ */
GamePacketNew<T, T1> sourceActor( uint32_t actorId ) GamePacketNew< T, T1 > sourceActor( uint32_t actorId )
{ {
m_segHdr.source_actor = actorId; m_segHdr.source_actor = actorId;
return this; return this;
@ -129,7 +129,7 @@ public:
* @param actorId The target actor id. * @param actorId The target actor id.
* @return This IPC packet object (can be used for chaining). * @return This IPC packet object (can be used for chaining).
*/ */
GamePacketNew<T, T1> targetActor( uint32_t actorId ) GamePacketNew< T, T1 > targetActor( uint32_t actorId )
{ {
m_segHdr.target_actor = actorId; m_segHdr.target_actor = actorId;
return this; return this;
@ -144,7 +144,7 @@ public:
return m_segHdr.target_actor; return m_segHdr.target_actor;
}; };
friend std::ostream& operator<< <> ( std::ostream& os, const GamePacketNew<T, T1>& packet ); friend std::ostream& operator<< <> ( std::ostream& os, const GamePacketNew< T, T1 >& packet );
friend class GamePacketFactory; friend class GamePacketFactory;
@ -205,7 +205,7 @@ private:
}; };
}; };
template <typename T, typename T1> template < typename T, typename T1 >
std::ostream& operator<<( std::ostream& os, const GamePacketNew<T, T1>& packet ) std::ostream& operator<<( std::ostream& os, const GamePacketNew<T, T1>& packet )
{ {
#if 0 #if 0

View file

@ -5,159 +5,122 @@
using namespace Core::Network::Packets; using namespace Core::Network::Packets;
namespace Core PacketParseResult Core::Network::Packets::getHeader( const std::vector< uint8_t > &buffer,
const uint32_t offset,
FFXIVARR_PACKET_HEADER &header )
{ {
namespace Network const auto headerSize = sizeof( FFXIVARR_PACKET_HEADER );
{
namespace Packets
{
PacketParseResult getHeader(
const std::vector< uint8_t > &buffer,
const uint32_t offset,
FFXIVARR_PACKET_HEADER &header)
{
const auto headerSize = sizeof( FFXIVARR_PACKET_HEADER );
// Check if we have enough bytes in the buffer. // Check if we have enough bytes in the buffer.
auto remainingBytes = buffer.size() - offset; auto remainingBytes = buffer.size() - offset;
if ( remainingBytes < headerSize ) if( remainingBytes < headerSize )
{ return Incomplete;
return Incomplete;
}
// Copy packet header. // Copy packet header.
memcpy( &header, buffer.data() + offset, headerSize ); memcpy( &header, buffer.data() + offset, headerSize );
if ( !checkHeader(header) ) if( !checkHeader(header) )
{ return Malformed;
return Malformed;
}
return Success; return Success;
} }
PacketParseResult getSegmentHeader( PacketParseResult Core::Network::Packets::getSegmentHeader( const std::vector< uint8_t > &buffer,
const std::vector< uint8_t > &buffer, const uint32_t offset,
const uint32_t offset, FFXIVARR_PACKET_SEGMENT_HEADER &header )
FFXIVARR_PACKET_SEGMENT_HEADER &header) {
{ const auto headerSize = sizeof( FFXIVARR_PACKET_SEGMENT_HEADER );
const auto headerSize = sizeof( FFXIVARR_PACKET_SEGMENT_HEADER );
// Check if we have enough bytes in the buffer.
// Check if we have enough bytes in the buffer. auto remainingBytes = buffer.size() - offset;
auto remainingBytes = buffer.size() - offset; if( remainingBytes < headerSize )
if (remainingBytes < headerSize) return Incomplete;
{
return Incomplete; // Copy segment header
} memcpy( &header, buffer.data() + offset, headerSize );
// Copy segment header return Success;
memcpy(&header, buffer.data() + offset, headerSize); }
return Success; PacketParseResult Core::Network::Packets::getPackets( const std::vector< uint8_t > &buffer,
} const uint32_t offset,
const FFXIVARR_PACKET_HEADER &packetHeader,
PacketParseResult getPackets( std::vector< FFXIVARR_PACKET_RAW > &packets )
const std::vector< uint8_t > &buffer, {
const uint32_t offset, // sanity check: check there's enough bytes in the buffer
const FFXIVARR_PACKET_HEADER &packetHeader, const auto bytesExpected = packetHeader.size - sizeof( struct FFXIVARR_PACKET_HEADER );
std::vector< FFXIVARR_PACKET_RAW > &packets) if( buffer.size() - offset < bytesExpected )
{ return Incomplete;
// sanity check: check there's enough bytes in the buffer
const auto bytesExpected = packetHeader.size - sizeof(struct FFXIVARR_PACKET_HEADER); // Loop each message
if ( buffer.size() - offset < bytesExpected ) uint32_t count = 0;
{ uint32_t bytesProcessed = 0;
return Incomplete; while( count < packetHeader.count )
} {
FFXIVARR_PACKET_RAW rawPacket;
// Loop each message
uint32_t count = 0; // Copy ipc packet message
uint32_t bytesProcessed = 0; const auto packetResult = getPacket( buffer, offset + bytesProcessed, rawPacket );
while ( count < packetHeader.count ) if( packetResult != Success )
{ return packetResult;
FFXIVARR_PACKET_RAW rawPacket;
// NOTE: isn't rawPacket is allocated on stack?
// Copy ipc packet message // why is okay to do this?
const auto packetResult = getPacket(buffer, offset + bytesProcessed, rawPacket); packets.push_back( rawPacket );
if ( packetResult != Success )
{ // Add message size and count
return packetResult; bytesProcessed += rawPacket.segHdr.size;
} count += 1;
}
// NOTE: isn't rawPacket is allocated on stack?
// why is okay to do this? // sanity check: check if we processed all bytes.
packets.push_back( rawPacket ); // this check can fail if size of messages don't add up to size reported from packet header.
if( bytesExpected != bytesProcessed )
// Add message size and count return Malformed;
bytesProcessed += rawPacket.segHdr.size;
count += 1; return Success;
} }
// sanity check: check if we processed all bytes. PacketParseResult Core::Network::Packets::getPacket( const std::vector< uint8_t > &buffer, const uint32_t offset,
// this check can fail if size of messages don't add up to size reported from packet header. FFXIVARR_PACKET_RAW &packet )
if ( bytesExpected != bytesProcessed ) {
{ // Copy segment header
return Malformed; const auto headerResult = getSegmentHeader( buffer, offset, packet.segHdr );
} if( headerResult != Success )
return headerResult;
return Success;
} // Check header sanity and it's size
if( !checkSegmentHeader( packet.segHdr ) )
PacketParseResult getPacket( return Malformed;
const std::vector< uint8_t > &buffer,
const uint32_t offset, const auto dataOffset = offset + sizeof( struct FFXIVARR_PACKET_SEGMENT_HEADER );
FFXIVARR_PACKET_RAW &packet const auto dataSize = packet.segHdr.size;
)
{ // Allocate data buffer and copy
// Copy segment header packet.data.resize( dataSize );
const auto headerResult = getSegmentHeader(buffer, offset, packet.segHdr); memcpy( packet.data.data(), buffer.data() + dataOffset, dataSize );
if ( headerResult != Success )
{ return Success;
return headerResult; }
}
bool Core::Network::Packets::checkHeader( const FFXIVARR_PACKET_HEADER &header )
// Check header sanity and it's size {
if ( !checkSegmentHeader( packet.segHdr ) ) // Max size of the packet is capped at 1MB for now.
{ if( header.size > 1 * 1024 * 1024 )
return Malformed; return false;
}
// Max number of message is capped at 255 for now.
const auto dataOffset = offset + sizeof(struct FFXIVARR_PACKET_SEGMENT_HEADER); if( header.count > 255 )
const auto dataSize = packet.segHdr.size; return false;
// Allocate data buffer and copy return true;
packet.data.resize( dataSize ); }
memcpy( packet.data.data(), buffer.data() + dataOffset, dataSize );
bool Core::Network::Packets::checkSegmentHeader( const FFXIVARR_PACKET_SEGMENT_HEADER &header )
return Success; {
} // Max size of individual message is capped at 256KB for now.
if( header.size > 256 * 1024 )
bool checkHeader(const FFXIVARR_PACKET_HEADER &header) return false;
{
// Max size of the packet is capped at 1MB for now. return true;
if ( header.size > 1 * 1024 * 1024 )
{
return false;
}
// Max number of message is capped at 255 for now.
if ( header.count > 255 )
{
return false;
}
return true;
}
bool checkSegmentHeader(const FFXIVARR_PACKET_SEGMENT_HEADER &header)
{
// Max size of individual message is capped at 256KB for now.
if ( header.size > 256 * 1024 )
{
return false;
}
return true;
}
}
}
} }

View file

@ -2,62 +2,49 @@
#define _GAMEPACKETPARSER_H #define _GAMEPACKETPARSER_H
#include "CommonNetwork.h" #include "CommonNetwork.h"
namespace Core namespace Core {
{ namespace Network {
namespace Network namespace Packets {
enum PacketParseResult
{ {
namespace Packets /// Dissected game packet successfully
{ Success,
enum PacketParseResult
{
/// Dissected game packet successfully
Success,
/// Buffer is too short to dissect a message. /// Buffer is too short to dissect a message.
Incomplete, Incomplete,
/// Invalid data detected.
Malformed
};
/// Read packet header from buffer with given offset. /// Invalid data detected.
/// Buffer with given offset must be pointing to start of the new FFXIV packet. Malformed
PacketParseResult getHeader( };
const std::vector< uint8_t > &buffer,
const uint32_t offset,
FFXIVARR_PACKET_HEADER &header
);
/// Read packet header from buffer with given offset. /// Read packet header from buffer with given offset.
/// Buffer with given offset must be pointing to start of FFXIVARR_PACKET_SEGMENT_HEADER data. /// Buffer with given offset must be pointing to start of the new FFXIV packet.
/// Keep in mind that this function does check for data validity. Call checkSegmentHeader() if that's needed. PacketParseResult getHeader( const std::vector< uint8_t > &buffer, const uint32_t offset,
PacketParseResult getSegmentHeader( FFXIVARR_PACKET_HEADER &header );
const std::vector< uint8_t > &buffer,
const uint32_t offset,
FFXIVARR_PACKET_SEGMENT_HEADER &header
);
/// Read packets from the buffer with given offset. /// Read packet header from buffer with given offset.
/// Buffer with given offset must be pointing to end of FFXIVARR_PACKET_HEADER data. /// Buffer with given offset must be pointing to start of FFXIVARR_PACKET_SEGMENT_HEADER data.
PacketParseResult getPackets( /// Keep in mind that this function does check for data validity. Call checkSegmentHeader() if that's needed.
const std::vector< uint8_t > &buffer, PacketParseResult getSegmentHeader( const std::vector< uint8_t > &buffer, const uint32_t offset,
const uint32_t offset, FFXIVARR_PACKET_SEGMENT_HEADER &header );
const FFXIVARR_PACKET_HEADER &header,
std::vector< Packets::FFXIVARR_PACKET_RAW > &packets);
/// Read single packet from the buffer with given offset.
/// Buffer with an offset must be pointing to start of FFXIVARR_PACKET_SEGMENT_HEADER data.
PacketParseResult getPacket(
const std::vector< uint8_t > &buffer,
const uint32_t offset,
FFXIVARR_PACKET_RAW &packet
);
bool checkHeader(const FFXIVARR_PACKET_HEADER &header); /// Read packets from the buffer with given offset.
bool checkSegmentHeader(const FFXIVARR_PACKET_SEGMENT_HEADER &header); /// Buffer with given offset must be pointing to end of FFXIVARR_PACKET_HEADER data.
PacketParseResult getPackets( const std::vector< uint8_t > &buffer, const uint32_t offset,
const FFXIVARR_PACKET_HEADER &header,
std::vector< Packets::FFXIVARR_PACKET_RAW > &packets );
} /// Read single packet from the buffer with given offset.
} /// Buffer with an offset must be pointing to start of FFXIVARR_PACKET_SEGMENT_HEADER data.
PacketParseResult getPacket( const std::vector< uint8_t > &buffer, const uint32_t offset,
FFXIVARR_PACKET_RAW &packet );
bool checkHeader(const FFXIVARR_PACKET_HEADER &header);
bool checkSegmentHeader(const FFXIVARR_PACKET_SEGMENT_HEADER &header);
}
}
} }

View file

@ -7,14 +7,14 @@
#include <chrono> #include <chrono>
Core::Network::Packets::PacketContainer::PacketContainer( void ) Core::Network::Packets::PacketContainer::PacketContainer()
{ {
memset( &m_ipcHdr, 0, sizeof( FFXIVARR_PACKET_HEADER ) ); memset( &m_ipcHdr, 0, sizeof( FFXIVARR_PACKET_HEADER ) );
m_ipcHdr.size = sizeof( FFXIVARR_PACKET_HEADER ); m_ipcHdr.size = sizeof( FFXIVARR_PACKET_HEADER );
m_ipcHdr.count = 0; m_ipcHdr.count = 0;
} }
Core::Network::Packets::PacketContainer::~PacketContainer( void ) Core::Network::Packets::PacketContainer::~PacketContainer()
{ {
m_entryList.clear(); m_entryList.clear();
} }

View file

@ -16,14 +16,14 @@ class GamePacket;
class PacketContainer class PacketContainer
{ {
public: public:
PacketContainer( void ); PacketContainer();
~PacketContainer( void ); ~PacketContainer();
void addPacket( GamePacket pEntry ); void addPacket( GamePacket pEntry );
FFXIVARR_PACKET_HEADER m_ipcHdr; FFXIVARR_PACKET_HEADER m_ipcHdr;
std::vector<GamePacket> m_entryList; std::vector< GamePacket > m_entryList;
std::string toString(); std::string toString();

View file

@ -1,7 +1,7 @@
#ifndef _CORE_NETWORK_PACKETS_IPCS_H #ifndef _CORE_NETWORK_PACKETS_IPCS_H
#define _CORE_NETWORK_PACKETS_IPCS_H #define _CORE_NETWORK_PACKETS_IPCS_H
#include<stdint.h> #include <stdint.h>
namespace Core { namespace Core {
namespace Network { namespace Network {
@ -45,11 +45,10 @@ namespace Packets {
enum ServerZoneIpcType : uint16_t enum ServerZoneIpcType : uint16_t
{ {
// static opcode ( the ones that rarely if ever change ) // static opcode ( the ones that rarely, if ever, change )
Ping = 0x0065, Ping = 0x0065,
Init = 0x0066, Init = 0x0066,
//ActorSpawn = 0x0190, // DEPRECATED
ActorFreeSpawn = 0x0191, ActorFreeSpawn = 0x0191,
InitZone = 0x019A, InitZone = 0x019A,
@ -74,6 +73,7 @@ namespace Packets {
CFRegistered = 0x00B8, // updated 4.1 CFRegistered = 0x00B8, // updated 4.1
SocialRequestResponse = 0x00BB, // updated 4.1 SocialRequestResponse = 0x00BB, // updated 4.1
CancelAllianceForming = 0x00C6, // updated 4.2 CancelAllianceForming = 0x00C6, // updated 4.2
Chat = 0x00F7, // updated 4.3 Chat = 0x00F7, // updated 4.3
SocialList = 0x00FD, // updated 4.3 SocialList = 0x00FD, // updated 4.3
@ -86,12 +86,13 @@ namespace Packets {
CountdownInitiate = 0x0111, // updated 4.3 CountdownInitiate = 0x0111, // updated 4.3
CountdownCancel = 0x0112, // updated 4.3 CountdownCancel = 0x0112, // updated 4.3
BlackList = 0x00FF, // updated 4.2 BlackList = 0x0115, // updated 4.3
LogMessage = 0x00D0, LogMessage = 0x00D0,
LinkshellList = 0x0106, // updated 4.2 LinkshellList = 0x011C, // updated 4.3
SetCharacterFCInfo = 0x0114, // updated 4.2 SetCharaFCTag = 0x013B, // updated 4.3
SetFreeCompanyInfo = 0x013D, // updated 4.3
StatusEffectList = 0x014E, // updated 4.3 StatusEffectList = 0x014E, // updated 4.3
Effect = 0x0151, // updated 4.3 Effect = 0x0151, // updated 4.3
@ -106,11 +107,15 @@ namespace Packets {
ActorCast = 0x0178, // updated 4.3 ActorCast = 0x0178, // updated 4.3
PartyList = 0x017A, // updated 4.3
HateList = 0x017B, // updated 4.3 HateList = 0x017B, // updated 4.3
ObjectSpawn = 0x017D, // updated 4.3 ObjectSpawn = 0x017D, // updated 4.3
ObjectDespawn = 0x017E, // updated 4.3 ObjectDespawn = 0x017E, // updated 4.3
UpdateClassInfo = 0x018A, // updated 4.3
SetLevelSync = 0x017F, // updated 4.3
InventoryActionAck = 0x0180, // updated 4.2 ?
InitUI = 0x0181, // updated 4.3 InitUI = 0x0181, // updated 4.3
PlayerStats = 0x0182, // updated 4.3 PlayerStats = 0x0182, // updated 4.3
@ -119,13 +124,14 @@ namespace Packets {
PlayerClassInfo = 0x0185, // updated 4.3 PlayerClassInfo = 0x0185, // updated 4.3
ModelEquip = 0x0186, // updated 4.3 ModelEquip = 0x0186, // updated 4.3
UpdateClassInfo = 0x018A, // updated 4.3
ItemInfo = 0x0190, // updated 4.3 ItemInfo = 0x0190, // updated 4.3
ContainerInfo = 0x0192, // updated 4.3 ContainerInfo = 0x0192, // updated 4.3
InventoryTransactionFinish = 0x0193, // updated 4.3 InventoryTransactionFinish = 0x0193, // updated 4.3
InventoryTransaction = 0x0194, // updated 4.3 InventoryTransaction = 0x0194, // updated 4.3
CurrencyCrystalInfo = 0x0197, // updated 4.3 CurrencyCrystalInfo = 0x0197, // updated 4.3
InventoryActionAck = 0x0180, // updated 4.2 ?
UpdateInventorySlot = 0x0198, // updated 4.3 UpdateInventorySlot = 0x0198, // updated 4.3
EventPlay = 0x01A6, // updated 4.3 EventPlay = 0x01A6, // updated 4.3
@ -136,21 +142,24 @@ namespace Packets {
EventLinkshell = 0x1169, EventLinkshell = 0x1169,
QuestMessage = 0x01CE, // updated 4.3 QuestActiveList = 0x01C3, // updated 4.3
QuestTracker = 0x01D3, // updated 4.3 QuestUpdate = 0x01C4, // updated 4.3
QuestCompleteList = 0x01C5, // updated 4.3
QuestFinish = 0x01C6, // updated 4.3 QuestFinish = 0x01C6, // updated 4.3
MSQTrackerComplete = 0x01C7, // updated 4.3 MSQTrackerComplete = 0x01C7, // updated 4.3
MSQTrackerProgress = 0x01C8, // updated 4.3 MSQTrackerProgress = 0x01C8, // updated 4.3
QuestActiveList = 0x01C3, // updated 4.3 QuestMessage = 0x01CE, // updated 4.3
QuestUpdate = 0x01C4, // updated 4.3
QuestCompleteList = 0x01C5, // updated 4.3 QuestTracker = 0x01D3, // updated 4.3
Mount = 0x01E3, // updated 4.3 Mount = 0x01E3, // updated 4.3
DirectorVars = 0x01E5, // updated 4.3 DirectorVars = 0x01E5, // updated 4.3
CFAvailableContents = 0x01FD, // updated 4.2
WeatherChange = 0x0200, // updated 4.3 WeatherChange = 0x0200, // updated 4.3
PlayerTitleList = 0x0201, // updated 4.3 PlayerTitleList = 0x0201, // updated 4.3
Discovery = 0x0202, // updated 4.3 Discovery = 0x0202, // updated 4.3
@ -159,13 +168,13 @@ namespace Packets {
EquipDisplayFlags = 0x0210, // updated 4.3 EquipDisplayFlags = 0x0210, // updated 4.3
CFAvailableContents = 0x01FD, // updated 4.2 DuelChallenge = 0x0277, // 4.2; this is responsible for opening the ui
PerformNote = 0x0286, // updated 4.3
PrepareZoning = 0x0291, // updated 4.3 PrepareZoning = 0x0291, // updated 4.3
ActorGauge = 0x0292, // updated 4.3 ActorGauge = 0x0292, // updated 4.3
DuelChallenge = 0x0277, // 4.2; this is the responsible for opening an ui
PerformNote = 0x0286, // updated 4.3
// Unknown IPC types that still need to be sent // Unknown IPC types that still need to be sent
// TODO: figure all these out properly // TODO: figure all these out properly
@ -174,8 +183,6 @@ namespace Packets {
}; };
// TODO: Include structures for the individual packet segment types
/** /**
* Client IPC Zone Type Codes. * Client IPC Zone Type Codes.
*/ */
@ -199,6 +206,7 @@ namespace Packets {
CFDutyInfoHandler = 0x0078, // updated 4.2 CFDutyInfoHandler = 0x0078, // updated 4.2
SocialReqSendHandler = 0x00AE, // updated 4.1 SocialReqSendHandler = 0x00AE, // updated 4.1
CreateCrossWorldLS = 0x00AF, // updated 4.3
ChatHandler = 0x00D3, // updated 4.3 ChatHandler = 0x00D3, // updated 4.3

View file

@ -611,7 +611,7 @@ struct FFXIVIpcInitUI : FFXIVIpcBasePacket<InitUI>
{ {
// plain C types for a bit until the packet is actually fixed. // plain C types for a bit until the packet is actually fixed.
// makes conversion between different editors easier. // makes conversion between different editors easier.
__int64 contentId; uint64_t contentId;
unsigned int unknown8; unsigned int unknown8;
unsigned int unknownC; unsigned int unknownC;
unsigned int charId; unsigned int charId;
@ -621,137 +621,143 @@ struct FFXIVIpcInitUI : FFXIVIpcBasePacket<InitUI>
unsigned int fishCaught; unsigned int fishCaught;
unsigned int useBaitCatalogId; unsigned int useBaitCatalogId;
unsigned int pvpWolfFoldMatches; unsigned int pvpWolfFoldMatches;
unsigned __int16 pvpWolfFoldWeeklyMatches; unsigned short pvpWolfFoldWeeklyMatches;
unsigned __int16 pvpWolfFoldWeeklyVictories; unsigned short pvpWolfFoldWeeklyVictories;
unsigned __int16 pvpStats[6]; unsigned short pvpStats[6];
unsigned __int16 playerCommendations; unsigned short playerCommendations;
unsigned __int16 pvpStats1; unsigned short pvpStats1;
unsigned __int8 frontlineCampaigns[4]; unsigned char frontlineCampaigns[4];
unsigned __int16 frontlineCampaignsWeekly; unsigned short frontlineCampaignsWeekly;
unsigned __int8 currentRelic; unsigned char currentRelic;
unsigned __int8 currentBook; unsigned char currentBook;
unsigned __int8 masterCrafterMask; unsigned char masterCrafterMask;
unsigned __int8 unknown69; unsigned char unknown69;
unsigned __int8 unknown6A; unsigned char unknown6A;
unsigned __int8 unknown6B; unsigned char unknown6B;
unsigned __int8 unknown6C[4]; unsigned char unknown6C[4];
unsigned __int8 unknown50[34]; unsigned char unknown70[34];
unsigned __int16 unknown18; unsigned short unknown18;
unsigned __int8 maxLevel; unsigned char maxLevel;
unsigned __int8 expansion; unsigned char expansion;
unsigned __int8 unknown76; unsigned char unknown;
unsigned __int8 race; unsigned char race;
unsigned __int8 tribe; unsigned char tribe;
unsigned __int8 gender; unsigned char gender;
unsigned __int8 currentJob; unsigned char currentJob;
unsigned __int8 currentClass; unsigned char currentClass;
unsigned __int8 deity; unsigned char deity;
unsigned __int8 namedayMonth; unsigned char namedayMonth;
unsigned __int8 namedayDay; unsigned char namedayDay;
unsigned __int8 cityState; unsigned char cityState;
unsigned __int8 homepoint; unsigned char homepoint;
unsigned __int8 unknown26; unsigned char unknown26;
unsigned __int8 petHotBar; unsigned char petHotBar;
unsigned __int8 companionRank; unsigned char companionRank;
unsigned __int8 companionStars; unsigned char companionStars;
unsigned __int8 companionSp; unsigned char companionSp;
unsigned __int8 companionUnk2B; unsigned char companionUnk2B;
unsigned __int8 companionColor; unsigned char companionColor;
unsigned __int8 companionFavoFeed; unsigned char companionFavoFeed;
unsigned __int8 companionUnk89; unsigned char companionUnk2E;
unsigned __int8 companionUnk90[5]; unsigned char companionTimePassed[4];
unsigned __int16 unknown90[7]; unsigned short unknown38[11];
unsigned __int16 unknown9E;
unsigned __int16 unknownA0;
unsigned int exp[25]; unsigned int exp[25];
unsigned __int8 unknown564[16]; unsigned char unknown564[16];
unsigned int pvpFrontlineOverall1st; unsigned int pvpFrontlineOverall1st;
unsigned int pvpFrontlineOverall2nd; unsigned int pvpFrontlineOverall2nd;
unsigned int pvpFrontlineOverall3rd; unsigned int pvpFrontlineOverall3rd;
unsigned __int8 relicBookCompletion1[4]; unsigned char relicBookCompletion1[4];
unsigned __int16 levels[25]; unsigned short levels[25];
unsigned __int16 levelsPadding; unsigned short levelsPadding;
unsigned __int16 unknown15C[8]; unsigned char unknown__[16];
unsigned __int16 fishingRecordsFish[26]; unsigned short fishingRecordsFish[26];
unsigned __int16 fishingRecordsFishWeight[26]; unsigned short fishingRecordsFishWeight[26];
unsigned __int8 unknownMask554[44]; unsigned char unknownMask554[44];
unsigned __int8 companion_name[21];
unsigned __int8 companionDefRank; unsigned char companion_name[21];
unsigned __int8 companionAttRank; unsigned char companionDefRank;
unsigned __int8 companionHealRank; unsigned char companionAttRank;
unsigned __int8 mountGuideMask[16]; unsigned char companionHealRank;
unsigned char mountGuideMask[16];
char name[32]; char name[32];
unsigned __int8 unknownOword[16]; unsigned char unknownOword[16];
unsigned __int8 unknown258; unsigned char unlockBitmask[64];
unsigned __int8 unlockBitmask[64]; unsigned char aetheryte[17];
unsigned __int8 aetheryte[17]; unsigned char discovery[421];
unsigned __int8 discovery[421]; unsigned char howto[33];
unsigned __int8 howto[33]; unsigned char minions[38];
unsigned __int8 minions[38]; unsigned char chocoboTaxiMask[8];
unsigned __int8 chocoboTaxiMask[8]; unsigned char contentClearMask[111];
unsigned __int8 contentClearMask[111]; unsigned char contentClearPadding;
unsigned __int8 contentClearPadding; unsigned short unknown428[8];
unsigned __int16 unknown428[8]; unsigned char companionBardingMask[8];
unsigned __int8 companionBardingMask[8]; unsigned char companionEquippedHead;
unsigned __int8 companionEquippedHead; unsigned char companionEquippedBody;
unsigned __int8 companionEquippedBody; unsigned char companionEquippedFeet;
unsigned __int8 companionEquippedFeet; unsigned char companionUnk4[4];
unsigned __int8 companionUnk4[4]; unsigned char companion_fields[11];
unsigned __int8 companion_fields[11];
unsigned __int8 fishingGuideMask[89]; unsigned char fishingGuideMask[89];
unsigned __int8 fishingSpotVisited[25]; unsigned char fishingSpotVisited[25];
unsigned __int8 unknownMask4Padding;
unsigned __int8 rankAmalJaa;
unsigned __int8 rankSylph; unsigned char unknownMask4Padding;
unsigned __int8 rankKobold;
unsigned __int8 rankSahagin; unsigned char rankAmalJaa;
unsigned __int8 rankIxal; unsigned char rankSylph;
unsigned __int8 rankVanu; unsigned char rankKobold;
unsigned __int8 rankVath; unsigned char rankSahagin;
unsigned __int8 rankMoogle; unsigned char rankIxal;
unsigned __int8 rankKojin; unsigned char rankVanu;
unsigned __int8 rankAnata; unsigned char rankVath;
unsigned __int16 expAmalJaa; unsigned char rankMoogle;
unsigned __int16 expSylph; unsigned char rankKojin;
unsigned __int16 expKobold; unsigned char rankAnata;
unsigned __int16 expSahagin; unsigned short expAmalJaa;
unsigned __int16 expIxal; unsigned short expSylph;
unsigned __int16 expVanu; unsigned short expKobold;
unsigned __int16 expVath; unsigned short expSahagin;
unsigned __int16 expMoogle; unsigned short expIxal;
unsigned __int16 expKojin; unsigned short expVanu;
unsigned __int16 expAnata; unsigned short expVath;
unsigned __int8 unknown596[10]; unsigned short expMoogle;
unsigned __int16 unknown5A0[5]; unsigned short expKojin;
unsigned __int8 unknownMask59E[5]; unsigned short expAnata;
unsigned __int8 unknown5A3[18]; unsigned char unknown596[10];
unsigned __int8 unknownMask5C1[28]; unsigned short unknown5A0[5];
unsigned __int8 unknown_03411; unsigned char unknownMask59E[5];
unsigned char unknown5A3[18];
unsigned char unknownMask5C1[28];
unsigned char unknown_03411;
unsigned int unknownDword5E0; unsigned int unknownDword5E0;
unsigned __int16 pvpFrontlineWeekly1st; unsigned short pvpFrontlineWeekly1st;
unsigned __int16 pvpFrontlineWeekly2nd; unsigned short pvpFrontlineWeekly2nd;
unsigned __int16 pvpFrontlineWeekly3rd; unsigned short pvpFrontlineWeekly3rd;
unsigned __int8 relicBookCompletion2[8]; unsigned char relicBookCompletion2[8];
unsigned __int8 sightseeingMask[26]; unsigned char sightseeingMask[26];
unsigned __int16 unknown_XXX; unsigned short unknown_XXX;
unsigned __int8 unknown61E[20];
unsigned __int8 unknown656[29]; unsigned char unknown61E;
unsigned __int8 unknown63F[22]; unsigned char unknown61F[32];
unsigned __int8 tripleTriadCards[28]; unsigned char unknown63F[22];
unsigned __int8 unknown671[11]; unsigned char tripleTriadCards[28];
unsigned __int8 unknownMask67C[22]; unsigned char unknown671[11];
unsigned __int8 unknown692[3]; unsigned char unknownMask67C[22];
unsigned __int8 orchestrionMask[40]; unsigned char unknown692[3];
unsigned __int8 hallOfNoviceCompleteMask[3]; unsigned char orchestrionMask[40];
unsigned __int8 unknownMask6C0[11]; unsigned char hallOfNoviceCompleteMask[3];
unsigned __int8 unknownMask6CB[16]; unsigned char unknownMask6C0[11];
unsigned __int8 unknown6DB[14]; unsigned char unknownMask6CB[16];
unsigned __int8 unlockedRaids[28]; unsigned char unknown6DB[14];
unsigned __int8 unlockedDungeons[18]; unsigned char unlockedRaids[28];
unsigned __int8 unlockedGuildhests[10]; unsigned char unlockedDungeons[18];
unsigned __int8 unlockedTrials[7]; unsigned char unlockedGuildhests[10];
unsigned __int8 unlockedPvp[5]; unsigned char unlockedTrials[7];
unsigned __int8 unknownMask72D[28]; unsigned char unlockedPvp[5];
unsigned char unknownMask72D[28];
// unsigned char unknownMask749[18];
//unsigned char unknown749[13];
}; };

View file

@ -0,0 +1,36 @@
#include <ScriptObject.h>
#include <Zone/InstanceContent.h>
class TheWeaponsRefrainUltimate : public InstanceContentScript
{
public:
TheWeaponsRefrainUltimate() : InstanceContentScript( 30067 )
{ }
void onInit( InstanceContentPtr instance ) override
{
instance->registerEObj( "unknown_0", 2009480, 0, 4, { 94.011192f, 0.000000f, 107.700996f }, 1.000000f, 0.000000f );
instance->registerEObj( "sgvf_w1fz_b1432", 2007457, 7372735, 4, { 100.000000f, 0.000000f, 100.000000f }, 1.000000f, 0.000000f );
instance->registerEObj( "unknown_1", 2007457, 7373056, 4, { 100.000000f, 0.000000f, 100.000000f }, 1.000000f, 0.000000f );
instance->registerEObj( "unknown_2", 2009481, 0, 4, { 101.695602f, 0.000000f, 101.959396f }, 1.000000f, 0.000000f );
instance->registerEObj( "unknown_3", 2007457, 7237754, 4, { 100.000000f, 0.000000f, 100.000000f }, 1.000000f, 0.000000f );
instance->registerEObj( "unknown_4", 2007457, 7237753, 4, { 100.000000f, 0.000000f, 100.000000f }, 1.000000f, 0.000000f );
instance->registerEObj( "unknown_5", 2007457, 7237756, 4, { 100.000000f, 0.000000f, 100.000000f }, 1.000000f, 0.000000f );
instance->registerEObj( "unknown_6", 2007457, 7237755, 4, { 100.000000f, 0.000000f, 100.000000f }, 1.000000f, 0.000000f );
instance->registerEObj( "Entrance", 2007457, 7343478, 5, { 100.000000f, 0.000000f, 116.000000f }, 1.000000f, 0.000000f );
// States -> vf_lock_on vf_lock_of
instance->registerEObj( "Exit", 2000139, 0, 4, { 100.000000f, 0.000000f, 85.000000f }, 1.000000f, 0.000000f );
instance->registerEObj( "unknown_7", 2007457, 7538258, 4, { 100.160004f, 0.000000f, 101.443398f }, 1.000000f, 0.000000f );
}
void onUpdate( InstanceContentPtr instance, uint32_t currTime ) override
{
}
void onEnterTerritory( InstanceContentPtr instance, Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override
{
}
};

View file

@ -9,7 +9,6 @@
#include "Actor/Player.h" #include "Actor/Player.h"
#include <cmath> #include <cmath>
#include <boost/make_shared.hpp>
using namespace Core::Entity; using namespace Core::Entity;
using namespace Core::Common; using namespace Core::Common;

View file

@ -2,14 +2,14 @@
#define _ACTIONCOLLISION_H #define _ACTIONCOLLISION_H
#include <Common.h> #include <Common.h>
#include "Action.h" #include "Forwards.h"
namespace Core { namespace Core {
namespace Data namespace Data
{ {
struct Action; struct Action;
} }
namespace Entity { namespace Entity {
enum class TargetFilter enum class TargetFilter

View file

@ -1,7 +1,7 @@
#ifndef _ACTIONMOUNT_H_ #ifndef _ACTIONMOUNT_H_
#define _ACTIONMOUNT_H_ #define _ACTIONMOUNT_H_
#include "../Forwards.h" #include "Forwards.h"
#include "Action.h" #include "Action.h"
namespace Core { namespace Core {

View file

@ -1,7 +1,7 @@
#ifndef _ACTIONTELEPORT_H_ #ifndef _ACTIONTELEPORT_H_
#define _ACTIONTELEPORT_H_ #define _ACTIONTELEPORT_H_
#include "../Forwards.h" #include "Forwards.h"
#include "Action.h" #include "Action.h"
namespace Core { namespace Core {

View file

@ -6,7 +6,6 @@
#include "Network/PacketWrappers/ActorControlPacket143.h" #include "Network/PacketWrappers/ActorControlPacket143.h"
#include "Actor/Player.h" #include "Actor/Player.h"
#include "Event/EventHandler.h"
#include "EventAction.h" #include "EventAction.h"
#include "Framework.h" #include "Framework.h"

View file

@ -3,7 +3,7 @@
#include <Common.h> #include <Common.h>
#include "../Forwards.h" #include "Forwards.h"
#include "Action.h" #include "Action.h"
namespace Core { namespace Core {

View file

@ -1,7 +1,7 @@
#ifndef _EVENTITEMACTION_H_ #ifndef _EVENTITEMACTION_H_
#define _EVENTITEMACTION_H_ #define _EVENTITEMACTION_H_
#include "../Forwards.h" #include "Forwards.h"
#include "Action.h" #include "Action.h"
namespace Core { namespace Core {

View file

@ -1,11 +1,10 @@
#include "Actor.h" #include "Actor.h"
#include <Network/PacketContainer.h> #include <Network/PacketContainer.h>
#include <Network/GamePacket.h>
#include <Util/Util.h> #include <Util/Util.h>
#include <Util/UtilMath.h> #include <Util/UtilMath.h>
#include "Forwards.h"
#include "Action/Action.h" #include "Action/Action.h"
#include "Action/ActionCollision.h" #include "Action/ActionCollision.h"
@ -19,8 +18,6 @@
#include "ServerZone.h" #include "ServerZone.h"
#include "Session.h" #include "Session.h"
#include "Zone/Zone.h"
#include "Zone/TerritoryMgr.h" #include "Zone/TerritoryMgr.h"
@ -28,11 +25,6 @@
#include "Math/CalcBattle.h" #include "Math/CalcBattle.h"
#include "ServerZone.h"
#include "Session.h"
#include "Actor.h"
#include "Player.h"
#include "Framework.h" #include "Framework.h"
extern Core::Framework g_fw; extern Core::Framework g_fw;

View file

@ -2,7 +2,6 @@
#include <Util/UtilMath.h> #include <Util/UtilMath.h>
#include <Network/PacketContainer.h> #include <Network/PacketContainer.h>
#include <Exd/ExdDataGenerated.h> #include <Exd/ExdDataGenerated.h>
#include <Network/GamePacket.h>
#include "Forwards.h" #include "Forwards.h"
#include "Action/Action.h" #include "Action/Action.h"

View file

@ -6,9 +6,7 @@
#include <Logging/Logger.h> #include <Logging/Logger.h>
#include <Network/GamePacket.h> #include <Network/GamePacket.h>
#include <Network/GamePacketNew.h> #include <Network/GamePacketNew.h>
#include <Network/CommonNetwork.h>
#include <Network/PacketDef/Zone/ServerZoneDef.h> #include <Network/PacketDef/Zone/ServerZoneDef.h>
#include <Network/PacketContainer.h>
#include <Util/UtilMath.h> #include <Util/UtilMath.h>
using namespace Core::Common; using namespace Core::Common;

View file

@ -10,10 +10,11 @@ namespace Entity
class EventObject : public Actor class EventObject : public Actor
{ {
public: public:
EventObject( uint32_t actorId, uint32_t objectId, uint32_t gimmickId, uint8_t initialState, Common::FFXIVARR_POSITION3 pos, EventObject( uint32_t actorId, uint32_t objectId, uint32_t gimmickId, uint8_t initialState,
float rotation, const std::string& givenName = "none" ); Common::FFXIVARR_POSITION3 pos, float rotation, const std::string& givenName = "none" );
using OnTalkEventHandler = std::function< void( Entity::Player&, Entity::EventObjectPtr, InstanceContentPtr, uint64_t ) >; using OnTalkEventHandler = std::function< void( Entity::Player&, Entity::EventObjectPtr,
InstanceContentPtr, uint64_t ) >;
uint32_t getGimmickId() const; uint32_t getGimmickId() const;
void setGimmickId( uint32_t gimmickId ); void setGimmickId( uint32_t gimmickId );

View file

@ -30,11 +30,6 @@
#include "Script/ScriptMgr.h" #include "Script/ScriptMgr.h"
#include "Inventory/Item.h"
#include "Inventory/Inventory.h"
#include "Event/EventHandler.h"
#include "Action/Action.h" #include "Action/Action.h"
#include "Action/ActionTeleport.h" #include "Action/ActionTeleport.h"
#include "Action/EventAction.h" #include "Action/EventAction.h"

View file

@ -16,12 +16,7 @@
#include "Action/EventAction.h" #include "Action/EventAction.h"
#include "Action/EventItemAction.h" #include "Action/EventItemAction.h"
#include "Event/EventHandler.h"
#include "Zone/Zone.h" #include "Zone/Zone.h"
#include "Player.h"
#include "Forwards.h"
#include "ServerZone.h" #include "ServerZone.h"
#include "Framework.h" #include "Framework.h"

View file

@ -8,8 +8,6 @@
#include "Network/PacketWrappers/QuestMessagePacket.h" #include "Network/PacketWrappers/QuestMessagePacket.h"
#include "Session.h" #include "Session.h"
#include "Inventory/Inventory.h"
#include "Player.h"
#include "Framework.h" #include "Framework.h"
extern Core::Framework g_fw; extern Core::Framework g_fw;

View file

@ -1,6 +1,4 @@
#include <set> #include <set>
#include <stdio.h>
#include <time.h>
#include <Common.h> #include <Common.h>
#include <Network/GamePacket.h> #include <Network/GamePacket.h>
@ -19,11 +17,7 @@
#include "Zone/TerritoryMgr.h" #include "Zone/TerritoryMgr.h"
#include "Zone/Zone.h" #include "Zone/Zone.h"
#include "Inventory/Inventory.h"
#include "Player.h"
#include "ServerZone.h" #include "ServerZone.h"
#include "Forwards.h"
#include "Framework.h" #include "Framework.h"
extern Core::Framework g_fw; extern Core::Framework g_fw;

View file

@ -6,7 +6,6 @@
#include <Common.h> #include <Common.h>
#include <Version.h> #include <Version.h>
#include <Network/GamePacketNew.h> #include <Network/GamePacketNew.h>
#include <Network/CommonNetwork.h>
#include <Util/UtilMath.h> #include <Util/UtilMath.h>
#include <Network/PacketContainer.h> #include <Network/PacketContainer.h>
#include <Logging/Logger.h> #include <Logging/Logger.h>
@ -25,7 +24,6 @@
#include "Script/ScriptMgr.h" #include "Script/ScriptMgr.h"
#include "Script/NativeScriptMgr.h" #include "Script/NativeScriptMgr.h"
#include "Actor/Player.h"
#include "Actor/EventObject.h" #include "Actor/EventObject.h"
#include "Zone/Zone.h" #include "Zone/Zone.h"
@ -34,7 +32,6 @@
#include "ServerZone.h" #include "ServerZone.h"
#include "StatusEffect/StatusEffect.h"
#include "Session.h" #include "Session.h"
#include "Framework.h" #include "Framework.h"

View file

@ -69,12 +69,6 @@ namespace Core
EVENT_TABLE_GAME = 24 EVENT_TABLE_GAME = 24
}; };
enum EventFinishState
{
UNLOCK = 1,
KEEPLOCK = 0
};
enum DamageType enum DamageType
{ {
STD_DAMAGE = 0X03, STD_DAMAGE = 0X03,

View file

@ -1,7 +1,7 @@
#ifndef _EVENT_H #ifndef _EVENT_H
#define _EVENT_H #define _EVENT_H
#include "../Forwards.h" #include "Forwards.h"
namespace Core { namespace Core {
namespace Event { namespace Event {

View file

@ -1,10 +1,12 @@
#include <Common.h> #include <Common.h>
#include <Exd/ExdDataGenerated.h> #include <Exd/ExdDataGenerated.h>
#include <boost/range/algorithm/remove_if.hpp>
#include <boost/algorithm/string/classification.hpp>
#include "Framework.h" #include "Framework.h"
#include "EventHelper.h" #include "EventHelper.h"
#include "EventHandler.h" #include "EventHandler.h"
#include <boost/range/algorithm/remove_if.hpp>
#include <boost/algorithm/string/classification.hpp>
extern Core::Framework g_fw; extern Core::Framework g_fw;

View file

@ -2,7 +2,7 @@
#include <boost/algorithm/clamp.hpp> #include <boost/algorithm/clamp.hpp>
#include <Network/PacketDef/Zone/ServerZoneDef.h> #include <Network/PacketDef/Zone/ServerZoneDef.h>
#include <Common.h>
#include <Exd/ExdDataGenerated.h> #include <Exd/ExdDataGenerated.h>
#include <Logging/Logger.h> #include <Logging/Logger.h>
#include <Database/DatabaseDef.h> #include <Database/DatabaseDef.h>
@ -12,8 +12,6 @@
#include "Network/PacketWrappers/ServerNoticePacket.h" #include "Network/PacketWrappers/ServerNoticePacket.h"
#include "Network/PacketWrappers/ActorControlPacket143.h" #include "Network/PacketWrappers/ActorControlPacket143.h"
#include "Forwards.h"
#include "Inventory.h"
#include "ItemContainer.h" #include "ItemContainer.h"
#include "Item.h" #include "Item.h"
#include "Framework.h" #include "Framework.h"

View file

@ -2,7 +2,7 @@
#define INVENTORY_H_ #define INVENTORY_H_
#include <map> #include <map>
#include <Common.h> #include <Common.h>
#include "../Forwards.h" #include "Forwards.h"
namespace Core namespace Core
{ {

View file

@ -5,7 +5,7 @@
#include <Common.h> #include <Common.h>
#include "../Forwards.h" #include "Forwards.h"
namespace Core namespace Core
{ {

View file

@ -4,8 +4,11 @@
#include <Network/CommonNetwork.h> #include <Network/CommonNetwork.h>
#include <Util/Util.h> #include <Util/Util.h>
#include <Logging/Logger.h> #include <Logging/Logger.h>
#include <Network/Acceptor.h>
#include <Network/PacketContainer.h> #include <Network/PacketContainer.h>
#include <Network/GamePacketParser.h> #include <Network/GamePacketParser.h>
#include <Network/GamePacket.h>
#include "Zone/Zone.h" #include "Zone/Zone.h"
@ -13,8 +16,6 @@
#include "DebugCommand/DebugCommandHandler.h" #include "DebugCommand/DebugCommandHandler.h"
#include "Actor/Player.h"
#include "GameConnection.h" #include "GameConnection.h"
#include "ServerZone.h" #include "ServerZone.h"
#include "Session.h" #include "Session.h"

View file

@ -2,9 +2,9 @@
#define GAMECONNECTION_H #define GAMECONNECTION_H
#include <Network/Connection.h> #include <Network/Connection.h>
#include <Network/Acceptor.h>
#include <Network/CommonNetwork.h> #include <Network/CommonNetwork.h>
#include <Network/GamePacket.h> //#include <Network/GamePacket.h>
#include <Util/LockedQueue.h> #include <Util/LockedQueue.h>
#include "Forwards.h" #include "Forwards.h"
@ -13,7 +13,9 @@
namespace Core { namespace Core {
namespace Network { namespace Network {
namespace Packets {
class GamePacket;
}
enum ConnectionType : uint8_t enum ConnectionType : uint8_t
{ {
Zone = 1, Zone = 1,

View file

@ -25,10 +25,6 @@
#include "DebugCommand/DebugCommandHandler.h" #include "DebugCommand/DebugCommandHandler.h"
#include "Actor/Player.h"
#include "Inventory/Inventory.h"
#include "Event/EventHelper.h" #include "Event/EventHelper.h"
#include "Action/Action.h" #include "Action/Action.h"

View file

@ -15,9 +15,6 @@
#include "Network/PacketWrappers/ActorControlPacket144.h" #include "Network/PacketWrappers/ActorControlPacket144.h"
#include "Network/PacketWrappers/PlayerStateFlagsPacket.h" #include "Network/PacketWrappers/PlayerStateFlagsPacket.h"
#include "Actor/Player.h"
#include "Forwards.h"
#include "Framework.h" #include "Framework.h"
#include "Session.h" #include "Session.h"

View file

@ -19,14 +19,12 @@
#include "Script/ScriptMgr.h" #include "Script/ScriptMgr.h"
#include "Actor/Player.h"
#include "Event/EventHelper.h" #include "Event/EventHelper.h"
#include "Zone/InstanceContent.h" #include "Zone/InstanceContent.h"
#include "Session.h" #include "Session.h"
#include "Forwards.h"
#include "Framework.h" #include "Framework.h"
extern Core::Framework g_fw; extern Core::Framework g_fw;

View file

@ -7,7 +7,6 @@
#include <Network/PacketContainer.h> #include <Network/PacketContainer.h>
#include <unordered_map> #include <unordered_map>
#include <boost/format.hpp>
#include "Network/GameConnection.h" #include "Network/GameConnection.h"
@ -16,9 +15,7 @@
#include "Zone/TerritoryMgr.h" #include "Zone/TerritoryMgr.h"
#include "Zone/Zone.h" #include "Zone/Zone.h"
#include "Zone/InstanceContent.h" #include "Zone/InstanceContent.h"
#include "Zone/ZonePosition.h"
#include "Network/GameConnection.h"
#include "Network/PacketWrappers/InitUIPacket.h" #include "Network/PacketWrappers/InitUIPacket.h"
#include "Network/PacketWrappers/PingPacket.h" #include "Network/PacketWrappers/PingPacket.h"
#include "Network/PacketWrappers/MoveActorPacket.h" #include "Network/PacketWrappers/MoveActorPacket.h"
@ -31,20 +28,7 @@
#include "Network/PacketWrappers/EventFinishPacket.h" #include "Network/PacketWrappers/EventFinishPacket.h"
#include "Network/PacketWrappers/PlayerStateFlagsPacket.h" #include "Network/PacketWrappers/PlayerStateFlagsPacket.h"
#include "DebugCommand/DebugCommandHandler.h"
#include "Actor/Player.h"
#include "Inventory/Inventory.h"
#include "Event/EventHelper.h"
#include "Action/Action.h"
#include "Action/ActionTeleport.h"
#include "Session.h"
#include "ServerZone.h" #include "ServerZone.h"
#include "Forwards.h"
#include "Framework.h" #include "Framework.h"
extern Core::Framework g_fw; extern Core::Framework g_fw;

View file

@ -17,11 +17,10 @@
#include "DebugCommand/DebugCommandHandler.h" #include "DebugCommand/DebugCommandHandler.h"
#include "Actor/Player.h" #include "Actor/Player.h"
#include "Inventory/Inventory.h"
#include "Session.h" #include "Session.h"
#include "ServerZone.h" #include "ServerZone.h"
#include "Forwards.h"
#include "Framework.h" #include "Framework.h"
extern Core::Framework g_fw; extern Core::Framework g_fw;

View file

@ -7,10 +7,7 @@
#include <Network/PacketContainer.h> #include <Network/PacketContainer.h>
#include <Network/PacketDef/Chat/ServerChatDef.h> #include <Network/PacketDef/Chat/ServerChatDef.h>
#include <Database/DatabaseDef.h> #include <Database/DatabaseDef.h>
#include <Database/DbWorkerPool.h>
#include <Database/CharaDbConnection.h>
#include <boost/format.hpp>
#include <unordered_map> #include <unordered_map>
#include "Network/GameConnection.h" #include "Network/GameConnection.h"
@ -32,10 +29,6 @@
#include "DebugCommand/DebugCommandHandler.h" #include "DebugCommand/DebugCommandHandler.h"
#include "Actor/Player.h"
#include "Inventory/Inventory.h"
#include "Event/EventHelper.h" #include "Event/EventHelper.h"
#include "Action/Action.h" #include "Action/Action.h"
@ -55,9 +48,10 @@ using namespace Core::Network::Packets::Server;
void Core::Network::GameConnection::fcInfoReqHandler( const Packets::GamePacket& inPacket, void Core::Network::GameConnection::fcInfoReqHandler( const Packets::GamePacket& inPacket,
Entity::Player& player ) Entity::Player& player )
{ {
GamePacketPtr pPe( new GamePacket( 0xDD, 0x78, player.getId(), player.getId() ) ); // TODO: use new packet struct for this
pPe->setValAt< uint8_t >( 0x48, 0x01 ); //GamePacketPtr pPe( new GamePacket( 0xDD, 0x78, player.getId(), player.getId() ) );
queueOutPacket( pPe ); //pPe->setValAt< uint8_t >( 0x48, 0x01 );
//queueOutPacket( pPe );
} }
void Core::Network::GameConnection::setSearchInfoHandler( const Packets::GamePacket& inPacket, void Core::Network::GameConnection::setSearchInfoHandler( const Packets::GamePacket& inPacket,

View file

@ -18,8 +18,6 @@
#include "DebugCommand/DebugCommandHandler.h" #include "DebugCommand/DebugCommandHandler.h"
#include "Actor/Player.h"
#include "Action/Action.h" #include "Action/Action.h"
#include "Action/ActionCast.h" #include "Action/ActionCast.h"
#include "Action/ActionMount.h" #include "Action/ActionMount.h"
@ -27,7 +25,6 @@
#include "Script/ScriptMgr.h" #include "Script/ScriptMgr.h"
#include "Session.h" #include "Session.h"
#include "Forwards.h"
#include "Framework.h" #include "Framework.h"
extern Core::Framework g_fw; extern Core::Framework g_fw;

View file

@ -3,7 +3,6 @@
#include <Version.h> #include <Version.h>
#include <Logging/Logger.h> #include <Logging/Logger.h>
#include <Config/XMLConfig.h> #include <Config/XMLConfig.h>
#include <Version.h>
#include <MySqlBase.h> #include <MySqlBase.h>
#include <Connection.h> #include <Connection.h>
@ -26,15 +25,12 @@
#include "Zone/TerritoryMgr.h" #include "Zone/TerritoryMgr.h"
#include "DebugCommand/DebugCommandHandler.h"
#include "Script/ScriptMgr.h" #include "Script/ScriptMgr.h"
#include "Linkshell/LinkshellMgr.h" #include "Linkshell/LinkshellMgr.h"
#include "Forwards.h" #include "Forwards.h"
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include <boost/algorithm/string.hpp>
#include <thread> #include <thread>
#include "Framework.h" #include "Framework.h"
@ -206,7 +202,7 @@ void Core::ServerZone::run( int32_t argc, char* argv[] )
void Core::ServerZone::printBanner() const void Core::ServerZone::printBanner() const
{ {
auto pLog = g_fw.get< Core::Logger>(); auto pLog = g_fw.get< Core::Logger >();
pLog->info("===========================================================" ); pLog->info("===========================================================" );
pLog->info( "Sapphire Server Project " ); pLog->info( "Sapphire Server Project " );
@ -335,15 +331,6 @@ void Core::ServerZone::removeSession( uint32_t sessionId )
m_sessionMapById.erase( sessionId ); m_sessionMapById.erase( sessionId );
} }
void Core::ServerZone::updateSession( uint32_t id )
{
std::lock_guard< std::mutex > lock( m_sessionMutex );
auto it = m_sessionMapById.find( id );
if( it != m_sessionMapById.end() )
it->second->loadPlayer();
}
Core::SessionPtr Core::ServerZone::getSession( uint32_t id ) Core::SessionPtr Core::ServerZone::getSession( uint32_t id )
{ {
//std::lock_guard<std::mutex> lock( m_sessionMutex ); //std::lock_guard<std::mutex> lock( m_sessionMutex );
@ -373,14 +360,6 @@ void Core::ServerZone::removeSession( std::string playerName )
m_sessionMapByName.erase( playerName ); m_sessionMapByName.erase( playerName );
} }
void Core::ServerZone::updateSession( std::string playerName )
{
std::lock_guard< std::mutex > lock( m_sessionMutex );
auto it = m_sessionMapByName.find( playerName );
if( it != m_sessionMapByName.end() )
it->second->loadPlayer();
}
bool Core::ServerZone::isRunning() const bool Core::ServerZone::isRunning() const
{ {

View file

@ -27,8 +27,6 @@ namespace Core {
SessionPtr getSession( uint32_t id ); SessionPtr getSession( uint32_t id );
SessionPtr getSession( std::string playerName ); SessionPtr getSession( std::string playerName );
void updateSession( uint32_t id );
void updateSession( std::string playerName );
size_t getSessionCount() const; size_t getSessionCount() const;
@ -38,7 +36,6 @@ namespace Core {
void printBanner() const; void printBanner() const;
private: private:
uint16_t m_port; uint16_t m_port;