Need Interceptors - alleg call-to-arms tool!

Allegiance discussion not belonging in another forum.
One-Man-Bucket
Posts: 1248
Joined: Sun Jun 19, 2005 7:00 am

Post by One-Man-Bucket »

Hello!

I'm writing a little online notifier tool for allegiance. It's a small personal project to learn some new tech but hopefully it might become useful for the community. I'd offering you to try it out, but it's in closed beta until I have proper authentication in place.

Here's the elevator pitch:
* The active playerbase is so small that only sunday SGT is a reliable time to get a game going.
* Current methods of setting up a game is posting in the gameplay forums thread and waiting around in the lobby until some people show up, which requires people to actively read the thread (i know i'm not).

My app is a better version of the thread, if you want to play a game:
1) you start it on your phone and use it to signal that you want to play by tapping a "let's play button".
2) A push notification pops up for everyone with the app installed saying that someone wants to play a game
3) people can respond that they want to play, want to play later etc
4) you see (in real time!) if there's enough people willing to get a game going

What works right now
* basic functionality (view online players, send some responses)
* shows currently online players
* basic infra (containerized backend, andorid app on google play store)
* push notification support (firebase)
* make app look less ugly
* show who's active with the app in the UI
* SSL for client-server communication
* google authentication

Backlog (off the top of my head)
* more robust reconnection logic
* structured logs
* find hosting for the backend
* build some kind of web-UI
* make it play the "need interceptors" sound when a game is forming! :)

What about an iphone version???
I'm not going to write one in the forseeable future, but if someone in the community would like to put one together let me know!
If the android app proves to be useful, I'll try write a web UI for iphone / desktop users. I'm not very good (or particularly interested) in web development though, so if someone wants to contribute, let me know!

How do I use it?
1) have an android phone
2) Go to https://play.google.com/store/apps/deta ... ko.allegni and install the app
3) Start app and type in your name (use your normal callsign) and log in with google


I'm a tech person, how does it work?
I've built a rudimentary message bus using gRPC & persitent bidirectional rpc endpoints:

Code: Select all

service StateService {
  rpc TransferPlayerState(stream PlayerState) returns (stream PlayerState) {}
  rpc TransferClientState(stream ClientState) returns (stream ClientState) {}
  rpc TransferGameState(Empty) returns (GameState) {}
}
When clients connect they fetch the current player states with a blocking rpc (TransferGameState) and then "subscribe" to the two other endpoints; one for sending and recieving player state changes, and one for sending/recieving client activity (so you can see who else is active in the app right now).

Push notifications will use googles firebase, backend will send out a notification when a someone wants to start a new game, when there's a critical mass of people online, etc. The clients can then pick which notifications to show (e.g. I'm only interested if one of my friends wants to play, I don't want to get notifications at all, only show when a forming game has >10 interested players etc).

Backend is written in java8 using the apollo framework (for some web endpoints) and grpc-java, containerized with docker. I wrote about half of it in golang first (to teach myself the language), but didn't really like the langauge (at least for this application) and rewrote everything in java in an afternoon :)

The android app is nothing special, it uses grpc for communication. I'm very much a beginner on android stuff...


Here's what it looks like right now (very much subject to change!):
Last edited by One-Man-Bucket on Thu Aug 31, 2017 11:20 am, edited 1 time in total.
zombywoof
Posts: 6522
Joined: Mon Jul 14, 2008 4:59 am
Location: Over the Rainbow

Post by zombywoof »

Bucket shows up on his own list twice and I don't even show up once?

BOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO :mad:

Imma go make my own app, with blackjack. And hookers. You know what? Forget the app!
Image
Don't find fault, find a remedy; anybody can complain.
Cookie Monster wrote:QUOTE (Cookie Monster @ Apr 1 2009, 09:35 PM) But I don't read the forums I only post.
Djole88
Posts: 438
Joined: Wed Jul 10, 2013 11:10 am
Location: Србија
Contact:

Post by Djole88 »

Can we extend http://www.freeallegiance.org/ACSSgadget/ACSS.php and eliminate the need for any app (and thus support everything that has a browser)? Yes, there will be no push notifications but still if you want to play I don't think its too much trouble to check the site occasionally

Simply add another table into the existing database like (player_index, interested_from, interested_to)

player_index - obviously player's account from acss
interested_from, interested_to - so you can set the time period on the interested state, if its past the deadline you are obviously not interested

state shown can be: offline, interested, online - deduced from either the 'interested' table or current state
Game and player state scan be retrieved from acss?

Using anything more complicated than php is an overkill in this case imo

You can even derive apps to support push notifications from this...

Edited: "deduced" instead of "deducted", was Saturday morning
Last edited by Djole88 on Sat Dec 24, 2016 5:38 pm, edited 1 time in total.
One-Man-Bucket
Posts: 1248
Joined: Sun Jun 19, 2005 7:00 am

Post by One-Man-Bucket »

Djole88 wrote:QUOTE (Djole88 @ Dec 24 2016, 01:27 PM) Can we extend http://www.freeallegiance.org/ACSSgadget/ACSS.php and eliminate the need for any app (and thus support everything that has a browser)? Yes, there will be no push notifications but still if you want to play I don't think its too much trouble to check the site occasionally

Simply add another table into the existing database like (player_index, interested_from, interested_to)

player_index - obviously player's account from acss
interested_from, interested_to - so you can set the time period on the interested state, if its past the deadline you are obviously not interested

state shown can be: offline, interested, online - deducted from either the 'interested' table or current state
Game and player state scan be retrieved from acss?

Using anything more complicated than php is an overkill in this case imo

You can even derive apps to support push notifications from this...
Actually, there's a standard for push notification from websites that you could use: https://www.w3.org/TR/push-api/

But anyway, this is a learning project for me, so "overkill" isn't really a factor. Let's keep the discussion in this thread on-topic and talk about extending acss somewhere else.
One-Man-Bucket
Posts: 1248
Joined: Sun Jun 19, 2005 7:00 am

Post by One-Man-Bucket »

Some tweaks and made it look prettier:
Dome
Posts: 4306
Joined: Fri Sep 08, 2006 7:44 am
Location: Portland, OR

Post by Dome »

awesome job OMB!

And I definitely would like this for the iphone too as that is what I use.
One-Man-Bucket
Posts: 1248
Joined: Sun Jun 19, 2005 7:00 am

Post by One-Man-Bucket »

Now there's push notifications that pop up when there's >10 players online or when someone wants to play.

It also highlights users of the app that have the app open
Papsmear
Posts: 4809
Joined: Sun Jul 06, 2003 7:00 am
Location: Toronto, Canada

Post by Papsmear »

I like it!
Image
ImageImage
Vipur24
Posts: 125
Joined: Tue Jul 15, 2003 7:00 am
Location: Florida

Post by Vipur24 »

OMB WITH THE CLUTCH!!!!
Immz says " Can you not $#@!ing read Bacon? ENGLISH MOTHER$#@!ER! DO YOU READ IT? I even bolded it out for you. Sheesh. "
One-Man-Bucket
Posts: 1248
Joined: Sun Jun 19, 2005 7:00 am

Post by One-Man-Bucket »

Now it will also say on discord when there's someone who want's to play (or if there's 10 people online)

Post Reply