Renderer/src/main/java/electrosphere/net/client/protocol/SynchronizationProtocol.java

24 lines
891 B
Java

package electrosphere.net.client.protocol;
import electrosphere.engine.Globals;
import electrosphere.net.parser.net.message.SynchronizationMessage;
public class SynchronizationProtocol {
protected static void handleSynchronizationMessage(SynchronizationMessage message){
Globals.profiler.beginCpuSample("SynchronizationProtocol.handleSynchronizationMessage");
switch(message.getMessageSubtype()){
case UPDATECLIENTSTATE:
case UPDATECLIENTSTRINGSTATE:
case ATTACHTREE:
case DETATCHTREE:
Globals.clientSynchronizationManager.pushMessage(message);
break;
default:
throw new UnsupportedOperationException("Received synchronization message on the client of unsupported type: " + message.getMessageSubtype());
}
Globals.profiler.endCpuSample();
}
}