mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Added 'ItemInst::Serialize()' overload to make use of std::stringstream implementation
This commit is contained in:
parent
3e0574630b
commit
915f22d564
@ -3,6 +3,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||
== 05/10/2016 ==
|
||||
Uleat: Converted client translators' 'SerializeItem()' to recursive, single buffer methodology. Titanium SerializeItem() now adds a null term between parent items instead of the invoking function
|
||||
Uleat: Converted server 'BulkSendInventoryItems()' to use single buffer methodology
|
||||
Uleat: Added 'ItemInst::Serialize()' overload to make use of the above single buffer methodology
|
||||
|
||||
== 05/08/2016 ==
|
||||
Uleat: Re-coded Titanium client translator 'SerializeItem()' to use coded property assignments over file enumerated ones
|
||||
|
||||
@ -411,7 +411,9 @@ public:
|
||||
int8 GetMaxEvolveLvl() const;
|
||||
uint32 GetKillsNeeded(uint8 currentlevel);
|
||||
|
||||
std::string Serialize(int16 slot_id) const { InternalSerializedItem_Struct s; s.slot_id=slot_id; s.inst=(const void *)this; std::string ser; ser.assign((char *)&s,sizeof(InternalSerializedItem_Struct)); return ser; }
|
||||
std::string Serialize(int16 slot_id) const { InternalSerializedItem_Struct s; s.slot_id = slot_id; s.inst = (const void*)this; std::string ser; ser.assign((char*)&s, sizeof(InternalSerializedItem_Struct)); return ser; }
|
||||
void Serialize(std::stringstream& ss, int16 slot_id) const { InternalSerializedItem_Struct isi; isi.slot_id = slot_id; isi.inst = (const void*)this; ss.write((const char*)&isi, sizeof(isi)); }
|
||||
|
||||
inline int32 GetSerialNumber() const { return m_SerialNumber; }
|
||||
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
|
||||
|
||||
|
||||
@ -768,7 +768,7 @@ void Client::BulkSendInventoryItems()
|
||||
if (!inst)
|
||||
continue;
|
||||
|
||||
ss << inst->Serialize(slot_id);
|
||||
inst->Serialize(ss, slot_id);
|
||||
|
||||
if (ss.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
@ -780,7 +780,7 @@ void Client::BulkSendInventoryItems()
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
|
||||
const ItemInst* inst = m_inv[EQEmu::legacy::SlotPowerSource];
|
||||
if (inst) {
|
||||
ss << inst->Serialize(EQEmu::legacy::SlotPowerSource);
|
||||
inst->Serialize(ss, EQEmu::legacy::SlotPowerSource);
|
||||
|
||||
if (ss.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::legacy::SlotPowerSource);
|
||||
@ -795,7 +795,7 @@ void Client::BulkSendInventoryItems()
|
||||
if (!inst)
|
||||
continue;
|
||||
|
||||
ss << inst->Serialize(slot_id);
|
||||
inst->Serialize(ss, slot_id);
|
||||
|
||||
if (ss.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
@ -809,7 +809,7 @@ void Client::BulkSendInventoryItems()
|
||||
if (!inst)
|
||||
continue;
|
||||
|
||||
ss << inst->Serialize(slot_id);
|
||||
inst->Serialize(ss, slot_id);
|
||||
|
||||
if (ss.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user