Exemplo n.º 1
0
        private static void OnColorBlocksRequest(MySyncGrid sync, ref ColorBlocksMsg msg, MyNetworkClient sender)
        {
            var handler = sync.BlocksColored;
            if (handler != null) handler(msg.Min, msg.Max, ColorExtensions.UnpackHSVFromUint(msg.HSV), msg.PlaySound);

            if (Sync.IsServer)
            {
                // Broadcast to clients, use result collection
                Sync.Layer.SendMessageToAll(ref msg);
            }
        }
Exemplo n.º 2
0
        public void ColorBlocks(Vector3I min, Vector3I max, Vector3 newHSV, bool playSound)
        {
            var msg = new ColorBlocksMsg();
            msg.GridEntityId = Entity.EntityId;
            msg.HSV = newHSV.PackHSVToUint();
            msg.Min = min;
            msg.Max = max;
            msg.PlaySound = playSound;

            Sync.Layer.SendMessageToServer(ref msg);
        }