This wiki is archived from 2021-09-05

Planetary Annihilation Community Mods Implementation: Difference between revisions

From Planetary Annihilation: TITANS and Classic PA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 30: Line 30:


* loading of the game and uberbar scenes is delayed by clearing panel src
* loading of the game and uberbar scenes is delayed by clearing panel src
* latest community mods files are downloaded
* latest community mods files are downloaded (auto update)
* scan for file system mods
* file system is scanned for client and server mods
* merge into installed mods
* file system mods are merged into existing installed mods
* load available mods from community mods server (falling back to local storage if unavailable)
* available mods data is loaded from the community mods server (falling back to local storage if unavailable)
* update active zip mods if mf5 has changed
* installed file system mods are linked to available mods
* mount client mods
* active zip mods are updated if md5 has changed (auto update)
* load game and uberbar scenes by restoring panel src (or after a 45 second timeout)
* client mods are mounted
* game and uberbar scenes are loaded by restoring their panel src (or after a 45 second timeout)


== [[File:platinum-rank-icon.png|50px]] Start Scene ==
== [[File:platinum-rank-icon.png|50px]] Start Scene ==
Line 46: Line 47:
Once loaded from the download cache the following occur:
Once loaded from the download cache the following occur:


* add community mods menu item to load community mods scene
* community mods menu item is added to load community mods scene
* hook api.file.unmountAllMemoryFiles to prevent unmounting of memory files
* api.file.unmountAllMemoryFiles to hooked to prevent unmounting of memory files
* if return to start and mods not already reset in transit:
* if return to start and mods not already reset in transit:
** hold ready
** hold ready
** reset server mods
** server mods are reset
** mount client mods
** client mods are mounted
** release ready
** ready is released


== [[File:platinum-rank-icon.png|50px]] Connect to Game Scene ==
== [[File:platinum-rank-icon.png|50px]] Connect to Game Scene ==
Line 62: Line 63:
Once loaded from the download cache the following occur:
Once loaded from the download cache the following occur:


* flag server mods reset required if joining, hosting or replaying a game that can mount server mods ie not Galactic War or ranked
* server mods reset required is flagged if joining, hosting or replaying a game that can mount server mods ie not Galactic War or ranked
* hook api.net.startGame to mount server mods for non Galactic War or ranked games
* api.net.startGame to hooked to mount server mods for non Galactic War or ranked games
* hook navToDestination to wait for server mods to mount
* navToDestination is replaced to wait for server mods to mount


== [[File:platinum-rank-icon.png|50px]] Transit Scene ==
== [[File:platinum-rank-icon.png|50px]] Transit Scene ==
Line 74: Line 75:
Once loaded from the download cache the following occur:
Once loaded from the download cache the following occur:


* If returning to start:
* ff returning to start:
* latest community mods files are downloaded
* latest community mods files are downloaded (auto update)
* and if server mods need reset:
* and if server mods need reset:
** reset server mods
** server mods are reset
** update active zip mods
* active zip mods are updated if md5 has changed (auto update)
** remount client mods
** client mods are remounted
** navigate to start
** navigation continues to start


== [[File:platinum-rank-icon.png|50px]] Galactic War Play Scene and Referee ==
== [[File:platinum-rank-icon.png|50px]] Galactic War Play Scene and Referee ==


The play scene and referee maange memory mounting of the unit specs for various loadouts and technology discovered.
The play scene and referee manage memory mounting of the unit specs for various loadouts and technology discovered.


Community Mods injects into the Galactic War play scene and referee using hooks in the default code.
Community Mods injects into the Galactic War play scene and referee using hooks in the default code.
Line 90: Line 91:
Once loaded from the download cache the following occur:
Once loaded from the download cache the following occur:


* hook api.file.unmountAllMemoryFiles to remount client mods
* api.file.unmountAllMemoryFiles to hooked to remount client mods

Revision as of 20:05, 29 March 2016

File:Titans-icon.png Planetary Annihilation Community Mods Implementation

File:Platinum-rank-icon.png Implementation Overview

Highlights of the implementation are:

  • community mods menu item is added to start menu
  • initial code is loaded remotely during startup in the main scene
  • downloaded files are cached for offline use or if the community mods server is temporarily offline
  • community mods code auto updates
  • community mods scene has been added to default code and loads from download cache
  • community mods hooks to load from download cache have been added to default scenes (see below)
  • mods are mounted from compressed zip archives
  • zip mod downloads are hashed using md5
  • zip mods auto update based on md5 hashes
  • server zip mod mounting is deferred until creating a game that supports server mods
  • server mods are reset in transit back to start only when needed
  • all scenes that load server mods return to start via transit
  • client mods are only remounted when necessary
  • community mods server does all the heavy lifting to process, validate, repackage and hash mod zips

File:Platinum-rank-icon.png Main Scene

The main scene is the parent of the game and uberbar scenes.

Community Mods injects into the main scene using hooks in the default code.

Once loaded remotely or from the download cache the following occur:

  • loading of the game and uberbar scenes is delayed by clearing panel src
  • latest community mods files are downloaded (auto update)
  • file system is scanned for client and server mods
  • file system mods are merged into existing installed mods
  • available mods data is loaded from the community mods server (falling back to local storage if unavailable)
  • installed file system mods are linked to available mods
  • active zip mods are updated if md5 has changed (auto update)
  • client mods are mounted
  • game and uberbar scenes are loaded by restoring their panel src (or after a 45 second timeout)

File:Platinum-rank-icon.png Start Scene

The start scene is the home page for the game panel in the main scene.

Community Mods injects into the start scene using hooks in the default code.

Once loaded from the download cache the following occur:

  • community mods menu item is added to load community mods scene
  • api.file.unmountAllMemoryFiles to hooked to prevent unmounting of memory files
  • if return to start and mods not already reset in transit:
    • hold ready
    • server mods are reset
    • client mods are mounted
    • ready is released

File:Platinum-rank-icon.png Connect to Game Scene

The connect to game scene manages starting and joining games.

Community Mods injects into the connect to game scene using hooks in the default code.

Once loaded from the download cache the following occur:

  • server mods reset required is flagged if joining, hosting or replaying a game that can mount server mods ie not Galactic War or ranked
  • api.net.startGame to hooked to mount server mods for non Galactic War or ranked games
  • navToDestination is replaced to wait for server mods to mount

File:Platinum-rank-icon.png Transit Scene

The transit scene display messages when returning to the start and other scenes.

Community Mods injects into the transit scene using hooks in the default code.

Once loaded from the download cache the following occur:

  • ff returning to start:
  • latest community mods files are downloaded (auto update)
  • and if server mods need reset:
    • server mods are reset
  • active zip mods are updated if md5 has changed (auto update)
    • client mods are remounted
    • navigation continues to start

File:Platinum-rank-icon.png Galactic War Play Scene and Referee

The play scene and referee manage memory mounting of the unit specs for various loadouts and technology discovered.

Community Mods injects into the Galactic War play scene and referee using hooks in the default code.

Once loaded from the download cache the following occur:

  • api.file.unmountAllMemoryFiles to hooked to remount client mods