Beispiel #1
0
 internal Server(ConnectionInfo conInfo, EngineType type, bool?isObsolete)
 {
     ConInfo   = conInfo;
     EndPoint  = conInfo.EndPoint;
     UdpSocket = new UdpQuery(conInfo);
     Type      = type;
     if (isObsolete == null)
     {
         try
         {
             if (UdpSocket.GetResponse(QueryMsg.ObsoleteInfoQuery, Type)[0] == 0x6D)
             {
                 IsObsolete = true;
             }
         }
         catch (SocketException e)
         {
             if (e.SocketErrorCode == SocketError.TimedOut)
             {
                 IsObsolete = false;
             }
         }
     }
     else
     {
         IsObsolete = isObsolete == true ? true : false;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Disposes all the resources used by this instance.
 /// </summary>
 /// <param name="disposing"></param>
 protected override void Dispose(bool disposing)
 {
     if (!IsDisposed)
     {
         if (disposing)
         {
             if (Rcon != null)
             {
                 Rcon.Dispose();
             }
             Rcon = null;
             if (logs != null)
             {
                 logs.Dispose();
             }
             logs = null;
             if (UdpSocket != null)
             {
                 UdpSocket.Dispose();
             }
             UdpSocket = null;
         }
         base.Dispose(disposing);
         IsDisposed = true;
     }
 }
Beispiel #3
0
 private RconGoldSource(ConnectionInfo conInfo)
 {
     socket  = new UdpQuery(conInfo);
     ConInfo = conInfo;
 }