Triang3l / WebQuake

HTML5/WebGL source port of Quake
623 stars 98 forks source link

Safari 6+ OS X Startup Error Number.isNaN(val) #8

Closed Yossa closed 11 years ago

Yossa commented 11 years ago

Can not start the Client application...

Error

Sys.js:25 Host.Init Q.js:115 TypeError: 'undefined' is not a function (evaluating 'Number.isNaN(val)'

Triang3l commented 11 years ago

Are you using the latest version of Safari?

Yossa commented 11 years ago

Yep Version 6.0.4 (8536.29.13)

This error accures on several machines with Safari 6.0.4, unfortunately i don't have any osx running lower version of Safari to test it

On Apr 22, 2013, at 3:41 PM, SiPlus notifications@github.com wrote:

Are you using the latest version of Safari?

— Reply to this email directly or view it on GitHub.

Triang3l commented 11 years ago

Can you try build 35? It's old and buggy, but it uses window.isNaN instead of newer Number.isNaN? If it works, I'll change Number.isNaN back to window.isNaN.

Yossa commented 11 years ago

I don't know if its a problem with my environment but I'm getting whole bunch of errors

Sys.js:25Host.Init http://10.1.5.5:21859/WebQuake/Client/id1/pak1.pakFailed to load resource: the server responded with a status of 404 (Not Found) http://10.1.5.5:21859/WebQuake/Client/id1/gfx/pop.lmpFailed to load resource: the server responded with a status of 404 (Not Found) Sys.js:25FindFile: can't find gfx/pop.lmp Sys.js:25PackFile: id1/pak0.pak : gfx.wad Sys.js:25PackFile: id1/pak0.pak : gfx/palette.lmp Sys.js:25PackFile: id1/pak0.pak : gfx/conback.lmp Sys.js:25PackFile: id1/pak0.pak : gfx/loading.lmp Sys.js:25PackFile: id1/pak0.pak : gfx/pause.lmp Sys.js:25PackFile: id1/pak0.pak : sound/ambience/water1.wav S.js:53TypeError: 'undefined' is not a function (evaluating 'S.context.createGain()')

On Apr 22, 2013, at 3:48 PM, SiPlus notifications@github.com wrote:

Can you try build 35? It's old and buggy, but it uses window.isNaN instead of newer Number.isNaN? If it works, I'll change Number.isNaN back to window.isNaN.

— Reply to this email directly or view it on GitHub.

Triang3l commented 11 years ago

Looks fixable. I'll add fallback to window.isNaN and old Web Audio function names. On Apr 22, 2013 5:55 PM, "Yossa" notifications@github.com wrote:

I don't know if its a problem with my environment but I'm getting whole bunch of errors

Sys.js:25Host.Init http://10.1.5.5:21859/WebQuake/Client/id1/pak1.pakFailed to load resource: the server responded with a status of 404 (Not Found) http://10.1.5.5:21859/WebQuake/Client/id1/gfx/pop.lmpFailed to load resource: the server responded with a status of 404 (Not Found) Sys.js:25FindFile: can't find gfx/pop.lmp Sys.js:25PackFile: id1/pak0.pak : gfx.wad Sys.js:25PackFile: id1/pak0.pak : gfx/palette.lmp Sys.js:25PackFile: id1/pak0.pak : gfx/conback.lmp Sys.js:25PackFile: id1/pak0.pak : gfx/loading.lmp Sys.js:25PackFile: id1/pak0.pak : gfx/pause.lmp Sys.js:25PackFile: id1/pak0.pak : sound/ambience/water1.wav S.js:53TypeError: 'undefined' is not a function (evaluating 'S.context.createGain()')

On Apr 22, 2013, at 3:48 PM, SiPlus notifications@github.com wrote:

Can you try build 35? It's old and buggy, but it uses window.isNaN instead of newer Number.isNaN? If it works, I'll change Number.isNaN back to window.isNaN.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/SiPlus/WebQuake/issues/8#issuecomment-16787392 .

Yossa commented 11 years ago

Sorry that i posted two times unformatted error texts, I was at work and had not time to check how it looks here.

Im looking forward to enjoy this project on os x safari.

Triang3l commented 11 years ago

I fixed those isNaN and createGain things, try now. Unfortunately, I don't have a Mac, so I can't test by myself. Do you have Google Talk?

Yossa commented 11 years ago

It does start up fine, only it doest get enough time to load all the resources such is demo1.dem or demo2.dem Extra page refresh and its all fine, most of the resources then come from the cache...

You need to load all this system files sequential e.g. wait for the first file is loaded then load the next one and so on, use something like onload attribute...

As far as i can tell sound is fine, mouse is there too only when i try to start new game i get "PR.LoadProgs: couldn't load progs.dat" on Sys.js line 47, is shareware version is enough to test it cuz I cant find the cd yet...

And some resources such is .ogg files throw 404 error u can make ur own error/load handler with "onload" and "onerror" attributes to avoid it.

Triang3l commented 11 years ago

1) Files are already loaded sequentially. 2) You probably have broken pak0.pak without progs.dat. The correct pak0.pak is 17 MiB in size. 3) 404 is not a JS exception, it's just unsuccessful HTTP return code. The console will always see it as an error, just to alert the developer about probably incorrect path or insufficient privileges. It's impossible (and pointless) to catch "errors" that exist only in the console. Also, I use sync XHR, not events.

Could you redownload the pak0.pak?

And did you see the "loading" image when loading a map?

Any graphics glitches?

Anyway, thanks for testing. On Apr 22, 2013 10:35 PM, "Yossa" notifications@github.com wrote:

It does start up fine, only it doest get enough time to load all the resources such is demo1.dem or demo2.dem

You need to load all this system files sequential e.g. wait for the first file is loaded then load the next one and so on, use something like onload attribute...

As far as i can tell sound is fine, mouse is there too only when i try to start new game i get "PR.LoadProgs: couldn't load progs.dat" on Sys.js line 47, is shareware version is enough to test it cuz I cant the cd yet...

And some resources such is .ogg files throw 404 error u can make ur own error/load handler with "onload" and "onerror" attributes to avoid it.

— Reply to this email directly or view it on GitHubhttps://github.com/SiPlus/WebQuake/issues/8#issuecomment-16812291 .

Yossa commented 11 years ago

Well I tried three different pak0.pak's and no luck, progs.dat not found. I tried pakexplorer and i see that there is a progs.dat file is in there but still not found error.

PR.LoadProgs: couldn't load progs.dat

when I start WebQuake with empty browser cache i get

W.LoadWadFile: couldn't load gfx.wad

Triang3l commented 11 years ago

Probably your web server doesn't respond to Range header well. Try Abyss, Apache or nginx. Or extract the pak file.

Yossa commented 11 years ago

I use apache and I tried with extracted pak file, same story...