Search in sources :

Example 1 with SerializerRegistrationsMessage

use of com.jme3.network.message.SerializerRegistrationsMessage in project jmonkeyengine by jMonkeyEngine.

the class ClientSerializerRegistrationsService method messageReceived.

@Override
public void messageReceived(Client source, Message m) {
    // We only wait for one kind of message...
    SerializerRegistrationsMessage msg = (SerializerRegistrationsMessage) m;
    msg.registerAll();
}
Also used : SerializerRegistrationsMessage(com.jme3.network.message.SerializerRegistrationsMessage)

Example 2 with SerializerRegistrationsMessage

use of com.jme3.network.message.SerializerRegistrationsMessage in project jmonkeyengine by jMonkeyEngine.

the class SerializerRegistrationsMessage method compile.

public static void compile() {
    // Let's just see what they are here
    List<Registration> list = new ArrayList<Registration>();
    for (SerializerRegistration reg : Serializer.getSerializerRegistrations()) {
        Class type = reg.getType();
        if (ignore.contains(type))
            continue;
        if (type.isPrimitive())
            continue;
        list.add(new Registration(reg));
    }
    if (log.isLoggable(Level.FINE)) {
        log.log(Level.FINE, "Number of registered classes:{0}", list.size());
        for (Registration reg : list) {
            log.log(Level.FINE, "    {0}", reg);
        }
    }
    compiled = list.toArray(new Registration[list.size()]);
    INSTANCE = new SerializerRegistrationsMessage(compiled);
    Serializer.setReadOnly(true);
}
Also used : SerializerRegistration(com.jme3.network.serializing.SerializerRegistration) SerializerRegistration(com.jme3.network.serializing.SerializerRegistration)

Aggregations

SerializerRegistrationsMessage (com.jme3.network.message.SerializerRegistrationsMessage)1 SerializerRegistration (com.jme3.network.serializing.SerializerRegistration)1