Shorten WorldPacket IDs by removing WORLD from them

coverity_scan^2
David Cernat 8 years ago
parent bdb53e1cb4
commit c25ebc34b3

@ -382,9 +382,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
switch (packet->data[0])
{
case ID_WORLD_OBJECT_PLACE:
case ID_OBJECT_PLACE:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_PLACE from %s",
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_PLACE from %s",
player->Npc()->mName.c_str());
myPacket->Read(event);
@ -393,9 +393,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_OBJECT_DELETE:
case ID_OBJECT_DELETE:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_DELETE from %s",
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_DELETE from %s",
player->Npc()->mName.c_str());
myPacket->Read(event);
@ -410,9 +410,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_OBJECT_LOCK:
case ID_OBJECT_LOCK:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_LOCK from %s",
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_LOCK from %s",
player->Npc()->mName.c_str());
myPacket->Read(event);
@ -427,9 +427,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_OBJECT_UNLOCK:
case ID_OBJECT_UNLOCK:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_UNLOCK from %s",
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_UNLOCK from %s",
player->Npc()->mName.c_str());
myPacket->Read(event);
@ -444,9 +444,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_OBJECT_SCALE:
case ID_OBJECT_SCALE:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_SCALE from %s",
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_SCALE from %s",
player->Npc()->mName.c_str());
myPacket->Read(event);
@ -461,9 +461,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_CONTAINER_ADD:
case ID_CONTAINER_ADD:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_CONTAINER_ADD from %s",
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_CONTAINER_ADD from %s",
player->Npc()->mName.c_str());
myPacket->Read(event);
@ -478,9 +478,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_CONTAINER_REMOVE:
case ID_CONTAINER_REMOVE:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_CONTAINER_REMOVE from %s",
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_CONTAINER_REMOVE from %s",
player->Npc()->mName.c_str());
myPacket->Read(event);
@ -495,9 +495,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_DOOR_ACTIVATE:
case ID_DOOR_ACTIVATE:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_DOOR_ACTIVATE from %s",
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_DOOR_ACTIVATE from %s",
player->Npc()->mName.c_str());
myPacket->Read(event);
@ -512,9 +512,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_ACTIVATOR_ACTIVATE:
case ID_ACTIVATOR_ACTIVATE:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_ACTIVATOR_ACTIVATE from %s",
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_ACTIVATOR_ACTIVATE from %s",
player->Npc()->mName.c_str());
myPacket->Read(event);
@ -529,9 +529,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_VIDEO_PLAY:
case ID_VIDEO_PLAY:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_VIDEO_PLAY from %s",
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_VIDEO_PLAY from %s",
player->Npc()->mName.c_str());
myPacket->Read(event);

@ -61,9 +61,9 @@ namespace MWGui
event->cellRef.mRefID = dropped.getCellRef().getRefId();
event->cellRef.mRefNum = dropped.getCellRef().getRefNum();
event->cellRef.mPos = dropped.getCellRef().getPosition();
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_PLACE)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_PLACE)->Send(event);
printf("Sending ID_WORLD_OBJECT_PLACE about %s\n%i\n",
printf("Sending ID_OBJECT_PLACE about %s\n%i\n",
event->cellRef.mRefID.c_str(),
event->cellRef.mRefNum.mIndex);

@ -62,7 +62,7 @@ namespace MWMechanics
event->cell = *lock.getCell()->getCell();
event->cellRef.mRefID = lock.getCellRef().getRefId();
event->cellRef.mRefNum = lock.getCellRef().getRefNum();
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_UNLOCK)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_UNLOCK)->Send(event);
lock.getClass().unlock(lock);
resultMessage = "#{sLockSuccess}";

@ -696,7 +696,7 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
switch (packet->data[0])
{
case ID_WORLD_OBJECT_PLACE:
case ID_OBJECT_PLACE:
{
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), event->cellRef.mRefID, 1);
@ -704,9 +704,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_OBJECT_DELETE:
case ID_OBJECT_DELETE:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_WORLD_OBJECT_DELETE");
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_DELETE");
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
event->cellRef.mRefID.c_str(),
event->cellRef.mRefNum.mIndex,
@ -725,9 +725,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_OBJECT_LOCK:
case ID_OBJECT_LOCK:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_WORLD_OBJECT_LOCK");
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_LOCK");
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
event->cellRef.mRefID.c_str(),
event->cellRef.mRefNum.mIndex,
@ -746,9 +746,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_OBJECT_UNLOCK:
case ID_OBJECT_UNLOCK:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_WORLD_OBJECT_UNLOCK");
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_UNLOCK");
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
event->cellRef.mRefID.c_str(),
event->cellRef.mRefNum.mIndex,
@ -767,9 +767,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_OBJECT_SCALE:
case ID_OBJECT_SCALE:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_WORLD_OBJECT_SCALE");
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_SCALE");
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
event->cellRef.mRefID.c_str(),
event->cellRef.mRefNum.mIndex,
@ -788,9 +788,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_DOOR_ACTIVATE:
case ID_DOOR_ACTIVATE:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_WORLD_DOOR_ACTIVATE");
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_DOOR_ACTIVATE");
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
event->cellRef.mRefID.c_str(),
event->cellRef.mRefNum.mIndex,
@ -810,9 +810,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break;
}
case ID_WORLD_VIDEO_PLAY:
case ID_VIDEO_PLAY:
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_WORLD_VIDEO_PLAY");
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_VIDEO_PLAY");
LOG_APPEND(Log::LOG_WARN, "- video: %s\n- allowSkipping: %s",
event->video.c_str(),
event->allowSkipping ? "true" : "false");

@ -92,7 +92,7 @@ namespace MWScript
mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent();
event->video = name;
event->allowSkipping = allowSkipping;
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_VIDEO_PLAY)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_VIDEO_PLAY)->Send(event);
MWBase::Environment::get().getWindowManager()->playVideo (name, allowSkipping);
}
@ -198,7 +198,7 @@ namespace MWScript
event->cellRef.mRefID = ptr.getCellRef().getRefId();
event->cellRef.mRefNum = ptr.getCellRef().getRefNum();
event->lockLevel = lockLevel;
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_LOCK)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_LOCK)->Send(event);
ptr.getClass().lock (ptr, lockLevel);
@ -231,7 +231,7 @@ namespace MWScript
event->cell = *ptr.getCell()->getCell();
event->cellRef.mRefID = ptr.getCellRef().getRefId();
event->cellRef.mRefNum = ptr.getCellRef().getRefNum();
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_UNLOCK)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_UNLOCK)->Send(event);
ptr.getClass().unlock (ptr);
}
@ -698,7 +698,7 @@ namespace MWScript
event->cell = *ptr.getCell()->getCell();
event->cellRef.mRefID = ptr.getCellRef().getRefId();
event->cellRef.mRefNum = ptr.getCellRef().getRefNum();
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_DELETE)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_DELETE)->Send(event);
MWBase::Environment::get().getWorld()->deleteObject(ptr);
}

@ -51,7 +51,7 @@ namespace MWScript
event->cellRef.mRefNum = ptr.getCellRef().getRefNum();
event->cellRef.mPos = ptr.getCellRef().getPosition();
event->scale = scale;
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_SCALE)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_SCALE)->Send(event);
MWBase::Environment::get().getWorld()->scaleObject(ptr,scale);
}
@ -542,9 +542,9 @@ namespace MWScript
event->cellRef.mRefID = ptr.getCellRef().getRefId();
event->cellRef.mRefNum = ptr.getCellRef().getRefNum();
event->cellRef.mPos = ptr.getCellRef().getPosition();
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_PLACE)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_PLACE)->Send(event);
printf("Sending ID_WORLD_OBJECT_PLACE about %s\n%i\n",
printf("Sending ID_OBJECT_PLACE about %s\n%i\n",
event->cellRef.mRefID.c_str(),
event->cellRef.mRefNum.mIndex);
}

@ -28,9 +28,9 @@ namespace MWWorld
event->cell = *getTarget().getCell()->getCell();
event->cellRef.mRefID = getTarget().getCellRef().getRefId();
event->cellRef.mRefNum = getTarget().getCellRef().getRefNum();
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_DELETE)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_DELETE)->Send(event);
printf("Sending ID_WORLD_OBJECT_DELETE about\n- cellRef: %s, %i\n- cell: %s",
printf("Sending ID_OBJECT_DELETE about\n- cellRef: %s, %i\n- cell: %s",
event->cellRef.mRefID.c_str(),
event->cellRef.mRefNum.mIndex,
event->cell.getDescription().c_str());

@ -2257,7 +2257,7 @@ namespace MWWorld
event->cellRef.mRefID = door.getCellRef().getRefId();
event->cellRef.mRefNum = door.getCellRef().getRefNum();
event->state = state;
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_DOOR_ACTIVATE)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_DOOR_ACTIVATE)->Send(event);
printf("Door activation 1\n- cellRef: %s, %i\n- cell: %s\n- state: %s",
event->cellRef.mRefID.c_str(),
@ -2277,7 +2277,7 @@ namespace MWWorld
event->cellRef.mRefID = door.getCellRef().getRefId();
event->cellRef.mRefNum = door.getCellRef().getRefNum();
event->state = state;
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_DOOR_ACTIVATE)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_DOOR_ACTIVATE)->Send(event);
printf("Door activation 2\n- cellRef: %s, %i\n- cell: %s\n- state: %s",
event->cellRef.mRefID.c_str(),

@ -33,17 +33,17 @@ enum GameMessages
ID_GAME_TIME,
ID_GAME_INVENTORY,
ID_WORLD_OBJECT_PLACE,
ID_WORLD_OBJECT_DELETE,
ID_WORLD_OBJECT_LOCK,
ID_WORLD_OBJECT_UNLOCK,
ID_WORLD_OBJECT_SCALE,
ID_WORLD_CONTAINER_ADD,
ID_WORLD_CONTAINER_REMOVE,
ID_WORLD_DOOR_ACTIVATE,
ID_WORLD_ACTIVATOR_ACTIVATE,
ID_WORLD_VIDEO_PLAY
ID_OBJECT_PLACE,
ID_OBJECT_DELETE,
ID_OBJECT_LOCK,
ID_OBJECT_UNLOCK,
ID_OBJECT_SCALE,
ID_CONTAINER_ADD,
ID_CONTAINER_REMOVE,
ID_DOOR_ACTIVATE,
ID_ACTIVATOR_ACTIVATE,
ID_VIDEO_PLAY
};

@ -5,7 +5,7 @@ using namespace mwmp;
PacketActivatorActivate::PacketActivatorActivate(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_WORLD_ACTIVATOR_ACTIVATE;
packetID = ID_ACTIVATOR_ACTIVATE;
}
void PacketActivatorActivate::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)

@ -5,7 +5,7 @@ using namespace mwmp;
PacketContainerAdd::PacketContainerAdd(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_WORLD_CONTAINER_ADD;
packetID = ID_CONTAINER_ADD;
}
void PacketContainerAdd::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)

@ -5,7 +5,7 @@ using namespace mwmp;
PacketContainerRemove::PacketContainerRemove(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_WORLD_CONTAINER_REMOVE;
packetID = ID_CONTAINER_REMOVE;
}
void PacketContainerRemove::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)

@ -5,7 +5,7 @@ using namespace mwmp;
PacketDoorActivate::PacketDoorActivate(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_WORLD_DOOR_ACTIVATE;
packetID = ID_DOOR_ACTIVATE;
}
void PacketDoorActivate::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)

@ -5,7 +5,7 @@ using namespace mwmp;
PacketObjectDelete::PacketObjectDelete(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_WORLD_OBJECT_DELETE;
packetID = ID_OBJECT_DELETE;
}
void PacketObjectDelete::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)

@ -5,7 +5,7 @@ using namespace mwmp;
PacketObjectLock::PacketObjectLock(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_WORLD_OBJECT_LOCK;
packetID = ID_OBJECT_LOCK;
}
void PacketObjectLock::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)

@ -5,7 +5,7 @@ using namespace mwmp;
PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_WORLD_OBJECT_PLACE;
packetID = ID_OBJECT_PLACE;
}
void PacketObjectPlace::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)

@ -5,7 +5,7 @@ using namespace mwmp;
PacketObjectScale::PacketObjectScale(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_WORLD_OBJECT_SCALE;
packetID = ID_OBJECT_SCALE;
}
void PacketObjectScale::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)

@ -5,7 +5,7 @@ using namespace mwmp;
PacketObjectUnlock::PacketObjectUnlock(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_WORLD_OBJECT_UNLOCK;
packetID = ID_OBJECT_UNLOCK;
}
void PacketObjectUnlock::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)

@ -5,7 +5,7 @@ using namespace mwmp;
PacketVideoPlay::PacketVideoPlay(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_WORLD_VIDEO_PLAY;
packetID = ID_VIDEO_PLAY;
}
void PacketVideoPlay::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)

Loading…
Cancel
Save