@ -39,6 +39,8 @@ import com.jme3.network.message.SerializerRegistrationsMessage;
import com.jme3.network.serializing.Serializer ;
import com.jme3.network.serializing.Serializer ;
import com.jme3.network.service.AbstractClientService ;
import com.jme3.network.service.AbstractClientService ;
import com.jme3.network.service.ClientServiceManager ;
import com.jme3.network.service.ClientServiceManager ;
import java.util.logging.Level ;
import java.util.logging.Logger ;
/ * *
/ * *
@ -49,13 +51,20 @@ import com.jme3.network.service.ClientServiceManager;
public class ClientSerializerRegistrationsService extends AbstractClientService
public class ClientSerializerRegistrationsService extends AbstractClientService
implements MessageListener < Client > {
implements MessageListener < Client > {
static final Logger log = Logger . getLogger ( SerializerRegistrationsMessage . class . getName ( ) ) ;
@Override
@Override
protected void onInitialize ( ClientServiceManager serviceManager ) {
protected void onInitialize ( ClientServiceManager serviceManager ) {
// Make sure our message type is registered
// Make sure our message type is registered if it isn't already
if ( Serializer . getSerializer ( SerializerRegistrationsMessage . class , false ) = = null ) {
// This is the minimum we'd need just to be able to register
// This is the minimum we'd need just to be able to register
// the rest... otherwise we can't even receive this message.
// the rest... otherwise we can't even receive this message.
Serializer . registerClass ( SerializerRegistrationsMessage . class ) ;
Serializer . registerClass ( SerializerRegistrationsMessage . class ) ;
Serializer . registerClass ( SerializerRegistrationsMessage . Registration . class ) ;
Serializer . registerClass ( SerializerRegistrationsMessage . Registration . class ) ;
} else {
log . log ( Level . INFO , "Skipping registration of SerializerRegistrationsMessage." ) ;
}
// Add our listener for that message type
// Add our listener for that message type
serviceManager . getClient ( ) . addMessageListener ( this , SerializerRegistrationsMessage . class ) ;
serviceManager . getClient ( ) . addMessageListener ( this , SerializerRegistrationsMessage . class ) ;