[WIP] PA Community Hub

Discussion in 'Work-In-Progress Mods' started by Raevn, August 25, 2014.

  1. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Update - 01/11/2014
    Massive Update! Major features:
    • Automatic updating of PA Hub to the latest Github version (only windows, for now)
    • "Spotlight" tab added, where you can see the latest content, as well as seeing content requiring updates and later will have most downloaded/most popular views as well.
      upload_2014-11-1_17-10-26.png
    • Now supports updating core plugins using the content hub
    • Content can now be grouped according to the sort method chosen
    • News is now formatted using CommonMark
      upload_2014-11-1_17-9-17.png
    Updated:
    Changes:
    • Change: (Windows only) Automatic updates from Git Repository.
    • Change: Added Spotlight Content to Content Hub
    • Change: Added Group by Sort option for content
    • Change: News is now formatted using CommonMark
    • Change: Font of body text
    • Change: Misc Styling
    • Change: com.pahub.content.plugin.settings is now a core plugin
    • Change: semver package updated to v4.1.0
    • Change: A meta-content item is now created for pahub, so content can depend on specific versions.
    • Change: Added Display tab to Local/Online Content tabs
    • Change: Versioning is now massaged into semver format if possible.
    • Change: Clicking on a content item now shows additional details at the bottom of the screen (previously, it was on hover).
    • Change: Content is now enabled/disabled by clicking the checkbox, not the content tile.
    • Change: Formatting of content information is now standardised across the tabs.
    • Change: Content now shows additional details, such as author, version, build, date and dependencies.
    • Change: Updating core plugins causes PA Hub to restart in order to install.
    • Change: Download tab moved to header.
    • Change: Download icon moved into content folder.
    • Change: Download the online catalog for a store is now done asynchronously.
    • Change: Added Sort method for "Last Updated" to online content.
    • Change: Sort method, sort direction and show/hide options for both local and online content is now remembered.
    • Change: Added instructions and formatting guide to "Add News Entry" page
    • Change: Text input box is now a multiline text area
    • Change: show_debug_log and show_verbose_log are now settings
    • Change: Log styling updated
    • Change: Setting type separated from control type
    • Change: Settings are now tied to an observable
    • Change: Mod Categories are now sorted alphabetically
    • Change: Mod Categories are now case-insensitive
    • Change: Mods now respect the priority parameter in modinfo.json
    • Fix: Core plugins can no longer be disabled.
    • Fix: Item filter counts not updating when additional filters are applied
    • Fix: incorrect path to ui_mod_list.json
    • Fix: Online mod content now properly processes dependency information
    • Fix: Error checking during ZIP operations
    • API: Added pahub.api.content.fixVersionString(version)
    • API: Added pahub.api.content.getContentName(content_id, prefer_local)
    • API: Added 'group_function' parameter to pahub.api.content.addSortMethod
    Known issues:
    • PA Hub defaults to Settings tab on start
  2. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    I've implemented detection of the PA install path and launching PA, but I only know what the Windows Uber Launcher install looks like; if anyone can give me the following information, that would be great :)

    Steam:
    • Assuming base directory of /x/, where is the coherent host folder?
    • Assuming base directory of /x/, where is PA.exe (or equivalent for other OSs)?
    • Are there differences between OSs?
    Linux:
    • Location of data (mods, logs etc)
    • Assuming base directory of /pahub/, where would package.json be located?
    • Assuming base directory of /pahub/, where would the "app" folder be located?
    • Assuming base directory of /x/, where are the PTE and Stable directories?
    • Assuming base directory of /stable/ or /pte/, where is the coherent host folder?
    • Assuming base directory of /stable/ or /pte/, where is PA.exe (or equivalent for other OSs)?
    Mac:
    • Assuming base directory of /x/, where are the PTE and Stable directories?
    • Assuming base directory of /stable/ or /pte/, where is the coherent host folder?
    • Assuming base directory of /stable/ or /pte/, where is PA.exe (or equivalent for other OSs)?
    For example, on windows this would be:
    • %USERPROFILE%\AppData\Local\Uber Entertainment\Planetary Annihilation\
    • /x/Planetary Annihilation/Stable & /x/Planetary Annihilation/PTE
    • /stable/bin_x[86/64]/host & /PTE/bin_x[86/64]/host
    • /stable/PA.exe & /PTE/PA.exe
  3. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    • data is in "~/.local/Uber Entertainment/Planetary Annihilation/"
    • I'm not sure what you mean with where package.json and app are located? I have it in "pahub/app/package.json", but that comes from your GitHub.
    • PTE and Stable are wherever you please. Linux lacks an UberLauncher, so there are now three community ones and they don't all put everything in the same place. Additionally, the "official" way is to still download a massive bz2 file and just extract that wherever for stable. Fun, eh?
    • /stable/host
    • /stable/PA
    host directories: (I'm not sure what you consider the "base", so here is the whole thing. :))
    ~/Library/Application Support/Uber Entertainment/Planetary Annihilation/data/streams/stable/PA.app/Contents/MacOS/host
    ~/Library/Application Support/Uber Entertainment/Planetary Annihilation/data/streams/pte/PA.app/Contents/MacOS/host
    And the PA executable is
    ~/Library/Application Support/Uber Entertainment/Planetary Annihilation/data/streams/stable/PA.app/Contents/MacOS/PA
    ~/Library/Application Support/Uber Entertainment/Planetary Annihilation/data/streams/pte/PA.app/Contents/MacOS/PA

    (No idea about Steam)
    Raevn likes this.
  4. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    I hate my life right now :(

    Thanks for all that though :)

    Edit:
    Different versions of Atom Shell for different OSs have it in different places within the Atom Shell folder structure.
  5. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Ah, ok. I always just ran "/path/to/atom pahub/", but I see that the atom-shell thingy has an app dir too, which is located in "atom-shell/resources/app", where atom-shell is just the base dir.
  6. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    The 'app' dir is PA Hub itself; all the rest is just atom-shell.

    Can someone who uses steam provide me with their log file? @SXX, @cwarner7264 @wpmarshall ?
  7. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    PC - Steam

    (Steam Apps -> PA Folder)\bin_x(yz)\host
    x\bin_x(yz)\pa.exe
    Raevn likes this.
  8. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Thanks :) Can I trouble you for a log file also?
  9. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    A typical UI log?
  10. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Yeah, one of the "PA-HH-MM-SS.000.txt" ones (not coherent_ui.log)

    Edit:

    Can you also confirm if the steam version has a generic exe (that automatically chooses the right pa.exe to run, x64 or x86) like the non-steam version? Eg., does it have:

    Steam Apps > PA Folder > PA.exe
    Steam Apps > PA Folder > bin_x86 > PA.exe
    Steam Apps > PA Folder > bin_x64 > PA.exe
    Last edited: November 3, 2014
  11. wpmarshall

    wpmarshall Planetary Moderator

    Messages:
    1,868
    Likes Received:
    2,989
    I'm not at home atm, but will try to give you my log when I get back, though I have barely used the steam launcher - I only have it installed so that I get the cards :p (I haven't installed the community hub mod though, that is if it is even available yet)
  12. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Thanks :)

    PA Hub is available, but it's very early. It's a manual install, but once installed it can update itself and it's content automatically/from within the app.
  13. Mereth

    Mereth Active Member

    Messages:
    330
    Likes Received:
    164
    https://github.com/pamods/pamm-atom/blob/master/app/assets/js/pa.js

    Why loosing time reimplementing what's already known to work ? All those cross-platform path issues had already been worked out (with some pain).

    And for steam, don't launch the exe, but use the steam handler instead : shell.openExternal('steam://rungameid/233250');
  14. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    I've been referring to your code for this as much as I can, but it's a little confusing - I thought asking might be quicker than trying to work it out ;).
    Some things I did notice:
    • I think you have a bug on windows where you force the x64 version of PA to run, rather than using the base PA.exe (which should choose the correct architecture to run). This will fail on 32 bit windows (a small audience, granted :p).
    • My understanding from @DeathByDenim 's post above is that Mac has a Stable & PTE install, like windows that is one folder level higher than you check - eg:
      papath = path.join(papath, '../../../..') // remove /PA.app/Contents/MacOS/host
      should be
      papath = path.join(papath, '../../../../..') // remove <stable|pte>/PA.app/Contents/MacOS/host
      plus other adjustments to account for this.
    For steam, I'm looking for a way to detect that it's a steam install in the first place (I had noticed your use of the steam handler, and have used that for launching it - good idea :) ); I *think* you revert to steam if it doesn't match the other options (that part was hard to follow), but I also remember there used to be a line in the log about steam distribution being detected or not, so I wanted to see if I can use that.
  15. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Oops, I just realized I screwed up the capitalization for Mac for the PTE stream. It should be:
    ~/Library/Application Support/Uber Entertainment/Planetary Annihilation/data/streams/PTE/PA.app/Contents/MacOS/host
    (copy-paste is your friend!)
    Raevn likes this.
  16. Mereth

    Mereth Active Member

    Messages:
    330
    Likes Received:
    164
    Using the PA.exe inside "x64" was a quick & dirty fix. If you use the PA.exe wrapper, the one supposed to choose between x64 and x86, PA is unable to launch the server.exe on Windows 7 (only). Uber consider this as a "mod issue" and don't give a <bip>. A proper fix would have to use the intel gathered earlier in the log file to choose between x64 and x86 but I was a bit pissed off by Uber response and it was already broken for days before I found this workaround.

    Windows & Linux release are very similar, the OSX package is more "special" for non OSX users, but @wondible helped me a lot to go through this. You can find a OSX log file in the first (or 2nd) pamm thread page.

    You definitely can't detect the steam version directly, the release is binary identical to the PA Launcher release (at least last time I checked it). The log only include the steam reference IF you start PA from Steam which make it unreliable (imo), while Uber Launchers will always install PA in streams names folders.

    You could have used the pa.js module as it, from an external point of view, you just have to use the ready "promise" and consume the object returned.
  17. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    If I had an application for it, I'd look into making a node module (or several) for modinfo parsing, mod management, mod installing, PA detection, etc.
  18. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Update - 04/11/2014
    Updates to pretty much every aspect of PA Hub. Changes are listed below, and have been added as news items also. I'm very keen on feedback on this version, especially from those using Mac, Linux and Steam (any OS).

    Note: PA Hub itself should auto-update, then ensure you update the Content Hub plugin first. Also, there will not appear to be an update to the Mod Store plugin, however there is - select it and click "Install" to overwrite the current version with the most recent one (this is due to a change in the underlying metadata for that plugin).

    These sorts of manual steps should become fewer and eventually unnecessary as the app gets more complete.

    PA Hub
    upload_2014-11-4_12-8-26.png

    • Added install location detection
    • Added Launch PA Button
    • Added Exit Button
    • Added ability to change between PTE (if detected) and Stable streams
    • Now supports Linux
    • Auto update now supported on Linux & Mac
    Content Hub
    upload_2014-11-4_12-9-53.png upload_2014-11-4_12-10-11.png upload_2014-11-4_12-10-51.png

    • Content display now shows download count
    • Content display now shows NEW! if last update is within 7 days
    • Added Stats tab to content spotlight
    • Most downloaded tab in content spotlight now functional
    • Can no longer install content if dependencies are missing (temporary; future plans are to install these automatically)
    • Added sort by downloads
    • Bugfix: Could enable content in certain circumstances when requirements were not met
    • Bugfix: Installed content no longer shows both “Install” and “Uninstall” buttons on content display
    • API change: Added pahub.api.content.getTotalDownloads()
    • API change: Added pahub.api.content.verifyContentDependencies()
    • API change: pahub.api.content.setEnabled, pahub.api.content.enableContent and pahub.api.content.disableContent now return true on success and false if they could not complete
    Plugin Store
    upload_2014-11-4_12-14-13.png

    • A meta-content item for PA is now created, with the version number equal to the PA build number of the currently selected stream (can be used for dependency purposes)
    Mod Store
    upload_2014-11-4_12-13-42.png upload_2014-11-4_12-13-56.png

    • Retrieves mod download counts
    • Now loads stock mods
    • Workaround for plugin not updating correctly.
    Settings Plugin
    upload_2014-11-4_12-9-3.png

    • Added new setting: Current Stream Change: Added current section/tab as background settings; this means the last section/tab you are on will be remembered when you close and open PA Hub.
    • Community > News set as the default tab on opening, if present.
    • Minor style change
    • Bugfix: Drop-down lists now work again
    Community Plugin
    upload_2014-11-4_12-11-56.png

    • Added Preview button to Add News Item page
    • Layout of Add News Item page updated
    • Basic verification added to preview/submit news item
    • Return to views news page after submit
    • Style changes
    • Bugfix: ‘.’ chars in news titles are now displayed correctly.
    Fr33Lancer and thetrophysystem like this.
  19. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Ok, tested in Linux and it's refusing to work.
    pahub.png
    I cleared out all of the previous pahub stuff and started afresh. I downloaded atom-shell (0.16.1), extracted it somewhere. The I downloaded pahub-master.zip, unzipped it and moved the app folder into the resources directory of atom-shell.
    Then I downloaded all of the plugin zips and extracted those in ~/.local/Uber Entertainment/Planetary Annihilation/pahub/content/plugin. Then I realized all of the plugin zips contain the actual directories, so I moved those one directory up to the correct place.
    Then I ran ./atom and got the screen above. In the terminal I have:
    Code:
    [7428:1103/220310:ERROR:browser_main_loop.cc(162)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
    [7459:1103/220311:INFO:renderer_main.cc(204)] Renderer process started
    ATTENTION: default value of option force_s3tc_enable overridden by environment.
    [7428:1103/220311:INFO:CONSOLE(384)] "Uncaught TypeError: Arguments to path.join must be strings", source: path.js (384)
    
    I'd love to find the error, but I have no idea how to debug this atom-shell business. The "documentation" is impressively unintelligible. I sprinkled some console.log statements around, since those seem to be written to the console, but I couldn't find anything that way. Anyway, I've also attached the pahub-log.txt file in case it helps. The only odd thing in there is the detected path for the location of PA. Happy hunting. :)
    (or point me to a something that will tell me how to step through the code in a debugger or at least do back traces. :))

    Attached Files:

  20. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Found it. Quick fix: comment out line 505 (getInstalledPTEBuild();).
    Edit: That would be line 505 of pahub.js, in /home/jarno/Projects/atomshell/resources/app/assets/js/
    Edit 2: Also change the second parameter for path.join on line 496 to ".."
    Last edited: November 4, 2014

Share This Page