-
- bodies=AMF.getint(req) # Read number of bodies
- bodies.times do # Read each body
- message=AMF.getstring(req) # | get message name
- index=AMF.getstring(req) # | get index in response sequence
- bytes=AMF.getlong(req) # | get total size in bytes
- args=AMF.getvalue(req) # | get response (probably an array)
- logger.info("Executing AMF #{message}(#{args.join(',')}):#{index}")
-
- case message
- when 'getpresets'; results[index]=AMF.putdata(index,getpresets(*args))
- when 'whichways'; results[index]=AMF.putdata(index,whichways(*args))
- when 'whichways_deleted'; results[index]=AMF.putdata(index,whichways_deleted(*args))
- when 'getway'; results[index]=AMF.putdata(index,getway(args[0].to_i))
- when 'getrelation'; results[index]=AMF.putdata(index,getrelation(args[0].to_i))
- when 'getway_old'; results[index]=AMF.putdata(index,getway_old(args[0].to_i,args[1]))
- when 'getway_history'; results[index]=AMF.putdata(index,getway_history(args[0].to_i))
- when 'getnode_history'; results[index]=AMF.putdata(index,getnode_history(args[0].to_i))
- when 'findgpx'; results[index]=AMF.putdata(index,findgpx(*args))
- when 'findrelations'; results[index]=AMF.putdata(index,findrelations(*args))
- when 'getpoi'; results[index]=AMF.putdata(index,getpoi(*args))
- end
- end
- logger.info("Encoding AMF results")
- sendresponse(results)
- else
- render :nothing => true, :status => :method_not_allowed