Fix for UF and older clients' experiment combine failure

This commit is contained in:
Uleat 2018-10-05 07:54:42 -04:00
parent 6eddb2b5f4
commit 1ba6801bb2
15 changed files with 85 additions and 45 deletions

View File

@ -83,6 +83,10 @@ namespace EQEmu
using RoF2::invslot::SLOT_INVALID;
using RoF2::invslot::SLOT_BEGIN;
using Titanium::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
const int16 SLOT_AUGMENT_GENERIC_RETURN = 1001; // clients don't appear to use this method... (internal inventory return value)
using RoF2::invslot::POSSESSIONS_BEGIN;
using RoF2::invslot::POSSESSIONS_END;
using RoF2::invslot::POSSESSIONS_COUNT;

View File

@ -523,18 +523,4 @@ static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // chang
static const uint32 MAX_SPELL_DB_ID_VAL = 65535;
namespace EQEmu
{
namespace legacy {
enum InventorySlot {
SLOT_CURSOR_END = (int16)0xFFFE, // I hope no one is using this...
SLOT_TRADESKILL = 1000,
SLOT_AUGMENT = 1001,
//SLOT_INVALID = (int16)0xFFFF,
};
} // namespace legacy
}
#endif /*COMMON_EQ_CONSTANTS_H*/

View File

@ -1418,7 +1418,7 @@ int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket,
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
if (inst->GetAugmentItemID(index) == item_id && quantity <= 1)
return legacy::SLOT_AUGMENT;
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
}
if (!inst->IsClassBag()) { continue; }
@ -1435,7 +1435,7 @@ int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket,
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
if (bag_inst->GetAugmentItemID(index) == item_id && quantity <= 1)
return legacy::SLOT_AUGMENT;
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
}
}
}
@ -1466,7 +1466,7 @@ int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, u
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
if (inst->GetAugmentItemID(index) == item_id && quantity <= 1)
return legacy::SLOT_AUGMENT;
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
}
if (!inst->IsClassBag()) { continue; }
@ -1483,7 +1483,7 @@ int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, u
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
if (bag_inst->GetAugmentItemID(index) == item_id && quantity <= 1)
return legacy::SLOT_AUGMENT;
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
}
}
@ -1593,7 +1593,7 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*
if (aug_inst == nullptr) { continue; }
if (aug_inst->GetItem()->LoreGroup == loregroup)
return legacy::SLOT_AUGMENT;
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
}
if (!inst->IsClassBag()) { continue; }
@ -1610,7 +1610,7 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*
if (aug_inst == nullptr) { continue; }
if (aug_inst->GetItem()->LoreGroup == loregroup)
return legacy::SLOT_AUGMENT;
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
}
}
}
@ -1633,7 +1633,7 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32
if (aug_inst == nullptr) { continue; }
if (aug_inst->GetItem()->LoreGroup == loregroup)
return legacy::SLOT_AUGMENT;
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
}
if (!inst->IsClassBag()) { continue; }
@ -1650,7 +1650,7 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32
if (aug_inst == nullptr) { continue; }
if (aug_inst->GetItem()->LoreGroup == loregroup)
return legacy::SLOT_AUGMENT;
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
}
}

View File

@ -5002,11 +5002,7 @@ namespace RoF
DECODE_LENGTH_EXACT(structs::NewCombine_Struct);
SETUP_DIRECT_DECODE(NewCombine_Struct, structs::NewCombine_Struct);
int16 slot_id = RoFToServerSlot(eq->container_slot);
if (slot_id == 4000) {
slot_id = EQEmu::legacy::SLOT_TRADESKILL; // 1000
}
emu->container_slot = slot_id;
emu->container_slot = RoFToServerSlot(eq->container_slot);
emu->guildtribute_slot = RoFToServerSlot(eq->guildtribute_slot); // this should only return INVALID_INDEX until implemented
FINISH_DIRECT_DECODE();
@ -5581,6 +5577,10 @@ namespace RoF
RoFSlot.Slot = server_slot - EQEmu::invslot::GUILD_TRIBUTE_BEGIN;
}
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
RoFSlot.Type = invtype::typeWorld;
}
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
RoFSlot.Type = invtype::typeBank;
RoFSlot.Slot = server_slot - EQEmu::invslot::BANK_BEGIN;
@ -5781,9 +5781,12 @@ namespace RoF
break;
}
case invtype::typeWorld: {
server_slot = EQEmu::invslot::WORLD_BEGIN; // evidently, [4,-1,-1,-1] is sent when world object is in experimental mode and combine is clicked
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::WORLD_SIZE) {
server_slot += rof_slot.Slot;
server_slot = EQEmu::invslot::WORLD_BEGIN + rof_slot.Slot;
}
else if (rof_slot.Slot == invslot::SLOT_INVALID) {
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
}
break;
@ -5950,9 +5953,12 @@ namespace RoF
break;
}
case invtype::typeWorld: {
server_slot = EQEmu::invslot::WORLD_BEGIN; // evidently, [4,-1,-1,-1] is sent when world object is in experimental mode and combine is clicked
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::WORLD_SIZE) {
server_slot += rof_slot.Slot;
server_slot = EQEmu::invslot::WORLD_BEGIN + rof_slot.Slot;
}
else if (rof_slot.Slot == invslot::SLOT_INVALID) {
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
}
break;

View File

@ -5299,11 +5299,7 @@ namespace RoF2
DECODE_LENGTH_EXACT(structs::NewCombine_Struct);
SETUP_DIRECT_DECODE(NewCombine_Struct, structs::NewCombine_Struct);
int16 slot_id = RoF2ToServerSlot(eq->container_slot);
if (slot_id == 4000) {
slot_id = EQEmu::legacy::SLOT_TRADESKILL; // 1000
}
emu->container_slot = slot_id;
emu->container_slot = RoF2ToServerSlot(eq->container_slot);
emu->guildtribute_slot = RoF2ToServerSlot(eq->guildtribute_slot); // this should only return INVALID_INDEX until implemented
FINISH_DIRECT_DECODE();
@ -5887,6 +5883,10 @@ namespace RoF2
RoF2Slot.Slot = server_slot - EQEmu::invslot::GUILD_TRIBUTE_BEGIN;
}
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
RoF2Slot.Type = invtype::typeWorld;
}
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
RoF2Slot.Type = invtype::typeBank;
RoF2Slot.Slot = server_slot - EQEmu::invslot::BANK_BEGIN;
@ -6071,9 +6071,12 @@ namespace RoF2
break;
}
case invtype::typeWorld: {
server_slot = EQEmu::invslot::WORLD_BEGIN; // evidently, [4,-1,-1,-1] is sent when world object is in experimental mode and combine is clicked
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::WORLD_SIZE) {
server_slot += rof2_slot.Slot;
server_slot = EQEmu::invslot::WORLD_BEGIN + rof2_slot.Slot;
}
else if (rof2_slot.Slot == invslot::SLOT_INVALID) {
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
}
break;
@ -6222,9 +6225,12 @@ namespace RoF2
break;
}
case invtype::typeWorld: {
ServerSlot = EQEmu::invslot::WORLD_BEGIN; // evidently, [4,-1,-1,-1] is sent when world object is in experimental mode and combine is clicked
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::WORLD_SIZE) {
ServerSlot += rof2_slot.Slot;
ServerSlot = EQEmu::invslot::WORLD_BEGIN + rof2_slot.Slot;
}
else if (rof2_slot.Slot == invslot::SLOT_INVALID) {
ServerSlot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
}
break;

View File

@ -3809,6 +3809,10 @@ namespace SoD
SoDSlot = serverSlot;
}
else if (serverSlot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::BANK_END && serverSlot >= EQEmu::invslot::BANK_BEGIN) {
SoDSlot = serverSlot;
}
@ -3887,6 +3891,10 @@ namespace SoD
server_slot = sod_slot;
}
else if (sod_slot == invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
server_slot = sod_slot;
}
else if (sod_slot <= invslot::BANK_END && sod_slot >= invslot::BANK_BEGIN) {
server_slot = sod_slot;
}

View File

@ -150,6 +150,8 @@ namespace SoD
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
const int16 SLOT_TRADESKILL_EXPERIMENT_COMBINE = 1000;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;

View File

@ -3199,6 +3199,10 @@ namespace SoF
sof_slot = server_slot;
}
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
sof_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
sof_slot = server_slot;
}
@ -3281,6 +3285,10 @@ namespace SoF
server_slot = sof_slot;
}
else if (sof_slot == invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
server_slot = sof_slot;
}
else if (sof_slot <= invslot::BANK_END && sof_slot >= invslot::BANK_BEGIN) {
server_slot = sof_slot;
}
@ -3505,4 +3513,4 @@ namespace SoF
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
}
}

View File

@ -150,6 +150,8 @@ namespace SoF
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
const int16 SLOT_TRADESKILL_EXPERIMENT_COMBINE = 1000;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;

View File

@ -2504,6 +2504,9 @@ namespace Titanium
server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
titanium_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
titanium_slot = server_slot;
}
@ -2586,6 +2589,9 @@ namespace Titanium
else if (titanium_slot <= invslot::TRIBUTE_END && titanium_slot >= invslot::TRIBUTE_BEGIN) {
server_slot = titanium_slot;
}
else if (titanium_slot == invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
server_slot = titanium_slot;
}
else if (titanium_slot <= invslot::GUILD_TRIBUTE_END && titanium_slot >= invslot::GUILD_TRIBUTE_BEGIN) {
server_slot = titanium_slot;
}

View File

@ -149,6 +149,8 @@ namespace Titanium
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
const int16 SLOT_TRADESKILL_EXPERIMENT_COMBINE = 1000;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;

View File

@ -4168,6 +4168,10 @@ namespace UF
UFSlot = serverSlot;
}
else if (serverSlot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::BANK_END && serverSlot >= EQEmu::invslot::BANK_BEGIN) {
UFSlot = serverSlot;
}
@ -4246,6 +4250,10 @@ namespace UF
ServerSlot = ufSlot;
}
else if (ufSlot == invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
ServerSlot = ufSlot;
}
else if (ufSlot <= invslot::BANK_END && ufSlot >= invslot::BANK_BEGIN) {
ServerSlot = ufSlot;
}

View File

@ -150,6 +150,8 @@ namespace UF
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
const int16 SLOT_TRADESKILL_EXPERIMENT_COMBINE = 1000;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;

View File

@ -1908,6 +1908,8 @@ luabind::scope lua_register_slot() {
luabind::value("GeneralBagsEnd", static_cast<int>(EQEmu::invbag::GENERAL_BAGS_END)),
luabind::value("CursorBagBegin", static_cast<int>(EQEmu::invbag::CURSOR_BAG_BEGIN)),
luabind::value("CursorBagEnd", static_cast<int>(EQEmu::invbag::CURSOR_BAG_END)),
luabind::value("Tradeskill", static_cast<int>(EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE)),
luabind::value("Augment", static_cast<int>(EQEmu::invslot::SLOT_AUGMENT_GENERIC_RETURN)), // will be revised out
luabind::value("BankBegin", static_cast<int>(EQEmu::invslot::BANK_BEGIN)),
luabind::value("BankEnd", static_cast<int>(EQEmu::invslot::BANK_END)),
luabind::value("BankBagsBegin", static_cast<int>(EQEmu::invbag::BANK_BAGS_BEGIN)),
@ -1929,9 +1931,7 @@ luabind::scope lua_register_slot() {
luabind::value("Ring2", static_cast<int>(EQEmu::invslot::slotFinger2)), // deprecated
luabind::value("PersonalBegin", static_cast<int>(EQEmu::invslot::GENERAL_BEGIN)), // deprecated
luabind::value("PersonalEnd", static_cast<int>(EQEmu::invslot::GENERAL_END)), // deprecated
luabind::value("CursorEnd", 0xFFFE), // deprecated
luabind::value("Tradeskill", static_cast<int>(EQEmu::legacy::SLOT_TRADESKILL)), // deprecated
luabind::value("Augment", static_cast<int>(EQEmu::legacy::SLOT_AUGMENT)) // deprecated
luabind::value("CursorEnd", 0xFFFE) // deprecated (not in use..and never valid vis-a-vis client behavior)
];
}

View File

@ -264,7 +264,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
uint32 some_id = 0;
bool worldcontainer=false;
if (in_combine->container_slot == EQEmu::legacy::SLOT_TRADESKILL) {
if (in_combine->container_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
if(!worldo) {
user->Message(13, "Error: Server is not aware of the tradeskill container you are attempting to use");
return;