[General] Simplify Actor packets.

0.6.1
Koncord 8 years ago
parent f6fba70a4e
commit 8478fed98a

@ -24,3 +24,11 @@ void ActorPacket::setActorList(BaseActorList *actorList)
this->actorList = actorList;
guid = actorList->guid;
}
void ActorPacket::Packet(RakNet::BitStream *bs, bool send)
{
BasePacket::Packet(bs, send);
RW(actorList->cell.mData, send, 1);
RW(actorList->cell.mName, send, 1);
}

@ -20,6 +20,7 @@ namespace mwmp
~ActorPacket();
void setActorList(BaseActorList *actorList);
virtual void Packet(RakNet::BitStream *bs, bool send);
protected:
BaseActorList *actorList;

@ -20,11 +20,6 @@ void PacketActorAnimFlags::Packet(RakNet::BitStream *bs, bool send)
RW(actorList->count, send);
RW(actorList->cell.mData.mFlags, send);
RW(actorList->cell.mData.mX, send);
RW(actorList->cell.mData.mY, send);
RW(actorList->cell.mName, send);
BaseActor actor;
for (unsigned int i = 0; i < actorList->count; i++)
@ -46,4 +41,5 @@ void PacketActorAnimFlags::Packet(RakNet::BitStream *bs, bool send)
actorList->baseActors.push_back(actor);
}
}
printf("Packet size: %d\n", bs->GetNumberOfBytesUsed());
}

@ -20,11 +20,6 @@ void PacketActorAnimPlay::Packet(RakNet::BitStream *bs, bool send)
RW(actorList->count, send);
RW(actorList->cell.mData.mFlags, send);
RW(actorList->cell.mData.mX, send);
RW(actorList->cell.mData.mY, send);
RW(actorList->cell.mName, send);
BaseActor actor;
for (unsigned int i = 0; i < actorList->count; i++)

@ -20,11 +20,6 @@ void PacketActorAttack::Packet(RakNet::BitStream *bs, bool send)
RW(actorList->count, send);
RW(actorList->cell.mData.mFlags, send);
RW(actorList->cell.mData.mX, send);
RW(actorList->cell.mData.mY, send);
RW(actorList->cell.mName, send);
BaseActor actor;
for (unsigned int i = 0; i < actorList->count; i++)

@ -18,9 +18,4 @@ void PacketActorAuthority::Packet(RakNet::BitStream *bs, bool send)
actorList->baseActors.clear();
RW(actorList->count, send);
RW(actorList->cell.mData.mFlags, send);
RW(actorList->cell.mData.mX, send);
RW(actorList->cell.mData.mY, send);
RW(actorList->cell.mName, send);
}

@ -37,11 +37,6 @@ void PacketActorCellChange::Packet(RakNet::BitStream *bs, bool send)
RW(actor.refNumIndex, send);
RW(actor.mpNum, send);
RW(actor.cell.mData.mFlags, send);
RW(actor.cell.mData.mX, send);
RW(actor.cell.mData.mY, send);
RW(actor.cell.mName, send);
RW(actor.position, send);
RW(actor.direction, send);

@ -20,11 +20,6 @@ void PacketActorEquipment::Packet(RakNet::BitStream *bs, bool send)
RW(actorList->count, send);
RW(actorList->cell.mData.mFlags, send);
RW(actorList->cell.mData.mX, send);
RW(actorList->cell.mData.mY, send);
RW(actorList->cell.mName, send);
BaseActor actor;
for (unsigned int i = 0; i < actorList->count; i++)

@ -27,11 +27,6 @@ void PacketActorList::Packet(RakNet::BitStream *bs, bool send)
return;
}
RW(actorList->cell.mData.mFlags, send);
RW(actorList->cell.mData.mX, send);
RW(actorList->cell.mData.mY, send);
RW(actorList->cell.mName, send);
BaseActor actor;
for (unsigned int i = 0; i < actorList->count; i++)

@ -20,9 +20,6 @@ void PacketActorPosition::Packet(RakNet::BitStream *bs, bool send)
RW(actorList->count, send);
RW(actorList->cell.mData, send, 1);
RW(actorList->cell.mName, send, 1);
BaseActor actor;
for (unsigned int i = 0; i < actorList->count; i++)

@ -20,11 +20,6 @@ void PacketActorSpeech::Packet(RakNet::BitStream *bs, bool send)
RW(actorList->count, send);
RW(actorList->cell.mData.mFlags, send);
RW(actorList->cell.mData.mX, send);
RW(actorList->cell.mData.mY, send);
RW(actorList->cell.mName, send);
BaseActor actor;
for (unsigned int i = 0; i < actorList->count; i++)

@ -21,11 +21,6 @@ void PacketActorStatsDynamic::Packet(RakNet::BitStream *bs, bool send)
RW(actorList->count, send);
RW(actorList->cell.mData.mFlags, send);
RW(actorList->cell.mData.mX, send);
RW(actorList->cell.mData.mY, send);
RW(actorList->cell.mName, send);
BaseActor actor;
for (unsigned int i = 0; i < actorList->count; i++)

@ -20,11 +20,6 @@ void PacketActorTest::Packet(RakNet::BitStream *bs, bool send)
RW(actorList->count, send);
RW(actorList->cell.mData.mFlags, send);
RW(actorList->cell.mData.mX, send);
RW(actorList->cell.mData.mY, send);
RW(actorList->cell.mName, send);
BaseActor actor;
for (unsigned int i = 0; i < actorList->count; i++)

Loading…
Cancel
Save