ftue changes
This commit is contained in:
parent
cc69aa098e
commit
16c5ee9c78
|
|
@ -60,35 +60,35 @@ module JamRuby
|
|||
if ip_address and !ip_address.eql?(conn.ip_address)
|
||||
# turn ip_address string into a number, then fetch the isp and block records and update location info
|
||||
|
||||
addr = JamIsp.ip_to_num(ip_address)
|
||||
#addr = JamIsp.ip_to_num(ip_address)
|
||||
#puts("============= JamIsp.ip_to_num returns #{addr} for #{ip_address} =============")
|
||||
|
||||
isp = JamIsp.lookup(addr)
|
||||
#isp = JamIsp.lookup(addr)
|
||||
#puts("============= JamIsp.lookup returns #{isp.inspect} for #{addr} =============")
|
||||
if isp.nil? then
|
||||
ispid = 0
|
||||
else
|
||||
ispid = isp.coid
|
||||
end
|
||||
#if isp.nil? then
|
||||
# ispid = 0
|
||||
#else
|
||||
# ispid = isp.coid
|
||||
#end
|
||||
|
||||
block = GeoIpBlocks.lookup(addr)
|
||||
#block = GeoIpBlocks.lookup(addr)
|
||||
#puts("============= GeoIpBlocks.lookup returns #{block.inspect} for #{addr} =============")
|
||||
if block.nil? then
|
||||
locid = 0
|
||||
else
|
||||
locid = block.locid
|
||||
end
|
||||
#if block.nil? then
|
||||
# locid = 0
|
||||
#else
|
||||
# locid = block.locid
|
||||
#end
|
||||
|
||||
location = GeoIpLocations.find_by_locid(locid)
|
||||
if location.nil? || isp.nil? || block.nil?
|
||||
locidispid = nil
|
||||
else
|
||||
locidispid = locid*1000000+ispid
|
||||
end
|
||||
#location = GeoIpLocations.find_by_locid(locid)
|
||||
#if location.nil? || isp.nil? || block.nil?
|
||||
# locidispid = nil
|
||||
#else
|
||||
# locidispid = locid*1000000+ispid
|
||||
#end
|
||||
|
||||
conn.ip_address = ip_address
|
||||
conn.addr = addr
|
||||
conn.locidispid = locidispid
|
||||
#conn.addr = addr
|
||||
#conn.locidispid = locidispid
|
||||
conn.save!(validate: false)
|
||||
end
|
||||
|
||||
|
|
@ -186,32 +186,34 @@ SQL
|
|||
|
||||
# turn ip_address string into a number, then fetch the isp and block records
|
||||
|
||||
addr = JamIsp.ip_to_num(ip_address)
|
||||
addr = nil
|
||||
#addr = JamIsp.ip_to_num(ip_address)
|
||||
#puts("============= JamIsp.ip_to_num returns #{addr} for #{ip_address} =============")
|
||||
|
||||
isp = JamIsp.lookup(addr)
|
||||
#isp = JamIsp.lookup(addr)
|
||||
#puts("============= JamIsp.lookup returns #{isp.inspect} for #{addr} =============")
|
||||
if isp.nil? then
|
||||
ispid = 0
|
||||
else
|
||||
ispid = isp.coid
|
||||
end
|
||||
#if isp.nil? then
|
||||
# ispid = 0
|
||||
#else
|
||||
# ispid = isp.coid
|
||||
#end
|
||||
|
||||
block = GeoIpBlocks.lookup(addr)
|
||||
#block = GeoIpBlocks.lookup(addr)
|
||||
#puts("============= GeoIpBlocks.lookup returns #{block.inspect} for #{addr} =============")
|
||||
if block.nil? then
|
||||
locid = 0
|
||||
else
|
||||
locid = block.locid
|
||||
end
|
||||
|
||||
location = GeoIpLocations.find_by_locid(locid)
|
||||
if location.nil? || isp.nil? || block.nil?
|
||||
locidispid = nil
|
||||
else
|
||||
locidispid = locid*1000000+ispid
|
||||
end
|
||||
#if block.nil? then
|
||||
# locid = 0
|
||||
#else
|
||||
# locid = block.locid
|
||||
#end
|
||||
|
||||
#location = GeoIpLocations.find_by_locid(locid)
|
||||
#if location.nil? || isp.nil? || block.nil?
|
||||
# locidispid = nil
|
||||
#else
|
||||
# locidispid = locid*1000000+ispid
|
||||
#end
|
||||
addr = IPAddr.new(ip_address).to_i
|
||||
locidispid = nil
|
||||
lock_connections(conn)
|
||||
|
||||
conn.exec("INSERT INTO connections (user_id, client_id, channel_id, ip_address, client_type, addr, locidispid, aasm_state, stale_time, expire_time, udp_reachable, gateway, is_jamblaster) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)",
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
|
||||
isp = JamIsp.lookup(addr)
|
||||
if isp
|
||||
ispid = isp.coid
|
||||
end
|
||||
#isp = JamIsp.lookup(addr)
|
||||
#if isp
|
||||
# ispid = isp.coid
|
||||
#end
|
||||
end
|
||||
|
||||
{city: city, state: state, country: country, addr: addr, locidispid: (locid.nil? || ispid.nil?) ? nil : Score.compute_locidispid(locid, ispid) }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
require 'ipaddr'
|
||||
=begin
|
||||
|
||||
module JamRuby
|
||||
class JamIsp < ActiveRecord::Base
|
||||
|
|
@ -219,3 +220,4 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
end
|
||||
=end
|
||||
|
|
|
|||
|
|
@ -49,21 +49,21 @@ module JamRuby
|
|||
|
||||
if ip_address and !ip_address.eql?(connection.ip_address)
|
||||
# locidispid stuff
|
||||
addr = JamIsp.ip_to_num(ip_address)
|
||||
isp = JamIsp.lookup(addr)
|
||||
if isp.nil? then ispid = 0 else ispid = isp.coid end
|
||||
block = GeoIpBlocks.lookup(addr)
|
||||
if block.nil? then locid = 0 else locid = block.locid end
|
||||
location = GeoIpLocations.find_by_locid(locid)
|
||||
if location.nil? || isp.nil? || block.nil?
|
||||
locidispid = nil
|
||||
else
|
||||
locidispid = locid*1000000+ispid
|
||||
end
|
||||
#addr = JamIsp.ip_to_num(ip_address)
|
||||
#isp = JamIsp.lookup(addr)
|
||||
#if isp.nil? then ispid = 0 else ispid = isp.coid end
|
||||
#block = GeoIpBlocks.lookup(addr)
|
||||
#if block.nil? then locid = 0 else locid = block.locid end
|
||||
#location = GeoIpLocations.find_by_locid(locid)
|
||||
#if location.nil? || isp.nil? || block.nil?
|
||||
# locidispid = nil
|
||||
#else
|
||||
# locidispid = locid*1000000+ispid
|
||||
#end
|
||||
|
||||
connection.ip_address = ip_address
|
||||
connection.addr = addr
|
||||
connection.locidispid = locidispid
|
||||
#connection.addr = addr
|
||||
#connection.locidispid = locidispid
|
||||
end
|
||||
|
||||
connection.client_type = 'latency_tester'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ include Devise::Models
|
|||
module JamRuby
|
||||
class User < ActiveRecord::Base
|
||||
|
||||
include Geokit::ActsAsMappable::Glue unless defined?(acts_as_mappable)
|
||||
#include Geokit::ActsAsMappable::Glue unless defined?(acts_as_mappable)
|
||||
include HtmlSanitize
|
||||
#include ::AutoStripAttributes
|
||||
html_sanitize strict: [:first_name, :last_name, :city, :state, :country, :biography]
|
||||
|
|
@ -68,7 +68,7 @@ module JamRuby
|
|||
|
||||
devise :database_authenticatable, :recoverable, :rememberable
|
||||
|
||||
acts_as_mappable
|
||||
#acts_as_mappable
|
||||
|
||||
after_save :update_teacher_pct
|
||||
|
||||
|
|
@ -1833,7 +1833,8 @@ module JamRuby
|
|||
|
||||
# gets the GeoIpLocation for the user's last_jam_locidispid (where are they REALLY, vs profile info)
|
||||
def geoiplocation
|
||||
GeoIpLocations.find_by_locid(last_jam_locidispid / 1000000) if last_jam_locidispid
|
||||
return nil
|
||||
#GeoIpLocations.find_by_locid(last_jam_locidispid / 1000000) if last_jam_locidispid
|
||||
end
|
||||
|
||||
def update_last_jam(remote_ip, reason)
|
||||
|
|
|
|||
|
|
@ -317,14 +317,14 @@
|
|||
display: 'MacOSX Built-In',
|
||||
shortName: 'Built-In',
|
||||
videoURL: "https://www.youtube.com/watch?v=7-9PW50ygHk",
|
||||
showKnobs: false,
|
||||
showKnobs: true,
|
||||
showASIO: false
|
||||
},
|
||||
MacOSX_interface: {
|
||||
display: 'MacOSX external interface',
|
||||
shortName: 'External',
|
||||
videoURL: "https://www.youtube.com/watch?v=7BLld6ogm14",
|
||||
showKnobs: false,
|
||||
showKnobs: true,
|
||||
showASIO: false
|
||||
},
|
||||
Win32_wdm: {
|
||||
|
|
@ -338,14 +338,14 @@
|
|||
display: 'Windows ASIO',
|
||||
shortName : 'ASIO',
|
||||
videoURL: "https://www.youtube.com/watch?v=PGUmISTVVMY",
|
||||
showKnobs: false,
|
||||
showKnobs: true,
|
||||
showASIO: true
|
||||
},
|
||||
Win32_asio4all: {
|
||||
display: 'Windows ASIO4ALL',
|
||||
shortName : 'ASIO4ALL',
|
||||
videoURL: "https://www.youtube.com/watch?v=PGUmISTVVMY",
|
||||
showKnobs: false,
|
||||
showKnobs: true,
|
||||
showASIO: true
|
||||
},
|
||||
Linux: {
|
||||
|
|
|
|||
|
|
@ -177,21 +177,7 @@ StatsInfo = {
|
|||
audio_type = 'JamBlaster'
|
||||
audioStats.push(@stat(audio, 'audio', 'Gear Driver', 'audio_in_type', audio_type))
|
||||
if audio.framesize?
|
||||
framesize = '?'
|
||||
if audio.framesize == 1.0
|
||||
framesize = '1 ms'
|
||||
else if audio.framesize == 2.0
|
||||
framesize = '1 ms'
|
||||
else if audio.framesize == 2.5
|
||||
framesize = '2.5 ms'
|
||||
else if audio.framesize == 5
|
||||
framesize = '5 ms'
|
||||
else if audio.framesize == 10
|
||||
framesize = '10 ms'
|
||||
else if audio.framesize == 20
|
||||
framesize = '20 ms'
|
||||
else if audio.framesize == 40
|
||||
framesize = '40 ms'
|
||||
framesize = audio.framesize + ' ms'
|
||||
audioStats.push(@stat(audio, 'audio', 'Frame Size', 'framesize', framesize))
|
||||
|
||||
networkTag = null
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
var ADJUST_GEAR_LINK_CLICKED = 'frame_buffers.adjust_gear_settings_clicked';
|
||||
|
||||
function selectedFramesize() {
|
||||
return parseFloat($frameSize.val());
|
||||
var selectedFrameSize = parseFloat($frameSize.val());
|
||||
console.log("selected FrameSize: ", selectedFrameSize)
|
||||
return selectedFrameSize;
|
||||
}
|
||||
|
||||
function selectedBufferIn() {
|
||||
|
|
@ -67,6 +69,7 @@
|
|||
}
|
||||
|
||||
function switchToWdm() {
|
||||
/**
|
||||
if($frameSize.find('option').length == 3){
|
||||
console.log("switching to WDM framesizez")
|
||||
$frameSize.html('<option val="2.5">2.5</option><option val="5">5</option><option val="10">10</option><option val="20">20</option><option val="40">40</option>')
|
||||
|
|
@ -74,11 +77,12 @@
|
|||
}
|
||||
else {
|
||||
console.log("nothing to switch to on WDM")
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
function switchOffWdm() {
|
||||
/**
|
||||
if($frameSize.find('option').length != 3){
|
||||
console.log("switching off of WDM")
|
||||
$frameSize.html('<option val="2.5">2.5</option><option val="5">5</option><option val="10">10</option>')
|
||||
|
|
@ -86,7 +90,7 @@
|
|||
}
|
||||
else {
|
||||
console.log("nothing to clean up on WDM")
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -547,29 +547,46 @@
|
|||
|
||||
function onSampleRateChanged() {
|
||||
console.log("onSampleRateChanged: ", sampleRate.selectedSampleRate())
|
||||
context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']});
|
||||
//context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']});
|
||||
jamClient.FTUESetPreferredMixerSampleRate(sampleRate.selectedSampleRate());
|
||||
jamClient.FTUESetPreferredOutputSampleRate(sampleRate.selectedSampleRate());
|
||||
invalidateScore();
|
||||
safeAtttemptScore();
|
||||
}
|
||||
|
||||
function onFramesizeChanged() {
|
||||
context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']});
|
||||
//context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']});
|
||||
updateDefaultBuffers();
|
||||
jamClient.FTUESetFrameSize(frameBuffers.selectedFramesize());
|
||||
invalidateScore();
|
||||
safeAtttemptScore();
|
||||
}
|
||||
|
||||
function onBufferInChanged() {
|
||||
context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']});
|
||||
//context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']});
|
||||
jamClient.FTUESetInputLatency(frameBuffers.selectedBufferIn());
|
||||
invalidateScore();
|
||||
safeAtttemptScore()
|
||||
}
|
||||
|
||||
function onBufferOutChanged() {
|
||||
context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']});
|
||||
//context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']});
|
||||
jamClient.FTUESetOutputLatency(frameBuffers.selectedBufferOut());
|
||||
invalidateScore();
|
||||
safeAtttemptScore()
|
||||
}
|
||||
|
||||
function safeAtttemptScore() {
|
||||
scheduleRescanSystem(function() {
|
||||
if (getSelectedInputs().length > 0 && getSelectedOutputs().length == 2) {
|
||||
logger.debug("after rescan, ready to attempt score")
|
||||
attemptScore();
|
||||
}
|
||||
else {
|
||||
logger.debug("after rescan, not ready to attempt score")
|
||||
}
|
||||
}, 500, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
function getSelectedInputs() {
|
||||
|
|
@ -583,21 +600,12 @@
|
|||
function initializeResync() {
|
||||
$resyncBtn.unbind('click').click(function () {
|
||||
|
||||
if($highLatencyNotice) {
|
||||
if ($highLatencyNotice) {
|
||||
$highLatencyNotice.btOff()
|
||||
$highLatencyNotice = null;
|
||||
}
|
||||
|
||||
scheduleRescanSystem(function() {
|
||||
if (getSelectedInputs().length > 0 && getSelectedOutputs().length == 2) {
|
||||
logger.debug("after rescan, ready to attempt score")
|
||||
attemptScore();
|
||||
}
|
||||
else {
|
||||
logger.debug("after rescan, not ready to attempt score")
|
||||
}
|
||||
}, 3000, false);
|
||||
return false;
|
||||
safeAtttemptScore()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
.buffers {
|
||||
float:left;
|
||||
width:60%;
|
||||
display:none;
|
||||
|
||||
h2 {
|
||||
margin-left:5px;
|
||||
|
|
|
|||
|
|
@ -177,6 +177,20 @@
|
|||
.frame-and-buffers {
|
||||
display: none;
|
||||
margin-top: 5px;
|
||||
|
||||
.framesize {
|
||||
float:none;
|
||||
width:auto;
|
||||
margin-right:0;
|
||||
|
||||
.dropdown-wrapper.easydropdown-wrapper {
|
||||
width:73px;
|
||||
}
|
||||
}
|
||||
.framesize h2 {
|
||||
display:inline;
|
||||
margin-right:15px;
|
||||
}
|
||||
}
|
||||
|
||||
.audio-port {
|
||||
|
|
@ -723,7 +737,7 @@
|
|||
}
|
||||
.easydropdown-wrapper {
|
||||
width:auto;
|
||||
float:left;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
.frame-and-buffers
|
||||
.framesize
|
||||
h2 Frame
|
||||
h2 Frame Size:
|
||||
select.select-frame-size
|
||||
option val='1' 1
|
||||
option val='2' 2
|
||||
option val='2.5' 2.5
|
||||
option val='5' 5
|
||||
option val='10' 10
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ if defined?(Bundler)
|
|||
config.middleware.insert_before "ActionDispatch::Cookies", "Middlewares::ClearDuplicatedSession"
|
||||
config.network_test_required = false
|
||||
# how long should the frontend wait for the IO to stabilize before asking for a IO score?
|
||||
config.ftue_io_wait_time = 10
|
||||
config.ftue_io_wait_time = 5
|
||||
# what should the threshold be for us to say, 'this person can't play at this rate' during the network test
|
||||
config.ftue_packet_rate_treshold = 0.95
|
||||
# how long to test at each network test step
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ module JamWebsockets
|
|||
@maximum_minutely_heartbeat_rate_client = nil
|
||||
@gateway_name = nil
|
||||
@stored_ars = nil
|
||||
@stored_ars_beta = nil
|
||||
@ar_base_logger = ::Logging::Repository.instance[ActiveRecord::Base]
|
||||
@message_stats = {}
|
||||
@time_it_sums = {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue