private static void OnRazeBlocksRequest(MySyncGrid sync, ref RazeBlocksMsg msg, MyNetworkClient sender) { m_tmpPositionListReceive.Clear(); Debug.Assert(m_tmpPositionListReceive != msg.Locations, "The raze block message was received via loopback using the same list. This causes erasing of the message."); var handler = sync.BlocksRazed; if (handler != null) handler(msg.Locations, m_tmpPositionListReceive); if (Sync.IsServer && m_tmpPositionListReceive.Count > 0) { // Broadcast to clients, use result collection msg.Locations = m_tmpPositionListReceive; Sync.Layer.SendMessageToAll(ref msg); } }
public void RazeBlocks(List<Vector3I> locations) { var msg = new RazeBlocksMsg(); msg.GridEntityId = Entity.EntityId; msg.Locations = locations; Sync.Layer.SendMessageToServer(ref msg); }