Ticket #4056: Profiler-scripts.patch

File Profiler-scripts.patch, 40.2 KB (added by wraitii, 8 years ago)

Apply patch to profile script components

  • binaries/data/mods/public/simulation/components/AIInterface.js

     
    11function AIInterface() {}
    22
     3AIInterface.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("AIInterface")
     6}
     7AIInterface.prototype.StopPP = function()
     8{
     9}
     10
    311AIInterface.prototype.Schema =
    412    "<a:component type='system'/><empty/>";
    513
  • binaries/data/mods/public/simulation/components/AIProxy.js

     
    11function AIProxy() {}
    22
     3AIProxy.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("AIProxy")
     6}
     7AIProxy.prototype.StopPP = function()
     8{
     9}
     10
    311AIProxy.prototype.Schema =
    412    "<empty/>";
    513
  • binaries/data/mods/public/simulation/components/AlertRaiser.js

     
    11function AlertRaiser() {}
    22
     3AlertRaiser.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("AlertRaiser")
     6}
     7AlertRaiser.prototype.StopPP = function()
     8{
     9}
     10
    311AlertRaiser.prototype.Schema = 
    412    "<element name='MaximumLevel'><data type='nonNegativeInteger'/></element>" +
    513    "<element name='Range'><data type='nonNegativeInteger'/></element>";
  • binaries/data/mods/public/simulation/components/Armour.js

     
    11function Armour() {}
    22
     3Armour.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Armour")
     6}
     7Armour.prototype.StopPP = function()
     8{
     9}
     10
    311Armour.prototype.Schema =
    412    "<a:help>Controls the damage resistance of the unit.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/Attack.js

     
    11function Attack() {}
    22
     3Attack.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Attack")
     6}
     7Attack.prototype.StopPP = function()
     8{
     9}
     10
    311Attack.prototype.bonusesSchema =
    412    "<optional>" +
    513        "<element name='Bonuses'>" +
  • binaries/data/mods/public/simulation/components/AttackDetection.js

     
    11function AttackDetection() {}
    22
     3AttackDetection.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("AttackDetection")
     6}
     7AttackDetection.prototype.StopPP = function()
     8{
     9}
     10
    311AttackDetection.prototype.Schema =
    412    "<a:help>Detects incoming attacks.</a:help>" +
    513    "<a:example/>" +
  • binaries/data/mods/public/simulation/components/AuraManager.js

     
    11function AuraManager() {}
    22
     3AuraManager.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("AuraManager")
     6}
     7AuraManager.prototype.StopPP = function()
     8{
     9}
     10
    311AuraManager.prototype.Schema =
    412    "<a:component type='system'/><empty/>";
    513
  • binaries/data/mods/public/simulation/components/Auras.js

     
    11function Auras() {}
    22
     3Auras.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Auras")
     6}
     7Auras.prototype.StopPP = function()
     8{
     9}
     10
    311Auras.prototype.Schema =
    412            "<attribute name='datatype'>" +
    513                "<value>tokens</value>" +
  • binaries/data/mods/public/simulation/components/Barter.js

     
    2626
    2727function Barter() {}
    2828
     29Barter.prototype.StartPP = function()
     30{
     31    Engine.ProfileArgument("Barter")
     32}
     33Barter.prototype.StopPP = function()
     34{
     35}
     36
    2937Barter.prototype.Schema =
    3038    "<a:component type='system'/><empty/>";
    3139
  • binaries/data/mods/public/simulation/components/BattleDetection.js

     
    11function BattleDetection() {}
    22
     3BattleDetection.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("BattleDetection")
     6}
     7BattleDetection.prototype.StopPP = function()
     8{
     9}
     10
    311BattleDetection.prototype.Schema =
    412    "<a:help>Detects the occurence of battles.</a:help>" +
    513    "<a:example/>" +
  • binaries/data/mods/public/simulation/components/Builder.js

     
    11function Builder() {}
    22
     3Builder.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Builder")
     6}
     7Builder.prototype.StopPP = function()
     8{
     9}
     10
    311Builder.prototype.Schema =
    412    "<a:help>Allows the unit to construct and repair buildings.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/BuildingAI.js

     
    44
    55function BuildingAI() {}
    66
     7BuildingAI.prototype.StartPP = function()
     8{
     9    Engine.ProfileArgument("BuildingAI")
     10}
     11BuildingAI.prototype.StopPP = function()
     12{
     13}
     14
    715BuildingAI.prototype.Schema =
    816    "<element name='DefaultArrowCount'>" +
    917        "<data type='nonNegativeInteger'/>" +
  • binaries/data/mods/public/simulation/components/BuildRestrictions.js

     
    11function BuildRestrictions() {}
    22
     3BuildRestrictions.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("BuildRestrictions")
     6}
     7BuildRestrictions.prototype.StopPP = function()
     8{
     9}
     10
    311BuildRestrictions.prototype.Schema =
    412    "<a:help>Specifies building placement restrictions as they relate to terrain, territories, and distance.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/Capturable.js

     
    11function Capturable() {}
    22
     3Capturable.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Capturable")
     6}
     7Capturable.prototype.StopPP = function()
     8{
     9}
     10
    311Capturable.prototype.Schema =
    412    "<element name='CapturePoints' a:help='Maximum capture points'>" +
    513        "<ref name='positiveDecimal'/>" +
  • binaries/data/mods/public/simulation/components/CeasefireManager.js

     
    11function CeasefireManager() {}
    22
     3CeasefireManager.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("CeasefireManager")
     6}
     7CeasefireManager.prototype.StopPP = function()
     8{
     9}
     10
    311CeasefireManager.prototype.Schema = "<a:component type='system'/><empty/>";
    412
    513CeasefireManager.prototype.Init = function()
  • binaries/data/mods/public/simulation/components/Cost.js

     
    11function Cost() {}
    22
     3Cost.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Cost")
     6}
     7Cost.prototype.StopPP = function()
     8{
     9}
     10
    311Cost.prototype.Schema =
    412    "<a:help>Specifies the construction/training costs of this entity.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/DataTemplateManager.js

     
    33 */
    44function DataTemplateManager() {}
    55
     6DataTemplateManager.prototype.StartPP = function()
     7{
     8    Engine.ProfileArgument("DataTemplateManager")
     9}
     10DataTemplateManager.prototype.StopPP = function()
     11{
     12}
     13
    614DataTemplateManager.prototype.Schema =
    715    "<a:component type='system'/><empty/>";
    816
  • binaries/data/mods/public/simulation/components/EndGameManager.js

     
    77 */
    88function EndGameManager() {}
    99
     10EndGameManager.prototype.StartPP = function()
     11{
     12    Engine.ProfileArgument("EndGameManager")
     13}
     14EndGameManager.prototype.StopPP = function()
     15{
     16}
     17
    1018EndGameManager.prototype.Schema =
    1119    "<a:component type='system'/><empty/>";
    1220   
  • binaries/data/mods/public/simulation/components/EntityLimits.js

     
    11function EntityLimits() {}
    22
     3EntityLimits.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("EntityLimits")
     6}
     7EntityLimits.prototype.StopPP = function()
     8{
     9}
     10
    311EntityLimits.prototype.Schema =
    412    "<a:help>Specifies per category limits on number of entities (buildings or units) that can be created for each player</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/Fogging.js

     
    44
    55function Fogging() {}
    66
     7Fogging.prototype.StartPP = function()
     8{
     9    Engine.ProfileArgument("Fogging")
     10}
     11Fogging.prototype.StopPP = function()
     12{
     13}
     14
    715Fogging.prototype.Schema =
    816    "<a:help>Allows this entity to be replaced by mirage entities in the fog-of-war.</a:help>" +
    917    "<empty/>";
  • binaries/data/mods/public/simulation/components/Formation.js

     
    11function Formation() {}
    22
     3Formation.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Formation")
     6}
     7Formation.prototype.StopPP = function()
     8{
     9}
     10
    311Formation.prototype.Schema =
    412    "<element name='FormationName' a:help='Name of the formation'>" +
    513        "<text/>" +
  • binaries/data/mods/public/simulation/components/FormationAttack.js

     
    11function FormationAttack() {}
    22
     3FormationAttack.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("FormationAttack")
     6}
     7FormationAttack.prototype.StopPP = function()
     8{
     9}
     10
    311FormationAttack.prototype.Schema =
    412    "<element name='CanAttackAsFormation'>" +
    513        "<text/>" +
  • binaries/data/mods/public/simulation/components/Foundation.js

     
    11function Foundation() {}
    22
     3Foundation.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Foundation")
     6}
     7Foundation.prototype.StopPP = function()
     8{
     9}
     10
    311Foundation.prototype.Schema =
    412    "<a:component type='internal'/><empty/>";
    513
  • binaries/data/mods/public/simulation/components/GarrisonHolder.js

     
    11function GarrisonHolder() {}
    22
     3GarrisonHolder.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("GarrisonHolder")
     6}
     7GarrisonHolder.prototype.StopPP = function()
     8{
     9}
     10
    311GarrisonHolder.prototype.Schema =
    412    "<element name='Max' a:help='Maximum number of entities which can be garrisoned inside this holder'>" +
    513        "<data type='positiveInteger'/>" +
  • binaries/data/mods/public/simulation/components/Gate.js

     
    11function Gate() {}
    22
     3Gate.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Gate")
     6}
     7Gate.prototype.StopPP = function()
     8{
     9}
     10
    311Gate.prototype.Schema =
    412    "<a:help>Controls behavior of wall gates</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/Guard.js

     
    11function Guard() {}
    22
     3Guard.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Guard")
     6}
     7Guard.prototype.StopPP = function()
     8{
     9}
     10
    311Guard.prototype.Schema =
    412    "<empty/>";
    513
  • binaries/data/mods/public/simulation/components/GuiInterface.js

     
    11function GuiInterface() {}
    22
     3GuiInterface.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("GuiInterface")
     6}
     7GuiInterface.prototype.StopPP = function()
     8{
     9}
     10
    311GuiInterface.prototype.Schema =
    412    "<a:component type='system'/><empty/>";
    513
  • binaries/data/mods/public/simulation/components/Heal.js

     
    11function Heal() {}
    22
     3Heal.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Heal")
     6}
     7Heal.prototype.StopPP = function()
     8{
     9}
     10
    311Heal.prototype.Schema =
    412    "<a:help>Controls the healing abilities of the unit.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/Health.js

     
    11function Health() {}
    22
     3Health.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Health")
     6}
     7Health.prototype.StopPP = function()
     8{
     9}
     10
    311Health.prototype.Schema =
    412    "<a:help>Deals with hitpoints and death.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/Identity.js

     
    11function Identity() {}
    22
     3Identity.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Identity")
     6}
     7Identity.prototype.StopPP = function()
     8{
     9}
     10
    311Identity.prototype.Schema =
    412    "<a:help>Specifies various names and values associated with the unit type, typically for GUI display to users.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/Loot.js

     
    11function Loot() {}
    22
     3Loot.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Loot")
     6}
     7Loot.prototype.StopPP = function()
     8{
     9}
     10
    311Loot.prototype.Schema =
    412    "<optional>" +
    513        "<element name='xp'><data type='nonNegativeInteger'/></element>" +
  • binaries/data/mods/public/simulation/components/Looter.js

     
    11function Looter() {}
    22
     3Looter.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Looter")
     6}
     7Looter.prototype.StopPP = function()
     8{
     9}
     10
    311Looter.prototype.Schema =
    412    "<empty/>";
    513
  • binaries/data/mods/public/simulation/components/Market.js

     
    11function Market() {}
    22
     3Market.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Market")
     6}
     7Market.prototype.StopPP = function()
     8{
     9}
     10
    311Market.prototype.Schema =
    412    "<element name='TradeType' a:help='Specifies the type of possible trade route (land or naval).'>" +
    513        "<list>" +
  • binaries/data/mods/public/simulation/components/Mirage.js

     
    44
    55function Mirage() {}
    66
     7Mirage.prototype.StartPP = function()
     8{
     9    Engine.ProfileArgument("Mirage")
     10}
     11Mirage.prototype.StopPP = function()
     12{
     13}
     14
    715Mirage.prototype.Schema =
    816    "<a:help>Mirage entities replace real entities in the fog-of-war.</a:help>" +
    917    "<empty/>";
  • binaries/data/mods/public/simulation/components/MotionBall.js

     
    11function MotionBallScripted() {}
    22
     3MotionBallScripted.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("MotionBallScripted")
     6}
     7MotionBallScripted.prototype.StopPP = function()
     8{
     9}
     10
    311MotionBallScripted.prototype.Schema =
    412    "<a:component type='test'/><empty/>";
    513
  • binaries/data/mods/public/simulation/components/Pack.js

     
    11function Pack() {}
    22
     3Pack.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Pack")
     6}
     7Pack.prototype.StopPP = function()
     8{
     9}
     10
    311const PACKING_INTERVAL = 250;
    412
    513Pack.prototype.Schema =
  • binaries/data/mods/public/simulation/components/Player.js

     
    11function Player() {}
    22
     3Player.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Player")
     6}
     7Player.prototype.StopPP = function()
     8{
     9}
     10
    311Player.prototype.Schema =
    412    "<element name='SharedLosTech' a:help='Allies will share los when this technology is researched. Leave empty to never share LOS.'>" +
    513        "<text/>" +
  • binaries/data/mods/public/simulation/components/PlayerManager.js

     
    11function PlayerManager() {}
    22
     3PlayerManager.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("PlayerManager")
     6}
     7PlayerManager.prototype.StopPP = function()
     8{
     9}
     10
    311PlayerManager.prototype.Schema =
    412    "<a:component type='system'/><empty/>";
    513
  • binaries/data/mods/public/simulation/components/ProductionQueue.js

     
    33
    44function ProductionQueue() {}
    55
     6ProductionQueue.prototype.StartPP = function()
     7{
     8    Engine.ProfileArgument("ProductionQueue")
     9}
     10ProductionQueue.prototype.StopPP = function()
     11{
     12}
     13
    614ProductionQueue.prototype.Schema =
    715    "<a:help>Allows the building to train new units and research technologies</a:help>" +
    816    "<a:example>" +
  • binaries/data/mods/public/simulation/components/Promotion.js

     
    11function Promotion() {}
    22
     3Promotion.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Promotion")
     6}
     7Promotion.prototype.StopPP = function()
     8{
     9}
     10
    311Promotion.prototype.Schema =
    412    "<element name='Entity'>" +
    513        "<text/>" +
  • binaries/data/mods/public/simulation/components/RallyPoint.js

     
    11function RallyPoint() {}
    22
     3RallyPoint.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("RallyPoint")
     6}
     7RallyPoint.prototype.StopPP = function()
     8{
     9}
     10
    311RallyPoint.prototype.Schema =
    412    "<a:component/><empty/>";
    513
  • binaries/data/mods/public/simulation/components/Repairable.js

     
    11function Repairable() {}
    22
     3Repairable.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Repairable")
     6}
     7Repairable.prototype.StopPP = function()
     8{
     9}
     10
    311Repairable.prototype.Schema =
    412    "<a:help>Deals with repairable structures and units.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/ResourceDropsite.js

     
    11function ResourceDropsite() {}
    22
     3ResourceDropsite.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("ResourceDropsite")
     6}
     7ResourceDropsite.prototype.StopPP = function()
     8{
     9}
     10
    311ResourceDropsite.prototype.Schema =
    412    "<element name='Types'>" +
    513        "<list>" +
  • binaries/data/mods/public/simulation/components/ResourceGatherer.js

     
    11function ResourceGatherer() {}
    22
     3ResourceGatherer.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("ResourceGatherer")
     6}
     7ResourceGatherer.prototype.StopPP = function()
     8{
     9}
     10
    311ResourceGatherer.prototype.Schema =
    412    "<a:help>Lets the unit gather resources from entities that have the ResourceSupply component.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/ResourceSupply.js

     
    11function ResourceSupply() {}
    22
     3ResourceSupply.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("ResourceSupply")
     6}
     7ResourceSupply.prototype.StopPP = function()
     8{
     9}
     10
    311ResourceSupply.prototype.Schema =
    412    "<a:help>Provides a supply of one particular type of resource.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/ResourceTrickle.js

     
    11function ResourceTrickle() {}
    22
     3ResourceTrickle.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("ResourceTrickle")
     6}
     7ResourceTrickle.prototype.StopPP = function()
     8{
     9}
     10
    311ResourceTrickle.prototype.Schema =
    412    "<a:help>Controls the resource trickle ability of the unit.</a:help>" +
    513    "<element name='Rates' a:help='Trickle Rates'>" +
  • binaries/data/mods/public/simulation/components/Settlement.js

     
    11function Settlement() {}
    22
     3Settlement.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Settlement")
     6}
     7Settlement.prototype.StopPP = function()
     8{
     9}
     10
    311Settlement.prototype.Schema =
    412    "<empty/>";
    513
  • binaries/data/mods/public/simulation/components/SkirmishReplacer.js

     
    11function SkirmishReplacer() {}
    22
     3SkirmishReplacer.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("SkirmishReplacer")
     6}
     7SkirmishReplacer.prototype.StopPP = function()
     8{
     9}
     10
    311SkirmishReplacer.prototype.Schema =
    412        "<optional>" +
    513            "<element name='general' a:help='The general element replaces {civ} with the civ code.'>" +
  • binaries/data/mods/public/simulation/components/Sound.js

     
    11function Sound() {}
    22
     3Sound.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Sound")
     6}
     7Sound.prototype.StopPP = function()
     8{
     9}
     10
    311Sound.prototype.Schema =
    412    "<a:help>Lists the sound groups associated with this unit.</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/StatisticsTracker.js

     
    11function StatisticsTracker() {}
    22
     3StatisticsTracker.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("StatisticsTracker")
     6}
     7StatisticsTracker.prototype.StopPP = function()
     8{
     9}
     10
    311StatisticsTracker.prototype.Schema =
    412    "<a:component type='system'/><empty/>";
    513
  • binaries/data/mods/public/simulation/components/StatusBars.js

     
    22
    33function StatusBars() {}
    44
     5StatusBars.prototype.StartPP = function()
     6{
     7    Engine.ProfileArgument("StatusBars")
     8}
     9StatusBars.prototype.StopPP = function()
     10{
     11}
     12
    513StatusBars.prototype.Schema =
    614    "<element name='BarWidth'>" +
    715        "<data type='decimal'/>" +
  • binaries/data/mods/public/simulation/components/TechnologyManager.js

     
    11function TechnologyManager() {}
    22
     3TechnologyManager.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("TechnologyManager")
     6}
     7TechnologyManager.prototype.StopPP = function()
     8{
     9}
     10
    311TechnologyManager.prototype.Schema =
    412    "<a:component type='system'/><empty/>";
    513
  • binaries/data/mods/public/simulation/components/TerritoryDecay.js

     
    11function TerritoryDecay() {}
    22
     3TerritoryDecay.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("TerritoryDecay")
     6}
     7TerritoryDecay.prototype.StopPP = function()
     8{
     9}
     10
    311TerritoryDecay.prototype.Schema =
    412    "<element name='DecayRate' a:help='Decay rate in capture points per second'>" +
    513        "<choice><ref name='positiveDecimal'/><value>Infinity</value></choice>" +
  • binaries/data/mods/public/simulation/components/Timer.js

     
    11function Timer() {}
    22
     3Timer.prototype.StartPP = function()
     4{
     5}
     6Timer.prototype.StopPP = function()
     7{
     8}
     9
    310Timer.prototype.Schema =
    411    "<a:component type='system'/><empty/>";
    512
  • binaries/data/mods/public/simulation/components/Trader.js

     
    99
    1010function Trader() {}
    1111
     12Trader.prototype.StartPP = function()
     13{
     14    Engine.ProfileArgument("Trader")
     15}
     16Trader.prototype.StopPP = function()
     17{
     18}
     19
    1220Trader.prototype.Schema =
    1321    "<a:help>Lets the unit generate resouces while moving between markets (or docks in case of water trading).</a:help>" +
    1422    "<a:example>" +
  • binaries/data/mods/public/simulation/components/TrainingRestrictions.js

     
    11function TrainingRestrictions() {}
    22
     3TrainingRestrictions.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("TrainingRestrictions")
     6}
     7TrainingRestrictions.prototype.StopPP = function()
     8{
     9}
     10
    311TrainingRestrictions.prototype.Schema =
    412    "<a:help>Specifies unit training restrictions, currently only unit category</a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/Trigger.js

     
    11function Trigger() {}
    22
     3Trigger.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Trigger")
     6}
     7Trigger.prototype.StopPP = function()
     8{
     9}
     10
    311Trigger.prototype.Schema =
    412    "<a:component type='system'/><empty/>";
    513
  • binaries/data/mods/public/simulation/components/TriggerPoint.js

     
    11function TriggerPoint() {}
    22
     3TriggerPoint.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("TriggerPoint")
     6}
     7TriggerPoint.prototype.StopPP = function()
     8{
     9}
     10
    311TriggerPoint.prototype.Schema =
    412    "<optional>" +
    513        "<element name='Reference'>" +
  • binaries/data/mods/public/simulation/components/UnitAI.js

     
    11function UnitAI() {}
    22
     3UnitAI.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("UnitAI")
     6}
     7UnitAI.prototype.StopPP = function()
     8{
     9}
     10
    311UnitAI.prototype.Schema =
    412    "<a:help>Controls the unit's movement, attacks, etc, in response to commands from the player.</a:help>" +
    513    "<a:example/>" +
  • binaries/data/mods/public/simulation/components/UnitMotionFlying.js

     
    33const SHORT_FINAL = 2.5;
    44function UnitMotionFlying() {}
    55
     6UnitMotionFlying.prototype.StartPP = function()
     7{
     8    Engine.ProfileArgument("UnitMotionFlying")
     9}
     10UnitMotionFlying.prototype.StopPP = function()
     11{
     12}
     13
    614UnitMotionFlying.prototype.Schema =
    715    "<element name='MaxSpeed'>" +
    816        "<ref name='nonNegativeDecimal'/>" +
  • binaries/data/mods/public/simulation/components/ValueModificationManager.js

     
    11function ValueModificationManager() {}
    22
     3ValueModificationManager.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("ValueModificationManager")
     6}
     7ValueModificationManager.prototype.StopPP = function()
     8{
     9}
     10
    311/*
    412 * A component to give the C++ defined components access to all value modifying components
    513 * via the helper script.
  • binaries/data/mods/public/simulation/components/Visibility.js

     
    44
    55function Visibility() {}
    66
     7Visibility.prototype.StartPP = function()
     8{
     9    Engine.ProfileArgument("Visibility")
     10}
     11Visibility.prototype.StopPP = function()
     12{
     13}
     14
    715Visibility.prototype.Schema =
    816    "<element name='RetainInFog'>" +
    917        "<data type='boolean'/>" +
  • binaries/data/mods/public/simulation/components/WallPiece.js

     
    11function WallPiece() {}
    22
     3WallPiece.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("WallPiece")
     6}
     7WallPiece.prototype.StopPP = function()
     8{
     9}
     10
    311WallPiece.prototype.Schema =
    412    "<a:help></a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/WallSet.js

     
    11function WallSet() {}
    22
     3WallSet.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("WallSet")
     6}
     7WallSet.prototype.StopPP = function()
     8{
     9}
     10
    311WallSet.prototype.Schema =
    412    "<a:help></a:help>" +
    513    "<a:example>" +
  • binaries/data/mods/public/simulation/components/Wonder.js

     
    11function Wonder() {}
    22
     3Wonder.prototype.StartPP = function()
     4{
     5    Engine.ProfileArgument("Wonder")
     6}
     7Wonder.prototype.StopPP = function()
     8{
     9}
     10
    311Wonder.prototype.Schema =
    412    "<element name='DurationMultiplier' a:help='A civ-specific time-bonus/handicap for the wonder-victory-condition.'>" +
    513        "<ref name='nonNegativeDecimal'/>" +
  • source/simulation2/scripting/ScriptComponent.cpp

     
    1919
    2020#include "ScriptComponent.h"
    2121
     22#include "ps/Profile.h"
    2223#include "simulation2/serialization/ISerializer.h"
    2324#include "simulation2/serialization/IDeserializer.h"
    2425
     
    5556
    5657void CComponentTypeScript::HandleMessage(const CMessage& msg, bool global)
    5758{
     59    PROFILE2_IFSPIKE("Script", 0.0002);
    5860    JSContext* cx = m_ScriptInterface.GetContext();
    5961    JSAutoRequest rq(cx);
    6062   
     
    6264
    6365    JS::RootedValue msgVal(cx, msg.ToJSValCached(m_ScriptInterface));
    6466
     67    m_ScriptInterface.CallFunctionVoid(m_Instance, "StartPP");
    6568    if (!m_ScriptInterface.CallFunctionVoid(m_Instance, name, msgVal))
    6669        LOGERROR("Script message handler %s failed", name);
     70    m_ScriptInterface.CallFunctionVoid(m_Instance, "StopPP");
    6771}
    6872
    6973void CComponentTypeScript::Serialize(ISerializer& serialize)
  • source/scriptinterface/ScriptInterface.cpp

     
    256256    return true;
    257257}
    258258
     259bool ProfileArgument(JSContext* cx, uint argc, jsval* vp)
     260{
     261    const char* name = "";
     262
     263    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
     264
     265    if (args.length() == 0)
     266        return true;
     267
     268    std::string str;
     269    if (!ScriptInterface::FromJSVal(cx, args[0], str))
     270        return false;
     271
     272    typedef boost::flyweight<
     273        std::string,
     274        boost::flyweights::no_tracking,
     275        boost::flyweights::no_locking
     276    > StringFlyweight;
     277
     278    name = StringFlyweight(str).get().c_str();
     279
     280    g_Profiler2.RecordAttribute(name);
     281
     282    args.rval().setUndefined();
     283    return true;
     284}
     285
    259286bool ProfileStop(JSContext* UNUSED(cx), uint UNUSED(argc), jsval* vp)
    260287{
    261288    JS::CallReceiver rec = JS::CallReceiverFromVp(vp);
     
    363390    JS_DefineFunction(m_cx, globalRootedVal, "deepcopy", ::deepcopy,  1, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT);
    364391
    365392    Register("ProfileStart", ::ProfileStart, 1);
     393    Register("ProfileArgument", ::ProfileArgument, 0);
    366394    Register("ProfileStop", ::ProfileStop, 0);
    367395
    368396    runtime->RegisterContext(m_cx);