コード例 #1
0
        public void RazeBlockInCompoundBlock(List <Tuple <Vector3I, ushort> > locationsAndIds)
        {
            var msg = new RazeBlockInCompoundBlockMsg();

            msg.GridEntityId    = Entity.EntityId;
            msg.LocationsAndIds = locationsAndIds;

            Sync.Layer.SendAsRpcToServer(ref msg);
        }
コード例 #2
0
        private static void OnRazeBlockInCompoundBlockRequest(MySyncGrid sync, ref RazeBlockInCompoundBlockMsg msg, MyNetworkClient sender)
        {
            m_tmpLocationsAndIdsReceive.Clear();
            Debug.Assert(m_tmpLocationsAndIdsReceive != msg.LocationsAndIds, "The raze block in compound block message was received via loopback using the same list. This causes erasing of the message.");
            var handler = sync.RazedBlockInCompoundBlock;

            if (handler != null)
            {
                handler(msg.LocationsAndIds, m_tmpLocationsAndIdsReceive);
            }

            if (Sync.IsServer && m_tmpLocationsAndIdsReceive.Count > 0)
            {
                // Broadcast to clients, use result collection
                msg.LocationsAndIds = m_tmpLocationsAndIdsReceive;
                Sync.Layer.SendAsRpcToAll(ref msg);
            }
        }
コード例 #3
0
ファイル: MySyncGrid.cs プロジェクト: Krulac/SpaceEngineers
        private static void OnRazeBlockInCompoundBlockRequest(MySyncGrid sync, ref RazeBlockInCompoundBlockMsg msg, MyNetworkClient sender)
        {
            m_tmpLocationsAndIdsReceive.Clear();
            Debug.Assert(m_tmpLocationsAndIdsReceive != msg.LocationsAndIds, "The raze block in compound block message was received via loopback using the same list. This causes erasing of the message.");
            var handler = sync.RazedBlockInCompoundBlock;
            if (handler != null) handler(msg.LocationsAndIds, m_tmpLocationsAndIdsReceive);

            if (Sync.IsServer && m_tmpLocationsAndIdsReceive.Count > 0)
            {
                // Broadcast to clients, use result collection
                msg.LocationsAndIds = m_tmpLocationsAndIdsReceive;
                Sync.Layer.SendMessageToAll(ref msg);
            }
        }
コード例 #4
0
ファイル: MySyncGrid.cs プロジェクト: Krulac/SpaceEngineers
        public void RazeBlockInCompoundBlock(List<Tuple<Vector3I, ushort>> locationsAndIds)
        {
            var msg = new RazeBlockInCompoundBlockMsg();
            msg.GridEntityId = Entity.EntityId;
            msg.LocationsAndIds = locationsAndIds;

            Sync.Layer.SendMessageToServer(ref msg);
        }