PHP Web Game Learning Xnova (ogame) Source code Interpretation (ix) _php example

Source: Internet
Author: User

12. Fleet-related functions (unlocalised.php)

This section will explain the functions associated with the fleet dispatch and continue to be annotated; As the functions involved are more numerous, it will take a lot of time to digest.

-------------------------------------------------------------------///Below is a list of functions to be used by the fleet dispatch/////------------------ -------------------------------------------------//Compute the distance between two planets function Gettargetdistance ($OrigGalaxy, $ Destgalaxy, $OrigSystem, $DestSystem, $OrigPlanet, $DestPlanet)//Calculate the time required for the fleet to reach the specified distance, consider the server's speed setting function
Getmissionduration ($GameSpeed, $MaxFleetSpeed, $Distance, $SpeedFactor)//Get the game set after the fleet Speed function Getgamespeedfactor () Calculate the maximum speed of the fleet function Getfleetmaxspeed ($FleetArray, $Fleet, $Player)//compute the HH consumption function getshipconsumption of a single ship species ($Ship,
$Player)//Compute the fleet's HH consumption, here is the actual HH consumption, passed a lot of parameter function getfleetconsumption ($FleetArray, $SpeedFactor, $MissionDuration, $MissionDistance, $FleetMaxSpeed, $Player)//-------------------------------------------------------------------/
///Below is a list of formatted display functions for strings////-------------------------------------------------------------------//Formatting time, in the form of: Xxd xxh XXM function Pretty_time ($seconds)//format minutes, in the form of: Xxmin function Pretty_time_hOur ($seconds)//build time format, preceded by a description of function showbuildtime ($time)//orphaned functions, not called function add_points ($resources, $userid)//Isolate function, not called function remove_points ($resources, $userid)//orphaned functions, no called function get_userdata ()//------------------------- ------------------------------------------////The following is a list of read/write/Use functions for template files////------------------------------------------ -------------------------//Read file content by filename function readfromfile ($filename)//orphaned function, not called function SaveToFile ($filename, $content)//Earlier, replace the function parsetemplate ($template, $array) with $array value and/or, that is, to obtain the content function GetTemplate of the specified template file ($ templatename)//Include different language file function Includelang ($filename, $ext = '. Mo ')//--------------------------------------- ----------------------------////Below is a list of Fleet link class functions////--------------------------------------------------------------- ----//construction of a fleet-starting Planet Star map hyperlink function Getstartadresslink ($FleetRow, $FleetType)//construction of a fleet Destination Planet map Hyperlink function Gettargetadres Slink ($FleetRow, $FleetType)//construct a star of a designated planetFigure Hyperlink Function Buildplanetadresslink ($CurrentPlanet)//construct a send message to the attacker to the hyperlink function Buildhostilefleetplayerlink ($Fleet ROW)//Get the next month gate Opening time function Getnextjumpwaittime ($CurMoon)//Construct an Attack Fleet detail list function Createfleetpopupedfleetlink ($Fle Etrow, $Texte, $FleetType)//construct a detailed list of returned fleets, including resource function Createfleetpopupedmissionlink ($FleetRow, $Texte, $  Fleettype)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.