Example #1
0
 void processMessage(const RoutableMessageHeader &hdr, MemoryReference body) {
     Persistence::Protocol::Response resp;
     resp.ParseFromArray(body.data(), body.length());
     if (hdr.has_return_status() || resp.has_return_status()) {
         SILOG(cppoh,info,"Failed to connect to database: "<<hdr.has_return_status()<<", "<<resp.has_return_status());
         mSuccess = true;
         return;
     }
     Protocol::UUIDListProperty uuidList;
     if (resp.reads(0).has_return_status()) {
         SILOG(cppoh,info,"Failed to find ObjectList in database.");
         mSuccess = true;
         return;
     }
     uuidList.ParseFromString(resp.reads(0).data());
     for (int i = 0; i < uuidList.value_size(); i++) {
         SILOG(cppoh,info,"Loading object "<<ObjectReference(uuidList.value(i)));
         HostedObjectPtr obj = HostedObject::construct<HostedObject>(mObjectHost, uuidList.value(i));
         obj->initializeRestoreFromDatabase(mSpace, HostedObjectPtr());
     }
     mSuccess = true;
 }
void ObjectQueryProcessor::deliverProximityUpdate(HostedObjectPtr ho, const SpaceObjectReference& sporef, const Sirikata::Protocol::Prox::ProximityUpdate& update) {
    ho->handleProximityUpdate(sporef, update);
}
void ObjectQueryProcessor::deliverLocationUpdate(HostedObjectPtr ho, const SpaceObjectReference& sporef, const LocUpdate& lu) {
    ho->handleLocationUpdate(sporef, lu);
}
Example #4
0
void ObjectHost::commandObjectPresences(const Command::Command& cmd, Command::Commander* cmdr, Command::CommandID cmdid) {
    HostedObjectPtr ho = getCommandObject(cmd, cmdr, cmdid);
    if (!ho) return;

    ho->commandPresences(cmd, cmdr, cmdid);
}