Exemplo n.º 1
0
bool Host::dispatchEvent(TargetID sourceID, PacketData& data)
{
  const ObjectID recipientID = data.read16();
  const EventID eventID = data.read8();

  Object* object = findObject(recipientID);
  if (!object)
  {
    if (isClient() || m_objectIDs.bucketOf(recipientID) == ID_BUCKET_UNUSED)
      logError("Failed to find recipient object %u", recipientID);

    return false;
  }

  object->receiveEvent(sourceID, data, eventID);
  return true;
}