summaryrefslogtreecommitdiffstats
path: root/lib/iotas
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-24 23:23:58 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-24 23:23:58 +0200
commit47d902611ca7617fbaa187c26846d378beae18a7 (patch)
tree2518aaa8d0e8f3af6fe76db6b1d77a75ecb6fefc /lib/iotas
parent6fa6c717da07b1c5a6acf1248bc341272378e354 (diff)
downloadedoors-ruby-47d902611ca7617fbaa187c26846d378beae18a7.zip
edoors-ruby-47d902611ca7617fbaa187c26846d378beae18a7.tar.gz
Room implement new routing policy
Diffstat (limited to 'lib/iotas')
-rw-r--r--lib/iotas/room.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/iotas/room.rb b/lib/iotas/room.rb
index 4482a6b..f3d0cfa 100644
--- a/lib/iotas/room.rb
+++ b/lib/iotas/room.rb
@@ -23,8 +23,7 @@ module Iotas
#
ERROR_ROUTE_NS = 'routing error: no source'.freeze
ERROR_ROUTE_RRWD = 'routing error: right room, wrong door'.freeze
- ERROR_ROUTE_DDWR = 'routing error: drill down, wrong room'.freeze
- ERROR_ROUTE_TRWR = 'routing error: top room, wrong room'.freeze
+ ERROR_ROUTE_DNE = 'routing error: does not exists'.freeze
ERROR_ROUTE_NDNL = 'routing error: no destination, no link'.freeze
ERROR_ROUTE_SND = 'routing error: system no destination'.freeze
#
@@ -126,17 +125,10 @@ module Iotas
else
p.error! Iotas::ERROR_ROUTE_RRWD
end
- elsif (p.room=~/^#{path}\/(.*)/)==0
- room, *more = $1.split Iotas::PATH_SEP
- if child=@iotas[room]
- child.route_p p
- else
- p.error! Iotas::ERROR_ROUTE_DDWR
- end
- elsif @parent
- @parent.route_p p
+ elsif door = @spin.search_world(p.room+Iotas::PATH_SEP+p.door)
+ p.dst_routed! door
else
- p.error! Iotas::ERROR_ROUTE_TRWR
+ p.error! Iotas::ERROR_ROUTE_DNE
end
end
#