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

Implement offseting eorzean time

Usage:
@set eorzeatime time
This commit is contained in:
Minho Kang 2017-09-22 22:03:57 +09:00
parent 37ff7c70ed
commit 01521d2c98
5 changed files with 31 additions and 3 deletions

View file

@ -116,6 +116,7 @@ namespace Packets {
WeatherChange = 0x01AF, // updated for sb
Discovery = 0x01B2, // updated for sb
EorzeaTimeOffset = 0x01B4,
CFAvailableContents = 0x01CF,

View file

@ -1281,6 +1281,11 @@ struct FFXIVIpcCFMemberStatus : FFXIVIpcBasePacket<CFMemberStatus>
uint32_t unknown3;
};
struct FFXIVIpcEorzeaTimeOffset : FFXIVIpcBasePacket<EorzeaTimeOffset>
{
uint64_t timestamp;
};
} /* Server */

View file

@ -1668,3 +1668,14 @@ void Core::Entity::Player::setOpeningSequence( uint8_t seq )
setSyncFlag( OpeningSeq );
m_openingSequence = seq;
}
/// Tells client to offset their eorzean time by given timestamp.
void Core::Entity::Player::setEorzeaTimeOffset( uint64_t timestamp )
{
// TODO: maybe change to persistent?
GamePacketNew< FFXIVIpcEorzeaTimeOffset, ServerZoneIpcType > packet ( getId() );
packet.data().timestamp = timestamp;
// Send to single player
queuePacket( packet );
}

View file

@ -499,6 +499,10 @@ public:
uint32_t getCFPenaltyMinutes() const;
void setCFPenaltyMinutes( uint32_t minutes );
void setEorzeaTimeOffset( uint64_t timestamp );
private:
uint32_t m_lastWrite;
uint32_t m_lastPing;

View file

@ -254,18 +254,25 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
else if( subCommand == "aaah" )
{
int32_t id;
sscanf( params.c_str(), "%d", &id );
pPlayer->sendDebug( std::to_string( pPlayer->actionHasCastTime( id ) ) );
}
else if ( subCommand == "cfpenalty" )
{
int32_t minutes;
sscanf( params.c_str(), "%d", &minutes );
pPlayer->setCFPenaltyMinutes( minutes );
}
else if ( subCommand == "eorzeatime" )
{
uint64_t timestamp;
sscanf(params.c_str(), "%llu", &timestamp);
pPlayer->setEorzeaTimeOffset( timestamp );
pPlayer->sendNotice( "Eorzea time offset: " + std::to_string( timestamp ) );
}
}