Exemplo n.º 1
0
        internal static Rcon Authorize(ConnectionInfo conInfo, string msg)
        {
            var rcon = new RconWeb($"ws://{conInfo.EndPoint.Address}:{conInfo.EndPoint.Port}/{msg}");

            if (rcon.WebSocket.Ping())
            {
                return(rcon);
            }

            rcon.Dispose();

            return(null);
        }
Exemplo n.º 2
0
        public override bool GetControl(string pass, bool useWebRcon)
        {
            ThrowIfDisposed();
            bool isSuccess = false;

            Rcon = useWebRcon
                ? RconWeb.Authorize(ConInfo, pass)
                : RconSource.Authorize(ConInfo, pass);
            if (Rcon != null)
            {
                isSuccess = true;
            }
            return(isSuccess);
        }