Class NumLookObjects
java.lang.Object
com.realtime.crossfire.jxclient.server.crossfire.NumLookObjects
Negotiates the size of the ground view in items with the Crossfire server.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after the server connection has been established.intReturns the current number of ground items.voidprocessSetupNumLookObjects(@NotNull String value) Called when a "setup num_look_objects" response has been received from the server.voidsetClientSocketState(@NotNull ClientSocketState clientSocketState) Called whenever the client socket state has changed.voidsetPreferredNumLookObjects(int preferredNumLookObjects) Sets the preferred number of ground items.voidWaits untilgetCurrentNumLookObjects()is stable.
-
Method Details
-
connected
public void connected()Called after the server connection has been established. -
processSetupNumLookObjects
public void processSetupNumLookObjects(@NotNull @NotNull String value) throws UnknownCommandException Called when a "setup num_look_objects" response has been received from the server.- Parameters:
value- the value of the message- Throws:
UnknownCommandException- if the value cannot be parsed
-
setPreferredNumLookObjects
public void setPreferredNumLookObjects(int preferredNumLookObjects) Sets the preferred number of ground items.- Parameters:
preferredNumLookObjects- the number of ground items
-
getCurrentNumLookObjects
public int getCurrentNumLookObjects()Returns the current number of ground items.- Returns:
- the number of ground items
-
waitForCurrentNumLookObjectsValid
Waits untilgetCurrentNumLookObjects()is stable. This function returns as soon as the negotiation with the Crossfire server is complete.- Throws:
InterruptedException- if the current thread was interrupted
-
setClientSocketState
Called whenever the client socket state has changed.- Parameters:
clientSocketState- the new client socket state
-