Exemplo n.º 1
0
        private Dictionary <string, MovieFileSetData> ToMovieFileDict(IAccessPoint dir, bool isInclude)
        {
            var dirPath = dir.BasePath;

            if (!Directory.Exists(dirPath))
            {
                //CriUtils.Warning( "[CRI Manager] Directory is Not Exists {0}", dirPath );
                return(new Dictionary <string, MovieFileSetData>());
            }
            var regex = new Regex("(.*?).(usm)$");
            //	acbとawbの一覧
            var files = Directory
                        .GetFiles(dirPath, "*", SearchOption.AllDirectories)
                        .Select(p => p.ToConvertDelimiter())
                        .Where(p => regex.IsMatch(p))
                        .ToArray();

            //	拡張子なしの相対パスをキーとする
            return(files
                   .ToDictionary(
                       c => dir.ToRelative(c).Replace(Path.GetExtension(c), string.Empty),
                       c => new MovieFileSetData
                       (
                           dir.ToRelative(c).Replace(Path.GetExtension(c), string.Empty),
                           c,
                           isInclude,
                           dir
                       )));
        }
Exemplo n.º 2
0
        private Dictionary <string, SoundFileSetData> ToSoundFileDict(IAccessPoint dir, bool isInclude)
        {
            var dirPath = dir.BasePath;

            if (!Directory.Exists(dirPath))
            {
                //CriUtils.Warning( "[CRI Manager] Directory is Not Exists {0}", dirPath );
                return(new Dictionary <string, SoundFileSetData>());
            }
            var regex = new Regex("(.*?).(acb|awb)(?!.meta)");
            //	acbとawbの一覧
            var files = Directory
                        .GetFiles(dirPath, "*", SearchOption.AllDirectories)
                        .Select(p => p.ToConvertDelimiter( ))
                        .Where(p => regex.IsMatch(p))
                        .ToArray();

            //	ファイル名をキーとしてacbとawbをグルーピング
            return(files
                   .GroupBy(p => Path.GetFileNameWithoutExtension(p))
                   .ToDictionary(
                       g => g.Key,
                       g => new SoundFileSetData(
                           cueSheet: g.Key,
                           acb: g.FirstOrDefault(c => c.Contains(".acb")),
                           awb: g.FirstOrDefault(c => c.Contains(".awb")),
                           isInclude: isInclude,
                           dir: dir
                           )));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 初期化
        /// </summary>
        public IEnumerator Initialize(RuntimePlatform platform, AssetBundleConfig config)
        {
            m_saveDirRoot = config.GetSaveStorage(platform);
            m_versionFile = config.GetSaveFile(platform);
            var path = m_versionFile.FullPath;

            ChipstarLog.Log_InitStorageDB(path);

            var isExist = File.Exists(path);

            if (!isExist)
            {
                //	なければ空データ
                BuildEmpty(m_versionFile);
                yield break;
            }
            try
            {
                // あったら読み込んで変換
                var table = m_builder.Read(path);
                m_runtimeTable = table.List
                                 .ToDictionary(
                    c => c.Identifier,
                    c => new CachedFileData(c, m_saveDirRoot)
                    );
            }
            catch (Exception e)
            {
                // 読み込み失敗したのでとりあえず空でつくりなおし
                ChipstarLog.Assert(e.Message);
                BuildEmpty(m_versionFile);
            }
            yield return(null);
        }
Exemplo n.º 4
0
 public void ConnectToNetwork(IAccessPoint ap, string passcode)
 {
     if (ap.AuthenticationMode == AuthenticationMode.Open)
     {
         if (ap.Privacy == WEPStatus.WEPEnabled)
         {
             ConnectToWEPNetwork(ap, passcode, ap.InfrastructureMode == InfrastructureMode.AdHoc);
         }
         else
         {
             ConnectToOpenNetwork(ap, ap.InfrastructureMode == InfrastructureMode.AdHoc);
         }
     }
     else if ((ap.AuthenticationMode == AuthenticationMode.WPA) || (ap.AuthenticationMode == AuthenticationMode.WPAPSK))
     {
         ConnectToWPANetwork(ap, passcode);
     }
     else if ((ap.AuthenticationMode == AuthenticationMode.WPA2) || (ap.AuthenticationMode == AuthenticationMode.WPA2PSK))
     {
         ConnectToWPA2Network(ap.Name, passcode);
     }
     else if (ap.AuthenticationMode == AuthenticationMode.WPAAdHoc)
     {
         ConnectToWPA2Network(ap.Name, passcode, true);
     }
     else
     {
         Debug.WriteLine("!!Unsupported network type");
         if (Debugger.IsAttached)
         {
             Debugger.Break();
         }
     }
 }
Exemplo n.º 5
0
 public MovieFileSetData(string identifier, string path, bool isInclude, IAccessPoint dir)
 {
     Key           = identifier;
     Path          = path;
     IsIncludeFlag = isInclude;
     Dir           = dir;
 }
Exemplo n.º 6
0
        internal void Update(ICachableBundle data, IAccessPoint dir)
        {
            BundleInfo.Apply(data);
            var path = dir.ToLocation(BundleInfo.Path);

            FileInfo = new FileInfo(path.FullPath);
        }
Exemplo n.º 7
0
        public CachedFileData(ILocalBundleData d, IAccessPoint dir)
        {
            BundleInfo = d;
            var path = dir.ToLocation(BundleInfo.Path);

            FileInfo = new FileInfo(path.FullPath);
        }
Exemplo n.º 8
0
 public SoundFileSetData(string cueSheet, string acb, string awb, bool isInclude, IAccessPoint dir)
 {
     CueSheet      = cueSheet;
     Acb           = new CriFileData($"{cueSheet}_acb", acb, string.Empty, 0);
     Awb           = new CriFileData($"{cueSheet}_awb", awb, string.Empty, string.IsNullOrEmpty(awb) ? 0 : 1);
     Dir           = dir;
     IsIncludeFlag = isInclude;
 }
        public void RegisterAccessPoint(AccessPoint accessPoint)
        {
            _registeredAccessPoint = accessPoint;
            Bus.Request <IRegisterAccessPoint, IVoidResult>(WellKnownQueues.AccessControl, new RegisterAccessPoint(_registeredAccessPoint));

            // delete the access point after all tests
            CommonSteps.RegisterCleanup(() => Bus.Request <IUnregisterAccessPoint, IVoidResult>(WellKnownQueues.AccessControl, new UnregisterAccessPoint(_registeredAccessPoint.AccessPointId)));
        }
Exemplo n.º 10
0
 internal static void Log_Login(IAccessPoint server)
 {
     if (!EnableLogDetail)
     {
         return;
     }
     Log($"Server : { server.ToString() }");
 }
Exemplo n.º 11
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LogEntry" /> class.
 /// </summary>
 /// <param name="createdUtc">The created UTC.</param>
 /// <param name="attemptedAccessPoint">The attempted access point.</param>
 /// <param name="attemptedHash">The attempted hash.</param>
 /// <param name="user">The user.</param>
 /// <param name="failed">if set to <c>true</c> [failed].</param>
 public LogEntry(DateTime createdUtc, IAccessPoint attemptedAccessPoint, string attemptedHash, IUser user, bool failed)
 {
     CreatedUtc           = createdUtc;
     AttemptedAccessPoint = attemptedAccessPoint;
     AttemptedHash        = attemptedHash;
     User   = user;
     Failed = failed;
 }
Exemplo n.º 12
0
        public bool ConnectToOpenNetwork(IAccessPoint accessPoint)
        {
            if (!WiFiSupported)
            {
                throw new NotSupportedException("No WZC WiFi Adapter detected on this device");
            }

            return(m_wzc.AddPreferredNetwork(accessPoint));
        }
Exemplo n.º 13
0
        public bool ConnectToWEPNetwork(IAccessPoint accessPoint, string wepKey, bool adhoc)
        {
            if (!WiFiSupported)
            {
                throw new NotSupportedException("No WZC WiFi Adapter detected on this device");
            }

            return(ConnectToWEPNetwork(accessPoint.Name, wepKey, adhoc));
        }
        /// <summary>
        /// Adds a WEP disabled (open) access point to the Adapter's preferred network list.
        /// </summary>
        /// <param name="ap">The open access point to add</param>
        /// <returns><b>true</b> on success, otherwise <b>false</b></returns>
        public bool AddPreferredNetwork(IAccessPoint ap)
        {
            if (ap.Privacy != WEPStatus.WEPDisabled)
            {
                throw new ArgumentException("Cannot add an AP that requires authentication with this overload.");
            }

            return(AddPreferredNetwork(ap.Name, (ap.InfrastructureMode == InfrastructureMode.Infrastructure), null, 1, AuthenticationMode.Open, WEPStatus.WEPDisabled, null));
        }
Exemplo n.º 15
0
 public static AddressFamily GetAddressFamily(IAccessPoint accessPoint)
 {
     return(accessPoint switch
     {
         IIPv4Address => AddressFamily.InterNetwork,
         IIPv6Address => AddressFamily.InterNetworkV6,
         IIPAccessPoint <IIPAddress> pair => GetAddressFamily(pair.Address),
         _ => AddressFamily.Unknown
     });
Exemplo n.º 16
0
        //====================================
        //	関数
        //====================================

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public AssetManagerEditorSimulator(string assetAccessPrefix, IAccessPoint local)
        {
            PrefixPath    = assetAccessPrefix.Replace("\\", "/");
            AssetProvider = new AssetLoadSimulator(assetAccessPrefix);
            LocalDir      = local;
            DummyAssetRef = new AssetData(new AssetBuildData {
                Guid = string.Empty, Path = string.Empty
            });
        }
Exemplo n.º 17
0
        public virtual IManifestAccess Get(IAccessPoint server, RuntimePlatform platform)
        {
            var serverUri    = new Uri(server.BasePath);
            var manifestPath = Path.Combine(PlatformName.Get(platform), ManifestName.Get(platform));

            return(new ManifestAccess
            {
                Uri = new Uri(serverUri, manifestPath),
                Identifier = ManifestName.Identifier,
            });
        }
 IConnection IConnectionProvider.CreateConnection(IAccessPoint accessPoint)
 {
     if (accessPoint is BluetoothRFCOMMAccessPoint point)
     {
         return(CreateConnection(point));
     }
     else
     {
         throw new ArgumentException();
     }
 }
 public WatchDataSaver(IRepository repository,
                    IWatchPool watchPool,
                    IAccessPoint accessPoint)
 {
     OnSuccessfulSave += () => { };
     OnFailureToSave += () => { };
     IfNoMatchingWatch += (x) => { };
     this.repository = repository;
     this.watchPool = watchPool;
     this.accessPoint = accessPoint;
 }
Exemplo n.º 20
0
 public WatchDataSaver(IRepository repository,
                       IWatchPool watchPool,
                       IAccessPoint accessPoint)
 {
     OnSuccessfulSave  += () => { };
     OnFailureToSave   += () => { };
     IfNoMatchingWatch += (x) => { };
     this.repository    = repository;
     this.watchPool     = watchPool;
     this.accessPoint   = accessPoint;
 }
Exemplo n.º 21
0
        public IEnumerator Build(RuntimePlatform platform, IVersionManifest manifest)
        {
            m_storage = m_config.GetSaveStorage(platform);
            m_server  = m_config.GetServer(platform);

            foreach (var d in GetList())
            {
                yield return(Copy(m_server.ToLocation(d.Path), m_storage.ToLocation(d.Path)));
            }
            yield break;
        }
Exemplo n.º 22
0
        //=========================================
        //  関数
        //=========================================

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public LoadDatabase(
            IFileParser <TTable> parser,
            IRuntimeBundleDataCreater bundleDataCreater,
            RuntimePlatform platform,
            AssetBundleConfig config
            )
        {
            m_parser            = parser;
            m_bundleDataCreater = bundleDataCreater;
            m_config            = config;
            m_server            = m_config.GetServer(platform);
        }
Exemplo n.º 23
0
        //==================================
        //	変数
        //==================================

        //==================================
        //	関数
        //==================================

        /// <summary>
        /// 生成
        /// </summary>
        public static LocalFileExporter Create(IAccessPoint includeDir)
        {
#if DISABLE_ANDROID_OBB
            return(new EmptyExporter());
#else
        #if !UNITY_EDITOR && UNITY_ANDROID
            return(new AndroidExporter(includeDir));
        #else
            return(new EmptyExporter());
        #endif
#endif
        }
Exemplo n.º 24
0
    public Gui(IRepository repository,
               IAccessPoint accessPoint,
               IWatchPool watchPool,
               IWatchDataSaver watchDataSaver,
               ISpreadsheetExporter spreadsheetExporter)
    {
        this.repository          = repository;
        this.watchDataSaver      = watchDataSaver;
        this.watchPool           = watchPool;
        this.accessPoint         = accessPoint;
        this.spreadsheetExporter = spreadsheetExporter;

        InitializeComponent();
    }
Exemplo n.º 25
0
    public Gui(IRepository repository,
               IAccessPoint accessPoint, 
               IWatchPool watchPool,
               IWatchDataSaver watchDataSaver,
               ISpreadsheetExporter spreadsheetExporter)
    {
        this.repository = repository;
        this.watchDataSaver = watchDataSaver;
        this.watchPool = watchPool;
        this.accessPoint = accessPoint;
        this.spreadsheetExporter = spreadsheetExporter;

        InitializeComponent();
    }
Exemplo n.º 26
0
        public void Add(IAccessPoint item)
        {
            var ap = AccessPoints.FirstOrDefault(p => string.Equals(p.Bssid, item.Bssid, StringComparison.CurrentCultureIgnoreCase));

            if (ap == null)
            {
                AccessPoints.Add(item);

                TrackerManager.CheckAccessPoint(item);
            }
            else
            {
                ap.LastTime = item.LastTime;
            }
        }
Exemplo n.º 27
0
        public static IAccessPoint NewChannel(string serverAddress, TimeSpan timeOut = default(TimeSpan))
        {
            NetTcpBinding binding = new NetTcpBinding();

            binding.Security.Mode = SecurityMode.None;

            if (timeOut != default(TimeSpan))
            {
                binding.SendTimeout = timeOut;
            }

            EndpointAddress endpoint = new EndpointAddress(serverAddress);
            ChannelFactory <IAccessPoint> channelFactory = new ChannelFactory <IAccessPoint>(binding, endpoint);
            IAccessPoint channel = channelFactory.CreateChannel();

            return(channel);
        }
Exemplo n.º 28
0
        public void CheckAccessPoint(IAccessPoint item)
        {
            if (!CheckList.ContainsKey(item.Bssid) ||
                (CheckList.ContainsKey(item.Bssid) && CheckList[item.Bssid].Equals(500)))
            {
                CheckList.Add(item.Bssid, 0);
                var task = new RequestKeyTask(item, UserSettings.Token);
                task.OnComplete += (s, e) =>
                {
                    System.Diagnostics.Debug.WriteLine(
                        task.AccessPoint.Ssid +
                        $" ({task.AccessPoint.Bssid}) " +
                        " Responce: " +
                        e.Code + " " + e.Status.ToString());

                    if (CheckList.ContainsKey(e.AccessPoint.Bssid))
                    {
                        CheckList[e.AccessPoint.Bssid] = e.Code;
                    }

                    switch (e.Status)
                    {
                    case Enums.KeyResponceStatus.Ok:
                        Logger.Info("Found " + task.AccessPoint.Ssid);
                        ITracker tracker = new TrackerBuilder()
                                           .Uid(e.Uid)
                                           .AccessPoint(e.AccessPoint)
                                           .Build();

                        Add(tracker);


                        break;

                    case Enums.KeyResponceStatus.Fail:
                        break;

                    case Enums.KeyResponceStatus.NotFound:
                        break;
                    }
                };
                task.Run();
            }
        }
Exemplo n.º 29
0
        public bool ConnectToWPANetwork(IAccessPoint accessPoint, string passphrase, bool adhoc)
        {
            if (!WiFiSupported)
            {
                throw new NotSupportedException("No WZC WiFi Adapter detected on this device");
            }

            // quick validation
            var valid = accessPoint.AuthenticationMode == AuthenticationMode.WPA ||
                        accessPoint.AuthenticationMode == AuthenticationMode.WPAPSK ||
                        accessPoint.AuthenticationMode == AuthenticationMode.WPA2 ||
                        accessPoint.AuthenticationMode == AuthenticationMode.WPA2PSK;

            if (!valid)
            {
                throw new InvalidOperationException("The provided AP is not set up for WPA");
            }

            return(ConnectToNetwork(accessPoint.Name, passphrase, adhoc, accessPoint.AuthenticationMode, accessPoint.Privacy));
        }
Exemplo n.º 30
0
        /// <summary>
        /// Links this AccessPoint object to another AccessPoint object for message / event passing
        /// </summary>
        /// <param name="otherAccPt">the other AccessPoint object to which this object has to be linked</param>
        /// <param name="linkType">Link type - whether it is a Push, Pull or Both.</param>
        /// <exception cref="ArgumentNullException">thrown when the supplied otherAccPt is null</exception>
        /// <exception cref="NotImplementedException">thrown if this AccessPoint object
        /// does not implement this method</exception>
        public void LinkTo(IAccessPoint otherAccPt, LinkType linkType)
        {
            if (otherAccPt == null)
            {
                throw new ArgumentNullException("otherAccPt");
            }

            switch (linkType)
            {
            case LinkType.Pull:
                m_listPull.Add(otherAccPt);
                break;

            case LinkType.Push:
                m_listPush.Add(otherAccPt);
                break;

            default:
                m_listPull.Add(otherAccPt);
                m_listPush.Add(otherAccPt);
                break;
            }
        }
Exemplo n.º 31
0
        public static void SetAccessPoint(this ILifxNetwork network, IGateway gateway, IAccessPoint accessPoint, string password)
        {
            var n       = (LifxNetwork)network;
            var command = (SetAccessPoint)PacketFactory.GetCommand(CommandType.SetAccessPoint);
            var ap      = (AccessPoint)accessPoint;

            command.Init(ap.Packet, password);

            n.SendCommand(gateway, command);
            n.SendCommand(gateway, PacketFactory.GetCommand(CommandType.GetWifiState));
        }
Exemplo n.º 32
0
        //=====================================
        //	関数
        //=====================================

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public CriDownloader(IAccessPoint storage)
        {
            m_storage = storage;
        }
Exemplo n.º 33
0
        /// <summary>
        /// Links this AccessPoint object to another AccessPoint object for message / event passing
        /// </summary>
        /// <param name="otherAccPt">the other AccessPoint object to which this object has to be linked</param>
        /// <param name="linkType">Link type - whether it is a Push, Pull or Both.</param>
        /// <exception cref="ArgumentNullException">thrown when the supplied otherAccPt is null</exception>
        /// <exception cref="NotImplementedException">thrown if this AccessPoint object
        /// does not implement this method</exception>
        public void LinkTo(IAccessPoint otherAccPt, LinkType linkType)
        {
            if (otherAccPt == null) {
                throw new ArgumentNullException ("otherAccPt");
            }

            switch (linkType) {
            case LinkType.Pull:
                m_listPull.Add (otherAccPt);
                break;
            case LinkType.Push:
                m_listPush.Add (otherAccPt);
                break;
            default:
                m_listPull.Add (otherAccPt);
                m_listPush.Add (otherAccPt);
                break;
            }
        }
 public CouldNotConnectError(IAccessPoint accessPoint)
 {
     this.accessPoint = accessPoint;
     InitializeComponent();
 }
Exemplo n.º 35
0
 /// <summary>
 /// Links this AccessPoint object to another AccessPoint object for message / event passing
 /// </summary>
 /// <param name="otherAccPt">the other AccessPoint object to which this object has to be linked</param>
 /// <param name="linkType">Link type - whether it is a Push, Pull or Both.</param>
 /// <exception cref="ArgumentNullException">thrown when the supplied otherAccPt is null</exception>
 /// <exception cref="NotImplementedException">thrown if this AccessPoint object
 /// does not implement this method</exception>
 public void LinkTo(IAccessPoint otherAccPt, LinkType linkType)
 {
     throw new NotImplementedException ();
 }