private static void OnKeepProjectionChangedRequest(ref KeepProjectionMsg msg, MyNetworkClient sender) { Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success); }
private static void OnKeepProjectionChangedSuccess(ref KeepProjectionMsg msg, MyNetworkClient sender) { MyEntity projectorEntity; MyEntities.TryGetEntityById(msg.EntityId, out projectorEntity); var projector = projectorEntity as MyProjector; if (projector != null) { projector.m_keepProjection = msg.KeepProjection; } }
public void SendNewKeepProjection(bool keepProjection) { var msg = new KeepProjectionMsg(); msg.EntityId = m_projector.EntityId; msg.KeepProjection = keepProjection; if (Sync.IsServer) { Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success); } else { Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request); } }