Ejemplo n.º 1
0
Archivo: Main.cs Proyecto: j0nat/JCIW
        /// <summary>
        /// Prepare app from file system. If not present then request download from server.
        /// </summary>
        /// <param name="appInfo"></param>
        public void PrepareAppFile(ModuleInfo appInfo)
        {
            string folder = Path.Combine(Local.Folder, "plugins");

            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }

            if (File.Exists(Path.Combine(Local.Folder, appInfo.Path)))
            {
                // File already exists!

                // Load!
                LoadApp(appInfo.Id, appInfo.Path);
            }
            else
            {
                // File needs to be downloaded
                Networking.Send(PacketName.RequestAppFile.ToString(), appInfo.Id);

                Networking.AppFileEvent += Networking_AppFileEvent;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Send to server.
 /// </summary>
 /// <param name="packetData">The <see cref="PacketData"/>.</param>
 public void Send(PacketData packetData)
 {
     appNetworking.Send(packetData);
 }