authenticate_request(); $sloodle->load_module('distributor', true); // Fetch the required additional parameters $sloodleinventory = $sloodle->request->optional_param('sloodleinventory', ''); $sloodlegiveobject = $sloodle->request->optional_param('sloodlegiveobject', ''); $sloodleuuid = $sloodle->request->optional_param('sloodleuuid', ''); if ($sloodleinventory != '') { // Attempt to update the inventory $objects = explode('|', $sloodleinventory); if (!$sloodle->module->set_objects($objects)) { // Update failed $sloodle->response->quick_output(-101, 'SYSTEM', 'Failed to update list of objects', false); exit(); } // Everything seems fine $sloodle->response->set_status_code(1); $sloodle->response->set_status_descriptor('OK'); } else if ($sloodlegiveobject != '') { $sloodle->validate_user(true); //$sloodle->validate_requirements(); //$sloodle->process_interaction('default', 1); // Everything seems fine $sloodle->response->set_status_code(SLOODLE_CHANNEL_DISTRIBUTOR_DO_GIVE_OBJECT); $sloodle->response->set_status_descriptor('OK'); // Pass back the line for what we want to give // That way the object to give and the avatar to give to will both be in the response // ...and we don't need to preserve state in the script $sloodle->response->add_data_line($sloodleuuid); // avatar line $sloodle->response->add_data_line($sloodlegiveobject); // object } // Output our response $sloodle->response->render_to_output();