十二、舰队相关函数(unlocalised.php)
本节将把舰队派遣相关的函数做个说明,继续以注释方式说明;由于这次涉及的函数比较多,需要花不少时间来整理消化。
// -------------------------------------------------------------------//// 以下是舰队派遣需要用到的函数列表//// -------------------------------------------------------------------// 计算两个星球之间的距离function gettargetdistance ($origgalaxy, $destgalaxy, $origsystem, $destsystem,$origplanet, $destplanet)// 计算舰队到达指定距离需要的时间,这里会考虑服务器的倍速设置function getmissionduration ($gamespeed, $maxfleetspeed, $distance, $speedfactor)// 取得游戏设置后的舰队速度function getgamespeedfactor ()// 计算舰队的最大速度function getfleetmaxspeed ($fleetarray, $fleet, $player)// 计算单个舰种的hh消耗function getshipconsumption ( $ship, $player )// 计算舰队的hh消耗,这里就是实际的hh消耗量,传入了很多参数function getfleetconsumption ($fleetarray, $speedfactor, $missionduration,$missiondistance, $fleetmaxspeed, $player)// -------------------------------------------------------------------//// 以下是字符串的格式化显示函数列表//// -------------------------------------------------------------------// 格式化时间,形如:xxd xxh xxmfunction pretty_time ($seconds)// 格式化分钟,形如:xxminfunction pretty_time_hour ($seconds)// 建造时间格式,前面会有说明function showbuildtime ($time)//孤立函数,没有被调用function add_points ($resources, $userid)//孤立函数,没有被调用function remove_points ($resources, $userid)//孤立函数,没有被调用function get_userdata ()// -------------------------------------------------------------------//// 以下是模板文件的读/写/使用函数列表//// -------------------------------------------------------------------// 根据文件名读取文件内容function readfromfile($filename)//孤立函数,没有被调用function savetofile ($filename, $content)//前面介绍过,用$array的值进行替换function parsetemplate ($template, $array)//也介绍过,就是取得指定模板文件的内容function gettemplate ($templatename)// include不同语言文件function includelang ($filename, $ext = '.mo')// -------------------------------------------------------------------//// 以下是舰队链接类函数列表//// -------------------------------------------------------------------// 构造一个舰队起始星球的星图超链接function getstartadresslink ( $fleetrow, $fleettype )// 构造一个舰队目的星球的星图超链接function gettargetadresslink ( $fleetrow, $fleettype )// 构造一个指定星球的星图超链接function buildplanetadresslink ( $currentplanet )// 构造一个给攻击者的发送消息到超链接function buildhostilefleetplayerlink ( $fleetrow )// 取得下次月门的开启时间function getnextjumpwaittime ( $curmoon )// 构造一个攻击舰队明细列表function createfleetpopupedfleetlink ( $fleetrow, $texte, $fleettype )//构造一个返回舰队的明细列表,包括有无资源function createfleetpopupedmissionlink ( $fleetrow, $texte, $fleettype )
http://www.bkjia.com/phpjc/824837.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/824837.htmltecharticle十二、舰队相关函数(unlocalised.php) 本节将把舰队派遣相关的函数做个说明,继续以注释方式说明;由于这次涉及的函数比较多,需要花不...