mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-30 08:35:52 -04:00
[General] Simplify Actor packets.
This commit is contained in:
parent
f6fba70a4e
commit
8478fed98a
@ -24,3 +24,11 @@ void ActorPacket::setActorList(BaseActorList *actorList)
|
|||||||
this->actorList = actorList;
|
this->actorList = actorList;
|
||||||
guid = actorList->guid;
|
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();
|
~ActorPacket();
|
||||||
|
|
||||||
void setActorList(BaseActorList *actorList);
|
void setActorList(BaseActorList *actorList);
|
||||||
|
virtual void Packet(RakNet::BitStream *bs, bool send);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BaseActorList *actorList;
|
BaseActorList *actorList;
|
||||||
|
@ -20,11 +20,6 @@ void PacketActorAnimFlags::Packet(RakNet::BitStream *bs, bool send)
|
|||||||
|
|
||||||
RW(actorList->count, 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;
|
BaseActor actor;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < actorList->count; i++)
|
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);
|
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->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;
|
BaseActor actor;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < actorList->count; i++)
|
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->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;
|
BaseActor actor;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < actorList->count; i++)
|
for (unsigned int i = 0; i < actorList->count; i++)
|
||||||
|
@ -18,9 +18,4 @@ void PacketActorAuthority::Packet(RakNet::BitStream *bs, bool send)
|
|||||||
actorList->baseActors.clear();
|
actorList->baseActors.clear();
|
||||||
|
|
||||||
RW(actorList->count, 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);
|
|
||||||
}
|
}
|
||||||
|
@ -37,11 +37,6 @@ void PacketActorCellChange::Packet(RakNet::BitStream *bs, bool send)
|
|||||||
RW(actor.refNumIndex, send);
|
RW(actor.refNumIndex, send);
|
||||||
RW(actor.mpNum, 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.position, send);
|
||||||
RW(actor.direction, send);
|
RW(actor.direction, send);
|
||||||
|
|
||||||
|
@ -20,11 +20,6 @@ void PacketActorEquipment::Packet(RakNet::BitStream *bs, bool send)
|
|||||||
|
|
||||||
RW(actorList->count, 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;
|
BaseActor actor;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < actorList->count; i++)
|
for (unsigned int i = 0; i < actorList->count; i++)
|
||||||
|
@ -27,11 +27,6 @@ void PacketActorList::Packet(RakNet::BitStream *bs, bool send)
|
|||||||
return;
|
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;
|
BaseActor actor;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < actorList->count; i++)
|
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->count, send);
|
||||||
|
|
||||||
RW(actorList->cell.mData, send, 1);
|
|
||||||
RW(actorList->cell.mName, send, 1);
|
|
||||||
|
|
||||||
BaseActor actor;
|
BaseActor actor;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < actorList->count; i++)
|
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->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;
|
BaseActor actor;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < actorList->count; i++)
|
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->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;
|
BaseActor actor;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < actorList->count; i++)
|
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->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;
|
BaseActor actor;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < actorList->count; i++)
|
for (unsigned int i = 0; i < actorList->count; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user