Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define( 'Foals_Dir', 'plugins/Foals/' );
- define( 'Foals_version', '0.1' );
- define ( 'Foals_File' , "plugins/Foals/data.txt");
- function Foals_init()
- {
- $_SESSION ['hooks'];
- $_SESSION ['this_plugin'];
- echo "Loaded Foals 0.1\r\n";
- $_SESSION ['hooks']['after_load_settings'] = 'Foals_run';
- }
- function Load_Settings()
- {
- $s=load_array('data.txt');
- if(!$s){
- $s = array(
- 'cycles' => '',
- 'data' => ''
- );
- }
- return $s;
- }
- function Foals_run() {
- $s=Load_Settings();
- $data = explode(",",$s['data']);
- foreach($data as $horse){
- AddLog2(' Making ' . $s['cycles' ] . Units_GetRealnameByName($horse) . ' Foal Reward Link');
- for($i=0; $i<=$s['cycles']; $i++){
- $amf = new AMFObject("");
- $amf->_bodys[0] = new MessageBody();
- $amf->_bodys[0]->targetURI = 'FlashService.dispatchBatch';
- $amf->_bodys[0]->_value[0] = GetAMFHeaders();
- $amf->_bodys[0]->_value[1][0]['params'][0] = $horse;
- $amf->_bodys[0]->_value[1][0]['sequence'] =GetSequense();
- $amf->_bodys[0]->_value[1][0]['functionName'] = "WanderingAnimalService.onShareFoal";
- $amf->_bodys[0]->_value[2] = 0;
- $res = RequestAMF($amf, true);
- if ($res['res'] == 'OK') {
- if (isset($res['amf2']->_bodys[0]->_value['data'][0]['data']['rewardUrl'])) {
- $uSQL = 'INSERT OR REPLACE INTO rewardstore(userid, rewardlink, rewarditem, timestamp) values("' . $_SESSION['userId'] . '","' . $res['amf2']->_bodys[0]->_value['data'][0]['data']['rewardUrl'] . '", "' . $horse . '", "' . time() . '")';
- $_SESSION['vRewardStoreDB']->exec($uSQL);
- }
- }
- }Addlog2('Genenrated' . $s['cycles'] . Units_GetRealnameByName($s['data']) . ' Foal Reward Links');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement