Esempio n. 1
0
        public override void Process(SignChanged packet)
        {
            SignMetadata signMetadata = packet.SignMetadata;

            BasePieceMetadataProcessor metadataProcessor = BasePieceMetadataProcessor.FromMetaData(signMetadata);

            metadataProcessor.UpdateMetadata(signMetadata.Id, signMetadata);
        }
Esempio n. 2
0
            public void AssignBasePieceMetadata(object sender, EventArgs eventArgs)
            {
                ThrottledBuilder.main.QueueDrained -= AssignBasePieceMetadata;

                foreach (KeyValuePair <string, BasePieceMetadata> guidWithMetadata in metadataByBasePieceGuid)
                {
                    string            guid     = guidWithMetadata.Key;
                    BasePieceMetadata metadata = guidWithMetadata.Value;

                    BasePieceMetadataProcessor metadataProcessor = BasePieceMetadataProcessor.FromMetaData(metadata);
                    metadataProcessor.UpdateMetadata(guid, metadata);
                }
            }
        public override void Process(InitialPlayerSync packet)
        {
            int basePieceMetadatas = 0;

            foreach (BasePiece basePiece in packet.BasePieces)
            {
                if (basePiece.Metadata.IsPresent())
                {
                    BasePieceMetadata          metadata          = basePiece.Metadata.Get();
                    BasePieceMetadataProcessor metadataProcessor = BasePieceMetadataProcessor.FromMetaData(metadata);
                    metadataProcessor.UpdateMetadata(basePiece.Id, metadata);

                    basePieceMetadatas++;
                }
            }

            Log.Info("Received initial sync packet with " + basePieceMetadatas + " base piece meta data");
        }
        public override IEnumerator Process(InitialPlayerSync packet, WaitScreen.ManualWaitItem waitScreenItem)
        {
            int basePiecesWithMetadata = 0;
            int basePiecesChecked      = 0;

            foreach (BasePiece basePiece in packet.BasePieces)
            {
                waitScreenItem.SetProgress(basePiecesChecked, packet.BasePieces.Count);

                if (basePiece.Metadata.HasValue)
                {
                    BasePieceMetadata          metadata          = basePiece.Metadata.Value;
                    BasePieceMetadataProcessor metadataProcessor = BasePieceMetadataProcessor.FromMetaData(metadata);
                    metadataProcessor.UpdateMetadata(basePiece.Id, metadata);
                    basePiecesWithMetadata++;
                }

                basePiecesChecked++;
                yield return(null);
            }

            Log.Info("Received initial sync packet having " + basePiecesWithMetadata + " base pieces with meta data");
        }
Esempio n. 5
0
        public override void Process(BasePieceMetadataChanged packet)
        {
            BasePieceMetadataProcessor metadataProcessor = BasePieceMetadataProcessor.FromMetaData(packet.Metadata);

            metadataProcessor.UpdateMetadata(packet.PieceId, packet.Metadata);
        }