コード例 #1
0
        // Read messages coming from clients.
        public override void UpdateBeforeSimulation()
        {
            ProfilerShort.Begin("External Debugging");
            foreach (var clientInfo in m_clients)
            {
                if (clientInfo == null || clientInfo.TcpClient == null || clientInfo.TcpClient.Client == null || !clientInfo.TcpClient.Connected)
                {
                    if (clientInfo != null && clientInfo.TcpClient != null && clientInfo.TcpClient.Client != null &&
                        clientInfo.TcpClient.Client.Connected)
                    {
                        clientInfo.TcpClient.Client.Disconnect(true);
                        clientInfo.TcpClient.Close();
                    }

                    m_clients.Remove(clientInfo);
                    continue;
                }
                if (clientInfo.TcpClient.Connected && clientInfo.TcpClient.Available > 0)
                {
                    ReadMessagesFromClients(clientInfo);
                }
            }
            m_clients.ApplyRemovals();
            ProfilerShort.End();
        }
コード例 #2
0
ファイル: GridControlCore.cs プロジェクト: Thraxus/Skunkworks
 protected override void Unload()
 {
     MyAPIGateway.Entities.OnEntityAdd -= OnEntityAdd;
     foreach (ControllableGrid grid in _grids)
     {
         DeRegisterGrid(grid);
     }
     _grids.ApplyRemovals();
     _grids.ClearList();
     // Unload code above base
     base.Unload();
 }
コード例 #3
0
 private void Close(MyEntity gyro)
 {
     gyro.OnClose -= Close;
     _gyros.Remove((MyGyro)gyro);
     _gyros.ApplyRemovals();
 }
コード例 #4
0
ファイル: DebugDraw.cs プロジェクト: Thraxus/Skunkworks
 public void RemoveLine(DrawLine line)
 {
     _drawLines.Remove(line);
     _drawLines.ApplyRemovals();
 }
コード例 #5
0
 private void Close(IMyEntity gear)
 {
     ((IMyLandingGear)gear).OnClose -= Close;
     _landingGears.Remove((IMyLandingGear)gear);
     _landingGears.ApplyRemovals();
 }