Class ClajConnection
java.lang.Object
com.xpdustry.claj.server.ClajConnection
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal InetAddressfinal arc.net.Connectionfinal intfinal arc.util.Ratekeeperprotected ClajRoomfinal Stringfinal Stringhex version ofid. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddQueue(com.xpdustry.claj.common.packets.RawPacket packet) voidvoidclose()voidclose(arc.net.DcReason reason) The room where the connection is right now.booleanbooleanhasQueue()booleanbooleanvoidSend via TCP.voidvoidsendStream(com.xpdustry.claj.common.net.stream.PreparedStream stream) voidsendStream(com.xpdustry.claj.common.packets.Packet packet)
-
Field Details
-
connection
public final arc.net.Connection connection -
address
-
saddress
-
id
public final int id -
sid
-
packetRate
public final arc.util.Ratekeeper packetRate -
room
-
-
Constructor Details
-
ClajConnection
public ClajConnection(arc.net.Connection connection)
-
-
Method Details
-
currentRoom
The room where the connection is right now. -
isRoomHost
public boolean isRoomHost() -
isConnected
public boolean isConnected() -
send
Send via TCP. -
send
-
sendStream
public void sendStream(com.xpdustry.claj.common.packets.Packet packet) -
sendStream
public void sendStream(com.xpdustry.claj.common.net.stream.PreparedStream stream) -
close
public void close() -
close
public void close(arc.net.DcReason reason) -
addQueue
public boolean addQueue(com.xpdustry.claj.common.packets.RawPacket packet) - Returns:
- whether a slot was found or not.
-
clearQueue
public void clearQueue() -
handleQueue
public boolean handleQueue()- Returns:
- whether the queue has been sent to the room host, or not, because no packet was queued or connection is not in a room.
-
hasQueue
public boolean hasQueue()
-