* VRFS-3914 - update jamblaster serial no if present

This commit is contained in:
Seth Call 2016-02-03 11:18:47 -06:00
parent ce6377377b
commit 7fc4376236
3 changed files with 24 additions and 0 deletions

View File

@ -657,6 +657,7 @@
client_type: isClientMode() ? context.JK.clientType() : 'latency_tester',
client_id: isClientMode() ? (gon.global.env == "development" ? $.cookie('client_id') : null): context.jamClient.clientID,
os: context.JK.GetOSAsString(),
jamblaster_serial_no: context.PlatformStore.jamblasterSerialNo(),
udp_reachable: context.JK.StunInstance ? !context.JK.StunInstance.sync() : null // latency tester doesn't have the stun class loaded
}

View File

@ -6,10 +6,23 @@ logger = context.JK.logger
{
logger: context.JK.logger
os: null
serial_no: null
init: ->
this.listenTo(context.AppStore, this.onAppInit)
jamblasterSerialNo: () ->
if @serial_no?
return @serial_no
if context.jamClient.jamBlasterSerialNo
@serial_no = context.jamClient.jamBlasterSerialNo()
else
@serial_no= false
@serial_no
onAppInit: (@app) ->
@os = context.jamClient.GetOSAsString()
this.trigger({os: @os, isWindows: @isWindows()})

View File

@ -690,6 +690,7 @@ module JamWebsockets
client_type = options["client_type"]
os = options["os"]
udp_reachable = options["udp_reachable"].nil? ? true : options["udp_reachable"] == 'true'
jamblaster_serial_no = options["jamblaster_serial_no"]
client.subscriptions = Set.new# list of subscriptions that this client is watching in real-time
@ -708,6 +709,15 @@ module JamWebsockets
client_id = UUIDTools::UUID.random_create.to_s
end
# we have to deal with jamblaster before login
if jamblaster_serial_no
jamblaster = Jamblaster.find_by_serial_no(jamblaster_serial_no)
if jamblaster
jamblaster.client_id = client_id
jamblaster.save
end
end
user = valid_login(username, password, token, client_id)
# protect against this user swamping the server