public override void DownloadProfiler(int index)
        {
            MyDownloadProfilerResult ret = new MyDownloadProfilerResult(MyMultiplayer.ProfilerDownloadChannel, ServerId, this);

            MyControlProfilerMsg msg = new MyControlProfilerMsg()
            {
                index = index
            };

            SendControlMessage(ServerId, ref msg);
        }
Exemple #2
0
        protected void OnProfilerRequest(ref MyControlProfilerMsg data, ulong sender)
        {
            if (IsServer && !m_profilerSenders.ContainsKey(sender))
            {
                MemoryStream profilerStream = new MemoryStream();

                MyObjectBuilder_Profiler profilerData = MyObjectBuilder_Profiler.GetObjectBuilder(VRage.Profiler.MyRenderProfiler.GetProfilerAtIndex(data.index));
                MyObjectBuilderSerializer.SerializeXML(profilerStream, profilerData, MyObjectBuilderSerializer.XmlCompression.Gzip);
                SyncLayer.TransportLayer.SendFlush(sender);
                var buffer = profilerStream.ToArray();
                MyMultipartSender msgSender = new MyMultipartSender(buffer, buffer.Length, sender, MyMultiplayer.ProfilerDownloadChannel);
                m_profilerSenders[sender] = msgSender;
            }
        }