Renderer/src/main/java/electrosphere/net/client/protocol/PlayerProtocol.java
austin ebec7a373e
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Separation of client and server logic
2023-05-20 19:18:09 -04:00

26 lines
942 B
Java

package electrosphere.net.client.protocol;
import org.joml.Vector3i;
import electrosphere.engine.Globals;
import electrosphere.engine.Main;
import electrosphere.logger.LoggerInterface;
import electrosphere.net.parser.net.message.PlayerMessage;
import electrosphere.net.server.player.Player;
public class PlayerProtocol {
protected static void handlePlayerMessage(PlayerMessage message){
switch(message.getMessageSubtype()){
case SET_ID:
Globals.clientPlayer = new Player(message.getplayerID());
LoggerInterface.loggerNetworking.DEBUG("Player ID is " + Globals.clientPlayer.getId());
break;
case SETINITIALDISCRETEPOSITION:
Globals.clientPlayerData.setWorldPos(new Vector3i(message.getinitialDiscretePositionX(), message.getinitialDiscretePositionY(), message.getinitialDiscretePositionZ()));
break;
}
}
}