Skip to content

archipelago.js@1.1.0

Compare
Choose a tag to compare
@ThePhar ThePhar released this 09 Jul 18:03
· 166 commits to main since this release
f2a4b2e

Archipelago.js 1.1.0 - Changelog

Made some quality of life improvements for using this library when it comes to item and location lookup. Also more functionality for PlayersManager and ItemsManager.

What's New?

  • Updated version number to 1.1.0.
  • ItemsManager now contains a received and index property.
    • ItemsManager.received returns an array of all NetworkItems that have been sent from the server.
    • ItemsManager.index returns the index of the next expected item to be received from the server. Any items with a lower index are stored in ItemsManager.received.
      • Useful for tracking if new items have been received or to check if a de-sync event occurred.
  • ItemsManager will automatically attempt re-sync if it notices an item index higher than what it is expecting.
  • PlayersManager now contains an all property and get method for player lookup.
    • PlayersManager.all returns an array of all players. Synonymous with DataManager.players.
    • PlayersManager.get(id) returns a Player object or undefined if no player was found. Synonymous with DataManager.players[id].
  • Player objects returned from DataManager.players, PlayersManager.all, or PlayersManager.get have two helper functions for looking up item and location names.
    • Player.item(id) returns the name of an item that belongs to this player's game.
    • Player.location(id) returns the name of a location that belongs to this player's game.

What's Changed?

  • DataManager.players now returns a ReadonlyArray<Player>, instead of a ReadonlyMap<Player>.
  • Renamed HintManager to HintsManager.
  • Export all types again.
  • ItemsManager's and LocationsManager's name methods can now request either a game name or player id to lookup an item or location name.
    • For item/location lookup in the context of a player however, it is recommended to use the new helper functions on the Player object. See "What's New?" for details.
  • ItemsManager.name and LocationsManager.name returns "Unknown Item: {id}" or "Unknown Location: {id}" instead now.
  • ItemsManager.name and LocationsManager.name will throw an error if player is not a safe integer.

What's Removed?

  • ItemsManager.id and LocationsManager.id have been removed. If needed, use DataManager.package to lookup the inverse table.

Full Changelog: 1.0.0...1.1.0