| 请问如何关闭商店买草?iamxyh 发表于 2009-11-15 20:42
 试下下面方法,记得先备份.
 
 一. 找到
 删除复制代码                if ( $_REQUEST['uId'] == NULL )
                {
                                $mucaomy = 1;
                }
 二,找到
 删除最上面的和最下面三,找到复制代码                if ( $mucaomy != 1 )
                {
                                $logyes = 0;
                                foreach ( $mc_log[help] as $key => $value )
                                {
                                                                if ( !( $_SGLOBAL['timestamp'] < $key + 1800 ) && !( $value[uid] == $_SGLOBAL['supe_uid'] ) )
                                                                {
                                                                                                continue;
                                                }
                                                                                      $mc_log[help][$key]['40'] = $mc_log[help][$key]['40'] + $_REQUEST['foodnum'];
                                                                                                                                 $logyes = 1;
                                                                                                                                 break;
                                }
                                if ( $logyes == 0 )
                                {
                                                                                                $space[name] = $space[username];
                                                                
                                                                $mc_log[help][$_SGLOBAL['timestamp']] = array(
                                                                                                "uid" => $_SGLOBAL['supe_uid'],
                                                                                                "name" => unicode_encodegb( $space[name] ),
                                                                                                "1001" => 0,
                                                                                                "1002" => 0,
                                                                                                "1003" => 0,
                                                                                                "1004" => 0,
                                                                                                "1005" => 0,
                                                                                                "1006" => 0,
                                                                                                "1007" => 0,
                                                                                                "1008" => 0,
                                                                                                "1501" => 0,
                                                                                                "1502" => 0,
                                                                                                "1503" => 0,
                                                                                                "1504" => 0,
                                                                                                "1505" => 0,
                                                                                                "40" => $_REQUEST['foodnum']
                                                                );
                                }
                                foreach ( $mc_log[help] as $key => $value )
                                                               {
                                                                                                  if ( $key < $_SGLOBAL['timestamp'] - 172800 )               
                                                               {
                                                                                                   unset( $_SGLOBAL['timestamp'][$key] ); // 原来这句,会执行错误,所以你突然不能加草、生产、偷蛋了,而且,传回服务器时间被置零:时间乱了
                                                               //unset( $mc_log['help'][$key] );
                                                }
                                                                }
                                                                }
删除.复制代码                        }
                }
                if ( $_REQUEST['type'] == "1" )
        {
                $mc_price = 60;
                $mc_id = 40;
                $fruit = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT fruit FROM ".tname( "plug_newfarm" )." where uid=".$_SGLOBAL['supe_uid'] ), 0 );
                $fruit = json_decode( $fruit );
                $money = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT money FROM ".tname( "plug_newfarm" )." where uid=".$_SGLOBAL['supe_uid'] ), 0 );
                if ( $money < $mc_price * $_REQUEST['foodnum'] ){
                        echo "{"errorContent":"\\u4F60\\u7684\\u91D1\\u5E01\\u4E0D\\u8DB3\\uFF0C\\u8D2D\\u4E70".$_REQUEST['foodnum']."\\u68F5\\u7267\\u8349\\uFF0C\\u5171\\u9700\\u8981".($mc_price * $_REQUEST['foodnum'])."\\u4E2A\\u91D1\\u5E01\\u3002","errorType":"1011"}";
                        exit();
                }
                $fruit->$mc_id = $fruit->$mc_id + $_REQUEST['foodnum'];
                $fruit = json_encode( $fruit );
                $money = $money - ($mc_price * $_REQUEST['foodnum']);
                $money < 0 && $money = 0;
                $mc_exps = $_REQUEST['foodnum'] / 5;
                $mc_exps > 5 && $mc_exps = 5;
                $_SGLOBAL['db']->query("UPDATE ".tname( "plug_newfarm" )." set fruit='".$fruit."',money=".$money.",mc_exp=mc_exp+'".$mc_exps."' where uid=".$_SGLOBAL['supe_uid'] );
                $query = $_SGLOBAL['db']->query( "SELECT animal FROM ".tname( "plug_newfarm" )." where uid=".intval( $_SGLOBAL['supe_uid'] ) );
                while ( $value = $_SGLOBAL['db']->fetch_array( $query ) )
                {
                        $list[] = $value;
                }
                $animal = ( array )json_decode( $list[0]['animal'] );
                foreach ( $animal['animal'] as $key => $value )
                {
                    if ( 0 < $value->cId ) {
                        if ( $value->postTime == 0 )
                        {
                                $time = $_SGLOBAL['timestamp'] - $value->buyTime;
                                if ( $animaltime[$value->cId][0] + $animaltime[$value->cId][1] <= $time )
                                {
                                        $status = 3;
                                        $growTimeNext = 12993;
                                        $statusNext = 6;
                                }
                                if ( $animaltime[$value->cId][0] <= $time && $time < $animaltime[$value->cId][0] + $animaltime[$value->cId][1] )
                                {
                                        $status = 2;
                                        $growTimeNext = $animaltime[$value->cId][0] + $animaltime[$value->cId][1] - $time;
                                        $statusNext = 3;
                                }
                                if ( $time < $animaltime[$value->cId][0] )
                                {
                                        $status = 1;
                                        $growTimeNext = $animaltime[$value->cId][0] - $time;
                                        $statusNext = 2;
                                }
                                if ( $animaltime[$value->cId][5] < $time )
                                {
                                        $status = 6;
                                        $growTimeNext = 0;
                                        $statusNext = 6;
                                }
                                $newanimal[] = "{"buyTime":".$value->buyTime.","cId":".$value->cId.","growTime":".$time.","growTimeNext":".$growTimeNext.","hungry":0,"serial":".$key.","status":".$status.","statusNext":".$statusNext.","totalCome":".$value->totalCome."}";
                        }
                        else
                        {
                                $totalCome = $value->totalCome;
                                $time = $_SGLOBAL['timestamp'] - $value->buyTime;
                                if ( $animaltime[$value->cId][5] < $time )
                                {
                                        $status = 6;
                                        $statusNext = 6;
                                        $growTimeNext = 0;
                                }
                                if ( $animaltime[$value->cId][4] < $_SGLOBAL['timestamp'] - $value->postTime )
                                {
                                        $status = 3;
                                        $statusNext = 6;
                                        $growTimeNext = 12993;
                                }
                                if ( $_SGLOBAL['timestamp'] - $value->postTime <= $animaltime[$value->cId][4] )
                                {
                                        $status = 5;
                                        $statusNext = 3;
                                        $growTimeNext = $animaltime[$value->cId][4] - ( $_SGLOBAL['timestamp'] - $value->postTime );
                                }
                                if ( $_SGLOBAL['timestamp'] - $value->postTime <= $animaltime[$value->cId][3] )
                                {
                                        $status = 4;
                                        $statusNext = 5;
                                        $growTimeNext = $animaltime[$value->cId][3] - ( $_SGLOBAL['timestamp'] - $value->postTime );
                                        $totalCome -= $shop[$value->cId][output];
                                }
                                if ( $value->buyTime + $animaltime[$value->cId][5] - $animaltime[$value->cId][3] - $animaltime[$value->cId][4] < $_SGLOBAL['timestamp'] )
                                {
                                        $status = 5;
                                        $statusNext = 6;
                                        $growTimeNext = $animaltime[$value->cId][5] - $time;
                                }
                                $newanimal[] = "{"buyTime":".$value->buyTime.","cId":".$value->cId.","growTime":".$time.","growTimeNext":".$growTimeNext.","hungry":0,"serial":".$key.","status":".$status.","statusNext":".$statusNext.","totalCome":".$totalCome."}";
                        }
                    }
                }
                $newanimal = json_encode( $newanimal );
                $newanimal = str_replace( ""{", "{", $newanimal );
                $newanimal = str_replace( "}"", "}", $newanimal );
                $newanimal = str_replace( "null", "[]", $newanimal );
                echo stripslashes("{"added":".$_REQUEST['foodnum'].","animal":".$newanimal.","direction":"\\\\u6210\\\\u529f\\\\u8d2d\\\\u4e70".$_REQUEST['foodnum']."\\\\u68f5\\\\u7267\\\\u8349\\\\uff0c\\\\u5171\\\\u82b1\\\\u8d39\\\\u91d1\\\\u5e01".($mc_price * $_REQUEST['foodnum'])."\\\\uff0c\\\\u5df2\\\\u653e\\\\u5165\\\\u60a8\\\\u7684\\\\u80CC\\\\u5305\\\\u5185\\\\u3002","money":".($mc_price * $_REQUEST['foodnum']).","total":".floor($animal[animalfood]).","type":1}");
                exit();
        }
 如果不行,就把60改为60000,就没人买了.
 |