BSN mining app
Publish: 2021-04-20 13:45:42
1.
方案一:给原生APP提供api接口
使用TP框架时 放在common文件夹下文件名就叫function.php
<?php
/**
*Createdbyzhangkx
*Email:[email protected]
*Date:2015/8/1
*Time:23:15
*/
/******api开发辅助函数*******/
/**
*@paramnull$msg返回正确的提示信息
*@paramflagsuccessCURD操作成功
*@paramarray$data具体返回信息
*Functiondescript:返回带参数,标志信息,提示信息的json数组
*
*/
functionreturnApiSuccess($msg=null,$data=array()){
$result=array(
'flag'=>'Success',
'msg'=>$msg,
'data'=>$data
);
print<ahref="https://www..com/s?wd=json_encode&tn=44039180_cpr&fenlei=-yw9Uz4Bmy-bIi4WUvYETgN-"target="_blank"class="-highlight">json_encode</a>($result);
}
/**
*@paramnull$msg返回具体错误的提示信息
*@paramflagsuccessCURD操作失败
*Functiondescript:返回标志信息‘Error',和提示信息的json数组
*/
functionreturnApiError($msg=null){
$result=array(
'flag'=>'Error',
'msg'=>$msg,
);
print<ahref="https://www..com/s?wd=json_encode&tn=44039180_cpr&fenlei=-yw9Uz4Bmy-bIi4WUvYETgN-"target="_blank"class="-highlight">json_encode</a>($result);
}
/**
*@paramnull$msg返回具体错误的提示信息
*@paramflagsuccessCURD操作失败
*Functiondescript:返回标志信息‘Error',和提示信息,当前系统繁忙,请稍后重试
*/
functionreturnApiErrorExample(){
$result=array(
'flag'=>'Error',
'msg'=>'当前系统繁忙,请稍后重试',
);
print<ahref="https://www..com/s?wd=json_encode&tn=44039180_cpr&fenlei=-yw9Uz4Bmy-bIi4WUvYETgN-"target="_blank"class="-highlight">json_encode</a>($result);
}
/**
*@paramnull$data
*@returnarray|mixed|null
*Functiondescript:过滤post提交的参数
*
*/
functioncheckDataPost($data=null){
if(!empty($data)){
$data=explode(',',$data);
foreach($dataas$k=>$v){
if((!isset($_POST[$k]))||(empty($_POST[$k]))){
if($_POST[$k]!==0&&$_POST[$k]!=='0'){
returnApiError($k.'值为空');
}
}
}
unset($data);
$data=I('post.');
unset($data['_URL_'],$data['token']);
return$data;
}
}
/**
*@paramnull$data
*@returnarray|mixed|null
*Functiondescript:过滤get提交的参数
*
*/
functioncheckDataGet($data=null){
if(!empty($data)){
$data=explode(',',$data);
foreach($dataas$k=>$v){
if((!isset($_GET[$k]))||(empty($_GET[$k]))){
if($_GET[$k]!==0&&$_GET[$k]!=='0'){
returnApiError($k.'值为空');
}
}
}
unset($data);
$data=I('get.');
unset($data['_URL_'],$data['token']);
return$data;
}
}
查询单个果品详细信息
/**
*发布模块
*
*获取信息单个果品详细信息
*
*/
(){
//检查是否通过post方法得到数据
checkdataPost('id');
$where['id']=$_POST['id'];
$field[]='id,fruit_name,high_price,low_price,address,size,weight,fruit_pic,remark';
$releaseInfo=$this->release_obj->findRelease($where,$field);
$releaseInfo['remark']=<ahref="https://www..com/s?wd=mb_substr&tn=44039180_cpr&fenlei=-yw9Uz4Bmy-bIi4WUvYETgN-"target="_blank"class="-highlight">mb_substr</a>($releaseInfo['remark'],0,49,'utf-8').'...';
//多张图地址按逗号截取字符串,截取后如果存在空数组则需要过滤掉
$releaseInfo['fruit_pic']=<ahref="https://www..com/s?wd=array_filter&tn=44039180_cpr&fenlei=-yw9Uz4Bmy-bIi4WUvYETgN-"target="_blank"class="-highlight">array_filter</a>(explode(',',$releaseInfo['fruit_pic']));
$fruit_pic=$releaseInfo['fruit_pic'];unset($releaseInfo['fruit_pic']);
//为图片添加存储路径
foreach($fruit_picas$k=>$v){
$releaseInfo['fruit_pic'][]='http://'.$_SERVER['HTTP_HOST'].'/Uploads/Release/'.$v;
}
if($releaseInfo){
returnApiSuccess('',$releaseInfo);
}else{
returnApiError('什么也没查到(+_+)');
}
}
findRelease()方法的model
/**
*查询一条数据
*/
publicfunctionfindRelease($where,$field){
if($where['status']==''||empty($where['status'])){
$where['status']=array('neq','9');
}
$result=$this->where($where)->field($field)->find();
return$result;
}
app端接收到的数据解码json之后
{
"flag":"success",
"message":"",
"responseList":{
"id":"2",
"fruit_name":"苹果",
"high_price":"8.0",
"low_price":"5.0",
"address":"天津小白楼水果市场",
"size":"2.0",
"weight":"2.0",
"remark":"急需...",
"fruit_pic":[
"http://fruit.txunda.com/Uploads/Release/201508/55599e7514815.png",
"http://fruit.txunda.com/Uploads/Release/201508/554f2dc45b526.jpg"
]
}
}
app端接收到的数据原生json串
代码如下:
{"flag":"success","message":"","responseList":{"id":"2","fruit_name":"u82f9u679c","high_price":"8.0","low_price":"5.0","address":"","size":"2.0","weight":"2.0","remark":"u6025u9700...","fruit_pic":["http://fruit.txunda.com/Uploads/Release/201508/55599e7514815.png","http://fruit.txunda.com/Uploads/Release/201508/554f2dc45b526.jpg"]}}
2. 1. Collection skill (/ mining
experience acquisition: mining ore
skill: [double drop] there is a chance of double drop ring mining, and the probability is [(0.1 * level)%]
[rampant miner] in this state, the player's mining speed will be doubled, and there is a triple drop probability, but it will lose two times of rability. The mining effect is only effective for the blocks with given experience< Block experience:
sandstone 30 stone 40 fluorite 30 hell rock 30 coal mine 100 red stone mine 150 Obsidian 150 iron mine 250 gold mine 350 lapis lazuli mine 400 diamond mine 750
2, The probability is [(0.1 * level)%]
[leaves blow away] when the logging level is above 100, when you cut the leaves with an axe, you have a 10% chance to drop seedlings
[tree killer] in the tree killer state, when you cut the log, all the trees and leaves within a certain range of the log will be cut< 3. Pharmaceutics (/ herbalism
experience gained: harvest crops manually
skill: [herbalism] bread and mushroom soup will have therapeutic effect, and the specific effect depends on the level. The amount of bread treatment: [3.5 + (level / 50) * 0.5HP], Treatment dose of mushroom soup: [5 + (grade / 50) * 0.5HP]
[green wheat] when you harvest wheat, you have a chance to sow wheat again after harvest without consuming seeds. The growth stage of sown wheat is determined by the grade, adding one stage every 200 grades
[double drop] when you harvest a crop, you have a chance to double drop. The probability is [(level ÷ 10)%]
[green stone] when you sprinkle seeds on some blocks, you have a chance to become another kind of block, and the probability increases with the level
[collection technique] in the state of planting expert, the horticulturist's effect will be 100% successful, and there is a three times chance of falling when harvesting crops
cube experience:
vine 10 watermelon 20 pumpkin 20 sugarcane 30 cactus 30 wheat 50 hell wart 50 lotus leaf 100 flower 100 mushroom 150
4. Digging (/ excavation
experience acquisition: digging
skill: [treasure hunter] when you dig, you will have a chance to dig other items
[rampage drill] in this state, you will gain 3 times of drop probability and 3 times of experience gain, and the digging speed will increase, but it will consume 2 times of rability<
cube experience:
all mineable cube experiences are the same as 40
treasure hunter's droppable items and minimum mining level: (red is the common drop of cubes)
grass procts:
phosphor 25, cocoa beans 50, eggs 250, CD 250, apple 250, diamond 350, mushroom 500
gravel procts:
flint 0, gunpowder 75, bones 175
hell rock 850
sand Proce procts:
soul sand 650
clay proce procts:
map 25 slime ball 150 spider silk 250 iron bucket 500 clock 500 spider web 750 cake 750
5. Fishing (/ fishing
experience acquisition: catch fish or other items
skill: [treasure hunter] when you fish, how often do you catch other items? The quality of the items is related to the level
[stealing] when you use a fishing rod on some creatures, you will get some extra items<
treasure hunter's dropable items:
leather equipment, stone equipment, iron equipment, gold equipment, diamond equipment, shadow pearl CD, flame rod, red stone, fluorite powder
6. Repair (/ repair
experience gained: use iron to repair tools, rability
skill: [repair master] when you upgrade your level, each material will restore an additional [(0.2 * level)%] rability
[super repair] there is a chance of double rability ring repair, and the probability is [(0.1 * level)%]
[enchant repair] enchant can be retained ring repair. The minimum requirement is level 100. Data 2 http://m.gamer.com.tw/forum/C.php?bsn=18673&snA=3076 / Mining: mining skills: active super breaker super Mining: can instantly dig out most of the bricks (Rock Series): passive double drops double harvest: Organic rate to dig one to get two (can be used to recycle non recyclable super mining, rability consumption will be doubled after starting, but the item will fall three times (start) Time increases with level (cooling time: 4 minutes) PS after startup, you can destroy any mineral with different levels of cross script. For example, you can destroy Obsidian with wooden pick, but you won't drop obsidian. However, super mining with diamond pick will drop three times as much obsidian. Some of the experience table also has the highest number of obsidian (150xp) and diamond (70exp) Recommended upgrade method: 1. Dig coal mine or red stone because the quantity is very far, faster than looking for rare diamonds (use the quantity to make up for the lack of exp) and match with repair skills ~ 2. If you have knocked down the terminal dragon, you are welcome to move the terminal home! Skill level of double drop rate formula * 01% example: lv1000 = 100% -- woodcutting: experience value: Oak 80, pine 90 Birch 70: active tree Feller super logging: can instantly dig out the 3x3x3 square with wood as the center (Flora): passive leafblower leaf killer: probability to kill large leaves in seconds: passive double drop double harvest: Organic rate to dig one will get two (can be used to collect non recyclable items back and forth) super logging range lv0-499: 3x3x3x3lv500-949: 4x4x4lv950 +: 5X5 X5 double harvest formula skill level * 01% example: lv1000 = 100% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / herbalism: farming skill: active green Terra green finger: after starting, Three times what has been harvested: passive healing seeder: if you plant seeds on pebbles, you have a chance to turn them into mosses. Green Terra will automatically plant seeds after harvesting (but it's useless because it will be knocked out automatically when harvesting). Green tumb is green finger. Healing function has been cancelled (cancelled after adding satiety in a certain version of MC). In addition, pumpkin experience has not been improved Unlike Wiki's 500exp: shovel skill: active Giga drill breaker: sand damage: after starting, What destroys the nature of sandy soil (sandy soil system): passive treasure hunt: when you are digging, you will find something good. First of all, you should mention the Giga drill breaker! Source (there is a super plot in Tianyuan breakthrough episode 8, ray wants not to watch the plot by himself). Since Tianyuan and Carmina are mentioned in this beautiful morning, we need to review God mad to warm up our blood (it has nothing to do with MC ~ you don't need to watch it). Giga drill breaker will lose twice as long after starting, but the falling object will triple. The starting time increases with the level skill, and the cooling time is 4 minutes The chart of hunt treasure hunter skill wiki is too messy, so I reclassified the treasure hunt skill experience value by myself. If I dig extra, I will also give (ex: dig grass to remove soil and add egg experience value is 40 + 100) level drop probability experience value of grass 0 soil 100% 40 25 fluorescein st 5% 80 50 cocoa beans 1.33% 80 250 eggs 1% 100 250 apples 0.1% 100 500 one of two kinds of mushrooms Ground like gravel 0 flint 10% 400 gravel 90% 40 75 powder 10% 30 175 bone 10% 30 850 hellstone 0.5% 3000 sand 0 sand 100% 40 50 fluorite st 5% 80 650 soul sand 0.5% 80 clay 0 clay X4 100% 40 25 map 2% 200 150 Slime ball 5% 100 250 thread 5% 200 500 iron barrel 0.1% 100 500 clock 0.1% 100 750 spider silk 5% 150 dig anything organic rate Item gold record lv250 0.05% 3000exp green record lv250 0.05% 3000exp diamond lv350 0.13% 1000exp cake lv750 0.05% 3000expps it takes 721 minutes to dig continuously with a shovel to reach lv1000. The author says that after lv350, the built-in diamond will drop about 1000 soil to spray, which will make everyone feel at ease Unarmed skill: active berserk destroyer: timeliness, can explode diamonds (sand system), and you want to flatten: creature: passive disarm: probability, can hit other players to strip (?) Berserk: Increases attack power by 50%, increases passive attack power by LV 250, increases attack power by one heart by LV 500, increases three heart disarming formula by 0.25% X lvex: lv1000 has a 25% chance to disarm. Quick upgrade method: ask people in diamond suits to be stakes for you Archery: bow and arrow skill: passive ignition igniter: probability, ignite the creature you shoot: passive arrow retrieval: probability, retrieve the arrow you kill the enemy: passive daze through the heart arrow: probability, The 25% chance of stun target affects the enemy's ignition level. The burning time increases by one second every 200 levels, and the maximum attack power increases by lv50 + 1 lv250 + 2 lv500 + 3 lv750 + 4 lv1000 + 5 for 6 seconds Sword skill: active ability to attack enemies in an entire area at one time: passive Parry grid: probability, defensive attack: passive counter attack: probability, counterattack attack (short range limit): passive bleed / bleed + bleeding: probability, Remove counterattack wiki from opponent's bleeding grid version 1.1.14. Bleeding rate skill level x 0.1%. The highest rate is 75% of lv750. Lose 1 / 2 heart skill level 1000 every two seconds. It lasts for 12 seconds (3 blood in total). New bleeding will cover the old bleeding effect. For example, when it lasts for 6 seconds to 5 seconds, it will cause bleeding again
experience acquisition: mining ore
skill: [double drop] there is a chance of double drop ring mining, and the probability is [(0.1 * level)%]
[rampant miner] in this state, the player's mining speed will be doubled, and there is a triple drop probability, but it will lose two times of rability. The mining effect is only effective for the blocks with given experience< Block experience:
sandstone 30 stone 40 fluorite 30 hell rock 30 coal mine 100 red stone mine 150 Obsidian 150 iron mine 250 gold mine 350 lapis lazuli mine 400 diamond mine 750
2, The probability is [(0.1 * level)%]
[leaves blow away] when the logging level is above 100, when you cut the leaves with an axe, you have a 10% chance to drop seedlings
[tree killer] in the tree killer state, when you cut the log, all the trees and leaves within a certain range of the log will be cut< 3. Pharmaceutics (/ herbalism
experience gained: harvest crops manually
skill: [herbalism] bread and mushroom soup will have therapeutic effect, and the specific effect depends on the level. The amount of bread treatment: [3.5 + (level / 50) * 0.5HP], Treatment dose of mushroom soup: [5 + (grade / 50) * 0.5HP]
[green wheat] when you harvest wheat, you have a chance to sow wheat again after harvest without consuming seeds. The growth stage of sown wheat is determined by the grade, adding one stage every 200 grades
[double drop] when you harvest a crop, you have a chance to double drop. The probability is [(level ÷ 10)%]
[green stone] when you sprinkle seeds on some blocks, you have a chance to become another kind of block, and the probability increases with the level
[collection technique] in the state of planting expert, the horticulturist's effect will be 100% successful, and there is a three times chance of falling when harvesting crops
cube experience:
vine 10 watermelon 20 pumpkin 20 sugarcane 30 cactus 30 wheat 50 hell wart 50 lotus leaf 100 flower 100 mushroom 150
4. Digging (/ excavation
experience acquisition: digging
skill: [treasure hunter] when you dig, you will have a chance to dig other items
[rampage drill] in this state, you will gain 3 times of drop probability and 3 times of experience gain, and the digging speed will increase, but it will consume 2 times of rability<
cube experience:
all mineable cube experiences are the same as 40
treasure hunter's droppable items and minimum mining level: (red is the common drop of cubes)
grass procts:
phosphor 25, cocoa beans 50, eggs 250, CD 250, apple 250, diamond 350, mushroom 500
gravel procts:
flint 0, gunpowder 75, bones 175
hell rock 850
sand Proce procts:
soul sand 650
clay proce procts:
map 25 slime ball 150 spider silk 250 iron bucket 500 clock 500 spider web 750 cake 750
5. Fishing (/ fishing
experience acquisition: catch fish or other items
skill: [treasure hunter] when you fish, how often do you catch other items? The quality of the items is related to the level
[stealing] when you use a fishing rod on some creatures, you will get some extra items<
treasure hunter's dropable items:
leather equipment, stone equipment, iron equipment, gold equipment, diamond equipment, shadow pearl CD, flame rod, red stone, fluorite powder
6. Repair (/ repair
experience gained: use iron to repair tools, rability
skill: [repair master] when you upgrade your level, each material will restore an additional [(0.2 * level)%] rability
[super repair] there is a chance of double rability ring repair, and the probability is [(0.1 * level)%]
[enchant repair] enchant can be retained ring repair. The minimum requirement is level 100. Data 2 http://m.gamer.com.tw/forum/C.php?bsn=18673&snA=3076 / Mining: mining skills: active super breaker super Mining: can instantly dig out most of the bricks (Rock Series): passive double drops double harvest: Organic rate to dig one to get two (can be used to recycle non recyclable super mining, rability consumption will be doubled after starting, but the item will fall three times (start) Time increases with level (cooling time: 4 minutes) PS after startup, you can destroy any mineral with different levels of cross script. For example, you can destroy Obsidian with wooden pick, but you won't drop obsidian. However, super mining with diamond pick will drop three times as much obsidian. Some of the experience table also has the highest number of obsidian (150xp) and diamond (70exp) Recommended upgrade method: 1. Dig coal mine or red stone because the quantity is very far, faster than looking for rare diamonds (use the quantity to make up for the lack of exp) and match with repair skills ~ 2. If you have knocked down the terminal dragon, you are welcome to move the terminal home! Skill level of double drop rate formula * 01% example: lv1000 = 100% -- woodcutting: experience value: Oak 80, pine 90 Birch 70: active tree Feller super logging: can instantly dig out the 3x3x3 square with wood as the center (Flora): passive leafblower leaf killer: probability to kill large leaves in seconds: passive double drop double harvest: Organic rate to dig one will get two (can be used to collect non recyclable items back and forth) super logging range lv0-499: 3x3x3x3lv500-949: 4x4x4lv950 +: 5X5 X5 double harvest formula skill level * 01% example: lv1000 = 100% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / herbalism: farming skill: active green Terra green finger: after starting, Three times what has been harvested: passive healing seeder: if you plant seeds on pebbles, you have a chance to turn them into mosses. Green Terra will automatically plant seeds after harvesting (but it's useless because it will be knocked out automatically when harvesting). Green tumb is green finger. Healing function has been cancelled (cancelled after adding satiety in a certain version of MC). In addition, pumpkin experience has not been improved Unlike Wiki's 500exp: shovel skill: active Giga drill breaker: sand damage: after starting, What destroys the nature of sandy soil (sandy soil system): passive treasure hunt: when you are digging, you will find something good. First of all, you should mention the Giga drill breaker! Source (there is a super plot in Tianyuan breakthrough episode 8, ray wants not to watch the plot by himself). Since Tianyuan and Carmina are mentioned in this beautiful morning, we need to review God mad to warm up our blood (it has nothing to do with MC ~ you don't need to watch it). Giga drill breaker will lose twice as long after starting, but the falling object will triple. The starting time increases with the level skill, and the cooling time is 4 minutes The chart of hunt treasure hunter skill wiki is too messy, so I reclassified the treasure hunt skill experience value by myself. If I dig extra, I will also give (ex: dig grass to remove soil and add egg experience value is 40 + 100) level drop probability experience value of grass 0 soil 100% 40 25 fluorescein st 5% 80 50 cocoa beans 1.33% 80 250 eggs 1% 100 250 apples 0.1% 100 500 one of two kinds of mushrooms Ground like gravel 0 flint 10% 400 gravel 90% 40 75 powder 10% 30 175 bone 10% 30 850 hellstone 0.5% 3000 sand 0 sand 100% 40 50 fluorite st 5% 80 650 soul sand 0.5% 80 clay 0 clay X4 100% 40 25 map 2% 200 150 Slime ball 5% 100 250 thread 5% 200 500 iron barrel 0.1% 100 500 clock 0.1% 100 750 spider silk 5% 150 dig anything organic rate Item gold record lv250 0.05% 3000exp green record lv250 0.05% 3000exp diamond lv350 0.13% 1000exp cake lv750 0.05% 3000expps it takes 721 minutes to dig continuously with a shovel to reach lv1000. The author says that after lv350, the built-in diamond will drop about 1000 soil to spray, which will make everyone feel at ease Unarmed skill: active berserk destroyer: timeliness, can explode diamonds (sand system), and you want to flatten: creature: passive disarm: probability, can hit other players to strip (?) Berserk: Increases attack power by 50%, increases passive attack power by LV 250, increases attack power by one heart by LV 500, increases three heart disarming formula by 0.25% X lvex: lv1000 has a 25% chance to disarm. Quick upgrade method: ask people in diamond suits to be stakes for you Archery: bow and arrow skill: passive ignition igniter: probability, ignite the creature you shoot: passive arrow retrieval: probability, retrieve the arrow you kill the enemy: passive daze through the heart arrow: probability, The 25% chance of stun target affects the enemy's ignition level. The burning time increases by one second every 200 levels, and the maximum attack power increases by lv50 + 1 lv250 + 2 lv500 + 3 lv750 + 4 lv1000 + 5 for 6 seconds Sword skill: active ability to attack enemies in an entire area at one time: passive Parry grid: probability, defensive attack: passive counter attack: probability, counterattack attack (short range limit): passive bleed / bleed + bleeding: probability, Remove counterattack wiki from opponent's bleeding grid version 1.1.14. Bleeding rate skill level x 0.1%. The highest rate is 75% of lv750. Lose 1 / 2 heart skill level 1000 every two seconds. It lasts for 12 seconds (3 blood in total). New bleeding will cover the old bleeding effect. For example, when it lasts for 6 seconds to 5 seconds, it will cause bleeding again
Hot content