refactoring multiplayer

This commit is contained in:
2025-07-21 19:58:20 +02:00
parent 0d8cc0e291
commit bf94ccb9db
6 changed files with 29 additions and 28 deletions

View File

@@ -40,6 +40,7 @@ namespace RebootReality.jelycho {
}
m_LastPressTime = DateTime.UtcNow;
PlayPressAnimation();
SendActorEvent((ushort) ButtonActorEvents.Pressed);
pressed?.Invoke();
@@ -49,6 +50,8 @@ namespace RebootReality.jelycho {
protected override void OnActorEventClient(ActorEvent actorEvent) {
if (actorEvent.EventID == (ushort) ButtonActorEvents.Pressed) {
PlayPressAnimation();
} else {
s_Logger.Error($"Unknown actor event: {actorEvent.EventID}");
}
}

View File

@@ -169,8 +169,6 @@ namespace RebootReality.jelycho.Player {
protected override void OnActorCommandServer(ActorCommand actorCommand) {
base.OnActorCommandServer(actorCommand);
// @TODO: SECURITY, Check if commands come from the owner
if (actorCommand.CommandID == (ushort) PlayerActorCommands.UpdateRemoteState) {
RemotePlayerActorState remoteState = new RemotePlayerActorState();
DataSerializationUtils.Deserialize(actorCommand.Data, ref remoteState);