[?] Server interaction with mumble

Making or wanting help making your own asset? Check in here
piepieonline
Retired PR Developer
Posts: 433
Joined: 2009-07-22 00:41

[?] Server interaction with mumble

Post by piepieonline »

So basically, I'm looking into the possibility of raising an in game alert when a player joins without mumble. What I was wondering, is there an API or anything exposed that is available to python scripts to list connected players?

Thanks, Pie
Image
BloodyDeed
Retired PR Developer
Posts: 4452
Joined: 2008-05-07 17:43

Post by BloodyDeed »

Thats not possible with the current mumble server version, at least thats we were told by the mumble dev.
All the joining/switching is done clientside. The server does not know if people are in mumble.
Which makes things even harder is that mumble and gameserver are 2 different machines.
Last edited by BloodyDeed on 2012-02-15 01:37, edited 1 time in total.
Image
piepieonline
Retired PR Developer
Posts: 433
Joined: 2009-07-22 00:41

Re: [?] Server interaction with mumble

Post by piepieonline »

Yea, I know they are different machines - I have access to our PR server, but not the mumble server.

Hmm... Would, in theory, a custom client be able to pull the names? I'm assuming it could, but is it alright to have a client 'afk' in our mumble channel?

EDIT: I found this: http://mumble.sourceforge.net/Channel_Viewer_Protocol
Just in case somebody finds this thread later...

Ok, another question, is 'Mumo' what PRMumble uses? It would seem to be, as the wiki states that it can auto move players around, with the specific example of bf2?
Last edited by piepieonline on 2012-02-07 08:21, edited 1 time in total.
Image
AfterDune
Retired PR Developer
Posts: 17094
Joined: 2007-02-08 07:19

Re: [?] Server interaction with mumble

Post by AfterDune »

Names in Mumble are often different from the ones used in-game. Since you want it automated, I guess it would be OK if you compare IP-addresses. In most cases (not all) it's fine to say: one player = one IP.

If you compare the IPs of the connected players on the server to the IPs of the players connected to your server's Mumble-channel, it would be a great start.

I can imagine someone making a script that outputs a list of playernames + IPs from the Mumble-channel of your choice. This has to run every x seconds/minutes to keep it up-to-date.
Python reads this file after someone enters a "!checkmumble" command (or whatever, just made that up). The Python script compares the IPs and outputs the (ingame) names of the players not on Mumble.

I personally wouldn't go as far as auto-kicking, 'cause that would mean the script has to check it every x seconds, etc, etc, etc.
Image
piepieonline
Retired PR Developer
Posts: 433
Joined: 2009-07-22 00:41

Re: [?] Server interaction with mumble

Post by piepieonline »

Yea, I was only thinking of warning admins - Like a mod we have at the moment, that warns admins that a vehicle has crashed without being shot.
Yea, I can see what your saying. The main thing I'm asking here is a way to read into the mumble server, but I'm thinking it will have to be a custom client.
As for pulling IP's, that isn't looking possible in the official client, so I think I will just have to name match. It will output a lot of false positives, but it's still easier than trying to manually enforce it.
Image
lucky.BOY
Posts: 1438
Joined: 2010-03-03 13:25

Re: [?] Server interaction with mumble

Post by lucky.BOY »

I dont think it can work with comparing names. Compare in-game names of a full server with its mumble channel, (with clan tags). You can count exactly corresponding names on your fingers.

-lucky
piepieonline
Retired PR Developer
Posts: 433
Joined: 2009-07-22 00:41

Re: [?] Server interaction with mumble

Post by piepieonline »

Honestly, I think the biggest problem is find how to pull the data from mumble. Once you have that data, you can adjust the conditions, so you can check if names are present, or if the entire squad is in mumble, etc, etc.
So yea, for now my problem is trying to pull the data in the first place.
Image
kerrermanisNL
Posts: 65
Joined: 2011-01-04 07:52

Re: [?] Server interaction with mumble

Post by kerrermanisNL »

Not sure if this is even possible but I'm just throwing an idea out there.
Instead of using names to check you might be able to check certain squads for instance (might pose a problem with people who aren't in a squad) a squad has 4 members, but on mumble there are only 3 members in that specific squad channel. You could than retrieve the names from the specific mumble channel and compare them manually to the PR squad (list them with a command, i.e. !ShowMumblers team1 squad1 - output: player1, player 2, player 3) and figure out which one is not on mumble (quite a hassle I know, but you might use that IP check for that)

Hope that doesnt sound entirely retarded :p

-edit
Sorry don't know how to get data from mumble, I guess that was your question
What's this?
Cohiba Esplandido, sir. Are you confiscating my cigar sir?
This cigar doesn't belong to you, it belongs to the army.

Image
piepieonline
Retired PR Developer
Posts: 433
Joined: 2009-07-22 00:41

Re: [?] Server interaction with mumble

Post by piepieonline »

Yea, that's along the lines of what i was thinking :P

DEVs/mumble admins - any chance of a PRSPY for mumble?
Image
Rincewind
Posts: 14
Joined: 2011-01-12 17:05

Re: [?] Server interaction with mumble

Post by Rincewind »

Mumble is open-source. So there is a quick solution: write your own client(bot) with basic features (joining server, receiving join/leave packets, ignoring anything else) and you will have all nicknames, then run it on a server and check em in any way.
Last edited by Rincewind on 2012-02-12 21:42, edited 1 time in total.
piepieonline
Retired PR Developer
Posts: 433
Joined: 2009-07-22 00:41

Re: [?] Server interaction with mumble

Post by piepieonline »

Yea, I did look at that. To be honest, I don't think I'm up to it. Although, is there documents I can read without having to find the relevant areas in the code? This code is damn confusing...

EDIT: Interesting definition of quick :P
Image
MaSSive
Posts: 4502
Joined: 2011-02-19 15:02

Re: [?] Server interaction with mumble

Post by MaSSive »

What about forcing players to register on mumble with their ingame username and make a condition so they cant stay on server if they are not found in mumble server.

Example:

User is registered on PRMumble as Tomm. Tomm connects to PR server which has mumble support and script which is running on server checks on player join, if Tomm is connected on Mumble server. Player Tomm is found on Mumble server and script greets him ( whatever :-P )

Second scenario would be if Tomm is not registered on Mumble, or not under that name, and connects to PRMumle supported server with some other name. Script checks, and doesn't finds Tomm in Mumble server, so issues a few warnings, in some time interval, and then kicks him for <reason>

If this can be customized or turned off or on by server admins trough admin script even better.

Now I'm not programmer and I have no clue if this can work or not, but I used some logic here. Apologies if I said something that's technically impossible.
Image
CATA4TW!

"People never lie so much as before an election, during a war, or after a hunt."
"God has a special providence for fools, drunks, and the United States of America."
― Otto von Bismarck
sylent/shooter
Posts: 1963
Joined: 2009-04-10 18:48

Re: [?] Server interaction with mumble

Post by sylent/shooter »

It sounds like aggregation :/ really confusing stuff AFAIK. Is what you want to do anyways. A script in python would probably be possible but don't hold me to that. I like good old .rfa coding xD it sure would be helpful though to see if this was the case.

But a thought just occured to me. Would there be any way to link our EA account through the PR engine (.exe file) into mumble so that it is automatically connected? There has to be some sort of way that it's connecting to PR in the first place so maybe if we use that same sort of knowledge. Of course it's a theory and god only knows how many legal dogs EA might have around that issue xD

Killing the enemy sylently
AncientMan
Retired PR Developer
Posts: 5111
Joined: 2007-05-22 07:42

Re: [?] Server interaction with mumble

Post by AncientMan »

https://www.realitymod.com/mumble/players.json

Should be all the data that's required for this :) . Just lists the ip's of users that are in the game channels. Going off names is a bad idea because the mumble names differ from ingame names. I guess there could be problems if there's 2 players with the same IP, but it's up to you how you want to handle that possible case.

The format is just standard json, if another format is required, I guess let me know, but json's pretty standard and easy to use... Just run it through a prettyfier if you want to see the structure easier.

That data will be updated every minute. Then in bf2 python you'd just get that data, parse it, get the user ip's for your server ip/port, and compare it against the ip's of the players connected to your server. If a person isn't in the list, do something about it :)

But yeah, just remember the data source could stop working at any time, and it only updates every minute (it's not realtime), so just kicking users straight off is probably a bad idea. I reckon it'd be better to just warn an admin after a delay of a few minutes (using adframework?), and they can deal with it. Of course, if you wanted to go fully automated you could, but any problems that arise from that is your problem

Oh and in reply to sylent/shooter, PR:BF2 1.0 will have auto joining mumble as a launch option (if you've got it installed)
Last edited by AncientMan on 2012-02-14 06:29, edited 2 times in total.
Image
Rincewind
Posts: 14
Joined: 2011-01-12 17:05

Re: [?] Server interaction with mumble

Post by Rincewind »

I've seen about 10 players with the same IP once.
Just make mubmle client to use ingame nickname automatically. Or check part of name - most of them are simplified ingame name and it should work. There is no reason to use different nick and refuse to change it for playing on server, after all.
KiloJules
Posts: 792
Joined: 2011-03-17 18:03

Re: [?] Server interaction with mumble

Post by KiloJules »

First off: Thanks for your work here! Hope you can achieve sth. as it would make admin work easier and therefore make the game better for everyone!

---------

If comparing the in-game names is the easiest or maybe even the only option I would also say that you (as in any server admin of a mumble mandatory server) could ask the player base to use their in-game name to connect to mumble! That would really not be to much to ask!!!
piepieonline
Retired PR Developer
Posts: 433
Joined: 2009-07-22 00:41

Re: [?] Server interaction with mumble

Post by piepieonline »

Ahh my god, thanks so much Ancient!! Yeah, I can definitely work with this, this is so much easier than the python bot client I was working on...

Questions: I have seen JSON data sources from you guys before, in particular, http://realitymodfiles.com/egor/currentplayers.jsonp and the current servers one. Now, my questions are:
A. Do you stop updating these at some stage? Because the one above appears to be frozen.
B. If so, when? And is it possible to restore the ones above?
Thankyou again!


Quick note: To anyone else who tries to do this, remember that BF2 python cannot, as far as I can tell, load web pages, due to the module not existing.
Last edited by piepieonline on 2012-02-14 22:59, edited 2 times in total.
Reason: Spelling/Grammer fail
Image
AncientMan
Retired PR Developer
Posts: 5111
Joined: 2007-05-22 07:42

Re: [?] Server interaction with mumble

Post by AncientMan »

Moved to: https://www.realitymod.com/prspy/currentplayers.jsonp / currentservers.jsonp

But these are padded json files made for PRSPY, would have to do some pre-parsing in order for it to work in some other program (remove PRSPY.getPlayers function and replace it with array notation). Again, updated every minute, not realtime.
Image
piepieonline
Retired PR Developer
Posts: 433
Joined: 2009-07-22 00:41

Re: [?] Server interaction with mumble

Post by piepieonline »

Ah, thankyou. Yea, it's not my code that's using it, but just a implementation of someone elses.

Although, with both sources online... I could make an addition to my website admin panel... Thanks!

Also, may not be worth the effort, but maybe replace the content of the old files with "Moved to: "?

Ahaha, of course, I start trying to use the data from PRSPY.. It goes down :P
Last edited by piepieonline on 2012-02-14 14:26, edited 1 time in total.
Image
Post Reply

Return to “PR:BF2 Community Modding”