Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. <?php
  2.  
  3. define( 'Foals_Dir', 'plugins/Foals/' );
  4. define( 'Foals_version', '0.1' );
  5. define ( 'Foals_File' , "plugins/Foals/data.txt");
  6.  
  7.  
  8. function Foals_init()
  9. {
  10. $_SESSION ['hooks'];
  11. $_SESSION ['this_plugin'];
  12. echo "Loaded Foals 0.1\r\n";
  13. $_SESSION ['hooks']['after_load_settings'] = 'Foals_run';
  14. }
  15.  
  16. function Load_Settings()
  17. {
  18. $s=load_array('data.txt');
  19. if(!$s){
  20. $s = array(
  21. 'cycles' => '',
  22. 'data' => ''
  23. );
  24. }
  25. return $s;
  26. }
  27. function Foals_run() {
  28. $s=Load_Settings();
  29. $data = explode(",",$s['data']);
  30. foreach($data as $horse){
  31. AddLog2(' Making ' . $s['cycles' ] . Units_GetRealnameByName($horse) . ' Foal Reward Link');
  32. for($i=0; $i<=$s['cycles']; $i++){
  33. $amf = new AMFObject("");
  34. $amf->_bodys[0] = new MessageBody();
  35. $amf->_bodys[0]->targetURI = 'FlashService.dispatchBatch';
  36. $amf->_bodys[0]->_value[0] = GetAMFHeaders();
  37. $amf->_bodys[0]->_value[1][0]['params'][0] = $horse;
  38. $amf->_bodys[0]->_value[1][0]['sequence'] =GetSequense();
  39. $amf->_bodys[0]->_value[1][0]['functionName'] = "WanderingAnimalService.onShareFoal";
  40. $amf->_bodys[0]->_value[2] = 0;
  41. $res = RequestAMF($amf, true);
  42. if ($res['res'] == 'OK') {
  43. if (isset($res['amf2']->_bodys[0]->_value['data'][0]['data']['rewardUrl'])) {
  44. $uSQL = 'INSERT OR REPLACE INTO rewardstore(userid, rewardlink, rewarditem, timestamp) values("' . $_SESSION['userId'] . '","' . $res['amf2']->_bodys[0]->_value['data'][0]['data']['rewardUrl'] . '", "' . $horse . '", "' . time() . '")';
  45. $_SESSION['vRewardStoreDB']->exec($uSQL);
  46. }
  47. }
  48. }Addlog2('Genenrated' . $s['cycles'] . Units_GetRealnameByName($s['data']) . ' Foal Reward Links');
  49. }
  50. }
  51.  
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement