2021-11-27 00:53:57 +01:00
|
|
|
#pragma once
|
2018-12-31 23:20:36 +11:00
|
|
|
|
2018-11-22 01:17:19 +11:00
|
|
|
#include "ForwardsZone.h"
|
2021-11-27 00:53:57 +01:00
|
|
|
#include <spdlog/fmt/fmt.h>
|
2018-11-22 01:17:19 +11:00
|
|
|
|
|
|
|
namespace Sapphire::World::Manager
|
|
|
|
{
|
2020-03-01 01:00:57 +11:00
|
|
|
class PlayerMgr
|
2018-11-22 01:17:19 +11:00
|
|
|
{
|
|
|
|
public:
|
2020-03-01 01:00:57 +11:00
|
|
|
PlayerMgr() = default;
|
2018-12-22 22:25:03 +01:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
void onOnlineStatusChanged( Sapphire::Entity::Player& player, bool updateProfile = true );
|
|
|
|
|
|
|
|
void onEquipDisplayFlagsChanged( Sapphire::Entity::Player& player );
|
|
|
|
|
|
|
|
void onSendStateFlags( Sapphire::Entity::Player& player, bool updateInRange );
|
|
|
|
|
|
|
|
void onSendStats( Sapphire::Entity::Player& player );
|
|
|
|
|
|
|
|
void onPlayerStatusUpdate( Sapphire::Entity::Player& player );
|
|
|
|
|
|
|
|
void onChangeClass( Sapphire::Entity::Player& player );
|
|
|
|
|
2023-01-19 13:03:54 -03:00
|
|
|
void onSendAchievementList( Sapphire::Entity::Player& player );
|
|
|
|
|
|
|
|
void onSendAchievementProgress( Sapphire::Entity::Player& player, uint32_t achievementId );
|
|
|
|
|
|
|
|
void onUnlockAchievement( Sapphire::Entity::Player& player, uint32_t achievementId );
|
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
void onPlayerHpMpTpChanged( Sapphire::Entity::Player& player );
|
|
|
|
|
|
|
|
void onPlayerItemLevelUpdate( Sapphire::Entity::Player& player );
|
|
|
|
|
|
|
|
void onLevelUp( Sapphire::Entity::Player& player );
|
|
|
|
|
2023-01-19 13:03:54 -03:00
|
|
|
void onSetLevelForClass( Sapphire::Entity::Player& player, Common::ClassJob classJob );
|
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
void onGainExp( Sapphire::Entity::Player& player, uint32_t exp );
|
|
|
|
|
|
|
|
void onUnlockOrchestrion( Sapphire::Entity::Player& player, uint8_t songId, uint32_t itemId );
|
|
|
|
|
|
|
|
void onChangeGear( Sapphire::Entity::Player& player );
|
|
|
|
|
|
|
|
void onGcUpdate( Sapphire::Entity::Player& player );
|
|
|
|
|
2023-01-23 21:39:12 +01:00
|
|
|
void onCompanionUpdate( Entity::Player& player, uint8_t companionId );
|
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
void onMountUpdate( Sapphire::Entity::Player& player, uint32_t mountId );
|
|
|
|
|
2022-02-23 08:36:23 +01:00
|
|
|
void onMobKill( Sapphire::Entity::Player& player, Sapphire::Entity::BNpc& bnpc );
|
2021-11-27 00:53:57 +01:00
|
|
|
|
|
|
|
void onHateListChanged( Sapphire::Entity::Player& player );
|
|
|
|
|
|
|
|
void onLogin( Sapphire::Entity::Player& player );
|
|
|
|
|
2023-01-15 22:03:44 +01:00
|
|
|
void onDeath( Sapphire::Entity::Player& player );
|
|
|
|
|
2023-01-27 11:13:57 +01:00
|
|
|
void onZone( Sapphire::Entity::Player& player );
|
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
//////////// Helpers
|
|
|
|
|
|
|
|
static void sendServerNotice( Sapphire::Entity::Player& player, const std::string& message );
|
|
|
|
template< typename... Args >
|
|
|
|
static void sendServerNotice( Sapphire::Entity::Player& player, const std::string& message, const Args&... args )
|
|
|
|
{
|
|
|
|
sendServerNotice( player, fmt::format( message, args... ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sendUrgent( Sapphire::Entity::Player& player, const std::string& message );
|
|
|
|
template< typename... Args >
|
|
|
|
static void sendUrgent( Sapphire::Entity::Player& player, const std::string& message, const Args&... args )
|
|
|
|
{
|
|
|
|
sendUrgent( player, fmt::format( message, args... ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sendDebug( Sapphire::Entity::Player& player, const std::string& message );
|
|
|
|
|
|
|
|
template< typename... Args >
|
|
|
|
static void sendDebug( Sapphire::Entity::Player& player, const std::string& message, const Args&... args )
|
|
|
|
{
|
|
|
|
sendDebug( player, fmt::format( message, args... ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sendLogMessage( Sapphire::Entity::Player& player, uint32_t messageId, uint32_t param2 = 0, uint32_t param3 = 0,
|
|
|
|
uint32_t param4 = 0, uint32_t param5 = 0, uint32_t param6 = 0 );
|
|
|
|
|
2018-11-22 01:17:19 +11:00
|
|
|
};
|
2018-12-31 23:20:36 +11:00
|
|
|
}
|