meh

Mumble Link plugin released

Recommended Posts

This. Is. BRILLIANT!

 

Thank you so much for this!

Finally no more relying on 3rd party apps to get the position data :D

 

Yeah, I'm going to write a blog post about it because it's been a real adventure trying to get this to work.

Share this post


Link to post
Share on other sites

Ok, i've played around with it for a while now and it works like a charm. I've found some weird bug which seems to be caused by scripts which insert script tags directly to the DOM while the page loads, e.g. like google maps does. Just take your example and add the gmaps script tag to it like so (or in my case also prototype/scriptaculos):

<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js"></script>
<script src="https://maps.googleapis.com/maps/api/js"></script>
and you'll get randomly either display errors like flickers/blinking or you'll just get an error like this:

Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'snapshot'

However, I'd love to see this feature implemented directly in Overwolf, so that we can access this data via the Overwolf API like i've requested over here http://feedback.overwolf.com/forums/235154-feature-requests/suggestions/5262764-mumble-integration ages ago. Do it, Overwolf devs! Now you have a proof of concept! ;)

Edited by Smiley

Share this post


Link to post
Share on other sites

This thread is full of win, I don't even care if it actually works (jk) :)

I'll get some engineering perspective on the outcome and either integrate these (unless you're against it), or at least link to the git on our documentation.

 

GG WP

Share this post


Link to post
Share on other sites

Ok, i've played around with it for a while now and it works like a charm. I've found some weird bug which seems to be caused by scripts which insert script tags directly to the DOM while the page loads, e.g. like google maps does. Just take your example and add the gmaps script tag to it like so (or in my case also prototype/scriptaculos):

<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js"></script>
<script src="https://maps.googleapis.com/maps/api/js"></script>
and you'll get randomly either display errors like flickers/blinking or you'll just get an error like this:

Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'snapshot'
However, I'd love to see this feature implemented directly in Overwolf, so that we can access this data via the Overwolf API like i've requested over here http://feedback.overwolf.com/forums/235154-feature-requests/suggestions/5262764-mumble-integration ages ago. Do it, Overwolf devs! Now you have a proof of concept! ;)

 

 

You could try deferring the insertion of the <embed> tag after all the dependencies have loaded.

 

 

This thread is full of win, I don't even care if it actually works (jk) :)

I'll get some engineering perspective on the outcome and either integrate these (unless you're against it), or at least link to the git on our documentation.

 

GG WP

 

I'm not against either.

Share this post


Link to post
Share on other sites

You could try deferring the insertion of the <embed> tag after all the dependencies have loaded.

I've tried basically everything now. I was even so desperate that i've restarted my pc (which i normally do only once a month on m$ patchday...). After restarting, your example app worked again, but only that one - even the copy of it which i put into my project folder didn't work. The plugin was loaded in all cases, but i got that "#<HTMLEmbedElement> has no method 'snapshot'" error.

So that's my "prototypified" example:

<!DOCTYPE html>
<html id="page" dir="ltr" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<title>Mumble Link</title>
	<style>
		#mumble{
			width: 0;
			height: 0;
			margin: 0;
			padding: 0;
		}
	</style>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js"></script>
<script>
	(function(){
		navigator.plugins.refresh(true);
		console.log(navigator.mimeTypes["application/x-mumble-link"]);

		document.observe('dom:loaded', function(){
			var mumbleObject = new Element('object', {
				'id': 'mumble',
				'type': 'application/x-mumble-link'
			});

			$$('body')[0].insert({'bottom': mumbleObject});

			var locationSender = function(){
				if(navigator.mimeTypes["application/x-mumble-link"].enabledPlugin){
					var mumble = mumbleObject.snapshot();
					var mod = function(a, B){
						return a < 0 ? a+b : a;
					};
					// GW2 Location sender compatible data block
					var data = {
						avatar_position: [
							mumble.avatar.position.x*39.3701,
							mumble.avatar.position.z*39.3701
						],
						avatar_front: Math.round(mod(Math.atan2(mumble.avatar.front.z, mumble.avatar.front.x)*180/Math.PI, 360)),
						character_data: mumble.identity === '' ? {} : mumble.identity.evalJSON(true),
						build: 0,
						account_name: '',
						guild_id: '',
						channel_id: '',
						tracking: 0
					};

					console.log(data);
					//new Ajax.Request('...');
				}
			};

			locationSender.delay(1);
			new PeriodicalExecuter(locationSender, 10);
		});
	})();
</script>
</body>
</html>
Edited by Smiley

Share this post


Link to post
Share on other sites

Try adding `width: 0, height: 0` to the options when creating the element. Also try removing any styling on it and see if it works.

Edited by meh

Share this post


Link to post
Share on other sites

Ok, this is totally weird, because i've tested exactly that in your example app and it worked o.O.

So it works again and i hope it does as long until it's implemented natively in Overwolf.

Thanks for the hint! (above code updated)

Share this post


Link to post
Share on other sites

Ok, this is totally weird, because i've tested exactly that in your example app and it worked o.O.

So it works again and i hope it does as long until it's implemented natively in Overwolf.

Thanks for the hint! (above code updated)

 

Cool, if you hit other problems just tell me.

 

EDIT: verified it's the `display: none`, if the plugin isn't displayed the browser unloads it, or something. Use `position: absolute; top: -5px; left: -5px` to hide it and it works.

Edited by meh

Share this post


Link to post
Share on other sites

Cool, if you hit other problems just tell me.

 

EDIT: verified it's the `display: none`, if the plugin isn't displayed the browser unloads it, or something. Use `position: absolute; top: -5px; left: -5px` to hide it and it works.

Thanks for checking this back. "visibility: hidden;" doesn't work either. I solved it now by just adding the container to the bottom of the page.

Code above updated again. (you can actually use this as reference implementation)

Edited by Smiley

Share this post


Link to post
Share on other sites

 

I keep getting the error "Cannot read property position of undefined" while if I try alert(document.getElementById('mumble')) I get a HTMLElement object.

 

 

I'm running into this issue as well. I've found that if I try to load my app, it can't load the plugin.  However, if I load the sample app, everything works fine.  Curiously enough, if I load the sample app, uninstall it, rename my app to match the name and author of the sample app, and then load my app (without restarting GW2 and Overwolf), everything works.

I'm on Windows 8.1 64bit.  The fact that the sample app works, but nothing else works bothers me.  Any ideas on why this happens?

Share this post


Link to post
Share on other sites

I'm running into this issue as well. I've found that if I try to load my app, it can't load the plugin.  However, if I load the sample app, everything works fine.  Curiously enough, if I load the sample app, uninstall it, rename my app to match the name and author of the sample app, and then load my app (without restarting GW2 and Overwolf), everything works.

I'm on Windows 8.1 64bit.  The fact that the sample app works, but nothing else works bothers me.  Any ideas on why this happens?

 

Make sure the <embed> tag has all the attributes you see in the example, and possibly in that order. Then make sure the <embed> tag isn't hidden by CSS in some way, I added some notes about that in the README.

 

Also make sure you listed it in the manifest.json.

Edited by meh

Share this post


Link to post
Share on other sites

I'm running into this issue as well. I've found that if I try to load my app, it can't load the plugin.  However, if I load the sample app, everything works fine.  Curiously enough, if I load the sample app, uninstall it, rename my app to match the name and author of the sample app, and then load my app (without restarting GW2 and Overwolf), everything works.

I'm on Windows 8.1 64bit.  The fact that the sample app works, but nothing else works bothers me.  Any ideas on why this happens?

Read on from a few posts above where i had basically the same problem. http://forums.overwolf.com/index.php?/topic/3043-mumble-link-plugin-released/?p=12250

However, i'm on Win7/64, dunno if this makes any difference.

Edited by Smiley

Share this post


Link to post
Share on other sites

Read on from a few posts above where i had basically the same problem. http://forums.overwolf.com/index.php?/topic/3043-mumble-link-plugin-released/?p=12250

However, i'm on Win7/64, dunno if this makes any difference.

 

I had read through your post and attempted to use your updated code snippet. I don't doubt that it's working for you, but it's not loading the plugin either.

 

Make sure the <embed> tag has all the attributes you see in the example, and possibly in that order. Then make sure the <embed> tag isn't hidden by CSS in some way, I added some notes about that in the README.

 

Also make sure you listed it in the manifest.json.

 

Yep, I tried that, but to no avail.

Share this post


Link to post
Share on other sites

I had read through your post and attempted to use your updated code snippet. I don't doubt that it's working for you, but it's not loading the plugin either.

 

 

Yep, I tried that, but to no avail.

 

If the sample app works it means the problem is in either how you're using it or how you setup the manifest.

 

Without the code or a reduced testcase with which I can reproduce it, I can't help you.

Share this post


Link to post
Share on other sites

tl;dr Well, I'm a moron.

 

I fixed it.  After lots of trial and error with the manifest and index.html page, I finally managed to figure it out. Here's a few things worth noting:

  1. The "plugins" property is a child of the "data" property in the manifest. I had it off of the root for the longest time. However, I was still able to make things work in certain cases because...
  2. If one Overwolf extension loads a plugin, you can uninstall the extension, reinstall an entirely different extension by the same name in its place and use the plugin from before without needing a proper reference to it from your extension.
  3. Overwolf doesn't care if extraneous properties are present in your manifest.json. You can do it and it won't tell you.

Regardless, thank you so much for making this plugin. It's fantastic!

Share this post


Link to post
Share on other sites

tl;dr Well, I'm a moron.

 

Regardless, thank you so much for making this plugin. It's fantastic!

 

Shit happens, you're welcome.

 

Also released a new version which implements enumeration of properties, which allows waaay nicer inspection in the developer tools.

 

post-6579-0-03228800-1409527333_thumb.pn

Edited by meh

Share this post


Link to post
Share on other sites

Small suggestion, since you're into making things nice and friendly. Any chance you want to make the plugin async?

 

There's no need to make it asynchronous, the access to the mumble link data is instant, it would take more time to dispatch the function to be called asynchronously than to return the value.

Share this post


Link to post
Share on other sites

Ow, okay.

I've had almost zero experience with Mumble. I can just say that from our experience with TS, running async made the experience a lot smoother.

If you say this works even better than async, I'll take your word for it. Good job yet again!

Share this post


Link to post
Share on other sites

Ow, okay.

I've had almost zero experience with Mumble. I can just say that from our experience with TS, running async made the experience a lot smoother.

If you say this works even better than async, I'll take your word for it. Good job yet again!

 

It's all O(1), the whole process of accessing a property on the Mumble Link is a pointer access.

Share this post


Link to post
Share on other sites

Shit happens, you're welcome.

 

Also released a new version which implements enumeration of properties, which allows waaay nicer inspection in the developer tools.

 

attachicon.gif.pagespeed.ce.hPGJFKgqtP.gwuSHB7W.png

 

Yo Meh!,

 

Seeing the new update you posted I think you're also working on the Overwolf GW2 WvW app challenge right?

 

I was wondering!: As you might have noticed the world ID isn't the same as the World ID used in the GW2 API (which is broke but the backups for example Far Shiverpeaks is 2007, but I can't find that world anywhere.

 

If there's anything I can do for you feel free to ask! Even as rivals I think it would be nice to help each other:P

 

Laters!

Share this post


Link to post
Share on other sites

Cool, now if you beat me at the contest I deserve some -40% condi duration food :P

 

 

Tell me more about this, it may be some issue with the conversion.

 

 

You're welcome.

hahahah I'll buy you that condition food! No worries! You better tell me when you won everything!

 

Also!:P I don't mind sharing some money with you if I win:P

Share this post


Link to post
Share on other sites

Yo Meh!,

 

Seeing the new update you posted I think you're also working on the Overwolf GW2 WvW app challenge right?

 

Yeah, I had finished mine a week before ArenaNet announced their special prize, I had no intention of participating in the general one so it was funny enough to get a special category.

 

 

I was wondering!: As you might have noticed the world ID isn't the same as the World ID used in the GW2 API (which is broke but the backups for example Far Shiverpeaks is 2007, but I can't find that world anywhere.

 

Since megaservers were introduced the world_id in the Mumble Link interface has been broken.

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