Lunation Studios

Child window not receiving permissions

Recommended Posts

Hey,

 

I recently faced a problem with the windows:

It happens when I try to do "overwolf.games.events.onInfoUpdates.addListener".

On my main window, this works and  the events get logged, but when I move the same code into one of the subchilds the code is never called and the following got logged into the console:



The property 'overwolf.games' requires the GameInfo permission.

But the permission is granted, otherwise I wouldnt get the events on the main window.

 

Please look over this.

 

Greetings

Share this post


Link to post
Share on other sites

I tested some more and I found that this BUG only happens with the new Version (90119) and not with the old (089630).

Please guys, something happend between these updates which makes it impossible to receive GameInfos with a child window.

 

Cmon give me some support...

Share this post


Link to post
Share on other sites

I tested some more and I found that this BUG only happens with the new Version (90119) and not with the old (089630).

Please guys, something happend between these updates which makes it impossible to receive GameInfos with a child window.

 

Cmon give me some support...

 

Hey Lunation Studios, Tsury from R&D here.

 

We are currently testing the issue, we will get back to you soon.

 

Thanks!

Share this post


Link to post
Share on other sites

I wasn't able to reproduce this issue with Overwolf 90.200+.

This version is currently available through the beta channel and will be released in a week or so.

 

Please post here if this issue persist for you on said version, you are also welcome to send your logs for me to inspect.

 

Thanks for the help and don't hesitate to post in the future!

 

Tsury.

Share this post


Link to post
Share on other sites

Hey guys,

I continued testing and found some more details:

 

It does work sometimes, but its very random-> I opened the app and it worked, I did nothing but restart and this time no events were received.

Second subject is the Array the onInfoUpdate methods fires. It should contain the name and the rank (Warface) and when there is a clan, also the clan. In the account i tested, there was a clan. But I also received Arrays that only contained name and rank. But complete OnInfoUpdate arrays, too.

 

But the weirdest thing is that this whole problems always happen in a small overlay window (child) and not in the main window.

I opened both consoles at one time, and the main console received the events while the child console got nothing.

 

Conclusion:

I think this entire issue is related to the warface api. How the arrays are structured and send seems totally random.

For the contest I will try to move the event handling from the child window to the main window, which is running in background.

 

Thanks anyway, maybe u find this bug one day.

 

PS: in console of the child window the gameinfo permission hint is still showing...

Share this post


Link to post
Share on other sites

I dont have this issue but I'll try to reproduce it tonight. At one point I had a similar issue because the API didn't/doesn't allow different listeners in different files to both get the info so one was being overwritten. Its been a while since I had this issue but it might be worth checking.

The Warface API has been working consistently for me.

Share this post


Link to post
Share on other sites

Pardon me if this suggestion has no place here,

But would it not be possible (and simpler) to handle all of the OverWolf event handling in the main window, and send the received data through sharedworkers to child windows, or localStorage events?

 

I found a decent demo of sharedworkers here (open this page in two windows, hit 'send' to update each page).

 

 

I'm not sure if either would fit your use case, but it's worth sharing.

Share this post


Link to post
Share on other sites

Pardon me if this suggestion has no place here,

But would it not be possible (and simpler) to handle all of the OverWolf event handling in the main window, and send the received data through sharedworkers to child windows, or localStorage events?

 

I found a decent demo of sharedworkers here (open this page in two windows, hit 'send' to update each page).

 

 

I'm not sure if either would fit your use case, but it's worth sharing.

 

Thats the first time I heard of "Sharedworkers", seems quite interesting.

Yesterday I tried to pass the events with localstorage.

 

Mainwindow receives the event and writes down 2 keys in localStorage (name: event_name, value:event_value).

Child window got something like this

$(window).bind('storage', function (e) {
console.log("STORAGE CHANGED!")  });

So when this function is called, you just have to getItem(name) and getItem(value).

After you retrieved the infos, I would recommend to clear the Storage to prevent getting old events.

 

And I will definitely look into this webworker stuff.

Share this post


Link to post
Share on other sites

Be careful, as WebWorker is a html5 function for splitting off work into 'threads', for lack of better explanation.

You'd want SharedWorkers. You'll find both in searches for SharedWorkers, confusingly enough.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now