private static void OnIntegrityChanged(MySyncGrid sync, ref IntegrityChangedMsg msg, MyNetworkClient sender) { if (sync.BlockIntegrityChanged != null) sync.BlockIntegrityChanged(msg.BlockPosition, msg.SubBlockId, msg.BuildIntegrity, msg.Integrity, msg.IntegrityChangeType, msg.ToolOwner); }
public void SendIntegrityChanged(MySlimBlock mySlimBlock, MyCubeGrid.MyIntegrityChangeEnum integrityChangeType, long toolOwner) { Debug.Assert(Sync.IsServer, "Other player than server is trying to send integrity changes"); var msg = new IntegrityChangedMsg(); msg.GridEntityId = Entity.EntityId; msg.BuildIntegrity = mySlimBlock.BuildIntegrity; msg.Integrity = mySlimBlock.Integrity; msg.BlockPosition = mySlimBlock.Position; msg.IntegrityChangeType = integrityChangeType; msg.ToolOwner = toolOwner; msg.SubBlockId = GetSubBlockId(mySlimBlock); Sync.Layer.SendMessageToAll(ref msg); }