GenericCAO* ClientEnvironment::getGenericCAO(u16 id) { ClientActiveObject *obj = getActiveObject(id); if (obj && obj->getType() == ACTIVEOBJECT_TYPE_GENERIC) return (GenericCAO*) obj; else return NULL; }
void ClientEnvironment::processActiveObjectMessage(u16 id, const std::string &data) { ClientActiveObject *obj = getActiveObject(id); if (obj == NULL) { infostream << "ClientEnvironment::processActiveObjectMessage():" << " got message for id=" << id << ", which doesn't exist." << std::endl; return; } try { obj->processMessage(data); } catch (SerializationError &e) { errorstream<<"ClientEnvironment::processActiveObjectMessage():" << " id=" << id << " type=" << obj->getType() << " SerializationError in processMessage(): " << e.what() << std::endl; } }