fixed
Session:
Code:
package com.runescape.net;
import org.jboss.netty.channel.Channel;
import com.runescape.model.player.Player;
import com.runescape.util.ISAACCipher;
/**
* Represents an in-server session, which keeps track of things like the remote
* channel, the player and the session state.
*
* @author Blake Beaupain
*/
public class Session {
/**
* The state of the session.
*/
public static enum State {
/** When a session has just connected. */
CONNECTED,
/** When a session is updating. */
UPDATING,
/** When a session is logging in. */
LOGGING_IN,
/** When a session is logged in. */
LOGGED_IN
}
/** The channel. */
private Channel channel;
/** The player. */
private Player player;
/** The state. */
private State state = State.CONNECTED;
/** The stream encoder. */
private ISAACCipher streamEncryptor;
/** The stream decoder. */
private ISAACCipher streamDecryptor;
/**
* Instantiates a new session.
*
* @param channel
* the channel
*/
public Session(Channel channel) {
this.setChannel(channel);
}
/**
* Sets the channel.
*
* @param channel
* the new channel
*/
public void setChannel(Channel channel) {
this.channel = channel;
}
/**
* Gets the channel.
*
* @return the channel
*/
public Channel getChannel() {
return channel;
}
/**
* Sets the state.
*
* @param state
* the new state
*/
public void setState(State state) {
this.state = state;
}
/**
* Gets the state.
*
* @return the state
*/
public State getState() {
return state;
}
/**
* Sets the player.
*
* @param player
* the new player
*/
public void setPlayer(Player player) {
this.player = player;
}
/**
* Gets the player.
*
* @return the player
*/
public Player getPlayer() {
return player;
}
public void setStreamEncryptor(ISAACCipher streamEncryptor) {
this.streamEncryptor = streamEncryptor;
}
public ISAACCipher getStreamEncryptor() {
return streamEncryptor;
}
public void setStreamDecryptor(ISAACCipher streamDecryptor) {
this.streamDecryptor = streamDecryptor;
}
public ISAACCipher getStreamDecryptor() {
return streamDecryptor;
}
}