lib/values/hvalue.rb in rsence-2.0.0.5.pre vs lib/values/hvalue.rb in rsence-2.0.0.6.pre
- old
+ new
@@ -1,6 +1,6 @@
-## Riassence Framework
+## RSence
# Copyright 2006 Riassence Inc.
# http://riassence.com/
#
# You should have received a copy of the GNU General Public License along
# with this software package. If not, contact licensing@riassence.com
@@ -45,13 +45,17 @@
end
# +HValue+ constructor. Binds HValue automatically to the +Message+ instance
# given as parameter. Data given as second parameter.
- def initialize( msg, data )
+ def initialize( msg, data, meta = { :name => nil } )
## Get an unique integer id for the value
- @val_id = msg.valuemanager.randgen.gen
+ if RSence.args[:debug] and meta[:name] and not msg.valuemanager.id_exists?( msg, meta[:name] )
+ @val_id = meta[:name]
+ else
+ @val_id = msg.valuemanager.randgen.gen
+ end
## set the data of the hvalue
set( msg, data, true )
## the @sync flag is raised, when the client data is older than the server data