示例#1
0
 private static void OnKeepProjectionChangedRequest(ref KeepProjectionMsg msg, MyNetworkClient sender)
 {
     Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success);
 }
示例#2
0
 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;
     }
 }
示例#3
0
            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);
                }
            }