@ChannelHandler.Sharable
public class WebSocketLoginHandler
extends org.jboss.netty.channel.SimpleChannelUpstreamHandler
Credentials
and lookup Player
and GameRoom
objects.
It kicks of the session creation process and will then send the
Events.START
event object to websocket client.Modifier and Type | Field and Description |
---|---|
private com.google.gson.Gson |
gson |
protected UniqueIDGeneratorService |
idGeneratorService |
private static org.slf4j.Logger |
LOG |
private LookupService |
lookupService |
protected ReconnectSessionRegistry |
reconnectRegistry |
Constructor and Description |
---|
WebSocketLoginHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeChannelWithLoginFailure(org.jboss.netty.channel.Channel channel) |
void |
connectToGameRoom(GameRoom gameRoom,
PlayerSession playerSession,
org.jboss.netty.channel.ChannelFuture future) |
protected org.jboss.netty.handler.codec.http.websocketx.TextWebSocketFrame |
eventToFrame(byte opcode,
Object payload) |
com.google.gson.Gson |
getGson() |
UniqueIDGeneratorService |
getIdGeneratorService() |
LookupService |
getLookupService() |
ReconnectSessionRegistry |
getReconnectRegistry() |
void |
handleGameRoomJoin(Player player,
org.jboss.netty.channel.Channel channel,
String refKey) |
void |
handleLogin(Player player,
org.jboss.netty.channel.Channel channel) |
protected void |
handleReconnect(PlayerSession playerSession,
org.jboss.netty.channel.Channel channel) |
protected void |
handleReJoin(PlayerSession playerSession,
GameRoom gameRoom,
org.jboss.netty.channel.Channel channel) |
Player |
lookupPlayer(String username,
String password) |
PlayerSession |
lookupSession(String reconnectKey) |
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e) |
void |
setGson(com.google.gson.Gson gson) |
void |
setIdGeneratorService(UniqueIDGeneratorService idGeneratorService) |
void |
setLookupService(LookupService lookupService) |
void |
setReconnectRegistry(ReconnectSessionRegistry reconnectRegistry) |
private static final org.slf4j.Logger LOG
private LookupService lookupService
protected ReconnectSessionRegistry reconnectRegistry
protected UniqueIDGeneratorService idGeneratorService
private com.google.gson.Gson gson
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e) throws Exception
messageReceived
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public PlayerSession lookupSession(String reconnectKey)
protected void handleReconnect(PlayerSession playerSession, org.jboss.netty.channel.Channel channel)
protected void handleReJoin(PlayerSession playerSession, GameRoom gameRoom, org.jboss.netty.channel.Channel channel)
public void handleLogin(Player player, org.jboss.netty.channel.Channel channel)
protected void closeChannelWithLoginFailure(org.jboss.netty.channel.Channel channel)
public void handleGameRoomJoin(Player player, org.jboss.netty.channel.Channel channel, String refKey)
public void connectToGameRoom(GameRoom gameRoom, PlayerSession playerSession, org.jboss.netty.channel.ChannelFuture future)
protected org.jboss.netty.handler.codec.http.websocketx.TextWebSocketFrame eventToFrame(byte opcode, Object payload)
public LookupService getLookupService()
public void setLookupService(LookupService lookupService)
public com.google.gson.Gson getGson()
public void setGson(com.google.gson.Gson gson)
public ReconnectSessionRegistry getReconnectRegistry()
public void setReconnectRegistry(ReconnectSessionRegistry reconnectRegistry)
public UniqueIDGeneratorService getIdGeneratorService()
public void setIdGeneratorService(UniqueIDGeneratorService idGeneratorService)
Copyright © 2013. All Rights Reserved.