コード例 #1
0
ファイル: MySyncGrid.cs プロジェクト: Krulac/SpaceEngineers
 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);
 }
コード例 #2
0
ファイル: MySyncGrid.cs プロジェクト: Krulac/SpaceEngineers
        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);
        }