Ejemplo n.º 1
0
 private static void OnStockpileChanged(MySyncGrid sync, ref StockpileChangedMsg msg, MyNetworkClient sender)
 {
     if (sync.BlockStockpileChanged != null)
         sync.BlockStockpileChanged(msg.BlockPosition, msg.SubBlockId, msg.Changes);
 }
Ejemplo n.º 2
0
        public void SendStockpileChanged(MySlimBlock mySlimBlock, List<MyStockpileItem> list)
        {
            Debug.Assert(Sync.IsServer, "Other player than server is trying to send stockpile changes");
            if (list.Count() == 0) return;

            var msg = new StockpileChangedMsg();
            msg.GridEntityId = Entity.EntityId;
            msg.BlockPosition = mySlimBlock.Position;
            msg.Changes = list;
            Debug.Assert(list != null, "List of stockpile changes was null!");
			msg.SubBlockId = GetSubBlockId(mySlimBlock);

            Sync.Layer.SendMessageToAll(ref msg);
        }