users@grizzly.java.net

Game server design questions

From: Johan Maasing <johan_at_zoom.nu>
Date: Thu, 31 Oct 2013 09:36:45 +0100

A while back I played around with grizzly for a hobby project, a small TCP
based game server.
I could get the filter approach working fine between clients and server. A
client sent a message and a filter chain on the server responded. I used
this to handle the sign-in flow where a client logged in to the game server.

But I got sort of stuck when I wanted the server to send game update
messages to one or more clients. Now there was no FilterChainContext I
could use to write to the client since the server was the one initiating
sending messages.
I tried to extract the Connection from the FilterChainContext during the
sign-in and keep around to send messages to clients later on but that never
worked.

What type of design should I use for this scenario? Are the filter chains
still appropriate? How do I get a Connection (or similar) to the client?

Cheers,
Johan