Module: Lich::Common::XMLParserDelta::Base

Included in:
Default, DragonRealms::XMLDelta, Gemstone::XMLDelta
Defined in:
documented/common/xmlparser/game_delta.rb

Overview

The hook interface, with the behavior for a game that is not (yet) known. Game deltas extend this and override only the hooks that differ.

Instance Method Summary collapse

Instance Method Details

#apply_crtr_status(_id, _flags, in_room_objs: false) ⇒ Boolean, Symbol

Applies a immediately, if this game can.

Returns true when applied and the id should be collected: only the DragonRealms prompt handler drains that list (pairing ids to legacy-stream bold names). Returns :applied when applied with no pairing and nothing to stash (GemStone's standalone tags for a creature already in the current room). Returns false to have the parser stash the flags for the creature's next room-objs link, which registers it and applies them. Opening room objs or

Parameters:

  • id (String) —

    the exist id

  • flags (Hash{String=>String}) —

    the tag's other attributes

  • in_room_objs (Boolean) (defaults to: false) —

    the tag arrived inside a room objs component

Returns:

  • (Boolean, Symbol) —

    true, :applied or false



90
91
92
# File 'documented/common/xmlparser/game_delta.rb', line 90

def apply_crtr_status(_id, _flags, in_room_objs: false) # rubocop:disable Lint/UnusedMethodArgument
  false
end

#main_subtitle(subtitle, nav_uid_pending:) ⇒ Hash

Parses the main window's streamWindow subtitle. Returns the parser state to update; omitted keys are left as they are. XMLParser applies only the keys listed under @return, so a new key needs a matching line at the call site. A hook may also update global (non-parser) state (GemStone's turns on Lich.display_uid), so call it once per subtitle and never speculatively.

Parameters:

  • subtitle (String) —

    the subtitle attribute, e.g. GemStone " - Town Square, Central - 228", DragonRealms " - [Town Square] (1234)"

  • nav_uid_pending (Boolean) —

    a

Returns:

  • (Hash) —

    any of :room_title, :room_id, :show_room_id, :nav_uid_pending



69
70
71
# File 'documented/common/xmlparser/game_delta.rb', line 69

def main_subtitle(subtitle, nav_uid_pending:) # rubocop:disable Lint/UnusedMethodArgument
  { room_title: String.new }
end