RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
Session.java
1
package
com.osroyale.net.session;
2
3
import
com.osroyale.Config;
4
import
io.netty.channel.Channel;
5
import
io.netty.channel.ChannelFuture;
6
7
import
java.net.InetSocketAddress;
8
44
45
public
class
Session
{
46
50
protected
final
Channel
channel
;
51
55
protected
final
String
host
;
56
63
public
Session
(Channel
channel
) {
64
this.channel =
channel
;
65
this.host = ((InetSocketAddress)
channel
.remoteAddress()).getAddress().getHostAddress();
66
}
67
71
public
final
void
close
() {
72
onClose
(
channel
.close());
73
}
74
81
protected
void
onClose
(ChannelFuture future) {
82
83
}
84
91
public
void
handleClientPacket
(Object o) {
92
93
}
94
100
public
Channel
getChannel
() {
101
return
channel
;
102
}
103
107
public
String
getHost
() {
108
final
Channel
channel
=
getChannel
();
109
if
(
channel
!=
null
&&
channel
.hasAttr(
Config
.SOURCE_ADDRESS)) {
110
return
channel
.attr(
Config
.SOURCE_ADDRESS).get();
111
}
112
return
host
;
113
}
114
115
}
com.osroyale.Config
Definition
Config.java:61
com.osroyale.net.session.Session.host
final String host
Definition
Session.java:55
com.osroyale.net.session.Session.onClose
void onClose(ChannelFuture future)
Definition
Session.java:81
com.osroyale.net.session.Session.channel
final Channel channel
Definition
Session.java:50
com.osroyale.net.session.Session.getChannel
Channel getChannel()
Definition
Session.java:100
com.osroyale.net.session.Session.getHost
String getHost()
Definition
Session.java:107
com.osroyale.net.session.Session.close
final void close()
Definition
Session.java:71
com.osroyale.net.session.Session.Session
Session(Channel channel)
Definition
Session.java:63
com.osroyale.net.session.Session.handleClientPacket
void handleClientPacket(Object o)
Definition
Session.java:91