From db2cabf007df10b1458a2f23aeddc51c291bda81 Mon Sep 17 00:00:00 2001 From: reiichi001 Date: Tue, 27 Oct 2020 08:44:16 -0700 Subject: [PATCH 1/5] update IPCs for 5.35 All of the known IPCs from opcodes channel for 5.35 now that 5.35 hotfix is out. --- src/common/Network/PacketDef/Ipcs.h | 102 ++++++++++++++-------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index b188abeb..302d9c3d 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -47,28 +47,28 @@ namespace Sapphire::Network::Packets Init = 0x03B9, // updated 5.25 ActorFreeSpawn = 0x022F, // updated 5.3 - InitZone = 0x0388, // updated 5.3 + InitZone = 00x0303, // updated 5.35 - EffectResult = 0x0346, // updated 5.3 - ActorControl = 0x0344, // updated 5.3 - ActorControlSelf = 0x0212, // updated 5.3 + EffectResult = 0x035E, // updated 5.35 + ActorControl = 0x02DC, // updated 5.35 + ActorControlSelf = 0x032C, // updated 5.35 ActorControlTarget = 0x01EB, // updated 5.25 /*! * @brief Used when resting */ - UpdateHpMpTp = 0x00F8, // updated 5.25 + UpdateHpMpTp = 0x0153, // updated 5.35 /////////////////////////////////////////////////// ChatBanned = 0xF06B, - Playtime = 0x0207, // updated 5.3 + Playtime = 0x03E4, // updated 5.35 Logout = 0x00CD, // updated 5.25 - CFNotify = 0x00FD, // updated 5.3 + CFNotify = 0x016F, // updated 5.35 CFMemberStatus = 0x0079, CFDutyInfo = 0x007A, CFPlayerInNeed = 0xF07F, - CFPreferredRole = 0x013C, // updated 5.3 + CFPreferredRole = 0x0073, // updated 5.35 CFCancel = 0x00B7, // updated 5.25 SocialRequestError = 0xF0AD, @@ -84,8 +84,8 @@ namespace Sapphire::Network::Packets SocialList = 0x0269, // updated 5.25 - ExamineSearchInfo = 0x03A1, // updated 5.3 - UpdateSearchInfo = 0x009E, // updated 5.3 + ExamineSearchInfo = 0x0126, // updated 5.35 + UpdateSearchInfo = 0x0251, // updated 5.35 InitSearchInfo = 0x0347, // updated 5.25 ExamineSearchComment = 0x0102, // updated 4.1 @@ -109,12 +109,12 @@ namespace Sapphire::Network::Packets ReqMoogleMailLetter = 0x0139, // updated 5.0 MailLetterNotification = 0x013A, // updated 5.0 - MarketTaxRates = 0x00C6, // updated 5.3 + MarketTaxRates = 0x030A, // updated 5.35 - MarketBoardSearchResult = 0x00C0, // updated 5.3 - MarketBoardItemListingCount = 0x016C, // updated 5.3 - MarketBoardItemListingHistory = 0x03BB, // updated 5.3 - MarketBoardItemListing = 0x0233, // updated 5.3 + MarketBoardSearchResult = 0x0297, // updated 5.35 + MarketBoardItemListingCount = 0x0075, // updated 5.35 + MarketBoardItemListingHistory = 0x00B8, // updated 5.35 + MarketBoardItemListing = 0x0154, // updated 5.35 CharaFreeCompanyTag = 0x013B, // updated 4.5 FreeCompanyBoardMsg = 0x013C, // updated 4.5 @@ -135,63 +135,63 @@ namespace Sapphire::Network::Packets GCAffiliation = 0xF16F, // updated 5.0 - PlayerSpawn = 0x038E, // updated 5.3 - NpcSpawn = 0x0083, // updated 5.3 + PlayerSpawn = 0x038E, // updated 5.35 + NpcSpawn = 0x01DA, // updated 5.35 NpcSpawn2 = 0x01CB, // ( Bigger statuseffectlist? ) updated 5.3 - ActorMove = 0x0352, // updated 5.3 + ActorMove = 0x02C5, // updated 5.35 ActorSetPos = 0x02A5, // updated 5.3 - ActorCast = 0x00E7, // updated 5.3 + ActorCast = 0x0111, // updated 5.35 SomeCustomiseChangePacketProbably = 0x00CD, // added 5.18 PartyList = 0x0287, // updated 5.18 HateRank = 0x012E, // updated 5.25 HateList = 0x02C4, // updated 5.25 - ObjectSpawn = 0x01A0, // updated 5.3 + ObjectSpawn = 0x01F9, // updated 5.35 ObjectDespawn = 0x034B, // updated 5.18 - UpdateClassInfo = 0x039A, // updated 5.3 + UpdateClassInfo = 0x015D, // updated 5.35 SilentSetClassJob = 0x018E, // updated 5.0 - seems to be the case, not sure if it's actually used for anything - PlayerSetup = 0x00D4, // updated 5.3 - PlayerStats = 0x3D8, // updated 5.3 + PlayerSetup = 0x032D, // updated 5.35 + PlayerStats = 0x0177, // updated 5.35 ActorOwner = 0x0149, // updated 5.25 PlayerStateFlags = 0x0125, // updated 5.25 PlayerClassInfo = 0x034F, // updated 5.25 CharaVisualEffect = 0x0258, // updated 5.25 ModelEquip = 0x01E5, // updated 5.25 - Examine = 0x03C4, // updated 5.3 - CharaNameReq = 0x0127, // updated 5.3 + Examine = 0x0310, // updated 5.35 + CharaNameReq = 0x01D3, // updated 5.35 // nb: see #565 on github UpdateRetainerItemSalePrice = 0x019F, // updated 5.0 RetainerSaleHistory = 0x020E, // updated 5.21 hotfix - RetainerInformation = 0x02B0, // updated 5.3 + RetainerInformation = 0x0321, // updated 5.35 SetLevelSync = 0x1186, // not updated for 4.4, not sure what it is anymore - ItemInfo = 0x02A4, // updated 5.3 + ItemInfo = 0x00F0, // updated 5.35 ContainerInfo = 0x02A8, // updated 5.25 - InventoryTransactionFinish = 0x0193, // updated 5.25 - InventoryTransaction = 0x00C5, // updated 5.3 - CurrencyCrystalInfo = 0x00D7, // updated 5.3 + InventoryTransactionFinish = 0x0241, // updated 5.35 + InventoryTransaction = 0x0136, // updated 5.35 + CurrencyCrystalInfo = 0x0133, // updated 5.35 - InventoryActionAck = 0x01AE, // updated 5.25 - UpdateInventorySlot = 0x036A, // updated 5.3 + InventoryActionAck = 0x0204, // updated 5.35 + UpdateInventorySlot = 0x03BE, // updated 5.35 HuntingLogEntry = 0xF1B3, // updated 5.0 - EventPlay = 0x0379, // updated 5.3 - EventPlay4 = 0x030B, // updated 5.3 - EventPlay8 = 0x014C, // updated 5.25 - EventPlay16 = 0x0074, // updated 5.25 - EventPlay32 = 0x02D9, // updated 5.25 - EventPlay64 = 0x0388, // updated 5.25 - EventPlay128 = 0x03A4, // updated 5.25 - EventPlay255 = 0x01AC, // updated 5.25 + EventPlay = 0x039A, // updated 5.35 + EventPlay4 = 0x0382, // updated 5.35 + EventPlay8 = 0x03E2, // updated 5.35 + EventPlay16 = 0x01DE, // updated 5.35 + EventPlay32 = 0x0115, // updated 5.35 + EventPlay64 = 0x01AF, // updated 5.35 + EventPlay128 = 0x0205, // updated 5.35 + EventPlay255 = 0x0322, // updated 5.35 - EventStart = 0x020D, // updated 5.3 - EventFinish = 0x00DF, // updated 5.3 + EventStart = 0x0131, // updated 5.35 + EventFinish = 0x03DC, // updated 5.35 EventLinkshell = 0x1169, @@ -212,7 +212,7 @@ namespace Sapphire::Network::Packets DirectorVars = 0x00E6, // updated 5.18 SomeDirectorUnk1 = 0x0084, // updated 5.18 SomeDirectorUnk2 = 0xF0C1, // updated 5.18 - SomeDirectorUnk4 = 0x01DF, // updated 5.3 + SomeDirectorUnk4 = 0x0333, // updated 5.35 SomeDirectorUnk8 = 0x028A, // updated 5.18 SomeDirectorUnk16 = 0x028C, // updated 5.18 DirectorPopUp = 0xF162, // updated 5.18 - display dialogue pop-ups in duties and FATEs, for example, Teraflare's countdown @@ -221,7 +221,7 @@ namespace Sapphire::Network::Packets CFAvailableContents = 0xF1FD, // updated 4.2 - WeatherChange = 0x03D6, // updated 5.3 + WeatherChange = 0x00BC, // updated 5.35 PlayerTitleList = 0x037D, // updated 5.1 Discovery = 0x0173, // updated 5.25 @@ -262,7 +262,7 @@ namespace Sapphire::Network::Packets DuelChallenge = 0x0277, // 4.2; this is responsible for opening the ui PerformNote = 0x0286, // updated 4.3 - PrepareZoning = 0x00F9, // updated 5.3 + PrepareZoning = 0x0160, // updated 5.35 ActorGauge = 0x020F, // updated 5.3 // daily quest info -> without them sent, login will take longer... @@ -306,10 +306,10 @@ namespace Sapphire::Network::Packets SocialReqSendHandler = 0x00AE, // updated 4.1 CreateCrossWorldLS = 0x00AF, // updated 4.3 - ChatHandler = 0x01E2, // updated 5.3 + ChatHandler = 0x021C, // updated 5.35 SocialListHandler = 0x0371, // updated 5.25 - SetSearchInfoHandler = 0x0210, // updated 5.3 + SetSearchInfoHandler = 0x034C, // updated 5.35 ReqSearchInfoHandler = 0x0366, // updated 5.25 ReqExamineSearchCommentHandler = 0x00E7, // updated 5.0 @@ -337,7 +337,7 @@ namespace Sapphire::Network::Packets ReqCountdownCancel = 0x0244, // updated 5.25 ZoneLineHandler = 0x0214, // updated 5.25 - ClientTrigger = 0x02BE, // updated 5.3 + ClientTrigger = 0x01DF, // updated 5.3 DiscoveryHandler = 0x02C8, // updated 5.25 PlaceFieldMarkerPreset = 0x023F, // updated 5.25 @@ -347,9 +347,9 @@ namespace Sapphire::Network::Packets GMCommand2 = 0x0368, // updated 5.25 AoESkillHandler = 0x0364, // updated 5.21 hotfix - UpdatePositionHandler = 0x037B, // updated 5.3 + UpdatePositionHandler = 0x00BD, // updated 5.35 - InventoryModifyHandler = 0x0118, // updated 5.3 + InventoryModifyHandler = 0x0343, // updated 5.35 (Base offset: 0x034A) InventoryEquipRecommendedItems = 0x0149, // updated 5.0 @@ -378,7 +378,7 @@ namespace Sapphire::Network::Packets SetSharedEstateSettings = 0x017B, // updated 5.0 - UpdatePositionInstance = 0x0245, // updated 5.3 + UpdatePositionInstance = 0x0081, // updated 5.35 PerformNoteHandler = 0x029B, // updated 4.3 From ff9a8a27e6b4135def44107bbad93e171775ffe0 Mon Sep 17 00:00:00 2001 From: collett Date: Wed, 11 Nov 2020 02:07:59 +0900 Subject: [PATCH 2/5] 5.35 updates --- src/common/Common.h | 10 +- src/common/Network/CommonActorControl.h | 4 +- src/common/Network/PacketDef/Ipcs.h | 288 +++++++++--------- .../Network/PacketDef/Zone/ClientZoneDef.h | 62 ++++ .../Network/PacketDef/Zone/ServerZoneDef.h | 127 +++++++- src/world/Actor/Player.cpp | 31 +- 6 files changed, 358 insertions(+), 164 deletions(-) diff --git a/src/common/Common.h b/src/common/Common.h index 9c3b9bd3..d8e7618c 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -51,11 +51,11 @@ namespace Sapphire::Common enum InventoryOperation : uint16_t { - Discard = 0x0180, - Move = 0x0181, - Swap = 0x0182, - Split = 0x0183, - Merge = 0x0185, + Discard = 0x013C, + Move = 0x013D, + Swap = 0x013E, + Split = 0x013F, + Merge = 0x0141, }; enum ClientLanguage : uint8_t diff --git a/src/common/Network/CommonActorControl.h b/src/common/Network/CommonActorControl.h index 2a74cba4..fbeea52f 100644 --- a/src/common/Network/CommonActorControl.h +++ b/src/common/Network/CommonActorControl.h @@ -271,9 +271,9 @@ namespace Sapphire::Network::ActorControl * Retail sends 12 for mount speed star 1 unlocked and 15 for mount speed star 2 unlocked * This also has to be sent before mounting finishes for it to take effect */ - SetMountSpeed = 0x39F, + SetMountSpeed = 0x3A0, // updated 5.35 hotfix - Dismount = 0x3A1, // updated 4.5 + Dismount = 0x3A2, // updated 5.35 hotfix // Duty Recorder BeginReplayAck = 0x3A2, diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index b188abeb..0c3f8cb1 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -43,78 +43,81 @@ namespace Sapphire::Network::Packets */ enum ServerZoneIpcType : uint16_t { - Ping = 0x017A, // updated 5.25 - Init = 0x03B9, // updated 5.25 + Ping = 0x0219, // updated 5.35 hotfix + Init = 0x0185, // updated 5.35 hotfix - ActorFreeSpawn = 0x022F, // updated 5.3 - InitZone = 0x0388, // updated 5.3 + ActorFreeSpawn = 0x0239, // updated 5.35 hotfix + InitZone = 0x03CD, // updated 5.35 hotfix - EffectResult = 0x0346, // updated 5.3 - ActorControl = 0x0344, // updated 5.3 - ActorControlSelf = 0x0212, // updated 5.3 - ActorControlTarget = 0x01EB, // updated 5.25 + EffectResult = 0x01C2, // updated 5.35 hotfix + ActorControl = 0x02A4, // updated 5.35 hotfix + ActorControlSelf = 0x02C8, // updated 5.35 hotfix + ActorControlTarget = 0x0209, // updated 5.35 hotfix /*! * @brief Used when resting */ - UpdateHpMpTp = 0x00F8, // updated 5.25 + UpdateHpMpTp = 0x0319, // updated 5.35 hotfix /////////////////////////////////////////////////// ChatBanned = 0xF06B, - Playtime = 0x0207, // updated 5.3 - Logout = 0x00CD, // updated 5.25 - CFNotify = 0x00FD, // updated 5.3 + Playtime = 0x03A4, // updated 5.35 hotfix + Logout = 0x02AD, // updated 5.35 hotfix + CFNotify = 0x02C4, // updated 5.35 hotfix CFMemberStatus = 0x0079, CFDutyInfo = 0x007A, CFPlayerInNeed = 0xF07F, - CFPreferredRole = 0x013C, // updated 5.3 - CFCancel = 0x00B7, // updated 5.25 + CFPreferredRole = 0x0196, // updated 5.35 hotfix + CFCancel = 0x00EC, // updated 5.35 hotfix SocialRequestError = 0xF0AD, - CFRegistered = 0x00B8, // updated 4.1 - SocialRequestResponse = 0x00BB, // updated 4.1 + CFRegistered = 0x010C, // updated 5.35 hotfix + SocialRequestResponse = 0x01C7, // updated 5.35 hotfix + SocialMessage = 0x0308, // updated 5.35 hotfix + SocialMessage2 = 0x037C, // updated 5.35 hotfix CancelAllianceForming = 0x00C6, // updated 4.2 LogMessage = 0x00D0, - Chat = 0x0161, // updated 5.25 + Chat = 0x0349, // updated 5.35 hotfix + PartyChat = 0x0065, WorldVisitList = 0xF0FE, // added 4.5 - SocialList = 0x0269, // updated 5.25 + SocialList = 0x0216, // updated 5.35 hotfix - ExamineSearchInfo = 0x03A1, // updated 5.3 - UpdateSearchInfo = 0x009E, // updated 5.3 - InitSearchInfo = 0x0347, // updated 5.25 + ExamineSearchInfo = 0x03C3, // updated 5.35 hotfix + UpdateSearchInfo = 0x0121, // updated 5.35 hotfix + InitSearchInfo = 0x036F, // updated 5.35 hotfix ExamineSearchComment = 0x0102, // updated 4.1 ServerNoticeShort = 0x0115, // updated 5.0 - ServerNotice = 0x00E9, // updated 5.25 - SetOnlineStatus = 0x0381, // updated 5.25 + ServerNotice = 0x02F8, // updated 5.35 hotfix + SetOnlineStatus = 0x03D7, // updated 5.35 hotfix CountdownInitiate = 0x0237, // updated 5.25 CountdownCancel = 0x00D9, // updated 5.18 PlayerAddedToBlacklist = 0x033F, // updated 5.1 PlayerRemovedFromBlacklist = 0x0385, // updated 5.1 - BlackList = 0x027A, // updated 5.25 + BlackList = 0x02DB, // updated 5.35 hotfix - LinkshellList = 0x00A9, // updated 5.25 + LinkshellList = 0x01F0, // updated 5.35 hotfix MailDeleteRequest = 0xF12B, // updated 5.0 // 12D - 137 - constant gap between 4.5x -> 5.0 - ReqMoogleMailList = 0x0138, // updated 5.0 - ReqMoogleMailLetter = 0x0139, // updated 5.0 + ReqMoogleMailList = 0xF138, // updated 5.0 + ReqMoogleMailLetter = 0xF139, // updated 5.0 MailLetterNotification = 0x013A, // updated 5.0 - MarketTaxRates = 0x00C6, // updated 5.3 + MarketTaxRates = 0x01F8, // updated 5.35 hotfix - MarketBoardSearchResult = 0x00C0, // updated 5.3 - MarketBoardItemListingCount = 0x016C, // updated 5.3 - MarketBoardItemListingHistory = 0x03BB, // updated 5.3 - MarketBoardItemListing = 0x0233, // updated 5.3 + MarketBoardSearchResult = 0x032C, // updated 5.35 hotfix + MarketBoardItemListingCount = 0x038F, // updated 5.35 hotfix + MarketBoardItemListingHistory = 0x0186, // updated 5.35 hotfix + MarketBoardItemListing = 0x025F, // updated 5.35 hotfix CharaFreeCompanyTag = 0x013B, // updated 4.5 FreeCompanyBoardMsg = 0x013C, // updated 4.5 @@ -123,96 +126,97 @@ namespace Sapphire::Network::Packets FreeCompanyUpdateShortMessage = 0xF157, // added 5.0 - StatusEffectList = 0x0172, // updated 5.3 + StatusEffectList = 0x0382, // updated 5.35 hotfix EurekaStatusEffectList = 0x0167, // updated 5.18 BossStatusEffectList = 0x0312, // added 5.1 - Effect = 0x00F4, // updated 5.3 - AoeEffect8 = 0x00C9, // updated 5.3 + 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 - PersistantEffect = 0x032E, // updated 5.25 + PersistantEffect = 0x0317, // updated 5.35 hotfix GCAffiliation = 0xF16F, // updated 5.0 - PlayerSpawn = 0x038E, // updated 5.3 - NpcSpawn = 0x0083, // updated 5.3 + PlayerSpawn = 0x0179, // updated 5.35 hotfix + NpcSpawn = 0x03A8, // updated 5.35 hotfix NpcSpawn2 = 0x01CB, // ( Bigger statuseffectlist? ) updated 5.3 - ActorMove = 0x0352, // updated 5.3 + ActorMove = 0x01BF, // updated 5.35 hotfix - ActorSetPos = 0x02A5, // updated 5.3 + ActorSetPos = 0x03DF, // updated 5.35 hotfix - ActorCast = 0x00E7, // updated 5.3 + ActorCast = 0x0302, // updated 5.35 hotfix SomeCustomiseChangePacketProbably = 0x00CD, // added 5.18 - PartyList = 0x0287, // updated 5.18 - HateRank = 0x012E, // updated 5.25 - HateList = 0x02C4, // updated 5.25 - ObjectSpawn = 0x01A0, // updated 5.3 - ObjectDespawn = 0x034B, // updated 5.18 - UpdateClassInfo = 0x039A, // updated 5.3 + PartyList = 0x02B2, // updated 5.35 hotfix + PartyMessage = 0x00AE, // updated 5.35 hotfix + HateRank = 0x02CC, // updated 5.35 hotfix + HateList = 0x0198, // updated 5.35 hotfix + ObjectSpawn = 0x02B8, // updated 5.35 hotfix + ObjectDespawn = 0xF34B, // updated 5.18 + 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 = 0x00D4, // updated 5.3 - PlayerStats = 0x3D8, // updated 5.3 - ActorOwner = 0x0149, // updated 5.25 - PlayerStateFlags = 0x0125, // updated 5.25 - PlayerClassInfo = 0x034F, // updated 5.25 - CharaVisualEffect = 0x0258, // updated 5.25 + PlayerSetup = 0x0290, // updated 5.35 hotfix + PlayerStats = 0x023B, // updated 5.35 hotfix + ActorOwner = 0x00E8, // updated 5.35 hotfix + PlayerStateFlags = 0x00F8, // updated 5.35 hotfix + PlayerClassInfo = 0x02C3, // updated 5.35 hotfix + CharaVisualEffect = 0x02E2, // updated 5.35 hotfix - ModelEquip = 0x01E5, // updated 5.25 - Examine = 0x03C4, // updated 5.3 - CharaNameReq = 0x0127, // updated 5.3 + ModelEquip = 0x0277, // updated 5.35 hotfix + Examine = 0x00BC, // updated 5.35 hotfix + CharaNameReq = 0x008E, // updated 5.35 hotfix // nb: see #565 on github - UpdateRetainerItemSalePrice = 0x019F, // updated 5.0 + UpdateRetainerItemSalePrice = 0xF19F, // updated 5.0 RetainerSaleHistory = 0x020E, // updated 5.21 hotfix - RetainerInformation = 0x02B0, // updated 5.3 + RetainerInformation = 0x01F9, // updated 5.35 hotfix SetLevelSync = 0x1186, // not updated for 4.4, not sure what it is anymore - ItemInfo = 0x02A4, // updated 5.3 - ContainerInfo = 0x02A8, // updated 5.25 - InventoryTransactionFinish = 0x0193, // updated 5.25 - InventoryTransaction = 0x00C5, // updated 5.3 - CurrencyCrystalInfo = 0x00D7, // updated 5.3 + ItemInfo = 0x0214, // updated 5.35 hotfix + ContainerInfo = 0x00C5, // updated 5.35 hotfix + InventoryTransactionFinish = 0x02F0, // updated 5.35 hotfix + InventoryTransaction = 0x01FD, // updated 5.35 hotfix + CurrencyCrystalInfo = 0x0379, // updated 5.35 hotfix - InventoryActionAck = 0x01AE, // updated 5.25 - UpdateInventorySlot = 0x036A, // updated 5.3 + InventoryActionAck = 0x03E4, // updated 5.35 hotfix + UpdateInventorySlot = 0x036A, // updated 5.35 hotfix - HuntingLogEntry = 0xF1B3, // updated 5.0 + HuntingLogEntry = 0x0146, // updated 5.35 hotfix - EventPlay = 0x0379, // updated 5.3 - EventPlay4 = 0x030B, // updated 5.3 - EventPlay8 = 0x014C, // updated 5.25 - EventPlay16 = 0x0074, // updated 5.25 - EventPlay32 = 0x02D9, // updated 5.25 - EventPlay64 = 0x0388, // updated 5.25 - EventPlay128 = 0x03A4, // updated 5.25 - EventPlay255 = 0x01AC, // updated 5.25 + EventPlay = 0x00F3, // updated 5.35 hotfix + EventPlay4 = 0x00AC, // updated 5.35 hotfix + EventPlay8 = 0x023F, // updated 5.35 hotfix + EventPlay16 = 0x025B, // updated 5.35 hotfix + EventPlay32 = 0x029A, // updated 5.35 hotfix + EventPlay64 = 0x02C1, // updated 5.35 hotfix + EventPlay128 = 0x038A, // updated 5.35 hotfix + EventPlay255 = 0x034B, // updated 5.35 hotfix - EventStart = 0x020D, // updated 5.3 - EventFinish = 0x00DF, // updated 5.3 + EventStart = 0x009A, // updated 5.35 hotfix + EventFinish = 0x007E, // updated 5.35 hotfix EventLinkshell = 0x1169, - QuestActiveList = 0x0391, // updated 5.25 - QuestUpdate = 0x0352, // updated 5.25 - QuestCompleteList = 0x0231, // updated 5.25 + QuestActiveList = 0x0117, // updated 5.35 hotfix + QuestUpdate = 0x0073, // updated 5.35 hotfix + QuestCompleteList = 0x0240, // updated 5.35 hotfix - QuestFinish = 0x02B6, // updated 5.25 - MSQTrackerComplete = 0x01D6, // updated 5.0 + QuestFinish = 0x00E9, // updated 5.35 hotfix + MSQTrackerComplete = 0xF1D6, // updated 5.0 MSQTrackerProgress = 0xF1CD, // updated 4.5 ? this actually looks like the two opcodes have been combined, see #474 - QuestMessage = 0x0093, // updated 5.25 + QuestMessage = 0x0381, // updated 5.35 hotfix - QuestTracker = 0x00AD, // updated 5.25 + QuestTracker = 0x018B, // updated 5.35 hotfix - Mount = 0x02BE, // updated 5.25 + Mount = 0x01B5, // updated 5.35 hotfix DirectorVars = 0x00E6, // updated 5.18 SomeDirectorUnk1 = 0x0084, // updated 5.18 SomeDirectorUnk2 = 0xF0C1, // updated 5.18 - SomeDirectorUnk4 = 0x01DF, // updated 5.3 + SomeDirectorUnk4 = 0x0202, // updated 5.35 hotfix SomeDirectorUnk8 = 0x028A, // updated 5.18 SomeDirectorUnk16 = 0x028C, // updated 5.18 DirectorPopUp = 0xF162, // updated 5.18 - display dialogue pop-ups in duties and FATEs, for example, Teraflare's countdown @@ -221,35 +225,37 @@ namespace Sapphire::Network::Packets CFAvailableContents = 0xF1FD, // updated 4.2 - WeatherChange = 0x03D6, // updated 5.3 + WeatherChange = 0x027B, // updated 5.35 hotfix PlayerTitleList = 0x037D, // updated 5.1 - Discovery = 0x0173, // updated 5.25 + Discovery = 0x031B, // updated 5.35 hotfix - EorzeaTimeOffset = 0x03B8, // updated 5.1 + EorzeaTimeOffset = 0xF3B8, // updated 5.1 - EquipDisplayFlags = 0x010D, // updated 5.25 + EquipDisplayFlags = 0x00BE, // updated 5.35 hotfix MiniCactpotInit = 0x0286, // added 5.31 + ShopMessage = 0x0197, // updated 5.35 hotfix + LootMessage = 0x01B7, // updated 5.35 hotfix /// Housing ////////////////////////////////////// LandSetInitialize = 0x0234, // updated 5.0 LandUpdate = 0x0235, // updated 5.0 - YardObjectSpawn = 0x0236, // updated 5.0 + YardObjectSpawn = 0xF236, // updated 5.0 HousingIndoorInitialize = 0x0237, // updated 5.0 LandPriceUpdate = 0x0238, // updated 5.0 - LandInfoSign = 0x037F, // updated 5.25 + LandInfoSign = 0x023D, // updated 5.35 hotfix LandRename = 0x023A, // updated 5.0 HousingEstateGreeting = 0x023B, // updated 5.0 HousingUpdateLandFlagsSlot = 0x023C, // updated 5.0 - HousingLandFlags = 0x0177, // updated 5.25 + HousingLandFlags = 0x022F, // updated 5.35 hotfix HousingShowEstateGuestAccess = 0x023E, // updated 5.0 - HousingObjectInitialize = 0x0333, // updated 5.25 - HousingInternalObjectSpawn = 0x241, // updated 5.0 + HousingObjectInitialize = 0x01AA, // updated 5.35 hotfix + HousingInternalObjectSpawn = 0xF241, // updated 5.0 - HousingWardInfo = 0x01D1, // updated 5.25 - HousingObjectMove = 0x0244, // updated 5.0 + HousingWardInfo = 0x02FD, // updated 5.35 hotfix + HousingObjectMove = 0xF244, // updated 5.0 SharedEstateSettingsResponse = 0x0245, // updated 4.5 @@ -262,12 +268,12 @@ namespace Sapphire::Network::Packets DuelChallenge = 0x0277, // 4.2; this is responsible for opening the ui PerformNote = 0x0286, // updated 4.3 - PrepareZoning = 0x00F9, // updated 5.3 - ActorGauge = 0x020F, // updated 5.3 + PrepareZoning = 0x026C, // updated 5.35 hotfix + ActorGauge = 0x0112, // updated 5.35 hotfix // daily quest info -> without them sent, login will take longer... - DailyQuests = 0x031E, // updated 5.25 - DailyQuestRepeatFlags = 0x00A7, // updated 5.25 + DailyQuests = 0x0139, // updated 5.35 hotfix + DailyQuestRepeatFlags = 0x024C, // updated 5.35 hotfix /// Doman Mahjong ////////////////////////////////////// MahjongOpenGui = 0x02A4, // only available in mahjong instance @@ -287,37 +293,43 @@ namespace Sapphire::Network::Packets */ enum ClientZoneIpcType : uint16_t { - PingHandler = 0x017A, // updated 5.25 - InitHandler = 0x03B9, // updated 5.25 + PingHandler = 0x0219, // updated 5.35 hotfix + InitHandler = 0x0185, // updated 5.35 hotfix - FinishLoadingHandler = 0x008A, // updated 5.25 + FinishLoadingHandler = 0x01BE, // updated 5.35 hotfix - CFCommenceHandler = 0x0228, // updated 5.25 + CFCommenceHandler = 0x0118, // updated 5.35 hotfix - CFCancelHandler = 0x013E, // updated 5.25 - CFRegisterDuty = 0x0180, // updated 5.25 - CFRegisterRoulette = 0x0395, // updated 5.25 - PlayTimeHandler = 0x02FE, // updated 5.25 - LogoutHandler = 0x00B7, // updated 5.25 - CancelLogout = 0x008F, // updated 5.1 + CFCancelHandler = 0x0332, // updated 5.35 hotfix + CFRegisterDuty = 0x0289, // updated 5.35 hotfix + CFRegisterRoulette = 0x0088, // updated 5.35 hotfix + PlayTimeHandler = 0x02A8, // updated 5.35 hotfix + LogoutHandler = 0x00EC, // updated 5.35 hotfix + CancelLogout = 0x03DB, // updated 5.35 hotfix CFDutyInfoHandler = 0x0078, // updated 4.2 - SocialReqSendHandler = 0x00AE, // updated 4.1 + SocialReqSendHandler = 0x0387, // updated 5.35 hotfix + SocialResponseHandler = 0x028D, // updated 5.35 hotfix CreateCrossWorldLS = 0x00AF, // updated 4.3 - ChatHandler = 0x01E2, // updated 5.3 + ChatHandler = 0x0131, // updated 5.35 hotfix + PartyChatHandler = 0x0065, + PartySetLeaderHandler = 0x0208, // updated 5.35 hotfix + LeavePartyHandler = 0x0337, // updated 5.35 hotfix + KickPartyMemberHandler = 0x014C, // updated 5.35 hotfix + DisbandPartyHandler = 0x0205, // updated 5.35 hotfix - SocialListHandler = 0x0371, // updated 5.25 - SetSearchInfoHandler = 0x0210, // updated 5.3 - ReqSearchInfoHandler = 0x0366, // updated 5.25 + SocialListHandler = 0x0340, // updated 5.35 hotfix + SetSearchInfoHandler = 0x0314, // updated 5.35 hotfix + ReqSearchInfoHandler = 0x01E9, // updated 5.35 hotfix ReqExamineSearchCommentHandler = 0x00E7, // updated 5.0 ReqRemovePlayerFromBlacklist = 0x00F1, // updated 5.0 - BlackListHandler = 0x0354, // updated 5.25 + BlackListHandler = 0x0079, // updated 5.35 hotfix PlayerSearchHandler = 0x00F4, // updated 5.0 - LinkshellListHandler = 0x01D4, // updated 5.25 + LinkshellListHandler = 0x024B, // updated 5.35 hotfix MarketBoardRequestItemListingInfo = 0x0102, // updated 4.5 MarketBoardRequestItemListings = 0x0103, // updated 4.5 @@ -336,41 +348,41 @@ namespace Sapphire::Network::Packets ReqCountdownInitiate = 0x009A, // updated 5.25 ReqCountdownCancel = 0x0244, // updated 5.25 - ZoneLineHandler = 0x0214, // updated 5.25 - ClientTrigger = 0x02BE, // updated 5.3 - DiscoveryHandler = 0x02C8, // updated 5.25 + ZoneLineHandler = 0x0279, // updated 5.35 hotfix + ClientTrigger = 0x03D3, // updated 5.35 hotfix + DiscoveryHandler = 0x00E3, // updated 5.35 hotfix PlaceFieldMarkerPreset = 0x023F, // updated 5.25 PlaceFieldMarker = 0x01BA, // updated 5.25 - SkillHandler = 0x033C, // updated 5.3 - GMCommand1 = 0x01EC, // updated 5.25 - GMCommand2 = 0x0368, // updated 5.25 - AoESkillHandler = 0x0364, // updated 5.21 hotfix + SkillHandler = 0x01CD, // updated 5.35 hotfix + GMCommand1 = 0x02AC, // updated 5.35 hotfix + GMCommand2 = 0x029F, // updated 5.35 hotfix + AoESkillHandler = 0x030C, // updated 5.35 hotfix - UpdatePositionHandler = 0x037B, // updated 5.3 + UpdatePositionHandler = 0x0236, // updated 5.35 hotfix - InventoryModifyHandler = 0x0118, // updated 5.3 + InventoryModifyHandler = 0x0135, // updated 5.35 hotfix InventoryEquipRecommendedItems = 0x0149, // updated 5.0 ReqPlaceHousingItem = 0x014B, // updated 5.0 BuildPresetHandler = 0x0150, // updated 5.0 - TalkEventHandler = 0x030F, // updated 5.25 - EmoteEventHandler = 0x01DD, // updated 5.25 - WithinRangeEventHandler = 0x0165, // updated 5.25 - OutOfRangeEventHandler = 0x01EB, // updated 5.25 - EnterTeriEventHandler = 0x00F8, // updated 5.25 + 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 - ReturnEventHandler = 0x00BB, // updated 5.25 - TradeReturnEventHandler = 0x03B6, // updated 5.25 - TradeMultipleReturnEventHander = 0x02B0, // updated 5.25 + ReturnEventHandler = 0x02B4, // updated 5.35 hotfix + TradeReturnEventHandler = 0x00A4, // updated 5.35 hotfix + TradeMultipleReturnEventHander = 0x035C, // updated 5.35 hotfix LinkshellEventHandler = 0x016B, // updated 4.5 LinkshellEventHandler1 = 0x016C, // updated 4.5 - ReqEquipDisplayFlagsChange = 0x0202, // updated 5.25 + ReqEquipDisplayFlagsChange = 0x02F6, // updated 5.35 hotfix LandRenameHandler = 0xF177, // updated 5.0 HousingUpdateHouseGreeting = 0x0178, // updated 5.0 @@ -378,13 +390,11 @@ namespace Sapphire::Network::Packets SetSharedEstateSettings = 0x017B, // updated 5.0 - UpdatePositionInstance = 0x0245, // updated 5.3 + UpdatePositionInstance = 0x0345, // updated 5.35 hotfix PerformNoteHandler = 0x029B, // updated 4.3 - WorldInteractionHandler = 0x0285, // updated 5.25 - ShopMessage = 0x00C1, // updated 5.25 - LootMessage = 0x00B1, // updated 5.25 + WorldInteractionHandler = 0x00A9, // updated 5.35 hotfix }; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/common/Network/PacketDef/Zone/ClientZoneDef.h b/src/common/Network/PacketDef/Zone/ClientZoneDef.h index 7df75c0e..bfadc021 100644 --- a/src/common/Network/PacketDef/Zone/ClientZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ClientZoneDef.h @@ -207,6 +207,13 @@ struct FFXIVIpcChatHandler : /* 001A */ char message[1012]; }; +struct FFXIVIpcPartyChatHandler : + FFXIVIpcBasePacket< ChatHandler > +{ + uint64_t unknown; + char message[1024]; +}; + struct FFXIVIpcShopEventHandler : FFXIVIpcBasePacket< ShopEventHandler > { @@ -355,6 +362,61 @@ struct FFXIVIpcWorldInteractionHandler : Common::FFXIVARR_POSITION3 position; }; +struct FFXIVIpcSocialReqSendHandler : + FFXIVIpcBasePacket< SocialReqSendHandler > +{ + uint64_t unknown; + uint8_t p1; + uint8_t p2; + uint8_t socialType; + char name[32]; + uint8_t padding[5]; +}; + +struct FFXIVIpcSocialResponseHandler : + FFXIVIpcBasePacket< SocialResponseHandler > +{ + uint64_t contentId; + uint8_t p1; + uint8_t p2; + uint8_t socialType; + uint8_t response; + uint32_t unknown; +}; + +struct FFXIVIpcPartySetLeaderHandler : + FFXIVIpcBasePacket< PartySetLeaderHandler > +{ + uint64_t contentId; + uint8_t p1; + uint8_t p2; + char name[32]; + uint8_t padding[6]; +}; + +struct FFXIVIpcLeavePartyHandler : + FFXIVIpcBasePacket< LeavePartyHandler > +{ + uint64_t empty; +}; + +struct FFXIVIpcKickPartyMemberHander : + FFXIVIpcBasePacket< KickPartyMemberHandler > +{ + uint64_t contentId; + uint8_t p1; + uint8_t p2; + char name[32]; + uint8_t padding[6]; +}; + +struct FFXIVIpcDisbandPartyHandler : + FFXIVIpcBasePacket< DisbandPartyHandler > +{ + uint64_t empty; +}; + + } #endif //_CORE_NETWORK_PACKETS_ZONE_CLIENT_IPC_H diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index 92ced6ca..f78a9cd3 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -46,6 +46,19 @@ namespace Sapphire::Network::Packets::Server char msg[1012]; }; + struct FFXIVIpcPartyChat : FFXIVIpcBasePacket< PartyChat > + { + uint64_t unknown; + uint64_t contentId; + uint32_t charaId; + uint8_t u1; + uint8_t u2; + uint8_t u3; + char name[32]; + char message[1024]; + uint8_t padding; + }; + struct FFXIVIpcChatBanned : FFXIVIpcBasePacket< ChatBanned > { uint8_t padding[4]; // I was not sure reinterpreting ZST is valid behavior in C++. @@ -1010,6 +1023,7 @@ namespace Sapphire::Network::Packets::Server unsigned int pvpExp; unsigned int pvpFrontlineOverallRanks[3]; unsigned short levels[Common::CLASSJOB_SLOTS]; + /* unsigned short unknown15C[9]; unsigned short u1; unsigned short u2; @@ -1026,6 +1040,15 @@ namespace Sapphire::Network::Packets::Server unsigned char u19[8]; unsigned char mountGuideMask[22]; unsigned char u19_2; + */ + unsigned char unknown5_3a[176]; + unsigned char companionName[21]; + unsigned char companionDefRank; + unsigned char companionAttRank; + unsigned char companionHealRank; + unsigned char mountGuideMask[23]; + unsigned char maybeReservedMountSlots; + //== char name[32]; unsigned char unknownOword[16]; unsigned char unknownOw; @@ -1033,13 +1056,14 @@ namespace Sapphire::Network::Packets::Server unsigned char aetheryte[21]; unsigned char discovery[445]; unsigned char howto[34]; - unsigned char minions[45]; + unsigned char minions[51]; unsigned char chocoboTaxiMask[10]; - unsigned char watchedCutscenes[124]; + unsigned char watchedCutscenes[131]; unsigned char companionBardingMask[10]; unsigned char companionEquippedHead; unsigned char companionEquippedBody; unsigned char companionEquippedLegs; + /* unsigned char unknown52A[4]; unsigned char unknownMask52E[11]; unsigned char fishingGuideMask[105]; @@ -1049,7 +1073,11 @@ namespace Sapphire::Network::Packets::Server unsigned char beastRank[11]; unsigned char unknownPvp5AB[11]; unsigned char unknown5B9[5]; + */ + unsigned char unknown5_3c[234]; + //== unsigned char pose; + /* unsigned char unknown5B91; unsigned char challengeLogComplete[9]; unsigned char weaponPose; @@ -1063,24 +1091,30 @@ namespace Sapphire::Network::Packets::Server unsigned char u13; unsigned char aetherCurrentMask[22]; unsigned char u10[3]; + */ + unsigned char unknown5_3d[292]; + //== unsigned char orchestrionMask[40]; unsigned char hallOfNoviceCompletion[3]; unsigned char animaCompletion[11]; - unsigned char u14[16]; - unsigned char u15[13]; + unsigned char unknown5_3e[33]; unsigned char unlockedRaids[28]; unsigned char unlockedDungeons[18]; unsigned char unlockedGuildhests[10]; - unsigned char unlockedTrials[8]; + unsigned char unlockedTrials[9]; // 5.35 trial:pvp either 9:5 or 8:6 not confirmed unsigned char unlockedPvp[5]; unsigned char clearedRaids[28]; unsigned char clearedDungeons[18]; unsigned char clearedGuildhests[10]; - unsigned char clearedTrials[8]; + unsigned char clearedTrials[9]; unsigned char clearedPvp[5]; + /* unsigned short fishingRecordsFishWeight[26]; unsigned int exploratoryMissionNextTimestamp; unsigned char pvpLevel; + */ + unsigned char padding2[8]; + //== }; @@ -1764,6 +1798,7 @@ namespace Sapphire::Network::Packets::Server struct FFXIVIpcMount : FFXIVIpcBasePacket< Mount > { uint32_t id; + uint32_t padding[3]; }; /** @@ -1981,7 +2016,7 @@ namespace Sapphire::Network::Packets::Server uint32_t housePrice; uint8_t infoFlags; Common::HousingAppeal houseAppeal[3]; - char estateOwnerName[30]; + char estateOwnerName[32]; } houseInfoEntry[60]; }; @@ -2125,6 +2160,84 @@ namespace Sapphire::Network::Packets::Server uint32_t param6; uint32_t param7; }; + + struct FFXIVIpcSocialMessage : FFXIVIpcBasePacket< SocialMessage > + { + uint64_t contentId; + uint32_t expireTime; + uint8_t p1; + uint8_t p2; + uint8_t socialType; + uint8_t padding; + uint8_t type; + uint8_t unknown4; + char name[32]; + uint8_t padding2[6]; + }; + + struct FFXIVIpcSocialMessage2 : FFXIVIpcBasePacket< SocialMessage2 > + { + uint64_t contentId; + uint32_t unknown3; + uint8_t p1; + uint8_t p2; + uint8_t socialType; + uint8_t padding; + char name[32]; + }; + + struct FFXIVIpcSocialRequestResponse : FFXIVIpcBasePacket< SocialRequestResponse > + { + uint64_t contentId; + uint32_t unknown3; + uint8_t u1AlwaysOne; + uint8_t response; + uint8_t u2AlwaysOne; + char name[32]; + uint8_t padding; + }; + + struct FFXIVIpcPartyList : FFXIVIpcBasePacket< PartyList > + { + struct + { + char name[32]; + uint64_t contentId; + uint32_t charaId; + uint32_t u1; + uint32_t u2; + uint32_t hp; + uint32_t maxHp; + uint16_t mp; + uint16_t maxMp; + uint16_t u3; + uint16_t zoneId; + uint8_t gposeSelectable; + uint8_t classId; + uint8_t u5; + uint8_t level; + uint8_t otherData[368]; + } member[8]; + uint64_t someContentId1; + uint64_t someContentId2; + uint8_t leaderIndex; + uint8_t partySize; + uint16_t padding1; + uint32_t padding2; + }; + + struct FFXIVIpcPartyMessage : FFXIVIpcBasePacket< PartyMessage > + { + uint64_t leaderContentId; + uint64_t memberContentId; + uint8_t u1; + uint8_t u2; + uint16_t type; + uint8_t partySize; // ? + char leaderName[32]; + char memberName[32]; + uint8_t padding[3]; + }; } #endif /*_CORE_NETWORK_PACKETS_SERVER_IPC_H*/ diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index f64f6afc..aa882b45 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -1544,22 +1544,31 @@ uint8_t Sapphire::Entity::Player::getEquipDisplayFlags() const void Sapphire::Entity::Player::mount( uint32_t id ) { - m_mount = id; - sendToInRangeSet( makeActorControl( getId(), ActorControlType::SetStatus, - static_cast< uint8_t >( Common::ActorStatus::Mounted ) ), true ); - sendToInRangeSet( makeActorControlSelf( getId(), 0x39e, 12 ), true ); //? + if( id > 0 ) + { + m_mount = id; + sendToInRangeSet( makeActorControl( getId(), ActorControlType::SetStatus, + static_cast< uint8_t >( Common::ActorStatus::Mounted ) ), true ); + sendToInRangeSet( makeActorControlSelf( getId(), ActorControlType::SetMountSpeed, 12 ), true ); + sendToInRangeSet( makeActorControlSelf( getId(), 0x107, 1 ), true ); - auto mountPacket = makeZonePacket< FFXIVIpcMount >( getId() ); - mountPacket->data().id = id; - sendToInRangeSet( mountPacket, true ); + auto mountPacket = makeZonePacket< FFXIVIpcMount >( getId() ); + mountPacket->data().id = id; + sendToInRangeSet( mountPacket, true ); + } } void Sapphire::Entity::Player::dismount() { - sendToInRangeSet( makeActorControl( getId(), ActorControlType::SetStatus, - static_cast< uint8_t >( Common::ActorStatus::Idle ) ), true ); - sendToInRangeSet( makeActorControlSelf( getId(), ActorControlType::Dismount, 1 ), true ); - m_mount = 0; + if( m_mount > 0 ) + { + sendToInRangeSet( makeActorControl( getId(), ActorControlType::SetStatus, + static_cast< uint8_t >( Common::ActorStatus::Idle ) ), true ); + sendToInRangeSet( makeActorControl( getId(), ActorControlType::Dismount, 1 ), true ); + sendToInRangeSet( makeActorControlSelf( getId(), 0x393, 1 ), true ); + sendToInRangeSet( makeActorControlSelf( getId(), 0x107, 0 ), true ); + m_mount = 0; + } } void Sapphire::Entity::Player::spawnCompanion( uint16_t id ) From 40b192b6ea723eeb3867e721ee4f31f8edcbe416 Mon Sep 17 00:00:00 2001 From: collett Date: Wed, 11 Nov 2020 20:00:59 +0900 Subject: [PATCH 3/5] event battle fix --- src/common/Network/CommonActorControl.h | 2 +- src/world/Network/Handlers/ClientTriggerHandler.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/Network/CommonActorControl.h b/src/common/Network/CommonActorControl.h index fbeea52f..6ead8897 100644 --- a/src/common/Network/CommonActorControl.h +++ b/src/common/Network/CommonActorControl.h @@ -264,7 +264,7 @@ namespace Sapphire::Network::ActorControl ToggleOrchestrionUnlock = 0x396, - EventBattleDialog = 0x39C, + EventBattleDialog = 0x39D, /*! * param1 = mountSpeed diff --git a/src/world/Network/Handlers/ClientTriggerHandler.cpp b/src/world/Network/Handlers/ClientTriggerHandler.cpp index 6ca7a7b4..285df66d 100644 --- a/src/world/Network/Handlers/ClientTriggerHandler.cpp +++ b/src/world/Network/Handlers/ClientTriggerHandler.cpp @@ -491,7 +491,7 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( const Packets::FFX auto packet = makeActorControlSelf( player.getId(), ActorControl::EventBattleDialog, 0, param12, param2 ); player.queuePacket( packet ); - player.sendDebug( "event battle level sync: {0}, ilevel sync?: {1}", param12, param2 ); + player.sendDebug( "event battle p1: {0}, p11: {1}, p12: {2}, p2: {3}, p3: {4}, p4: {5}, p5: {6}", param1, param11, param12, param2, param3, param4, param5 ); break; } From 9083d81d974bb428a5e5d727e0fd2a580854af6e Mon Sep 17 00:00:00 2001 From: Sophie Hamilton Date: Sat, 14 Nov 2020 15:04:43 +0000 Subject: [PATCH 4/5] Fix bad hex number The number format here was typoed, preventing a successful compile. --- src/common/Network/PacketDef/Ipcs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index 302d9c3d..0cf9c386 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -47,7 +47,7 @@ namespace Sapphire::Network::Packets Init = 0x03B9, // updated 5.25 ActorFreeSpawn = 0x022F, // updated 5.3 - InitZone = 00x0303, // updated 5.35 + InitZone = 0x0303, // updated 5.35 EffectResult = 0x035E, // updated 5.35 ActorControl = 0x02DC, // updated 5.35 From d7bc93843d64a227cf4da20ed5db1e8baad15f70 Mon Sep 17 00:00:00 2001 From: collett Date: Sat, 14 Nov 2020 06:15:10 +0900 Subject: [PATCH 5/5] implement diving --- src/common/Network/PacketDef/Ipcs.h | 1 + .../Network/PacketDef/Zone/ClientZoneDef.h | 9 + src/world/Network/GameConnection.cpp | 1 + src/world/Network/GameConnection.h | 1 + src/world/Network/Handlers/PacketHandlers.cpp | 197 +++++++++++++----- 5 files changed, 157 insertions(+), 52 deletions(-) diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index 0c3f8cb1..0b93fdaf 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -395,6 +395,7 @@ namespace Sapphire::Network::Packets PerformNoteHandler = 0x029B, // updated 4.3 WorldInteractionHandler = 0x00A9, // updated 5.35 hotfix + Dive = 0x02CC, // updated 5.35 hotfix }; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/common/Network/PacketDef/Zone/ClientZoneDef.h b/src/common/Network/PacketDef/Zone/ClientZoneDef.h index bfadc021..19b4fff5 100644 --- a/src/common/Network/PacketDef/Zone/ClientZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ClientZoneDef.h @@ -417,6 +417,15 @@ struct FFXIVIpcDisbandPartyHandler : }; +struct FFXIVIpcDive : + FFXIVIpcBasePacket< Dive > +{ + float unknown; + Common::FFXIVARR_POSITION3 posTarget; + Common::FFXIVARR_POSITION3 posOriginal; + uint32_t padding; +}; + } #endif //_CORE_NETWORK_PACKETS_ZONE_CLIENT_IPC_H diff --git a/src/world/Network/GameConnection.cpp b/src/world/Network/GameConnection.cpp index f8603f17..82b401ee 100644 --- a/src/world/Network/GameConnection.cpp +++ b/src/world/Network/GameConnection.cpp @@ -132,6 +132,7 @@ Sapphire::Network::GameConnection::GameConnection( Sapphire::Network::HivePtr pH &GameConnection::marketBoardRequestItemListings ); setZoneHandler( ClientZoneIpcType::WorldInteractionHandler, "WorldInteractionHandler", &GameConnection::worldInteractionhandler ); + setZoneHandler( ClientZoneIpcType::Dive, "Dive", &GameConnection::diveHandler ); setChatHandler( ClientChatIpcType::TellReq, "TellReq", &GameConnection::tellHandler ); diff --git a/src/world/Network/GameConnection.h b/src/world/Network/GameConnection.h index 8f343dbc..8a3aabc0 100644 --- a/src/world/Network/GameConnection.h +++ b/src/world/Network/GameConnection.h @@ -189,6 +189,7 @@ namespace Sapphire::Network DECLARE_HANDLER( worldInteractionhandler ); + DECLARE_HANDLER( diveHandler ); }; } diff --git a/src/world/Network/Handlers/PacketHandlers.cpp b/src/world/Network/Handlers/PacketHandlers.cpp index ed917a69..af472089 100644 --- a/src/world/Network/Handlers/PacketHandlers.cpp +++ b/src/world/Network/Handlers/PacketHandlers.cpp @@ -731,65 +731,158 @@ void Sapphire::Network::GameConnection::worldInteractionhandler( const Packets:: const auto packet = ZoneChannelPacket< Client::FFXIVIpcWorldInteractionHandler >( inPacket ); auto action = packet.data().action; player.sendDebug( "WorldInteraction {}", action ); - if( action == 0x1F5 ) + switch( action ) { - auto emote = packet.data().param1; - if( emote == 0x32 || emote == 0x33 ) // "/sit" + case 0x1F5: // emote { - auto param4 = packet.data().param4; - auto& exdData = Common::Service< Data::ExdDataGenerated >::ref(); - auto emoteData = exdData.get< Data::Emote >( emote ); - - if( !emoteData ) - return; - - player.setPos( packet.data().position ); - if( emote == 0x32 && player.hasInRangeActor() ) + auto emote = packet.data().param1; + if( emote == 0x32 || emote == 0x33 ) // "/sit" { - auto setpos = makeZonePacket< FFXIVIpcActorSetPos >( player.getId() ); - setpos->data().r16 = param4; - setpos->data().waitForLoad = 18; - setpos->data().unknown1 = 1; - setpos->data().x = packet.data().position.x; - setpos->data().y = packet.data().position.y; - setpos->data().z = packet.data().position.z; - player.sendToInRangeSet( setpos, false ); - } - player.sendToInRangeSet( makeActorControlTarget( player.getId(), ActorControl::ActorControlType::Emote, emote, 0, 0, param4, 0xE0000000 ), true ); + auto param4 = packet.data().param4; + auto& exdData = Common::Service< Data::ExdDataGenerated >::ref(); + auto emoteData = exdData.get< Data::Emote >( emote ); - if( emote == 0x32 && emoteData->emoteMode != 0 ) - { - player.setStance( Common::Stance::Passive ); - player.setAutoattack( false ); - player.setPersistentEmote( emoteData->emoteMode ); - player.setStatus( Common::ActorStatus::EmoteMode ); + if( !emoteData ) + break; + + player.setPos( packet.data().position ); + if( emote == 0x32 && player.hasInRangeActor() ) + { + auto setpos = makeZonePacket< FFXIVIpcActorSetPos >( player.getId() ); + setpos->data().r16 = param4; + setpos->data().waitForLoad = 18; + setpos->data().unknown1 = 1; + setpos->data().x = packet.data().position.x; + setpos->data().y = packet.data().position.y; + setpos->data().z = packet.data().position.z; + player.sendToInRangeSet( setpos, false ); + } + player.sendToInRangeSet( makeActorControlTarget( player.getId(), ActorControl::ActorControlType::Emote, emote, 0, 0, param4, 0xE0000000 ), true ); + + if( emote == 0x32 && emoteData->emoteMode != 0 ) + { + player.setStance( Common::Stance::Passive ); + player.setAutoattack( false ); + player.setPersistentEmote( emoteData->emoteMode ); + player.setStatus( Common::ActorStatus::EmoteMode ); + } } + break; + } + case 0x1F8: + { + if( player.getPersistentEmote() > 0 ) + { + auto param2 = packet.data().param2; + + player.setPos( packet.data().position ); + if( player.hasInRangeActor() ) + { + auto setpos = makeZonePacket< FFXIVIpcActorSetPos >( player.getId() ); + setpos->data().r16 = param2; + setpos->data().waitForLoad = 18; + setpos->data().unknown1 = 2; + setpos->data().x = packet.data().position.x; + setpos->data().y = packet.data().position.y; + setpos->data().z = packet.data().position.z; + player.sendToInRangeSet( setpos, false ); + } + + player.setPersistentEmote( 0 ); + player.emoteInterrupt(); + player.setStatus( Common::ActorStatus::Idle ); + auto pSetStatusPacket = makeActorControl( player.getId(), SetStatus, static_cast< uint8_t >( Common::ActorStatus::Idle ) ); + player.sendToInRangeSet( pSetStatusPacket ); + } + break; + } + case 0x25E: // coming out from water + case 0xD1: // underwater town portal + { + auto p = makeZonePacket< FFXIVIpcPrepareZoning >( player.getId() ); + p->data().targetZone = player.getCurrentTerritory()->getTerritoryTypeId(); + p->data().param4 = action == 0xD1 ? 14 : 227; + p->data().hideChar = action == 0xD1 ? 2 : 1; + p->data().fadeOut = action == 0xD1 ? 24 : 25; + p->data().fadeOutTime = 1; + p->data().unknown = action == 0xD1 ? 4 : 6; + auto x = packet.data().position.x; + auto y = packet.data().position.y; + auto z = packet.data().position.z; + auto rot = player.getRot(); + if( action == 0xD1 ) + { + auto exitRange = packet.data().param1; + + auto& instanceObjectCache = Common::Service< InstanceObjectCache >::ref(); + auto exit = instanceObjectCache.getExitRange( p->data().targetZone, exitRange ); + if( exit ) + { + player.sendDebug( "exitRange {0} found!", exitRange ); + auto destZone = exit->data.destTerritoryType; + if( destZone == 0 ) + destZone = p->data().targetZone; + else + p->data().targetZone = destZone; + auto pop = instanceObjectCache.getPopRange( destZone, exit->data.destInstanceObjectId ); + if( pop ) + { + player.sendDebug( "popRange {0} found!", exit->data.destInstanceObjectId ); + x = pop->header.transform.translation.x; + y = pop->header.transform.translation.y; + z = pop->header.transform.translation.z; + //rot = pop->header.transform.rotation.y; all x/y/z not correct, maybe we don't need it since we have to be facing the portal anyway? + } + else + { + player.sendUrgent( "popRange {0} not found in {1}!", exit->data.destInstanceObjectId, destZone ); + } + } + else + { + player.sendUrgent( "exitRange {0} not found in {1}!", exitRange, p->data().targetZone ); + } + } + player.queuePacket( p ); + player.setPos( x, y, z, true ); + player.setRot( rot ); + auto setPos = makeZonePacket< FFXIVIpcActorSetPos >( player.getId() ); + setPos->data().r16 = Common::Util::floatToUInt16Rot( player.getRot() ); + setPos->data().x = x; + setPos->data().y = y; + setPos->data().z = z; + setPos->data().waitForLoad = action == 0xD1 ? 24 : 25; + setPos->data().unknown1 = 0; + player.queuePacket( setPos ); // this packet needs a delay of 0.8 second to wait for the client finishing its water animation otherwise it looks odd. + break; } } - else if( action == 0x1F8 ) - { - if( player.getPersistentEmote() > 0 ) - { - auto param2 = packet.data().param2; +} - player.setPos( packet.data().position ); - if( player.hasInRangeActor() ) - { - auto setpos = makeZonePacket< FFXIVIpcActorSetPos >( player.getId() ); - setpos->data().r16 = param2; - setpos->data().waitForLoad = 18; - setpos->data().unknown1 = 2; - setpos->data().x = packet.data().position.x; - setpos->data().y = packet.data().position.y; - setpos->data().z = packet.data().position.z; - player.sendToInRangeSet( setpos, false ); - } +void Sapphire::Network::GameConnection::diveHandler( const Packets::FFXIVARR_PACKET_RAW& inPacket, Entity::Player& player ) +{ + const auto packetIn = ZoneChannelPacket< Client::FFXIVIpcDive >( inPacket ); + auto p = makeZonePacket< FFXIVIpcPrepareZoning >( player.getId() ); + p->data().targetZone = player.getCurrentTerritory()->getTerritoryTypeId(); + p->data().param4 = 218; + p->data().hideChar = 1; + p->data().fadeOut = 25; + p->data().fadeOutTime = 1; + p->data().unknown = 6; + player.queuePacket( p ); - player.setPersistentEmote( 0 ); - player.emoteInterrupt(); - player.setStatus( Common::ActorStatus::Idle ); - auto pSetStatusPacket = makeActorControl( player.getId(), SetStatus, static_cast< uint8_t >( Common::ActorStatus::Idle ) ); - player.sendToInRangeSet( pSetStatusPacket ); - } - } + player.setStance( Common::Stance::Passive ); + + auto x = packetIn.data().posTarget.x; + auto y = packetIn.data().posTarget.y; + auto z = packetIn.data().posTarget.z; + player.setPos( x, y, z, true ); + auto setPos = makeZonePacket< FFXIVIpcActorSetPos >( player.getId() ); + setPos->data().r16 = Common::Util::floatToUInt16Rot( player.getRot() ); + setPos->data().x = x; + setPos->data().y = y; + setPos->data().z = z; + setPos->data().waitForLoad = 25; + setPos->data().unknown1 = 0; + player.queuePacket( setPos ); // need delay, same as above. } \ No newline at end of file