public class SessionFactory extends Object
NettyTCPClient
and NettyUDPClient
and using their connect methods.Modifier and Type | Field and Description |
---|---|
private LoginHelper |
loginHelper
This class holds a number of variables like username, password etc which
are necessary for creating connections to remote jetserver.
|
private static AtomicInteger |
sessionId |
private NettyTCPClient |
tcpClient |
private NettyUDPClient |
udpClient |
Constructor and Description |
---|
SessionFactory(LoginHelper theLoginHelper)
This constructor will take a
LoginHelper and initialize the
NettyTCPClient and NettyUDPClient s using the connection
parameters provided in this login helper class. |
Modifier and Type | Method and Description |
---|---|
void |
connectSession(Session session)
Connects the session to remote jetserver.
|
Session |
createAndConnectSession()
Creates a
Session and connects it to the remote jetserver. |
PlayerSession |
createPlayerSession(Player player) |
Session |
createSession() |
LoginHelper |
getLoginHelper() |
NettyTCPClient |
getTcpClient() |
NettyUDPClient |
getUdpClient() |
private final LoginHelper loginHelper
private final NettyTCPClient tcpClient
private final NettyUDPClient udpClient
private static final AtomicInteger sessionId
public SessionFactory(LoginHelper theLoginHelper) throws UnknownHostException, Exception
LoginHelper
and initialize the
NettyTCPClient
and NettyUDPClient
s using the connection
parameters provided in this login helper class.theLoginHelper
- UnknownHostException
Exception
public Session createAndConnectSession() throws InterruptedException, Exception
Session
and connects it to the remote jetserver.InterruptedException
Exception
public Session createSession()
DefaultSession.SessionBuilder
.public void connectSession(Session session) throws InterruptedException, Exception
session
- The session to be connected to remote jetserver.InterruptedException
Exception
public PlayerSession createPlayerSession(Player player)
public LoginHelper getLoginHelper()
public NettyTCPClient getTcpClient()
public NettyUDPClient getUdpClient()
Copyright © 2012. All Rights Reserved.