PHP webpage game learning-Explanation of Xnova (ogame) source code (9) _ php instance

Source: Internet
Author: User
This article mainly introduces the functions of the fleet for interpreting the source code of PHP Web Game Xnova (ogame). If you need them, refer to the following 12-> fleet functions (unlocalised. php)

In this section, we will explain the functions related to the dispatch of the fleet and continue to describe them in the form of annotations. As this involves many functions, it takes a lot of time to sort and digest them.

/// Functions //// list of functions required for fleet dispatch // functions // calculates the distance between two planets. function GetTargetDistance ($ OrigGalaxy, $ DestGalaxy, $ OrigSystem, $ DestSystem, $ OrigPlanet, $ DestPlanet) // the time required for the computing fleet to reach the specified distance. Here, the server's speed setting function GetMissionDuration ($ GameSpeed, $ MaxFleetSpeed, $ Distance, $ SpeedFactor) // get the Fleet speed function GetGameSpeedFactor () after game settings // calculate the maximum speed function GetFleetMaxSpeed of the Fleet ($ FleetArray, $ Fleet, $ Player) // calculate the HH consumption of a single Ship type. function GetShipConsumption ($ Ship, $ Player) // calculate the HH consumption of the fleet. Here is the actual HH consumption, passed in many parameters: function GetFleetConsumption ($ FleetArray, $ SpeedFactor, $ MissionDuration, $ MissionDistance, $ FleetMaxSpeed, $ Player) // functions //// The following is the list of functions displayed in string formatting // functions // formatting time, for example: xxd xxh xxmfunction pretty_time ($ seconds) // format the minute, for example, xxminfunction pretty_time_hour ($ seconds) // the construction time format. The previous section describes function ShowBuildTime ($ time) // isolated function, the function add_points ($ resources, $ userid) is not called. // The function remove_points ($ resources, $ userid) is not called. // The function is isolated, function get_userdata () not called () /// functions //// The following is the template file's read/write/use the function list /// functions // read the file content according to the file name function ReadFromFile ($ filename) // isolated function, not called function SaveToFile ($ filename, $ content) // As described earlier, replace function parsetemplate ($ template, $ array) with the value of $ array) // It is also introduced that the function gettemplate ($ templatename) // include the function Extension delang ($ filename, $ ext = '. mo') // functions /// the following lists the functions of the fleet link class. // functions // creates a map hyperlink function GetStartAdressLink ($ FleetRow, $ FleetType) // create a map hyperlink function GetTargetAdressLink ($ FleetRow, $ FleetType) for a fleet target planet // construct a map hyperlink function BuildPlanetAdressLink ($ CurrentPlanet) for a specified planet) // construct a message sent to the attacker to the hyperlink function BuildHostileFleetPlayerLink ($ FleetRow) // obtain the next month's enabling time function GetNextJumpWaitTime ($ CurMoon) // construct an attack fleet details list function CreateFleetPopupedFleetLink ($ FleetRow, $ Texte, $ FleetType) // construct a detailed list of returned fleets, including the 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.