public class EntityDataHostService extends java.lang.Object implements EntityHostSettings
It is up to the game server to periodically call sendUpdates() to flush any pending EntitySet changes to clients.
For JME 3.1 and above, use EntityDataHostedService and EntityDataClientService instead of these more crude classes. They will be deprecated when JME 3.1 is full released.
Modifier and Type | Class and Description |
---|---|
protected class |
EntityDataHostService.ConnectionObserver |
Constructor and Description |
---|
EntityDataHostService(com.jme3.network.Server server,
int channel,
com.simsilica.es.ObservableEntityData ed)
Creates a new EntityDataHostService that will watch for new
connections on the specified Server and provide access to the
specified EntityData.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addConnection(com.jme3.network.HostedConnection hc) |
boolean |
getAutoHost() |
int |
getChannel() |
int |
getMaxChangeBatchSize() |
int |
getMaxEntityBatchSize() |
protected void |
removeConnection(com.jme3.network.HostedConnection hc) |
void |
sendUpdates()
Must be called by the game server to send pending updates
to the relevant clients.
|
void |
setAutoHost(boolean b)
Set to true to have new connections automatically 'hosted'
by this entity service.
|
void |
setMaxChangeBatchSize(int i)
Sets the maximum number of EntityChanges that will be sent back
in a single batched results message.
|
void |
setMaxEntityBatchSize(int i)
Sets the maximum number of entities that will be sent back
in a single batched results message.
|
void |
startHostingOnConnection(com.jme3.network.HostedConnection hc)
Sets up the specified connection for hosting remote
entity data commands.
|
void |
stop()
Causes this service to stop listening for new connections and
all existing connections will have stopHostingOnConnection() called
for them.
|
void |
stopHostingOnConnection(com.jme3.network.HostedConnection hc)
Terminates the specified connection for hosting remote
entity data commands.
|
public EntityDataHostService(com.jme3.network.Server server, int channel, com.simsilica.es.ObservableEntityData ed)
public int getChannel()
getChannel
in interface EntityHostSettings
public void sendUpdates()
public void stop()
public void startHostingOnConnection(com.jme3.network.HostedConnection hc)
public void stopHostingOnConnection(com.jme3.network.HostedConnection hc)
public void setMaxEntityBatchSize(int i)
public int getMaxEntityBatchSize()
getMaxEntityBatchSize
in interface EntityHostSettings
public void setMaxChangeBatchSize(int i)
public int getMaxChangeBatchSize()
getMaxChangeBatchSize
in interface EntityHostSettings
public void setAutoHost(boolean b)
public boolean getAutoHost()
protected void addConnection(com.jme3.network.HostedConnection hc)
protected void removeConnection(com.jme3.network.HostedConnection hc)