FAQ  •  Register  •  Login

Server activity alerts

<<

Cracatoa

User avatar

Posts: 292

Joined: Sun Apr 18, 2010 2:39 pm

Location: In your attic

Post Sat Sep 21, 2013 11:19 am

Server activity alerts

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.
The bottom statement is false.
The top statement is true.
<<

kaen

User avatar

Posts: 209

Joined: Thu Jun 14, 2012 11:54 am

Post Sat Sep 21, 2013 2:55 pm

Re: Server activity alerts

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
bobdaduck wrote:Next, the moon!

└────────┘
⎈⎈⎈⎈
┌────────┐
<<

Cracatoa

User avatar

Posts: 292

Joined: Sun Apr 18, 2010 2:39 pm

Location: In your attic

Post Mon Sep 23, 2013 9:49 am

Re: Server activity alerts

Awesome.
The bottom statement is false.
The top statement is true.
<<

sky_lark

User avatar

Posts: 2053

Joined: Wed Mar 10, 2010 6:00 pm

Post Tue Sep 24, 2013 12:52 pm

Re: Server activity alerts

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!
Follow Bitfighter! FacebookTwitterDiscord
<<

Fordcars

User avatar

Posts: 1016

Joined: Fri Apr 20, 2012 3:51 pm

Location: Some city, somewhere

Post Tue Sep 24, 2013 2:07 pm

Re: Server activity alerts

Sky-lark, Dashboard still exists in Osx Lion right? Maybe it would be good to have a Bitfighter widget?
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.
<<

sky_lark

User avatar

Posts: 2053

Joined: Wed Mar 10, 2010 6:00 pm

Post Fri Sep 27, 2013 12:45 pm

Re: Server activity alerts

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.
Follow Bitfighter! FacebookTwitterDiscord
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sun Sep 29, 2013 2:44 am

Re: Server activity alerts

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.
<<

sky_lark

User avatar

Posts: 2053

Joined: Wed Mar 10, 2010 6:00 pm

Post Sun Sep 29, 2013 8:12 am

Re: Server activity alerts

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.
Follow Bitfighter! FacebookTwitterDiscord
<<

Fordcars

User avatar

Posts: 1016

Joined: Fri Apr 20, 2012 3:51 pm

Location: Some city, somewhere

Post Sun Sep 29, 2013 1:26 pm

Re: Server activity alerts

Oh it's just a python script. Download python and run :D
http://www.python.org/
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sun Sep 29, 2013 7:31 pm

Re: Server activity alerts

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!
<<

sky_lark

User avatar

Posts: 2053

Joined: Wed Mar 10, 2010 6:00 pm

Post Tue Oct 01, 2013 6:40 am

Re: Server activity alerts

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?
Follow Bitfighter! FacebookTwitterDiscord
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Tue Oct 01, 2013 12:17 pm

Re: Server activity alerts

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!
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Tue Oct 01, 2013 2:22 pm

Re: Server activity alerts

OK, looks like the OSX 10.8+ part doesn't work for some reason... I'm working on fixing it.
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Tue Oct 01, 2013 3:03 pm

Re: Server activity alerts

OK, it is fixed. Please get the latest from the repository. You too, Little_Apple :)
<<

sky_lark

User avatar

Posts: 2053

Joined: Wed Mar 10, 2010 6:00 pm

Post Thu Oct 03, 2013 8:36 am

Re: Server activity alerts

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.
Follow Bitfighter! FacebookTwitterDiscord
<<

Fordcars

User avatar

Posts: 1016

Joined: Fri Apr 20, 2012 3:51 pm

Location: Some city, somewhere

Post Thu Oct 03, 2013 10:38 am

Re: Server activity alerts

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 :)
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Thu Oct 03, 2013 10:58 am

Re: Server activity alerts

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
<<

Fordcars

User avatar

Posts: 1016

Joined: Fri Apr 20, 2012 3:51 pm

Location: Some city, somewhere

Post Thu Oct 03, 2013 11:13 am

Re: Server activity alerts

So:
  Code:
cd /path
python main_osx.py


For example:
  Code:
cd /Users/fordcars/Desktop/ActivityNotifierFolder
python main_osx.py
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.
<<

Whittling While

User avatar

Posts: 235

Joined: Wed Apr 07, 2010 10:22 am

Location: Minnesota

Post Fri Oct 11, 2013 2:38 pm

Re: Server activity alerts

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
Premier Cloaker
"Time is an illusion; lunchtime, dually so."
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Sat Oct 12, 2013 4:57 am

Re: Server activity alerts

@ShadowX.loner

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

Fordcars

User avatar

Posts: 1016

Joined: Fri Apr 20, 2012 3:51 pm

Location: Some city, somewhere

Post Sat Oct 12, 2013 4:59 am

Re: Server activity alerts

Raptor, is that PyObjC?

EDIT: Yes, it is
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.
<<

Whittling While

User avatar

Posts: 235

Joined: Wed Apr 07, 2010 10:22 am

Location: Minnesota

Post Sat Oct 12, 2013 10:52 am

Re: Server activity alerts

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.
Premier Cloaker
"Time is an illusion; lunchtime, dually so."
<<

sky_lark

User avatar

Posts: 2053

Joined: Wed Mar 10, 2010 6:00 pm

Post Sun Oct 13, 2013 4:15 am

Re: Server activity alerts

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.
Follow Bitfighter! FacebookTwitterDiscord
<<

Fordcars

User avatar

Posts: 1016

Joined: Fri Apr 20, 2012 3:51 pm

Location: Some city, somewhere

Post Sun Oct 13, 2013 4:36 am

Re: Server activity alerts

That means it works! The JSON runs every 10 seconds, right?
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.
<<

Whittling While

User avatar

Posts: 235

Joined: Wed Apr 07, 2010 10:22 am

Location: Minnesota

Post Sun Oct 13, 2013 5:27 am

Re: Server activity alerts

Am I right to think of JASON when I read that? That's essentially what this program is doing no?
Premier Cloaker
"Time is an illusion; lunchtime, dually so."
<<

Fordcars

User avatar

Posts: 1016

Joined: Fri Apr 20, 2012 3:51 pm

Location: Some city, somewhere

Post Sun Oct 13, 2013 6:12 am

Re: Server activity alerts

Totally, it's looking for JASON on Bitfighter.org
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.
<<

sky_lark

User avatar

Posts: 2053

Joined: Wed Mar 10, 2010 6:00 pm

Post Sun Oct 13, 2013 11:23 am

Re: Server activity alerts

Yeah, it's about ten seconds. So what should happen when someone joins?
Follow Bitfighter! FacebookTwitterDiscord
<<

kaen

User avatar

Posts: 209

Joined: Thu Jun 14, 2012 11:54 am

Post Sun Oct 13, 2013 1:46 pm

Re: Server activity alerts

You should get some sort of visible notification
bobdaduck wrote:Next, the moon!

└────────┘
⎈⎈⎈⎈
┌────────┐
<<

Whittling While

User avatar

Posts: 235

Joined: Wed Apr 07, 2010 10:22 am

Location: Minnesota

Post Sun Oct 13, 2013 1:51 pm

Re: Server activity alerts

Could one possibly mod it in such a way we get a soundbite yelling "JASON" upon that notification?
Premier Cloaker
"Time is an illusion; lunchtime, dually so."
<<

kaen

User avatar

Posts: 209

Joined: Thu Jun 14, 2012 11:54 am

Post Sun Oct 13, 2013 1:56 pm

Re: Server activity alerts

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.
bobdaduck wrote:Next, the moon!

└────────┘
⎈⎈⎈⎈
┌────────┐
<<

Whittling While

User avatar

Posts: 235

Joined: Wed Apr 07, 2010 10:22 am

Location: Minnesota

Post Sun Oct 13, 2013 2:04 pm

Re: Server activity alerts

I may just teach myself basic coding just so I can do that.
It'd be worth every second.
Premier Cloaker
"Time is an illusion; lunchtime, dually so."
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Sun Oct 13, 2013 4:10 pm

Re: Server activity alerts

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...

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests