Crossfire JXClient, Trunk
R20561
|
A FaceQueue requesting faces by "askface" commands sent to the Crossfire server. More...
Public Member Functions | |||
AskfaceFaceQueue (@NotNull final AskfaceQueue askfaceQueue) | |||
Creates a new instance. More... | |||
void | faceReceived (final int faceNum, final int faceSetNum, @NotNull final ByteBuffer packet) | ||
Notifies the askface manager that image information have been received from the server. More... | |||
void | loadFace (@NotNull final Face face) | ||
Request a face.Must eventually call either FaceQueueListener#faceLoaded(Face, FaceImages) or FaceQueueListener#faceFailed(Face) for the face. Faces re-requested while still processing may be notified only once.
| |||
void | reset () | ||
Reset the processing: forget about pending faces.This function is called whenever the server socket breaks, or when a new connection has been established. More... | |||
![]() | |||
void | addFaceQueueListener (@NotNull final FaceQueueListener faceQueueListener) | ||
Adds a FaceQueueListener to be notified about processed faces.
| |||
void | removeFaceQueueListener (@NotNull final FaceQueueListener faceQueueListener) | ||
Removes a FaceQueueListener to be notified about processed faces.
| |||
Private Member Functions | |
void | processFaceData (@NotNull final Face face, @NotNull final byte[] data) |
Processes face information received from the server. More... | |
void | sendAskface () |
Sends some pending "askface" commands. More... | |
Private Attributes | |
final AskfaceQueue | askfaceQueue |
The connection to use. More... | |
final Map< Integer, Face > | pendingAskfaces = new HashMap<>() |
Face numbers for which "askface" commands have been sent without having received a response from the server. More... | |
final Map< Integer, Face > | pendingFaces = new HashMap<>() |
Face numbers for which an "askface" command should be sent. More... | |
final List< Face > | pendingFacesQueue = new LinkedList<>() |
The same elements as pendingFaces in query order. More... | |
final Object | sync = new Object() |
The object use for synchronization. More... | |
Static Private Attributes | |
static final int | CONCURRENT_ASKFACE_COMMANDS = 8 |
The maximum number of concurrently sent "askface" commands. More... | |
Additional Inherited Members | |
![]() | |
void | fireFaceFailed (@NotNull final Face face) |
Notify all listener with FaceQueueListener#faceFailed(Face). More... | |
void | fireFaceLoaded (@NotNull final Face face, @NotNull final FaceImages faceImages) |
Notify all listener with FaceImages). More... | |
A FaceQueue requesting faces by "askface" commands sent to the Crossfire server.
Definition at line 37 of file AskfaceFaceQueue.java.
com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.AskfaceFaceQueue | ( | @NotNull final AskfaceQueue | askfaceQueue | ) |
Creates a new instance.
askfaceQueue | the connection instance for sending askface commands |
Definition at line 83 of file AskfaceFaceQueue.java.
References com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.askfaceQueue.
void com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.faceReceived | ( | final int | faceNum, |
final int | faceSetNum, | ||
@NotNull final ByteBuffer | packet | ||
) |
Notifies the askface manager that image information have been received from the server.
faceNum | the face ID |
faceSetNum | the face set |
packet | the face data |
Definition at line 147 of file AskfaceFaceQueue.java.
References com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.processFaceData(), com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.sendAskface(), and com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.sync.
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.processImage2().
void com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.loadFace | ( | @NotNull final Face | face | ) |
Request a face.Must eventually call either FaceQueueListener#faceLoaded(Face, FaceImages) or FaceQueueListener#faceFailed(Face) for the face. Faces re-requested while still processing may be notified only once.
face | the requested face |
Implements com.realtime.crossfire.jxclient.faces.FaceQueue.
Definition at line 103 of file AskfaceFaceQueue.java.
References com.realtime.crossfire.jxclient.faces.AbstractFaceQueue.fireFaceFailed(), com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.sendAskface(), and com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.sync.
|
private |
Processes face information received from the server.
face | the face |
data | the face information; it is supposed to be a .png file |
Definition at line 174 of file AskfaceFaceQueue.java.
References com.realtime.crossfire.jxclient.faces.AbstractFaceQueue.fireFaceFailed(), com.realtime.crossfire.jxclient.faces.AbstractFaceQueue.fireFaceLoaded(), and com.realtime.crossfire.jxclient.faces.FaceImagesUtils.newFaceImages().
Referenced by com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.faceReceived().
void com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.reset | ( | ) |
Reset the processing: forget about pending faces.This function is called whenever the server socket breaks, or when a new connection has been established.
Implements com.realtime.crossfire.jxclient.faces.FaceQueue.
Definition at line 91 of file AskfaceFaceQueue.java.
References com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.sync.
|
private |
Sends some pending "askface" commands.
Definition at line 127 of file AskfaceFaceQueue.java.
References com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.CONCURRENT_ASKFACE_COMMANDS, and com.realtime.crossfire.jxclient.faces.AskfaceQueue.sendAskface().
Referenced by com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.faceReceived(), and com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.loadFace().
|
private |
The connection to use.
Definition at line 56 of file AskfaceFaceQueue.java.
Referenced by com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.AskfaceFaceQueue().
|
staticprivate |
The maximum number of concurrently sent "askface" commands.
If more are requested, the excess ones are put on hold until some face information is received.
Definition at line 44 of file AskfaceFaceQueue.java.
Referenced by com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.sendAskface().
|
private |
Face numbers for which "askface" commands have been sent without having received a response from the server.
Maps face ID to Face instance.
Definition at line 64 of file AskfaceFaceQueue.java.
|
private |
Face numbers for which an "askface" command should be sent.
It includes all elements of pendingAskfaces.
Definition at line 71 of file AskfaceFaceQueue.java.
|
private |
The same elements as pendingFaces in query order.
Definition at line 77 of file AskfaceFaceQueue.java.
|
private |
The object use for synchronization.
Definition at line 50 of file AskfaceFaceQueue.java.
Referenced by com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.faceReceived(), com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.loadFace(), and com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue.reset().