function checkImmediatePic() { global $config; logMessage("Checking ImmediatePic flag"); $post = array('action' => 'immediatePic', 'PID' => $config->PID); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $config->serverurl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close($ch); logMessage("Got result: " . $result); $jsonout = json_decode($result); if ($jsonout->takePic == 1) { logMessage("Taking pic, say cheese!"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://localhost:8080/0/action/snapshot"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close($ch); sleep(3); // just a little delay to take the pic uploadNewPics(); /*$pic = file_get_contents("/dev/shm/cam1/lastsnap.jpg"); logMessage("Pic taken, file size is ".strlen($pic)." bytes"); //dan, pick up here, need to send a file!!! uploadPic($pic,time(),false); */ resetFlags(); } }
if ($_GET['action'] == 'delete') { deleteCharacter($_GET['id']); } else { echo "Invalid Action"; } } elseif (isset($_POST['action'])) { if ($_POST['action'] == 'change') { updateChar(); } elseif ($_POST['action'] == 'rename') { flagRename(); } elseif ($_POST['action'] == 'customize') { flagCustomize(); } elseif ($_POST['action'] == 'talents') { flagTalentReset(); } elseif ($_POST['action'] == 'reset') { resetFlags(); } } else { $character = $CDB->selectRow("SELECT * FROM `characters` WHERE `guid`='" . $_GET['id'] . "'"); ?> <table style="border-bottom: 1px solid #E5E2E2; width: 500px; margin-left: auto; margin-right: auto;"> <thead> <th colspan="4"><center><b><?php echo $lang['general_info']; ?> </center></b></th> </thead> <tbody>