football3s

2 views
Skip to first unread message

Jonas

unread,
Aug 16, 2009, 6:42:26 AM8/16/09
to Hemlock
Hi, I just stumbled upon Hemlock through football3s and am trying to
understand how this works.

So if I understand this correctly, then Hemlock is a middlepiece
between XMPP and Flash where the Flash client receives data (push)
from the XMPP. All of the connection storing is handeled by XMPP so
scalability should be there.

If I want to deploy data to a large number of clients (for example,
because another form was updated somewhere else) how would Hemlock
then know of the new data arriving? In the football3s thing for
example, does Hemlock or does XMPP learn first about the new event
like a pass or a goal? (by the way, I am pretty impressed by the speed
of the updates! Where do you get that data from?)

Thanks,
Jonas

Ron DeVera

unread,
Aug 16, 2009, 12:04:41 PM8/16/09
to hem...@googlegroups.com
Hello Jonas,

> So if I understand this correctly, then Hemlock is a middlepiece
> between XMPP and Flash where the Flash client receives data (push)
> from the XMPP. All of the connection storing is handeled by XMPP so
> scalability should be there.

Right -- Hemlock is meant as a bridge to allow real-time data
transmission among users. XMPP provides massive scalability, and Flash
provides the ability to maintain an open socket connection for pushing
data. The server can push to the client, and vice versa.

> If I want to deploy data to a large number of clients (for example,
> because another form was updated somewhere else) how would Hemlock
> then know of the new data arriving?

The typical flow is:
- A user performs some action via Flash UI.
- The ActionScript client pushes that action's data to the XMPP server.
- The XMPP server pushes that data back out to everyone else in the
same XMPP room as that user.
- Data reaches another user's ActionScript client.
- The ActionScript client parses the incoming data, and the Flash UI
displays it.

Here, the overall flow is: human -> Flash/ActionScript -> XMPP ->
Flash/ActionScript -> human.

> In the football3s thing for
> example, does Hemlock or does XMPP learn first about the new event
> like a pass or a goal?

Football3s uses a more interesting setup:
- Spotters watch the football match on TV. Whenever a certain action
occurs (like a goal or pass), the spotter submits that action to a
typical SQL database via an HTML form. (This part is typical of
websites today.)
- A bot (daemon) monitors the SQL database for new events. The bot is
also connected to each Football3s XMPP game room.
- When the bot finds new events, it pushes their data out to every XMPP room.
- The data is then pushed out to every ActionScript client, where
Hemlock takes care of interpreting that data for use in the UI.

Here, the flow of data is: human -> SQL DB -> bot -> XMPP ->
Flash/ActionScript -> human.

> (by the way, I am pretty impressed by the speed
> of the updates! Where do you get that data from?)

High-speed humans, intently watching every game and extracting data
for your gaming pleasure. :)

Cheers,
Ron

Jonas

unread,
Aug 18, 2009, 9:37:33 PM8/18/09
to Hemlock
Very interesting. What happens behind a corporate firewall for example
which blocks all ports except for port 80, Hemlock would not work
then, correct?

By the way, where do I apply for that game watching job? Sounds like a
fantastic side job...

Cheers,
Jonas

Ron DeVera

unread,
Aug 18, 2009, 10:55:24 PM8/18/09
to hem...@googlegroups.com
Support for port 80 is one of our next top priorities. We've made
some good experimental progress with running Football3s on port 80, so
we added it to the Hemlock repository. If you're interested, you can
check out Hemlock's bleeding edge on the `development` branch:
http://github.com/mintdigital/hemlock/commits/development

Here's the important commit:
http://github.com/mintdigital/hemlock/commit/a4616cb52ea453829ef8b9b1ab318bf62905053d
-- In your `config/environment.as` file, you can set
`HemlockEnvironment.SERVER_PORTS` to an array of ports to try, e.g.,
`[80, 5222]`. Earlier ports take precedence; later ports are
fallbacks.

If you're feeling less adventurous, the `master` branch is time-tested
and considered stable. When we're satisfied with how our port 80
experiments go, we'll merge that work into the `master` branch.

> By the way, where do I apply for that game watching job? Sounds like a
> fantastic side job...

Yeah, it's gotta be the best job yet. :)

Cheers,
Ron

Reply all
Reply to author
Forward
0 new messages