Skip to content

Commit

Permalink
[xmlparser.rb] Add XMLData.dr_room_numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR committed Nov 15, 2024
1 parent 698f0d3 commit bef55c0
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions lib/xmlparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
game: Gemstone
tags: CORE, spells
required: Lich > 5.7
version: 1.3.3
version: 1.3.4
changelog:
v1.3.4 (2024-11-15)
feature: Add DR room numbers to XMLData
v1.3.3 (2024-10-31)
Feature: Add DR Active Spells to XMLData
v1.3.2 (2024-10-17)
Expand Down Expand Up @@ -36,7 +38,7 @@ class XMLParser
:indicator, :injuries, :injury_mode, :room_count, :room_name, :room_title, :room_description,
:room_exits, :room_exits_string, :familiar_room_title, :familiar_room_description,
:familiar_room_exits, :bounty_task, :server_time, :server_time_offset,
:dr_active_spells, :dr_active_spells_stellar_percentage, :dr_active_spells_slivers,
:dr_active_spells, :dr_active_spells_stellar_percentage, :dr_active_spells_slivers, :dr_room_number,
:roundtime_end, :cast_roundtime_end, :last_pulse, :level, :next_level_value,
:next_level_text, :society_task, :stow_container_id, :name, :game, :in_stream,
:player_id, :prompt, :current_target_ids, :current_target_id, :room_window_disabled,
Expand Down Expand Up @@ -106,6 +108,8 @@ def initialize
@dr_active_spell_tracking = false
@dr_active_spells_stellar_percentage = 0
@dr_active_spells_slivers = false
@dr_room_number_ready = false
@dr_room_number = 0
@name = String.new
@game = String.new
@player_id = String.new
Expand Down Expand Up @@ -295,6 +299,7 @@ def tag_start(name, attributes)
@obj_exist = attributes['exist']
@obj_noun = attributes['noun']
end

if name == 'inv'
if attributes['id'] == 'stow'
@obj_location = @stow_container_id
Expand Down Expand Up @@ -355,7 +360,16 @@ def tag_start(name, attributes)
if name == 'style'
@current_style = attributes['id']
end

if name == 'preset' && attributes['id'] && !XMLData.in_stream
@dr_room_number_ready = true
end

if name == 'prompt'
if @game =~ /^DR/ && Room.current && @dr_room_number_ready
@dr_room_number = Room.current.id
@dr_room_number_ready = false
end
@server_time = attributes['time'].to_i
@server_time_offset = (Time.now.to_i - @server_time)
$_CLIENT_.puts "\034GSq#{sprintf('%010d', @server_time)}\r\n" if @send_fake_tags
Expand Down

0 comments on commit bef55c0

Please sign in to comment.