|
@@ -362,7 +362,8 @@ void Inventory::afterPushStack(
|
|
|
else
|
|
|
{
|
|
|
NetworkMessage* msg = new NetworkMessage();
|
|
|
- char* message = new char[29];
|
|
|
+ char* message
|
|
|
+ = new char[30 + zItem->getName().getLength()];
|
|
|
message[0] = 2; // add new stack
|
|
|
*(int*)(message + 1) = zSlot->getId();
|
|
|
*(int*)(message + 5) = zSlot->getNumberOfItems();
|
|
@@ -372,7 +373,11 @@ void Inventory::afterPushStack(
|
|
|
*(float*)(message + 17) = zItem->getDurability();
|
|
|
*(float*)(message + 21) = zItem->getMaxDurability();
|
|
|
*(int*)(message + 25) = zItem->zItemType()->getId();
|
|
|
- msg->setMessage(message, 29);
|
|
|
+ *(message + 29) = (char)zItem->getName().getLength();
|
|
|
+ memcpy(message + 30,
|
|
|
+ zItem->getName().getText(),
|
|
|
+ zItem->getName().getLength());
|
|
|
+ msg->setMessage(message, 30 + zItem->getName().getLength());
|
|
|
notifyObservers(msg);
|
|
|
}
|
|
|
for (auto call : afterPushStackCalls)
|
|
@@ -733,6 +738,14 @@ void Inventory::inventoryApi(Framework::StreamReader* zRequest,
|
|
|
buffer.schreibe((char*)&f, 4);
|
|
|
int id = slot->zStack()->zItem()->zItemType()->getId();
|
|
|
buffer.schreibe((char*)&id, 4);
|
|
|
+ char len = (char)slot->zStack()
|
|
|
+ ->zItem()
|
|
|
+ ->getName()
|
|
|
+ .getLength();
|
|
|
+ buffer.schreibe((char*)&len, 1);
|
|
|
+ buffer.schreibe(
|
|
|
+ slot->zStack()->zItem()->getName().getText(),
|
|
|
+ slot->zStack()->zItem()->getName().getLength());
|
|
|
}
|
|
|
}
|
|
|
}
|