Page 1 of 1

Server activity alerts

PostPosted: Sat Sep 21, 2013 11:19 am
by Cracatoa
What if we could install a tiny background program that would alert us whenever someone gets on ANY server on bitfighter, sort of like the alert on a dedicated server? That way whenever someone joins, BAM! whoever is at their computer at the time could join and that would solve the problem of people not being on at the same time.

If everyone who actively plays bitfigher installed something like that, one person could get on, and then suddenly there are four or five people depending on how many people are available/feel like playing at that time.

I could even make it if someone would tell me the proper hooks on the server to use to tell when someone joins.

Re: Server activity alerts

PostPosted: Sat Sep 21, 2013 2:55 pm
by kaen
That's in the works. There's a usable version here if you already have python installed: https://code.google.com/p/bitfighter/so ... repo=tools

Re: Server activity alerts

PostPosted: Mon Sep 23, 2013 9:49 am
by Cracatoa
Awesome.

Re: Server activity alerts

PostPosted: Tue Sep 24, 2013 12:52 pm
by sky_lark
I would be so happy to see a little icon that sat in my menu bar (mac) and lit up or played a sound whenever someone logged onto Bitfighter. Would definitely increase my attendance in-game. Glad to see it - or something similar - is on the todo list!

Re: Server activity alerts

PostPosted: Tue Sep 24, 2013 2:07 pm
by Fordcars
Sky-lark, Dashboard still exists in Osx Lion right? Maybe it would be good to have a Bitfighter widget?

Re: Server activity alerts

PostPosted: Fri Sep 27, 2013 12:45 pm
by sky_lark
Would a widget be able to communicate to me outside of Dashboard, though? I mentioned a menu bar app since that could run in the background and still alert me of new players.

Re: Server activity alerts

PostPosted: Sun Sep 29, 2013 2:44 am
by watusimoto
Perhaps some of you Mac people could try the notifier code that kaen linked to and give us some feedback (perhaps in a new thread). None of us devs uses a Mac enough to really know how well it works there.

BTW, I run this on my Linux desktop all day, and it seems to be pretty good.

Re: Server activity alerts

PostPosted: Sun Sep 29, 2013 8:12 am
by sky_lark
I'd be happy to, but I'm afraid I have no idea how to get this thing to run.

bobdaduck or quartz, maybe? Can't remember if you guys use Macs.

Re: Server activity alerts

PostPosted: Sun Sep 29, 2013 1:26 pm
by Fordcars
Oh it's just a python script. Download python and run :D
http://www.python.org/

Re: Server activity alerts

PostPosted: Sun Sep 29, 2013 7:31 pm
by watusimoto
I didn't fully realize the script was in a raw Python form. So yes, install Python from the link above, download the notifier code in some folder, then run (probably by double-clicking on) the mac specific python program.

If clicking doesn't work, open up a command window in the folder where the script lives and run with "python <script name>.py"

If it works, please post the steps you took (so we can document it and/or simplify it). If it doesn't work, please do the same (so we can diagnose the problem).

Thanks!

Re: Server activity alerts

PostPosted: Tue Oct 01, 2013 6:40 am
by sky_lark
Ok, I installed Python 3 and downloaded the "bitfighter-notifier-macosx" package under the bitfighter-notificer > gci directory on google code.

I ran the app somewhat successfully... it launched, albeit rather slowly, and its name was "IDLE". After launching, though, the app returned an error message looking like this:

http://i.imgur.com/A3rkZOB.png

Suggestions?

Re: Server activity alerts

PostPosted: Tue Oct 01, 2013 12:17 pm
by raptor
Hi sky_lark,

I have since updated (and fixed) that old GCI project. The real code to use is at the root of the repo, not in the 'gci' sub-directory. The file you want to run is 'main_osx.py':

  Code:
python main_osx.py


Also, you do not need to install any python because OSX should have it installed by default already, and the notifier works with python 2 and 3.

It runs on OSX 10.6+, but works best on OSX 10.8+. Sadly, there was some thread-blocking issue I couldn't resolve on 10.6/10.7, which it makes it not check for a new status if the notification alert has shown, until you close the alert.

And thanks for testing!

Re: Server activity alerts

PostPosted: Tue Oct 01, 2013 2:22 pm
by raptor
OK, looks like the OSX 10.8+ part doesn't work for some reason... I'm working on fixing it.

Re: Server activity alerts

PostPosted: Tue Oct 01, 2013 3:03 pm
by raptor
OK, it is fixed. Please get the latest from the repository. You too, Little_Apple :)

Re: Server activity alerts

PostPosted: Thu Oct 03, 2013 8:36 am
by sky_lark
I may (?) have gotten it to work? What's it supposed to look like? I downloaded the file, double clicked main_osx.py (seemed to work better than opening it via command line), and an app called IDLE opens and provides me with two text doc windows. One is titled "*Python 3.3.2 Shell*" and has a little "about info" of Python, and the other is "main_osx.py" with a bunch of code in it.

Re: Server activity alerts

PostPosted: Thu Oct 03, 2013 10:38 am
by Fordcars
The IDLE application is a Python IDE, an application to write Python code. I think you would need to find 'Run' or something in that application while the code is openned :)

Re: Server activity alerts

PostPosted: Thu Oct 03, 2013 10:58 am
by raptor
sky_lark,

You'll have to run it from the command-line, I think. In a terminal, go to the folder and type:

  Code:
python main_osx.py

Re: Server activity alerts

PostPosted: Thu Oct 03, 2013 11:13 am
by Fordcars
So:
  Code:
cd /path
python main_osx.py


For example:
  Code:
cd /Users/fordcars/Desktop/ActivityNotifierFolder
python main_osx.py

Re: Server activity alerts

PostPosted: Fri Oct 11, 2013 2:38 pm
by Whittling While
Every time I attempt to run the program, My terminal presents this line.

Traceback (most recent call last):
File "main_osx.py", line 3, in <module>
import objc
ImportError: No module named objc

Re: Server activity alerts

PostPosted: Sat Oct 12, 2013 4:57 am
by raptor
@ShadowX.loner

What OSX version are you running? I think it will only run on 10.6+

Re: Server activity alerts

PostPosted: Sat Oct 12, 2013 4:59 am
by Fordcars
Raptor, is that PyObjC?

EDIT: Yes, it is

Re: Server activity alerts

PostPosted: Sat Oct 12, 2013 10:52 am
by Whittling While
Ah, yep. That does it. I'm running on 1.7.5.
Ah well. Maybe I can test some other stuff you guys want some feedback on in the future.

Re: Server activity alerts

PostPosted: Sun Oct 13, 2013 4:15 am
by sky_lark
Okay, I ran it through Terminal, and here's what I get:

  Code:
Cookies-MacBook-Pro:~ Cookies$ cd /Users/Cookies/Downloads/tools.bitfighter-03e4dc5b83f0/bitfighter-notifier
Cookies-MacBook-Pro:bitfighter-notifier Cookies$ python main_osx.py
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/PyObjCTools/NibClassBuilder.py:73: DeprecationWarning: PyObjCTools.NibClassBuilder is deprecated, use explicit definitions instead
  warnings.warn("PyObjCTools.NibClassBuilder is deprecated, use explicit definitions instead", DeprecationWarning)
DEBUG:root:Attempting to load config: bitfighter-notifier-osx.ini
DEBUG:root:OSX!
DEBUG:root:major: 10; minor: 6
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON
DEBUG:root:Refreshing JSON


With that JSON message repeating over and over.

Re: Server activity alerts

PostPosted: Sun Oct 13, 2013 4:36 am
by Fordcars
That means it works! The JSON runs every 10 seconds, right?

Re: Server activity alerts

PostPosted: Sun Oct 13, 2013 5:27 am
by Whittling While
Am I right to think of JASON when I read that? That's essentially what this program is doing no?

Re: Server activity alerts

PostPosted: Sun Oct 13, 2013 6:12 am
by Fordcars
Totally, it's looking for JASON on Bitfighter.org

Re: Server activity alerts

PostPosted: Sun Oct 13, 2013 11:23 am
by sky_lark
Yeah, it's about ten seconds. So what should happen when someone joins?

Re: Server activity alerts

PostPosted: Sun Oct 13, 2013 1:46 pm
by kaen
You should get some sort of visible notification

Re: Server activity alerts

PostPosted: Sun Oct 13, 2013 1:51 pm
by Whittling While
Could one possibly mod it in such a way we get a soundbite yelling "JASON" upon that notification?

Re: Server activity alerts

PostPosted: Sun Oct 13, 2013 1:56 pm
by kaen
uh... yes, one could.

You just need some python knowledge and a sound file, then you'd use one of the builtin python audio modules to play it.

Re: Server activity alerts

PostPosted: Sun Oct 13, 2013 2:04 pm
by Whittling While
I may just teach myself basic coding just so I can do that.
It'd be worth every second.

Re: Server activity alerts

PostPosted: Sun Oct 13, 2013 4:10 pm
by raptor
OK everyone,

I fixed the OSX 10.6+ variation of the script. I also renamed it and merged all the code into ONE file found here:

https://tools.bitfighter.googlecode.com ... otifier.py

Enjoy! (complain, whatever)

Oh, I changed the refresh interval to check every 20 seconds... too slow? We don't want to hammer our server too much...