From 7b093af5863dd5017e078527b4495bc1c3812471 Mon Sep 17 00:00:00 2001 From: Jeido Date: Sat, 23 Jan 2021 17:17:39 +0100 Subject: [PATCH 1/3] 5.35 hotfix opcodes --- src/common/Network/PacketDef/Ipcs.h | 66 +++++++++++++++-------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index 0b93fdaf..4f38f3ed 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -66,7 +66,7 @@ namespace Sapphire::Network::Packets Logout = 0x02AD, // updated 5.35 hotfix CFNotify = 0x02C4, // updated 5.35 hotfix CFMemberStatus = 0x0079, - CFDutyInfo = 0x007A, + CFDutyInfo = 0x0193, // updated 5.35 hotfix CFPlayerInNeed = 0xF07F, CFPreferredRole = 0x0196, // updated 5.35 hotfix CFCancel = 0x00EC, // updated 5.35 hotfix @@ -92,7 +92,7 @@ namespace Sapphire::Network::Packets InitSearchInfo = 0x036F, // updated 5.35 hotfix ExamineSearchComment = 0x0102, // updated 4.1 - ServerNoticeShort = 0x0115, // updated 5.0 + ServerNoticeShort = 0x017A, // updated 5.35 hotfix ServerNotice = 0x02F8, // updated 5.35 hotfix SetOnlineStatus = 0x03D7, // updated 5.35 hotfix @@ -131,12 +131,12 @@ namespace Sapphire::Network::Packets BossStatusEffectList = 0x0312, // added 5.1 Effect = 0x0192, // updated 5.35 hotfix AoeEffect8 = 0x012C, // updated 5.35 hotfix - AoeEffect16 = 0x03BF, // updated 5.3 - AoeEffect24 = 0x027E, // updated 5.3 - AoeEffect32 = 0x017E, // updated 5.3 + AoeEffect16 = 0x01B9, // updated 5.35 hotfix + AoeEffect24 = 0x02B4, // updated 5.35 hotfix + AoeEffect32 = 0x00A4, // updated 5.35 hotfix PersistantEffect = 0x0317, // updated 5.35 hotfix - GCAffiliation = 0xF16F, // updated 5.0 + GCAffiliation = 0x0105, // updated 5.35 hotfix PlayerSpawn = 0x0179, // updated 5.35 hotfix NpcSpawn = 0x03A8, // updated 5.35 hotfix @@ -153,7 +153,7 @@ namespace Sapphire::Network::Packets HateRank = 0x02CC, // updated 5.35 hotfix HateList = 0x0198, // updated 5.35 hotfix ObjectSpawn = 0x02B8, // updated 5.35 hotfix - ObjectDespawn = 0xF34B, // updated 5.18 + ObjectDespawn = 0x00C0, // updated 5.35 hotfix UpdateClassInfo = 0x0235, // updated 5.35 hotfix SilentSetClassJob = 0x018E, // updated 5.0 - seems to be the case, not sure if it's actually used for anything PlayerSetup = 0x0290, // updated 5.35 hotfix @@ -213,7 +213,7 @@ namespace Sapphire::Network::Packets Mount = 0x01B5, // updated 5.35 hotfix - DirectorVars = 0x00E6, // updated 5.18 + DirectorVars = 0x011D, // updated 5.35 hotfix SomeDirectorUnk1 = 0x0084, // updated 5.18 SomeDirectorUnk2 = 0xF0C1, // updated 5.18 SomeDirectorUnk4 = 0x0202, // updated 5.35 hotfix @@ -226,10 +226,10 @@ namespace Sapphire::Network::Packets CFAvailableContents = 0xF1FD, // updated 4.2 WeatherChange = 0x027B, // updated 5.35 hotfix - PlayerTitleList = 0x037D, // updated 5.1 + PlayerTitleList = 0x0251, // updated 5.35 hotfix Discovery = 0x031B, // updated 5.35 hotfix - EorzeaTimeOffset = 0xF3B8, // updated 5.1 + EorzeaTimeOffset = 0x01D4, // updated 5.35 hotfix EquipDisplayFlags = 0x00BE, // updated 5.35 hotfix @@ -239,29 +239,29 @@ namespace Sapphire::Network::Packets /// Housing ////////////////////////////////////// - LandSetInitialize = 0x0234, // updated 5.0 - LandUpdate = 0x0235, // updated 5.0 - YardObjectSpawn = 0xF236, // updated 5.0 - HousingIndoorInitialize = 0x0237, // updated 5.0 - LandPriceUpdate = 0x0238, // updated 5.0 + LandSetInitialize = 0x0095, // updated 5.35 hotfix + LandUpdate = 0x00BF, // updated 5.35 hotfix + YardObjectSpawn = 0x01CA, // updated 5.35 hotfix + HousingIndoorInitialize = 0x01FF, // updated 5.35 hotfix + LandPriceUpdate = 0x0380, // updated 5.35 hotfix LandInfoSign = 0x023D, // updated 5.35 hotfix - LandRename = 0x023A, // updated 5.0 - HousingEstateGreeting = 0x023B, // updated 5.0 - HousingUpdateLandFlagsSlot = 0x023C, // updated 5.0 + LandRename = 0x0140, // updated 5.35 hotfix + HousingEstateGreeting = 0x00C7, // updated 5.35 hotfix + HousingUpdateLandFlagsSlot = 0x027E, // updated 5.35 hotfix HousingLandFlags = 0x022F, // updated 5.35 hotfix - HousingShowEstateGuestAccess = 0x023E, // updated 5.0 + HousingShowEstateGuestAccess = 0x03B5, // updated 5.35 hotfix HousingObjectInitialize = 0x01AA, // updated 5.35 hotfix - HousingInternalObjectSpawn = 0xF241, // updated 5.0 + HousingInternalObjectSpawn = 0x0234, // updated 5.35 hotfix HousingWardInfo = 0x02FD, // updated 5.35 hotfix - HousingObjectMove = 0xF244, // updated 5.0 + HousingObjectMove = 0x022C, // updated 5.35 hotfix - SharedEstateSettingsResponse = 0x0245, // updated 4.5 + SharedEstateSettingsResponse = 0x006A, // updated 5.35 hotfix - LandUpdateHouseName = 0x0257, // updated 4.5 + LandUpdateHouseName = 0x00B1, // updated 5.35 hotfix - LandSetMap = 0x025B, // updated 4.5 + LandSetMap = 0x0149, // updated 5.35 hotfix ////////////////////////////////////////////////// @@ -345,7 +345,7 @@ namespace Sapphire::Network::Packets ReqJoinNoviceNetwork = 0x0129, // updated 4.2 - ReqCountdownInitiate = 0x009A, // updated 5.25 + ReqCountdownInitiate = 0x025F, // updated 5.35 hotfix ReqCountdownCancel = 0x0244, // updated 5.25 ZoneLineHandler = 0x0279, // updated 5.35 hotfix @@ -363,17 +363,17 @@ namespace Sapphire::Network::Packets InventoryModifyHandler = 0x0135, // updated 5.35 hotfix - InventoryEquipRecommendedItems = 0x0149, // updated 5.0 + InventoryEquipRecommendedItems = 0x0116, // updated 5.35 hotfix - ReqPlaceHousingItem = 0x014B, // updated 5.0 - BuildPresetHandler = 0x0150, // updated 5.0 + ReqPlaceHousingItem = 0x02AE, // updated 5.35 hotfix + BuildPresetHandler = 0x01C2, // updated 5.35 hotfix TalkEventHandler = 0x02A4, // updated 5.35 hotfix EmoteEventHandler = 0x02C8, // updated 5.35 hotfix WithinRangeEventHandler = 0x0209, // updated 5.35 hotfix OutOfRangeEventHandler = 0x0319, // updated 5.35 hotfix EnterTeriEventHandler = 0x0192, // updated 5.35 hotfix - ShopEventHandler = 0x0156, // updated 5.0 + ShopEventHandler = 0x01F6, // updated 5.35 hotfix ReturnEventHandler = 0x02B4, // updated 5.35 hotfix TradeReturnEventHandler = 0x00A4, // updated 5.35 hotfix @@ -384,9 +384,9 @@ namespace Sapphire::Network::Packets ReqEquipDisplayFlagsChange = 0x02F6, // updated 5.35 hotfix - LandRenameHandler = 0xF177, // updated 5.0 - HousingUpdateHouseGreeting = 0x0178, // updated 5.0 - HousingUpdateObjectPosition = 0x0159, // updated 5.25 + LandRenameHandler = 0x0155, // updated 5.35 hotfix + HousingUpdateHouseGreeting = 0x02EA, // updated 5.35 hotfix + HousingUpdateObjectPosition = 0x00D5, // updated 5.35 hotfix SetSharedEstateSettings = 0x017B, // updated 5.0 @@ -406,6 +406,7 @@ namespace Sapphire::Network::Packets enum ServerChatIpcType : uint16_t { Tell = 0x0064, // updated for sb + PublicContentTell = 0x00FB, // added 4.5, this is used when receiving a /tell in PublicContent instances such as Eureka or Bozja TellErrNotFound = 0x0066, FreeCompanyEvent = 0x012C, // added 5.0 @@ -417,6 +418,7 @@ namespace Sapphire::Network::Packets enum ClientChatIpcType : uint16_t { TellReq = 0x0064, + PublicContentTellReq = 0x0326, // updated 5.35 hotfix, this is used when sending a /tell in PublicContent instances such as Eureka or Bozja }; From 9d5452778a46d81352cd5b756b19cb537bff1ff1 Mon Sep 17 00:00:00 2001 From: Jeido Date: Mon, 25 Jan 2021 17:08:36 +0100 Subject: [PATCH 2/3] Several fixes and improvements -Eobj will keep their animation flag even after respawning -Using !set classjob properly updates stats and UI -Using an emote while /changepose is active doesn't immediatly interrupt the emote anymore -GM2Command Logging moved to info instead of debug to match GM1 -//gm raise doesn't raise the target twice anymore -Fix modelSubWeapon always being reset to 0 upon logging in -Added TerritoryIntendedUses --- src/common/Network/PacketDef/Zone/ServerZoneDef.h | 2 +- src/world/Actor/EventObject.cpp | 10 +++++++++- src/world/Actor/EventObject.h | 3 +++ src/world/Actor/PlayerSql.cpp | 2 +- src/world/Manager/DebugCommandMgr.cpp | 12 ++++++++++++ src/world/Manager/TerritoryMgr.h | 15 +++++++++++++-- .../Network/Handlers/ClientTriggerHandler.cpp | 2 +- src/world/Network/Handlers/GMCommandHandlers.cpp | 4 +--- 8 files changed, 41 insertions(+), 9 deletions(-) diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index f78a9cd3..e21d1427 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -2079,7 +2079,7 @@ namespace Sapphire::Network::Packets::Server uint16_t rotation; int16_t unknown24a; int16_t unknown24b; - uint16_t unknown28a; + uint16_t flag; int16_t unknown28c; uint32_t housingLink; Common::FFXIVARR_POSITION3 position; diff --git a/src/world/Actor/EventObject.cpp b/src/world/Actor/EventObject.cpp index 7287d01f..a5620e94 100644 --- a/src/world/Actor/EventObject.cpp +++ b/src/world/Actor/EventObject.cpp @@ -25,7 +25,8 @@ Sapphire::Entity::EventObject::EventObject( uint32_t actorId, uint32_t objectId, m_state( initialState ), m_objectId( objectId ), m_name( givenName ), - m_housingLink( 0 ) + m_housingLink( 0 ), + m_flag( 0 ) { m_id = actorId; m_pos.x = pos.x; @@ -84,6 +85,12 @@ void Sapphire::Entity::EventObject::setState( uint8_t state ) } } +uint8_t Sapphire::Entity::EventObject::getFlag() const +{ + return m_flag; +} + + void Sapphire::Entity::EventObject::setAnimationFlag( uint32_t flag, uint32_t animationFlag ) { for( const auto& player : m_inRangePlayers ) @@ -131,6 +138,7 @@ void Sapphire::Entity::EventObject::spawn( Sapphire::Entity::PlayerPtr pTarget ) eobjStatePacket->data().actorId = getId(); eobjStatePacket->data().housingLink = getHousingLink(); eobjStatePacket->data().rotation = Util::floatToUInt16Rot( getRot() ); + eobjStatePacket->data().flag = getFlag(); pTarget->queuePacket( eobjStatePacket ); } diff --git a/src/world/Actor/EventObject.h b/src/world/Actor/EventObject.h index 7b38f64d..f2ae6d05 100644 --- a/src/world/Actor/EventObject.h +++ b/src/world/Actor/EventObject.h @@ -25,6 +25,8 @@ namespace Sapphire::Entity float getScale() const; + uint8_t getFlag() const; + void setScale( float scale ); void setOnTalkHandler( OnTalkEventHandler handler ); @@ -54,6 +56,7 @@ namespace Sapphire::Entity uint32_t m_gimmickId; uint32_t m_objectId; uint8_t m_state; + uint8_t m_flag; float m_scale; std::string m_name; TerritoryPtr m_parentInstance; diff --git a/src/world/Actor/PlayerSql.cpp b/src/world/Actor/PlayerSql.cpp index b1f056f1..6c145cbb 100644 --- a/src/world/Actor/PlayerSql.cpp +++ b/src/world/Actor/PlayerSql.cpp @@ -214,7 +214,7 @@ bool Sapphire::Entity::Player::load( uint32_t charId, World::SessionPtr pSession m_mount = res->getUInt8( "Mount" ); - m_modelSubWeapon = 0; + m_modelSubWeapon = getModelSubWeapon(); m_lastTickTime = 0; // first login, run the script event diff --git a/src/world/Manager/DebugCommandMgr.cpp b/src/world/Manager/DebugCommandMgr.cpp index 612ab4f9..2fea49fa 100644 --- a/src/world/Manager/DebugCommandMgr.cpp +++ b/src/world/Manager/DebugCommandMgr.cpp @@ -227,9 +227,21 @@ void Sapphire::World::Manager::DebugCommandMgr::set( char* data, Entity::Player& { player.setLevelForClass( 1, static_cast< Common::ClassJob > ( id ) ); player.setClassJob( static_cast< Common::ClassJob > ( id ) ); + player.sendModel(); + player.sendItemLevel(); + player.calculateStats(); + player.sendStats(); + player.sendStatusEffectUpdate(); + player.sendStatusUpdate(); } else player.setClassJob( static_cast< Common::ClassJob > ( id ) ); + player.sendModel(); + player.sendItemLevel(); + player.calculateStats(); + player.sendStats(); + player.sendStatusEffectUpdate(); + player.sendStatusUpdate(); } else if( subCommand == "cfpenalty" ) { diff --git a/src/world/Manager/TerritoryMgr.h b/src/world/Manager/TerritoryMgr.h index 88935a5f..9401a6a9 100644 --- a/src/world/Manager/TerritoryMgr.h +++ b/src/world/Manager/TerritoryMgr.h @@ -42,6 +42,7 @@ namespace Sapphire::World::Manager AllianceRaid = 8, OpenWorldInstanceBattle = 9, Trial = 10, + RaidPublicArea = 12, HousingArea = 13, HousingPrivateArea = 14, MSQPrivateArea = 15, @@ -49,14 +50,24 @@ namespace Sapphire::World::Manager RaidFights = 17, ChocoboTutorial = 21, Wedding = 22, + DiademV1 = 26, BeginnerTutorial = 27, + PvPTheFeast = 28, + MSQEventArea = 29, FreeCompanyGarrison = 30, PalaceOfTheDead = 31, TreasureMapInstance = 33, EventTrial = 36, - TheFeastArea = 37, + TheFeastArea = 37, //custom match? + DiademV2 = 38, PrivateEventArea = 40, - //Eureka = 41, // wat + Eureka = 41, // wat + TheFeastCrystalTower = 42, + LeapOfFaith = 44, + MaskedCarnival = 45, + OceanFishing = 46, + DiademV3 = 47, + Bozja = 48, }; TerritoryMgr(); diff --git a/src/world/Network/Handlers/ClientTriggerHandler.cpp b/src/world/Network/Handlers/ClientTriggerHandler.cpp index 285df66d..3e1bb620 100644 --- a/src/world/Network/Handlers/ClientTriggerHandler.cpp +++ b/src/world/Network/Handlers/ClientTriggerHandler.cpp @@ -250,7 +250,7 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( const Packets::FFX { player.setPose( static_cast< uint8_t >( param12 ) ); auto pSetStatusPacket = makeActorControl( player.getId(), SetPose, param11, param12 ); - player.sendToInRangeSet( pSetStatusPacket, true ); + player.sendToInRangeSet( pSetStatusPacket, false ); break; } case ClientTriggerType::Return: // return dead / accept raise diff --git a/src/world/Network/Handlers/GMCommandHandlers.cpp b/src/world/Network/Handlers/GMCommandHandlers.cpp index c68fab97..af3b5335 100644 --- a/src/world/Network/Handlers/GMCommandHandlers.cpp +++ b/src/world/Network/Handlers/GMCommandHandlers.cpp @@ -612,7 +612,7 @@ void Sapphire::Network::GameConnection::gm2Handler( const Packets::FFXIVARR_PACK const auto param4 = packet.data().param4; const auto target = std::string( packet.data().target ); - Logger::debug( "{0} used GM2 commandId: {1}, params: {2}, {3}, {4}, {5}, target: {6}", + Logger::info( "{0} used GM2 commandId: {1}, params: {2}, {3}, {4}, {5}, target: {6}", player.getName(), commandId, param1, param2, param3, param4, target ); auto targetSession = serverMgr.getSession( target ); @@ -649,8 +649,6 @@ void Sapphire::Network::GameConnection::gm2Handler( const Packets::FFXIVARR_PACK targetPlayer->setStatus( Common::ActorStatus::Idle ); targetPlayer->sendZoneInPackets( 0x01, 0x01, 0, 113, true ); - - targetPlayer->sendToInRangeSet( makeActorControlSelf( player.getId(), ZoneIn, 0x01, 0x01, 0, 113 ), true ); targetPlayer->sendToInRangeSet( makeActorControl( player.getId(), SetStatus, static_cast< uint8_t >( Common::ActorStatus::Idle ) ), true ); From 066662156677af08800038260b14836a154257ec Mon Sep 17 00:00:00 2001 From: Jeido Date: Mon, 25 Jan 2021 17:46:28 +0100 Subject: [PATCH 3/3] style --- src/world/Actor/EventObject.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/world/Actor/EventObject.cpp b/src/world/Actor/EventObject.cpp index a5620e94..939e2698 100644 --- a/src/world/Actor/EventObject.cpp +++ b/src/world/Actor/EventObject.cpp @@ -90,7 +90,6 @@ uint8_t Sapphire::Entity::EventObject::getFlag() const return m_flag; } - void Sapphire::Entity::EventObject::setAnimationFlag( uint32_t flag, uint32_t animationFlag ) { for( const auto& player : m_inRangePlayers )