forked from teamnwah/openmw-tes3coop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
836 B
C++
35 lines
836 B
C++
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
#include "PacketConsoleCommand.hpp"
|
|
|
|
using namespace mwmp;
|
|
|
|
PacketConsoleCommand::PacketConsoleCommand(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
|
|
{
|
|
packetID = ID_CONSOLE_COMMAND;
|
|
}
|
|
|
|
void PacketConsoleCommand::Packet(RakNet::BitStream *bs, bool send)
|
|
{
|
|
if (!PacketHeader(bs, send))
|
|
return;
|
|
|
|
RW(objectList->consoleCommand, send);
|
|
|
|
BaseObject baseObject;
|
|
for (unsigned int i = 0; i < objectList->baseObjectCount; i++)
|
|
{
|
|
if (send)
|
|
baseObject = objectList->baseObjects.at(i);
|
|
|
|
RW(baseObject.isPlayer, send);
|
|
|
|
if (baseObject.isPlayer)
|
|
RW(baseObject.guid, send);
|
|
else
|
|
Object(baseObject, send);
|
|
|
|
if (!send)
|
|
objectList->baseObjects.push_back(baseObject);
|
|
}
|
|
}
|