[WIP] PA Community Hub

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

  1. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    media got added to OS X many builds ago.

    ~/Library/Application\ Support/Uber\ Entertainment/Planetary\ Annihilation/data/streams/stable/PA\.app/Contents/Resources/media/stockmods/client

    Ah. So stores aren't opaque in how they manage their data.
  2. Mereth

    Mereth Active Member

    Messages:
    330
    Likes Received:
    164
    All code I produced for PAMM(client/server) is, in spirit, under WTFPL licence :D

    You can find the installer project inside a custom branch of the pamm-atom repository. It use WiX Toolset and should require minimum changes to package pahub. It shouldn't require you to have Visual Studio to build it. I can of course help you to make the appropriate changes in the configuration files.

    https://github.com/pamods/pamm-atom/tree/wix-installer
    Fr33Lancer likes this.
  3. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    The default behaviour when enabling/disabling a content item is simply to toggle the "enabled" parameter & write it out to the content-info.json file. What enabled/disabled actually means though is entirely defined by the content store - it does nothing intrinsically. This behaviour can also be overridden (as the mod store does, due to the different file names - modinfo.json vs content-info.json).

    Not sure what you mean by not opaque, but hope this answers it.

    Also, one other difference I forgot to mention - PA Hub enforces the folder names being equal to the content ID (it won't error if they are not packaged that way, but when installing it will install to the changed folder name). This can mean duplicate items if you have mods installed already that don't follow that convention, then reinstall them from PA Hub. The first one alphabetically is the one that will be used. I mean to put a disclaimer that says to remove all mods and re-install them, to avoid this.

    Haha, that's an awesome license.

    If I have any issues I'll let you know - thanks :)
  4. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    As in a store presents a collection of objects. The mod store would persist the enabled property in mods.json (leaving modinfo alone), and correctly re-create the enabled property the next time store contents were requested.

    Interesting. But if I'm reading you right it only matters when installing via PAHub; PAMM does the same thing where it can manage mods in any directory, but installs them under identifier.
  5. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Content stores are responsible for finding their own content, either through the inbuilt method (which looks for content-info.json files in the given content directory), or via a custom function that returns a list of content objects.
    Those objects can be edited before being returned, so I could change the enabled value there based on the mods.json list, leaving the actual value of enabled as written in the file, unchanged.

    This also allows content stores to have content that doesn't need their own individual info files, too - the info for each item just needs to be built in memory before being returned, and I plan on doing that for the Map Content Store that I am building for the system sharing mod.

    Interesting. But if I'm reading you right it only matters when installing via PAHub; PAMM does the same thing where it can manage mods in any directory, but installs them under identifier.[/QUOTE]
    Correct; both apps can read content installed by the other, the only issue is currently if you install a mod from PA Hub that is already installed in a folder that is not named after it's identifier.
  6. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Found a bug: Downloading animation is stuck for update/installing PA mods.
    pahub.png
    It installs the mods just fine, but the "Download <name of mod>" thingy in the status bar won't go away. I do have this in my terminal, but I haven't figured out yet where it comes from:
    Code:
    [29078:1107/085435:INFO:CONSOLE(1253)] "Uncaught TypeError: undefined is not a function", source:  (1253)
    
    Maybe later tonight. :)

    (Also: woohoo my news entry was approved! :))
  7. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Can't reproduce, and the line number doesn't give me any clues either.

    Don't forget to add the mod ID as a tag in future (I'll edit it in for your post). I have plans for making this much easier, though.
  8. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Here's an install script for Linux & Mac, based on the one created by @Mereth for PAMM.
    I have zero ability to check this, so if it works I'll be amazed :p

    Attached Files:

  9. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Heh, it's full of those silly Windows new-line thingies ('\r'), which result in this:
    Code:
    bash: ./install.sh: /bin/bash^M: bad interpreter: No such file or directory
    Doing dos2unix fixes that, but the next error is this:
    Code:
    cp: cannot stat ‘/tmp/pahub_18269/com.pahub.content.plugin.community-master/com.pahub.content.plugin.community-master’: No such file or directory
    That's because you have an extra "-master" tacked on in lines like this:
    Code:
    cp -R "$WORKINGDIR/com.pahub.content.plugin.community-master/com.pahub.content.plugin.community-master" "$PAHUBDIR/content/plugin"
    
    The second "-master" shouldn't be there.

    After fixing that, atom shell starts up, but it's almost an empty screen. That's because you put in the wrong PAHUBDIR for Linux. It should be:
    Code:
      PAHUBDIR="$HOME/.local/Uber Entertainment/Planetary Annihilation/pahub"
    
    Finally, on line 312, there should be quotes because it may contain spaces. It should be:
    Code:
      "$PAHUBDIR/client/pahub"
    
    And the same for the .desktop file generation on lines 304-305:
    Code:
    Exec="$PAHUBDIR/client/pahub" "%u"
    Icon="$PAHUBDIR/client/resources/app/assets/img/launch.png"
    
    I've attached the new file. Not tested for Mac though.

    By the way, the downloading mod animation getting stuck disappeared for some reason, so nice! :)

    Attached Files:

    Raevn and Fr33Lancer like this.
  10. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Update - 08/11/2014
    This was released several days ago but I forgot to post here.

    PA Hub (v0.2.3)
    • Updated stream handling (covers launching PA, build numbers and stockmods location).
    • Bugfix: Linux install paths corrected
    thetrophysystem likes this.
  11. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Those were the only problems? I was expecting far more :p. Thanks a million for this :) Not sure if I can take credit for fixing your download mod animation though, as I don't even know what caused it in the first place!

    Currently working on:
    • Content Hub
      • Multi selection (hold ctrl to select/deselect additional items)
      • Link to News for content items
      • Actions on multiple content items - Enable/Disable All, Install All etc.
      • Show download counts.
    • Windows Installer
    Next:
    • Mod store updates
      • Support for legacy scenes
      • Use same enabled/disabled detection as PAMM for mods to avoid the issue when switching between them.
    • News
      • Ability to add comments to news entries
  12. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Update - 20/11/2014
    Select multiple content items! Use Ctrl to add/remove an item from the current selection. Clicking normally will clear the current selected items and select only that item. You can perform enable/disable and install on multiple selected items.
    upload_2014-11-20_7-40-57.png
    (Enable All, Disable All and Uninstall All only appear when selecting multiple items in the Local Content tab. Uninstall & Uninstall All are currently not yet implemented).

    Content Hub Plugin (v0.3.0)
    • News link on content item detail view
    • Content Detail view now shows downloads
    • Author now visible in the spotlight Recently updated & most downloaded lists
    • Layout changes to the spotlight recently updated and most downloaded lists.
    • Multi-item selection via Ctrl+Click
    • Enable/Disable checkbox no longer shows on Core Plugin items.
    • Separated out plugin code into sub-files for easier development.
    • Selecting multiple content items nows shows a combined download count
    • API: Added disableContentItems, disableContentItem
    • API: Added enableContentItems, enableContentItem
    • API: Added installContentItems
    • API: Added getContentItemEnabled
    • API: Added setContentItemsEnabled, setContentItemEnabled
    • API: Deprecated setContentEnabled
    • API: Deprecated enableContent
    • API: Deprecated disableContent
    Fr33Lancer likes this.
  13. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Some things I've been working on since the last update.

    Content Hub
    • Can click on the filter/sort/display tabs to toggle them open & closed
    • Added Select All/Select None buttons.
    • Content in the Find Content tab which you have installed already appears greyed out.
    General
    • Updated the section names/launch button to have a bit more consistency
      upload_2014-11-23_20-47-0.png
    • You can now login with your PlayFab account
      upload_2014-11-23_20-47-13.png
    • Working on a Game section, with ladder:
      upload_2014-11-23_20-47-56.png
  14. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
    This looks absolutely wonderful! Keep up the good work.
    EDIT: By the way, do you need any code monkeys? I've been pretty bored lately and would love to get involved! I have the usual experience with HTML/CSS but also node.js.
    Last edited: November 24, 2014
    squishypon3, proeleert and Fr33Lancer like this.
  15. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Nice , where is my windows installer ? :p
    squishypon3, Fricia, Quitch and 2 others like this.
  16. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Looking for help with the following, because these will take me a while to get round to:
    • Custom implementation of IRC chat (currently uses a web chat in an i-frame, but implementing it natively will give us much more control & functionality)
    • Creation of a lobby tab (need to wait until the "game" plugin drops, which should be soon)
    Or you can start on your own custom plugin, if you have any ideas!

    I want to release the remainder of the updates I'm working on, since these are actually packaged in the installer for Windows (the linux one simply pulls the latest github versions).

    Not long left though! Hopefully on or before this weekend :)
    Last edited: November 25, 2014
    squishypon3 and Fr33Lancer like this.
  17. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
    Ooohhhh this one sounds nice. I am currently reading up KO and node irc libraries.

    Just a question, is this IRC chat supposed to behave like an embedded IRC client (so you can use irc commands and change channels etc) or more like a global chat?
  18. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Update - 27/11/2014
    Several updates to plugins were released over the last couple of days, the notes for these are below.
    Lots of small tweaks to the content hub, plus some long-needed fixes to the mod store to bring it back in line with PAMM. Other tweaks are in preparation for a large update to the core application and a new "game" plugin, which includes among other things the ability to log in with your Uber account and a PA ladder.

    Known issue: Installing a mod does not enable it
    Known issue: Log state (showing debug and/or verbose messages) isn't currently saved


    Log Plugin (v0.1.1)
    • Removed debug setting controls
    • Removed label text from section
    Settings Plugin (v0.2.1)
    • Removed debug setting controls
    • Removed label text from section
    • Removed incorrect colon from checkbox setting
    • Bugfix: Settings without controls no longer cause a blank line to be added
    Content Hub Plugin (v0.4.0 & v0.4.1)
    • Added Refresh Button to the Local and Find Content tabs
    • Added Select All, Select None to the Local and Find Content tabs
    • Content you have installed appears greyed out in the Find Content list.
    • Clicking on a sub-tab (Filter, Sort, Display) in the local or find content tabs toggles the visibility of the options
    • Only network downloads are now shown on the downloads tab
    • Removed Popular sub-tab from Spotlight tab.
    • Removed Show/Hide Options button
    • Removed debug setting controls
    • Removed download section label
    • Removed Upload tab for now
    • Removed some logging.
    • Bugfix: When scanning for local files, content stores now correctly only return a list of new/updated content (if using the in-built method).
    • Bugfix: Reinstalling or updating a plugin now unloads and re-loads it
    • API: Added pahub.api.content.selectAll
    • API: Added pahub.api.content.selectNone
    • Content is correctly unloaded and re-loaded when updated
    • Bugfix: Enabling & disabling content now first checks the content exists
    Mod Store Plugin (v0.3.0)
    • Mod download counts are now incremented when downloaded
    • Support for legacy scene definitions in modinfo.json
    • Initial enabled/disabled state of mods taken from mods.json
    • Update for new stream handling method
    Last edited: November 27, 2014
    cwarner7264 likes this.
  19. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    [​IMG]
    This started happening a few updates back. Waited to see if it was a small revertable error.

    Attached Files:

    Raevn likes this.
  20. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Good catch. It only happens when "Group by sort" is turned off (on the display tab)
    thetrophysystem likes this.

Share This Page